From f5d7b210bd3af980b048362d283cbd1b518480ed Mon Sep 17 00:00:00 2001 From: xs Date: Sat, 3 Aug 2024 16:18:00 +0800 Subject: [PATCH] =?UTF-8?q?2.8.3=20=E8=BD=A6=E9=97=B4MES:=20=E5=9B=9B?= =?UTF-8?q?=E6=A5=BC=E6=BF=80=E5=85=89=E5=88=87=E5=89=B2=E5=B7=A5=E5=BA=8F?= =?UTF-8?q?=E6=9D=BF=E6=9D=90=E5=85=A5=E5=BA=93=E3=80=81=E6=9D=BF=E6=9D=90?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=92=8C=E6=9D=BF=E6=9D=90=E9=80=80=E5=BA=93?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hw/common/core/constant/MesConstants.java | 5 +- .../hw/wms/controller/WmsApiController.java | 26 ++- .../com/hw/wms/domain/WmsLocationBarcode.java | 32 +++ .../wms/mapper/WmsLocationBarcodeMapper.java | 9 + .../service/IWmsLocationBarcodeService.java | 10 + .../hw/wms/service/IWmsRawReturnService.java | 9 + .../impl/WmsLocationBarcodeServiceImpl.java | 15 ++ .../impl/WmsRawInstockServiceImpl.java | 15 +- .../impl/WmsRawOutstockServiceImpl.java | 3 + .../service/impl/WmsRawReturnServiceImpl.java | 58 ++++- .../mapper/wms/WmsLocationBarcodeMapper.xml | 24 ++ hw-ui/src/api/board/index.js | 18 ++ .../views/board/fourthFloor/laserLight.vue | 206 ++++++++++++------ 13 files changed, 350 insertions(+), 80 deletions(-) diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java index 788138a2..25e47c34 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java @@ -28,10 +28,7 @@ public class MesConstants { * 条码类型:配对码 */ public static final String MES_BARCODE_TYPE_BIND = "4"; - /** - * 条码类型:拆分配对(目前系统没使用,传参数使用) - */ - public static final String MES_BARCODE_TYPE_SPLIT = "5"; + /** * 条码类型:固定原材料条码 */ diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java index 41aaac3e..8f44280f 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java @@ -51,6 +51,9 @@ public class WmsApiController extends BaseController { @Autowired private IWmsErpScheduledTaskService wmsErpScheduledTaskService; + @Autowired + private IWmsLocationBarcodeService wmsLocationBarcodeService; + /** * 根据工位查询查询仓库列表 @@ -81,7 +84,6 @@ public class WmsApiController extends BaseController { /** * 申请领料,如果是五楼申请领柜体,wcs轮询后执行完成要删除库存 */ -// @RequiresPermissions("wms:mobile:addrawinstock") @Log(title = "原材料出库记录", businessType = BusinessType.APPLY) @PostMapping(("/applyRawOutstock")) public AjaxResult applyRawOutstock(@Validated @RequestBody WmsRawOutstock wmsRawOutstock) { @@ -129,6 +131,17 @@ public class WmsApiController extends BaseController { return toAjax(wmsRawOutstockService.directRawOutstock(wmsRawOutstock)); } + + /** + * 原材料直接退库(适合于四楼激光切割工位的板材退库) + */ + @Log(title = "原材料退库记录", businessType = BusinessType.CONFIRM) + @PostMapping(("/directRawReturn")) + public AjaxResult directRawReturn(@RequestBody WmsRawReturn wmsRawReturn) { + return toAjax(wmsRawReturnService.directRawReturn(wmsRawReturn)); + } + + /** * 新增成品入库记录(适合于一楼生产完成品入虚拟库,没有库位) */ @@ -194,6 +207,17 @@ public class WmsApiController extends BaseController { return success(wmsRawOutstockService.getNewestOutstockCabinet(wmsRawOutstock)); } + /** + * 获取四楼板材库固定条码 + */ + @GetMapping(("/get4thFloorRegularBarcode")) + public AjaxResult get4thFloorRegularBarcode(WmsLocationBarcode wmsLocationBarcode) { + return success(wmsLocationBarcodeService.selectWmsLocationBarcodeJoinList(wmsLocationBarcode)); + } + + + + /** * 定时同步入库信息给ERP * @return diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsLocationBarcode.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsLocationBarcode.java index 7f52c3d8..276fa345 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsLocationBarcode.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsLocationBarcode.java @@ -37,6 +37,14 @@ public class WmsLocationBarcode extends BaseEntity { @Excel(name = "物料条码") private String barcodeInfo; + + private String materialCode; + + private String materialName; + + private String materialSpec; + + public void setLocationBarcodeId(Long locationBarcodeId) { this.locationBarcodeId = locationBarcodeId; } @@ -69,6 +77,30 @@ public class WmsLocationBarcode extends BaseEntity { return barcodeInfo; } + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMaterialSpec() { + return materialSpec; + } + + public void setMaterialSpec(String materialSpec) { + this.materialSpec = materialSpec; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsLocationBarcodeMapper.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsLocationBarcodeMapper.java index 9c3a1088..da8f6cfa 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsLocationBarcodeMapper.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsLocationBarcodeMapper.java @@ -67,4 +67,13 @@ public interface WmsLocationBarcodeMapper */ public int batchWmsLocationBarcode(List wmsLocationBarcodeList); + + /** + * 查询库位关联条码信息列表,join material + * + * @param wmsLocationBarcode 库位关联条码信息 + * @return 库位关联条码信息集合 + */ + public List selectWmsLocationBarcodeJoinList(WmsLocationBarcode wmsLocationBarcode); + } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsLocationBarcodeService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsLocationBarcodeService.java index 218b7cbf..39b65b45 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsLocationBarcodeService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsLocationBarcodeService.java @@ -58,4 +58,14 @@ public interface IWmsLocationBarcodeService { * @return 结果 */ public int deleteWmsLocationBarcodeByLocationBarcodeId(Long locationBarcodeId); + + + + /** + * 查询库位关联条码信息列表,Join material + * + * @param wmsLocationBarcode 库位关联条码信息 + * @return 库位关联条码信息 + */ + public List selectWmsLocationBarcodeJoinList(WmsLocationBarcode wmsLocationBarcode); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawReturnService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawReturnService.java index e89b5f7f..003c4102 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawReturnService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawReturnService.java @@ -110,4 +110,13 @@ public interface IWmsRawReturnService * @return 结果 */ public int applyRawReturn(List wmsRawReturns); + + + /** + * 直接退库(适合四楼激光切割工位板材退库) + * + * @param wmsRawReturn + * @return + */ + public int directRawReturn(WmsRawReturn wmsRawReturn); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsLocationBarcodeServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsLocationBarcodeServiceImpl.java index d2d6618c..f58c7b90 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsLocationBarcodeServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsLocationBarcodeServiceImpl.java @@ -86,4 +86,19 @@ public class WmsLocationBarcodeServiceImpl implements IWmsLocationBarcodeService public int deleteWmsLocationBarcodeByLocationBarcodeId(Long locationBarcodeId) { return wmsLocationBarcodeMapper.deleteWmsLocationBarcodeByLocationBarcodeId(locationBarcodeId); } + + + + + /** + * 查询库位关联条码信息列表,Join material + * + * @param wmsLocationBarcode 库位关联条码信息 + * @return 库位关联条码信息 + */ + @Override + public List selectWmsLocationBarcodeJoinList(WmsLocationBarcode wmsLocationBarcode) { + return wmsLocationBarcodeMapper.selectWmsLocationBarcodeJoinList(wmsLocationBarcode); + } + } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java index bd54d0e8..2776e526 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java @@ -125,7 +125,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { /** - * 新增原材料入库记录(适用于移动手持端) + * 新增原材料入库记录(适用于移动手持端,也适用于4楼激光切割工序板材入库) * * @param wmsRawInstockVo 原材料入库记录 * @return 结果 @@ -160,11 +160,14 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { } } - WmsRawInstock existedRawInstock = wmsRawInstockMapper.selectWmsRawInstockByBarcode(wmsRawInstockVo.getMaterialBarcode()); - if (existedRawInstock != null) { - throw new ServiceException("此物料已经入库,不需重复入库"); + if(!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR)){ + WmsRawInstock existedRawInstock = wmsRawInstockMapper.selectWmsRawInstockByBarcode(wmsRawInstockVo.getMaterialBarcode()); + if (existedRawInstock != null) { + throw new ServiceException("此物料已经入库,不需重复入库"); + } } + Date currentDate = new Date(); String userName = SecurityUtils.getUsername(); WmsRawInstock wmsRawInstock = new WmsRawInstock(); @@ -177,7 +180,9 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { wmsRawInstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH); wmsRawInstock.setApplyBy(userName); wmsRawInstock.setApplyDate(currentDate); - wmsRawInstock.setMaterialBarcode(wmsRawInstockVo.getMaterialBarcode()); + if(!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR)) { + wmsRawInstock.setMaterialBarcode(wmsRawInstockVo.getMaterialBarcode()); + } wmsRawInstock.setMaterialBatchCode(baseBarcodeInfo.getBatchCode()); wmsRawInstock.setMaterialId(baseBarcodeInfo.getMaterialId()); wmsRawInstock.setInstockAmount(wmsRawInstockVo.getInstockAmount()); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java index e0a99a68..f671bbd8 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java @@ -1157,6 +1157,9 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService { throw new ServiceException("物料条码有误"); } MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); + if (baseBarcodeInfo == null) { + throw new ServiceException("物料条码有误"); + } BigDecimal outstockAmount = wmsRawOutstock.getOutstockAmount(); String batchCode = baseBarcodeInfo.getBatchCode(); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawReturnServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawReturnServiceImpl.java index 23f21e5f..2b5e3160 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawReturnServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawReturnServiceImpl.java @@ -381,12 +381,11 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService { } - private void updateRawStock(WmsRawReturnConfirmVo wmsRawReturnConfirmVo, MesBaseBarcodeInfo mesBaseBarcodeInfo, WmsBaseLocation baseLocation, - String userName, Date currentDate) { - String locationCode = wmsRawReturnConfirmVo.getLocationCode(); + public void updateRawStock(WmsRawReturnConfirmVo wmsRawReturnConfirmVo, MesBaseBarcodeInfo mesBaseBarcodeInfo, WmsBaseLocation baseLocation, + String userName, Date currentDate) { + String locationCode = baseLocation.getLocationCode(); String instockBatch = mesBaseBarcodeInfo.getBatchCode(); - //todo 批次码 WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(instockBatch); if (wmsRawStock == null) { WmsBaseWarehouse warehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(baseLocation.getWarehouseId()); @@ -399,6 +398,8 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService { wmsRawStock.setInstockBatch(mesBaseBarcodeInfo.getBatchCode()); wmsRawStock.setInstockDate(mesBaseBarcodeInfo.getAcceptedDate()); wmsRawStock.setLastOutstockTime(mesBaseBarcodeInfo.getLastOutstockDate()); + wmsRawStock.setSaleOrderId(mesBaseBarcodeInfo.getSaleOrderId()); + wmsRawStock.setSafeFlag(mesBaseBarcodeInfo.getSafeFlag()); // wmsRawStock.setQualityStatus();//TODO:质检状态 wmsRawStock.setCompleteFlag(WmsConstants.WMS_RAW_STOCK_COMPLETE_FLAG_YES); wmsRawStock.setTotalAmount(wmsRawReturnConfirmVo.getReturnAmount()); @@ -539,4 +540,53 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService { return 1; } + + /** + * 直接退库(适合四楼激光切割工位板材退库) + * + * @param wmsRawReturn + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public int directRawReturn(WmsRawReturn wmsRawReturn) { + String materialBarcode = wmsRawReturn.getMaterialBarcode(); + String locationCode = wmsRawReturn.getLocationCode(); + WmsBaseLocation baseLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode); + if (baseLocation == null) { + throw new ServiceException("库位编码错误"); + } + R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); + if (baseBarcodeInfoR == null) { + throw new ServiceException("物料条码有误"); + } + MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); + if (baseBarcodeInfo == null) { + throw new ServiceException("物料条码有误"); + } + + BigDecimal returnAmount = wmsRawReturn.getReturnAmount(); + String userName = SecurityUtils.getUsername(); + Date currentDate = new Date(); + + wmsRawReturn.setTaskCode(Seq.getId(Seq.rawReturnSeqType, Seq.rawReturnCode)); + wmsRawReturn.setWarehouseId(baseLocation.getWarehouseId()); + wmsRawReturn.setMaterialId(baseBarcodeInfo.getMaterialId()); + wmsRawReturn.setMaterialBarcode(materialBarcode); + wmsRawReturn.setReturnAmount(returnAmount); + wmsRawReturn.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS); + wmsRawReturn.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH); + + wmsRawReturn.setApplyBy(userName); + wmsRawReturn.setApplyDate(currentDate); + wmsRawReturnMapper.insertWmsRawReturn(wmsRawReturn); + + WmsRawReturnConfirmVo wmsRawReturnConfirmVo = new WmsRawReturnConfirmVo(); + wmsRawReturnConfirmVo.setReturnAmount(returnAmount); + updateRawStock(wmsRawReturnConfirmVo, baseBarcodeInfo, baseLocation, + userName, currentDate); + + return 1; + } + } diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsLocationBarcodeMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsLocationBarcodeMapper.xml index e9cb16b2..43f6cc95 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsLocationBarcodeMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsLocationBarcodeMapper.xml @@ -12,6 +12,9 @@ + + + @@ -86,4 +89,25 @@ ( #{item.locationBarcodeId}, #{item.locationCode}, #{item.materialId}, #{item.barcodeInfo}, #{item.remark}, #{item.createBy}, #{item.createTime}) + + + + + + + + + + + + \ No newline at end of file diff --git a/hw-ui/src/api/board/index.js b/hw-ui/src/api/board/index.js index 2cb9e6c0..3a0dd5be 100644 --- a/hw-ui/src/api/board/index.js +++ b/hw-ui/src/api/board/index.js @@ -222,6 +222,15 @@ export function directRawOutstock(data) { }) } +//激光切割工位板材退库 +export function directRawReturn(data) { + return request({ + url: '/wms/api/directRawReturn', + method: 'post', + data: data + }) +} + // 柜体绑定 @@ -318,3 +327,12 @@ export function completeReturnMaterials(data) { data: data }) } + +// 查询固定条码 +export function get4thFloorRegularBarcode(query) { + return request({ + url: '/wms/api/get4thFloorRegularBarcode', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/views/board/fourthFloor/laserLight.vue b/hw-ui/src/views/board/fourthFloor/laserLight.vue index bf081f60..02ddd11f 100644 --- a/hw-ui/src/views/board/fourthFloor/laserLight.vue +++ b/hw-ui/src/views/board/fourthFloor/laserLight.vue @@ -36,6 +36,9 @@ 板材领料 + 板材退库 + 完成 @@ -100,7 +103,7 @@ slot="reference" :disabled="i.planDetailStatus" size="small" - type="text">{{ !i.planDetailStatus ? "开始" : PLAN_DETAIL_STATUS_STR[i.planDetailStatus]}} + type="text">{{ !i.planDetailStatus ? "开始" : PLAN_DETAIL_STATUS_STR[i.planDetailStatus] }} @@ -130,7 +133,9 @@ width="80" > - @@ -167,7 +172,7 @@ 退库 - + @@ -201,16 +206,26 @@ + + - + + + + + + + + +