From 4bd74ded216856176d47a87f69572084023be329 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期二, 02 四月 2024 16:49:19 +0800 Subject: [PATCH] 工段级看板接口 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentWorkLineServiceImpl.java | 40 +------ lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/MdcProductionMapper.xml | 5 + lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcHomeMapper.java | 21 ++++ lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/IMdcProductionService.java | 5 + lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcProductionServiceImpl.java | 8 + lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml | 41 ++++++++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/EquipmentDayUtilizationVo.java | 29 +++++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/IMdcHomeServiceImpl.java | 76 +++++++++++++++ lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/MdcProductionMapper.java | 7 + lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcHomeController.java | 42 ++++++++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcHomeService.java | 11 ++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOverallEquipmentEfficiencyServiceImpl.java | 3 12 files changed, 255 insertions(+), 33 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcHomeController.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcHomeController.java index 970f4fb..65d39c8 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcHomeController.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcHomeController.java @@ -10,6 +10,7 @@ import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.modules.mdc.constant.MdcConstant; +import org.jeecg.modules.mdc.entity.MdcOverallEquipmentEfficiency; import org.jeecg.modules.mdc.service.IMdcEquipmentService; import org.jeecg.modules.mdc.service.IMdcHomeService; import org.jeecg.modules.mdc.vo.MdcCommonVo; @@ -64,6 +65,9 @@ } else if (userType.equals(MdcConstant.USER_TYPE_3)) { //鍘傚尯 key = mdcProductionService.findFirstProduction(userId, mdcProduction.getId()); + } else if (userType.equals(MdcConstant.USER_TYPE_2)) { + //宸ユ 鏌ヨ鐢ㄦ埛鎷ユ湁鐨勫伐娈垫潈闄� + key = mdcProductionService.findThreeProductionId(userId); } } List<MdcCommonVo> resultMap = mdcHomeService.getEquipmentStatusStatistics(userId, key); @@ -150,4 +154,42 @@ Map<String, Object> result = mdcHomeService.getEquipmentMonthStatistics(userId, key); return Result.OK(result); } + + @ApiOperation(value = "MDC棣栭〉鎺ュ彛-宸ユ绾у墠涓冨ぉ鍒╃敤鐜囨姌绾垮浘", notes = "MDC棣栭〉鎺ュ彛-宸ユ绾у墠涓冨ぉ鍒╃敤鐜囨姌绾垮浘") + @GetMapping("/equipmentDayUtilizationStatistics") + public Result<?> equipmentDayUtilizationStatistics(String productionCode) { + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + String userId = user.getId(); + String key = ""; + if (StringUtils.isNotBlank(productionCode)) { + //鍘傚尯 + MdcProduction mdcProduction = mdcProductionService.getOne(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getProductionCode, productionCode).eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString())); + key = mdcProduction.getId(); + } else { + //宸ユ 鏌ヨ鐢ㄦ埛鎷ユ湁鐨勫伐娈垫潈闄� + key = mdcProductionService.findThreeProductionId(userId); + } + Map<String, Object> result = mdcHomeService.getEquipmentDayUtilizationStatistics(userId, key); + return Result.OK(result); + } + + @ApiOperation(value = "MDC棣栭〉鎺ュ彛-涓婃湀鍚勮澶嘜EE缁熻", notes = "MDC棣栭〉鎺ュ彛-涓婃湀鍚勮澶嘜EE缁熻") + @GetMapping("/equipmentOEEMonthStatistics") + public Result<?> equipmentOEEMonthStatistics(String productionCode) { + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + String userId = user.getId(); + String key = ""; + if (StringUtils.isNotBlank(productionCode)) { + //鍘傚尯 + MdcProduction mdcProduction = mdcProductionService.getOne(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getProductionCode, productionCode).eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString())); + key = mdcProduction.getId(); + } else { + //宸ユ 鏌ヨ鐢ㄦ埛鎷ユ湁鐨勫伐娈垫潈闄� + key = mdcProductionService.findThreeProductionId(userId); + } + List<MdcOverallEquipmentEfficiency> result = mdcHomeService.getEquipmentOEEMonthStatistics(userId, key); + return Result.OK(result); + } + + } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcHomeMapper.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcHomeMapper.java index bae0b19..79e3ebd 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcHomeMapper.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcHomeMapper.java @@ -2,6 +2,8 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo; +import org.jeecg.modules.mdc.entity.MdcOverallEquipmentEfficiency; import org.jeecg.modules.system.entity.MdcProduction; import org.springframework.stereotype.Repository; @@ -52,4 +54,23 @@ * @return */ Map<String, Object> getUtilizationByMonth(@Param("equipmentIdList") List<String> equipmentIdList, @Param("date") String date); + + /** + * 鏌ヨ鍓嶄竷澶╁埄鐢ㄧ巼 + * + * @param equipmentIdList + * @param dateList + * @return + */ + List<MdcEquipmentStatisticalInfo> getEquipmentDayUtilizationStatistics(@Param("equipmentIdList") List<String> equipmentIdList, @Param("dateList") List<String> dateList); + + /** + * 鏌ヨOEE + * + * @param validDate + * @param equipmentIdList + * @return + */ + List<MdcOverallEquipmentEfficiency> getEquipmentOEEMonthStatistics(@Param("validDate") String validDate, @Param("equipmentIdList") List<String> equipmentIdList); + } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml index b358a64..ad5cadb 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcHomeMapper.xml @@ -61,4 +61,45 @@ </where> </select> + <select id="getEquipmentDayUtilizationStatistics" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo"> + SELECT + the_date, + SUM ( process_long ) processLong, + SUM ( open_long ) openLong + FROM + mdc_equipment_statistical_info + <where> + <if test="equipmentIdList != null and equipmentIdList.size() > 0 "> + AND equipment_id IN + <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")"> + #{id} + </foreach> + </if> + <if test="dateList != null and dateList.size() > 0 "> + AND the_date IN + <foreach collection="dateList" index="index" item="date" open="(" separator="," close=")"> + #{date} + </foreach> + </if> + </where> + GROUP BY + the_date + </select> + + <select id="getEquipmentOEEMonthStatistics" resultType="org.jeecg.modules.mdc.entity.MdcOverallEquipmentEfficiency"> + SELECT + * + FROM + mdc_overall_equipment_efficiency + <where> + AND valid_date = #{validDate} + <if test="equipmentIdList != null and equipmentIdList.size() > 0 "> + AND equipment_id IN + <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")"> + #{id} + </foreach> + </if> + </where> + </select> + </mapper> \ No newline at end of file diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcHomeService.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcHomeService.java index 41759d8..aa3a799 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcHomeService.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcHomeService.java @@ -1,5 +1,6 @@ package org.jeecg.modules.mdc.service; +import org.jeecg.modules.mdc.entity.MdcOverallEquipmentEfficiency; import org.jeecg.modules.mdc.vo.MdcCommonVo; import java.util.List; @@ -30,4 +31,14 @@ * 璁惧OEE鍜屽埄鐢ㄧ巼缁熻鏌辩姸鍥� */ Map<String, Object> getEquipmentMonthStatistics(String userId, String key); + + /** + * 宸ユ绾у墠涓冨ぉ鍒╃敤鐜囨姌绾垮浘 + */ + Map<String, Object> getEquipmentDayUtilizationStatistics(String userId, String key); + + /** + * 鏌ヨ璁惧涓婃湀OEE + */ + List<MdcOverallEquipmentEfficiency> getEquipmentOEEMonthStatistics(String userId, String key); } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/IMdcHomeServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/IMdcHomeServiceImpl.java index 25b9414..9a9fe09 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/IMdcHomeServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/IMdcHomeServiceImpl.java @@ -2,11 +2,14 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils; import org.jeecg.modules.mdc.entity.EquipmentLog; +import org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalInfo; +import org.jeecg.modules.mdc.entity.MdcOverallEquipmentEfficiency; import org.jeecg.modules.mdc.mapper.MdcHomeMapper; import org.jeecg.modules.mdc.service.IEquipmentLogService; import org.jeecg.modules.mdc.service.IMdcEquipmentService; import org.jeecg.modules.mdc.service.IMdcHomeService; import org.jeecg.modules.mdc.util.DateUtils; +import org.jeecg.modules.mdc.vo.EquipmentDayUtilizationVo; import org.jeecg.modules.mdc.vo.MdcCommonVo; import org.jeecg.modules.mdc.vo.MdcEquipmentStatusVo; import org.jeecg.modules.system.entity.MdcProduction; @@ -229,4 +232,77 @@ result.put("oeeList", oeeList); return result; } + + /** + * 宸ユ绾у墠涓冨ぉ鍒╃敤鐜囨姌绾垮浘 + */ + @Override + public Map<String, Object> getEquipmentDayUtilizationStatistics(String userId, String key) { + Map<String, Object> result = new HashMap<>(); + List<String> equipmentIdList = mdcEquipmentService.getEquipmentIdsProduction(userId, key); + //鑾峰彇鍓嶄竷澶╂棩鏈熼泦鍚� + Date start = DateUtils.toDate(LocalDate.now().plusDays(-7).toString(), DateUtils.STR_DATE); + Date end = DateUtils.toDate(LocalDate.now().plusDays(-1).toString(), DateUtils.STR_DATE); + List<String> dayBetween = DateUtils.getDatesStringList2(start, end); + List<String> dateList = new ArrayList<>(); + List<EquipmentDayUtilizationVo> dataList = new ArrayList<>(); + for (String date : dayBetween) { + EquipmentDayUtilizationVo equipmentDayUtilizationVo = new EquipmentDayUtilizationVo(); + String item = date.substring(4); + if (item.startsWith("0")) { + item = item.substring(1); + String sub = item.substring(1); + if (sub.startsWith("0")) { + item = item.substring(0, 1) + "鏈�" + sub.substring(1) + "鏃�"; + } else { + item = item.substring(0, 1) + "鏈�" + item.substring(1) + "鏃�"; + } + } else { + String sub = item.substring(2); + if (sub.startsWith("0")) { + item = item.substring(0, 2) + "鏈�" + sub.substring(2) + "鏃�"; + } else { + item = item.substring(0, 2) + "鏈�" + item.substring(2) + "鏃�"; + } + } + dateList.add(item); + equipmentDayUtilizationVo.setDate(item); + if (equipmentIdList != null && !equipmentIdList.isEmpty()) { + //鑾峰彇鍓嶄竷澶╁埄鐢ㄧ巼鏁版嵁 + List<MdcEquipmentStatisticalInfo> mdcEquipmentStatisticalInfos = mdcHomeMapper.getEquipmentDayUtilizationStatistics(equipmentIdList, dayBetween); + if (mdcEquipmentStatisticalInfos != null && !mdcEquipmentStatisticalInfos.isEmpty()) { + for (MdcEquipmentStatisticalInfo mdcEquipmentStatisticalInfo : mdcEquipmentStatisticalInfos) { + if (mdcEquipmentStatisticalInfo.getTheDate().equals(date)) { + equipmentDayUtilizationVo.setUtilizationRate(mdcEquipmentStatisticalInfo.getProcessLong().divide(new BigDecimal("864"), 4, RoundingMode.HALF_UP).divide(new BigDecimal(equipmentIdList.size()), 4, RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP)); + if (BigDecimal.ZERO.compareTo(mdcEquipmentStatisticalInfo.getOpenLong()) == -1) { + equipmentDayUtilizationVo.setOpenRate(mdcEquipmentStatisticalInfo.getProcessLong().divide(mdcEquipmentStatisticalInfo.getOpenLong(), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP)); + equipmentDayUtilizationVo.setStartRate(mdcEquipmentStatisticalInfo.getOpenLong().divide(new BigDecimal("864"), 4, RoundingMode.HALF_UP).divide(new BigDecimal(equipmentIdList.size()), 4, RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP)); + } + } + } + } else { + dataList.add(equipmentDayUtilizationVo); + } + } else { + dataList.add(equipmentDayUtilizationVo); + } + } + result.put("dateList", dateList); + result.put("dataList", dataList); + return result; + } + + /** + * 鏌ヨ璁惧涓婃湀OEE + */ + @Override + public List<MdcOverallEquipmentEfficiency> getEquipmentOEEMonthStatistics(String userId, String key) { + List<MdcOverallEquipmentEfficiency> result = new ArrayList<>(); + List<String> equipmentIdList = mdcEquipmentService.getEquipmentIdsProduction(userId, key); + if (equipmentIdList != null && !equipmentIdList.isEmpty()) { + String validDate = DateUtils.format(DateUtils.toDate(LocalDate.now().plusMonths(-1).toString(), DateUtils.STR_DATE), DateUtils.STR_YEAR_MONTH); + result = mdcHomeMapper.getEquipmentOEEMonthStatistics(validDate, equipmentIdList); + } + return result; + } } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentWorkLineServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentWorkLineServiceImpl.java index 0701d87..b082be7 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentWorkLineServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentWorkLineServiceImpl.java @@ -135,7 +135,7 @@ //寰呬紭鍖� if ("FANUC".equals(mdcWorkChartVo.getDriveType()) || "SIEMENS840D".equals(mdcWorkChartVo.getDriveType())) { Map<String, Object> param = new HashMap<>(); - param.put("columns", ",spindlespeed,spindleload,spindlebeilv,feedrate,feedbeilv"); + param.put("columns", ",spindlespeed,spindleload,spindlebeilv,feedrate,feedbeilv,actualfeedrate,actualspindlespeed"); param.put("tableName", saveTableName); param.put("startTime", startTime); param.put("endTime", endTime); @@ -188,40 +188,16 @@ case "feedbeilv": ei.setFeedbeilv(map.get(collentParams.get(i - 1).getEnglishName()) == null ? null : map.get(collentParams.get(i - 1).getEnglishName()).toString()); break; + case "actualfeedrate": + ei.setActualfeedrate(map.get(collentParams.get(i - 1).getEnglishName()) == null ? null : map.get(collentParams.get(i - 1).getEnglishName()).toString()); + break; + case "actualspindlespeed": + ei.setActualspindlespeed(map.get(collentParams.get(i - 1).getEnglishName()) == null ? null : map.get(collentParams.get(i - 1).getEnglishName()).toString()); + break; } } catch (Exception e) { e.printStackTrace(); } -// try { -// switch (i) { -// case 1: -// ei.setDataLine1(map.get(collentParams.get(i - 1).getEnglishName()) == null ? null : map.get(collentParams.get(i - 1).getEnglishName()).toString()); -// break; -// case 2: -// ei.setDataLine2(map.get(collentParams.get(i - 1).getEnglishName()) == null ? null : map.get(collentParams.get(i - 1).getEnglishName()).toString()); -// break; -// case 3: -// ei.setDataLine3(map.get(collentParams.get(i - 1).getEnglishName()) == null ? null : map.get(collentParams.get(i - 1).getEnglishName()).toString()); -// break; -// case 4: -// ei.setDataLine4(map.get(collentParams.get(i - 1).getEnglishName()) == null ? null : map.get(collentParams.get(i - 1).getEnglishName()).toString()); -// break; -// case 5: -// ei.setDataLine5(map.get(collentParams.get(i - 1).getEnglishName()) == null ? null : map.get(collentParams.get(i - 1).getEnglishName()).toString()); -// break; -// case 6: -// ei.setDataLine6(map.get(collentParams.get(i - 1).getEnglishName()) == null ? null : map.get(collentParams.get(i - 1).getEnglishName()).toString()); -// break; -// case 7: -// ei.setDataLine7(map.get(collentParams.get(i - 1).getEnglishName()) == null ? null : map.get(collentParams.get(i - 1).getEnglishName()).toString()); -// break; -// case 8: -// ei.setDataLine8(map.get(collentParams.get(i - 1).getEnglishName()) == null ? null : map.get(collentParams.get(i - 1).getEnglishName()).toString()); -// break; -// } -// } catch (Exception e) { -// e.printStackTrace(); -// } } dto.add(ei); } @@ -253,6 +229,8 @@ ei.setSequencenumber(map.get("Sequencenumber") == null ? null : map.get("Sequencenumber").toString()); ei.setExecutingcode(map.get("executingcode") == null ? null : map.get("executingcode").toString()); ei.setProductName(map.get("ProductName") == null ? null : map.get("ProductName").toString()); + ei.setActualfeedrate(map.get("actualfeedrate") == null ? null : map.get("actualfeedrate").toString()); + ei.setActualspindlespeed(map.get("actualspindlespeed") == null ? null : map.get("actualspindlespeed").toString()); dto.add(ei); } if (dto.isEmpty()) { diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOverallEquipmentEfficiencyServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOverallEquipmentEfficiencyServiceImpl.java index 919e18b..6d3cb80 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOverallEquipmentEfficiencyServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcOverallEquipmentEfficiencyServiceImpl.java @@ -107,7 +107,6 @@ mdcOverallEquipmentEfficiency.setShift(shift); } -// BigDecimal shiftTimeCount = mdcDeviceCalendarService.computeShiftTimeCount(equipmentId, validDate); if (StringUtils.isEmpty(mdcOverallEquipmentEfficiency.getShift())) { mdcOverallEquipmentEfficiency.setShiftTimeCount(BigDecimal.ZERO); } else { @@ -159,7 +158,7 @@ */ // mdcOverallEquipmentEfficiency.getShiftTimeCount() - plannedMaintenanceDuration - conferenceTrainingDuration - otherRestDuration // 璐熻嵎鏃堕棿(鍒嗛挓) - BigDecimal loadTime = mdcOverallEquipmentEfficiency.getShiftTimeCount().subtract(plannedMaintenanceDuration).subtract(conferenceTrainingDuration).subtract(otherRestDuration); + BigDecimal loadTime = mdcOverallEquipmentEfficiency.getMonthActualWorkDayTimeCount().subtract(plannedMaintenanceDuration).subtract(conferenceTrainingDuration).subtract(otherRestDuration); if (loadTime.compareTo(BigDecimal.ZERO) < 0) { loadTime = BigDecimal.ZERO; } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/EquipmentDayUtilizationVo.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/EquipmentDayUtilizationVo.java new file mode 100644 index 0000000..e3e18fb --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/EquipmentDayUtilizationVo.java @@ -0,0 +1,29 @@ +package org.jeecg.modules.mdc.vo; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @author Lius + * @date 2024/3/29 11:25 + */ +@Data +public class EquipmentDayUtilizationVo { + /** + * 鏃ユ湡 + */ + private String date; + /** + * 鍒╃敤鐜� + */ + private BigDecimal utilizationRate = BigDecimal.ZERO; + /** + * 寮�鍔ㄧ巼 + */ + private BigDecimal startRate = BigDecimal.ZERO; + /** + * 寮�鏈虹巼 + */ + private BigDecimal openRate = BigDecimal.ZERO; +} diff --git a/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/MdcProductionMapper.java b/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/MdcProductionMapper.java index 5830282..de6a479 100644 --- a/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/MdcProductionMapper.java +++ b/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/MdcProductionMapper.java @@ -34,4 +34,11 @@ * @return */ String findFirstProduction(@Param("userId") String userId, @Param("productionId") String productionId); + + /** + * 鏍规嵁鐢ㄦ埛id鏌ヨ鐢ㄦ埛宸ユ鏉冮檺 + * @param userId + * @return + */ + String findThreeProductionId(@Param("userId") String userId); } diff --git a/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/MdcProductionMapper.xml b/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/MdcProductionMapper.xml index 7bede3f..119e935 100644 --- a/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/MdcProductionMapper.xml +++ b/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/MdcProductionMapper.xml @@ -26,4 +26,9 @@ <select id="findFirstProduction" resultType="java.lang.String"> SELECT TOP 1 t2.id FROM mdc_user_production t1 LEFT JOIN mdc_production t2 ON t1.pro_id = t2.id WHERE t1.user_id = #{ userId } AND t2.parent_id = #{productionId} </select> + + <!--鏍规嵁鐢ㄦ埛id鏌ヨ鐢ㄦ埛宸ユ鏉冮檺--> + <select id="findThreeProductionId" resultType="java.lang.String"> + SELECT TOP 1 t2.id id FROM mdc_user_production t1 LEFT JOIN mdc_production t2 ON t1.pro_id = t2.id WHERE t1.user_id = #{userId} AND t2.org_type = '3' + </select> </mapper> \ No newline at end of file diff --git a/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/IMdcProductionService.java b/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/IMdcProductionService.java index 8dd86b9..cfd203d 100644 --- a/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/IMdcProductionService.java +++ b/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/IMdcProductionService.java @@ -72,10 +72,15 @@ /** * 鏍规嵁鐢ㄦ埛id鍜岃溅闂磇d鑾峰彇鐢ㄦ埛鎷ユ湁鐨勮溅闂磇d + * * @param userId * @param productionId * @return */ String findFirstProduction(String userId, String productionId); + /** + * 鏍规嵁鐢ㄦ埛id鏌ヨ鐢ㄦ埛宸ユ鏉冮檺 + */ + String findThreeProductionId(String userId); } diff --git a/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcProductionServiceImpl.java b/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcProductionServiceImpl.java index d95c890..e0511bb 100644 --- a/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcProductionServiceImpl.java +++ b/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcProductionServiceImpl.java @@ -236,6 +236,14 @@ } /** + * 鏍规嵁鐢ㄦ埛id鏌ヨ鐢ㄦ埛宸ユ鏉冮檺 + */ + @Override + public String findThreeProductionId(String userId) { + return this.baseMapper.findThreeProductionId(userId); + } + + /** * delete 鏂规硶璋冪敤 閫掑綊鏌ユ壘瀛愰泦id */ private void checkChildrenExists(String id, List<String> idList) { -- Gitblit v1.9.3