Merge branch 'master' of https://git.picaiba.com/mengtong/mt-pms-api into weihongyang
This commit is contained in:
commit
e376194e1d
@ -17,6 +17,7 @@ public interface ProcessBomMapper extends Mapper<ProcessBom> {
|
|||||||
void insertProcessMaterialsBom(List<ProcessMaterialsBom> list);
|
void insertProcessMaterialsBom(List<ProcessMaterialsBom> list);
|
||||||
|
|
||||||
List<ProcessBom> findListByProductBom(ProcessBomParams params);
|
List<ProcessBom> findListByProductBom(ProcessBomParams params);
|
||||||
|
|
||||||
List<ProcessBom> findListByProductBomId(ProcessBomParams params);
|
List<ProcessBom> findListByProductBomId(ProcessBomParams params);
|
||||||
|
|
||||||
List<ProcessBomDto> findListByProductNameId(ProcessBomParams params);
|
List<ProcessBomDto> findListByProductNameId(ProcessBomParams params);
|
||||||
|
@ -14,7 +14,7 @@ public interface ProcessMaterialsBomMapper extends Mapper<ProcessMaterialsBom> {
|
|||||||
|
|
||||||
List<MaterialInfoVo> findMaterilaListByProcessBomId(ProcessBom processBom);
|
List<MaterialInfoVo> findMaterilaListByProcessBomId(ProcessBom processBom);
|
||||||
|
|
||||||
|
|
||||||
void insertOrUpdate(List<ProcessMaterialsBom> processMaterialsBomList);
|
void insertOrUpdate(List<ProcessMaterialsBom> processMaterialsBomList);
|
||||||
|
|
||||||
|
List<ProcessMaterialsBomVo> findProcMatBomVoListByProcBom(ProcessMaterialsBomParams procMatBomParams);
|
||||||
}
|
}
|
@ -19,4 +19,6 @@ public interface ProductProcessBomMapper extends Mapper<ProductProcessBom> {
|
|||||||
List<ProductProcessBom> findListById(ProductProcessBomParams params);
|
List<ProductProcessBom> findListById(ProductProcessBomParams params);
|
||||||
|
|
||||||
List<ProductProcessBomVO> findByProductNameAndProductNum(ProductProcessBomParams mtAloneProductProcessBomParams);
|
List<ProductProcessBomVO> findByProductNameAndProductNum(ProductProcessBomParams mtAloneProductProcessBomParams);
|
||||||
|
|
||||||
|
ProductProcessBom selectByProdProcBom(ProductProcessBomParams params);
|
||||||
}
|
}
|
@ -95,7 +95,7 @@
|
|||||||
<if test="companyId != null">
|
<if test="companyId != null">
|
||||||
AND process.company_id = #{companyId}
|
AND process.company_id = #{companyId}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where> ORDER BY process.process_step
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,6 +60,20 @@
|
|||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="findProcMatBomVoListByProcBom" parameterType="com.deer.wms.produce.manage.model.ProcessMaterialsBomParams" resultMap="ProcessMatBomVoResultMap">
|
||||||
|
SELECT matbom.*, materials.materials_name, unit.unit_name FROM mt_alone_process_materials_bom matbom
|
||||||
|
LEFT JOIN mt_alone_materials_info materials ON matbom.materials_id = materials.id AND matbom.company_id = materials.company_id
|
||||||
|
LEFT JOIN unit ON matbom.unit_id = unit.unit_id AND matbom.company_id = unit.company_id
|
||||||
|
<where>
|
||||||
|
<if test="companyId != null">
|
||||||
|
AND matbom.company_id = #{companyId}
|
||||||
|
</if>
|
||||||
|
<if test="processBomId != null">
|
||||||
|
AND matbom.process_bom_id = #{processBomId}
|
||||||
|
</if>
|
||||||
|
</where> ORDER BY matbom.create_time DESC, matbom.update_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="findProcMatBomVoListByProId" parameterType="com.deer.wms.produce.manage.model.ProcessMaterialsBomParams" resultMap="ProcessMatBomVoResultMap">
|
<select id="findProcMatBomVoListByProId" parameterType="com.deer.wms.produce.manage.model.ProcessMaterialsBomParams" resultMap="ProcessMatBomVoResultMap">
|
||||||
SELECT materials.code, materials.materials_name,
|
SELECT materials.code, materials.materials_name,
|
||||||
unit.unit_name, matbom.specification, procbom.process_name,
|
unit.unit_name, matbom.specification, procbom.process_name,
|
||||||
@ -82,6 +96,7 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="findListByProcessBomId" parameterType="com.deer.wms.produce.manage.model.ProcessMaterialsBomParams" resultMap="BaseResultMap">
|
<select id="findListByProcessBomId" parameterType="com.deer.wms.produce.manage.model.ProcessMaterialsBomParams" resultMap="BaseResultMap">
|
||||||
SELECT matbom.*
|
SELECT matbom.*
|
||||||
FROM mt_alone_process_materials_bom matbom
|
FROM mt_alone_process_materials_bom matbom
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<result column="operator_id" jdbcType="INTEGER" property="operatorId" />
|
<result column="operator_id" jdbcType="INTEGER" property="operatorId" />
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
<result column="version" jdbcType="INTEGER" property="version" />
|
<result column="version" jdbcType="VARCHAR" property="version" />
|
||||||
<result column="status" jdbcType="INTEGER" property="status" />
|
<result column="status" jdbcType="INTEGER" property="status" />
|
||||||
<result column="process_id" jdbcType="INTEGER" property="processId" />
|
<result column="process_id" jdbcType="INTEGER" property="processId" />
|
||||||
<result column="materials_bom_id" jdbcType="INTEGER" property="materialsBomId" />
|
<result column="materials_bom_id" jdbcType="INTEGER" property="materialsBomId" />
|
||||||
@ -28,7 +28,7 @@
|
|||||||
<result column="operator_id" jdbcType="INTEGER" property="operatorId" />
|
<result column="operator_id" jdbcType="INTEGER" property="operatorId" />
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
<result column="version" jdbcType="INTEGER" property="version" />
|
<result column="version" jdbcType="VARCHAR" property="version" />
|
||||||
<result column="status" jdbcType="INTEGER" property="status" />
|
<result column="status" jdbcType="INTEGER" property="status" />
|
||||||
<result column="process_id" jdbcType="INTEGER" property="processId" />
|
<result column="process_id" jdbcType="INTEGER" property="processId" />
|
||||||
<result column="materials_bom_id" jdbcType="INTEGER" property="materialsBomId" />
|
<result column="materials_bom_id" jdbcType="INTEGER" property="materialsBomId" />
|
||||||
|
@ -72,17 +72,7 @@
|
|||||||
<result column="product_annex_code" jdbcType="VARCHAR" property="productAnnexCode" />
|
<result column="product_annex_code" jdbcType="VARCHAR" property="productAnnexCode" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- <select id="findList" parameterType="com.deer.wms.produce.manage.model.ProductProcessBomParams" resultMap="ProPrcessBomDTOResultMap">-->
|
|
||||||
<!-- SELECT product.product_name, productBom.product_process_name, com.company_name-->
|
|
||||||
<!-- FROM mt_alone_product_process_bom productBom-->
|
|
||||||
<!-- LEFT JOIN mt_alone_machining_product product ON product.id = productBom.product_id AND product.company_id = productBom.company_id-->
|
|
||||||
<!-- LEFT JOIN company com ON productBom.company_id = com.company_id-->
|
|
||||||
<!-- <where>-->
|
|
||||||
<!-- <if test="companyId != null">-->
|
|
||||||
<!-- AND productBom.company_id = #{companyId}-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- </where>-->
|
|
||||||
<!-- </select>-->
|
|
||||||
<select id="findList" resultMap="ProPrcessBomDTOResultMap">
|
<select id="findList" resultMap="ProPrcessBomDTOResultMap">
|
||||||
SELECT *,COUNT(mapb.process_step) process_step
|
SELECT *,COUNT(mapb.process_step) process_step
|
||||||
FROM mt_alone_product_process_bom mappb
|
FROM mt_alone_product_process_bom mappb
|
||||||
@ -152,4 +142,18 @@
|
|||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByProdProcBom" parameterType="com.deer.wms.produce.manage.model.ProductProcessBomParams" resultMap="BaseResultMap">
|
||||||
|
SELECT prodprocbom.id, prodprocbom.product_process_name
|
||||||
|
FROM mt_alone_product_process_bom prodprocbom
|
||||||
|
<where>
|
||||||
|
<if test="productBomId != null">
|
||||||
|
AND prodprocbom.id = #{productBomId}
|
||||||
|
</if>
|
||||||
|
<if test="companyId != null">
|
||||||
|
AND prodprocbom.company_id = #{companyId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -109,13 +109,13 @@
|
|||||||
OR client.client_name LIKE CONCAT('%', #{keywords}, '%')
|
OR client.client_name LIKE CONCAT('%', #{keywords}, '%')
|
||||||
OR prodproc.contract_name LIKE CONCAT('%', #{keywords}, '%')
|
OR prodproc.contract_name LIKE CONCAT('%', #{keywords}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="createDate != null">
|
<if test="createDate != null and createDate != ''">
|
||||||
AND DATE_FORMAT(prodproc.create_time,'%Y-%m-%d') = DATE_FORMAT(#{createDate}, '%Y-%m-%d')
|
AND DATE_FORMAT(prodproc.create_time,'%Y-%m-%d') = DATE_FORMAT(#{createDate}, '%Y-%m-%d')
|
||||||
</if>
|
</if>
|
||||||
<if test="companyId != null">
|
<if test="companyId != null">
|
||||||
AND prodproc.company_id = #{companyId}
|
AND prodproc.company_id = #{companyId}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where> ORDER BY prodproc.create_time DESC, prodproc.update_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--没用
|
<!--没用
|
||||||
|
@ -6,10 +6,13 @@ import com.deer.wms.project.seed.core.service.QueryParams;
|
|||||||
* Created by hy on 2019/07/19.
|
* Created by hy on 2019/07/19.
|
||||||
*/
|
*/
|
||||||
public class MtAloneProcessParams extends QueryParams {
|
public class MtAloneProcessParams extends QueryParams {
|
||||||
|
|
||||||
private Integer processId;
|
private Integer processId;
|
||||||
|
|
||||||
private Integer productBomId;
|
private Integer productBomId;
|
||||||
|
|
||||||
|
private Integer processBomId;
|
||||||
|
|
||||||
public Integer getProcessId() {
|
public Integer getProcessId() {
|
||||||
return processId;
|
return processId;
|
||||||
}
|
}
|
||||||
@ -25,4 +28,12 @@ public class MtAloneProcessParams extends QueryParams {
|
|||||||
public void setProductBomId(Integer productBomId) {
|
public void setProductBomId(Integer productBomId) {
|
||||||
this.productBomId = productBomId;
|
this.productBomId = productBomId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getProcessBomId() {
|
||||||
|
return processBomId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcessBomId(Integer processBomId) {
|
||||||
|
this.processBomId = processBomId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
package com.deer.wms.produce.manage.model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*同时获取工序信息和物料信息
|
|
||||||
* @Author: hy
|
|
||||||
* @Date: 2019/12/19 20:13
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
public class ProcessAndMaterials {
|
|
||||||
|
|
||||||
private MtAloneProcessVo processVo;//工序扩展信息
|
|
||||||
|
|
||||||
private ProcessMaterialsVo[] processMaterialsVo;//物料扩展信息
|
|
||||||
|
|
||||||
public MtAloneProcessVo getProcessVo() {
|
|
||||||
return processVo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProcessVo(MtAloneProcessVo processVo) {
|
|
||||||
this.processVo = processVo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ProcessMaterialsVo[] getProcessMaterialsVo() {
|
|
||||||
return processMaterialsVo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProcessMaterialsVo(ProcessMaterialsVo[] processMaterialsVo) {
|
|
||||||
this.processMaterialsVo = processMaterialsVo;
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.deer.wms.produce.manage.model;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*同时获取工序信息和物料bom信息
|
||||||
|
* @Author: hy
|
||||||
|
* @Date: 2019/12/19 20:13
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class ProcessAndMaterialsBom {
|
||||||
|
|
||||||
|
private MtAloneProcessVo processVo;//工序扩展信息
|
||||||
|
|
||||||
|
private List<ProcessMaterialsBomVo> procMatBomVoList;//物料扩展信息
|
||||||
|
|
||||||
|
public MtAloneProcessVo getProcessVo() {
|
||||||
|
return processVo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcessVo(MtAloneProcessVo processVo) {
|
||||||
|
this.processVo = processVo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ProcessMaterialsBomVo> getProcMatBomVoList() {
|
||||||
|
return procMatBomVoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcMatBomVoList(List<ProcessMaterialsBomVo> procMatBomVoList) {
|
||||||
|
this.procMatBomVoList = procMatBomVoList;
|
||||||
|
}
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
@ -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<ProcessMaterialsBomVo> procMatBomVoList;
|
||||||
|
|
||||||
|
public List<ProcessMaterialsBomVo> getProcMatBomVoList() {
|
||||||
|
return procMatBomVoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcMatBomVoList(List<ProcessMaterialsBomVo> procMatBomVoList) {
|
||||||
|
this.procMatBomVoList = procMatBomVoList;
|
||||||
|
}
|
||||||
|
}
|
@ -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<ProcessMaterialsVo> processMaterialsVoList;
|
||||||
|
|
||||||
|
public List<ProcessMaterialsVo> getProcessMaterialsVoList() {
|
||||||
|
return processMaterialsVoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcessMaterialsVoList(List<ProcessMaterialsVo> processMaterialsVoList) {
|
||||||
|
this.processMaterialsVoList = processMaterialsVoList;
|
||||||
|
}
|
||||||
|
}
|
@ -30,7 +30,7 @@ public class ProcessMaterials {
|
|||||||
/**
|
/**
|
||||||
* 版本号 默认为 1.1
|
* 版本号 默认为 1.1
|
||||||
*/
|
*/
|
||||||
private Integer version;
|
private String version;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态 0使用,1禁用
|
* 状态 0使用,1禁用
|
||||||
@ -158,7 +158,7 @@ public class ProcessMaterials {
|
|||||||
*
|
*
|
||||||
* @return version - 版本号 默认为 1.1
|
* @return version - 版本号 默认为 1.1
|
||||||
*/
|
*/
|
||||||
public Integer getVersion() {
|
public String getVersion() {
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ public class ProcessMaterials {
|
|||||||
*
|
*
|
||||||
* @param version 版本号 默认为 1.1
|
* @param version 版本号 默认为 1.1
|
||||||
*/
|
*/
|
||||||
public void setVersion(Integer version) {
|
public void setVersion(String version) {
|
||||||
this.version = version;
|
this.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,8 +23,6 @@ public class ProcessMaterialsBomVo extends ProcessMaterialsBom {
|
|||||||
|
|
||||||
private Float remain;//剩余数量
|
private Float remain;//剩余数量
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getProcessName() {
|
public String getProcessName() {
|
||||||
return processName;
|
return processName;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||||||
public class ProductAndProcess {
|
public class ProductAndProcess {
|
||||||
private ProductProcess productProcess;//批次生产加工信息
|
private ProductProcess productProcess;//批次生产加工信息
|
||||||
|
|
||||||
private MtAloneProcessVo[] processesVo;//工序扩展信息
|
private List<MtAloneProcessVo> processVoList;//工序扩展信息
|
||||||
|
|
||||||
public ProductProcess getProductProcess() {
|
public ProductProcess getProductProcess() {
|
||||||
return productProcess;
|
return productProcess;
|
||||||
@ -22,11 +22,11 @@ public class ProductAndProcess {
|
|||||||
this.productProcess = productProcess;
|
this.productProcess = productProcess;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MtAloneProcessVo[] getProcessesVo() {
|
public List<MtAloneProcessVo> getProcessVoList() {
|
||||||
return processesVo;
|
return processVoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setProcessesVo(MtAloneProcessVo[] processesVo) {
|
public void setProcessVoList(List<MtAloneProcessVo> processVoList) {
|
||||||
this.processesVo = processesVo;
|
this.processVoList = processVoList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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<ProcessBomHo> 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<ProcessBomHo> getProcessBomHoList() {
|
||||||
|
return processBomHoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcessBomHoList(List<ProcessBomHo> processBomHoList) {
|
||||||
|
this.processBomHoList = processBomHoList;
|
||||||
|
}
|
||||||
|
}
|
@ -15,7 +15,7 @@ public class ProductProcessBomParams extends QueryParams {
|
|||||||
*/
|
*/
|
||||||
private Integer productId;
|
private Integer productId;
|
||||||
|
|
||||||
private String productBomId;
|
private Integer productBomId;
|
||||||
|
|
||||||
private String productName;
|
private String productName;
|
||||||
|
|
||||||
@ -144,11 +144,11 @@ public class ProductProcessBomParams extends QueryParams {
|
|||||||
this.productId = productId;
|
this.productId = productId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getProductBomId() {
|
public Integer getProductBomId() {
|
||||||
return productBomId;
|
return productBomId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setProductBomId(String productBomId) {
|
public void setProductBomId(Integer productBomId) {
|
||||||
this.productBomId = productBomId;
|
this.productBomId = productBomId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,26 +8,17 @@ import java.util.List;
|
|||||||
* @Version 1.0
|
* @Version 1.0
|
||||||
*/
|
*/
|
||||||
public class ProductProcessBomPo {
|
public class ProductProcessBomPo {
|
||||||
private String specification;//加工规格型号
|
private ProductProcessBom productProcessBom;//产品bom
|
||||||
|
|
||||||
private String processContent;//加工描述内容
|
|
||||||
|
|
||||||
private List<ProcessBom> processBomList;//产品bom下的工序bom
|
private List<ProcessBom> processBomList;//产品bom下的工序bom
|
||||||
|
|
||||||
public String getSpecification() {
|
public ProductProcessBom getProductProcessBom() {
|
||||||
return specification;
|
return productProcessBom;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSpecification(String specification) {
|
public void setProductProcessBom(ProductProcessBom productProcessBom) {
|
||||||
this.specification = specification;
|
this.productProcessBom = productProcessBom;
|
||||||
}
|
|
||||||
|
|
||||||
public String getProcessContent() {
|
|
||||||
return processContent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProcessContent(String processContent) {
|
|
||||||
this.processContent = processContent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ProcessBom> getProcessBomList() {
|
public List<ProcessBom> getProcessBomList() {
|
||||||
|
@ -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<ProcessHo> processHoList;
|
||||||
|
|
||||||
|
public List<ProcessHo> getProcessHoList() {
|
||||||
|
return processHoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcessHoList(List<ProcessHo> processHoList) {
|
||||||
|
this.processHoList = processHoList;
|
||||||
|
}
|
||||||
|
}
|
@ -11,8 +11,7 @@ import java.util.Date;
|
|||||||
public class ProductProcessParams extends QueryParams {
|
public class ProductProcessParams extends QueryParams {
|
||||||
private Integer productProcessId;
|
private Integer productProcessId;
|
||||||
|
|
||||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
private String createDate;
|
||||||
private Date createDate;
|
|
||||||
|
|
||||||
public Integer getProductProcessId() {
|
public Integer getProductProcessId() {
|
||||||
return productProcessId;
|
return productProcessId;
|
||||||
@ -22,11 +21,11 @@ public class ProductProcessParams extends QueryParams {
|
|||||||
this.productProcessId = productProcessId;
|
this.productProcessId = productProcessId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getCreateDate() {
|
public String getCreateDate() {
|
||||||
return createDate;
|
return createDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreateDate(Date createDate) {
|
public void setCreateDate(String createDate) {
|
||||||
this.createDate = createDate;
|
this.createDate = createDate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.deer.wms.produce.manage.service;
|
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.produce.manage.model.*;
|
||||||
import com.deer.wms.project.seed.core.service.Service;
|
import com.deer.wms.project.seed.core.service.Service;
|
||||||
|
|
||||||
@ -13,9 +14,9 @@ public interface MtAloneProcessService extends Service<MtAloneProcess, Integer>
|
|||||||
|
|
||||||
List<MtAloneProcessVo> findProcessVoListByProductProcess(ProductProcessParams params);
|
List<MtAloneProcessVo> findProcessVoListByProductProcess(ProductProcessParams params);
|
||||||
|
|
||||||
ProcessAndMaterials queryProcessDetail(MtAloneProcessParams params);
|
ProcessHo queryProcessDetail(MtAloneProcessParams params);
|
||||||
|
|
||||||
|
void saveProcAndProcMat(ProcessAndProcMat processAndProcMat, CurrentUser currentUser);
|
||||||
|
|
||||||
//List<MtAloneProcess> findList(MtAloneProcessParams params) ;
|
void updateProcess(ProcessHo processHo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,8 @@ public interface ProcessMaterialsBomService extends Service<ProcessMaterialsBom,
|
|||||||
|
|
||||||
List<MaterialInfoVo> findMaterilaListByProcessBomId(ProcessBom processBom);
|
List<MaterialInfoVo> findMaterilaListByProcessBomId(ProcessBom processBom);
|
||||||
|
|
||||||
|
List<ProcessMaterialsBomVo> findProcMatBomVoListByProcBom(ProcessMaterialsBomParams procMatBomParams);
|
||||||
|
|
||||||
|
|
||||||
//List<ProcessMaterialsBom> findList(ProcessMaterialsBomParams params) ;
|
//List<ProcessMaterialsBom> findList(ProcessMaterialsBomParams params) ;
|
||||||
|
|
||||||
|
@ -14,7 +14,4 @@ import java.util.List;
|
|||||||
public interface ProcessMaterialsService extends Service<ProcessMaterials, Integer> {
|
public interface ProcessMaterialsService extends Service<ProcessMaterials, Integer> {
|
||||||
List<ProcessMaterialsVo> findProcMatVoListByProcess(MtAloneProcessParams params);
|
List<ProcessMaterialsVo> findProcMatVoListByProcess(MtAloneProcessParams params);
|
||||||
|
|
||||||
|
|
||||||
//List<ProcessMaterials> findList(ProcessMaterialsParams params) ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
package com.deer.wms.produce.manage.service;
|
package com.deer.wms.produce.manage.service;
|
||||||
|
|
||||||
import com.deer.wms.produce.manage.model.ProductProcessBom;
|
import com.deer.wms.produce.manage.model.*;
|
||||||
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.project.seed.core.service.Service;
|
import com.deer.wms.project.seed.core.service.Service;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -23,6 +20,8 @@ public interface ProductProcessBomService extends Service<ProductProcessBom, Int
|
|||||||
void addProductProcessBom(ProductProcessBomParams params);
|
void addProductProcessBom(ProductProcessBomParams params);
|
||||||
|
|
||||||
void updateProductProcessBom(ProductProcessBomParams params);
|
void updateProductProcessBom(ProductProcessBomParams params);
|
||||||
//static Integer getProductBomIdByProductId() {
|
|
||||||
//}
|
ProductProcessBomHo findAllBomByProdProcBom(ProductProcessBomParams params);
|
||||||
|
|
||||||
|
ProductProcessBom selectByProdProcBom(ProductProcessBomParams params);
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
package com.deer.wms.produce.manage.service;
|
package com.deer.wms.produce.manage.service;
|
||||||
|
|
||||||
import com.deer.wms.intercept.common.data.CurrentUser;
|
import com.deer.wms.intercept.common.data.CurrentUser;
|
||||||
import com.deer.wms.produce.manage.model.ProductAndProcess;
|
import com.deer.wms.produce.manage.model.*;
|
||||||
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.project.seed.core.service.Service;
|
import com.deer.wms.project.seed.core.service.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -19,5 +16,11 @@ public interface ProductProcessService extends Service<ProductProcess, Integer>
|
|||||||
|
|
||||||
void saveProdAndProc(ProductAndProcess productAndProcess, CurrentUser currentUser);
|
void saveProdAndProc(ProductAndProcess productAndProcess, CurrentUser currentUser);
|
||||||
|
|
||||||
ProductAndProcess queryProductProcessDetail(ProductProcessParams params);
|
ProductProcessHo queryProductProcessDetail(ProductProcessParams params);
|
||||||
|
|
||||||
|
ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params);
|
||||||
|
|
||||||
|
void addProduceProcess(ProductProcessHo productProcessHo, CurrentUser currentUser);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package com.deer.wms.produce.manage.service.impl;
|
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.dao.MtAloneProcessMapper;
|
||||||
import com.deer.wms.produce.manage.model.*;
|
import com.deer.wms.produce.manage.model.*;
|
||||||
import com.deer.wms.produce.manage.service.MtAloneProcessService;
|
import com.deer.wms.produce.manage.service.MtAloneProcessService;
|
||||||
import com.deer.wms.produce.manage.service.ProcessBomService;
|
import com.deer.wms.produce.manage.service.ProcessBomService;
|
||||||
|
import com.deer.wms.produce.manage.service.ProcessMaterialsBomService;
|
||||||
import com.deer.wms.produce.manage.service.ProcessMaterialsService;
|
import com.deer.wms.produce.manage.service.ProcessMaterialsService;
|
||||||
import com.deer.wms.project.seed.core.service.AbstractService;
|
import com.deer.wms.project.seed.core.service.AbstractService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@ -12,6 +14,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,6 +33,9 @@ public class MtAloneProcessServiceImpl extends AbstractService<MtAloneProcess, I
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ProcessMaterialsService processMaterialsService;
|
private ProcessMaterialsService processMaterialsService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProcessMaterialsBomService processMaterialsBomService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MtAloneProcess> findProcessListByProductBom(ProcessBomParams params) {
|
public List<MtAloneProcess> findProcessListByProductBom(ProcessBomParams params) {
|
||||||
//通过产品bom获取工序bom
|
//通过产品bom获取工序bom
|
||||||
@ -53,32 +59,67 @@ public class MtAloneProcessServiceImpl extends AbstractService<MtAloneProcess, I
|
|||||||
return mtAloneProcessMapper.findProcessVoListByProductProcess(params);
|
return mtAloneProcessMapper.findProcessVoListByProductProcess(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*接着写*/
|
|
||||||
@Override
|
@Override
|
||||||
public ProcessAndMaterials queryProcessDetail(MtAloneProcessParams params) {
|
public ProcessHo queryProcessDetail(MtAloneProcessParams params) {
|
||||||
//根据工序id查询工序详细信息
|
//根据工序id查询工序详细信息
|
||||||
MtAloneProcessVo processVo = (MtAloneProcessVo) mtAloneProcessMapper.selectProcessVoByProcessId(params);
|
MtAloneProcessVo processVo = (MtAloneProcessVo) mtAloneProcessMapper.selectProcessVoByProcessId(params);
|
||||||
|
|
||||||
//根据工序id查询物料信息
|
//根据工序id查询物料信息
|
||||||
List<ProcessMaterialsVo> processMaterialsVoList = processMaterialsService.findProcMatVoListByProcess(params);
|
List<ProcessMaterialsVo> procMatVoList = processMaterialsService.findProcMatVoListByProcess(params);
|
||||||
|
ProcessHo processHo = new ProcessHo();
|
||||||
ProcessAndMaterials processAndMaterials = new ProcessAndMaterials();
|
if(null != processVo){
|
||||||
processAndMaterials.setProcessVo(processVo);
|
System.out.println("----------"+processVo.getId());
|
||||||
if(null != processMaterialsVoList) {
|
System.out.println("----------"+processVo.getProcessName());
|
||||||
ProcessMaterialsVo[] processMaterialsVo = new ProcessMaterialsVo[processMaterialsVoList.size()];
|
BeanUtils.copyProperties(processVo, processHo);
|
||||||
for (int i = 0; i < processMaterialsVo.length; i++) {
|
processHo.setProcessMaterialsVoList(procMatVoList);
|
||||||
processMaterialsVo[i] = processMaterialsVoList.get(i);
|
|
||||||
}
|
}
|
||||||
processAndMaterials.setProcessMaterialsVo(processMaterialsVo);
|
return processHo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveProcAndProcMat(ProcessAndProcMat processAndProcMat, CurrentUser currentUser) {
|
||||||
|
//前端对工序赋值,更新工序
|
||||||
|
MtAloneProcessVo mtAloneProcessVo = processAndProcMat.getMtAloneProcessVo();
|
||||||
|
MtAloneProcess mtAloneProcess = new MtAloneProcess();
|
||||||
|
BeanUtils.copyProperties(mtAloneProcessVo, mtAloneProcess);
|
||||||
|
mtAloneProcessMapper.updateByPrimaryKey(mtAloneProcess);
|
||||||
|
|
||||||
return processAndMaterials;
|
//通过工序bom的id获取物料bom
|
||||||
|
ProcessMaterialsBomParams procMatBomParams = new ProcessMaterialsBomParams();
|
||||||
|
procMatBomParams.setProcessBomId(processAndProcMat.getMtAloneProcessVo().getProcessBomId());
|
||||||
|
procMatBomParams.setCompanyId(currentUser.getCompanyId());
|
||||||
|
List<ProcessMaterialsBomVo> procMatBomVoList = processMaterialsBomService.findProcMatBomVoListByProcBom(procMatBomParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProcess(ProcessHo processHo) {
|
||||||
|
Date date = new Date();
|
||||||
|
MtAloneProcess process = new MtAloneProcess();
|
||||||
|
processHo.setUpdateTime(date);
|
||||||
|
BeanUtils.copyProperties(processHo, process);
|
||||||
|
this.update(process);
|
||||||
|
|
||||||
//@Override
|
//if(null != processHo.getProcessMaterialsVoList()) {
|
||||||
//public List<MtAloneProcess> findList(MtAloneProcessParams params) {
|
// List<ProcessMaterialsVo> procMatVoList = processHo.getProcessMaterialsVoList();
|
||||||
// return mtAloneProcessMapper.findList(params);
|
// List<ProcessMaterials> procMatList = new ArrayList<ProcessMaterials>(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<ProcessMaterialsVo> procMatVoList = processHo.getProcessMaterialsVoList();
|
||||||
|
for (ProcessMaterialsVo processMaterialsVo : procMatVoList){
|
||||||
|
ProcessMaterials processMaterials = new ProcessMaterials();
|
||||||
|
processMaterialsVo.setUpdateTime(date);
|
||||||
|
BeanUtils.copyProperties(processMaterialsVo, processMaterials);
|
||||||
|
processMaterialsService.update(processMaterials);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -73,11 +73,9 @@ public class ProcessBomServiceImpl extends AbstractService<ProcessBom, Integer>
|
|||||||
ProductProcessBom productProcessBom = productProcessBomService.findById(params.getProductProcessId());
|
ProductProcessBom productProcessBom = productProcessBomService.findById(params.getProductProcessId());
|
||||||
|
|
||||||
ProductProcessBomPo productProcessBomPo = new ProductProcessBomPo();
|
ProductProcessBomPo productProcessBomPo = new ProductProcessBomPo();
|
||||||
|
productProcessBomPo.setProductProcessBom(productProcessBom);
|
||||||
productProcessBomPo.setProcessBomList(processBomList);
|
productProcessBomPo.setProcessBomList(processBomList);
|
||||||
if(null != productProcessBom) {
|
|
||||||
productProcessBomPo.setSpecification(productProcessBom.getSpecification());
|
|
||||||
productProcessBomPo.setProcessContent(productProcessBom.getProcessContent());
|
|
||||||
}
|
|
||||||
return productProcessBomPo;
|
return productProcessBomPo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,11 @@ public class ProcessMaterialsBomServiceImpl extends AbstractService<ProcessMater
|
|||||||
return processMaterialsBomMapper.findMaterilaListByProcessBomId(processBom);
|
return processMaterialsBomMapper.findMaterilaListByProcessBomId(processBom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProcessMaterialsBomVo> findProcMatBomVoListByProcBom(ProcessMaterialsBomParams procMatBomParams) {
|
||||||
|
return processMaterialsBomMapper.findProcMatBomVoListByProcBom(procMatBomParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//@Override
|
//@Override
|
||||||
//public List<ProcessMaterialsBom> findList(ProcessMaterialsBomParams params) {
|
//public List<ProcessMaterialsBom> findList(ProcessMaterialsBomParams params) {
|
||||||
|
@ -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.ProcessMaterialsBomMapper;
|
||||||
import com.deer.wms.produce.manage.dao.ProductProcessBomMapper;
|
import com.deer.wms.produce.manage.dao.ProductProcessBomMapper;
|
||||||
import com.deer.wms.produce.manage.model.*;
|
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.produce.manage.service.ProductProcessBomService;
|
||||||
|
|
||||||
|
|
||||||
import com.deer.wms.project.seed.core.service.AbstractService;
|
import com.deer.wms.project.seed.core.service.AbstractService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -32,6 +34,9 @@ public class ProductProcessBomServiceImpl extends AbstractService<ProductProcess
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ProcessMaterialsBomMapper processMaterialsBomMapper;
|
private ProcessMaterialsBomMapper processMaterialsBomMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProcessMaterialsBomService processMaterialsBomService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ProductProcessBomDto> findProBomAndProList(ProductProcessBomParams params) {
|
public List<ProductProcessBomDto> findProBomAndProList(ProductProcessBomParams params) {
|
||||||
@ -135,4 +140,41 @@ public class ProductProcessBomServiceImpl extends AbstractService<ProductProcess
|
|||||||
}
|
}
|
||||||
processMaterialsBomMapper.insertOrUpdate(processMaterialsBomList);
|
processMaterialsBomMapper.insertOrUpdate(processMaterialsBomList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProductProcessBomHo findAllBomByProdProcBom(ProductProcessBomParams params) {
|
||||||
|
ProductProcessBomHo productProcessBomHo = new ProductProcessBomHo();
|
||||||
|
//产品bom的id、名称获取
|
||||||
|
ProductProcessBom productProcessBom = productProcessBomMapper.selectByProdProcBom(params);
|
||||||
|
productProcessBomHo.setProdProcBomId(productProcessBom.getId());
|
||||||
|
productProcessBomHo.setProdProcBomName(productProcessBom.getProductProcessName());
|
||||||
|
//工序bom获取
|
||||||
|
ProcessBomParams processBomParams = new ProcessBomParams();
|
||||||
|
processBomParams.setProductProcessId(params.getProductBomId());
|
||||||
|
processBomParams.setCompanyId(params.getCompanyId());
|
||||||
|
List<ProcessBom> processBomList = processBomMapper.findListByProductBom(processBomParams);
|
||||||
|
List<ProcessBomHo> processBomHoList = null;
|
||||||
|
if(null != processBomList){
|
||||||
|
processBomHoList = new ArrayList<ProcessBomHo>(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<ProcessMaterialsBomVo> procMatBomVoList = processMaterialsBomService.findProcMatBomVoListByProcBom(procMatBomParams);
|
||||||
|
processBomHo.setProcMatBomVoList(procMatBomVoList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
productProcessBomHo.setProcessBomHoList(processBomHoList);
|
||||||
|
|
||||||
|
return productProcessBomHo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProductProcessBom selectByProdProcBom(ProductProcessBomParams params) {
|
||||||
|
return productProcessBomMapper.selectByProdProcBom(params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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.constant.ProduceManagePublicMethod;
|
||||||
import com.deer.wms.produce.manage.dao.ProductProcessMapper;
|
import com.deer.wms.produce.manage.dao.ProductProcessMapper;
|
||||||
import com.deer.wms.produce.manage.model.*;
|
import com.deer.wms.produce.manage.model.*;
|
||||||
import com.deer.wms.produce.manage.service.MtAloneProcessService;
|
import com.deer.wms.produce.manage.service.*;
|
||||||
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 com.deer.wms.project.seed.core.service.AbstractService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -28,12 +26,24 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ProductProcessMapper productProcessMapper;
|
private ProductProcessMapper productProcessMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProductProcessService productProcessService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProcessBomService processBomService;
|
private ProcessBomService processBomService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MtAloneProcessService processService;
|
private MtAloneProcessService processService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProductProcessBomService productProcessBomService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProcessMaterialsBomService processMaterialsBomService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProcessMaterialsService processMaterialsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ProductProcessVo> findList(ProductProcessParams params) {
|
public List<ProductProcessVo> findList(ProductProcessParams params) {
|
||||||
return productProcessMapper.findList(params);
|
return productProcessMapper.findList(params);
|
||||||
@ -58,7 +68,7 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveProdAndProc(ProductAndProcess productAndProcess, CurrentUser currentUser) {
|
public void saveProdAndProc(ProductAndProcess productAndProcess, CurrentUser currentUser) {
|
||||||
//首先保存批次产品加工信息
|
//保存批次产品加工信息
|
||||||
ProductProcess productProcess = productAndProcess.getProductProcess();
|
ProductProcess productProcess = productAndProcess.getProductProcess();
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
productProcess.setOperatorId(currentUser.getUserId());
|
productProcess.setOperatorId(currentUser.getUserId());
|
||||||
@ -72,36 +82,166 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
|||||||
productProcess.setCompanyId(currentUser.getCompanyId());
|
productProcess.setCompanyId(currentUser.getCompanyId());
|
||||||
productProcessMapper.insert(productProcess);
|
productProcessMapper.insert(productProcess);
|
||||||
|
|
||||||
//其次保存由前端获取的工序信息
|
//保存由前端获取的工序信息
|
||||||
MtAloneProcessVo[] processesVo = productAndProcess.getProcessesVo();
|
List<MtAloneProcessVo> processVoList = productAndProcess.getProcessVoList();
|
||||||
if(null != processesVo) {
|
if(null != processVoList) {
|
||||||
MtAloneProcess[] processes = new MtAloneProcess[processesVo.length];
|
List<MtAloneProcess> processList = new ArrayList<MtAloneProcess>(processVoList.size());
|
||||||
for (int i = 0; i < processesVo.length; i++) {
|
for (MtAloneProcess processVo : processVoList) {
|
||||||
processes[i] = new MtAloneProcess();
|
MtAloneProcess process = new MtAloneProcess();
|
||||||
BeanUtils.copyProperties(processesVo[i], processes[i]);
|
BeanUtils.copyProperties(processVo, process);
|
||||||
processService.save(processes[i]);
|
process.setProductProcessId(productProcess.getId());
|
||||||
|
processList.add(process);
|
||||||
}
|
}
|
||||||
|
processService.save(processList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProductAndProcess queryProductProcessDetail(ProductProcessParams params) {
|
public ProductProcessHo queryProductProcessDetail(ProductProcessParams params) {
|
||||||
//根据批次产品加工id查询批次产品加工单信息
|
//根据批次生产加工id查询批次产品加工单信息
|
||||||
ProductProcess productProcess = productProcessMapper.selectByPrimaryKey(params.getProductProcessId());
|
ProductProcess productProcess = productProcessMapper.selectByPrimaryKey(params.getProductProcessId());
|
||||||
//根据批次产品加工id查询工序信息
|
//根据批次产品加工id查询工序信息
|
||||||
List<MtAloneProcessVo> processVoList = processService.findProcessVoListByProductProcess(params);
|
List<MtAloneProcessVo> tempProcessVoList = processService.findProcessVoListByProductProcess(params);
|
||||||
|
|
||||||
ProductAndProcess productAndProcess = new ProductAndProcess();
|
ProductProcessHo productProcessHo = new ProductProcessHo();
|
||||||
productAndProcess.setProductProcess(productProcess);
|
if(null != productProcess) {
|
||||||
if(null != processVoList) {
|
BeanUtils.copyProperties(productProcess, productProcessHo);
|
||||||
MtAloneProcessVo[] processesVo = new MtAloneProcessVo[processVoList.size()];
|
if (null != tempProcessVoList) {
|
||||||
for (int i = 0; i < processesVo.length; i++) {
|
List<ProcessHo> processHoList = new ArrayList<ProcessHo>(tempProcessVoList.size());
|
||||||
processesVo[i] = processVoList.get(i);
|
for (MtAloneProcessVo processVo : tempProcessVoList) {
|
||||||
|
ProcessHo processHo = new ProcessHo();
|
||||||
|
BeanUtils.copyProperties(processVo, processHo);
|
||||||
|
processHoList.add(processHo);
|
||||||
|
}
|
||||||
|
productProcessHo.setProcessHoList(processHoList);
|
||||||
}
|
}
|
||||||
productAndProcess.setProcessesVo(processesVo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return productAndProcess;
|
return productProcessHo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params) {
|
||||||
|
ProductProcessHo productProcessHo = new ProductProcessHo();
|
||||||
|
|
||||||
|
//批次产品加工单初步赋值,关联bom
|
||||||
|
ProductProcessBom productProcessBom = productProcessBomService.selectByProdProcBom(params);
|
||||||
|
if(null != productProcessBom) {
|
||||||
|
productProcessHo.setProductBomId(productProcessBom.getId());
|
||||||
|
productProcessHo.setProductProcessBomName(productProcessBom.getProductProcessName());
|
||||||
|
//工序初步赋值,关联bom
|
||||||
|
ProcessBomParams processBomParams = new ProcessBomParams();
|
||||||
|
processBomParams.setProductProcessId(params.getProductBomId());
|
||||||
|
processBomParams.setCompanyId(params.getCompanyId());
|
||||||
|
List<ProcessBom> processBomList = processBomService.findListByProductBom(processBomParams);
|
||||||
|
List<ProcessHo> processHoList;
|
||||||
|
if (null != processBomList) {
|
||||||
|
processHoList = new ArrayList<ProcessHo>(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<ProcessMaterialsBomVo> procMatBomVoList = processMaterialsBomService.findProcMatBomVoListByProcBom(procMatBomParams);
|
||||||
|
List<ProcessMaterialsVo> procMatVoList;
|
||||||
|
if (null != procMatBomVoList) {
|
||||||
|
procMatVoList = new ArrayList<ProcessMaterialsVo>(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());
|
||||||
|
procMatVo.setDosage(procMatBomVo.getDosage());//先按照模板对用量赋值,前端在将匹数乘以用量计算后展示在表格
|
||||||
|
procMatVoList.add(procMatVo);
|
||||||
|
}
|
||||||
|
processHo.setProcessMaterialsVoList(procMatVoList);
|
||||||
|
}
|
||||||
|
processHoList.add(processHo);
|
||||||
|
}
|
||||||
|
productProcessHo.setProcessHoList(processHoList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return productProcessHo;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addProduceProcess(ProductProcessHo productProcessHo, CurrentUser currentUser) {
|
||||||
|
//保存批次产品加工信息
|
||||||
|
Date date = new Date();
|
||||||
|
ProductProcess productProcess = new ProductProcess();
|
||||||
|
BeanUtils.copyProperties(productProcessHo, productProcess);
|
||||||
|
productProcess.setOperatorId(currentUser.getUserId());
|
||||||
|
productProcess.setCreateTime(date);
|
||||||
|
productProcess.setUpdateTime(date);
|
||||||
|
productProcess.setVersion("1.1");
|
||||||
|
productProcess.setStatus(ProduceManageConstant.STATUS_AVAILABLE);
|
||||||
|
productProcess.setWorkOrderCode(ProduceManagePublicMethod.creatUniqueCode("PCJGD"));
|
||||||
|
productProcess.setShrinkage((productProcess.getDetectionLen()/productProcess.getLen())*100+"%");
|
||||||
|
productProcess.setReviewStatus(ProduceManageConstant.REVIEW_STATUS_FORREVIEW);
|
||||||
|
productProcess.setCompanyId(currentUser.getCompanyId());
|
||||||
|
productProcessMapper.insert(productProcess);
|
||||||
|
|
||||||
|
//保存工序和物料信息,避免循环操作数据库
|
||||||
|
List<ProcessHo> processHoList = productProcessHo.getProcessHoList();
|
||||||
|
List<MtAloneProcess> processList;
|
||||||
|
List<ProcessMaterials> processMaterialsList;
|
||||||
|
if(null != processHoList) {
|
||||||
|
processList = new ArrayList<MtAloneProcess>(processHoList.size());
|
||||||
|
for (ProcessHo processHo : processHoList) {
|
||||||
|
MtAloneProcess process = new MtAloneProcess();
|
||||||
|
BeanUtils.copyProperties(processHo, process);
|
||||||
|
process.setOperatorId(currentUser.getUserId());
|
||||||
|
process.setCreateTime(date);
|
||||||
|
process.setUpdateTime(date);
|
||||||
|
process.setVersion("1.1");
|
||||||
|
process.setStatus(ProduceManageConstant.STATUS_AVAILABLE);
|
||||||
|
process.setProductProcessId(productProcess.getId());
|
||||||
|
process.setCode(ProduceManagePublicMethod.creatUniqueCode("GX"));
|
||||||
|
process.setCompanyId(currentUser.getCompanyId());
|
||||||
|
processList.add(process);
|
||||||
|
|
||||||
|
}
|
||||||
|
processService.save(processList);
|
||||||
|
|
||||||
|
processMaterialsList = new ArrayList<ProcessMaterials>();
|
||||||
|
for (int i=0; i<processList.size(); i++) {
|
||||||
|
MtAloneProcess process = processList.get(i);
|
||||||
|
ProcessHo processHo = processHoList.get(i);
|
||||||
|
List<ProcessMaterialsVo> processMaterialsVoList = processHo.getProcessMaterialsVoList();
|
||||||
|
if(null != processMaterialsVoList) {
|
||||||
|
for (ProcessMaterialsVo processMaterialsVo : processMaterialsVoList) {
|
||||||
|
ProcessMaterials processMaterials = new ProcessMaterials();
|
||||||
|
BeanUtils.copyProperties(processMaterialsVo, processMaterials);
|
||||||
|
processMaterials.setOperatorId(currentUser.getUserId());
|
||||||
|
processMaterials.setCreateTime(date);
|
||||||
|
processMaterials.setUpdateTime(date);
|
||||||
|
processMaterials.setVersion("1.1");
|
||||||
|
processMaterials.setStatus(ProduceManageConstant.STATUS_AVAILABLE);
|
||||||
|
processMaterials.setProcessId(process.getId());
|
||||||
|
processMaterials.setCode(ProduceManagePublicMethod.creatUniqueCode("SCWL"));
|
||||||
|
processMaterials.setDosage(productProcess.getPiNum()*processMaterials.getDosage());
|
||||||
|
processMaterials.setCompanyId(currentUser.getCompanyId());
|
||||||
|
processMaterialsList.add(processMaterials);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
processMaterialsService.save(processMaterialsList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -129,22 +129,60 @@ public class MtAloneProcessController {
|
|||||||
* @param currentUser
|
* @param currentUser
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "根据工序id查询工序详情及物料信息", notes = "根据工序id查询工序详情及物料信息")
|
@ApiOperation(value = "工序详情查询", notes = "工序详情查询")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "processId", value = "工序id", paramType = "query", dataType = "int", required = true),
|
@ApiImplicitParam(name = "processId", value = "工序id", paramType = "query", dataType = "int", required = true),
|
||||||
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
||||||
|
|
||||||
})
|
})
|
||||||
@OperateLog(description = "根据工序id查询工序详情及物料信息", type = "查询")
|
@OperateLog(description = "工序详情查询", type = "查询")
|
||||||
@GetMapping("/query/process/detail")
|
@GetMapping("/query/process/detail")
|
||||||
public Result queryProcessDetail(MtAloneProcessParams params, @ApiIgnore @User CurrentUser currentUser) {
|
public Result queryProcessDetail(MtAloneProcessParams params, @ApiIgnore @User CurrentUser currentUser) {
|
||||||
//if(currentUser==null){
|
if(currentUser==null){
|
||||||
// return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
|
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
|
||||||
//}
|
}
|
||||||
|
|
||||||
params.setCompanyId(1);
|
params.setCompanyId(currentUser.getCompanyId());
|
||||||
PageHelper.startPage(params.getPageNum(), params.getPageSize());
|
ProcessHo processHo = mtAloneProcessService.queryProcessDetail(params);
|
||||||
ProcessAndMaterials processAndMaterials = mtAloneProcessService.queryProcessDetail(params);
|
return ResultGenerator.genSuccessResult(processHo);
|
||||||
return ResultGenerator.genSuccessResult(processAndMaterials);
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hy停用
|
||||||
|
* 工序处理完毕时,点击提交同时更新工序信息、保存物料信息、更新物料库存信息
|
||||||
|
* @param processAndProcMat
|
||||||
|
* @param currentUser
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "工序及物料信息保存", notes = "工序及物料信息保存")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "processAndProcMat", value = "工序及物料", paramType = "body", dataType = "ProcessAndProcMat", 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();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hy正在用
|
||||||
|
* 工序处理完毕点提交按钮后,同时更新工序和物料信息
|
||||||
|
* @param processHo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "工序详情更新", notes = "工序详情更新")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "processHo", value = "工序及物料", paramType = "body", dataType = "ProcessHo", required = true)
|
||||||
|
})
|
||||||
|
@OperateLog(description = "工序详情更新", type = "更新")
|
||||||
|
@PostMapping("/updateProcess")
|
||||||
|
public Result updateProcess(@RequestBody ProcessHo processHo) {
|
||||||
|
mtAloneProcessService.updateProcess(processHo);
|
||||||
|
return ResultGenerator.genSuccessResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,10 +161,8 @@ public class ProcessBomController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation(value = "根据产品bom的id获取产品bom部分数据和工序数据", notes = "根据产品bom的id获取产品bom部分数据和工序数据")
|
@ApiOperation(value = "根据产品bom的id获取产品bom部分数据和工序数据", notes = "根据产品bom的id获取产品bom部分数据和工序数据")
|
||||||
@ApiImplicitParams({
|
@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 = "productProcessId", value = "产品bom的id", paramType = "query", dataType = "int", required = true),
|
||||||
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
||||||
|
|
||||||
})
|
})
|
||||||
@GetMapping("/and/product/bom/by/prodbom")
|
@GetMapping("/and/product/bom/by/prodbom")
|
||||||
public Result ProductAndProcessBomByProdBom(ProcessBomParams params, @ApiIgnore @User CurrentUser currentUser){
|
public Result ProductAndProcessBomByProdBom(ProcessBomParams params, @ApiIgnore @User CurrentUser currentUser){
|
||||||
|
@ -2,10 +2,7 @@ package com.deer.wms.produce.manage.web;
|
|||||||
|
|
||||||
import com.deer.wms.intercept.annotation.User;
|
import com.deer.wms.intercept.annotation.User;
|
||||||
import com.deer.wms.intercept.common.data.CurrentUser;
|
import com.deer.wms.intercept.common.data.CurrentUser;
|
||||||
import com.deer.wms.produce.manage.model.ProductProcessBom;
|
import com.deer.wms.produce.manage.model.*;
|
||||||
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.service.ProductProcessBomService;
|
import com.deer.wms.produce.manage.service.ProductProcessBomService;
|
||||||
import com.deer.wms.project.seed.annotation.OperateLog;
|
import com.deer.wms.project.seed.annotation.OperateLog;
|
||||||
import com.deer.wms.project.seed.constant.SystemManageConstant;
|
import com.deer.wms.project.seed.constant.SystemManageConstant;
|
||||||
@ -179,6 +176,24 @@ public class ProductProcessBomController {
|
|||||||
return ResultGenerator.genSuccessResult(pageInfo);
|
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
|
* author:caixiang
|
||||||
*
|
*
|
||||||
|
@ -3,10 +3,7 @@ package com.deer.wms.produce.manage.web;
|
|||||||
import com.deer.wms.intercept.annotation.Authority;
|
import com.deer.wms.intercept.annotation.Authority;
|
||||||
import com.deer.wms.intercept.annotation.User;
|
import com.deer.wms.intercept.annotation.User;
|
||||||
import com.deer.wms.intercept.common.data.CurrentUser;
|
import com.deer.wms.intercept.common.data.CurrentUser;
|
||||||
import com.deer.wms.produce.manage.model.ProductAndProcess;
|
import com.deer.wms.produce.manage.model.*;
|
||||||
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.service.ProcessBomService;
|
import com.deer.wms.produce.manage.service.ProcessBomService;
|
||||||
import com.deer.wms.produce.manage.service.ProductProcessService;
|
import com.deer.wms.produce.manage.service.ProductProcessService;
|
||||||
import com.deer.wms.project.seed.annotation.OperateLog;
|
import com.deer.wms.project.seed.annotation.OperateLog;
|
||||||
@ -19,10 +16,12 @@ import io.swagger.annotations.Api;
|
|||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@ -41,7 +40,7 @@ public class ProductProcessController {
|
|||||||
private ProcessBomService processBomService;
|
private ProcessBomService processBomService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hy
|
* hy暂时没用
|
||||||
* 生成某种产品某一批次的生产加工单
|
* 生成某种产品某一批次的生产加工单
|
||||||
* 需要调用对应产品bom
|
* 需要调用对应产品bom
|
||||||
* @param productProcess
|
* @param productProcess
|
||||||
@ -91,7 +90,7 @@ public class ProductProcessController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation(value = "批次生产加工单分页查询", notes = "批次生产加工单分页查询")
|
@ApiOperation(value = "批次生产加工单分页查询", notes = "批次生产加工单分页查询")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "createDate", value = "创建时间", paramType = "query", dataType = "Date", required = false),
|
@ApiImplicitParam(name = "createDate", value = "创建时间", paramType = "query", dataType = "String", required = false),
|
||||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String", required = false),
|
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String", required = false),
|
||||||
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
||||||
|
|
||||||
@ -111,7 +110,7 @@ public class ProductProcessController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hy正在用
|
* hy停用
|
||||||
* 新建批次产品加工完毕时,点击提交同时保存产品加工和工序信息
|
* 新建批次产品加工完毕时,点击提交同时保存产品加工和工序信息
|
||||||
* @param productAndProcess
|
* @param productAndProcess
|
||||||
* @param currentUser
|
* @param currentUser
|
||||||
@ -132,7 +131,6 @@ public class ProductProcessController {
|
|||||||
return ResultGenerator.genSuccessResult();
|
return ResultGenerator.genSuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hy正在用
|
* hy正在用
|
||||||
* 点击批次生产加工单列表最后一列查看或处理按钮,
|
* 点击批次生产加工单列表最后一列查看或处理按钮,
|
||||||
@ -145,7 +143,6 @@ public class ProductProcessController {
|
|||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "productProcessId", value = "批次生产加工单id", paramType = "query", dataType = "int", required = true),
|
@ApiImplicitParam(name = "productProcessId", value = "批次生产加工单id", paramType = "query", dataType = "int", required = true),
|
||||||
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
||||||
|
|
||||||
})
|
})
|
||||||
@OperateLog(description = "批次生产加工单详情查询", type = "查询")
|
@OperateLog(description = "批次生产加工单详情查询", type = "查询")
|
||||||
@GetMapping("/query/product/process/detail")
|
@GetMapping("/query/product/process/detail")
|
||||||
@ -155,8 +152,77 @@ public class ProductProcessController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
params.setCompanyId(currentUser.getCompanyId());
|
params.setCompanyId(currentUser.getCompanyId());
|
||||||
ProductAndProcess productAndProcess = productProcessService.queryProductProcessDetail(params);
|
ProductProcessHo productProcessHo = productProcessService.queryProductProcessDetail(params);
|
||||||
return ResultGenerator.genSuccessResult(productAndProcess);
|
return ResultGenerator.genSuccessResult(productProcessHo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hy正在用
|
||||||
|
* 新建批次产品加工时,选择产品bom后,
|
||||||
|
* 生成加工单、工序、物料信息并对其初步赋值,用于表格展示
|
||||||
|
* @param params
|
||||||
|
* @param currentUser
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "初始化批次生产加工单信息", notes = "初始化批次生产加工单信息")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "productBomId", value = "产品bom的id", paramType = "query", dataType = "int", required = true),
|
||||||
|
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
|
||||||
|
|
||||||
|
})
|
||||||
|
@OperateLog(description = "初始化批次生产加工单信息", type = "查询")
|
||||||
|
@GetMapping("/initialProdProcByProdProcBom")
|
||||||
|
public Result initialProdProcByProdProcBom(ProductProcessBomParams params, @ApiIgnore @User CurrentUser currentUser) {
|
||||||
|
if(currentUser==null){
|
||||||
|
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
|
||||||
|
}
|
||||||
|
|
||||||
|
params.setCompanyId(currentUser.getCompanyId());
|
||||||
|
ProductProcessHo productProcessHo = productProcessService.initialProdProcByProdProcBom(params);
|
||||||
|
return ResultGenerator.genSuccessResult(productProcessHo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hy正在用
|
||||||
|
* 新建批次产品加工时,点击提交按钮在库表中同时保存初步的加工单、工序、物料信息
|
||||||
|
* @param productProcessHo
|
||||||
|
* @param currentUser
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增批次生产加工单", notes = "新增批次生产加工单")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "productProcessHo", value = "批次生产加工信息", paramType = "body", dataType = "ProductProcessHo", required = true)
|
||||||
|
})
|
||||||
|
@OperateLog(description = "新增批次生产加工单", type = "保存")
|
||||||
|
@PostMapping("/addProductProcess")
|
||||||
|
public Result addProductProcess(@RequestBody ProductProcessHo productProcessHo, @ApiIgnore @User CurrentUser currentUser) {
|
||||||
|
if(currentUser==null){
|
||||||
|
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
|
||||||
|
}
|
||||||
|
|
||||||
|
productProcessService.addProduceProcess(productProcessHo, currentUser);
|
||||||
|
return ResultGenerator.genSuccessResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hy正在用
|
||||||
|
* 批次生产加工单处理完毕点保存按钮后,仅更新批次加工单信息
|
||||||
|
* @param productProcessHo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批次加工单详情更新", notes = "批次加工单详情更新")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "productProcessHo", value = "批次加工单", paramType = "body", dataType = "ProductProcessHo", required = true)
|
||||||
|
})
|
||||||
|
@OperateLog(description = "批次加工单详情更新", type = "更新")
|
||||||
|
@PostMapping("/updateProductProcess")
|
||||||
|
public Result updateProductProcess(@RequestBody ProductProcessHo productProcessHo) {
|
||||||
|
ProductProcess productProcess = new ProductProcess();
|
||||||
|
productProcessHo.setUpdateTime(new Date());
|
||||||
|
BeanUtils.copyProperties(productProcessHo, productProcess);
|
||||||
|
productProcessService.update(productProcess);
|
||||||
|
return ResultGenerator.genSuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user