From 0a91a2028e33cdc8f9f7165d95954bc00b7f72d4 Mon Sep 17 00:00:00 2001 From: xins Date: Mon, 15 Apr 2024 11:01:03 +0800 Subject: [PATCH 1/5] =?UTF-8?q?2.1.2=20=E8=BD=A6=E9=97=B4=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=EF=BC=9A=E4=BA=94=E6=A5=BC=E8=A3=85=E9=85=8D=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=89=AB=E7=A0=81=E5=BC=80=E5=A7=8B=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E6=B4=BE=E5=B7=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hw/common/core/constant/MesConstants.java | 3 ++ .../hw/mes/controller/MesApiController.java | 18 ++++++++-- .../hw/mes/domain/MesProductPlanDetail.java | 10 ++++++ .../vo/MesMaterialBarcodeScan2StartVo.java | 26 ++++++++++++++ .../service/IMesProductPlanDetailService.java | 4 ++- .../impl/MesProductPlanDetailServiceImpl.java | 36 +++++++++++++++---- .../impl/MesProductPlanServiceImpl.java | 4 +-- .../mes/MesMaterialAssignInfoMapper.xml | 1 + hw-ui/src/api/board/index.js | 10 ++++++ hw-ui/src/views/board/fifthFloor/index.vue | 25 +++++++++---- 10 files changed, 119 insertions(+), 18 deletions(-) create mode 100644 hw-modules/hw-mes/src/main/java/com/hw/mes/domain/vo/MesMaterialBarcodeScan2StartVo.java 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 e6d9b4d5..4a2c9523 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 @@ -89,4 +89,7 @@ public class MesConstants { public static final String MES_ASSIGN_TASK_RESULT_KEY = "fifth_floor_assign_task_result";//五楼分配柜体任务到具体工位返库key + /**生产派工开始类型*/ + public static final String MES_START_TYPE_FIFTH_FLOOR_ASSEMBLE = "1";//五楼装配工位 + } 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 94b3bef4..17119fff 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 @@ -1,5 +1,6 @@ package com.hw.mes.controller; +import com.hw.common.core.constant.MesConstants; import com.hw.common.core.web.controller.BaseController; import com.hw.common.core.web.domain.AjaxResult; import com.hw.common.core.web.page.TableDataInfo; @@ -142,7 +143,20 @@ public class MesApiController extends BaseController { @Log(title = "生产计划明细", businessType = BusinessType.START) @PostMapping(("/startNextProductPlanDetail")) public AjaxResult startNextProductPlanDetail(@RequestBody MesProductPlanDetail mesProductPlanDetail) { - return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail)); + return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail,"")); + } + + /** + * 开始下一生产计划明细(适用于五楼装配区域),扫描或输入物料条码后开始时生成一条计划明细 + * 传planId + */ + @Log(title = "生产计划明细", businessType = BusinessType.START) + @PostMapping(("/scan2StartNextProductPlanDetail")) + public AjaxResult scan2StartNextProductPlanDetail(@Validated @RequestBody MesMaterialBarcodeScan2StartVo mesMaterialBarcodeScan2StartVo) { + MesProductPlanDetail mesProductPlanDetail = new MesProductPlanDetail(); + mesProductPlanDetail.setPlanId(mesMaterialBarcodeScan2StartVo.getPlanId()); + mesProductPlanDetail.setMaterialBarcode(mesMaterialBarcodeScan2StartVo.getMaterialBarcode()); + return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail, MesConstants.MES_START_TYPE_FIFTH_FLOOR_ASSEMBLE)); } /** @@ -155,7 +169,7 @@ public class MesApiController extends BaseController { MesProductPlanDetail mesProductPlanDetail = new MesProductPlanDetail(); mesProductPlanDetail.setPlanId(mesProductPlanDetailAttachVo.getPlanId()); mesProductPlanDetail.setAttachId(mesProductPlanDetailAttachVo.getAttachId()); - return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail)); + return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail,"")); } /** diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java index ff017d7a..b50cca36 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesProductPlanDetail.java @@ -64,6 +64,8 @@ public class MesProductPlanDetail extends BaseEntity private String attachName; + private String materialBarcode; + public void setPlanDetailId(Long planDetailId) { this.planDetailId = planDetailId; @@ -180,6 +182,14 @@ public class MesProductPlanDetail extends BaseEntity this.attachName = attachName; } + public String getMaterialBarcode() { + return materialBarcode; + } + + public void setMaterialBarcode(String materialBarcode) { + this.materialBarcode = materialBarcode; + } + @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/domain/vo/MesMaterialBarcodeScan2StartVo.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/vo/MesMaterialBarcodeScan2StartVo.java new file mode 100644 index 00000000..2ba1ad2c --- /dev/null +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/vo/MesMaterialBarcodeScan2StartVo.java @@ -0,0 +1,26 @@ +package com.hw.mes.domain.vo; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * @Description: 五楼装配工位扫码开始VO对象 + * @ClassName: MesMaterialBarcodeScan2StartVo + * @Author : xins + * @Date :2024-04-15 10:10 + * @Version :1.0 + */ +@Data +public class MesMaterialBarcodeScan2StartVo { + + //生产计划ID + @NotNull(message = "planId必须输入") + private Long planId; + + //物料条码 + @NotBlank(message = "物料条码必须输入") + private String materialBarcode; + +} diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java index db99e210..4a5f8507 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanDetailService.java @@ -6,6 +6,7 @@ import com.hw.common.core.utils.DateUtils; import com.hw.mes.domain.MesProductPlan; import com.hw.mes.domain.MesProductPlanDetail; import com.hw.mes.domain.vo.MesProductPlanDetailVo; +import org.springframework.transaction.annotation.Transactional; /** * 生产计划明细Service接口 @@ -108,7 +109,8 @@ public interface IMesProductPlanDetailService { * 开始下一生产计划明细 * * @param mesProductPlanDetail 生产计划明细 + * @param startType (0:其他工位,1:五楼装配工位) * @return MesProductPlanDetail */ - public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail); + public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail,String startType); } 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 8537b393..420c242d 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 @@ -6,14 +6,13 @@ 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.domain.MesMaterialAssignInfo; import com.hw.mes.domain.MesMaterialCheckResult; import com.hw.mes.domain.MesProductPlan; import com.hw.mes.domain.MesProductPlanDetail; import com.hw.mes.domain.vo.MesProductPlanDetailVo; -import com.hw.mes.mapper.MesMaterialBomMapper; -import com.hw.mes.mapper.MesMaterialCheckResultMapper; -import com.hw.mes.mapper.MesProductPlanDetailMapper; -import com.hw.mes.mapper.MesProductPlanMapper; +import com.hw.mes.mapper.*; import com.hw.mes.service.IMesProductPlanDetailService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -42,6 +41,12 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer @Autowired private MesMaterialCheckResultMapper mesMaterialCheckResultMapper; + @Autowired + private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper; + + @Autowired + private MesMaterialAssignInfoMapper mesMaterialAssignInfoMapper; + /** * 查询生产计划明细 * @@ -61,7 +66,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer */ @Override public List selectMesProductPlanDetailList(MesProductPlanDetail mesProductPlanDetail) { - if(mesProductPlanDetail.getPlanId()==null){ + if (mesProductPlanDetail.getPlanId() == null) { return new ArrayList(); } return mesProductPlanDetailMapper.selectMesProductPlanDetailList(mesProductPlanDetail); @@ -304,11 +309,12 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer * 开始下一生产计划明细 * * @param mesProductPlanDetail 生产计划明细 + * @param startType (0:其他工位,1:五楼装配工位) * @return MesProductPlanDetail */ @Override @Transactional(rollbackFor = Exception.class) - public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail) { + public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail, String startType) { //根据planId获取最新一条的生产计划明细 MesProductPlanDetail newestPlanDetail = mesProductPlanDetailMapper.selectNewestMesProductPlanDetail(mesProductPlanDetail); //todo:在开始生产计划时,更新生产工单状态、开始时间; @@ -326,6 +332,24 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer } } + //五楼装配工位要扫码开始 + if (startType.equals(MesConstants.MES_START_TYPE_FIFTH_FLOOR_ASSEMBLE)) { + String materialBarcode = mesProductPlanDetail.getMaterialBarcode(); + MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(materialBarcode); + if (mesBaseBarcodeInfo == null) { + throw new ServiceException("物料条码有误"); + } + +// MesMaterialAssignInfo queryMaterialAssignInfo = new MesMaterialAssignInfo(); +// queryMaterialAssignInfo.setMaterialBarcode(materialBarcode); +// List mesMaterialAssignInfoList = mesMaterialAssignInfoMapper.selectMesMaterialAssignInfoList(queryMaterialAssignInfo); +// if (mesMaterialAssignInfoList == null || mesMaterialAssignInfoList.isEmpty()) { +// throw new ServiceException("此物料条码还没下发到工位"); +// } + + } + + MesProductPlan mesProductPlan = mesProductPlanMapper.selectMesProductPlanByPlanId(mesProductPlanDetail.getPlanId()); //判断生产计划的状态 String planStatus = mesProductPlan.getPlanStatus(); diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java index 7c227f84..d44d9e23 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanServiceImpl.java @@ -388,10 +388,10 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService { String materialBarcode = mesAssignTaskVo.getMaterialBarcode(); MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(materialBarcode); if (mesBaseBarcodeInfo == null) { - throw new ServiceException("成品条码有误"); + throw new ServiceException("物料条码有误"); } if (StringUtils.isEmpty(mesBaseBarcodeInfo.getBindBarcode())) { - throw new ServiceException("此成品条码未绑定柜体,不能下发"); + throw new ServiceException("此物料条码未绑定柜体,不能下发"); } MesMaterialAssignInfo queryMesMaterialAssignInfo = new MesMaterialAssignInfo(); diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialAssignInfoMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialAssignInfoMapper.xml index 7ad10f82..0c9b5d41 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialAssignInfoMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialAssignInfoMapper.xml @@ -22,6 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and material_barcode = #{materialBarcode} and station_id = #{stationId} + order by material_assign_info_id desc @@ -31,24 +35,33 @@ where pallet_info_id = #{palletInfoId} - + insert into mes_base_pallet_info pallet_info_code, + material_id, + material_code, + material_name, + material_barcode, remark, create_by, create_time, update_by, update_time, + bind_amount, #{palletInfoCode}, + #{materialId}, + #{materialCode}, + #{materialName}, + #{materialBarcode}, #{remark}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, + #{bindAmount}, @@ -56,11 +69,16 @@ update mes_base_pallet_info pallet_info_code = #{palletInfoCode}, + material_id = #{materialId}, + material_code = #{materialCode}, + material_name = #{materialName}, + material_barcode = #{materialBarcode}, remark = #{remark}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, + bind_amount = #{bindAmount}, where pallet_info_id = #{palletInfoId} @@ -77,4 +95,13 @@ #{palletInfoId} - \ No newline at end of file + + + + + + + From eef55d52ac427a06cc8c48818c643b811c9918f5 Mon Sep 17 00:00:00 2001 From: xins Date: Mon, 15 Apr 2024 14:44:15 +0800 Subject: [PATCH 3/5] =?UTF-8?q?2.1.3=20=E7=94=9F=E4=BA=A7=EF=BC=9APDA?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=89=98=E7=9B=98=E4=B8=8E=E7=89=A9=E6=96=99?= =?UTF-8?q?=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java index 0a61c511..79abc61b 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java @@ -63,7 +63,7 @@ public class MesBaseBarcodeInfo extends BaseEntity private Long materialId; /** 物料名称 */ - @Excel(name = "物料ID") + @Excel(name = "物料名称") private String materialName; /** 供应商ID */ From 0712a3f235c926efefd7a2f4dde95bbef91d6740 Mon Sep 17 00:00:00 2001 From: xins Date: Mon, 15 Apr 2024 15:06:27 +0800 Subject: [PATCH 4/5] =?UTF-8?q?2.1.4=20=E8=BD=A6=E9=97=B4=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=EF=BC=9A=E5=AE=8C=E6=88=905=E6=A5=BC=E8=A3=85?= =?UTF-8?q?=E9=85=8D=E5=B7=A5=E4=BD=8D=E6=89=AB=E6=8F=8F=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E7=89=A9=E6=96=99=E4=BD=BF=E7=94=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hw-ui/src/views/board/fifthFloor/index.vue | 87 +++++++++++++++++++++- hw-ui/src/views/board/fourthFloor/weld.vue | 1 - 2 files changed, 86 insertions(+), 2 deletions(-) diff --git a/hw-ui/src/views/board/fifthFloor/index.vue b/hw-ui/src/views/board/fifthFloor/index.vue index 008c5042..f82141ef 100644 --- a/hw-ui/src/views/board/fifthFloor/index.vue +++ b/hw-ui/src/views/board/fifthFloor/index.vue @@ -27,6 +27,10 @@
领料 + 扫描 + + 退料 + 领柜体 @@ -368,6 +372,30 @@ + + + + + + + + + + + + + + + + + + @@ -418,7 +446,7 @@ import { getWarehouses, bindBarcode, applyRawBack, - assignTask + assignTask, scanMaterial2Confirm } from "@/api/board"; const setState = (e) => { @@ -469,6 +497,22 @@ export default { }, submitAssignLoading: false, + materialConfirmVisible: false, + materialConfirmForm: { + materialBarcode: null, + planId: null, + planDetailId:null, + checkAmount:null + }, + materialConfirmRules: { + materialBarcode: [ + { required: true, message: "物料条码不能为空", trigger: "blur" } + ], + checkAmount: [ + { required: true, message: "数量不能为空", trigger: "blur" } + ], + }, + tableData: [], nowStation: null, stationData: [ @@ -1342,6 +1386,47 @@ export default { this.resetRawBack(); }, + + + // 表单重置 + resetMaterialConfirm() { + this.materialConfirmForm = { + materialBarcode: null, + planId: null, + planDetailId:null, + checkAmount:null + }; + this.resetForm("materialConfirmForm"); + }, + + /** 扫描物料确认使用按钮操作 */ + handleMaterialConfirmForm() { + this.materialConfirmForm = { + materialBarcode: null, + planId: this.form.planId, + planDetailId:this.form.planDetailId, + checkAmount:null + }; + this.materialConfirmVisible = true; + }, + + + submitMaterialConfirm(){ + this.$refs["materialConfirmForm"].validate(valid => { + if (valid) { + scanMaterial2Confirm(this.materialConfirmForm).then(response => { + this.$modal.msgSuccess("确认成功"); + this.cancelMaterialConfirm(); + }); + } + }); + }, + + cancelMaterialConfirm(){ + this.materialConfirmVisible = false; + this.resetMaterialConfirm(); + } + } } diff --git a/hw-ui/src/views/board/fourthFloor/weld.vue b/hw-ui/src/views/board/fourthFloor/weld.vue index 84fa89d8..577c7937 100644 --- a/hw-ui/src/views/board/fourthFloor/weld.vue +++ b/hw-ui/src/views/board/fourthFloor/weld.vue @@ -399,7 +399,6 @@ export default { }) }, async startPlan(val) { - alert(JSON.stringify(val)) const data = await startNextProductPlanDetail({planId: val.planId}) if (data.code === 200) { this.$message({ From 1ccba4083da5f19619d67dbd5673bc0f2400aba3 Mon Sep 17 00:00:00 2001 From: xins Date: Mon, 15 Apr 2024 15:07:27 +0800 Subject: [PATCH 5/5] =?UTF-8?q?2.1.4=20=E8=BD=A6=E9=97=B4=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=EF=BC=9A=E5=AE=8C=E6=88=905=E6=A5=BC=E8=A3=85?= =?UTF-8?q?=E9=85=8D=E5=B7=A5=E4=BD=8D=E6=89=AB=E6=8F=8F=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E7=89=A9=E6=96=99=E4=BD=BF=E7=94=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hw-ui/src/views/board/fifthFloor/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw-ui/src/views/board/fifthFloor/index.vue b/hw-ui/src/views/board/fifthFloor/index.vue index f82141ef..fad9045d 100644 --- a/hw-ui/src/views/board/fifthFloor/index.vue +++ b/hw-ui/src/views/board/fifthFloor/index.vue @@ -1294,7 +1294,7 @@ export default { if (e.code === 200) { this.dialogVisible = false this.$message({ - message: '申请领柜体成功', + message: '申请领取成功', type: 'success' }); }