diff --git a/hw-api/hw-api-wms/src/main/java/com/hw/wms/api/domain/WmsWarehouseMaterial.java b/hw-api/hw-api-wms/src/main/java/com/hw/wms/api/domain/WmsWarehouseMaterial.java index 49defc8..67bdd7d 100644 --- a/hw-api/hw-api-wms/src/main/java/com/hw/wms/api/domain/WmsWarehouseMaterial.java +++ b/hw-api/hw-api-wms/src/main/java/com/hw/wms/api/domain/WmsWarehouseMaterial.java @@ -34,6 +34,9 @@ public class WmsWarehouseMaterial extends BaseEntity private String materialName; + private String materialSpec; + + public Long getWarehouseMaterialId() { return warehouseMaterialId; } @@ -104,6 +107,14 @@ public class WmsWarehouseMaterial extends BaseEntity 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-mes/src/main/java/com/hw/mes/controller/MesApiController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java index 515655b..bd9ac2a 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java @@ -11,9 +11,11 @@ import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseMaterialInfo; import com.hw.mes.api.domain.MesBaseStationInfo; +import com.hw.mes.api.domain.MesSaleOrderRelate; import com.hw.mes.domain.MesMaterialBom; import com.hw.mes.domain.MesProductPlan; import com.hw.mes.domain.MesProductPlanDetail; +import com.hw.mes.domain.MesSaleOrder; import com.hw.mes.domain.vo.*; import com.hw.mes.service.*; import org.springframework.beans.factory.annotation.Autowired; @@ -51,6 +53,9 @@ public class MesApiController extends BaseController { @Autowired private IMesBaseMaterialInfoService mesBaseMaterialInfoService; + @Autowired + private IMesSaleOrderService mesSaleOrderService; + /** * 查询当前登录工位信息 @@ -387,4 +392,12 @@ public class MesApiController extends BaseController { public AjaxResult productPlanDetailContinue(@Validated @RequestBody MesProductPlanDetailPauseVo mesProductPlanDetailPauseVo) { return success(productPlanDetailService.productPlanDetailContinue(mesProductPlanDetailPauseVo)); } + + + @GetMapping("/selectSaleOrderRelates") + public TableDataInfo selectSaleOrderRelates(MesSaleOrderRelate mesSaleOrderRelate) { + startPage(); + List list = mesSaleOrderService.selectMesSaleOrderRelateJoinProductList(mesSaleOrderRelate); + return getDataTable(list); + } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java index b6592b6..ee34dc8 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlan.java @@ -200,6 +200,9 @@ public class MesProductPlan extends BaseEntity private Long productId;//针对内部生产5楼的成品ID + private String materialClassfication; + + public Long getSaleOrderId() { return saleOrderId; } @@ -597,6 +600,14 @@ public class MesProductPlan extends BaseEntity this.productId = productId; } + public String getMaterialClassfication() { + return materialClassfication; + } + + public void setMaterialClassfication(String materialClassfication) { + this.materialClassfication = materialClassfication; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java index 828d888..cf873a4 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesSaleOrderService.java @@ -91,4 +91,11 @@ public interface IMesSaleOrderService * @return */ public List selectMesSaleOrderRelateJoinList(Long saleOrderId); + + /** + * 获取销售订单关联信息表,join product + * @param mesSaleOrderRelate + * @return + */ + public List selectMesSaleOrderRelateJoinProductList(MesSaleOrderRelate mesSaleOrderRelate); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java index 04aae4f..cd26375 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java @@ -1268,6 +1268,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService */ @Override public List selectBarCodeAllocationWarehouse(MesBaseBarcodeInfo mesBaseBarcodeInfo) { + mesBaseBarcodeInfo.setMaterialSpec(StringUtils.isNotEmpty(mesBaseBarcodeInfo.getMaterialSpec()) + ? mesBaseBarcodeInfo.getMaterialSpec().replaceAll("\\s+", "") : ""); return mesBaseBarcodeInfoMapper.selectBarCodeAllocationWarehouse(mesBaseBarcodeInfo); } @@ -1279,6 +1281,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService */ @Override public List selectWarehouseBarCodeList(MesBaseBarcodeInfo mesBaseBarcodeInfo) { + mesBaseBarcodeInfo.setMaterialSpec(StringUtils.isNotEmpty(mesBaseBarcodeInfo.getMaterialSpec()) + ? mesBaseBarcodeInfo.getMaterialSpec().replaceAll("\\s+", "") : ""); return mesBaseBarcodeInfoMapper.selectWarehouseBarCodeList(mesBaseBarcodeInfo); } 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 9aee034..420c56b 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 @@ -157,6 +157,8 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi */ @Override public List selectMaterialInfos4AllocationWarehouse(MesBaseMaterialInfo mesBaseMaterialInfo) { + mesBaseMaterialInfo.setMaterialSpec(StringUtils.isNotEmpty(mesBaseMaterialInfo.getMaterialSpec()) + ? mesBaseMaterialInfo.getMaterialSpec().replaceAll("\\s+", "") : ""); return mesBaseMaterialInfoMapper.selectMaterialInfos4AllocationWarehouse(mesBaseMaterialInfo); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java index bc27049..ebc515c 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesSaleOrderServiceImpl.java @@ -232,5 +232,14 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService { return mesSaleOrderRelateMapper.selectMesSaleOrderRelateJoinList(querySaleOrderRelate); } + /** + * 获取销售订单关联信息表,join product + * @param mesSaleOrderRelate + * @return + */ + @Override + public List selectMesSaleOrderRelateJoinProductList(MesSaleOrderRelate mesSaleOrderRelate){ + return mesSaleOrderRelateMapper.selectMesSaleOrderRelateJoinProductList(mesSaleOrderRelate); + } } diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml index 3efb368..f723d8a 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseBarcodeInfoMapper.xml @@ -446,6 +446,8 @@ and wlb.location_code = #{locationCode}) and bmi.material_code like concat('%', #{materialCode},'%') and bmi.material_name like concat('%', #{materialName},'%') + and replace(bmi.material_spec,' ','') like concat('%', #{materialSpec}, + '%') and bbi.barcode_info like concat('%', #{barcodeInfo},'%') @@ -464,6 +466,8 @@ and wlb.location_code = #{locationCode} and bmi.material_code like concat('%', #{materialCode},'%') and bmi.material_name like concat('%', #{materialName},'%') + and replace(bmi.material_spec,' ','') like concat('%', #{materialSpec}, + '%') and wlb.barcode_info like concat('%', #{barcodeInfo},'%') diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml index b88163a..263c7f3 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesBaseMaterialInfoMapper.xml @@ -311,6 +311,8 @@ and material_name like concat('%', #{materialName}, '%') + and replace(mbmi.material_spec,' ','') like concat('%', #{materialSpec}, + '%') and material_categories = #{materialCategories} @@ -322,7 +324,6 @@ and material_unit_id = #{materialUnitId} and material_unit = #{materialUnit} and material_matkl = #{materialMatkl} - and material_spec = #{materialSpec} and net_weight = #{netWeight} and gross_weight = #{grossWeight} and factory_id = #{factoryId} diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml index f14955d..6822feb 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml @@ -43,6 +43,7 @@ + @@ -350,7 +351,7 @@ mpp.station_id, mpp.dispatch_amount, mpp.plan_amount, mpp.complete_amount, mpp.plan_begin_time, mpp.plan_end_time, mpp.real_begin_time, mpp.real_end_time, mpp.attach_id, mpp.plan_status, mpo.plan_delivery_date,mpo.sale_type,mpo.cabinet_channel,mpo.material_id as product_id, - mbmi.material_code,mbmi.material_name,mbmi.material_spec + mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbmi.material_classfication from mes_product_plan mpp left join mes_product_order mpo on mpp.product_order_id = mpo.product_order_id left join mes_base_material_info mbmi on mpp.material_id=mbmi.material_id diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderRelateMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderRelateMapper.xml index b66cbbe..39add43 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderRelateMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderRelateMapper.xml @@ -145,6 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and relate_sale_order_id = #{relateSaleOrderId} and purchase_order_id = #{purchaseOrderId} and relate_sale_order_amount = #{relateSaleOrderAmount} + and virtual_material_id = #{virtualMaterialId} diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsProductOutstockAuditVo.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsProductOutstockAuditVo.java index 688492d..857ebdd 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsProductOutstockAuditVo.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/vo/WmsProductOutstockAuditVo.java @@ -3,6 +3,7 @@ package com.hw.wms.domain.vo; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; /** * @Description: 原材料出库审核VO @@ -14,10 +15,14 @@ import javax.validation.constraints.NotBlank; @Data public class WmsProductOutstockAuditVo { - //审核状态 - @NotBlank(message = "任务编号必须输入") + //任务编号 private String taskCode; + + //成品出库记录ID + @NotNull(message = "成品出库记录ID必须输入") + private Long productOutstockId; + //审核状态 @NotBlank(message = "审核状态必须输入") private String auditStatus; diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java index 935fcd5..75b936e 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductOutstockServiceImpl.java @@ -516,32 +516,52 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService public int auditProductOutstock(WmsProductOutstockAuditVo wmsProductOutstockAuditVo) { String auditStatus = wmsProductOutstockAuditVo.getAuditStatus(); String auditReason = wmsProductOutstockAuditVo.getAuditReason(); - String taskCode = wmsProductOutstockAuditVo.getTaskCode(); + Long productOutstockId = wmsProductOutstockAuditVo.getProductOutstockId(); Date currentDate = new Date(); String userName = SecurityUtils.getUsername(); - WmsProductOutstock queryProductOutstock = new WmsProductOutstock(); - queryProductOutstock.setTaskCode(taskCode); - queryProductOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_TOAUDIT); - List wmsProductOutstocks = wmsProductOutstockMapper.selectWmsProductOutstockList(queryProductOutstock); - if (wmsProductOutstocks == null || wmsProductOutstocks.isEmpty()) { - throw new ServiceException("无待审核成品出库记录"); - } +// WmsProductOutstock queryProductOutstock = new WmsProductOutstock(); +// queryProductOutstock.setTaskCode(taskCode); +// queryProductOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_TOAUDIT); +// List wmsProductOutstocks = wmsProductOutstockMapper.selectWmsProductOutstockList(queryProductOutstock); +// if (wmsProductOutstocks == null || wmsProductOutstocks.isEmpty()) { +// throw new ServiceException("无待审核成品出库记录"); +// } + + WmsProductOutstock wmsProductOutstock = wmsProductOutstockMapper.selectWmsProductOutstockByProductOutstockId(productOutstockId); //审核不通过,需要有审核意见 if (auditStatus.equalsIgnoreCase(WmsConstants.WMS_AUDIT_STATUS_FAIL)) { if (StringUtils.isEmpty(auditReason)) { throw new ServiceException("请输入审核意见"); } + + WmsStockTotal queryStockTotal = new WmsStockTotal(); + queryStockTotal.setWarehouseId(wmsProductOutstock.getWarehouseId()); + queryStockTotal.setMaterialId(wmsProductOutstock.getProductId()); + queryStockTotal.setSaleOrderId(wmsProductOutstock.getSaleOrderId()); + List wmsStockTotals = wmsStockTotalMapper.selectOnlyWmsStockTotalList(queryStockTotal); + if (wmsStockTotals == null || wmsStockTotals.isEmpty()) { + throw new ServiceException("没有库存"); + } + WmsStockTotal wmsStockTotal = wmsStockTotals.get(0); + wmsStockTotal.setOccupyAmount(wmsStockTotal.getOccupyAmount().subtract(wmsProductOutstock.getApplyQty())); + wmsStockTotal.setUpdateBy(userName); + wmsStockTotal.setUpdateDate(currentDate); + + wmsStockTotalMapper.updateWmsStockTotal(wmsStockTotal); + + wmsProductOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH); + } - WmsProductOutstock wmsProductOutstock = new WmsProductOutstock(); + wmsProductOutstock.setAuditStatus(auditStatus); wmsProductOutstock.setAuditReason(auditReason); wmsProductOutstock.setAuditBy(userName); wmsProductOutstock.setAuditDate(currentDate); - wmsProductOutstock.setTaskCode(taskCode); - return wmsProductOutstockMapper.auditWmsProductOutstockByTaskCode(wmsProductOutstock); + + return wmsProductOutstockMapper.updateWmsProductOutstock(wmsProductOutstock); } private static BigDecimal getAvailableAmount(WmsProductStock productStock) { diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsWarehouseMaterialServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsWarehouseMaterialServiceImpl.java index d12b91f..8c8eb5e 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsWarehouseMaterialServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsWarehouseMaterialServiceImpl.java @@ -113,6 +113,8 @@ public class WmsWarehouseMaterialServiceImpl implements IWmsWarehouseMaterialSer */ @Override public List selectWmsWarehouseMaterialJoinList(WmsWarehouseMaterial wmsWarehouseMaterial) { + wmsWarehouseMaterial.setMaterialSpec(StringUtils.isNotEmpty(wmsWarehouseMaterial.getMaterialSpec()) + ? wmsWarehouseMaterial.getMaterialSpec().replaceAll("\\s+", "") : ""); return wmsWarehouseMaterialMapper.selectWmsWarehouseMaterialJoinList(wmsWarehouseMaterial); } diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsWarehouseMaterialMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsWarehouseMaterialMapper.xml index 905e685..69fa502 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsWarehouseMaterialMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsWarehouseMaterialMapper.xml @@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -84,10 +85,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/hw-ui/src/api/mes/saleOrder.js b/hw-ui/src/api/mes/saleOrder.js index 2c724d4..0dbac69 100644 --- a/hw-ui/src/api/mes/saleOrder.js +++ b/hw-ui/src/api/mes/saleOrder.js @@ -52,3 +52,14 @@ export function listOrderBinds(query) { params: query }) } + + + +// 查询销售订单关联信息列表 +export function selectSaleOrderRelates(query) { + return request({ + url: '/mes/api/selectSaleOrderRelates', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/views/board/barcode/workshopBarcode.vue b/hw-ui/src/views/board/barcode/workshopBarcode.vue index c18db25..dead8b2 100644 --- a/hw-ui/src/views/board/barcode/workshopBarcode.vue +++ b/hw-ui/src/views/board/barcode/workshopBarcode.vue @@ -740,6 +740,7 @@ export default { printBindBarcodes(barcodeIds, printNumber).then(response => { this.$modal.msgSuccess("打印条码成功"); this.getList(); + this.closePopover(); }).catch(() => { }); }, diff --git a/hw-ui/src/views/board/common/saleOrderRelates.vue b/hw-ui/src/views/board/common/saleOrderRelates.vue new file mode 100644 index 0000000..dc1a40c --- /dev/null +++ b/hw-ui/src/views/board/common/saleOrderRelates.vue @@ -0,0 +1,92 @@ + + + + diff --git a/hw-ui/src/views/board/fifthFloor/index.vue b/hw-ui/src/views/board/fifthFloor/index.vue index e1e4553..e2960f3 100644 --- a/hw-ui/src/views/board/fifthFloor/index.vue +++ b/hw-ui/src/views/board/fifthFloor/index.vue @@ -221,6 +221,13 @@ width="120" >