From 7812f248a27ee08fab39932f64bbcb1d8265da3e Mon Sep 17 00:00:00 2001 From: lgh Date: Wed, 3 Aug 2022 21:16:20 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E8=AE=A2=E5=8D=95=E5=8E=86=E5=8F=B2b?= =?UTF-8?q?ug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/OrderInfoServiceImpl.java | 19 +++++++++++++------ .../mt/wms/empty/task/TaskDistanceUtils.java | 3 +++ .../com/mt/wms/empty/vo/TaskHisQueryVo.java | 6 ++++++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java index f1f6820..b0751b5 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java @@ -14,8 +14,10 @@ import com.mt.wms.core.base.BaseService; import com.mt.wms.core.dal.entity.ApmsCheckResult; import com.mt.wms.core.dal.entity.CurrTaskDet; import com.mt.wms.core.dal.entity.OrderInfo; +import com.mt.wms.core.dal.entity.OrderInfoHis; import com.mt.wms.core.dal.service.ApmsCheckResultServiceBiz; import com.mt.wms.core.dal.service.CommunicationLogServiceBiz; +import com.mt.wms.core.dal.service.OrderInfoHisServiceBiz; import com.mt.wms.core.dal.service.OrderInfoServiceBiz; import com.mt.wms.core.enums.WhetherEnum; import com.mt.wms.core.params.IdParam; @@ -81,6 +83,8 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic ApmsCheckResultServiceBiz apmsCheckResultServiceBiz; @Autowired ApmsController apmsControl; + @Autowired + OrderInfoHisServiceBiz orderInfoHisServiceBiz; private void setCommon(OrderInfo communicationLog) { communicationLog.setValid(WhetherEnum.YES.getValue()); @@ -117,8 +121,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic .orderByDesc(OrderInfo.CREATE_TIME); Page page = orderInfoService.page(new Page<>(param.getCurrent(), param.getSize()), wrapper); PageVo orderInfoVoPageVo = new PageVo<>(page, OrderInfoVo.class); - orderInfoVoPageVo.getRecords().forEach(e -> - { + for (OrderInfoVo e : orderInfoVoPageVo.getRecords()) { R info = getTaskInfoByIdenCardNum(e.getIdenCardNum()); e.setFinishWeight(info.getData().getFinishWeight()); e.setFinishQuantity(info.getData().getFinishQuantity()); @@ -126,15 +129,19 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic e.setWaitQuantity(info.getData().getWaitQuantity()); e.setReProcessQuantity(info.getData().getReProcessQuantity()); e.setReProcessWeight(info.getData().getReProcessWeight()); - e.setSurplusQuantity(e.getQuantity()-e.getFinishQuantity()-e.getWaitQuantity()); - e.setSurplusWeight(e.getWeight()-e.getFinishWeight()-e.getWaitWeight()); + e.setSurplusQuantity(e.getQuantity() - e.getFinishQuantity() - e.getWaitQuantity()); + e.setSurplusWeight(e.getWeight() - e.getFinishWeight() - e.getWaitWeight()); //当完成数量等于总数量且完成重量等于总重量时订单状态置为2 - if (e.getQuantity().equals(e.getFinishQuantity())&&e.getWeight().equals(e.getFinishWeight())){ + if (e.getQuantity().equals(e.getFinishQuantity()) && e.getWeight().equals(e.getFinishWeight())) { OrderInfo orderInfo = orderInfoService.getById(e.getId()); orderInfo.setStatus(2); orderInfoService.updateById(orderInfo); + OrderInfoHis orderInfoHis=new OrderInfoHis(); + BeanUtils.copyProperties(orderInfo, orderInfoHis); + orderInfoHisServiceBiz.save(orderInfoHis); + } - }); + } return successful(orderInfoVoPageVo); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/TaskDistanceUtils.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/TaskDistanceUtils.java index 3d8077d..5671384 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/TaskDistanceUtils.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/TaskDistanceUtils.java @@ -114,6 +114,9 @@ public class TaskDistanceUtils { //小车当前位置、起点、终点,找出最大最小值 Double minDistance=(((rgvCurrPositionstartDistance)?rgvCurrPosition:startDistance)>endDistance)?((rgvCurrPosition>startDistance)?rgvCurrPosition:startDistance):endDistance; + logger.info("min"+minDistance); + logger.info("max"+maxDistance); + logger.info("other"+otherNowPosition); //另一辆小车在在小车路径上比如冲突,不在小车路径上时判定一下安全距离(4米) if (otherNowPosition>=minDistance&&otherNowPosition<=maxDistance){ return true; diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisQueryVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisQueryVo.java index 27a90c2..33dcd67 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisQueryVo.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisQueryVo.java @@ -82,4 +82,10 @@ public class TaskHisQueryVo extends BaseVo implements PageVo.ConvertVo { */ @ApiModelProperty("加工单号") private String sheetNo; + + /** + * 加工单号 + */ + @ApiModelProperty("加工单号") + private Long taskId; }