diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/webservice/WebServiceClient.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/webservice/WebServiceClient.java new file mode 100644 index 0000000..3cbc084 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/webservice/WebServiceClient.java @@ -0,0 +1,20 @@ +package org.nl.wms.mes.webservice; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.ws.client.core.WebServiceTemplate; +import org.springframework.ws.soap.client.core.SoapActionCallback; +import org.springframework.stereotype.Service; +@Service +public class WebServiceClient { + + public void callWebService(Object request,String url) { + String soapAction = ""; + WebServiceTemplate webServiceTemplate = new WebServiceTemplate(); + // 发送 SOAP 请求并获取响应 + Object response = webServiceTemplate.marshalSendAndReceive(url, request, new SoapActionCallback(soapAction)); + + // 处理响应 + System.out.println("Response: " + response); + + // 其他处理: 转对象、转字符串等操作 + } +} \ No newline at end of file diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java index 471b8d1..ac3e72b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java @@ -53,7 +53,7 @@ public class SchBaseVehiclematerialgroup implements Serializable { @ApiModelProperty(value = "批次") private String pcsn; - @ApiModelProperty(value = "入库时间") + @ApiModelProperty(value = "回温开始时间") private String instorage_time; @ApiModelProperty(value = "回温时间(小时)") diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dto/SchBaseVehiclematerialgroupDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dto/SchBaseVehiclematerialgroupDto.java index e0a1a17..28012fb 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dto/SchBaseVehiclematerialgroupDto.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dto/SchBaseVehiclematerialgroupDto.java @@ -39,7 +39,7 @@ public class SchBaseVehiclematerialgroupDto implements Serializable { /** 批次 */ private String pcsn; - /** 入库时间 */ + /** 回温开始时间 */ private String instorage_time; /** 回温时间(小时) */ diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java index e262d1c..59821e7 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/KJRKTask.java @@ -189,7 +189,7 @@ public class KJRKTask extends AbstractTask { groupEntity.setPoint_code(startPoint); groupEntity.setPoint_name(startPointObj.getPoint_name()); groupEntity.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd")); - groupEntity.setInstorage_time(DateUtil.now()); +// groupEntity.setInstorage_time(DateUtil.now()); groupEntity.setTask_code(taskObj.getTask_code()); groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定 groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。 diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java index 205480b..75ce254 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/SSXBKJTask.java @@ -189,7 +189,7 @@ public class SSXBKJTask extends AbstractTask { groupEntity.setPoint_code(startPoint); groupEntity.setPoint_name(startPointObj.getPoint_name()); groupEntity.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd")); - groupEntity.setInstorage_time(DateUtil.now()); +// groupEntity.setInstorage_time(DateUtil.now()); groupEntity.setTask_code(taskObj.getTask_code()); groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定 groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。 diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java index dd9ced1..3849415 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLCKTask.java @@ -10,10 +10,15 @@ import org.nl.common.exception.BadRequestException; import org.nl.config.MapOf; import org.nl.wms.ext.service.WmsToAcsService; import org.nl.wms.ext.service.dto.to.BaseResponse; +import org.nl.wms.mes.domain.QPMES062Request; +import org.nl.wms.mes.domain.QPMES065Request; +import org.nl.wms.mes.webservice.WebServiceClient; import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; +import org.nl.wms.sch.material.service.dao.Material; +import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.task.service.ISchBaseTaskService; @@ -65,7 +70,10 @@ public class YCLCKTask extends AbstractTask { @Autowired private PointMapper pointMapper; @Autowired - private WmsToAcsService wmsToAcsService; + private WebServiceClient webServiceClient; + @Autowired + private MaterialMapper materialMapper; + @Override // @Transactional(rollbackFor = Exception.class) @@ -76,7 +84,17 @@ public class YCLCKTask extends AbstractTask { SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper() .eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE)); for (SchBaseTask task : tasks) { - SchBasePoint point = findNextPoint(task); + JSONObject jsonObject = JSONObject.parseObject(task.getExt_group_data()); + String region; + if ("0".equals(jsonObject.getString("mode"))) { + region = "HW"; + } else if ("1".equals(jsonObject.getString("mode"))) { + region = "HWK"; + } else { + log.error("任务:" + task.getTask_code() + "回温mode:" + jsonObject.getString("mode") + "模式不正确!"); + continue; + } + SchBasePoint point = findNextPoint(task, region); if (ObjectUtil.isEmpty(point)) { task.setRemark("未找到所需点位!"); taskService.update(task); @@ -88,7 +106,7 @@ public class YCLCKTask extends AbstractTask { task.setPoint_code2(point.getPoint_code()); task.setTask_status(TaskStatus.CREATED.getCode()); task.setRemark(""); - SchBasePoint schBasePoint= pointService.getOne(new LambdaQueryWrapper() + SchBasePoint schBasePoint = pointService.getOne(new LambdaQueryWrapper() .eq(SchBasePoint::getPoint_code, task.getPoint_code1())); task.setVehicle_code(schBasePoint.getVehicle_code()); task.setVehicle_code2(schBasePoint.getVehicle_code2()); @@ -106,22 +124,18 @@ public class YCLCKTask extends AbstractTask { } /** - * todo 待确认怎么区分普通回温和快速回温 - * todo 设置回温时间 - * * @return */ - private SchBasePoint findNextPoint(SchBaseTask task) { - String regionCode = "HW"; - List schBasePointList = pointMapper.findPointByRegion(regionCode,"0"); + private SchBasePoint findNextPoint(SchBaseTask task, String regionCode) { + List schBasePointList = pointMapper.findPointByRegion(regionCode, "0"); for (SchBasePoint schBasePoint : schBasePointList) { //已锁定直接返回 - if(task.getTask_code().equals(schBasePoint.getIng_task_code())){ + if (task.getTask_code().equals(schBasePoint.getIng_task_code())) { return schBasePoint; } if (schBasePoint.getIs_used() - && schBasePoint.getVehicle_qty() ==0) { - log.info("原材料出库任务找到当前符合条件的缓存区位置{}",schBasePoint.getPoint_code()); + && schBasePoint.getVehicle_qty() == 0) { + log.info("原材料出库任务找到当前符合条件的缓存区位置{}", schBasePoint.getPoint_code()); return schBasePoint; } } @@ -129,7 +143,7 @@ public class YCLCKTask extends AbstractTask { } /** - * todo 任务完成设置完成时间为开始固化时间 + * 任务完成设置完成时间为开始固化时间 */ @Override // @Transactional(rollbackFor = Exception.class) @@ -152,8 +166,8 @@ public class YCLCKTask extends AbstractTask { taskObj.setRemark("执行中"); } if (status.equals(TaskStatus.FINISHED)) { // 完成 - String vehicleCode=taskObj.getVehicle_code(); - String vehicleCode2= taskObj.getVehicle_code2(); + String vehicleCode = taskObj.getVehicle_code(); + String vehicleCode2 = taskObj.getVehicle_code2(); SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getOne(new LambdaQueryWrapper() .eq(SchBaseVehiclematerialgroup::getVehicle_code, vehicleCode) .eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status, @@ -166,6 +180,7 @@ public class YCLCKTask extends AbstractTask { one.setPoint_name(endPointObj.getPoint_name()); one.setMove_way(one.getMove_way() == null ? "" : (one.getMove_way() + " -> ") + endPointObj.getPoint_code()); one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); + one.setInstorage_time(DateUtil.now()); one.setUpdate_id(GeneralDefinition.ACS_ID); one.setUpdate_name(GeneralDefinition.ACS_NAME); one.setUpdate_time(DateUtil.now()); @@ -183,6 +198,7 @@ public class YCLCKTask extends AbstractTask { one.setPoint_name(endPointObj.getPoint_name()); one.setMove_way(one.getMove_way() == null ? "" : (one.getMove_way() + " -> ") + endPointObj.getPoint_code()); one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); + one.setInstorage_time(DateUtil.now()); one.setUpdate_id(GeneralDefinition.ACS_ID); one.setUpdate_name(GeneralDefinition.ACS_NAME); one.setUpdate_time(DateUtil.now()); @@ -206,9 +222,29 @@ public class YCLCKTask extends AbstractTask { taskObj.setGroup_id(one.getGroup_id()); taskObj.setRemark("任务完成"); try { - //todo 出库成功后上报mes - }catch (Exception e){ - log.error("原材料出库上报MES失败{}",e.getMessage(),e); + //todo 待确认具体传值 + List materialList = materialMapper.selectList(new LambdaQueryWrapper() + .eq(Material::getPalletSN, taskObj.getVehicle_code2()) + .eq(Material::getGroup_bind_material_status, GroupBindMaterialStatusEnum.BOUND.getValue())); + if (ObjectUtil.isNotEmpty(materialList)) { + PdmBdWorkorder pdmBdWorkorder=workorderService.getOne(new LambdaQueryWrapper() + .eq(PdmBdWorkorder::getMaterial_code, materialList.get(0).getProductName())); + String url = "http://11.111.11.111:9556/xxx/ws/powerAlarmWs"; + QPMES065Request qpmes065Request = new QPMES065Request(); + qpmes065Request.setDEST_SYSTEM("1"); + qpmes065Request.setINTF_ID("1"); + qpmes065Request.setSRC_MSGID("1"); + qpmes065Request.setSRC_SYSTEM("1"); + qpmes065Request.setMoname(pdmBdWorkorder.getWorkorder_code()); + qpmes065Request.setLotSN(materialList.get(0).getPalletSN()); + qpmes065Request.setQty(String.valueOf(one.getMaterial_qty())); + qpmes065Request.setSiteName(materialList.get(0).getLocationCode()); + webServiceClient.callWebService(qpmes065Request, url); + } else { + log.error("当前子托盘:" + taskObj.getVehicle_code2() + "不存在未解绑的物料信息,请确认!"); + } + } catch (Exception e) { + log.error("原材料出库上报MES失败{}", e.getMessage(), e); } } if (status.equals(TaskStatus.CANCELED)) { // 取消 @@ -239,7 +275,7 @@ public class YCLCKTask extends AbstractTask { } @Override - protected void feedbackTaskState(JSONObject param,SchBaseTask schBaseTask, BaseResponse result) { + protected void feedbackTaskState(JSONObject param, SchBaseTask schBaseTask, BaseResponse result) { //该场景无需重算等待点 } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java index 06cf6ed..363f657 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/YCLRKTask.java @@ -9,10 +9,14 @@ import lombok.extern.slf4j.Slf4j; import org.nl.common.exception.BadRequestException; import org.nl.wms.ext.service.AcsToWmsService; import org.nl.wms.ext.service.dto.to.BaseResponse; +import org.nl.wms.mes.domain.QPMES062Request; +import org.nl.wms.mes.webservice.WebServiceClient; import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.dao.PdmBdWorkorder; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; +import org.nl.wms.sch.material.service.dao.Material; +import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.task.service.ISchBaseTaskService; @@ -66,7 +70,9 @@ public class YCLRKTask extends AbstractTask { @Autowired private PointMapper pointMapper; @Autowired - private AcsToWmsService acsToWmsService; + private WebServiceClient webServiceClient; + @Autowired + private MaterialMapper materialMapper; @Override // @Transactional(rollbackFor = Exception.class) @@ -186,7 +192,30 @@ public class YCLRKTask extends AbstractTask { taskObj.setGroup_id(groupEntity.getGroup_id()); taskObj.setRemark("任务完成"); try { - //todo 入库成功后上报mes + //todo 待确认具体传值 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(Material::getPalletSN,taskObj.getVehicle_code2()); + wrapper.eq(Material::getGroup_bind_material_status,GroupBindMaterialStatusEnum.BOUND.getValue()); + List materialList= materialMapper.selectList(wrapper); + if(ObjectUtil.isNotEmpty(materialList)) { + String url = "http://11.111.11.111:9556/xxx/ws/powerAlarmWs"; + QPMES062Request qpmes062Request = new QPMES062Request(); + qpmes062Request.setDEST_SYSTEM("1"); + qpmes062Request.setINTF_ID("1"); + qpmes062Request.setSRC_MSGID("1"); + qpmes062Request.setSRC_SYSTEM("1"); + qpmes062Request.setSimtOrderNo(materialList.get(0).getSimtOrderNo()); + qpmes062Request.setLocationCode(materialList.get(0).getLocationCode()); + qpmes062Request.setSimtType(materialList.get(0).getSimtType()); + qpmes062Request.setDeliveryNo(materialList.get(0).getDeliveryNo()); + qpmes062Request.setWhlCode(materialList.get(0).getWhlCode()); + qpmes062Request.setPalletSn(materialList.get(0).getPalletSN()); + qpmes062Request.setUserCode(materialList.get(0).getSupplierCode()); + qpmes062Request.setUserName(materialList.get(0).getSupplierName()); + webServiceClient.callWebService(qpmes062Request, url); + }else{ + log.error("当前子托盘:"+taskObj.getVehicle_code2()+"不存在未解绑的物料信息,请确认!"); + } }catch (Exception e){ log.error("原材料入库上报MES失败{}",e.getMessage(),e); } @@ -225,7 +254,7 @@ public class YCLRKTask extends AbstractTask { groupEntity.setPoint_code(startPoint); groupEntity.setPoint_name(startPointObj.getPoint_name()); groupEntity.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd")); - groupEntity.setInstorage_time(DateUtil.now()); +// groupEntity.setInstorage_time(DateUtil.now()); groupEntity.setTask_code(taskObj.getTask_code()); groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定 groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。 diff --git a/lms/nladmin-ui/src/views/wms/sch/group/index.vue b/lms/nladmin-ui/src/views/wms/sch/group/index.vue index 8d6a4b4..7fe94f1 100644 --- a/lms/nladmin-ui/src/views/wms/sch/group/index.vue +++ b/lms/nladmin-ui/src/views/wms/sch/group/index.vue @@ -86,7 +86,7 @@ 母托盘 - + --> - - + + diff --git a/lms/nladmin-ui/src/views/wms/sch/material/index.vue b/lms/nladmin-ui/src/views/wms/sch/material/index.vue index 3115623..9b406c6 100644 --- a/lms/nladmin-ui/src/views/wms/sch/material/index.vue +++ b/lms/nladmin-ui/src/views/wms/sch/material/index.vue @@ -94,7 +94,7 @@ 母托盘 - + - + diff --git a/lms/nladmin-ui/src/views/wms/sch/point/ViewDialog.vue b/lms/nladmin-ui/src/views/wms/sch/point/ViewDialog.vue index 0b741cc..a9a0944 100644 --- a/lms/nladmin-ui/src/views/wms/sch/point/ViewDialog.vue +++ b/lms/nladmin-ui/src/views/wms/sch/point/ViewDialog.vue @@ -72,7 +72,7 @@ - +