diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProcessBomMapper.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProcessBomMapper.java index 01cae38..542769f 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProcessBomMapper.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProcessBomMapper.java @@ -17,6 +17,7 @@ public interface ProcessBomMapper extends Mapper { void insertProcessMaterialsBom(List list); List findListByProductBom(ProcessBomParams params); + List findListByProductBomId(ProcessBomParams params); List findListByProductNameId(ProcessBomParams params); diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProcessMaterialsBomMapper.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProcessMaterialsBomMapper.java index 1666b68..7246b8c 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProcessMaterialsBomMapper.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProcessMaterialsBomMapper.java @@ -14,7 +14,6 @@ public interface ProcessMaterialsBomMapper extends Mapper { List findMaterilaListByProcessBomId(ProcessBom processBom); - void insertOrUpdate(List processMaterialsBomList); List findProcMatBomVoListByProcBom(ProcessMaterialsBomParams procMatBomParams); diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProductProcessBomMapper.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProductProcessBomMapper.java index 45e76b7..03ade96 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProductProcessBomMapper.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/dao/ProductProcessBomMapper.java @@ -19,4 +19,6 @@ public interface ProductProcessBomMapper extends Mapper { List findListById(ProductProcessBomParams params); List findByProductNameAndProductNum(ProductProcessBomParams mtAloneProductProcessBomParams); + + ProductProcessBom selectByProdProcBom(ProductProcessBomParams params); } \ No newline at end of file diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProcessMaterialsBomMapper.xml b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProcessMaterialsBomMapper.xml index 03c8f5a..2ab49ae 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProcessMaterialsBomMapper.xml +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProcessMaterialsBomMapper.xml @@ -66,7 +66,7 @@ LEFT JOIN unit ON matbom.unit_id = unit.unit_id AND matbom.company_id = unit.company_id - AND product.company_id = #{companyId} + AND matbom.company_id = #{companyId} AND matbom.process_bom_id = #{processBomId} diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProductProcessBomMapper.xml b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProductProcessBomMapper.xml index deb4600..445b26d 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProductProcessBomMapper.xml +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProductProcessBomMapper.xml @@ -72,17 +72,7 @@ - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProcessBomHo.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProcessBomHo.java new file mode 100644 index 0000000..8298916 --- /dev/null +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProcessBomHo.java @@ -0,0 +1,20 @@ +package com.deer.wms.produce.manage.model; + +import java.util.List; + +/** + * @Author: hy + * @Date: 2019/12/27 10:51 + * @Version 1.0 + */ +public class ProcessBomHo extends ProcessBom { + private List procMatBomVoList; + + public List getProcMatBomVoList() { + return procMatBomVoList; + } + + public void setProcMatBomVoList(List procMatBomVoList) { + this.procMatBomVoList = procMatBomVoList; + } +} diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProcessHo.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProcessHo.java new file mode 100644 index 0000000..cd01de2 --- /dev/null +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProcessHo.java @@ -0,0 +1,21 @@ +package com.deer.wms.produce.manage.model; + +import java.util.List; + +/** + * @Author: hy + * @Date: 2019/12/27 18:26 + * @Version 1.0 + */ +public class ProcessHo extends MtAloneProcessVo{ + + private List processMaterialsVoList; + + public List getProcessMaterialsVoList() { + return processMaterialsVoList; + } + + public void setProcessMaterialsVoList(List processMaterialsVoList) { + this.processMaterialsVoList = processMaterialsVoList; + } +} diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessBomHo.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessBomHo.java new file mode 100644 index 0000000..d056e4d --- /dev/null +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessBomHo.java @@ -0,0 +1,40 @@ +package com.deer.wms.produce.manage.model; + +import java.util.List; + +/** + * @Author: hy + * @Date: 2019/12/27 10:48 + * @Version 1.0 + */ +public class ProductProcessBomHo { + private Integer prodProcBomId; + + private String prodProcBomName; + + private List processBomHoList; + + public Integer getProdProcBomId() { + return prodProcBomId; + } + + public void setProdProcBomId(Integer prodProcBomId) { + this.prodProcBomId = prodProcBomId; + } + + public String getProdProcBomName() { + return prodProcBomName; + } + + public void setProdProcBomName(String prodProcBomName) { + this.prodProcBomName = prodProcBomName; + } + + public List getProcessBomHoList() { + return processBomHoList; + } + + public void setProcessBomHoList(List processBomHoList) { + this.processBomHoList = processBomHoList; + } +} diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessBomParams.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessBomParams.java index 77d743e..f0d71e4 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessBomParams.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessBomParams.java @@ -15,7 +15,7 @@ public class ProductProcessBomParams extends QueryParams { */ private Integer productId; - private String productBomId; + private Integer productBomId; private String productName; @@ -141,11 +141,11 @@ public class ProductProcessBomParams extends QueryParams { this.productId = productId; } - public String getProductBomId() { + public Integer getProductBomId() { return productBomId; } - public void setProductBomId(String productBomId) { + public void setProductBomId(Integer productBomId) { this.productBomId = productBomId; } } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessHo.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessHo.java new file mode 100644 index 0000000..6d4bfc0 --- /dev/null +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessHo.java @@ -0,0 +1,20 @@ +package com.deer.wms.produce.manage.model; + +import java.util.List; + +/** + * @Author: hy + * @Date: 2019/12/27 15:33 + * @Version 1.0 + */ +public class ProductProcessHo extends ProductProcess{ + private List processHoList; + + public List getProcessHoList() { + return processHoList; + } + + public void setProcessHoList(List processHoList) { + this.processHoList = processHoList; + } +} diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProductProcessBomService.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProductProcessBomService.java index dd31aa2..cbdbed2 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProductProcessBomService.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProductProcessBomService.java @@ -1,9 +1,6 @@ package com.deer.wms.produce.manage.service; -import com.deer.wms.produce.manage.model.ProductProcessBom; -import com.deer.wms.produce.manage.model.ProductProcessBomDto; -import com.deer.wms.produce.manage.model.ProductProcessBomParams; -import com.deer.wms.produce.manage.model.ProductProcessBomVO; +import com.deer.wms.produce.manage.model.*; import com.deer.wms.project.seed.core.service.Service; import java.util.List; @@ -23,6 +20,8 @@ public interface ProductProcessBomService extends Service void saveProdAndProc(ProductAndProcess productAndProcess, CurrentUser currentUser); ProductAndProcess queryProductProcessDetail(ProductProcessParams params); + + void saveInitial(ProductProcessHo productProcessHo, CurrentUser currentUser); + + ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params); } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProductProcessBomServiceImpl.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProductProcessBomServiceImpl.java index 9beed59..161c880 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProductProcessBomServiceImpl.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/impl/ProductProcessBomServiceImpl.java @@ -4,10 +4,12 @@ import com.deer.wms.produce.manage.dao.ProcessBomMapper; import com.deer.wms.produce.manage.dao.ProcessMaterialsBomMapper; import com.deer.wms.produce.manage.dao.ProductProcessBomMapper; import com.deer.wms.produce.manage.model.*; +import com.deer.wms.produce.manage.service.ProcessMaterialsBomService; import com.deer.wms.produce.manage.service.ProductProcessBomService; import com.deer.wms.project.seed.core.service.AbstractService; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -32,6 +34,9 @@ public class ProductProcessBomServiceImpl extends AbstractService findProBomAndProList(ProductProcessBomParams params) { @@ -134,4 +139,41 @@ public class ProductProcessBomServiceImpl extends AbstractService processBomList = processBomMapper.findListByProductBom(processBomParams); + List processBomHoList = null; + if(null != processBomList){ + processBomHoList = new ArrayList(processBomList.size()); + for(ProcessBom processBom : processBomList){ + ProcessBomHo processBomHo = new ProcessBomHo(); + BeanUtils.copyProperties(processBom, processBomHo); + processBomHoList.add(processBomHo); + //物料bom获取 + ProcessMaterialsBomParams procMatBomParams = new ProcessMaterialsBomParams(); + procMatBomParams.setProcessBomId(processBom.getId()); + procMatBomParams.setCompanyId(processBomParams.getCompanyId()); + List procMatBomVoList = processMaterialsBomService.findProcMatBomVoListByProcBom(procMatBomParams); + processBomHo.setProcMatBomVoList(procMatBomVoList); + } + } + productProcessBomHo.setProcessBomHoList(processBomHoList); + + return productProcessBomHo; + } + + @Override + public ProductProcessBom selectByProdProcBom(ProductProcessBomParams params) { + return productProcessBomMapper.selectByProdProcBom(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 8ad1348..3c1cab7 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 @@ -5,9 +5,7 @@ import com.deer.wms.produce.manage.constant.ProduceManageConstant; import com.deer.wms.produce.manage.constant.ProduceManagePublicMethod; import com.deer.wms.produce.manage.dao.ProductProcessMapper; import com.deer.wms.produce.manage.model.*; -import com.deer.wms.produce.manage.service.MtAloneProcessService; -import com.deer.wms.produce.manage.service.ProcessBomService; -import com.deer.wms.produce.manage.service.ProductProcessService; +import com.deer.wms.produce.manage.service.*; import com.deer.wms.project.seed.core.service.AbstractService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -37,6 +35,12 @@ public class ProductProcessServiceImpl extends AbstractService findList(ProductProcessParams params) { return productProcessMapper.findList(params); @@ -110,4 +114,87 @@ 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 ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params) { + ProductProcessHo productProcessHo = new ProductProcessHo(); + + //批次产品加工单初步赋值,关联bom + ProductProcessBom productProcessBom = productProcessBomService.selectByProdProcBom(params); + productProcessHo.setProductBomId(productProcessBom.getId()); + productProcessHo.setProductProcessBomName(productProcessBom.getProductProcessName()); + //工序初步赋值,关联bom + ProcessBomParams processBomParams = new ProcessBomParams(); + processBomParams.setProductProcessId(params.getProductBomId()); + processBomParams.setCompanyId(params.getCompanyId()); + List processBomList = processBomService.findListByProductBom(processBomParams); + List processHoList; + if(null != processBomList){ + processHoList = new ArrayList(processBomList.size()); + for(ProcessBom processBom : processBomList){ + ProcessHo processHo = new ProcessHo(); + processHo.setProcessBomId(processBom.getId()); + processHo.setProcessBomName(processBom.getProcessName()); + processHo.setProcessStep(processBom.getProcessStep()); + processHo.setProcessName(processBom.getProcessName()); + processHo.setProcessContent(processBom.getProcessContent()); + processHo.setSpecification(processBom.getSpecification()); + + //物料初步赋值,关联bom + ProcessMaterialsBomParams procMatBomParams = new ProcessMaterialsBomParams(); + procMatBomParams.setProcessBomId(processBom.getId()); + procMatBomParams.setCompanyId(processBomParams.getCompanyId()); + List procMatBomVoList = processMaterialsBomService.findProcMatBomVoListByProcBom(procMatBomParams); + List procMatVoList; + if(null != procMatBomVoList){ + procMatVoList = new ArrayList(procMatBomVoList.size()); + for (ProcessMaterialsBomVo procMatBomVo : procMatBomVoList){ + ProcessMaterialsVo procMatVo = new ProcessMaterialsVo(); + procMatVo.setMaterialsBomId(procMatBomVo.getId()); + procMatVo.setMaterialsName(procMatBomVo.getMaterialsName()); + procMatVo.setSpecification(procMatBomVo.getSpecification()); + procMatVo.setUnitId(procMatBomVo.getUnitId()); + procMatVo.setUnitName0(procMatBomVo.getUnitName()); + procMatVoList.add(procMatVo); + } + processHo.setProcessMaterialsVoList(procMatVoList); + } + processHoList.add(processHo); + } + productProcessHo.setProcessHoList(processHoList); + } + + return productProcessHo; + + } + } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/ProductProcessBomController.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/ProductProcessBomController.java index ddb29a5..26f85bf 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/ProductProcessBomController.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/ProductProcessBomController.java @@ -2,10 +2,7 @@ package com.deer.wms.produce.manage.web; import com.deer.wms.intercept.annotation.User; import com.deer.wms.intercept.common.data.CurrentUser; -import com.deer.wms.produce.manage.model.ProductProcessBom; -import com.deer.wms.produce.manage.model.ProductProcessBomDto; -import com.deer.wms.produce.manage.model.ProductProcessBomParams; -import com.deer.wms.produce.manage.model.ProductProcessBomVO; +import com.deer.wms.produce.manage.model.*; import com.deer.wms.produce.manage.service.ProductProcessBomService; import com.deer.wms.project.seed.annotation.OperateLog; import com.deer.wms.project.seed.constant.SystemManageConstant; @@ -183,6 +180,24 @@ public class ProductProcessBomController { return ResultGenerator.genSuccessResult(pageInfo); } + /** + * hy暂时没用 + * 根据产品bom的id获取产品bom、工序bom、物料bom信息 + * @param params + * @param currentUser + * @return + */ + @GetMapping("/findAllBomByProdProcBom") + public Result findAllBomByProdProcBom(ProductProcessBomParams params, @ApiIgnore @User CurrentUser currentUser) { + if(currentUser==null){ + return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); + } + + params.setCompanyId(currentUser.getCompanyId()); + ProductProcessBomHo productProcessBomHo = productProcessBomService.findAllBomByProdProcBom(params); + return ResultGenerator.genSuccessResult(productProcessBomHo); + } + /** * author:caixiang * diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/ProductProcessController.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/ProductProcessController.java index a674c09..7f5a296 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/ProductProcessController.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/ProductProcessController.java @@ -3,10 +3,7 @@ package com.deer.wms.produce.manage.web; import com.deer.wms.intercept.annotation.Authority; import com.deer.wms.intercept.annotation.User; import com.deer.wms.intercept.common.data.CurrentUser; -import com.deer.wms.produce.manage.model.ProductAndProcess; -import com.deer.wms.produce.manage.model.ProductProcess; -import com.deer.wms.produce.manage.model.ProductProcessParams; -import com.deer.wms.produce.manage.model.ProductProcessVo; +import com.deer.wms.produce.manage.model.*; import com.deer.wms.produce.manage.service.ProcessBomService; import com.deer.wms.produce.manage.service.ProductProcessService; import com.deer.wms.project.seed.annotation.OperateLog; @@ -111,7 +108,7 @@ public class ProductProcessController { } /** - * hy正在用 + * hy停用 * 新建批次产品加工完毕时,点击提交同时保存产品加工和工序信息 * @param productAndProcess * @param currentUser @@ -159,4 +156,48 @@ public class ProductProcessController { return ResultGenerator.genSuccessResult(productAndProcess); } + /** + * hy正在用 + * 新建批次产品加工时,选择产品bom后, + * 生成加工单、工序、物料信息并对其初步赋值,用于表格展示 + * @param + * @param currentUser + * @return + */ + @GetMapping("/initialProdProcByProdProcBom") + public Result initialProdProcByProdProcBom(ProductProcessBomParams params, @ApiIgnore @User CurrentUser currentUser) { + //if(currentUser==null){ + // return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); + //} + + params.setCompanyId(1); + ProductProcessHo productProcessHo = productProcessService.initialProdProcByProdProcBom(params); + return ResultGenerator.genSuccessResult(productProcessHo); + } + + + /** + * hy正在用 + * 首次新建批次产品加工时,点击提交初步根据bom对加工单、工序、物料信息赋值,并保存 + * @param + * @param currentUser + * @return + */ + //@ApiOperation(value = "批次生产加工初步保存", notes = "批次生产加工初步保存") + //@ApiImplicitParams({ + // @ApiImplicitParam(name = "productAndProcess", value = "批次生产加工信息", paramType = "body", dataType = "ProductAndProcess", required = true) + //}) + //@OperateLog(description = "批次生产加工初步保存", type = "保存") + //@GetMapping("/findAllBomByProdProcBom") + //public Result findAllBomByProdProcBom(ProductProcessBomParams params, @ApiIgnore @User CurrentUser currentUser) { + // if(currentUser==null){ + // return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); + // } + // + // params.setCompanyId(currentUser.getCompanyId()); + // ProductProcessBomHo productProcessBomHo = productProcessBomService.findAllBomByProdProcBom(params); + // return ResultGenerator.genSuccessResult(productProcessBomHo); + //} + + }