diff --git a/.idea/workspace.xml b/.idea/workspace.xml index cf10f7f..2718949 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,17 +5,32 @@ - - - + + - - + + + + + + + + + + + + + + + + + + @@ -62,100 +77,55 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -164,8 +134,18 @@ - - + + + + + + + + + + + + @@ -173,6 +153,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -185,8 +208,6 @@ - bar - findby materialsOutgoingLogDTOService ProductDetDto ProductCombinationMap @@ -215,6 +236,8 @@ mt_erp com.deer.wms.project.seed.core.service.AbstractService logging.ipdb.path + productprocesspo + findProductProcessPoById ProductBatchDetectDet @@ -227,6 +250,7 @@ D:\gitSpace\mt-wms-api\wms-produce-manage\src\main\java\com\deer\wms\produce\manage\model D:\gitSpace\mt-wms-api D:\gitSpace\mt-wms-api\wms-produce-manage + D:\gitSpace\mt-pms-api @@ -240,31 +264,13 @@ @@ -371,8 +395,8 @@ - + @@ -386,17 +410,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SELECT process.*, supplier.supplier_name, accessory.name FROM mt_alone_process process + LEFT JOIN supplier_manage supplier ON process.supplier_id = supplier.supplier_id AND process.company_id = supplier.company_id + LEFT JOIN mt_alone_accessory accessory ON process.product_annex_code = accessory.annex_code AND process.company_id = accessory.company_id + + + process.product_process_id = #{productProcessId} + + + AND process.company_id = #{companyId} + + ORDER BY process.process_step + + + \ No newline at end of file diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProcessBomMapper.xml b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProcessBomMapper.xml index 377a15e..bf9f931 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProcessBomMapper.xml +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProcessBomMapper.xml @@ -172,4 +172,5 @@ ORDER BY procbom.process_step + \ No newline at end of file diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProductProcessMapper.xml b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProductProcessMapper.xml index 3aa9b06..ce20904 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProductProcessMapper.xml +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/mapper/ProductProcessMapper.xml @@ -28,6 +28,7 @@ + @@ -49,7 +50,6 @@ - @@ -73,6 +73,7 @@ + @@ -96,21 +97,42 @@ + + + \ No newline at end of file diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/MtAloneProcessVo.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/MtAloneProcessVo.java new file mode 100644 index 0000000..6dc95f4 --- /dev/null +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/MtAloneProcessVo.java @@ -0,0 +1,29 @@ +package com.deer.wms.produce.manage.model; + +/** + * 用于处理、编辑批次产品加工单时下方展示的工序信息 + * @Author: hy + * @Date: 2019/12/19 9:11 + * @Version 1.0 + */ +public class MtAloneProcessVo extends MtAloneProcess { + private String supplierName;//加工商名称(供应商表取值) + + private String accessoryName;//附件名称(附件表取值) + + public String getSupplierName() { + return supplierName; + } + + public void setSupplierName(String supplierName) { + this.supplierName = supplierName; + } + + public String getAccessoryName() { + return accessoryName; + } + + public void setAccessoryName(String accessoryName) { + this.accessoryName = accessoryName; + } +} diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProcessBomParams.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProcessBomParams.java index 458d47b..0decc1f 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProcessBomParams.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProcessBomParams.java @@ -10,7 +10,7 @@ import java.util.List; */ public class ProcessBomParams extends QueryParams { /** - *产品生产bom的id + *产品bom的id */ private Integer productProcessId; 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 5ecc9b8..4cad2a4 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 @@ -1,6 +1,7 @@ package com.deer.wms.produce.manage.model; import java.util.ArrayList; +import java.util.List; /** * 从前端同时获取批次产品加工信息和工序信息 @@ -11,7 +12,7 @@ import java.util.ArrayList; public class ProductAndProcess { private ProductProcess productProcess; - private static MtAloneProcess[] processes; + private MtAloneProcessVo[] processesVo; public ProductProcess getProductProcess() { return productProcess; @@ -21,11 +22,11 @@ public class ProductAndProcess { this.productProcess = productProcess; } - public static MtAloneProcess[] getProcesses() { - return processes; + public MtAloneProcessVo[] getProcessesVo() { + return processesVo; } - public void setProcesses(MtAloneProcess[] processes) { - this.processes = processes; + public void setProcessesVo(MtAloneProcessVo[] processesVo) { + this.processesVo = processesVo; } } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcess.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcess.java index e155d7c..d79eb7f 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcess.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcess.java @@ -133,6 +133,12 @@ public class ProductProcess { @Column(name = "product_bom_id") private Integer productBomId; + /** + * 产品bom名称 + */ + @Column(name = "product_process_bom_name") + private String productProcessBomName; + /** * 加工规格型号 */ @@ -945,4 +951,12 @@ public class ProductProcess { public void setCompanyId(Integer companyId) { this.companyId = companyId; } + + public String getProductProcessBomName() { + return productProcessBomName; + } + + public void setProductProcessBomName(String productProcessBomName) { + this.productProcessBomName = productProcessBomName; + } } \ No newline at end of file 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 new file mode 100644 index 0000000..9ee75b9 --- /dev/null +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessBomPo.java @@ -0,0 +1,40 @@ +package com.deer.wms.produce.manage.model; + +import java.util.List; + +/** + * @Author: hy + * @Date: 2019/12/17 20:13 + * @Version 1.0 + */ +public class ProductProcessBomPo { + private String specification;//加工规格型号 + + private String processContent;//加工描述内容 + + private List processBomList;//产品bom下的工序bom + + public String getSpecification() { + return specification; + } + + public void setSpecification(String specification) { + this.specification = specification; + } + + public String getProcessContent() { + return processContent; + } + + public void setProcessContent(String processContent) { + this.processContent = processContent; + } + + public List getProcessBomList() { + return processBomList; + } + + public void setProcessBomList(List processBomList) { + this.processBomList = processBomList; + } +} diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessDtoSpare.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessDtoSpare.java deleted file mode 100644 index 8870fb7..0000000 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessDtoSpare.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.deer.wms.produce.manage.model; - -/** - * @Author: hy - * @Date: 2019/9/5 21:22 - * @Version 1.0 - * - * 新建生产加工页面对应的结构,集成生产加工单、生产工序、生产物料等信息,备用!!!! - * - */ - -public class ProductProcessDtoSpare extends ProductProcess { - private ProcessMaterialsBomVo processMaterialsBomVo;//所有bom信息 - - private MtAloneProcess[] mtAloneProcess;//产品工序 - - private ProcessMaterials[] processMaterials;//工序所用物料 - - private ProductProcessBom productProcessBom; - - private ProcessBom[] processBom; - - private ProcessMaterialsBom[] processMaterialsBom; - - public MtAloneProcess[] getMtAloneProcess() { - return mtAloneProcess; - } - - public void setMtAloneProcess(MtAloneProcess[] mtAloneProcess) { - this.mtAloneProcess = mtAloneProcess; - } - - public ProcessMaterials[] getProcessMaterials() { - return processMaterials; - } - - public void setProcessMaterials(ProcessMaterials[] processMaterials) { - this.processMaterials = processMaterials; - } - - public ProductProcessBom getProductProcessBom() { - return productProcessBom; - } - - public void setProductProcessBom(ProductProcessBom productProcessBom) { - this.productProcessBom = productProcessBom; - } - - public ProcessBom[] getProcessBom() { - return processBom; - } - - public void setProcessBom(ProcessBom[] processBom) { - this.processBom = processBom; - } - - public ProcessMaterialsBomVo getProcessMaterialsBomVo() { - return processMaterialsBomVo; - } - - public void setProcessMaterialsBomVo(ProcessMaterialsBomVo processMaterialsBomVo) { - this.processMaterialsBomVo = processMaterialsBomVo; - } -} diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessParams.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessParams.java index ce8d7a5..7d00eca 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessParams.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessParams.java @@ -1,6 +1,7 @@ package com.deer.wms.produce.manage.model; import com.deer.wms.project.seed.core.service.QueryParams; +import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; @@ -8,8 +9,19 @@ import java.util.Date; * Created by guo on 2019/09/24. */ public class ProductProcessParams extends QueryParams { + private Integer productProcessId; + + @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8") private Date createDate; + public Integer getProductProcessId() { + return productProcessId; + } + + public void setProductProcessId(Integer productProcessId) { + this.productProcessId = productProcessId; + } + public Date getCreateDate() { return createDate; } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessVo.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessVo.java index dd7c0a7..fca3abc 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessVo.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/model/ProductProcessVo.java @@ -17,7 +17,6 @@ public class ProductProcessVo extends ProductProcess { private String productProcessName;//产品Bom名称 - public String getProductName() { return productName; } @@ -42,12 +41,10 @@ public class ProductProcessVo extends ProductProcess { this.schedule = schedule; } - public String getProductProcessName() { return productProcessName; } - public void setProductProcessName(String productProcessName) { this.productProcessName = productProcessName; } 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 1190679..4e601e5 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,8 +1,6 @@ package com.deer.wms.produce.manage.service; -import com.deer.wms.produce.manage.model.MtAloneProcess; -import com.deer.wms.produce.manage.model.MtAloneProcessParams; -import com.deer.wms.produce.manage.model.ProcessBomParams; +import com.deer.wms.produce.manage.model.*; import com.deer.wms.project.seed.core.service.Service; import java.util.List; @@ -13,6 +11,8 @@ import java.util.List; public interface MtAloneProcessService extends Service { List findProcessListByProductBom(ProcessBomParams params); + List findProcessListByProductProcess(ProductProcessParams params); + //List findList(MtAloneProcessParams params) ; diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProcessBomService.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProcessBomService.java index 123e234..de662c5 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProcessBomService.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/service/ProcessBomService.java @@ -4,6 +4,7 @@ package com.deer.wms.produce.manage.service; import com.deer.wms.produce.manage.model.ProcessBom; import com.deer.wms.produce.manage.model.ProcessBomDto; import com.deer.wms.produce.manage.model.ProcessBomParams; + import com.deer.wms.produce.manage.model.ProductProcessBomPo; import com.deer.wms.project.seed.core.service.Service; import java.util.List; @@ -21,4 +22,5 @@ public interface ProcessBomService extends Service { List findListByProductNameId(ProcessBomParams params); + ProductProcessBomPo findProductAndProcessBomByProdBom(ProcessBomParams params); } 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 49d4e4f..b79c70c 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 @@ -18,4 +18,6 @@ public interface ProductProcessService extends Service void save(ProductProcess productProcess, CurrentUser currentUser); void saveProdAndProc(ProductAndProcess productAndProcess, CurrentUser currentUser); + + ProductAndProcess queryProductProcessDetail(ProductProcessParams 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 85355ec..eeccd83 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,10 +1,7 @@ package com.deer.wms.produce.manage.service.impl; import com.deer.wms.produce.manage.dao.MtAloneProcessMapper; -import com.deer.wms.produce.manage.model.MtAloneProcess; -import com.deer.wms.produce.manage.model.MtAloneProcessParams; -import com.deer.wms.produce.manage.model.ProcessBom; -import com.deer.wms.produce.manage.model.ProcessBomParams; +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.project.seed.core.service.AbstractService; @@ -51,6 +48,11 @@ public class MtAloneProcessServiceImpl extends AbstractService findProcessListByProductProcess(ProductProcessParams params) { + return mtAloneProcessMapper.findProcessListByProductProcess(params); + } + //@Override //public List 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 e2d32a3..c3a5e3e 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 @@ -4,6 +4,7 @@ import com.deer.wms.produce.manage.dao.ProcessBomMapper; import com.deer.wms.produce.manage.model.*; import com.deer.wms.produce.manage.service.ProcessBomService; +import com.deer.wms.produce.manage.service.ProductProcessBomService; import com.deer.wms.project.seed.core.service.AbstractService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -23,6 +24,9 @@ public class ProcessBomServiceImpl extends AbstractService @Autowired private ProcessBomMapper processBomMapper; + @Autowired + private ProductProcessBomService productProcessBomService; + @Override public List findList(ProcessBomParams params) { @@ -62,4 +66,18 @@ public class ProcessBomServiceImpl extends AbstractService public List findListByProductNameId(ProcessBomParams params) { return processBomMapper.findListByProductNameId(params); } + + @Override + public ProductProcessBomPo findProductAndProcessBomByProdBom(ProcessBomParams params) { + List processBomList = processBomMapper.findListByProductBom(params); + ProductProcessBom productProcessBom = productProcessBomService.findById(params.getProductProcessId()); + + ProductProcessBomPo productProcessBomPo = new ProductProcessBomPo(); + 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 5bafbcc..ac09bd9 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 @@ -9,16 +9,14 @@ 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.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; import java.text.DecimalFormat; import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; +import java.util.*; /** * Created by hy on 2019/07/19. @@ -75,13 +73,35 @@ public class ProductProcessServiceImpl extends AbstractService processesList = new ArrayList<>(processes.length); - Collections.addAll(processesList, processes); - processService.save(processesList); + MtAloneProcessVo[] processesVo = productAndProcess.getProcessesVo(); + if(null != processesVo) { + MtAloneProcess[] processes = new MtAloneProcess[processesVo.length]; + for (int i = 0; i < processesVo.length; i++) { + processes[i] = new MtAloneProcess(); + BeanUtils.copyProperties(processesVo[i], processes[i]); + processService.save(processes[i]); + } + } + } + + @Override + public ProductAndProcess queryProductProcessDetail(ProductProcessParams params) { + //根据批次产品加工id查询批次产品加工单信息 + ProductProcess productProcess = productProcessMapper.selectByPrimaryKey(params.getProductProcessId()); + //根据批次产品加工id查询工序信息 + List processList = processService.findProcessListByProductProcess(params); + + ProductAndProcess productAndProcess = new ProductAndProcess(); + productAndProcess.setProductProcess(productProcess); + if(null != processList) { + MtAloneProcessVo[] processesVo = new MtAloneProcessVo[processList.size()]; + for (int i = 0; i < processesVo.length; i++) { + processesVo[i] = processList.get(i); + } + productAndProcess.setProcessesVo(processesVo); } + return productAndProcess; } } diff --git a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MaterialsInfoController.java b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MaterialsInfoController.java index 1a941e1..d600fe9 100644 --- a/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MaterialsInfoController.java +++ b/wms-produce-manage/src/main/java/com/deer/wms/produce/manage/web/MaterialsInfoController.java @@ -49,7 +49,7 @@ public class MaterialsInfoController { private MaterialsOutgoingLogService materialsOutgoingLogService; /** - * hy + * hy正在用 * 新增物料信息 * @param materialsInfo * @param currentUser @@ -101,8 +101,8 @@ public class MaterialsInfoController { } /** - * hy - * 获取某种物料详细信息 + * hy正在用 + * 获取某个物料详细信息 * @param params * @param currentUser * @return @@ -118,7 +118,7 @@ public class MaterialsInfoController { //if(currentUser==null){ // return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); //} - StringUtil.trimObjectStringProperties(params); + //StringUtil.trimObjectStringProperties(params); params.setCompanyId(1); MaterialsInfoDto materialsInfoDto = materialsInfoService.findDetailById(params); @@ -126,7 +126,7 @@ public class MaterialsInfoController { } /** - * hy + * hy正在用 * 物料信息分页列表查询 * @param params * @param currentUser @@ -135,8 +135,8 @@ public class MaterialsInfoController { @ApiImplicitParams({ @ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false), @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String", required = false), - @ApiImplicitParam(name = "begDate", value = "起始日期", paramType = "query", dataType = "Date", required = false), - @ApiImplicitParam(name = "endDate", value = "结束日期", paramType = "query", dataType = "Date", required = false) + @ApiImplicitParam(name = "begDate", value = "起始日期", paramType = "query", dataType = "String", required = false), + @ApiImplicitParam(name = "endDate", value = "结束日期", paramType = "query", dataType = "String", required = false) }) @OperateLog(description = "物料信息分页查询", type = "查询") @ApiOperation(value = "物料信息列表分页", notes = "物料信息列表分页") 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 0dea8c1..2f07347 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 @@ -91,15 +91,30 @@ public class MtAloneProcessController { @ApiOperation(value = "根据产品bom查询工序", notes = "根据产品bom查询工序") @GetMapping("/processListByProductBom") public Result processListByProductBom(ProcessBomParams 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()); List list = mtAloneProcessService.findProcessListByProductBom(params); PageInfo pageInfo = new PageInfo(list); return ResultGenerator.genSuccessResult(pageInfo); } + + @OperateLog(description = "根据批次产品加工单id查询工序", type = "查询") + @ApiOperation(value = "根据批次产品加工单id查询工序", notes = "根据批次产品加工单id查询工序") + @GetMapping("/processListByProductProcess") + public Result processListByProductProcess(ProductProcessParams params, @ApiIgnore @User CurrentUser currentUser) { + //if(currentUser==null){ + // return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); + //} + + params.setCompanyId(1); + PageHelper.startPage(params.getPageNum(), params.getPageSize()); + List list = mtAloneProcessService.findProcessListByProductProcess(params); + PageInfo pageInfo = new PageInfo(list); + return ResultGenerator.genSuccessResult(pageInfo); + } } 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 c127b16..8498b64 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 @@ -128,7 +128,8 @@ public class ProcessBomController { /** * hy - * 根据选择的产品名称来展示产品其他数据和工序数据 + * 根据选择的产品名称来展示产品其他数据和工序数据, + * 用于新建生产加工产品bom下拉框选择 * @param params * @param currentUser * @return @@ -143,13 +144,39 @@ public class ProcessBomController { return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); } - params.setCompanyId(1); + params.setCompanyId(currentUser.getCompanyId()); PageHelper.startPage(params.getPageNum(), params.getPageSize()); List list = processBomService.findListByProductNameId(params); PageInfo pageInfo = new PageInfo(list); return ResultGenerator.genSuccessResult(pageInfo); } + /** + * hy正在用 + * 根据产品bom的id获取产品bom部分数据和工序数据 + * 用于新建生产加工产品bom下拉框选择 + * @param params + * @param currentUser + * @return + */ + @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){ + if(currentUser==null){ + return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); + } + + params.setCompanyId(currentUser.getCompanyId()); + ProductProcessBomPo productProcessBomPo = processBomService.findProductAndProcessBomByProdBom(params); + return ResultGenerator.genSuccessResult(productProcessBomPo); + } + /** * 添加工序数据到数据库 */ 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 7bf680c..ddb29a5 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 @@ -164,7 +164,13 @@ public class ProductProcessBomController { return ResultGenerator.genSuccessResult(pageInfo); } - /**根据产品bom的id获取产品bom,用于新建批次产品加工的产品bom下拉框填入名称**/ + /** + * hy + * 根据产品bom的id获取产品bom,用于新建批次产品加工的产品bom下拉框填入名称 + * @param params + * @param currentUser + * @return + */ @GetMapping("/listById") public Result listByProductId(ProductProcessBomParams params, @ApiIgnore @User CurrentUser currentUser) { if(currentUser==null){ 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 04f7cf5..f196e77 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 @@ -83,7 +83,7 @@ public class ProductProcessController { } /** - * hy + * hy正在用 * 批次生产加工单分页查询 * @param params * @param currentUser @@ -91,6 +91,7 @@ public class ProductProcessController { */ @ApiOperation(value = "批次生产加工单分页查询", notes = "批次生产加工单分页查询") @ApiImplicitParams({ + @ApiImplicitParam(name = "createDate", value = "创建时间", paramType = "query", dataType = "Date", required = false), @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String", required = false), @ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false) @@ -98,11 +99,11 @@ public class ProductProcessController { @OperateLog(description = "批次生产加工单分页查询", type = "查询") @GetMapping("/list") public Result list(ProductProcessParams 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()); List list = productProcessService.findList(params); PageInfo pageInfo = new PageInfo(list); @@ -110,25 +111,51 @@ public class ProductProcessController { } /** - * hy + * hy正在用 * 新建批次产品加工完毕时,点击提交同时保存产品加工和工序信息 * @param productAndProcess * @param currentUser * @return */ - @ApiOperation(value = "批次生产加工及工序保存更新", notes = "批次生产加工及工序保存更新") + @ApiOperation(value = "批次生产加工及工序保存", notes = "批次生产加工及工序保存") @ApiImplicitParams({ @ApiImplicitParam(name = "productAndProcess", value = "批次生产加工及工序", paramType = "body", dataType = "ProductAndProcess", required = true) }) @OperateLog(description = "批次生产加工及工序保存", type = "保存") @PostMapping("/saveProdAndProc") public Result saveProdAndProc(@RequestBody ProductAndProcess productAndProcess, @ApiIgnore @User CurrentUser currentUser) { - if(currentUser==null){ - return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); - } + //if(currentUser==null){ + // return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); + //} productProcessService.saveProdAndProc(productAndProcess, currentUser); return ResultGenerator.genSuccessResult(); } + + /** + * hy正在用 + * 点击批次生产加工单列表最后一列详情按钮,查询批次生产加工单详情 + * @param params + * @param currentUser + * @return + */ + @ApiOperation(value = "批次生产加工单详情查询", notes = "批次生产加工单详情查询") + @ApiImplicitParams({ + @ApiImplicitParam(name = "productProcessId", value = "批次生产加工单id", paramType = "query", dataType = "int", required = true), + @ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false) + + }) + @OperateLog(description = "批次生产加工单详情查询", type = "查询") + @GetMapping("/query/product/process/detail") + public Result queryProductProcessDetail(ProductProcessParams params, @ApiIgnore @User CurrentUser currentUser) { + if(currentUser==null){ + return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); + } + + params.setCompanyId(currentUser.getCompanyId()); + ProductAndProcess productAndProcess = productProcessService.queryProductProcessDetail(params); + return ResultGenerator.genSuccessResult(productAndProcess); + } + }