批次生产加工新增、详情查询接口更新

This commit is contained in:
hy2250089 2019-12-19 14:04:31 +08:00
parent 17b5b7d98c
commit 410a5b4b6e
27 changed files with 10062 additions and 613 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,10 +2,13 @@ package com.deer.wms.produce.manage.dao;
import com.deer.wms.produce.manage.model.MtAloneProcess;
import com.deer.wms.produce.manage.model.MtAloneProcessParams;
import com.deer.wms.produce.manage.model.MtAloneProcessVo;
import com.deer.wms.produce.manage.model.ProductProcessParams;
import com.deer.wms.project.seed.core.mapper.Mapper;
import java.util.List;
public interface MtAloneProcessMapper extends Mapper<MtAloneProcess> {
List<MtAloneProcessVo> findProcessListByProductProcess(ProductProcessParams params);
}

View File

@ -22,4 +22,6 @@ public interface ProcessBomMapper extends Mapper<ProcessBom> {
List<ProcessBomDto> findListByProductNameId(ProcessBomParams params);
void insertOrUpdate(List<ProcessBom> processBomList);
ProductProcessBomPo findProductAndProcessBomByProdBom(Integer productBomId);
}

View File

@ -10,4 +10,5 @@ import java.util.List;
public interface ProductProcessMapper extends Mapper<ProductProcess> {
List<ProductProcessVo> findList(ProductProcessParams params);
}

View File

@ -34,5 +34,52 @@
<result column="company_id" jdbcType="INTEGER" property="companyId" />
</resultMap>
<resultMap id="MtAloneProcessVoResultMap" type="com.deer.wms.produce.manage.model.MtAloneProcessVo">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="operator_id" jdbcType="INTEGER" property="operatorId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="version" jdbcType="VARCHAR" property="version" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="process_name" jdbcType="VARCHAR" property="processName" />
<result column="product_process_id" jdbcType="INTEGER" property="productProcessId" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="specification" jdbcType="VARCHAR" property="specification" />
<result column="process_source" jdbcType="INTEGER" property="processSource" />
<result column="process_price" jdbcType="REAL" property="processPrice" />
<result column="process_unit_price" jdbcType="REAL" property="processUnitPrice" />
<result column="original_len" jdbcType="REAL" property="originalLen" />
<result column="loss" jdbcType="REAL" property="loss" />
<result column="after_len" jdbcType="REAL" property="afterLen" />
<result column="shrinkage" jdbcType="VARCHAR" property="shrinkage" />
<result column="process_content" jdbcType="VARCHAR" property="processContent" />
<result column="supplier_id" jdbcType="INTEGER" property="supplierId" />
<result column="process_step" jdbcType="INTEGER" property="processStep" />
<result column="merchandiser_id" jdbcType="INTEGER" property="merchandiserId" />
<result column="product_bar_code" jdbcType="VARCHAR" property="productBarCode" />
<result column="process_bom_id" jdbcType="INTEGER" property="processBomId" />
<result column="process_bom_name" jdbcType="VARCHAR" property="processBomName" />
<result column="product_annex_code" jdbcType="VARCHAR" property="productAnnexCode" />
<result column="memo" jdbcType="VARCHAR" property="memo" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
<result column="supplier_name" jdbcType="VARCHAR" property="supplierName" />
<result column="name" jdbcType="VARCHAR" property="accessoryName" />
</resultMap>
<select id="findProcessListByProductProcess" parameterType="com.deer.wms.produce.manage.model.ProductProcessParams" resultMap="MtAloneProcessVoResultMap">
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
<where>
<if test="productProcessId != null">
process.product_process_id = #{productProcessId}
</if>
<if test="companyId != null">
AND process.company_id = #{companyId}
</if>
</where> ORDER BY process.process_step
</select>
</mapper>

View File

@ -172,4 +172,5 @@
</if>
</where> ORDER BY procbom.process_step
</select>
</mapper>

View File

