From a3cfd941f3ccb05906ecbe99e6993f96770b51ed Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期四, 10 七月 2025 10:43:05 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcProcessQuantityServiceImpl.java | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcProcessQuantityServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcProcessQuantityServiceImpl.java index 1082564..b2c78c8 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcProcessQuantityServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcProcessQuantityServiceImpl.java @@ -16,11 +16,13 @@ import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -141,4 +143,45 @@ public MdcProcessQuantityDto findById(String id) { return this.baseMapper.findById(id); } + + + /** + * 娣诲姞鏁版嵁 + * + * @param mdcProcessQuantity + * @return + */ + @Override + public boolean addData(MdcProcessQuantity mdcProcessQuantity) { + boolean result = false; + String[] equipmentIds = mdcProcessQuantity.getEquipmentIds().split(","); + for (String equipmentId : equipmentIds) { + MdcProcessQuantity processQuantity = new MdcProcessQuantity(); + BeanUtils.copyProperties(mdcProcessQuantity, processQuantity); + processQuantity.setEquipmentId(equipmentId); + boolean b = super.save(processQuantity); + if (b) { + result = true; + } + } + return result; + } + + /** + * + * @param equipmentId + * @param validDate + * @return + */ + @Override + public BigDecimal findTemporarily(String equipmentId, String validDate) { + BigDecimal result = BigDecimal.ZERO; + List<MdcProcessQuantityDto> mdcProcessQuantityList = this.baseMapper.findList(equipmentId, validDate); + if (mdcProcessQuantityList != null && !mdcProcessQuantityList.isEmpty()) { + for (MdcProcessQuantityDto mdcProcessQuantity : mdcProcessQuantityList) { + result = result.add(new BigDecimal(mdcProcessQuantity.getProcessQuantity()).multiply(new BigDecimal(mdcProcessQuantity.getDuration()))); + } + } + return result; + } } -- Gitblit v1.9.3