生产订单、发货单同步wms

2024年9月2日13:37:59
This commit is contained in:
xiang2lin 2024-09-02 13:38:16 +08:00
parent ea109c3b39
commit 5c8481ef33
5 changed files with 17 additions and 13 deletions

View File

@ -100,7 +100,7 @@ public class GenericEventConsumer {
//获取用户详情
String userRes = getUserById(String.valueOf(userIds.get(i)));
//保存钉钉用户到mdm
String userMdmRes = createUser(userRes);
String userMdmRes = createUser(userRes,eventType);
}
}else if ("dept".equals(type)){
JSONArray deptIdArr = bizData.getJSONArray("deptId");
@ -153,14 +153,15 @@ public class GenericEventConsumer {
}
//保存用户到mdm
private static String createUser(String userRes) {
private static String createUser(String userRes,String eventType) {
JsonResultEntity jsonResult = JSONObject.parseObject(userRes,JsonResultEntity.class);
if (jsonResult.isFlag()){
shade.com.alibaba.fastjson2.JSONObject attribute = (shade.com.alibaba.fastjson2.JSONObject) jsonResult.getAttribute();
String attrStr = attribute.toString();
OapiV2UserGetResponse rsp = JSONObject.parseObject(attrStr, OapiV2UserGetResponse.class);
if (rsp.isSuccess()){
OapiV2UserGetResponse.UserGetResponse userInfo = rsp.getResult();
String result = attribute.getString("result");
OapiV2UserGetResponse.UserGetResponse userInfo = com.alibaba.fastjson.JSONObject.parseObject(result,OapiV2UserGetResponse.UserGetResponse.class);
//OapiV2UserGetResponse.UserGetResponse userInfo = dingtalkService.getUserById(userIds.getString(i));
Map<String,Object> mdmMap = new LinkedHashMap<>();
mdmMap.put("mdmCode",DDUSERMDMCODE);
@ -175,6 +176,8 @@ public class GenericEventConsumer {
userMap.put("title",userInfo.getTitle());
userMap.put("email",userInfo.getEmail());
userMap.put("org_email",userInfo.getOrgEmail());
userMap.put("event_type",eventType);
userMap.put("dept_id_list",userInfo.getDeptIdList());
if (null != userInfo.getHiredDate()){
userMap.put("hired_date", DateUtil.date(userInfo.getHiredDate()));
}
@ -203,8 +206,6 @@ public class GenericEventConsumer {
JsonResultEntity jsonResult = JSONObject.parseObject(deptRes,JsonResultEntity.class);
if (jsonResult.isFlag()){
shade.com.alibaba.fastjson2.JSONObject attribute = (shade.com.alibaba.fastjson2.JSONObject) jsonResult.getAttribute();
String attrStr = attribute.toString();
OapiV2DepartmentGetResponse rsp = JSONObject.parseObject(attrStr,OapiV2DepartmentGetResponse.class);
String result = attribute.getString("result");
OapiV2DepartmentGetResponse.DeptGetResponse deptInfo = com.alibaba.fastjson.JSONObject.parseObject(result,OapiV2DepartmentGetResponse.DeptGetResponse.class);
//OapiV2DepartmentGetResponse.DeptGetResponse deptInfo = dingtalkService.getDeptById(deptIdArr.getLong(i));

View File

@ -81,7 +81,7 @@ public class DeliveryOrderPluginServiceImpl extends KjsPluginBaseService impleme
DeliveryOrderDTO deliveryOrderDTO = DeliveryMapper.INSTANCE.deliveryEntityToDto(order);
//发货单表体entity转dto
List<DeliveryDetailDTO> deliveryDetailList = DeliveryMapper.INSTANCE.deliveryDetailListToDto(detailList);
deliveryOrderDTO.setItesm(deliveryDetailList);
deliveryOrderDTO.setItems(deliveryDetailList);
String reqParams = JSONObject.toJSONString(deliveryOrderDTO);
logger.info("发货单请求参数:{}",reqParams);
//调用wms接口

View File

@ -51,6 +51,7 @@ public class KjsPluginBaseService {
taskLivingDetailsService.saveLogToFail(taskLivingDetail);
}
}else {
taskLivingDetail.setId(integration_task_living_details_id);
if (flag){
//如果是重试 成功调这个方法
taskLivingDetailsService.saveLogFailToSuccess(taskLivingDetail);

View File

@ -75,8 +75,10 @@ public class MomOrderPluginServiceImpl extends KjsPluginBaseService implements I
//查询生产订单明细表
MomOrderDetailEntity detailEntity = new MomOrderDetailEntity();
detailEntity.setMoId(order.getMoId());
detailEntity.setStartTime(startTime);
detailEntity.setEndTime(endTime);
if (StrUtil.isEmpty(id)){
detailEntity.setStartTime(startTime);
detailEntity.setEndTime(endTime);
}
detailEntity.setDataSourceCode(datasourceCode);
List<MomOrderDetailEntity> detailList = momOrderDetailService.query(detailEntity);
//表头转换dto

View File

@ -47,7 +47,7 @@ public class DeliveryOrderDTO {
private String cmemo;
//子表
@JSONField(ordinal = 12)
private List<DeliveryDetailDTO> itesm;
private List<DeliveryDetailDTO> items;
public String getDlid() {
return dlid;
@ -145,11 +145,11 @@ public class DeliveryOrderDTO {
this.cmemo = cmemo;
}
public List<DeliveryDetailDTO> getItesm() {
return itesm;
public List<DeliveryDetailDTO> getItems() {
return items;
}
public void setItesm(List<DeliveryDetailDTO> itesm) {
this.itesm = itesm;
public void setItems(List<DeliveryDetailDTO> items) {
this.items = items;
}
}