From 4e5af86ad91040f4c9a2656396079b7192c8bdcf Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期一, 08 七月 2024 14:33:34 +0800 Subject: [PATCH] update --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcProcessQuantityServiceImpl.java | 31 ++++++++++++++++++++++++++++--- 1 files changed, 28 insertions(+), 3 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 6cbc674..371afbc 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 @@ -12,9 +12,11 @@ import org.jeecg.modules.mdc.mapper.MdcProcessQuantityMapper; import org.jeecg.modules.mdc.service.IMdcEquipmentService; import org.jeecg.modules.mdc.service.IMdcProcessQuantityService; +import org.jeecg.modules.mdc.vo.MdcProcessQuantityVo; 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; @@ -47,7 +49,7 @@ * @return */ @Override - public IPage<MdcProcessQuantityDto> pageList(String userId, Page<MdcProcessQuantityDto> page, MdcProcessQuantity mdcProcessQuantity, HttpServletRequest req) { + public IPage<MdcProcessQuantityDto> pageList(String userId, Page<MdcProcessQuantityDto> page, MdcProcessQuantityVo mdcProcessQuantity, HttpServletRequest req) { List<String> equipmentIds = new ArrayList<>(); if (StringUtils.isNotEmpty(mdcProcessQuantity.getParentId()) && StringUtils.isEmpty(mdcProcessQuantity.getEquipmentId())) { if ("2".equals(mdcProcessQuantity.getTypeTree())) { @@ -89,7 +91,7 @@ * @return */ @Override - public ModelAndView exportXls(String userId, MdcProcessQuantity mdcProcessQuantity) { + public ModelAndView exportXls(String userId, MdcProcessQuantityVo mdcProcessQuantity) { List<String> equipmentIds = new ArrayList<>(); if (StringUtils.isNotEmpty(mdcProcessQuantity.getParentId()) && StringUtils.isEmpty(mdcProcessQuantity.getEquipmentId())) { if ("2".equals(mdcProcessQuantity.getTypeTree())) { @@ -127,7 +129,7 @@ //鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛 //update-begin---author:wangshuai ---date:20211227 for锛歔JTC-116]瀵煎嚭浜哄啓姝讳簡------------ LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("鍔犲伐鏁伴噺鍒楄〃鏁版嵁", "瀵煎嚭浜�:" + user.getRealname(), "瀵煎嚭淇℃伅")); + mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("鍔犲伐鏁伴噺鍒楄〃鏁版嵁", "瀵煎嚭浜�:" + user.getRealname(), "鍔犲伐鏁伴噺")); //update-end---author:wangshuai ---date:20211227 for锛歔JTC-116]瀵煎嚭浜哄啓姝讳簡------------ mv.addObject(NormalExcelConstants.DATA_LIST, processQuantityDtos); return mv; @@ -140,4 +142,27 @@ 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; + } } -- Gitblit v1.9.3