From b8599d2bb47b6df6ede8bc0b5fa4b4f4a1bb498f Mon Sep 17 00:00:00 2001 From: yinq Date: Wed, 17 Apr 2024 15:08:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?change=20-=20=E6=9F=A5=E8=AF=A2=E7=89=A9?= =?UTF-8?q?=E6=96=99=E5=AE=89=E8=A3=85=E6=83=85=E5=86=B5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hw/mes/controller/MesApiController.java | 11 ++++++ .../mapper/MesMaterialCheckResultMapper.java | 16 +++++++++ .../mes/service/IMesProductPlanService.java | 8 +++++ .../impl/MesProductPlanServiceImpl.java | 24 ++++++++++--- .../mes/MesMaterialCheckResultMapper.xml | 36 +++++++++++++++++++ 5 files changed, 90 insertions(+), 5 deletions(-) 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 17119ff..7eaf345 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 @@ -18,6 +18,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.Map; /** * MES对外提供接口Controller @@ -210,4 +211,14 @@ public class MesApiController extends BaseController { return success(productPlanService.assignTask(mesAssignTaskVo)); } + /** + * 查询物料安装情况 + * @param hashMap (installType=1已安装,installType=2未安装) + * @return + */ + @GetMapping(("/selectMaterialInstallationCircumstance")) + public AjaxResult selectMaterialInstallationCircumstance(@RequestParam(required = false) Map hashMap) { + return success(productPlanService.selectMaterialInstallationCircumstance(hashMap)); + } + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialCheckResultMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialCheckResultMapper.java index 23d0d21..da9db04 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialCheckResultMapper.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialCheckResultMapper.java @@ -1,6 +1,8 @@ package com.hw.mes.mapper; +import java.util.HashMap; import java.util.List; +import java.util.Map; import com.hw.mes.domain.MesMaterialCheckResult; import org.apache.ibatis.annotations.Param; @@ -85,4 +87,18 @@ public interface MesMaterialCheckResultMapper { @Param("ancestors") String ancestors); + /** + * 查询物料已安装情况 + * @param hashMap + * @return + */ + List> selectMaterialInstallationCircumstance(Map hashMap); + + /** + * 查询物料未安装情况 + * @param hashMap + * @return + */ + List> selectMaterialUnInstallationCircumstance(Map hashMap); + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java index 94e59a8..539e3a7 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesProductPlanService.java @@ -1,6 +1,8 @@ package com.hw.mes.service; +import java.util.HashMap; import java.util.List; +import java.util.Map; import com.hw.mes.domain.MesBaseAttachInfo; import com.hw.mes.domain.MesProductOrder; @@ -129,4 +131,10 @@ public interface IMesProductPlanService */ public int assignTask(MesAssignTaskVo mesAssignTaskVo); + /** + * 查询物料安装情况 + * @param hashMap (installType=1已安装,installType=2未安装) + * @return + */ + List> selectMaterialInstallationCircumstance(Map hashMap); } 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 d44d9e2..afc9ce4 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 @@ -1,9 +1,7 @@ package com.hw.mes.service.impl; import java.math.BigDecimal; -import java.util.Arrays; -import java.util.Date; -import java.util.List; +import java.util.*; import com.alibaba.fastjson.JSONObject; import com.hw.common.core.constant.MesConstants; @@ -25,8 +23,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; -import java.util.ArrayList; - import com.hw.common.core.utils.StringUtils; import org.springframework.transaction.annotation.Transactional; import com.hw.mes.service.IMesProductPlanService; @@ -436,6 +432,24 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService { } + /** + * 查询物料安装情况 + * @param hashMap (installType=1已安装,installType=2未安装) + * @return + */ + @Override + public List> selectMaterialInstallationCircumstance(Map hashMap) { + List> result = new ArrayList<>(); + if (hashMap.containsKey("installType") && hashMap.get("installType").equals("1")){ + result = mesMaterialCheckResultMapper.selectMaterialInstallationCircumstance(hashMap); + } + if (hashMap.containsKey("installType") && hashMap.get("installType").equals("2") + && hashMap.containsKey("planDetailId") && hashMap.containsKey("materialBomId")){ + result = mesMaterialCheckResultMapper.selectMaterialUnInstallationCircumstance(hashMap); + } + return result; + } + // public String executeAssignTaskResultTask() { // ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialCheckResultMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialCheckResultMapper.xml index 833f913..76cc470 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialCheckResultMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialCheckResultMapper.xml @@ -97,4 +97,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where mmb.ancestors like concat(#{ancestors}, '%') and mmcr.plan_id = #{planId} and mmcr.plan_detail_id = #{planDetailId} + + + + From 42c5f587c2f8f8b1b402e4ab1c140e86b652c59d Mon Sep 17 00:00:00 2001 From: yinq Date: Wed, 17 Apr 2024 16:08:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?change=20-=20=E6=9F=A5=E8=AF=A2=E7=89=A9?= =?UTF-8?q?=E6=96=99=E5=AE=89=E8=A3=85=E6=83=85=E5=86=B5=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=8A=A0=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hw/mes/controller/MesApiController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 7eaf345..db559a5 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 @@ -217,8 +217,9 @@ public class MesApiController extends BaseController { * @return */ @GetMapping(("/selectMaterialInstallationCircumstance")) - public AjaxResult selectMaterialInstallationCircumstance(@RequestParam(required = false) Map hashMap) { - return success(productPlanService.selectMaterialInstallationCircumstance(hashMap)); + public TableDataInfo selectMaterialInstallationCircumstance(@RequestParam(required = false) Map hashMap) { + startPage(); + return getDataTable(productPlanService.selectMaterialInstallationCircumstance(hashMap)); } }