|
|
@ -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<SchBaseTaskconfig>() |
|
|
|
.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); |
|
|
@ -106,13 +124,9 @@ public class YCLCKTask extends AbstractTask { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* todo 待确认怎么区分普通回温和快速回温 |
|
|
|
* todo 设置回温时间 |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private SchBasePoint findNextPoint(SchBaseTask task) { |
|
|
|
String regionCode = "HW"; |
|
|
|
private SchBasePoint findNextPoint(SchBaseTask task, String regionCode) { |
|
|
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "0"); |
|
|
|
for (SchBasePoint schBasePoint : schBasePointList) { |
|
|
|
//已锁定直接返回
|
|
|
@ -129,7 +143,7 @@ public class YCLCKTask extends AbstractTask { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* todo 任务完成设置完成时间为开始固化时间 |
|
|
|
* 任务完成设置完成时间为开始固化时间 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
// @Transactional(rollbackFor = Exception.class)
|
|
|
@ -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,7 +222,27 @@ public class YCLCKTask extends AbstractTask { |
|
|
|
taskObj.setGroup_id(one.getGroup_id()); |
|
|
|
taskObj.setRemark("任务完成"); |
|
|
|
try { |
|
|
|
//todo 出库成功后上报mes
|
|
|
|
//todo 待确认具体传值
|
|
|
|
List<Material> materialList = materialMapper.selectList(new LambdaQueryWrapper<Material>() |
|
|
|
.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<PdmBdWorkorder>() |
|
|
|
.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); |
|
|
|
} |
|
|
|