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..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 @@ -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,15 @@ public class MesApiController extends BaseController { return success(productPlanService.assignTask(mesAssignTaskVo)); } + /** + * 查询物料安装情况 + * @param hashMap (installType=1已安装,installType=2未安装) + * @return + */ + @GetMapping(("/selectMaterialInstallationCircumstance")) + public TableDataInfo selectMaterialInstallationCircumstance(@RequestParam(required = false) Map hashMap) { + startPage(); + return getDataTable(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} + + + +