From 6884f17f8391689ed12134f9819b557a5c194297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=88=86=E7=B1=B3=E8=8A=B1?= <417727563@qq.com> Date: Thu, 8 Jun 2023 11:22:53 +0800 Subject: [PATCH] 2023-06-08-01-bug --- .../jeecg/modules/hanger/entity/Hanger.java | 5 ++ .../controller/HangerLocationController.java | 16 ++++ .../service/IHangerLocationService.java | 2 + .../impl/HangerLocationServiceImpl.java | 86 ++++++++++++++----- .../service/IHangerMakerService.java | 2 +- .../service/impl/HangerMakerServiceImpl.java | 9 +- 6 files changed, 94 insertions(+), 26 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/Hanger.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/Hanger.java index 98da1c69..0430f53c 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/Hanger.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/Hanger.java @@ -58,4 +58,9 @@ public class Hanger implements Serializable { @Excel(name = "衣架编号", width = 15) @ApiModelProperty(value = "衣架编号") private java.lang.String hangerCode; + + /**衣架状态*/ + @Excel(name = "衣架状态", width = 15) + @ApiModelProperty(value = "衣架状态") + private java.lang.String status; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/controller/HangerLocationController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/controller/HangerLocationController.java index ce98f66f..81c66050 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/controller/HangerLocationController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/controller/HangerLocationController.java @@ -225,4 +225,20 @@ public class HangerLocationController extends JeecgController records(@RequestParam(name="code",required=true) String code,@RequestParam(name="id",required=true) String id) { + hangerLocationService.records(id, code); + return Result.ok("编辑成功!"); + } + } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/IHangerLocationService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/IHangerLocationService.java index 1d15cf40..6dfa6f10 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/IHangerLocationService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/IHangerLocationService.java @@ -18,4 +18,6 @@ public interface IHangerLocationService extends IService { //自动化生产传感器记录 void recordAuto(List woList); + //记录传感器信息 + void records(String id, String code); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/impl/HangerLocationServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/impl/HangerLocationServiceImpl.java index a1bfafd9..b55b2166 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/impl/HangerLocationServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/impl/HangerLocationServiceImpl.java @@ -1,6 +1,7 @@ package org.jeecg.modules.hangerlocation.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import org.jeecg.common.util.XJobUtils; import org.jeecg.modules.demo.productrecord.entity.ProductRecord; import org.jeecg.modules.demo.productrecord.mapper.ProductRecordMapper; @@ -8,6 +9,7 @@ import org.jeecg.modules.demo.sensor.entity.Sensor; import org.jeecg.modules.demo.sensor.mapper.SensorMapper; import org.jeecg.modules.demo.sensorrecord.entity.SensorRecord; import org.jeecg.modules.demo.sensorrecord.mapper.SensorRecordMapper; +import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; import org.jeecg.modules.hanger.entity.HangRecord; import org.jeecg.modules.hanger.mapper.HangRecordMapper; import org.jeecg.modules.hangerlocation.entity.HangerLocation; @@ -45,7 +47,9 @@ import static org.jeecg.common.util.XJobUtils.dateToLong; public class HangerLocationServiceImpl extends ServiceImpl implements IHangerLocationService { @Autowired private HangerLocationMapper hangerLocationMapper; - + //订单 + @Autowired + private IZyOrdersService zyOrdersService; //工单 @Autowired private WorkOrderMapper workOrderMapper; @@ -103,6 +107,9 @@ public class HangerLocationServiceImpl extends ServiceImpl qws=new QueryWrapper<>(); + List sensorList=sensorMapper.selectList(qws); //1、读取工单,得到生产计划 if(woList.size()<=0) { @@ -110,22 +117,22 @@ public class HangerLocationServiceImpl extends ServiceImpl workList=workOrderMapper.selectBatchIds(woList); - // - List workCodeList=new ArrayList<>(); - for(WorkOrder wk:workList) - { - workCodeList.add(wk.getProductCode()); - } - QueryWrapper qwProduct=new QueryWrapper<>(); - qwProduct.in("product_code",workCodeList); - List productPlanList=zyProductPlanMapper.selectList(qwProduct); - //查找有所传感器 - QueryWrapper qws=new QueryWrapper<>(); - List sensorList=sensorMapper.selectList(qws); - //#region2.遍历生产计划 吊挂(开始+结束)+传感器记录(每个)+生产记录(每个) - for(ZyProductPlan item :productPlanList) + for(WorkOrder wo:workList) { + //根据工单得到生产计划 + QueryWrapper qwProduct=new QueryWrapper<>(); + qwProduct.eq("product_code",wo.getProductCode()); + ZyProductPlan item=zyProductPlanMapper.selectOne(qwProduct); + + //生产计划成产中 + item.setStatus(2); + zyProductPlanMapper.updateById(item); + + //订单生产中 + item.setStatus(2); + workOrderMapper.updateById(wo); + //3、每个生产计划对应工序,每一道工序对应工位 QueryWrapper qwProcess=new QueryWrapper<>(); qwProcess.eq("plan_id",item.getId()); @@ -144,6 +151,8 @@ public class HangerLocationServiceImpl extends ServiceImpl senlist = sensorList.stream() .filter(Sensor -> Sensor.getStationId().equals(process.getStationId())) @@ -231,9 +240,9 @@ public class HangerLocationServiceImpl extends ServiceImpl { //自动衣架绑定工单 - void doAutoHM(List woList); + Boolean doAutoHM(List woList); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangermaker/service/impl/HangerMakerServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangermaker/service/impl/HangerMakerServiceImpl.java index dd38abbe..df9719eb 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangermaker/service/impl/HangerMakerServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangermaker/service/impl/HangerMakerServiceImpl.java @@ -38,12 +38,14 @@ public class HangerMakerServiceImpl extends ServiceImpl woList) { + public Boolean doAutoHM(List woList) { + Boolean flag=false; if(woList.size()<=0) { - return; + return flag; } + QueryWrapper qw=new QueryWrapper<>(); qw.in("id",woList); List workList=workOrderMapper.selectList(qw); @@ -73,9 +75,10 @@ public class HangerMakerServiceImpl extends ServiceImpl