|
|
@ -1,11 +1,16 @@ |
|
|
|
package org.nl.wms.sch.task_manage.task.tasks; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.date.DateTime; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.lang.Assert; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.http.HttpRequest; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
import org.nl.common.exception.BadRequestException; |
|
|
@ -13,8 +18,13 @@ import org.nl.system.service.param.ISysParamService; |
|
|
|
import org.nl.system.service.param.dao.Param; |
|
|
|
import org.nl.wms.ext.service.WmsToAcsService; |
|
|
|
import org.nl.wms.ext.service.dto.to.BaseResponse; |
|
|
|
import org.nl.wms.mes.domain.Head; |
|
|
|
import org.nl.wms.mes.domain.QPMES062Request; |
|
|
|
import org.nl.wms.mes.domain.QPMES062RequestBody; |
|
|
|
import org.nl.wms.sch.data.service.dto.MaterialDataDto; |
|
|
|
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.point.service.ISchBasePointService; |
|
|
|
import org.nl.wms.sch.point.service.dao.SchBasePoint; |
|
|
|
import org.nl.wms.sch.task.service.ISchBaseTaskService; |
|
|
@ -32,7 +42,12 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Author: psh |
|
|
@ -179,6 +194,10 @@ public class POINTTask extends AbstractTask { |
|
|
|
if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) { |
|
|
|
throw new BadRequestException("该任务已取消!"); |
|
|
|
} |
|
|
|
// 获取参数
|
|
|
|
JSONObject extGroupData = ObjectUtil.isNotEmpty(taskObj.getExt_group_data()) |
|
|
|
? JSONObject.parseObject(taskObj.getExt_group_data()) |
|
|
|
: null; |
|
|
|
String startPoint = taskObj.getPoint_code1(); // 获取起点
|
|
|
|
String endPoint = taskObj.getPoint_code2(); // 获取终点
|
|
|
|
if(endPoint.startsWith("DKT")){ |
|
|
@ -205,7 +224,11 @@ public class POINTTask extends AbstractTask { |
|
|
|
one.setPoint_code(endPointObj.getPoint_code()); // 当前位置
|
|
|
|
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()); |
|
|
|
//拆包位需解绑组盘记录
|
|
|
|
if(endPointObj.getRegion_code().contains("CB")){ |
|
|
|
one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); |
|
|
|
} |
|
|
|
one.setUpdate_id(GeneralDefinition.ACS_ID); |
|
|
|
one.setUpdate_name(GeneralDefinition.ACS_NAME); |
|
|
|
one.setUpdate_time(DateUtil.now()); |
|
|
@ -222,13 +245,18 @@ public class POINTTask extends AbstractTask { |
|
|
|
one.setPoint_code(endPointObj.getPoint_code()); // 当前位置
|
|
|
|
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()); |
|
|
|
//拆包位需解绑组盘记录
|
|
|
|
if(endPointObj.getRegion_code().contains("CB")){ |
|
|
|
one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); |
|
|
|
} |
|
|
|
one.setUpdate_id(GeneralDefinition.ACS_ID); |
|
|
|
one.setUpdate_name(GeneralDefinition.ACS_NAME); |
|
|
|
one.setUpdate_time(DateUtil.now()); |
|
|
|
vehiclematerialgroupService.updateByJson(one); |
|
|
|
} |
|
|
|
if(endPointObj.getPoint_code().contains("XHW")){ |
|
|
|
//工单出库任务更新工单记录
|
|
|
|
if(endPointObj.getRegion_code().contains("HW")){ |
|
|
|
//pdm_bd_workorder_two任务完成时,status改为3
|
|
|
|
workorderService.update(vehicleCode2,"3"); |
|
|
|
} |
|
|
@ -237,6 +265,9 @@ public class POINTTask extends AbstractTask { |
|
|
|
endPointObj.setIng_task_code(""); |
|
|
|
endPointObj.setVehicle_code(taskObj.getVehicle_code()); |
|
|
|
endPointObj.setVehicle_code2(taskObj.getVehicle_code2()); |
|
|
|
if(extGroupData.containsKey("weight")){ |
|
|
|
endPointObj.setMaterial_weight(extGroupData.getBigDecimal("weight")); |
|
|
|
} |
|
|
|
if(endPointObj.getPoint_code().startsWith("DKT")){ |
|
|
|
//叠盘机数量由acs同步,无需维护
|
|
|
|
// endPointObj.setVehicle_qty(endPointObj.getVehicle_qty()+1);
|
|
|
@ -256,7 +287,8 @@ public class POINTTask extends AbstractTask { |
|
|
|
taskObj.setGroup_id(ObjectUtil.isNotEmpty(one)?one.getGroup_id():null); |
|
|
|
taskObj.setRemark("任务完成"); |
|
|
|
} |
|
|
|
if (status.equals(TaskStatus.CANCELED)) { // 取消
|
|
|
|
// 取消
|
|
|
|
if (status.equals(TaskStatus.CANCELED)) { |
|
|
|
// 终点解锁
|
|
|
|
if (ObjectUtil.isNotEmpty(endPointObj)) { |
|
|
|
endPointObj.setIng_task_code(""); |
|
|
|