|
|
@ -3,7 +3,6 @@ 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; |
|
|
@ -11,16 +10,13 @@ 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 com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.nl.common.exception.BadRequestException; |
|
|
|
import org.nl.system.service.param.dao.Param; |
|
|
|
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.pdm.service.IPdmBdWorkorderService; |
|
|
|
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; |
|
|
|
import org.nl.wms.sch.data.service.dao.mapper.MaterialDataMapper; |
|
|
|
import org.nl.wms.sch.data.service.dto.MaterialDataDto; |
|
|
|
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; |
|
|
@ -34,13 +30,11 @@ import org.nl.wms.sch.task.service.ISchBaseTaskconfigService; |
|
|
|
import org.nl.wms.sch.task.service.dao.SchBaseTask; |
|
|
|
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig; |
|
|
|
import org.nl.wms.sch.task_manage.AbstractTask; |
|
|
|
import org.nl.wms.sch.task_manage.GeneralDefinition; |
|
|
|
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; |
|
|
|
import org.nl.wms.sch.task_manage.enums.GroupStatusEnum; |
|
|
|
import org.nl.wms.sch.task_manage.task.TaskType; |
|
|
|
import org.nl.wms.sch.task_manage.task.core.TaskStatus; |
|
|
|
import org.nl.wms.sch.task_manage.task.tasks.mapper.PointMapper; |
|
|
|
import org.nl.wms.sch.workorder.service.dao.Workorder; |
|
|
|
import org.nl.wms.util.PointUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
@ -210,13 +204,6 @@ public class YCLRKTask extends AbstractTask { |
|
|
|
JSONObject extGroupData = ObjectUtil.isNotEmpty(taskObj.getExt_group_data()) |
|
|
|
? JSONObject.parseObject(taskObj.getExt_group_data()) |
|
|
|
: null; |
|
|
|
PdmBdWorkorder workorderCode = null; |
|
|
|
if (extGroupData != null) { |
|
|
|
workorderCode = ObjectUtil.isNotEmpty(extGroupData.getString("workorder_code")) |
|
|
|
? workorderService.getOne(new LambdaQueryWrapper<PdmBdWorkorder>() |
|
|
|
.eq(PdmBdWorkorder::getWorkorder_code, extGroupData.getString("workorder_code"))) |
|
|
|
: null; |
|
|
|
} |
|
|
|
String startPoint = taskObj.getPoint_code1(); // 获取起点
|
|
|
|
String endPoint = taskObj.getPoint_code2(); // 获取终点
|
|
|
|
SchBasePoint startPointObj = pointService.getById(startPoint); |
|
|
@ -248,7 +235,7 @@ public class YCLRKTask extends AbstractTask { |
|
|
|
//回传状态为0的
|
|
|
|
wrapper.eq(Material::getReturn_status,"0"); |
|
|
|
List<Material> materialList= materialMapper.selectList(wrapper); |
|
|
|
SchBaseVehiclematerialgroup groupEntity = getSchBaseVehiclematerialgroup(taskObj, extGroupData, workorderCode, endPoint, endPointObj); |
|
|
|
SchBaseVehiclematerialgroup groupEntity = getSchBaseVehiclematerialgroup(taskObj, endPoint, endPointObj); |
|
|
|
groupEntity.setVehicle_code(taskObj.getVehicle_code()); |
|
|
|
groupEntity.setVehicle_type("0"); |
|
|
|
groupEntity.setMaterial_weight(extGroupData.getBigDecimal("weight")); |
|
|
@ -365,25 +352,17 @@ public class YCLRKTask extends AbstractTask { |
|
|
|
taskService.update(taskObj); |
|
|
|
} |
|
|
|
|
|
|
|
private static SchBaseVehiclematerialgroup getSchBaseVehiclematerialgroup(SchBaseTask taskObj, JSONObject extGroupData, PdmBdWorkorder workorderCode, String startPoint, SchBasePoint startPointObj) { |
|
|
|
private static SchBaseVehiclematerialgroup getSchBaseVehiclematerialgroup(SchBaseTask taskObj, String startPoint, SchBasePoint startPointObj) { |
|
|
|
SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup(); |
|
|
|
groupEntity.setGroup_id(IdUtil.getSnowflake(1, 1).nextIdStr()); |
|
|
|
groupEntity.setCreate_id("2"); |
|
|
|
groupEntity.setCreate_name("ACS"); |
|
|
|
groupEntity.setCreate_time(DateUtil.now()); |
|
|
|
groupEntity.setUpdate_time(DateUtil.now()); |
|
|
|
groupEntity.setMaterial_id(ObjectUtil.isNotEmpty(workorderCode) |
|
|
|
? workorderCode.getMaterial_id() |
|
|
|
: ""); |
|
|
|
groupEntity.setStanding_time(ObjectUtil.isNotEmpty(workorderCode) |
|
|
|
? workorderCode.getStanding_time() |
|
|
|
: 0); |
|
|
|
groupEntity.setMaterial_weight(ObjectUtil.isNotEmpty(extGroupData) |
|
|
|
? extGroupData.getBigDecimal("material_qty") |
|
|
|
: BigDecimal.valueOf(0)); |
|
|
|
groupEntity.setWorkorder_code(ObjectUtil.isNotEmpty(workorderCode) |
|
|
|
? workorderCode.getWorkorder_code() |
|
|
|
: ""); |
|
|
|
groupEntity.setMaterial_id(""); |
|
|
|
groupEntity.setStanding_time(0); |
|
|
|
groupEntity.setMaterial_weight(BigDecimal.valueOf(0)); |
|
|
|
groupEntity.setWorkorder_code(""); |
|
|
|
groupEntity.setPoint_code(startPoint); |
|
|
|
groupEntity.setPoint_name(startPointObj.getPoint_name()); |
|
|
|
// groupEntity.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd"));
|
|
|
|