From ae7bb481ccb7e67e23c33641bfbe5b0b00bb9bc5 Mon Sep 17 00:00:00 2001 From: hy2250089 Date: Thu, 16 Jan 2020 09:32:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=B7=A5=E5=8D=95=E7=89=A9=E6=96=99?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/dao/ProcessMaterialsMapper.java | 2 + .../manage/mapper/ProcessMaterialsMapper.xml | 11 ++++++ .../service/ProcessMaterialsService.java | 1 + .../impl/MaterialsInfoServiceImpl.java | 2 +- .../impl/MtAloneProcessServiceImpl.java | 31 +++++----------- .../impl/ProcessMaterialsServiceImpl.java | 8 ++-- .../impl/ProductProcessServiceImpl.java | 37 ++++++++++--------- .../manage/web/MaterialsInfoController.java | 8 ++-- 8 files changed, 52 insertions(+), 48 deletions(-) diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProcessMaterialsMapper.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProcessMaterialsMapper.java index a5216a0..f085d23 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProcessMaterialsMapper.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProcessMaterialsMapper.java @@ -10,4 +10,6 @@ import java.util.List; public interface ProcessMaterialsMapper extends Mapper { List findProcMatVoListByProcess(MtAloneProcessParams params); + + void updateList(List procMatList); } \ No newline at end of file diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProcessMaterialsMapper.xml b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProcessMaterialsMapper.xml index df8ddb4..a5d2ae4 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProcessMaterialsMapper.xml +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProcessMaterialsMapper.xml @@ -55,4 +55,15 @@ ORDER BY procmaterials.id + + + UPDATE mt_alone_process_materials + + dosage = #{item.dosage}, + update_time = #{item.updateTime} + + WHERE id = #{item.id} AND company_id = #{item.companyId} + + + \ No newline at end of file diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProcessMaterialsService.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProcessMaterialsService.java index 56ec91e..3859910 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProcessMaterialsService.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProcessMaterialsService.java @@ -14,4 +14,5 @@ import java.util.List; public interface ProcessMaterialsService extends Service { List findProcMatVoListByProcess(MtAloneProcessParams params); + void updateList(List procMatList); } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MaterialsInfoServiceImpl.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MaterialsInfoServiceImpl.java index c68f750..c98824b 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MaterialsInfoServiceImpl.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MaterialsInfoServiceImpl.java @@ -69,7 +69,7 @@ public class MaterialsInfoServiceImpl extends AbstractService processBomList = processBomService.findListByProductBom(params); List processList = new ArrayList(); - if(processBomList!=null && processBomList.size()!=0){ + if (processBomList != null && processBomList.size() != 0) { //循环工序bom给工序初步赋值,先不保存 for (ProcessBom processBom : processBomList) { MtAloneProcess process = new MtAloneProcess(); @@ -66,9 +66,9 @@ public class MtAloneProcessServiceImpl extends AbstractService procMatVoList = processMaterialsService.findProcMatVoListByProcess(params); ProcessHo processHo = new ProcessHo(); - if(null != processVo){ - System.out.println("----------"+processVo.getId()); - System.out.println("----------"+processVo.getProcessName()); + if (null != processVo) { + System.out.println("----------" + processVo.getId()); + System.out.println("----------" + processVo.getProcessName()); BeanUtils.copyProperties(processVo, processHo); processHo.setProcessMaterialsVoList(procMatVoList); } @@ -98,27 +98,16 @@ public class MtAloneProcessServiceImpl extends AbstractService procMatVoList = processHo.getProcessMaterialsVoList(); - // List procMatList = new ArrayList(procMatVoList.size()); - // for (ProcessMaterialsVo processMaterialsVo : procMatVoList){ - // ProcessMaterials processMaterials = new ProcessMaterials(); - // processMaterialsVo.setUpdateTime(date); - // BeanUtils.copyProperties(processMaterialsVo, processMaterials); - // procMatList.add(processMaterials); - // } - // processMaterialsService.update(procMatList); - //} - - if(null != processHo.getProcessMaterialsVoList()) { - List procMatVoList = processHo.getProcessMaterialsVoList(); - for (ProcessMaterialsVo processMaterialsVo : procMatVoList){ + List procMatVoList = processHo.getProcessMaterialsVoList(); + if (null != procMatVoList && procMatVoList.size() != 0) { + List procMatList = new ArrayList(procMatVoList.size()); + for (ProcessMaterialsVo processMaterialsVo : procMatVoList) { ProcessMaterials processMaterials = new ProcessMaterials(); processMaterialsVo.setUpdateTime(date); BeanUtils.copyProperties(processMaterialsVo, processMaterials); - processMaterialsService.update(processMaterials); + procMatList.add(processMaterials); } - + processMaterialsService.updateList(procMatList); } } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProcessMaterialsServiceImpl.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProcessMaterialsServiceImpl.java index 9a9cdfa..46ee8e2 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProcessMaterialsServiceImpl.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProcessMaterialsServiceImpl.java @@ -28,9 +28,9 @@ public class ProcessMaterialsServiceImpl extends AbstractService procMatList) { + processMaterialsMapper.updateList(procMatList); + } - //@Override - //public List findList(ProcessMaterialsParams params) { - // return processMaterialsMapper.findList(params); - //} } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProductProcessServiceImpl.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProductProcessServiceImpl.java index 431cd7d..580a984 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProductProcessServiceImpl.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProductProcessServiceImpl.java @@ -60,7 +60,7 @@ public class ProductProcessServiceImpl extends AbstractService processVoList = productAndProcess.getProcessVoList(); - if(null != processVoList) { + if (null != processVoList) { List processList = new ArrayList(processVoList.size()); for (MtAloneProcess processVo : processVoList) { MtAloneProcess process = new MtAloneProcess(); @@ -104,7 +104,7 @@ public class ProductProcessServiceImpl extends AbstractService tempProcessVoList = processService.findProcessVoListByProductProcess(params); ProductProcessHo productProcessHo = new ProductProcessHo(); - if(null != productProcess) { + if (null != productProcess) { BeanUtils.copyProperties(productProcess, productProcessHo); if (null != tempProcessVoList) { List processHoList = new ArrayList(tempProcessVoList.size()); @@ -127,7 +127,7 @@ public class ProductProcessServiceImpl extends AbstractService processHoList = productProcessHo.getProcessHoList(); - List processList; - List processMaterialsList; - if((null!=processHoList) && (0!=processHoList.size())) { - processList = new ArrayList(processHoList.size()); - processMaterialsList = new ArrayList(); + if (null != processHoList && processHoList.size() != 0) { + List processList = new ArrayList(processHoList.size()); for (ProcessHo processHo : processHoList) { MtAloneProcess process = new MtAloneProcess(); BeanUtils.copyProperties(processHo, process); @@ -210,12 +207,18 @@ public class ProductProcessServiceImpl extends AbstractService processMaterialsList = new ArrayList(); + for (int i = 0; i < processHoList.size(); i++) { + ProcessHo processHo = processHoList.get(i); + MtAloneProcess process = processList.get(i); List processMaterialsVoList = processHo.getProcessMaterialsVoList(); - if((null!=processMaterialsVoList) && (0!=processMaterialsVoList.size())){ + if (null != processMaterialsVoList && processMaterialsVoList.size() != 0) { for (ProcessMaterialsVo processMaterialsVo : processMaterialsVoList) { ProcessMaterials processMaterials = new ProcessMaterials(); BeanUtils.copyProperties(processMaterialsVo, processMaterials); @@ -225,20 +228,18 @@ public class ProductProcessServiceImpl extends AbstractService