From 81eae83295642387de38a97fdc5a35f485307587 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期四, 07 十一月 2024 22:20:11 +0800 Subject: [PATCH] license --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/service/impl/MdcProductDayScheduleServiceImpl.java | 31 ++++++++++++++++++++++++++----- 1 files changed, 26 insertions(+), 5 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/service/impl/MdcProductDayScheduleServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/service/impl/MdcProductDayScheduleServiceImpl.java index 89ab5c2..23169ee 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/service/impl/MdcProductDayScheduleServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdcJc/service/impl/MdcProductDayScheduleServiceImpl.java @@ -1,6 +1,7 @@ package org.jeecg.modules.mdcJc.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.mdc.mapper.MdcEquipmentMapper; import org.jeecg.modules.mdc.util.DateUtils; import org.jeecg.modules.mdcJc.entity.MdcProductDayschedule; import org.jeecg.modules.mdcJc.entity.ProductDayschedule; @@ -14,8 +15,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDate; -import java.util.ArrayList; -import java.util.List; +import java.util.*; /** * @author Lius @@ -26,6 +26,9 @@ @Resource private IClassMonthlyScheduleService classMonthlyScheduleService; + + @Resource + private MdcEquipmentMapper mdcEquipmentMapper; @Override @@ -40,10 +43,28 @@ this.removeBatchByIds(mdcListIds); } List<MdcProductDayschedule> mesC = new ArrayList<>(); + Map<String, String> map = new HashMap<>(); + map.put("5899-8026", "1818119280110690306"); + map.put("5899-8027", "1818119094416269313"); + map.put("5899-8060", "1818118942234337281"); + map.put("5899-8061", "1818119019862515714"); for (ProductDayschedule c : list) { - MdcProductDayschedule mdc = new MdcProductDayschedule(); - BeanMapper.copy(c, mdc); - mesC.add(mdc); + if (map.containsKey(c.getEquipmentId())) { + List<String> productionIds = Arrays.asList(map.get(c.getEquipmentId()).split(",")); + List<String> equipmentList = mdcEquipmentMapper.queryIdsByProductions(productionIds); + if (equipmentList != null && !equipmentList.isEmpty()) { + for (String equipmentId : equipmentList) { + MdcProductDayschedule mdc = new MdcProductDayschedule(); + BeanMapper.copy(c, mdc); + mdc.setEquipmentId(equipmentId); + mesC.add(mdc); + } + } + } else { + MdcProductDayschedule mdc = new MdcProductDayschedule(); + BeanMapper.copy(c, mdc); + mesC.add(mdc); + } } boolean b = this.saveBatch(mesC); return b; -- Gitblit v1.9.3