@ -28,6 +28,7 @@
<result column="product_process_name0" jdbcType="VARCHAR" property="productProcessName0" />
<result column="finish_time" jdbcType="TIMESTAMP" property="finishTime" />
<result column="product_bom_id" jdbcType="INTEGER" property="productBomId" />
<result column="product_process_bom_name" jdbcType="VARCHAR" property="productProcessBomName" />
<result column="specification" jdbcType="VARCHAR" property="specification" />
<result column="process_price" jdbcType="REAL" property="processPrice" />
<result column="len" jdbcType="REAL" property="len" />
@ -49,7 +50,6 @@
</resultMap>
<resultMap id="ProductProcessVoResultMap" type="com.deer.wms.produce.manage.model.ProductProcessVo">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="operator_id" jdbcType="INTEGER" property="operatorId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
@ -73,6 +73,7 @@
<result column="product_process_name0" jdbcType="VARCHAR" property="productProcessName0" />
<result column="finish_time" jdbcType="TIMESTAMP" property="finishTime" />
<result column="product_bom_id" jdbcType="INTEGER" property="productBomId" />
<result column="product_process_bom_name" jdbcType="VARCHAR" property="productProcessBomName" />
<result column="specification" jdbcType="VARCHAR" property="specification" />
<result column="process_price" jdbcType="REAL" property="processPrice" />
<result column="len" jdbcType="REAL" property="len" />
@ -96,21 +97,42 @@
</resultMap>
<select id="findList" parameterType="com.deer.wms.produce.manage.model.ProductProcessParams" resultMap="ProductProcessVoResultMap">
SELECT prodproc.*, probom.product_process_name, product.product_name
SELECT prodproc.*, prodbom.product_process_name, product.product_name
FROM mt_alone_product_process prodproc
LEFT JOIN mt_alone_product_process_bom probom ON prodproc.product_bom_id = probom.id AND prodproc.company_id = probom.company_id
LEFT JOIN mt_alone_machining_product product ON probom.product_id = product.id AND probom.company_id = product.company_id
LEFT JOIN mt_alone_product_process_bom prodbom ON prodproc.product_bom_id = prodbom.id AND prodproc.company_id = prodbom.company_id
LEFT JOIN mt_alone_machining_product product ON prodbom.product_id = product.id AND prodbom.company_id = product.company_id
<where>
<if test="keywords != null and keywords != ''">
AND prodproc.work_order_code LIKE CONCAT('%', #{keywords}, '%')
OR probom.product_bom_name LIKE CONCAT('%', #{keywords}, '%')
OR prodbom.product_bom_name LIKE CONCAT('%', #{keywords}, '%')
OR prodproc.product_process_name LIKE CONCAT('%', #{keywords}, '%')
OR client.client_name LIKE CONCAT('%', #{keywords}, '%')
OR prodproc.contract_name LIKE CONCAT('%', #{keywords}, '%')
</if>
<if test="createDate != null">
AND DATE_FORMAT(prodproc.create_time,'%Y-%m-%d') = DATE_FORMAT(#{createDate}, '%Y-%m-%d')
</if>
<if test="companyId != null">
AND prodproc.company_id = #{companyId}
</if>
</where>
</select>
<!--没用
<select id="findProductProcessPoById" parameterType="com.deer.wms.produce.manage.model.ProductProcessParams" resultMap="ProductProcessPoResultMap">
SELECT prodproc.*, prodbom.product_process_name, product.product_name
FROM mt_alone_product_process prodproc
LEFT JOIN mt_alone_product_process_bom prodbom ON prodproc.product_bom_id = prodbom.id AND prodproc.company_id = prodbom.company_id
LEFT JOIN mt_alone_machining_product product ON prodbom.product_id = product.id AND prodbom.company_id = product.company_id
<where>
<if test=" != null">
AND DATE_FORMAT(prodproc.create_time,'%Y-%m-%d') = DATE_FORMAT(#{createDate}, '%Y-%m-%d')
</if>
<if test="companyId != null">
AND prodproc.company_id = #{companyId}
</if>
</where>
</select>
-->
</mapper>

View File

@ -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;
}
}

View File

@ -10,7 +10,7 @@ import java.util.List;
*/
public class ProcessBomParams extends QueryParams {
/**
*产品生产bom的id
*产品bom的id
*/
private Integer productProcessId;

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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<ProcessBom> 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<ProcessBom> getProcessBomList() {
return processBomList;
}
public void setProcessBomList(List<ProcessBom> processBomList) {
this.processBomList = processBomList;
}
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<MtAloneProcess, Integer> {
List<MtAloneProcess> findProcessListByProductBom(ProcessBomParams params);
List<MtAloneProcessVo> findProcessListByProductProcess(ProductProcessParams params);
//List<MtAloneProcess> findList(MtAloneProcessParams params) ;

View File

@ -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<ProcessBom, Integer> {
List<ProcessBomDto> findListByProductNameId(ProcessBomParams params);
ProductProcessBomPo findProductAndProcessBomByProdBom(ProcessBomParams params);
}

View File

@ -18,4 +18,6 @@ public interface ProductProcessService extends Service<ProductProcess, Integer>
void save(ProductProcess productProcess, CurrentUser currentUser);
void saveProdAndProc(ProductAndProcess productAndProcess, CurrentUser currentUser);
ProductAndProcess queryProductProcessDetail(ProductProcessParams params);
}

View File

@ -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<MtAloneProcess, I
return processList;
}
@Override
public List<MtAloneProcessVo> findProcessListByProductProcess(ProductProcessParams params) {
return mtAloneProcessMapper.findProcessListByProductProcess(params);
}
//@Override
//public List<MtAloneProcess> findList(MtAloneProcessParams params) {

View File

@ -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<ProcessBom, Integer>
@Autowired
private ProcessBomMapper processBomMapper;
@Autowired
private ProductProcessBomService productProcessBomService;
@Override
public List<ProcessBom> findList(ProcessBomParams params) {
@ -62,4 +66,18 @@ public class ProcessBomServiceImpl extends AbstractService<ProcessBom, Integer>
public List<ProcessBomDto> findListByProductNameId(ProcessBomParams params) {
return processBomMapper.findListByProductNameId(params);
}
@Override
public ProductProcessBomPo findProductAndProcessBomByProdBom(ProcessBomParams params) {
List<ProcessBom> 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;
}
}

View File

@ -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<ProductProcess, I
productProcessMapper.insert(productProcess);
//其次保存由前端获取的工序信息
MtAloneProcess[] processes = productAndProcess.getProcesses();
if(null != processes) {
List<MtAloneProcess> 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<MtAloneProcessVo> 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;
}
}

View File

@ -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 = "物料信息列表分页")

View File

@ -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<MtAloneProcess> 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<MtAloneProcessVo> list = mtAloneProcessService.findProcessListByProductProcess(params);
PageInfo pageInfo = new PageInfo(list);
return ResultGenerator.genSuccessResult(pageInfo);
}
}

View File

@ -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<ProcessBomDto> 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);
}
/**
* 添加工序数据到数据库
*/

View File

@ -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){

View File

@ -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<ProductProcessVo> 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);
}
}