From 20bfc09eaceedc41062a05bc179798de6562168f Mon Sep 17 00:00:00 2001 From: xins Date: Fri, 27 Sep 2024 13:27:00 +0800 Subject: [PATCH] =?UTF-8?q?3.1.5:=20-PDA5=E6=A5=BC=E7=BB=84=E8=A3=85?= =?UTF-8?q?=E5=87=BA=E5=BA=93=EF=BC=9A4=E6=A5=BC=E5=88=B05=E6=A5=BC?= =?UTF-8?q?=E7=9A=84=E6=9F=9C=E4=BD=93=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=98=AF?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E6=9F=9C=E4=BD=93=E5=90=88=E4=B8=BA=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=8E=9F=E6=9D=90=E6=96=99=E6=9D=A1=E7=A0=81=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E7=94=9F=E6=88=90=E4=B8=80=E4=B8=AA=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E6=98=8E=E7=BB=86=EF=BC=8C=E7=94=9F=E4=BA=A7=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E4=BF=9D=E5=AD=98=E5=AF=B9=E5=BA=94=E7=9A=84=E5=8E=9F?= =?UTF-8?q?=E6=9D=90=E6=96=99=E6=9D=A1=E7=A0=81=20-PDA5=E6=A5=BC=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E5=85=A5=E5=BA=93=EF=BC=9A=E7=94=9F=E4=BA=A7=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E9=80=BB=E8=BE=91=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 | 16 +- .../hw/mes/api/domain/MesBaseBindBarcode.java | 88 +++++++++ .../api/domain/vo/MesPdaProductPlanVo.java | 2 + .../api/factory/RemoteMesFallbackFactory.java | 10 +- .../MesBaseBarcodeInfoController.java | 16 +- .../controller/MesProductPlanController.java | 4 +- .../com/hw/mes/domain/MesBaseBindBarcode.java | 176 +++++++++--------- .../mes/mapper/MesBaseBindBarcodeMapper.java | 2 +- .../service/IMesBaseBarcodeInfoService.java | 10 + .../impl/MesBaseBarcodeInfoServiceImpl.java | 19 +- .../impl/MesProductPlanDetailServiceImpl.java | 112 ++++++++++- .../wms/controller/WmsMobileController.java | 12 ++ .../impl/WmsProductInstockServiceImpl.java | 82 ++++++-- .../impl/WmsRawOutstockServiceImpl.java | 25 +-- 14 files changed, 429 insertions(+), 145 deletions(-) create mode 100644 hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBindBarcode.java 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 523ee95..d306434 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 @@ -3,10 +3,7 @@ package com.hw.mes.api; import com.hw.common.core.constant.SecurityConstants; import com.hw.common.core.constant.ServiceNameConstants; import com.hw.common.core.domain.R; -import com.hw.mes.api.domain.MesBaseBarcodeInfo; -import com.hw.mes.api.domain.MesBaseMaterialInfo; -import com.hw.mes.api.domain.MesBaseProcessInfo; -import com.hw.mes.api.domain.MesBaseStationInfo; +import com.hw.mes.api.domain.*; import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo; import com.hw.mes.api.domain.vo.MesPdaProductPlanVo; import com.hw.mes.api.domain.vo.MesSaleOrderTransferVo; @@ -148,4 +145,15 @@ public interface RemoteMesService { @GetMapping("/barcode/getRawBarcodeByProductBarcode/{productBarcode}") public R getRawBarcodeByProductBarcode(@PathVariable("productBarcode") String productBarcode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + + /** + * 通过原材料条码ID查询绑定的成品条码信息 + * + * @param barcodeId 原材料条码ID + * @param source 请求来源 + * @return 结果 + */ + @GetMapping("/barcode/selectMesBaseBindBarcodeList/{barcodeId}") + public R> selectMesBaseBindBarcodeList(@PathVariable("barcodeId") Long barcodeId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + } diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBindBarcode.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBindBarcode.java new file mode 100644 index 0000000..dcec64e --- /dev/null +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBindBarcode.java @@ -0,0 +1,88 @@ +package com.hw.mes.api.domain; + +import com.hw.common.core.annotation.Excel; +import com.hw.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 绑定条码对象 mes_base_bind_barcode + * + * @author Open Platform + * @date 2024-09-25 + */ +public class MesBaseBindBarcode extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long bindBarcodeId; + + /** 条码ID */ + @Excel(name = "条码ID") + private Long barcodeId; + + private String barcodeInfo; + + private Long saleOrderId; + + /** 绑定的条码内容 */ + @Excel(name = "绑定的条码内容") + private String bindBarcode; + + public void setBindBarcodeId(Long bindBarcodeId) + { + this.bindBarcodeId = bindBarcodeId; + } + + public Long getBindBarcodeId() + { + return bindBarcodeId; + } + public void setBarcodeId(Long barcodeId) + { + this.barcodeId = barcodeId; + } + + public Long getBarcodeId() + { + return barcodeId; + } + + public String getBarcodeInfo() { + return barcodeInfo; + } + + public void setBarcodeInfo(String barcodeInfo) { + this.barcodeInfo = barcodeInfo; + } + + public Long getSaleOrderId() { + return saleOrderId; + } + + public void setSaleOrderId(Long saleOrderId) { + this.saleOrderId = saleOrderId; + } + + public void setBindBarcode(String bindBarcode) + { + this.bindBarcode = bindBarcode; + } + + public String getBindBarcode() + { + return bindBarcode; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("bindBarcodeId", getBindBarcodeId()) + .append("barcodeId", getBarcodeId()) + .append("bindBarcode", getBindBarcode()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/vo/MesPdaProductPlanVo.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/vo/MesPdaProductPlanVo.java index d1ea7ce..9e0b979 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/vo/MesPdaProductPlanVo.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/vo/MesPdaProductPlanVo.java @@ -1,5 +1,6 @@ package com.hw.mes.api.domain.vo; +import com.hw.mes.api.domain.MesBaseBarcodeInfo; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -24,4 +25,5 @@ public class MesPdaProductPlanVo { //组装出库配对码对应的原材料条码 @NotBlank(message="raw material barcode cannot be empty") private String rawMaterialBarcode; + } 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 37fe473..1728b50 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 @@ -2,10 +2,7 @@ package com.hw.mes.api.factory; import com.hw.common.core.domain.R; import com.hw.mes.api.RemoteMesService; -import com.hw.mes.api.domain.MesBaseBarcodeInfo; -import com.hw.mes.api.domain.MesBaseMaterialInfo; -import com.hw.mes.api.domain.MesBaseProcessInfo; -import com.hw.mes.api.domain.MesBaseStationInfo; +import com.hw.mes.api.domain.*; import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo; import com.hw.mes.api.domain.vo.MesPdaProductPlanVo; import com.hw.mes.api.domain.vo.MesSaleOrderTransferVo; @@ -88,6 +85,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory getRawBarcodeByProductBarcode(String productBarcode, String source) { return R.fail("根据成品条码获取原材料条码信息失败:" + throwable.getMessage()); } + + @Override + public R> selectMesBaseBindBarcodeList(Long barcodeId, String source) { + return R.fail("根据原材料条码获取成品条码信息失败:" + throwable.getMessage()); + } }; } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java index 93e190a..e0b5bbf 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseBarcodeInfoController.java @@ -8,7 +8,7 @@ import com.hw.common.core.domain.R; import com.hw.common.security.annotation.InnerAuth; 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.MesBaseBindBarcode; import com.hw.mes.domain.MesPurchaseOrder; import com.hw.mes.service.IMesBaseMaterialInfoService; import com.hw.mes.service.IMesPurchaseOrderService; @@ -385,4 +385,18 @@ public class MesBaseBarcodeInfoController extends BaseController return success(mesBaseBarcodeInfoService.selectRawBarcodeInfoByProductBarcode(productBarcode)); } + + /** + * 查询原材料条码绑定的成品条码信息 + */ + @InnerAuth + @GetMapping(value="/selectMesBaseBindBarcodeList/{barcodeId}") + public R> selectMesBaseBindBarcodeList(@PathVariable("barcodeId") Long barcodeId) + { + MesBaseBindBarcode queryBindBarcode = new MesBaseBindBarcode(); + queryBindBarcode.setBarcodeId(barcodeId); + return R.ok(mesBaseBarcodeInfoService.selectMesBaseBindBarcodeList(queryBindBarcode)); + } + + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java index 99f3d0c..688c681 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesProductPlanController.java @@ -269,7 +269,7 @@ public class MesProductPlanController extends BaseController { try { MesProductPlanDetail mesProductPlanDetail = new MesProductPlanDetail(); mesProductPlanDetail.setMaterialBarcode(mesPdaProductPlanVo.getMaterialBarcode()); - mesProductPlanDetail.setRawMaterialBarcode(mesPdaProductPlanVo.getRawMaterialBarcode()); +// mesProductPlanDetail.setRawMaterialBarcode(mesPdaProductPlanVo.getRawMaterialBarcode()); mesProductPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail, MesConstants.MES_START_TYPE_FIFTH_FLOOR_INSTALL); return R.ok("start successfully"); } catch (Exception e) { @@ -287,7 +287,7 @@ public class MesProductPlanController extends BaseController { public R complete5thFloorInstall(@RequestBody MesPdaProductPlanVo mesPdaProductPlanVo) { try { MesProductPlanDetail mesProductPlanDetail = new MesProductPlanDetail(); - mesProductPlanDetail.setRawMaterialBarcode(mesPdaProductPlanVo.getRawMaterialBarcode()); + mesProductPlanDetail.setMaterialBarcode(mesPdaProductPlanVo.getMaterialBarcode()); mesProductPlanDetailService.completeMesProductPlanDetail(mesProductPlanDetail); return R.ok("complete successfully"); } catch (Exception e) { diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseBindBarcode.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseBindBarcode.java index 936087b..f39a1fd 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseBindBarcode.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesBaseBindBarcode.java @@ -1,88 +1,88 @@ -package com.hw.mes.domain; - -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.hw.common.core.annotation.Excel; -import com.hw.common.core.web.domain.BaseEntity; - -/** - * 绑定条码对象 mes_base_bind_barcode - * - * @author Open Platform - * @date 2024-09-25 - */ -public class MesBaseBindBarcode extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 主键 */ - private Long bindBarcodeId; - - /** 条码ID */ - @Excel(name = "条码ID") - private Long barcodeId; - - private String barcodeInfo; - - private Long saleOrderId; - - /** 绑定的条码内容 */ - @Excel(name = "绑定的条码内容") - private String bindBarcode; - - public void setBindBarcodeId(Long bindBarcodeId) - { - this.bindBarcodeId = bindBarcodeId; - } - - public Long getBindBarcodeId() - { - return bindBarcodeId; - } - public void setBarcodeId(Long barcodeId) - { - this.barcodeId = barcodeId; - } - - public Long getBarcodeId() - { - return barcodeId; - } - - public String getBarcodeInfo() { - return barcodeInfo; - } - - public void setBarcodeInfo(String barcodeInfo) { - this.barcodeInfo = barcodeInfo; - } - - public Long getSaleOrderId() { - return saleOrderId; - } - - public void setSaleOrderId(Long saleOrderId) { - this.saleOrderId = saleOrderId; - } - - public void setBindBarcode(String bindBarcode) - { - this.bindBarcode = bindBarcode; - } - - public String getBindBarcode() - { - return bindBarcode; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("bindBarcodeId", getBindBarcodeId()) - .append("barcodeId", getBarcodeId()) - .append("bindBarcode", getBindBarcode()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .toString(); - } -} +//package com.hw.mes.domain; +// +//import org.apache.commons.lang3.builder.ToStringBuilder; +//import org.apache.commons.lang3.builder.ToStringStyle; +//import com.hw.common.core.annotation.Excel; +//import com.hw.common.core.web.domain.BaseEntity; +// +///** +// * 绑定条码对象 mes_base_bind_barcode +// * +// * @author Open Platform +// * @date 2024-09-25 +// */ +//public class MesBaseBindBarcode extends BaseEntity +//{ +// private static final long serialVersionUID = 1L; +// +// /** 主键 */ +// private Long bindBarcodeId; +// +// /** 条码ID */ +// @Excel(name = "条码ID") +// private Long barcodeId; +// +// private String barcodeInfo; +// +// private Long saleOrderId; +// +// /** 绑定的条码内容 */ +// @Excel(name = "绑定的条码内容") +// private String bindBarcode; +// +// public void setBindBarcodeId(Long bindBarcodeId) +// { +// this.bindBarcodeId = bindBarcodeId; +// } +// +// public Long getBindBarcodeId() +// { +// return bindBarcodeId; +// } +// public void setBarcodeId(Long barcodeId) +// { +// this.barcodeId = barcodeId; +// } +// +// public Long getBarcodeId() +// { +// return barcodeId; +// } +// +// public String getBarcodeInfo() { +// return barcodeInfo; +// } +// +// public void setBarcodeInfo(String barcodeInfo) { +// this.barcodeInfo = barcodeInfo; +// } +// +// public Long getSaleOrderId() { +// return saleOrderId; +// } +// +// public void setSaleOrderId(Long saleOrderId) { +// this.saleOrderId = saleOrderId; +// } +// +// public void setBindBarcode(String bindBarcode) +// { +// this.bindBarcode = bindBarcode; +// } +// +// public String getBindBarcode() +// { +// return bindBarcode; +// } +// +// @Override +// public String toString() { +// return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) +// .append("bindBarcodeId", getBindBarcodeId()) +// .append("barcodeId", getBarcodeId()) +// .append("bindBarcode", getBindBarcode()) +// .append("createBy", getCreateBy()) +// .append("createTime", getCreateTime()) +// .toString(); +// } +//} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseBindBarcodeMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseBindBarcodeMapper.java index 0c8aa65..5a0cd13 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseBindBarcodeMapper.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesBaseBindBarcodeMapper.java @@ -1,7 +1,7 @@ package com.hw.mes.mapper; import java.util.List; -import com.hw.mes.domain.MesBaseBindBarcode; +import com.hw.mes.api.domain.MesBaseBindBarcode; /** * 绑定条码Mapper接口 diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseBarcodeInfoService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseBarcodeInfoService.java index 2e6a681..c51d448 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseBarcodeInfoService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseBarcodeInfoService.java @@ -1,6 +1,7 @@ package com.hw.mes.service; import com.hw.mes.api.domain.MesBaseBarcodeInfo; +import com.hw.mes.api.domain.MesBaseBindBarcode; import com.hw.mes.domain.vo.MesBindBarcodeVo; import org.springframework.transaction.annotation.Transactional; @@ -214,4 +215,13 @@ public interface IMesBaseBarcodeInfoService { * @return 条码信息 */ public MesBaseBarcodeInfo selectRawBarcodeInfoByProductBarcode(String productBarcode); + + + /** + * 查询绑定的成品条码信息 + * + * @param mesBaseBindBarcode 绑定条码信息 + * @return 绑定的条码信息 + */ + public List selectMesBaseBindBarcodeList(MesBaseBindBarcode mesBaseBindBarcode); } 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 cdb6d77..3b67d2c 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 @@ -3,7 +3,6 @@ package com.hw.mes.service.impl; import java.math.BigDecimal; import java.util.*; -import com.alibaba.fastjson2.JSONObject; import com.hw.common.core.constant.*; import com.hw.common.core.domain.R; import com.hw.common.core.exception.ServiceException; @@ -11,10 +10,7 @@ import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.StringUtils; import com.hw.common.core.utils.uuid.Seq; 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.MesOrderBind; -import com.hw.mes.api.domain.MesSaleOrderRelate; +import com.hw.mes.api.domain.*; import com.hw.mes.config.MesConfig; import com.hw.mes.domain.*; import com.hw.mes.domain.vo.MesBindBarcodeVo; @@ -1510,6 +1506,19 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService } + + /** + * 查询绑定的成品条码信息 + * + * @param mesBaseBindBarcode 绑定条码信息 + * @return 绑定的条码信息 + */ + @Override + public List selectMesBaseBindBarcodeList(MesBaseBindBarcode mesBaseBindBarcode) { + return mesBaseBindBarcodeMapper.selectMesBaseBindBarcodeList(mesBaseBindBarcode); + } + + // public MesPurchaseOrder insertVirtualPurchaseOrder(Long materialId, String barcodeInfo, BigDecimal sumOrderAmount, // List mesPurchaseOrderRelates,String userName, Date currentDate) { // MesPurchaseOrder virtualPurchaseOrder = new MesPurchaseOrder(); diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java index 6b58e96..bb23256 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java @@ -7,6 +7,7 @@ import com.hw.common.core.utils.StringUtils; import com.hw.common.core.utils.uuid.Seq; import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.api.domain.MesBaseBarcodeInfo; +import com.hw.mes.api.domain.vo.MesPdaProductPlanVo; import com.hw.mes.config.MesConfig; import com.hw.mes.domain.*; import com.hw.mes.domain.vo.MesProductPlanDetailVo; @@ -216,6 +217,111 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer return mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail); } +// /** +// * 完成生产计划明细(5楼PDA生产入库) +// * +// * @param mesProductPlanDetail 生产计划明细 +// * @return 结果 +// */ +// @Override +// @Transactional(rollbackFor = Exception.class) +// public int complete5thFloorProduceInstock(MesPdaProductPlanVo mesPdaProductPlanVo) { +// Long planId = null; +// MesBaseBarcodeInfo baseBarcodeInfo = mesPdaProductPlanVo.getMesBaseBarcodeInfo(); +// if (baseBarcodeInfo.getSingleFlag().equals(MesConstants.MES_BARCODE_SINGLE_FLAG_INTERNAL)) { +// +// }else{ +// +// } +// +// +// MesProductPlan dbProductPlan = mesProductPlanMapper.selectMesProductPlanByPlanId(planId); +// if (!dbProductPlan.getUserId().equals(SecurityUtils.getUserId())) { +// throw new ServiceException("此派工信息没有派工到您"); +// } +// +// String planStatus = dbProductPlan.getPlanStatus(); +// if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_TO_DISPATCH)) { +// throw new ServiceException("还未派工,不能结束"); +// } else if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_FINISH)) { +// throw new ServiceException("此生产派工已结束"); +// } +// +// String updatePlanDetailStatus = MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH; +// +// Date currentDate = new Date(); +// String userName = SecurityUtils.getUsername(); +// BigDecimal planAmount = null; +//// BigDecimal dispatchAmount = null; +// //获取计划数量 +// //如果是按图纸生产(激光切割工序),则判断完成数量不能大于图纸的数量, +// //如果不是按图纸生产,则判断完成数量不能大于计划的数量 +// String attachId = dbProductPlan.getAttachId(); +// if (dbProductPlan.getProcessId().equals(mesConfig.getLaserProcessId())) { +// if (StringUtils.isNotEmpty(attachId)) {//如果是按图纸生产的 +// String[] attachIdArr = attachId.split(","); +// planAmount = new BigDecimal(attachIdArr.length); +// } else { +// planAmount = BigDecimal.ONE; +// } +// } else { +// planAmount = dbProductPlan.getPlanAmount(); +// } +// +// BigDecimal complementAmount = dbProductPlan.getCompleteAmount() == null ? BigDecimal.ZERO : dbProductPlan.getCompleteAmount(); +// +// BigDecimal newComplementAmount = complementAmount.add(BigDecimal.ONE); +// if (newComplementAmount.compareTo(planAmount) > 0) { +// throw new ServiceException("完成数量超出派工数量"); +// } +// +// if (newComplementAmount.compareTo(planAmount) == 0) { +// dbProductPlan.setPlanStatus(MesConstants.MES_PRODUCT_PLAN_STATUS_FINISH); +// dbProductPlan.setRealEndTime(currentDate); +// } +// +// +// dbProductPlan.setCompleteAmount(newComplementAmount); +// dbProductPlan.setUpdateTime(currentDate); +// dbProductPlan.setUpdateBy(userName); +// mesProductPlanMapper.updateMesProductPlan(dbProductPlan); +// +// } +// +// +// /** +// * 完成生产计划明细 +// * +// * @param materialBarcode 物料条码 +// * @param userName 用户名称 +// * @param currentDate 当前时间 +// * @return 结果 +// */ +// +// public Long complete5thFloorMesProductPlanDetail(String materialBarcode,String userName,Date currentDate) { +// MesProductPlanDetail dbProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByMaterialBarcode(materialBarcode); +// +// if (dbProductPlanDetail == null) { +// throw new ServiceException("未找到生产明细"); +// } +// +// String planDetailStatus = dbProductPlanDetail.getPlanDetailStatus(); +// if (planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_TO_START)) { +// throw new ServiceException("此生产明细未开始"); +// } else if (planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH)) { +// return dbProductPlanDetail.getPlanId(); +// } +// +// +// dbProductPlanDetail.setUpdateTime(currentDate); +// dbProductPlanDetail.setUpdateBy(userName); +// dbProductPlanDetail.setPlanDetailStatus( MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH); +// dbProductPlanDetail.setRealEndTime(currentDate); +// mesProductPlanDetailMapper.updateMesProductPlanDetail(dbProductPlanDetail); +// return dbProductPlanDetail.getPlanId(); +// } + + /** * 完成生产计划明细 * @@ -226,7 +332,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer @Transactional(rollbackFor = Exception.class) public int completeMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail) { Long planDetailId = mesProductPlanDetail.getPlanDetailId(); - MesProductPlanDetail dbProductPlanDetail = new MesProductPlanDetail(); + MesProductPlanDetail dbProductPlanDetail = null; if (planDetailId != null) { dbProductPlanDetail = mesProductPlanDetailMapper. selectMesProductPlanDetailByPlanDetailId(planDetailId); @@ -241,7 +347,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer if (planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_TO_START)) { throw new ServiceException("此生产明细未开始"); } else if (planDetailStatus.equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH)) { - throw new ServiceException("此生产明细已结束"); + return 1; } Long planId = dbProductPlanDetail.getPlanId(); @@ -451,7 +557,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer //在拆分区拿柜体拆分时,需要打印配对码,然后跟柜体码绑定 //在从4楼到5楼接驳位时,需要根据4楼的成品码重新打印原材料条码 MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo( - mesProductPlanDetail.getRawMaterialBarcode()); + mesProductPlanDetail.getMaterialBarcode()); if (mesBaseBarcodeInfo == null) { throw new ServiceException("无派工任务"); } 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 d5d474a..b9d1d70 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 @@ -405,6 +405,18 @@ public class WmsMobileController extends BaseController { return toAjax(wmsRawOutstockService.assembleOutstock(wmsAssembleOutstockVo)); } + /** + * 组装返库,适合在五楼背板安装区(将拆分的柜体运输出来没组装完成,再进行返回原材料周转区) + */ + @Log(title = "组装返库", businessType = BusinessType.INSERT) + @PostMapping(("/assembleBack")) + public AjaxResult assembleBack(@Validated @RequestBody WmsAssembleOutstockVo wmsAssembleOutstockVo) { + if(!wmsAssembleOutstockVo.getMaterialBarcode().equals("")) { + throw new ServiceException("组装返库"); + } + return toAjax(1); + } + /** * 生产入库,适合在五楼背板安装区(将组装好的柜体入到半成品库) diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductInstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductInstockServiceImpl.java index c4a9805..f49be08 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductInstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsProductInstockServiceImpl.java @@ -14,6 +14,7 @@ import com.hw.common.core.utils.uuid.Seq; import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.api.RemoteMesService; import com.hw.mes.api.domain.MesBaseBarcodeInfo; +import com.hw.mes.api.domain.MesBaseBindBarcode; import com.hw.mes.api.domain.vo.MesPdaProductPlanVo; import com.hw.wms.config.WmsConfig; import com.hw.wms.domain.*; @@ -304,19 +305,52 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService { String operationType = WmsConstants.WMS_OPERATION_TYPE_AUTO; String executeStatus = WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE; - produceInstock(wmsProduceInstockVo, warehouseId, productType, operationType, executeStatus, 5L); + String materialBarcode = wmsProduceInstockVo.getMaterialBarcode(); + R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); + if (baseBarcodeInfoR == null) { + throw new ServiceException("物料条码有误"); + } + MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); + if (baseBarcodeInfo == null) { + throw new ServiceException("物料条码有误"); + } + + produceInstock(baseBarcodeInfo, warehouseId, productType, operationType, executeStatus, 5L); + +// if (baseBarcodeInfo.getSingleFlag().equals(MesConstants.MES_BARCODE_SINGLE_FLAG_INTERNAL)) { +// R> baseBindBarcodeListData = remoteMesService.selectMesBaseBindBarcodeList(baseBarcodeInfo.getBarcodeId(), SecurityConstants.INNER); +// if (baseBindBarcodeListData == null) { +// throw new RuntimeException("没有绑定的成品条码信息。"); +// } +// List baseBindBarcodeList = baseBindBarcodeListData.getData(); +// if (baseBindBarcodeList == null || baseBindBarcodeList.isEmpty()) { +// throw new RuntimeException("没有绑定的成品条码信息!"); +// } +// +// for (MesBaseBindBarcode baseBindBarcode : baseBindBarcodeList) { +// this.complete5thFloorInstall(baseBindBarcode.getBindBarcode()); +// } +// +// } else { +// this.complete5thFloorInstall(materialBarcode); +// } + + this.complete5thFloorInstall(materialBarcode); + return 1; + } + + + public void complete5thFloorInstall(String materialBarcode) { /** * 适用于5楼组装入库(PDA操作) */ MesPdaProductPlanVo mesPdaProductPlanVo = new MesPdaProductPlanVo(); - mesPdaProductPlanVo.setRawMaterialBarcode(wmsProduceInstockVo.getMaterialBarcode()); + mesPdaProductPlanVo.setMaterialBarcode(materialBarcode);//扫描的柜体原材料条码信息 R tdReturnMsg = remoteMesService.complete5thFloorInstall(mesPdaProductPlanVo, SecurityConstants.INNER); if (tdReturnMsg.getCode() != Constants.SUCCESS) {//抛出异常,回滚事务 throw new RuntimeException(tdReturnMsg.getMsg()); } - - return 1; } /** @@ -332,7 +366,17 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService { String productType = WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_PRODUCT; String operationType = WmsConstants.WMS_OPERATION_TYPE_MANUAL; String executeStatus = WmsConstants.WMS_EXECUTE_STATUS_FINISH; - return produceInstock(wmsProduceInstockVo, warehouseId, productType, operationType, executeStatus, 1L); + String materialBarcode = wmsProduceInstockVo.getMaterialBarcode(); + R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); + if (baseBarcodeInfoR == null) { + throw new ServiceException("物料条码有误"); + } + MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); + if (baseBarcodeInfo == null) { + throw new ServiceException("物料条码有误"); + } + + return produceInstock(baseBarcodeInfo, warehouseId, productType, operationType, executeStatus, 1L); } @@ -349,30 +393,30 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService { String productType = WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_PRODUCT; String operationType = WmsConstants.WMS_OPERATION_TYPE_MANUAL; String executeStatus = WmsConstants.WMS_EXECUTE_STATUS_FINISH; - return produceInstock(wmsProduceInstockVo, warehouseId, productType, operationType, executeStatus, 4L); + String materialBarcode = wmsProduceInstockVo.getMaterialBarcode(); + R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); + if (baseBarcodeInfoR == null) { + throw new ServiceException("物料条码有误"); + } + MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); + if (baseBarcodeInfo == null) { + throw new ServiceException("物料条码有误"); + } + return produceInstock(baseBarcodeInfo, warehouseId, productType, operationType, executeStatus, 4L); } /** * 新增成品入库记录(车间一楼和四楼成品入库,5楼组装工序生产入库) * - * @param wmsProduceInstockVo + * @param baseBarcodeInfo * @param warehouseId * @param productType * @param operationType * @param executeStatus * @return */ - public int produceInstock(WmsProduceInstockVo wmsProduceInstockVo, Long warehouseId, String productType, String operationType, String executeStatus, Long warehouseFloor) { - String materialBarcode = wmsProduceInstockVo.getMaterialBarcode(); - R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); - if (baseBarcodeInfoR == null) { - throw new ServiceException("物料条码有误"); - } - MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); - if (baseBarcodeInfo == null) { - throw new ServiceException("物料条码有误"); - } + public int produceInstock(MesBaseBarcodeInfo baseBarcodeInfo, Long warehouseId, String productType, String operationType, String executeStatus, Long warehouseFloor) { //半成品入库按原材料入库的柜体原料码进行入库 if (productType.equals(WmsConstants.PRODUCT_INSTOCK_STOCK_TYPE_SEMI)) { @@ -392,7 +436,7 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService { //如果执行状态不是已完成,是agv入库,则需要判断是否有入库记录,避免重复提交;如果执行状态是已完成(人工入库),则判断是否有此成品条码库存即可 if (!executeStatus.equals(WmsConstants.WMS_EXECUTE_STATUS_FINISH)) { WmsProductInstock queryProductInstock = new WmsProductInstock(); - queryProductInstock.setProductBatch(materialBarcode);//productbatch是索引,查出来再过滤性能更快 + queryProductInstock.setProductBatch(baseBarcodeInfo.getBarcodeInfo());//productbatch是索引,查出来再过滤性能更快 List wmsProductInstocks = wmsProductInstockMapper.selectWmsProductInstockList(queryProductInstock); if (wmsProductInstocks != null && !wmsProductInstocks.isEmpty()) { List incompleteProductInstocks = wmsProductInstocks.stream().filter( @@ -415,7 +459,7 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService { wmsProductInstock.setPlanDetailCode(baseBarcodeInfo.getPlanDetailCode()); wmsProductInstock.setInstockType(WmsConstants.PRODUCT_INSTOCK_INSTOCK_TYPE_PRODUCT); wmsProductInstock.setProductId(baseBarcodeInfo.getMaterialId()); - wmsProductInstock.setProductBatch(materialBarcode); + wmsProductInstock.setProductBatch(baseBarcodeInfo.getBarcodeInfo()); wmsProductInstock.setInstockAmount(BigDecimal.ONE); wmsProductInstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS); wmsProductInstock.setExecuteStatus(executeStatus); 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 1459e13..264a678 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 @@ -1032,32 +1032,21 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService { WmsRawOutstock queryRawOutstock = new WmsRawOutstock(); queryRawOutstock.setMaterialBatch(assembleMaterialBarcode); List wmsRawOutstocks = wmsRawOutstockMapper.selectWmsRawOutstockList(queryRawOutstock); + if (wmsRawOutstocks != null && !wmsRawOutstocks.isEmpty()) { + throw new ServiceException("已经有此物料出库记录"); + } WmsRawStock queryRawStock = new WmsRawStock(); queryRawStock.setInstockBatch(assembleMaterialBarcode); // queryRawStock.setCompleteFlag(WmsConstants.WMS_RAW_STOCK_COMPLETE_FLAG_NO); List wmsRawStocks = wmsRawStockMapper.selectWmsRawStockInList(queryRawStock); - - //如果是对内生产的柜体,则判断 - if (baseBarcodeInfo.getSingleFlag().equals(MesConstants.MES_BARCODE_SINGLE_FLAG_INTERNAL)) { - if (wmsRawOutstocks == null || wmsRawOutstocks.isEmpty()) { - this.assembleRawOutstock(wmsRawStocks, assembleMaterialBarcode, planCode, planDetailCode, - palletInfoCode, materialId, bindBarcodeInfo.getSaleOrderId()); - } - } else { - if (wmsRawOutstocks != null && !wmsRawOutstocks.isEmpty()) { - throw new ServiceException("已经有此物料出库记录"); - } - - this.assembleRawOutstock(wmsRawStocks, assembleMaterialBarcode, planCode, planDetailCode, - palletInfoCode, materialId, bindBarcodeInfo.getSaleOrderId()); - } - + this.assembleRawOutstock(wmsRawStocks, assembleMaterialBarcode, planCode, planDetailCode, + palletInfoCode, materialId, bindBarcodeInfo.getSaleOrderId()); MesPdaProductPlanVo mesPdaProductPlanVo = new MesPdaProductPlanVo(); - mesPdaProductPlanVo.setRawMaterialBarcode(assembleMaterialBarcode);//采购的柜体原材料条码,或者4楼到5楼后生成的原材料条码 - mesPdaProductPlanVo.setMaterialBarcode(bindBarcode);// 采购的bindbarcode就是采购的原材料条码,而四楼到5楼的则是在4楼绑定的成品条码。原柜体的条码(之前的原材料条码或成品条码),start后在plandetail保存此码 +// mesPdaProductPlanVo.setRawMaterialBarcode(assembleMaterialBarcode);//采购的柜体原材料条码,或者4楼到5楼后生成的原材料条码 + mesPdaProductPlanVo.setMaterialBarcode(assembleMaterialBarcode);// 采购的柜体原材料条码,或者4楼到5楼后生成的原材料条码。,start后在plandetail保存此码 R tdReturnMsg = remoteMesService.start5thFloorInstall(mesPdaProductPlanVo, SecurityConstants.INNER); if (tdReturnMsg.getCode() != Constants.SUCCESS) {//抛出异常,回滚事务 throw new ServiceException(tdReturnMsg.getMsg());