From 7b8ab735139b2a138adabe94082255e8bcd88257 Mon Sep 17 00:00:00 2001 From: psh Date: Tue, 9 Apr 2024 16:06:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B7=A5=E5=8D=95=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=89=B9=E9=87=8F=E9=80=89=E6=8B=A9=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E7=89=A9=E6=96=99=E8=BF=9B=E8=A1=8C=E5=87=BA=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StandardAutodoorDeviceDriver.java | 4 +- .../nl/wms/mes/controller/MesController.java | 8 ++++ .../mes/domain/QPMES098RequestBodyItem2.java | 15 +++++++ .../PdmBdWorkorderDetailController.java | 45 ++++--------------- .../pdm/controller/PointDetailController.java | 41 ++++++++++------- .../pdm/service/IPdmBdWorkorderService.java | 12 +++++ .../pdm/service/dao/PdmBdWorkorderDetail.java | 45 +++++-------------- .../nl/wms/pdm/service/dao/PointDetail.java | 11 ++++- .../wms/pdm/service/dao/PointDetailAdd.java | 12 ++--- 9 files changed, 100 insertions(+), 93 deletions(-) diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutodoorDeviceDriver.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutodoorDeviceDriver.java index 750d85d..6f3b011 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutodoorDeviceDriver.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/StandardAutodoorDeviceDriver.java @@ -68,7 +68,9 @@ public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implem } if (close != last_close) { logServer.deviceExecuteLog(this.device_code, "", "", "信号close:" + last_close + "->" + close); - + if(close ==1 ){ + this.writing("to_close","0"); + } } if (toClose != last_toClose) { logServer.deviceExecuteLog(this.device_code, "", "", "信号toClose:" + last_toClose + "->" + toClose); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java index f3bf969..e69db1d 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java @@ -13,6 +13,7 @@ import org.nl.common.logging.annotation.Log; import org.nl.wms.mes.domain.*; import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.dao.PdmBdWorkorder; +import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail; import org.nl.wms.sch.material.service.dao.Material; import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; @@ -108,6 +109,13 @@ public class MesController { entity.setCreate_name("MES"); entity.setCreate_time(DateUtil.now()); pdmBdWorkorderService.create(entity); + for(QPMES098RequestBodyItem2 qpmes098RequestBodyItem2:qpmes098Request.getBODY().get(0).getITEM2()){ + PdmBdWorkorderDetail pdmBdWorkorderDetail=new PdmBdWorkorderDetail(); + pdmBdWorkorderDetail.setReal_qty(BigDecimal.valueOf(0)); + pdmBdWorkorderDetail.setWorkorder_code(entity.getWorkorder_code()); + pdmBdWorkorderDetail.copyFrom(qpmes098RequestBodyItem2); + pdmBdWorkorderService.createDetail(pdmBdWorkorderDetail); + } qpmes098ResponseBody.setMESSAGE("工单下发成功"); qpmes098ResponseBody.setSTATUS("S"); qpmes098ResponseBody.setFKEY_VALUE01(qpmes098Request.getBODY().get(0).getAUFNR()); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES098RequestBodyItem2.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES098RequestBodyItem2.java index b48ac9b..ba4ed14 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES098RequestBodyItem2.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES098RequestBodyItem2.java @@ -4,19 +4,34 @@ import lombok.Data; @Data public class QPMES098RequestBodyItem2 { + /** 订单行项目编号 **/ private String POSNR; + /** 预留行项目编号 **/ private String RSPOS; + /** 移动类型 **/ private String BWART; + /** 物料编码 **/ private String MATNR; + /** 物料名称 **/ private String MAKTX; + /** 产品类别 **/ private String MTYPE; + /** 产品类别描述 **/ private String MTYTXT; + /** 数量 **/ private String BDMNG; + /** 计量单位 **/ private String MEINS; + /** 物料供应标识 **/ private String BEIKZ; + /** 预留字段11 **/ private String ZRSV11; + /** 预留字段12 **/ private String ZRSV12; + /** 预留字段13 **/ private String ZRSV13; + /** 预留字段14 **/ private String ZRSV14; + /** 预留字段15 **/ private String ZRSV15; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PdmBdWorkorderDetailController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PdmBdWorkorderDetailController.java index a603c79..6de1df6 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PdmBdWorkorderDetailController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PdmBdWorkorderDetailController.java @@ -8,6 +8,7 @@ import org.nl.common.domain.query.PageQuery; import org.nl.common.logging.annotation.Log; import org.nl.wms.pdm.service.IPdmBdWorkorderService; import org.nl.wms.pdm.service.dao.PdmBdWorkorder; +import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail; import org.nl.wms.pdm.service.dto.PdmBdWorkorderQuery; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -16,51 +17,23 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.Set; -/** -* @author lyd -* @date 2023-05-05 -**/ + + @Slf4j @RestController -@Api(tags = "工单管理管理") -@RequestMapping("/api/pdmBdWorkorder") -public class PdmBdWorkorderController { +@Api(tags = "工单详情管理") +@RequestMapping("/api/pdmBdWorkorderDetail") +public class PdmBdWorkorderDetailController { @Autowired private IPdmBdWorkorderService pdmBdWorkorderService; @GetMapping - @Log("查询工单管理") - @ApiOperation("查询工单管理") + @Log("查询工单详情管理") + @ApiOperation("查询工单详情管理") //@SaCheckPermission("@el.check('pdmBdWorkorder:list')") public ResponseEntity query(PdmBdWorkorderQuery query, PageQuery page){ - return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryAll(query,page)),HttpStatus.OK); - } - - @PostMapping - @Log("新增工单管理") - @ApiOperation("新增工单管理") - //@SaCheckPermission("@el.check('pdmBdWorkorder:add')") - public ResponseEntity create(@Validated @RequestBody PdmBdWorkorder entity){ - pdmBdWorkorderService.create(entity); - return new ResponseEntity<>(HttpStatus.CREATED); + return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryAllDetail(query,page)),HttpStatus.OK); } - @PutMapping - @Log("修改工单管理") - @ApiOperation("修改工单管理") - //@SaCheckPermission("@el.check('pdmBdWorkorder:edit')") - public ResponseEntity update(@Validated @RequestBody PdmBdWorkorder entity){ - pdmBdWorkorderService.update(entity); - return new ResponseEntity<>(HttpStatus.NO_CONTENT); - } - - @Log("删除工单管理") - @ApiOperation("删除工单管理") - //@SaCheckPermission("@el.check('pdmBdWorkorder:del')") - @DeleteMapping - public ResponseEntity delete(@RequestBody Set ids) { - pdmBdWorkorderService.deleteAll(ids); - return new ResponseEntity<>(HttpStatus.OK); - } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PointDetailController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PointDetailController.java index 8dd2b63..2f1e966 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PointDetailController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/controller/PointDetailController.java @@ -1,47 +1,56 @@ package org.nl.wms.pdm.controller; +import com.alibaba.fastjson.JSONObject; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.nl.common.base.TableDataInfo; import org.nl.common.domain.query.PageQuery; import org.nl.common.logging.annotation.Log; +import org.nl.wms.pda.service.PdaService; import org.nl.wms.pdm.service.IPdmBdWorkorderService; -import org.nl.wms.pdm.service.dao.PdmBdWorkorder; -import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail; +import org.nl.wms.pdm.service.dao.PointDetailAdd; import org.nl.wms.pdm.service.dto.PdmBdWorkorderQuery; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.Set; - @Slf4j @RestController @Api(tags = "工单详情管理") -@RequestMapping("/api/pdmBdWorkorderDetail") -public class PdmBdWorkorderDetailController { +@RequestMapping("/api/pointDetail") +public class PointDetailController { @Autowired private IPdmBdWorkorderService pdmBdWorkorderService; + @Autowired + private PdaService pdaService; @GetMapping - @Log("查询工单详情管理") - @ApiOperation("查询工单详情管理") + @Log("根据物料查询点位库存") + @ApiOperation("根据物料查询点位库存") //@SaCheckPermission("@el.check('pdmBdWorkorder:list')") - public ResponseEntity query(PdmBdWorkorderQuery query, PageQuery page){ - return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryAllDetail(query,page)),HttpStatus.OK); + public ResponseEntity query(String productname, PageQuery page){ + return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryPointDetail(productname,page)),HttpStatus.OK); } - @GetMapping - @Log("根据物料查询点位库存") - @ApiOperation("根据物料查询点位库存") + @PostMapping("/add") + @Log("批量新增原材料出库任务") + @ApiOperation("批量新增原材料出库任务") //@SaCheckPermission("@el.check('pdmBdWorkorder:list')") - public ResponseEntity queryPointDetail(String PalletSN, PageQuery page){ - return new ResponseEntity<>(TableDataInfo.build(pdmBdWorkorderService.queryPointDetail(PalletSN,page)),HttpStatus.OK); + public ResponseEntity add(@RequestBody PointDetailAdd pointDetailAdd){ + log.info("批量新增原材料出库任务:"+pointDetailAdd.toString()); + for(String point_code:pointDetailAdd.getPointCodes()){ + JSONObject param=new JSONObject(); + param.put("start_point",point_code); + param.put("time",pointDetailAdd.getTime()); + param.put("mode",pointDetailAdd.getMode()); + param.put("workorder_code",pointDetailAdd.getWorkorder_code()); + pdaService.yclck(param); + } + return new ResponseEntity<>(HttpStatus.OK); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/IPdmBdWorkorderService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/IPdmBdWorkorderService.java index f926f55..333a16b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/IPdmBdWorkorderService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/IPdmBdWorkorderService.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import org.nl.common.domain.query.PageQuery; import org.nl.wms.pdm.service.dao.PdmBdWorkorder; +import org.nl.wms.pdm.service.dao.PdmBdWorkorderDetail; +import org.nl.wms.pdm.service.dao.PointDetail; import org.nl.wms.pdm.service.dto.PdmBdWorkorderQuery; import java.util.Set; @@ -40,4 +42,14 @@ public interface IPdmBdWorkorderService extends IService { * @param ids / */ void deleteAll(Set ids); + + /** + * 创建 + * @param entity / + */ + void createDetail(PdmBdWorkorderDetail entity); + + IPage queryAllDetail(PdmBdWorkorderQuery query, PageQuery page); + + IPage queryPointDetail(String productname, PageQuery page); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PdmBdWorkorderDetail.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PdmBdWorkorderDetail.java index 1bf4511..d759878 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PdmBdWorkorderDetail.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PdmBdWorkorderDetail.java @@ -1,50 +1,27 @@ -package org.nl.wms.pdm.service.dto; +package org.nl.wms.pdm.service.dao; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; +import org.nl.wms.mes.domain.QPMES060RequestBody; +import org.nl.wms.mes.domain.QPMES098RequestBodyItem2; import java.io.Serializable; import java.math.BigDecimal; @Data @EqualsAndHashCode(callSuper = false) -@TableName("sch_base_material") -public class PdmBdWorkorderDetail implements Serializable { - +@TableName("pmd_bd_workorder_detail") +public class PdmBdWorkorderDetail extends QPMES098RequestBodyItem2 implements Serializable { /** 工单编号 */ private String workorder_code; /** 实际数量 */ private BigDecimal real_qty; - /** 订单行项目编号 **/ - private String POSNR; - /** 预留行项目编号 **/ - private String RSPOS; - /** 移动类型 **/ - private String BWART; - /** 物料编码 **/ - private String MATNR; - /** 物料名称 **/ - private String MAKTX; - /** 产品类别 **/ - private String MTYPE; - /** 产品类别描述 **/ - private String MTYTXT; - /** 数量 **/ - private String BDMNG; - /** 计量单位 **/ - private String MEINS; - /** 物料供应标识 **/ - private String BEIKZ; - /** 预留字段11 **/ - private String ZRSV11; - /** 预留字段12 **/ - private String ZRSV12; - /** 预留字段13 **/ - private String ZRSV13; - /** 预留字段14 **/ - private String ZRSV14; - /** 预留字段15 **/ - private String ZRSV15; + + public void copyFrom(QPMES098RequestBodyItem2 source){ + BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PointDetail.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PointDetail.java index 710e0fa..8248961 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PointDetail.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PointDetail.java @@ -1,2 +1,11 @@ -package org.nl.wms.pdm.service.dao;public class PointDetail { +package org.nl.wms.pdm.service.dao; + +import lombok.Data; + +@Data +public class PointDetail { + private String point_code; + private String productName; + private String PalletSN; + private String qty; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PointDetailAdd.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PointDetailAdd.java index 8248961..36a9310 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PointDetailAdd.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PointDetailAdd.java @@ -2,10 +2,12 @@ package org.nl.wms.pdm.service.dao; import lombok.Data; +import java.util.List; + @Data -public class PointDetail { - private String point_code; - private String productName; - private String PalletSN; - private String qty; +public class PointDetailAdd { + private List pointCodes; + private String mode; + private String time; + private String workorder_code; }