diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MtAloneProcessService.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MtAloneProcessService.java index 87bf193..7d339a7 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MtAloneProcessService.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/MtAloneProcessService.java @@ -17,4 +17,6 @@ public interface MtAloneProcessService extends Service ProcessHo queryProcessDetail(MtAloneProcessParams params); void saveProcAndProcMat(ProcessAndProcMat processAndProcMat, CurrentUser currentUser); + + void updateProcess(ProcessHo processHo); } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProductProcessService.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProductProcessService.java index 4a68be4..8ba52f2 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProductProcessService.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProductProcessService.java @@ -21,4 +21,6 @@ public interface ProductProcessService extends Service ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params); void addProduceProcess(ProductProcessHo productProcessHo, CurrentUser currentUser); + + } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MtAloneProcessServiceImpl.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MtAloneProcessServiceImpl.java index 39b1f82..e7e8723 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MtAloneProcessServiceImpl.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/MtAloneProcessServiceImpl.java @@ -14,6 +14,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -87,39 +88,38 @@ public class MtAloneProcessServiceImpl extends AbstractService procMatBomVoList = processMaterialsBomService.findProcMatBomVoListByProcBom(procMatBomParams); - - ////由物料bom对物料赋值,保存物料,其中前端赋值物料用量 - //MtAloneProcessParams processParams = new MtAloneProcessParams(); - //processParams.setProcessId(mtAloneProcessVo.getId()); - //List procMatVoList = processMaterialsService.findProcMatVoListByProcess(processParams); - //if(null == procMatVoList){ - // procMatVoList = new ArrayList(procMatBomVoList.size()); - // Date date = new Date(); - // for (ProcessMaterialsBomVo procMatBomVo : procMatBomVoList){ - // ProcessMaterialsVo procMatVo = new ProcessMaterialsVo(); - // procMatVo.setCreateTime(date); - // procMatVo.setUpdateTime(date); - // procMatVo.setStatus(0); - // procMatVo.setProcessId(mtAloneProcessVo.getId()); - // procMatVo.setMaterialsBomId(procMatBomVo.getId()); - // procMatVo.setMaterialsName(procMatBomVo.getMaterialsName()); - // procMatVo.setCode(ProduceManagePublicMethod.creatUniqueCode("WL")); - // procMatVo.setSpecification(procMatBomVo.getSpecification()); - // procMatVo.setUnitId(procMatBomVo.getUnitId()); - // procMatVo.setCompanyId(currentUser.getCompanyId()); - // procMatVoList.add(procMatVo); - // } - // processMaterialsService.save(); - //}else{ - // for () - //} - - } + @Override + public void updateProcess(ProcessHo processHo) { + Date date = new Date(); + MtAloneProcess process = new MtAloneProcess(); + processHo.setUpdateTime(date); + BeanUtils.copyProperties(processHo, process); + this.update(process); + + //if(null != processHo.getProcessMaterialsVoList()) { + // List 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){ + ProcessMaterials processMaterials = new ProcessMaterials(); + processMaterialsVo.setUpdateTime(date); + BeanUtils.copyProperties(processMaterialsVo, processMaterials); + processMaterialsService.update(processMaterials); + } + + } + } - //@Override - //public List findList(MtAloneProcessParams params) { - // return mtAloneProcessMapper.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 bb8bd6d..0dc460e 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 @@ -242,4 +242,6 @@ public class ProductProcessServiceImpl extends AbstractService