Browse Source

opt:优化手持原材料入库功能、优化点对点搬运任务组盘记录处理逻辑

master
zds 4 months ago
parent
commit
22028e1747
  1. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java
  2. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java
  3. 40
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java

@ -60,7 +60,7 @@ public class PdaController {
region.setVehicle_qty(0); region.setVehicle_qty(0);
} }
} }
if("KJ".equals(whereJson.get("region_code"))){ if("KJ".equals(whereJson.get("region_code")) || "SSX".equals(whereJson.get("region_code"))){
region.setVehicle_qty(null); region.setVehicle_qty(null);
} }
return new ResponseEntity<>(pointService.getPointListByPda(region), HttpStatus.OK); return new ResponseEntity<>(pointService.getPointListByPda(region), HttpStatus.OK);

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java

@ -73,6 +73,7 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV
@Override @Override
public void updateByJson(SchBaseVehiclematerialgroup entity) { public void updateByJson(SchBaseVehiclematerialgroup entity) {
log.info("组盘记录变更updateByJson:"+entity.toString());
//更新 //更新
UpdateWrapper<SchBaseVehiclematerialgroup> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<SchBaseVehiclematerialgroup> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("vehicle_code",entity.getVehicle_code()); updateWrapper.eq("vehicle_code",entity.getVehicle_code());

40
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java

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

Loading…
Cancel
Save