Commit 457dfc40 by root

Merge branch 'bugfix_20231219_weimo_order' into test_branch

parents d172bb92 bc274c67
......@@ -74,6 +74,8 @@ public class MemberOrderHoloBo implements Serializable {
private Long contentMaterialId;
private Long auditMaterialId;
/**
* 分享导购id
*/
......@@ -273,4 +275,12 @@ public class MemberOrderHoloBo implements Serializable {
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public Long getAuditMaterialId() {
return auditMaterialId;
}
public void setAuditMaterialId(Long auditMaterialId) {
this.auditMaterialId = auditMaterialId;
}
}
......@@ -84,7 +84,7 @@ public class MessageConvertHelper {
String orderNumber = cuspJson.getString("order_number");
interactRecordMessageBO.setOrderNumber(orderNumber);
String runningUuid = jsonObject.getString("runningUuid");
String runningUuid = gpJson.getString("runningUuid");
interactRecordMessageBO.setBusinessUUId(runningUuid);
Long lastAccessTime = jsonObject.getLong("server_timestamp");
......
......@@ -14,6 +14,9 @@ import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.DateUtil;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.enterprise.api.constant.EnterpriseServiceEnum;
import com.gic.enterprise.api.dto.enterprise.EnterpriseUsingStatusDTO;
import com.gic.enterprise.api.service.EnterpriseUseForbidService;
import com.gic.haoban.manage.api.dto.content.log.TriggerCustomerDetailLogDTO;
import com.gic.haoban.manage.api.dto.content.report.MaterialReportDTO;
import com.gic.haoban.manage.api.enums.content.MaterialReportType;
......@@ -55,6 +58,7 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
......@@ -89,6 +93,9 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
@Autowired
private MaterialDataAdaptor materialDataAdaptor;
@Autowired
EnterpriseUseForbidService enterpriseUseForbidService;
@Override
public ServiceResponse<Void> groupMsgTaskJob(String params) {
log.info("执行触达客户定时任务 {}", DateUtil.datetimeToString(new Date()));
......@@ -324,6 +331,17 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
return ServiceResponse.success();
}
String enterpriseId = memberOrderBo.getEnterpriseId();
ServiceResponse<List<EnterpriseUsingStatusDTO>> tempServiceResponse = enterpriseUseForbidService.getUseEnterpriseByCode(EnterpriseServiceEnum.CONTENT.getRightMenuCode(), enterpriseId);
if (!tempServiceResponse.isSuccess() || CollectionUtils.isEmpty(tempServiceResponse.getResult())) {
log.info("企业 {} 没有内容权限 {}", enterpriseId, JSON.toJSONString(tempServiceResponse));
return ServiceResponse.success();
}
EnterpriseUsingStatusDTO enterpriseUsingStatusDTO = tempServiceResponse.getResult().get(0);
if (!Boolean.TRUE.equals(enterpriseUsingStatusDTO.getVaild())) {
log.info("企业 {} 内容权限已失效 {}", enterpriseId, JSON.toJSONString(tempServiceResponse));
return ServiceResponse.success();
}
// 订单纬度
MemberOrderHoloBo orderHoloBo = new MemberOrderHoloBo();
// 订单项纬度
......@@ -356,16 +374,22 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
log.error("recordMemberOrderForData 数仓数据源链接异常, 请检查!!!!{}", JSON.toJSONString(orderConvertBos));
return ServiceResponse.success();
}
TableSchema tableSchema = client.getTableSchema("tab_gic_cms_order");
SerializeConfig serializeConfig = new SerializeConfig();
serializeConfig.setPropertyNamingStrategy(PropertyNamingStrategy.SnakeCase);
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(orderHoloBo, serializeConfig));
Put temp = new Put(tableSchema);
for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
temp.setObject(entry.getKey(), entry.getValue());
if (Objects.nonNull(orderHoloBo.getContentMaterialId())) {
TableSchema tableSchema = client.getTableSchema("tab_gic_cms_order");
Put temp = new Put(tableSchema);
for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
temp.setObject(entry.getKey(), entry.getValue());
}
client.put(Collections.singletonList(temp));
}
client.put(Collections.singletonList(temp));
orderItemHoloBos = orderItemHoloBos
.stream()
.filter(item -> Objects.nonNull(item.getContentMaterialId()))
.collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(orderItemHoloBos)) {
TableSchema cmsOrderItem = client.getTableSchema("tab_gic_cms_order_item");
List<Put> puts = orderItemHoloBos.stream()
......@@ -397,7 +421,11 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
orderHoloBo.setPaidAmount(BigDecimal.valueOf(orderDTO.getPaidAmount()));
orderHoloBo.setPayAmount(BigDecimal.valueOf(orderDTO.getPayAmount()));
orderHoloBo.setReceiptsDate(DateUtil.dateToStr(orderDTO.getOrderTime(), DateUtil.FORMAT_DATETIME_19));
orderHoloBo.setPayTime(DateUtil.dateToStr(orderDTO.getOrderTime(), DateUtil.FORMAT_DATETIME_19));
orderHoloBo.setChannelCode(orderDTO.getChannelCode());
if (StringUtils.isBlank(orderHoloBo.getChannelCode())) {
orderHoloBo.setChannelCode(MemberOrderBo.weimo);
}
orderHoloBo.setClerkId(orderDTO.getClerkId());
orderHoloBo.setClerkCode(orderDTO.getClerkCode());
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(orderDTO.getClerkId());
......@@ -465,7 +493,14 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
orderHoloBo.setPaidAmount(BigDecimal.valueOf(eorderDTO.getTotalAmount()));
orderHoloBo.setPayAmount(BigDecimal.valueOf(eorderDTO.getPaymentAmount()));
orderHoloBo.setReceiptsDate(DateUtil.dateToStr(eorderDTO.getOrderCreateTime(), DateUtil.FORMAT_DATETIME_19));
orderHoloBo.setPayTime(DateUtil.dateToStr(eorderDTO.getOrderCreateTime(), DateUtil.FORMAT_DATETIME_19));
if (eorderDTO.getPayTime() != null) {
orderHoloBo.setPayTime(DateUtil.dateToStr(eorderDTO.getPayTime(), DateUtil.FORMAT_DATETIME_19));
}
orderHoloBo.setChannelCode(eorderDTO.getChannelCode());
if (StringUtils.isBlank(orderHoloBo.getChannelCode())) {
orderHoloBo.setChannelCode(MemberOrderBo.weimo);
}
orderHoloBo.setClerkId(eorderDTO.getClerkId());
orderHoloBo.setClerkCode(eorderDTO.getClerkCode());
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(eorderDTO.getClerkId());
......@@ -482,6 +517,8 @@ public class QywxGroupMsgTaskApiServiceImpl implements QywxGroupMsgTaskApiServic
MaterialDataAdaptor.MaterialBizInfo materialBizInfo = materialDataAdaptor.queryMaterialBizInfo(eorderDTO.getEnterpriseId(), eorderDTO.getMemberId(), eorderDTO.getOrderCreateTime(), null);
if (materialBizInfo != null) {
orderHoloBo.setContentMaterialId(Long.parseLong(materialBizInfo.getBizId()));
Long materialBaseId = materialDataAdaptor.queryMaterialBaseId(eorderDTO.getEnterpriseId(), orderHoloBo.getContentMaterialId());
orderHoloBo.setAuditMaterialId(materialBaseId);
orderHoloBo.setShareClerkId(materialBizInfo.getClerkId());
orderHoloBo.setShareStoreId(materialBizInfo.getStoreId());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment