diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProcessAndProcMat.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProcessAndProcMat.java new file mode 100644 index 0000000..ea41317 --- /dev/null +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProcessAndProcMat.java @@ -0,0 +1,29 @@ +package com.deer.wms.produce.manage.model; + +/** + * @Author: hy + * @Date: 2019/12/23 20:06 + * @Version 1.0 + */ +public class ProcessAndProcMat { + + private MtAloneProcessVo mtAloneProcessVo; + + private ProcessMaterialsVo[] processMaterialsVo; + + public MtAloneProcessVo getMtAloneProcessVo() { + return mtAloneProcessVo; + } + + public void setMtAloneProcessVo(MtAloneProcessVo mtAloneProcessVo) { + this.mtAloneProcessVo = mtAloneProcessVo; + } + + public ProcessMaterialsVo[] getProcessMaterialsVo() { + return processMaterialsVo; + } + + public void setProcessMaterialsVo(ProcessMaterialsVo[] processMaterialsVo) { + this.processMaterialsVo = processMaterialsVo; + } +} diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductAndProcess.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductAndProcess.java index c7d211b..e4c7188 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductAndProcess.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductAndProcess.java @@ -12,7 +12,7 @@ import java.util.List; public class ProductAndProcess { private ProductProcess productProcess;//批次生产加工信息 - private MtAloneProcessVo[] processesVo;//工序扩展信息 + private List processVoList;//工序扩展信息 public ProductProcess getProductProcess() { return productProcess; @@ -22,11 +22,11 @@ public class ProductAndProcess { this.productProcess = productProcess; } - public MtAloneProcessVo[] getProcessesVo() { - return processesVo; + public List getProcessVoList() { + return processVoList; } - public void setProcessesVo(MtAloneProcessVo[] processesVo) { - this.processesVo = processesVo; + public void setProcessVoList(List processVoList) { + this.processVoList = processVoList; } } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessBomPo.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessBomPo.java index 9ee75b9..3d7f1a7 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessBomPo.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessBomPo.java @@ -8,26 +8,17 @@ import java.util.List; * @Version 1.0 */ public class ProductProcessBomPo { - private String specification;//加工规格型号 + private ProductProcessBom productProcessBom;//产品bom - private String processContent;//加工描述内容 private List processBomList;//产品bom下的工序bom - public String getSpecification() { - return specification; + public ProductProcessBom getProductProcessBom() { + return productProcessBom; } - public void setSpecification(String specification) { - this.specification = specification; - } - - public String getProcessContent() { - return processContent; - } - - public void setProcessContent(String processContent) { - this.processContent = processContent; + public void setProductProcessBom(ProductProcessBom productProcessBom) { + this.productProcessBom = productProcessBom; } public List getProcessBomList() { 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 b60086e..d9e99f9 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 @@ -1,5 +1,6 @@ package com.deer.wms.produce.manage.service; +import com.deer.wms.intercept.common.data.CurrentUser; import com.deer.wms.produce.manage.model.*; import com.deer.wms.project.seed.core.service.Service; @@ -15,6 +16,8 @@ public interface MtAloneProcessService extends Service ProcessAndMaterials queryProcessDetail(MtAloneProcessParams params); + void saveProcAndProcMat(ProcessAndProcMat processAndProcMat, CurrentUser currentUser); + //List findList(MtAloneProcessParams params) ; 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 cfdc34d..5bcb2bf 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 @@ -1,5 +1,6 @@ package com.deer.wms.produce.manage.service.impl; +import com.deer.wms.intercept.common.data.CurrentUser; import com.deer.wms.produce.manage.dao.MtAloneProcessMapper; import com.deer.wms.produce.manage.model.*; import com.deer.wms.produce.manage.service.MtAloneProcessService; @@ -53,7 +54,6 @@ public class MtAloneProcessServiceImpl extends AbstractService findList(MtAloneProcessParams params) { diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProcessBomServiceImpl.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProcessBomServiceImpl.java index c3a5e3e..fe902c8 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProcessBomServiceImpl.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProcessBomServiceImpl.java @@ -73,11 +73,9 @@ public class ProcessBomServiceImpl extends AbstractService ProductProcessBom productProcessBom = productProcessBomService.findById(params.getProductProcessId()); ProductProcessBomPo productProcessBomPo = new ProductProcessBomPo(); + productProcessBomPo.setProductProcessBom(productProcessBom); productProcessBomPo.setProcessBomList(processBomList); - if(null != productProcessBom) { - productProcessBomPo.setSpecification(productProcessBom.getSpecification()); - productProcessBomPo.setProcessContent(productProcessBom.getProcessContent()); - } + return productProcessBomPo; } } 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 c3eb334..8ad1348 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 @@ -28,6 +28,9 @@ public class ProductProcessServiceImpl extends AbstractService processVoList = productAndProcess.getProcessVoList(); + if(null != processVoList) { + List processList = new ArrayList(processVoList.size()); + for (MtAloneProcess processVo : processVoList) { + MtAloneProcess process = new MtAloneProcess(); + BeanUtils.copyProperties(processVo, process); + process.setProductProcessId(productProcess.getId()); + processList.add(process); } + processService.save(processList); } } @Override public ProductAndProcess queryProductProcessDetail(ProductProcessParams params) { - //根据批次产品加工id查询批次产品加工单信息 + //根据批次生产加工id查询批次产品加工单信息 ProductProcess productProcess = productProcessMapper.selectByPrimaryKey(params.getProductProcessId()); //根据批次产品加工id查询工序信息 - List processVoList = processService.findProcessVoListByProductProcess(params); + List tempProcessVoList = processService.findProcessVoListByProductProcess(params); ProductAndProcess productAndProcess = new ProductAndProcess(); productAndProcess.setProductProcess(productProcess); - if(null != processVoList) { - MtAloneProcessVo[] processesVo = new MtAloneProcessVo[processVoList.size()]; - for (int i = 0; i < processesVo.length; i++) { - processesVo[i] = processVoList.get(i); + List processVoList; + if(null != tempProcessVoList) { + processVoList = new ArrayList(tempProcessVoList.size()); + for (MtAloneProcessVo processVo : tempProcessVoList) { + processVoList.add(processVo); } - productAndProcess.setProcessesVo(processesVo); + productAndProcess.setProcessVoList(processVoList); } return productAndProcess; diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MtAloneProcessController.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MtAloneProcessController.java index 9b62c26..aafa2d9 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MtAloneProcessController.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MtAloneProcessController.java @@ -138,13 +138,35 @@ public class MtAloneProcessController { @OperateLog(description = "根据工序id查询工序详情及物料信息", type = "查询") @GetMapping("/query/process/detail") public Result queryProcessDetail(MtAloneProcessParams params, @ApiIgnore @User CurrentUser currentUser) { - //if(currentUser==null){ - // return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); - //} + if(currentUser==null){ + return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); + } - params.setCompanyId(1); + params.setCompanyId(currentUser.getCompanyId()); PageHelper.startPage(params.getPageNum(), params.getPageSize()); ProcessAndMaterials processAndMaterials = mtAloneProcessService.queryProcessDetail(params); return ResultGenerator.genSuccessResult(processAndMaterials); } + + /** + * hy正在用 + * 工序处理完毕时,点击提交同时更新工序信息、保存物料信息、更新物料库存信息 + * @param productAndProcess + * @param currentUser + * @return + */ + @ApiOperation(value = "工序及物料信息保存", notes = "工序及物料信息保存") + @ApiImplicitParams({ + @ApiImplicitParam(name = "productAndProcess", value = "批次生产加工及工序", paramType = "body", dataType = "ProductAndProcess", required = true) + }) + @OperateLog(description = "工序及物料信息保存", type = "更新、保存") + @PostMapping("/saveProcAndProcMat") + public Result saveProcAndProcMat(@RequestBody ProcessAndProcMat processAndProcMat, @ApiIgnore @User CurrentUser currentUser) { + //if(currentUser==null){ + // return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); + //} + + mtAloneProcessService.saveProcAndProcMat(processAndProcMat, currentUser); + return ResultGenerator.genSuccessResult(); + } } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/ProcessBomController.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/ProcessBomController.java index 8498b64..c2fa1ec 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/ProcessBomController.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/ProcessBomController.java @@ -161,10 +161,8 @@ public class ProcessBomController { */ @ApiOperation(value = "根据产品bom的id获取产品bom部分数据和工序数据", notes = "根据产品bom的id获取产品bom部分数据和工序数据") @ApiImplicitParams({ - @ApiImplicitParam(name = "access-token", value = "token", paramType = "header", dataType = "String", required = true), @ApiImplicitParam(name = "productProcessId", value = "产品bom的id", paramType = "query", dataType = "int", required = true), @ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false) - }) @GetMapping("/and/product/bom/by/prodbom") public Result ProductAndProcessBomByProdBom(ProcessBomParams params, @ApiIgnore @User CurrentUser currentUser){