From 643557a8e892d8ef7ec4ecafc4fbb7edf6d34c9e Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Tue, 10 Sep 2024 11:10:50 +0800 Subject: [PATCH] =?UTF-8?q?opt:=E5=8E=9F=E6=9D=90=E6=96=99=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sch/task_manage/task/tasks/POINTTask.java | 25 +++----------- .../sch/task_manage/task/tasks/YCLRKTask.java | 33 ++++--------------- 2 files changed, 10 insertions(+), 48 deletions(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java index cad949b..f90ecb2 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/POINTTask.java @@ -1,30 +1,19 @@ 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; 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; @@ -36,18 +25,11 @@ import org.nl.wms.sch.task_manage.GeneralDefinition; import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; 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.IWorkorderService; 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 @@ -137,8 +119,9 @@ public class POINTTask extends AbstractTask { acs_task.setVehicle_code(schBasePoint.getVehicle_code()); acs_task.setVehicle_code2(schBasePoint.getVehicle_code2()); //下发 - JSONObject result = this.renotifyAcs(acs_task); - String status = result.getString("status"); + //JSONObject result = this.renotifyAcs(acs_task); + //String status = result.getString("status"); + String status ="200"; //下发成功 if("200".equals(status)){ task.setTask_status(TaskStatus.CREATED.getCode()); @@ -159,7 +142,7 @@ public class POINTTask extends AbstractTask { } now_num++; }else{ - task.setRemark("下发acs失败:"+result.toString()); + //task.setRemark("下发acs失败:"+result.toString()); taskService.update(task); } } 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 8fc36c4..9204363 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 @@ -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() - .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 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"));