From 29db8fdfedb3b0c9536682d58748ab48e82eb8d5 Mon Sep 17 00:00:00 2001 From: xs Date: Sun, 8 Dec 2024 16:42:20 +0800 Subject: [PATCH] =?UTF-8?q?3.6.1=20=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=EF=BC=9A=E5=A2=9E=E5=8A=A0=E7=89=A9=E6=96=99=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E9=A2=84=E8=AD=A6=E3=80=81=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E4=BA=A4=E8=B4=A7=E8=B6=85=E6=97=B6=E9=A2=84=E8=AD=A6=E3=80=81?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E4=BA=A4=E8=B4=A7=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E9=A2=84=E8=AD=A6=E7=9A=84=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=201=E6=A5=BC=E4=BA=A7=E7=BA=BF=E7=94=B5=E6=B0=94?= =?UTF-8?q?=E5=B7=A5=E5=BA=8F=E4=B9=9F=E5=A2=9E=E5=8A=A0=E6=9D=A1=E7=A0=81?= =?UTF-8?q?=E7=9A=84=E7=94=9F=E6=88=90=204=E6=A5=BC=E6=8A=98=E5=BC=AF?= =?UTF-8?q?=E5=92=8C=E7=84=8A=E6=8E=A5=E5=B7=A5=E5=BA=8F=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9D=A1=E7=A0=81=E5=92=8C=E7=94=B3=E8=AF=B7=E9=A2=86=E6=96=99?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD=20PDA=E5=BA=93=E5=AD=98=E7=9B=98?= =?UTF-8?q?=E7=82=B9=E6=8E=A5=E5=8F=A3=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hw/mes/api/RemoteMesService.java | 27 ++++ .../api/factory/RemoteMesFallbackFactory.java | 15 +++ .../hw/common/core/constant/MesConstants.java | 2 +- .../mapper/jindie/MesPurchaseOrderMapper.xml | 5 +- .../src/main/java/com/hw/job/task/RyTask.java | 22 ++++ .../MesPurchaseOrderController.java | 2 +- .../controller/MesSaleOrderController.java | 2 +- .../impl/MesBaseMaterialInfoServiceImpl.java | 4 +- .../qms/controller/QmsMobileController.java | 15 +++ .../wms/controller/WmsMobileController.java | 3 +- .../hw/wms/mapper/WmsBaseLocationMapper.java | 16 ++- .../wms/service/IWmsBaseLocationService.java | 8 ++ .../impl/WmsBaseLocationServiceImpl.java | 48 +++++-- .../impl/WmsInventoryCheckServiceImpl.java | 87 ++++++++----- .../impl/WmsStockTotalServiceImpl.java | 5 +- .../mapper/wms/WmsBaseLocationMapper.xml | 16 +++ .../mapper/wms/WmsStockTotalMapper.xml | 2 +- .../views/board/common/applyRawOutstock.vue | 28 +++-- hw-ui/src/views/board/firstFloor/index.vue | 19 ++- .../src/views/board/fourthFloor/assemble.vue | 2 +- hw-ui/src/views/board/fourthFloor/weld.vue | 117 +++++++++++++++++- hw-ui/src/views/mes/materialinfo/index.vue | 10 +- 22 files changed, 369 insertions(+), 86 deletions(-) diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/RemoteMesService.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/RemoteMesService.java index b3e0174a..30832ecd 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/RemoteMesService.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/RemoteMesService.java @@ -214,6 +214,16 @@ public interface RemoteMesService { public R> getRelateMaterialsBySaleOrderId(@PathVariable("saleOrderId") Long saleOrderId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + /** + * 销售订单交货超时预警 + * + * @param source 请求来源 + * @return 结果 + */ + @PostMapping("/saleOrder/saleOrderOverTimeAlarm") + public R saleOrderOverTimeAlarm(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); + + /** * 通过采购订单ID查询采购订单 * @@ -224,6 +234,14 @@ public interface RemoteMesService { @GetMapping("/purchaseOrder/selectPurchaseOrderJoinSupplierProjectByOrderId/{purchaseOrderId}") public R selectPurchaseOrderJoinSupplierProjectByOrderId(@PathVariable("purchaseOrderId") Long purchaseOrderId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + /** + * 采购订单交货超时预警 + * + * @param source 请求来源 + * @return 结果 + */ + @PostMapping("/purchaseOrder/purchaseOrderOverTimeAlarm") + public R purchaseOrderOverTimeAlarm(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); /** * 定时根据完成的工单明细生成完成记录 @@ -234,4 +252,13 @@ public interface RemoteMesService { @PostMapping("/productplan/generateProduceStatisticsDetail") public R generateProduceStatisticsDetail(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); + + /** + * 物料库存预警 + * + * @param source 请求来源 + * @return 结果 + */ + @PostMapping("/materialinfo/stockAlarm") + public R stockAlarm(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); } diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/factory/RemoteMesFallbackFactory.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/factory/RemoteMesFallbackFactory.java index db7d710c..07a4b5a0 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/factory/RemoteMesFallbackFactory.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/factory/RemoteMesFallbackFactory.java @@ -117,16 +117,31 @@ public class RemoteMesFallbackFactory implements FallbackFactory saleOrderOverTimeAlarm(String source) { + return R.fail("销售订单交货超时任务失败:" + throwable.getMessage()); + } + @Override public R selectPurchaseOrderJoinSupplierProjectByOrderId(Long purchaseOrderId, String source) { return R.fail("根据采购订单ID获取采购订单信息失败:" + throwable.getMessage()); } + @Override + public R purchaseOrderOverTimeAlarm(String source) { + return R.fail("采购订单交货超时任务失败:" + throwable.getMessage()); + } + @Override public R generateProduceStatisticsDetail(String source) { return R.fail("定时生成完成的生产明细失败:" + throwable.getMessage()); } + + @Override + public R stockAlarm(String source) { + return R.fail("物料库存预警任务失败:" + throwable.getMessage()); + } }; } } 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 a59ee5a2..88431cd5 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 @@ -295,7 +295,7 @@ public class MesConstants { /** - * 物料信息辅料标识 + * 物料信息bom内物料标识 */ public static final String MES_MATERIAL_ACCESSORIES_FLAG_YES = "1";//是 public static final String MES_MATERIAL_ACCESSORIES_FLAG_NO = "0";//否 diff --git a/hw-modules/hw-jindie/src/main/resources/mapper/jindie/MesPurchaseOrderMapper.xml b/hw-modules/hw-jindie/src/main/resources/mapper/jindie/MesPurchaseOrderMapper.xml index 11c5b2ff..0530b1bb 100644 --- a/hw-modules/hw-jindie/src/main/resources/mapper/jindie/MesPurchaseOrderMapper.xml +++ b/hw-modules/hw-jindie/src/main/resources/mapper/jindie/MesPurchaseOrderMapper.xml @@ -182,6 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" unit_id=#{unitId}, stock_unit_id=#{stockUnitId}, price_unit_id=#{priceUnitId}, + price=#{price}, aux_prop_id=#{auxPropId}, specification_parameter=#{specificationParameter}, src_bill_no=#{srcBillNo}, @@ -214,9 +215,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - INSERT INTO mes_purchase_order (erp_id, fentry_id, po_no, document_status, material_id, material_code, material_name, order_amount, complete_amount, approve_date, erp_modify_date, plan_delivery_date, order_status, unit_id, stock_unit_id, price_unit_id, aux_prop_id, specification_parameter, src_bill_no, purchase_org_id, tond_base, supplier_id, create_time,update_time) VALUES + INSERT INTO mes_purchase_order (erp_id, fentry_id, po_no, document_status, material_id, material_code, material_name, order_amount, complete_amount, approve_date, erp_modify_date, plan_delivery_date, order_status, unit_id, stock_unit_id, price_unit_id, price,aux_prop_id, specification_parameter, src_bill_no, purchase_org_id, tond_base, supplier_id, create_time,update_time) VALUES - (#{item.erpId}, #{item.fentryId}, #{item.poNo},#{item.documentStatus}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.orderAmount}, #{item.completeAmount}, #{item.approveDate}, #{item.erpModifyDate}, #{item.planDeliveryDate}, #{item.orderStatus}, #{item.unitId}, #{item.stockUnitId}, #{item.priceUnitId}, #{item.auxPropId}, #{item.specificationParameter},#{item.srcBillNo}, #{item.purchaseOrgId}, #{item.tondBase}, #{item.supplierId}, #{item.createTime},#{item.updateTime}) + (#{item.erpId}, #{item.fentryId}, #{item.poNo},#{item.documentStatus}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.orderAmount}, #{item.completeAmount}, #{item.approveDate}, #{item.erpModifyDate}, #{item.planDeliveryDate}, #{item.orderStatus}, #{item.unitId}, #{item.stockUnitId}, #{item.priceUnitId}, #{item.price}, #{item.auxPropId}, #{item.specificationParameter},#{item.srcBillNo}, #{item.purchaseOrgId}, #{item.tondBase}, #{item.supplierId}, #{item.createTime},#{item.updateTime}) diff --git a/hw-modules/hw-job/src/main/java/com/hw/job/task/RyTask.java b/hw-modules/hw-job/src/main/java/com/hw/job/task/RyTask.java index 5eb28fc8..d7b6a2ea 100644 --- a/hw-modules/hw-job/src/main/java/com/hw/job/task/RyTask.java +++ b/hw-modules/hw-job/src/main/java/com/hw/job/task/RyTask.java @@ -187,4 +187,26 @@ public class RyTask public void processActivityEmailNotify(){ remoteSysCommonService.processActivityEmailNotify(SecurityConstants.INNER); } + + /** + * 销售订单交货超时 + */ + public void saleOrderOverTimeAlarm(){ + remoteMesService.saleOrderOverTimeAlarm(SecurityConstants.INNER); + } + + /** + * 采购订单交货超时 + */ + public void purchaseOrderOverTimeAlarm(){ + remoteMesService.purchaseOrderOverTimeAlarm(SecurityConstants.INNER); + } + + /** + * 物料库存预警 + */ + public void stockAlarm(){ + remoteMesService.stockAlarm(SecurityConstants.INNER); + } + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseOrderController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseOrderController.java index d84a26c8..7ba94dae 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseOrderController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesPurchaseOrderController.java @@ -293,7 +293,7 @@ public class MesPurchaseOrderController extends BaseController /** * 采购订单交货超时计算 */ - @Log(title = "采购订单", businessType = BusinessType.OVERTIME) +// @Log(title = "采购订单", businessType = BusinessType.OVERTIME) @PostMapping("/purchaseOrderOverTimeAlarm") // @InnerAuth public R purchaseOrderOverTimeAlarm() { diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesSaleOrderController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesSaleOrderController.java index 3ad829fb..26240b88 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesSaleOrderController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesSaleOrderController.java @@ -192,7 +192,7 @@ public class MesSaleOrderController extends BaseController { /** * 销售订单交货超时计算 */ - @Log(title = "销售订单", businessType = BusinessType.OVERTIME) +// @Log(title = "销售订单", businessType = BusinessType.OVERTIME) @PostMapping("/saleOrderOverTimeAlarm") // @InnerAuth public R saleOrderOverTimeAlarm() { diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java index 6831e78a..29b0ef35 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseMaterialInfoServiceImpl.java @@ -217,8 +217,8 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi Long alarmInfoId = mesAlarmInfo.getAlarmInfoId(); List allStockAlarmDetailList = new ArrayList<>(); stockAlarm(allStockAlarmDetailList, alarmInfoId, 1, nickName, currentDate); - if (allStockAlarmDetailList.size() <= 0) { - throw new ServiceException("无报警信息"); + if (allStockAlarmDetailList==null || allStockAlarmDetailList.isEmpty()) { + return 1; } else { List sysPointRouterList = new ArrayList<>(); SysPointRouter sysPointRouter = getSysPointRouter(alarmInfoId, nickName, currentDate); diff --git a/hw-modules/hw-qms/src/main/java/com/hw/qms/controller/QmsMobileController.java b/hw-modules/hw-qms/src/main/java/com/hw/qms/controller/QmsMobileController.java index 70da62b2..a178762a 100644 --- a/hw-modules/hw-qms/src/main/java/com/hw/qms/controller/QmsMobileController.java +++ b/hw-modules/hw-qms/src/main/java/com/hw/qms/controller/QmsMobileController.java @@ -183,6 +183,21 @@ public class QmsMobileController extends BaseController { queryCheckInstanceFile.setTargetType(WfConstants.QMS_FILE_TARGET_TYPE_QUALITY_INSTANCE_ACTIVITY); queryCheckInstanceFile.setTargetId(firstQualityInstanceActivity.getInstanceActivityId());//第一步工单实例节点ID,根据工单实例节点保存图片,后续可扩展到每一步可保存图片 List qmsCheckInstanceFiles = qmsCheckInstanceFileService.selectQmsCheckInstanceFileList(queryCheckInstanceFile); + qmsCheckInstanceFiles.forEach(qcif->{ + String filePath = qcif.getFaultFile(); + if(!filePath.contains("7309")){ + if(filePath.contains("https")){ + filePath.replaceFirst("https","http"); + } + int index= filePath.indexOf("/statics"); + filePath = "http://172.16.12.100:7309"+filePath.substring(index); + qcif.setUrl(filePath); + qcif.setFilePath(filePath); + qcif.setFaultFile(filePath); + }else{ + } + }); + qmsCheckResultDetailVo.setQmsCheckInstanceFiles(qmsCheckInstanceFiles); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java index 6f134126..5e07d5ea 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java @@ -518,8 +518,7 @@ public class WmsMobileController extends BaseController { @GetMapping(value = "/getLocations") public TableDataInfo getLocations(WmsBaseLocation baseLocation) { startPage(); - //todo 需要根据正在盘点的生成库位的盘点记录明细过滤 - List baseLocations = wmsBaseLocationService.selectWmsBaseLocationList(baseLocation); + List baseLocations = wmsBaseLocationService.selectInventoryCheckBaseLocationList(baseLocation); return getDataTable(baseLocations); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsBaseLocationMapper.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsBaseLocationMapper.java index 94325f2b..fe286a9b 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsBaseLocationMapper.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/mapper/WmsBaseLocationMapper.java @@ -1,7 +1,9 @@ package com.hw.wms.mapper; import java.util.List; + import com.hw.wms.domain.WmsBaseLocation; +import org.apache.ibatis.annotations.Param; /** * 库位Mapper接口 @@ -9,8 +11,7 @@ import com.hw.wms.domain.WmsBaseLocation; * @author xs * @date 2023-12-20 */ -public interface WmsBaseLocationMapper -{ +public interface WmsBaseLocationMapper { /** * 查询库位 * @@ -87,6 +88,7 @@ public interface WmsBaseLocationMapper /** * 获取库位数量 + * * @param wmsBaseLocation * @return */ @@ -117,4 +119,14 @@ public interface WmsBaseLocationMapper Integer selectFourthFustockLocation(); Integer selectFourthNoFustockLocation(); + + + /** + * 查询可盘点库位 + * + * @param warehouseId + * @param inventoryCheckId + * @return + */ + public List selectInventoryCheckBaseLocationList(@Param("warehouseId") Long warehouseId, @Param("inventoryCheckId") Long inventoryCheckId); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsBaseLocationService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsBaseLocationService.java index 13d27d1d..01f2d48e 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsBaseLocationService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsBaseLocationService.java @@ -135,4 +135,12 @@ public interface IWmsBaseLocationService * @return */ public JSONArray getLocationCodesGroupByWarehouse(WmsBaseLocation wmsBaseLocation); + + + /** + * 查询可盘点库位列表 + * @param baseLocation + * @return + */ + public List selectInventoryCheckBaseLocationList(WmsBaseLocation baseLocation); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseLocationServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseLocationServiceImpl.java index be6defec..23937809 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseLocationServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsBaseLocationServiceImpl.java @@ -12,9 +12,11 @@ import com.hw.common.core.utils.ip.IpUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.wms.domain.WmsBaseLocation; import com.hw.wms.domain.WmsBaseWarehouse; +import com.hw.wms.domain.WmsInventoryCheck; import com.hw.wms.domain.WmsLocationBarcode; import com.hw.wms.mapper.WmsBaseLocationMapper; import com.hw.wms.mapper.WmsBaseWarehouseMapper; +import com.hw.wms.mapper.WmsInventoryCheckMapper; import com.hw.wms.mapper.WmsLocationBarcodeMapper; import com.hw.wms.service.IWmsBaseLocationService; import org.springframework.beans.factory.annotation.Autowired; @@ -42,6 +44,9 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService { @Autowired private WmsLocationBarcodeMapper wmsLocationBarcodeMapper; + @Autowired + private WmsInventoryCheckMapper wmsInventoryCheckMapper; + @Autowired private StringRedisTemplate redisTemplate; @@ -129,8 +134,6 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService { } - - /** * 锁定库位 * @@ -159,7 +162,7 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService { return this.lockLocation(baseLocation); } - public int lockLocation(WmsBaseLocation baseLocation){ + public int lockLocation(WmsBaseLocation baseLocation) { String locationStatus = baseLocation.getLocationStatus(); if (locationStatus.equals(WmsLocationStatus.MANUALLOCK.getCode())) { return 1; @@ -249,7 +252,7 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService { String hostIp = IpUtils.getIpAddr(); String printKey = "print_" + hostIp; redisTemplate.opsForList().rightPush(printKey, printContentJson.toString()); - redisTemplate.expire(printKey,1, TimeUnit.DAYS); + redisTemplate.expire(printKey, 1, TimeUnit.DAYS); // redisTemplate.convertAndSend("print_10.10.3.119", printContentJson.toString()); } catch (Exception e) { throw new ServiceException("打印失败:" + e.getMessage()); @@ -265,12 +268,12 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService { * 批量新增库位关联条码 * * @param locationCode 库位编码 - * @param materialIds 物料ID组 + * @param materialIds 物料ID组 * @param barcodeInfos 条码内容组 */ @Override public void batchInsertWarehouseBarCodes(String locationCode, Long[] materialIds, String[] barcodeInfos) { - if (StringUtils.isNotEmpty(barcodeInfos)){ + if (StringUtils.isNotEmpty(barcodeInfos)) { String userName = SecurityUtils.getUsername(); Date currentDate = new Date(); List list = new ArrayList<>(); @@ -289,6 +292,7 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService { /** * 删除仓库配置的条码信息 + * * @param locationBarcodeIds * @return */ @@ -300,15 +304,16 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService { /** * 根据仓库group 查询已锁库位的库位信息 + * * @param wmsBaseLocation * @return */ @Override - public JSONArray getLocationCodesGroupByWarehouse(WmsBaseLocation wmsBaseLocation){ + public JSONArray getLocationCodesGroupByWarehouse(WmsBaseLocation wmsBaseLocation) { JSONArray locationCodesByWarehouseJsonArr = new JSONArray(); wmsBaseLocation.setLocationStatus(WmsConstants.WMS_BASE_LOCATION_STATUS_MANUAL_LOCK); List wmsBaseLocations = wmsBaseLocationMapper.selectWmsBaseLocationJoinList(wmsBaseLocation); - Map> locationCodesByWarehouseMap = wmsBaseLocations.stream() + Map> locationCodesByWarehouseMap = wmsBaseLocations.stream() .collect(Collectors.groupingBy( WmsBaseLocation::getWarehouseName, Collectors.mapping(WmsBaseLocation::getLocationCode, Collectors.toList()) @@ -318,11 +323,34 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService { for (String warehouseName : locationCodesByWarehouseMap.keySet()) { locationCodesByWarehouseJson = new JSONObject(); List locationCodeStrs = locationCodesByWarehouseMap.get(warehouseName); - locationCodesByWarehouseJson.put("warehouseName",warehouseName); - locationCodesByWarehouseJson.put("locationCodes",locationCodeStrs); + locationCodesByWarehouseJson.put("warehouseName", warehouseName); + locationCodesByWarehouseJson.put("locationCodes", locationCodeStrs); locationCodesByWarehouseJsonArr.add(locationCodesByWarehouseJson); } return locationCodesByWarehouseJsonArr; } + + + /** + * 查询可盘点库位列表 + * + * @param baseLocation + * @return + */ + @Override + public List selectInventoryCheckBaseLocationList(WmsBaseLocation baseLocation) { + Long warehouseId = baseLocation.getWarehouseId(); + WmsInventoryCheck queryInventoryCheck = new WmsInventoryCheck(); + queryInventoryCheck.setWarehouseId(warehouseId); + queryInventoryCheck.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_STATUS_INVENTORYING); + List wmsInventoryChecks = wmsInventoryCheckMapper.selectWmsInventoryCheckList(queryInventoryCheck); + Long inventoryCheckId = null; + if (wmsInventoryChecks != null && !wmsInventoryChecks.isEmpty()) { + WmsInventoryCheck wmsInventoryCheck = wmsInventoryChecks.get(0); + inventoryCheckId = wmsInventoryCheck.getInventoryCheckId(); + } + return wmsBaseLocationMapper.selectInventoryCheckBaseLocationList(warehouseId, inventoryCheckId); + } + } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsInventoryCheckServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsInventoryCheckServiceImpl.java index 6986f546..426480c0 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsInventoryCheckServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsInventoryCheckServiceImpl.java @@ -86,6 +86,18 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService { Long warehouseId = wmsInventoryCheckVo.getWarehouseId(); List locationCodes = wmsInventoryCheckVo.getLocationCodes(); + //在选择库位时已经过滤,此处不加此判断了 +// for (String locationCode : locationCodes) { +// WmsInventoryCheckDetail queryInventoryCheckDetail = new WmsInventoryCheckDetail(); +// queryInventoryCheckDetail.setInventoryCheckId(inventoryCheckId); +// queryInventoryCheckDetail.setLocationCode(locationCode); +// +// List wmsInventoryCheckDetailList = wmsInventoryCheckDetailMapper.selectWmsInventoryCheckDetailList(queryInventoryCheckDetail); +// if (wmsInventoryCheckDetailList != null && !wmsInventoryCheckDetailList.isEmpty()) { +// throw new ServiceException("库位:" + locationCode + ",已经盘点过"); +// } +// } + String userName = SecurityUtils.getUsername(); Date currentDate = new Date(); @@ -93,11 +105,11 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService { String warehouseInstockType = baseWarehouse.getWarehouseInstockType(); String warehouseType = baseWarehouse.getWarehouseType(); String inventoryCheckType = ""; - if(warehouseType.equals(WmsConstants.WMS_WAREHOUSE_TYPE_NORMAL)){ + if (warehouseType.equals(WmsConstants.WMS_WAREHOUSE_TYPE_NORMAL)) { inventoryCheckType = WmsConstants.WMS_INVENTORY_CHECK_TYPE_MANUAL; - }else if(warehouseType.equals(WmsConstants.WMS_WAREHOUSE_TYPE_AGV)){ + } else if (warehouseType.equals(WmsConstants.WMS_WAREHOUSE_TYPE_AGV)) { inventoryCheckType = WmsConstants.WMS_INVENTORY_CHECK_TYPE_WCS; - }else{ + } else { throw new ServiceException("请选择人工仓库或agv仓库盘库"); } @@ -129,7 +141,8 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService { toSetInventoryCheckId = wmsInventoryCheck.getInventoryCheckId(); } else { WmsInventoryCheck toUpdatedInventoryCheck = wmsInventoryCheckMapper.selectWmsInventoryCheckByInventoryCheckId(inventoryCheckId); - toUpdatedInventoryCheck.setInventoryingAmount(toUpdatedInventoryCheck.getInventoriedAmount() + (long) locationCodes.size()); + toUpdatedInventoryCheck.setInventoryingAmount(toUpdatedInventoryCheck.getInventoryingAmount() == null ? 0 : toUpdatedInventoryCheck.getInventoryingAmount() + + (long) locationCodes.size()); toUpdatedInventoryCheck.setUpdateDate(currentDate); toUpdatedInventoryCheck.setUpdateBy(userName); wmsInventoryCheckMapper.updateWmsInventoryCheck(toUpdatedInventoryCheck); @@ -172,6 +185,7 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService { wmsInventoryCheckDetail.setInventoryTime(0L); wmsInventoryCheckDetail.setStockType(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW); wmsInventoryCheckDetail.setStockId(wmsRawStock.getRawStockId()); + wmsInventoryCheckDetail.setStockAmount(wmsRawStock.getTotalAmount()); wmsInventoryCheckDetail.setLocationCode(locationCode); wmsInventoryCheckDetail.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_DETAIL_STATUS_INVENTORYING); wmsInventoryCheckDetail.setCreateDate(currentDate); @@ -361,28 +375,34 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService { WmsInventoryCheck wmsInventoryCheck = wmsInventoryCheckMapper.selectWmsInventoryCheckByInventoryCheckId(existedInventoryCheckDetail.getInventoryCheckId()); //根据物料id查询库存数量 - if (stockType.equals(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_RAW)) { - WmsRawStock queryRawStock = new WmsRawStock(); - queryRawStock.setMaterialId(existedInventoryCheckDetail.getMaterialId()); - queryRawStock.setWarehouseId(wmsInventoryCheck.getWarehouseId()); - List wmsRawStockInList = wmsRawStockMapper.selectOnlyWmsRawStockInList(queryRawStock); - //需要区分批次和非批次,所以需要通过totalAmount相加得出此物料库存总数量 - BigDecimal stockAmount = wmsRawStockInList == null || wmsRawStockInList.isEmpty() ? BigDecimal.ZERO : - wmsRawStockInList.stream() - .map(WmsRawStock::getTotalAmount) - .reduce(BigDecimal.ZERO, BigDecimal::add); - existedInventoryCheckDetail.setStockAmount(stockAmount); + if (StringUtils.isEmpty(stockType)) { + } else { - WmsProductStock queryProductStock = new WmsProductStock(); - queryProductStock.setProductId(existedInventoryCheckDetail.getMaterialId()); - queryProductStock.setWarehouseId(wmsInventoryCheck.getWarehouseId()); - List wmsProductStockInList = wmsProductStockMapper.selectOnlyWmsProductStockInList(queryProductStock); - //需要区分批次和非批次,所以需要通过totalAmount相加得出此物料库存总数量 - BigDecimal stockAmount = wmsProductStockInList == null || wmsProductStockInList.isEmpty() ? BigDecimal.ZERO : - wmsProductStockInList.stream() - .map(WmsProductStock::getTotalAmount) - .reduce(BigDecimal.ZERO, BigDecimal::add); - existedInventoryCheckDetail.setStockAmount(stockAmount); + if (stockType.equals(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_RAW)) { + WmsRawStock queryRawStock = new WmsRawStock(); + queryRawStock.setMaterialId(existedInventoryCheckDetail.getMaterialId()); + queryRawStock.setLocationCode(existedInventoryCheckDetail.getLocationCode()); + queryRawStock.setWarehouseId(wmsInventoryCheck.getWarehouseId()); + List wmsRawStockInList = wmsRawStockMapper.selectOnlyWmsRawStockInList(queryRawStock); + //按库位计算库存数量 + BigDecimal stockAmount = wmsRawStockInList == null || wmsRawStockInList.isEmpty() ? BigDecimal.ZERO : + wmsRawStockInList.stream() + .map(WmsRawStock::getTotalAmount) + .reduce(BigDecimal.ZERO, BigDecimal::add); + existedInventoryCheckDetail.setStockAmount(stockAmount); + } else { + WmsProductStock queryProductStock = new WmsProductStock(); + queryProductStock.setProductId(existedInventoryCheckDetail.getMaterialId()); + queryProductStock.setLocationCode(existedInventoryCheckDetail.getLocationCode()); + queryProductStock.setWarehouseId(wmsInventoryCheck.getWarehouseId()); + List wmsProductStockInList = wmsProductStockMapper.selectOnlyWmsProductStockInList(queryProductStock); + //按库位计算库存数量 + BigDecimal stockAmount = wmsProductStockInList == null || wmsProductStockInList.isEmpty() ? BigDecimal.ZERO : + wmsProductStockInList.stream() + .map(WmsProductStock::getTotalAmount) + .reduce(BigDecimal.ZERO, BigDecimal::add); + existedInventoryCheckDetail.setStockAmount(stockAmount); + } } @@ -403,7 +423,11 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService { @Override @Transactional(rollbackFor = Exception.class) public int completeInventoryCheck(WmsInventoryCheck wmsInventoryCheck) { - List wmsInventoryCheckDetailList = wmsInventoryCheck.getWmsInventoryCheckDetailList(); +// List wmsInventoryCheckDetailList = wmsInventoryCheck.getWmsInventoryCheckDetailList(); + WmsInventoryCheckDetail queryInventoryCheckDetail = new WmsInventoryCheckDetail(); + queryInventoryCheckDetail.setInventoryCheckId(wmsInventoryCheck.getInventoryCheckId()); + List wmsInventoryCheckDetailList = wmsInventoryCheckDetailMapper.selectWmsInventoryCheckDetailList(queryInventoryCheckDetail); + List unconfirmedCheckDetails = wmsInventoryCheckDetailList.stream() .filter(checkDetail -> checkDetail.getInventoryTime() < 1).collect(Collectors.toList()); if (unconfirmedCheckDetails != null && !unconfirmedCheckDetails.isEmpty()) { @@ -412,11 +436,12 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService { Map> inventoryCheckDetailMap = wmsInventoryCheckDetailList.stream() .collect(Collectors.groupingBy(WmsInventoryCheckDetail::getLocationCode)); - long completeLocationAmount = inventoryCheckDetailMap.entrySet().size(); +// long completeLocationAmount = inventoryCheckDetailMap.entrySet().size(); // List inventoryCheckDetailIds = wmsInventoryCheckDetailList.stream().map(WmsInventoryCheckDetail::getInventoryCheckDetailId).collect(Collectors.toList()); Date currentDate = new Date(); String userName = SecurityUtils.getUsername(); + wmsInventoryCheckDetailList.forEach(wmsInventoryCheckDetail -> { wmsInventoryCheckDetail.setCheckStatus(WmsConstants.WMS_INVENTORY_CHECK_DETAIL_STATUS_FINISH); wmsInventoryCheckDetail.setUpdateDate(currentDate); @@ -425,10 +450,12 @@ public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService { }); WmsInventoryCheck existedInventoryCheck = wmsInventoryCheckMapper.selectOnlyInventoryCheckByInventoryCheckId(wmsInventoryCheck.getInventoryCheckId()); - Long inventoriedAmount = existedInventoryCheck.getInventoriedAmount(); - Long locationAmount = existedInventoryCheck.getLocationAmount(); - Long currentInventoriedAmount = inventoriedAmount + completeLocationAmount; + Long inventoriedAmount = existedInventoryCheck.getInventoriedAmount();//已盘点库位数量 + Long inventoryingAmount = existedInventoryCheck.getInventoryingAmount(); + Long locationAmount = existedInventoryCheck.getLocationAmount();//库位总数量 + Long currentInventoriedAmount = inventoriedAmount + inventoryingAmount;//当前已盘点库位总数量 wmsInventoryCheck.setInventoriedAmount(currentInventoriedAmount); + wmsInventoryCheck.setInventoryingAmount(0L); wmsInventoryCheck.setUpdateDate(currentDate); wmsInventoryCheck.setUpdateBy(userName); if (currentInventoriedAmount >= locationAmount) { diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java index a647a4c0..19a3d718 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java @@ -164,14 +164,15 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService { wmsStockTotal.setAccessoriesFlag(null); } else { if (StringUtils.isEmpty(wmsStockTotal.getAccessoriesFlag()) - || wmsStockTotal.getAccessoriesFlag().equals(MesConstants.MES_MATERIAL_ACCESSORIES_FLAG_NO)) { + || wmsStockTotal.getAccessoriesFlag().equals(MesConstants.MES_MATERIAL_ACCESSORIES_FLAG_YES)) { wmsStockTotal.setAncestors("0," + wmsStockTotal.getMaterialBomId()); wmsStockTotal.setAccessoriesFlag(null); wmsStockTotal.setVirtualFlag("1"); } } }else{ - if (StringUtils.isEmpty(wmsStockTotal.getAccessoriesFlag()) || wmsStockTotal.getAccessoriesFlag().equals(MesConstants.MES_MATERIAL_ACCESSORIES_FLAG_NO)) { + if (StringUtils.isEmpty(wmsStockTotal.getAccessoriesFlag()) + || wmsStockTotal.getAccessoriesFlag().equals(MesConstants.MES_MATERIAL_ACCESSORIES_FLAG_YES)) { wmsStockTotal.setAncestors("0," + wmsStockTotal.getMaterialBomId()); wmsStockTotal.setAccessoriesFlag(null); } diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsBaseLocationMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsBaseLocationMapper.xml index 30644b45..9ec8c2c9 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsBaseLocationMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsBaseLocationMapper.xml @@ -356,6 +356,22 @@ + + + + + + + diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml index 0cd3393b..a2fb0c3d 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsStockTotalMapper.xml @@ -196,7 +196,7 @@ #{materialCodeNameSpec},'%') or mbmi.material_name like concat('%',#{materialCodeNameSpec},'%') or mbmi.material_spec like concat('%',#{materialCodeNameSpec},'%')) - and mbmi.accessories_flag='1' + and mbmi.accessories_flag='0' and exists (select 1 from mes_material_bom mmb where mmb.material_id=wst.material_id and mmb.ancestors like concat(#{ancestors},'%')) diff --git a/hw-ui/src/views/board/common/applyRawOutstock.vue b/hw-ui/src/views/board/common/applyRawOutstock.vue index 38ad2beb..b8de3834 100644 --- a/hw-ui/src/views/board/common/applyRawOutstock.vue +++ b/hw-ui/src/views/board/common/applyRawOutstock.vue @@ -30,19 +30,20 @@ @keyup.enter.native="searchMaterial"/> - - - {{ dict.label }} - - - + + + + + + + + + + - 搜索 + BOM内物料搜索 + 非BOM内物料搜索 重置 @@ -201,7 +202,7 @@ export default { deletedFlag: null, approveDate: null, erpModifyDate: null, - accessoriesFlag:'0' + accessoriesFlag:'1' //bom内物料标识 }, // 表单参数 form: {}, @@ -280,7 +281,7 @@ export default { }, // 物料搜索 - searchMaterial() { + searchMaterial(bomFlag) { this.loading = true; if (this.form.warehouseId === null || this.form.warehouseId === undefined || this.form.warehouseId === "") { @@ -292,6 +293,7 @@ export default { this.queryParams.planDetailCode = this.form.planDetailCode; this.queryParams.productId = this.form.productId; this.queryParams.materialBomId = this.form.materialBomId; + this.queryParams.accessoriesFlag = bomFlag; getStockTotal(this.queryParams).then(e => { this.total = e.total; // e.rows.forEach(ee =>{ diff --git a/hw-ui/src/views/board/firstFloor/index.vue b/hw-ui/src/views/board/firstFloor/index.vue index 9e3f8dd2..681cd6dc 100644 --- a/hw-ui/src/views/board/firstFloor/index.vue +++ b/hw-ui/src/views/board/firstFloor/index.vue @@ -255,13 +255,13 @@ > 领料 - - 扫描 - + + + + + + + 条码 @@ -359,8 +358,8 @@
- 成品入库 - 成品出库 + 成品入库 + 成品出库 退出
diff --git a/hw-ui/src/views/board/fourthFloor/assemble.vue b/hw-ui/src/views/board/fourthFloor/assemble.vue index 2e01dd12..14cff095 100644 --- a/hw-ui/src/views/board/fourthFloor/assemble.vue +++ b/hw-ui/src/views/board/fourthFloor/assemble.vue @@ -1046,7 +1046,7 @@ export default { this.PrintData = val this.PrintData.barcodeType = '4';//成品配对码 this.PrintData.productId = val.materialId; - if (this.saleType === this.SALE_TYPE.INTERNAL) { + if (this.saleType === this.SALE_TYPE.INTERNAL) {//对内生产 this.PrintData.singleFlag = this.SINGLE_FLAG.INTERNAL; this.PrintData.productId = this.finalProductId; } else { diff --git a/hw-ui/src/views/board/fourthFloor/weld.vue b/hw-ui/src/views/board/fourthFloor/weld.vue index ba795222..76f21a6f 100644 --- a/hw-ui/src/views/board/fourthFloor/weld.vue +++ b/hw-ui/src/views/board/fourthFloor/weld.vue @@ -24,6 +24,14 @@
+ 申请领料 + + + + 条码 + + 完成 @@ -189,6 +197,8 @@ type="text">开始 + + @@ -335,6 +345,22 @@
+ + + + + + + +
+ +
+ +
+ @@ -352,6 +378,8 @@ import WorkshopNotice from "@/components/workshopNotice/index.vue"; import {noticeData} from "@/utils/notice" import ViewFile from "@/components/viewFile/index.vue"; import {getDispatchSOPAttachList} from "@/api/mes/productplan"; +import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue"; +import PrintPage from "@/views/board/barcode/workshopBarcode.vue"; const setState = (e) => { if (e === '1') { @@ -371,7 +399,14 @@ const vw = (document.documentElement.clientWidth || document.body.clientWidth) / export default { name: 'Board1', dicts: ['wms_audit_status'], + provide() { + return { + closeDialog: this.closeDialog, + } + }, components: { + PrintPage, + 'apply-raw-outstock': applyRawOutstock, Chart, WorkshopNotice, ViewFile @@ -396,7 +431,20 @@ export default { //预览文件数据列表 fileListData: [], rawOutstockData: [], - purchaseOrderData: [] + purchaseOrderData: [], + dialogVisible: false, + productPlanData: {}, + applyMaterialTitle: '', + PrintData: {}, + printModel: false, + SALE_TYPE: { + INTERNAL: '2',//对内生产 + }, + + SINGLE_FLAG: { + NOT_SINGLE: "0",//非单独成品条码标识 + INTERNAL: '2'//对内条码 + }, } }, mounted() { @@ -613,9 +661,11 @@ export default { }); } this.form = data.data || {} + this.form.productId = val.productId//如果是内部生产,则此为5楼成品ID this.form.materialId = val.materialId this.form.materialCode = val.materialCode this.form.materialName = val.materialName + this.form.saleType = val.saleType this.form.planDetailStatus = setState(data.data.planDetailStatus) this.getInfo(val) this.selectBindPurchaseOrders(); @@ -625,10 +675,12 @@ export default { if (!val) return const {data} = await getNewestProductPlanDetail({planId: val.planId}) this.form = data || {} - this.form.materialId = val.materialId + this.form.productId = val.productId//如果是内部生产,则此为5楼成品ID + this.form.materialId = val.materialId//本楼层生产的成品 this.form.materialCode = val.materialCode this.form.materialName = val.materialName this.form.saleOrderId = val.saleOrderId + this.form.saleType = val.saleType this.form.planDetailStatus = setState(data?.planDetailStatus) this.getInfo(val) this.selectBindPurchaseOrders(); @@ -1060,7 +1112,57 @@ export default { // this.loading = false; }); } - } + }, + + + // 申请领料页面 + getMaterials() { + this.applyMaterialTitle = "领料"; + this.maxPlanAmount = 1000000000; + this.taskType = '1';//生产领料 + + this.dialogVisible = true + + this.productPlanData = { + warehouseId: '', + planId: this.form?.planId, + planCode: this.form?.planCode, + dispatchCode: this.form?.dispatchCode, + planDetailCode: this.form?.planDetailCode, + saleOrderId: this.form?.saleOrderId, + productId: this.form?.materialId, + materialBomId: this.form?.materialBomId, + maxPlanAmount: 100000000, + returnFlag: "0", + applyReason: '', + taskType: "1", + warehouseFloor: 4, + mesAreaType: 3, + wmsRawOutstockDetailList: [] + } + + }, + + + closeDialog() { + this.dialogVisible = false; + }, + + + + print() { + this.PrintData = this.form + this.PrintData.barcodeType = '4';//成品配对码 + this.PrintData.productId = this.form.materialId; + if (this.form.saleType === this.SALE_TYPE.INTERNAL) { + this.PrintData.singleFlag = this.SINGLE_FLAG.INTERNAL; + this.PrintData.productId = this.form.productId; + } else { + this.PrintData.singleFlag = this.SINGLE_FLAG.NOT_SINGLE; + } + this.printModel = true + }, + } } @@ -1222,4 +1324,13 @@ export default { /deep/ .current-row td .cell { color: #000 !important; } + +/deep/ .dialog .app-container { + background: none !important; + position: static; +} + +/deep/ .dialog .el-dialog__body { + padding: 0 !important; +} diff --git a/hw-ui/src/views/mes/materialinfo/index.vue b/hw-ui/src/views/mes/materialinfo/index.vue index e6277144..d8951b7f 100644 --- a/hw-ui/src/views/mes/materialinfo/index.vue +++ b/hw-ui/src/views/mes/materialinfo/index.vue @@ -1,6 +1,6 @@ - + @@ -328,7 +328,7 @@ - +