Merge branch 'master' of https://git.picaiba.com/mengtong/mt-pms-api into caixiang

 Conflicts:
	.idea/workspace.xml
This commit is contained in:
CaiXiang 2020-01-10 15:04:30 +08:00
commit 4e7e52f7b9
69 changed files with 5884 additions and 26131 deletions

6
.gitignore vendored
View File

@ -3,6 +3,7 @@
.metadata .metadata
bin/ bin/
tmp/ tmp/
logs/
*.tmp *.tmp
*.bak *.bak
*.swp *.swp
@ -11,6 +12,7 @@ local.properties
.settings/ .settings/
.loadpath .loadpath
.recommenders .recommenders
.idea/
# External tool builders # External tool builders
.externalToolBuilders/ .externalToolBuilders/
@ -56,3 +58,7 @@ local.properties
.scala_dependencies .scala_dependencies
.worksheet .worksheet
/.idea/libraries/Maven__com_deer_wms_intercept_1_0_0_SNAPSHOT.xml
/.idea/libraries/Maven__com_deer_wms_intercept_1_0_0_SNAPSHOT.xml
/.idea/libraries/Maven__com_deer_wms_project_seed_1_0_0_SNAPSHOT.xml
/.idea/workspace.xml

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

13
pom.xml
View File

@ -8,6 +8,10 @@
<packaging>pom</packaging> <packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<modules>
<module>wms-produce-manage</module>
</modules>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
@ -15,9 +19,6 @@
<relativePath/> <relativePath/>
</parent> </parent>
<modules>
<module>wms-produce-manage</module>
</modules>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -105,6 +106,12 @@
<artifactId>pagehelper</artifactId> <artifactId>pagehelper</artifactId>
<version>4.2.1</version> <version>4.2.1</version>
</dependency> </dependency>
<!-- MyBatis 通用 Mapper -->
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
<version>2.0.2</version>
</dependency>
<!--阿里 FastJson依赖--> <!--阿里 FastJson依赖-->
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>

View File

@ -76,6 +76,13 @@
<orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0" level="project" /> <orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:4.2.1" level="project" /> <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:4.2.1" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:0.9.5" level="project" /> <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:0.9.5" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-starter:2.0.2" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-core:1.0.2" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-base:1.0.1" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-weekend:1.1.3" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring:1.0.1" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-extra:1.0.1" level="project" />
<orderEntry type="library" name="Maven: tk.mybatis:mapper-spring-boot-autoconfigure:2.0.2" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.22" level="project" /> <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.22" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.2" level="project" /> <orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.2" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.2" level="project" /> <orderEntry type="library" name="Maven: com.alibaba:druid:1.1.2" level="project" />

View File

@ -1,11 +1,13 @@
##ignore this file## ##ignore this file##
/target/ /target/
target/  target/ 
logs/
.classpath .classpath
.project .project
.factorypath .factorypath
.settings .settings
.apt_generated .apt_generated
.idea
### IntelliJ IDEA ### ### IntelliJ IDEA ###
.idea .idea

View File

@ -1,5 +1,7 @@
package com.deer.wms.produce.manage; package com.deer.wms.produce.manage;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;

View File

@ -6,9 +6,12 @@ import com.deer.wms.produce.manage.model.MaterialsOutgoingLogParams;
import com.deer.wms.produce.manage.model.MaterialsOutgoingLogVo; import com.deer.wms.produce.manage.model.MaterialsOutgoingLogVo;
import com.deer.wms.project.seed.core.mapper.Mapper; import com.deer.wms.project.seed.core.mapper.Mapper;
import java.util.HashMap;
import java.util.List; import java.util.List;
public interface MaterialsOutgoingLogMapper extends Mapper<MaterialsOutgoingLog> { public interface MaterialsOutgoingLogMapper extends Mapper<MaterialsOutgoingLog> {
List<MaterialsOutgoingLogVo> findListByOneMaterial(MaterialsOutgoingLogParams params); List<MaterialsOutgoingLogVo> findListByOneMaterial(MaterialsOutgoingLogParams params);
void deleteByOutgoingIds(HashMap outgoingParam);
} }

View File

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

View File

@ -17,9 +17,12 @@ 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);
void insertOrUpdate(List<ProcessBom> processBomList); void insertOrUpdate(List<ProcessBom> processBomList);
ProductProcessBomPo findProductAndProcessBomByProdBom(Integer productBomId);
} }

View File

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

View File

@ -1,8 +1,13 @@
package com.deer.wms.produce.manage.dao; package com.deer.wms.produce.manage.dao;
import com.deer.wms.produce.manage.model.MtAloneProcessParams;
import com.deer.wms.produce.manage.model.ProcessMaterials; import com.deer.wms.produce.manage.model.ProcessMaterials;
import com.deer.wms.produce.manage.model.ProcessMaterialsVo;
import com.deer.wms.project.seed.core.mapper.Mapper; import com.deer.wms.project.seed.core.mapper.Mapper;
import java.util.List;
public interface ProcessMaterialsMapper extends Mapper<ProcessMaterials> { public interface ProcessMaterialsMapper extends Mapper<ProcessMaterials> {
List<ProcessMaterialsVo> findProcMatVoListByProcess(MtAloneProcessParams params);
} }

View File

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

View File

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

View File

@ -25,8 +25,11 @@
<result column="materials_name" jdbcType="VARCHAR" property="materialsName" /> <result column="materials_name" jdbcType="VARCHAR" property="materialsName" />
<result column="position_name" jdbcType="VARCHAR" property="positionName" /> <result column="position_name" jdbcType="VARCHAR" property="positionName" />
<result column="company_name" jdbcType="VARCHAR" property="companyName" /> <result column="company_name" jdbcType="VARCHAR" property="companyName" />
<result column="unit_id" jdbcType="INTEGER" property="unitId" />
<result column="unit_name" jdbcType="VARCHAR" property="unitName" /> <result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="parent_id" jdbcType="INTEGER" property="parentId" />
<result column="parent_name" jdbcType="VARCHAR" property="parentName" /> <result column="parent_name" jdbcType="VARCHAR" property="parentName" />
<result column="supplier_id" jdbcType="INTEGER" property="supplierId" />
<result column="supplier_name" jdbcType="VARCHAR" property="supplierName" /> <result column="supplier_name" jdbcType="VARCHAR" property="supplierName" />
</resultMap> </resultMap>
@ -39,12 +42,16 @@
<select id="findList" parameterType="com.deer.wms.produce.manage.model.MaterialsInfoParams" resultMap="MatInfoDTOResultMap"> <select id="findList" parameterType="com.deer.wms.produce.manage.model.MaterialsInfoParams" resultMap="MatInfoDTOResultMap">
SELECT SELECT
materials.id, materials.id,
materials.code,
materials.create_time, materials.create_time,
materials.materials_name, materials.materials_name,
materials.parent_id,
(SELECT m.materials_name FROM mt_alone_materials_info m (SELECT m.materials_name FROM mt_alone_materials_info m
WHERE m.id = materials.parent_id ) parent_name, WHERE m.id = materials.parent_id) parent_name,
materials.unit_id,
materials.specification, materials.specification,
materials.memo, materials.memo,
materials.supplier_id,
IFNULL(stock.quantity,0) quantity, IFNULL(stock.quantity,0) quantity,
stock.position_name, stock.position_name,
unit.unit_name, unit.unit_name,
@ -78,17 +85,22 @@
<if test="companyId != null"> <if test="companyId != null">
AND com.company_id = #{companyId} AND com.company_id = #{companyId}
</if> </if>
</where> order by materials.id </where> ORDER BY materials.create_time DESC
</select> </select>
<select id="findDetailById" parameterType="com.deer.wms.produce.manage.model.MaterialsInfoParams" resultMap="MatInfoDTOResultMap"> <select id="findDetailById" parameterType="com.deer.wms.produce.manage.model.MaterialsInfoParams" resultMap="MatInfoDTOResultMap">
SELECT SELECT
materials.id,
materials.code,
materials.create_time, materials.create_time,
materials.materials_name, materials.materials_name,
materials.parent_id,
(SELECT m.materials_name FROM mt_alone_materials_info m (SELECT m.materials_name FROM mt_alone_materials_info m
WHERE m.id = materials.parent_id ) parent_name, WHERE m.id = materials.parent_id) parent_name,
materials.unit_id,
materials.specification, materials.specification,
materials.memo, materials.memo,
materials.supplier_id,
IFNULL(stock.quantity,0) quantity, IFNULL(stock.quantity,0) quantity,
stock.position_name, stock.position_name,
unit.unit_name, unit.unit_name,
@ -106,7 +118,7 @@
AND materials.id = #{materialsId} AND materials.id = #{materialsId}
</if> </if>
<if test="companyId != null"> <if test="companyId != null">
AND com.company_id = #{companyId} AND materials.company_id = #{companyId}
</if> </if>
</where> </where>
</select> </select>
@ -125,16 +137,15 @@
</select> </select>
<select id="findMaterialsByKeyWords" parameterType="com.deer.wms.produce.manage.model.MaterialsInfoParams" resultMap="mtAloneProcessMaterialsBomVO"> <select id="findMaterialsByKeyWords" parameterType="com.deer.wms.produce.manage.model.MaterialsInfoParams" resultMap="mtAloneProcessMaterialsBomVO">
SELECT * from mt_alone_materials_info materialsInfo inner JOIN mt_alone_process_materials_bom pmb on materialsInfo.id = pmb.materials_id SELECT * from mt_alone_materials_info materialsInfo
<where> <where>
<if test="keywords != null and keywords != ''"> <if test="keywords != null and keywords != ''">
AND materialsInfo.materials_name LIKE CONCAT('%', #{keywords}, '%') AND materialsInfo.materials_name LIKE CONCAT('%', #{keywords}, '%')
OR materialsInfo.code LIKE CONCAT('%', #{keywords}, '%') OR materialsInfo.code LIKE CONCAT('%', #{keywords}, '%')
OR materialsInfo.specification LIKE CONCAT('%', #{keywords}, '%') OR materialsInfo.specification LIKE CONCAT('%', #{keywords}, '%')
OR materialsInfo.unit_id LIKE CONCAT('%', #{keywords}, '%') OR materialsInfo.unit_id LIKE CONCAT('%', #{keywords}, '%')
OR pmb.dosage LIKE CONCAT('%', #{keywords}, '%')
</if> </if>
</where> </where> ORDER BY materialsInfo.create_time
</select> </select>
</mapper> </mapper>

View File

@ -15,6 +15,7 @@
<result column="materials_name" jdbcType="VARCHAR" property="materialsName" /> <result column="materials_name" jdbcType="VARCHAR" property="materialsName" />
<result column="quantity" jdbcType="REAL" property="quantity" /> <result column="quantity" jdbcType="REAL" property="quantity" />
<result column="position_name" jdbcType="VARCHAR" property="positionName" /> <result column="position_name" jdbcType="VARCHAR" property="positionName" />
<result column="unit_id" jdbcType="INTEGER" property="unitId" />
<result column="memo" jdbcType="VARCHAR" property="memo" /> <result column="memo" jdbcType="VARCHAR" property="memo" />
<result column="company_id" jdbcType="INTEGER" property="companyId" /> <result column="company_id" jdbcType="INTEGER" property="companyId" />
</resultMap> </resultMap>
@ -23,6 +24,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="materials_name" jdbcType="VARCHAR" property="materialsName" /> <result column="materials_name" jdbcType="VARCHAR" property="materialsName" />
<result column="position_name" jdbcType="VARCHAR" property="positionName" /> <result column="position_name" jdbcType="VARCHAR" property="positionName" />
<result column="unit_id" jdbcType="INTEGER" property="unitId" />
<result column="user_name" jdbcType="VARCHAR" property="userName" /> <result column="user_name" jdbcType="VARCHAR" property="userName" />
</resultMap> </resultMap>
@ -45,6 +47,15 @@
<if test="companyId != null"> <if test="companyId != null">
AND outgoing.company_id = #{companyId} AND outgoing.company_id = #{companyId}
</if> </if>
</where> ORDER BY outgoing.id </where> ORDER BY outgoing.create_time DESC
</select> </select>
<delete id="deleteByOutgoingIds" parameterType = "java.util.HashMap">
DELETE FROM mt_alone_materials_outgoing_log
where 1>2 OR company_id=#{companyId} AND id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper> </mapper>

View File

@ -31,8 +31,72 @@
<result column="process_bom_name" jdbcType="VARCHAR" property="processBomName" /> <result column="process_bom_name" jdbcType="VARCHAR" property="processBomName" />
<result column="product_annex_code" jdbcType="VARCHAR" property="productAnnexCode" /> <result column="product_annex_code" jdbcType="VARCHAR" property="productAnnexCode" />
<result column="memo" jdbcType="VARCHAR" property="memo" /> <result column="memo" jdbcType="VARCHAR" property="memo" />
<result column="beg_date" jdbcType="TIMESTAMP" property="begDate" />
<result column="end_date" jdbcType="TIMESTAMP" property="endDate" />
<result column="company_id" jdbcType="INTEGER" property="companyId" /> <result column="company_id" jdbcType="INTEGER" property="companyId" />
</resultMap> </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="beg_date" jdbcType="TIMESTAMP" property="begDate" />
<result column="end_date" jdbcType="TIMESTAMP" property="endDate" />
<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="findProcessVoListByProductProcess" 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>
<select id="selectProcessVoByProcessId" parameterType="com.deer.wms.produce.manage.model.MtAloneProcessParams" 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="processId != null">
process.id = #{processId}
</if>
<if test="companyId != null">
AND process.company_id = #{companyId}
</if>
</where> ORDER BY process.process_step
</select>
</mapper> </mapper>

View File

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

View File

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

View File

@ -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" />
@ -18,8 +18,41 @@
<result column="specification" jdbcType="VARCHAR" property="specification" /> <result column="specification" jdbcType="VARCHAR" property="specification" />
<result column="dosage" jdbcType="REAL" property="dosage" /> <result column="dosage" jdbcType="REAL" property="dosage" />
<result column="unit_id" jdbcType="INTEGER" property="unitId" /> <result column="unit_id" jdbcType="INTEGER" property="unitId" />
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="memo" jdbcType="VARCHAR" property="memo" /> <result column="memo" jdbcType="VARCHAR" property="memo" />
<result column="company_id" jdbcType="INTEGER" property="companyId" /> <result column="company_id" jdbcType="INTEGER" property="companyId" />
</resultMap> </resultMap>
<resultMap id="ProcessMaterialsVoResultMap" type="com.deer.wms.produce.manage.model.ProcessMaterialsVo">
<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_id" jdbcType="INTEGER" property="processId" />
<result column="materials_bom_id" jdbcType="INTEGER" property="materialsBomId" />
<result column="materials_name" jdbcType="VARCHAR" property="materialsName" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="specification" jdbcType="VARCHAR" property="specification" />
<result column="dosage" jdbcType="REAL" property="dosage" />
<result column="unit_id" jdbcType="INTEGER" property="unitId" />
<result column="memo" jdbcType="VARCHAR" property="memo" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
<result column="unit_name" jdbcType="VARCHAR" property="unitName0" />
</resultMap>
<select id="findProcMatVoListByProcess" parameterType="com.deer.wms.produce.manage.model.MtAloneProcessParams" resultMap="ProcessMaterialsVoResultMap">
SELECT procmaterials.*, unit.unit_name unit_name0 FROM mt_alone_process_materials procmaterials
LEFT JOIN unit ON procmaterials.unit_id = unit.unit_id AND procmaterials.company_id = unit.company_id
<where>
<if test="processId != null">
procmaterials.process_id = #{processId}
</if>
<if test="companyId != null">
AND procmaterials.company_id = #{companyId}
</if>
</where> ORDER BY procmaterials.id
</select>
</mapper> </mapper>

View File

@ -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
@ -106,7 +96,7 @@
</select> </select>
<select id="findListByTerm" resultMap="ProPrcessBomDTOResultMap"> <select id="findListByTerm" resultMap="ProPrcessBomDTOResultMap">
SELECT u.unit_name,mappb.id,mamp.product_code, mamp.product_name,mamp.specification,mapb.specification AS SELECT u.unit_name,mappb.id,mappb.product_process_name,mamp.product_code, mamp.product_name,mamp.specification,mapb.specification AS
work_specification,mapb.process_content, COUNT(mapb.process_step) process_step work_specification,mapb.process_content, COUNT(mapb.process_step) process_step
FROM mt_alone_product_process_bom mappb FROM mt_alone_product_process_bom mappb
LEFT JOIN mt_alone_machining_product mamp ON mappb.product_id = mamp.id LEFT JOIN mt_alone_machining_product mamp ON mappb.product_id = mamp.id
@ -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>

View File

@ -28,6 +28,7 @@
<result column="product_process_name0" jdbcType="VARCHAR" property="productProcessName0" /> <result column="product_process_name0" jdbcType="VARCHAR" property="productProcessName0" />
<result column="finish_time" jdbcType="TIMESTAMP" property="finishTime" /> <result column="finish_time" jdbcType="TIMESTAMP" property="finishTime" />
<result column="product_bom_id" jdbcType="INTEGER" property="productBomId" /> <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="specification" jdbcType="VARCHAR" property="specification" />
<result column="process_price" jdbcType="REAL" property="processPrice" /> <result column="process_price" jdbcType="REAL" property="processPrice" />
<result column="len" jdbcType="REAL" property="len" /> <result column="len" jdbcType="REAL" property="len" />
@ -49,7 +50,6 @@
</resultMap> </resultMap>
<resultMap id="ProductProcessVoResultMap" type="com.deer.wms.produce.manage.model.ProductProcessVo"> <resultMap id="ProductProcessVoResultMap" type="com.deer.wms.produce.manage.model.ProductProcessVo">
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id" />
<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" />
@ -73,6 +73,7 @@
<result column="product_process_name0" jdbcType="VARCHAR" property="productProcessName0" /> <result column="product_process_name0" jdbcType="VARCHAR" property="productProcessName0" />
<result column="finish_time" jdbcType="TIMESTAMP" property="finishTime" /> <result column="finish_time" jdbcType="TIMESTAMP" property="finishTime" />
<result column="product_bom_id" jdbcType="INTEGER" property="productBomId" /> <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="specification" jdbcType="VARCHAR" property="specification" />
<result column="process_price" jdbcType="REAL" property="processPrice" /> <result column="process_price" jdbcType="REAL" property="processPrice" />
<result column="len" jdbcType="REAL" property="len" /> <result column="len" jdbcType="REAL" property="len" />
@ -96,21 +97,26 @@
</resultMap> </resultMap>
<select id="findList" parameterType="com.deer.wms.produce.manage.model.ProductProcessParams" resultMap="ProductProcessVoResultMap"> <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 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_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 probom.product_id = product.id AND probom.company_id = product.company_id LEFT JOIN mt_alone_machining_product product ON prodbom.product_id = product.id AND prodbom.company_id = product.company_id
<where> <where>
<if test="keywords != null and keywords != ''"> <if test="keywords != null and keywords != ''">
AND prodproc.work_order_code LIKE CONCAT('%', #{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 prodproc.product_process_name LIKE CONCAT('%', #{keywords}, '%')
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 and createDate != ''">
AND DATE_FORMAT(prodproc.create_time,'%Y-%m-%d') = DATE_FORMAT(#{createDate}, '%Y-%m-%d')
</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>
</mapper> </mapper>

View File

@ -59,6 +59,12 @@ public class MaterialsOutgoingLog {
@Column(name = "position_name") @Column(name = "position_name")
private String positionName; private String positionName;
/**
* 单位id, 关联表unit
*/
@Column(name = "unit_id")
private Integer unitId;
/** /**
* 备注 * 备注
*/ */
@ -274,4 +280,22 @@ public class MaterialsOutgoingLog {
public void setCompanyId(Integer companyId) { public void setCompanyId(Integer companyId) {
this.companyId = companyId; this.companyId = companyId;
} }
/**
* 获取单位id
*
* @return unit_Id - 单位id
*/
public Integer getUnitId() {
return unitId;
}
/**
* 设置单位id
*
* @param unitId 单位id
*/
public void setUnitId(Integer unitId) {
this.unitId = unitId;
}
} }

View File

@ -1,6 +1,7 @@
package com.deer.wms.produce.manage.model; package com.deer.wms.produce.manage.model;
/** /**
* 暂时没用
* @Author: hy * @Author: hy
* @Date: 2019/8/20 11:23 * @Date: 2019/8/20 11:23
* @Version 1.0 * @Version 1.0

View File

@ -8,7 +8,7 @@ import com.deer.wms.project.seed.core.service.QueryParams;
*/ */
public class MaterialsOutgoingLogParams extends QueryParams { public class MaterialsOutgoingLogParams extends QueryParams {
private Integer type = ProduceManageConstant.TYPE_IN;//默认为入库记录 private Integer type;
private Integer materialsId; private Integer materialsId;

View File

@ -156,6 +156,18 @@ public class MtAloneProcess {
@Column(name = "company_id") @Column(name = "company_id")
private Integer companyId; private Integer companyId;
/**
* 工序开始日期
*/
@Column(name = "beg_date")
private Date begDate;
/**
* 工序完成日期
*/
@Column(name = "end_date")
private Date endDate;
/** /**
* @return id * @return id
*/ */
@ -634,4 +646,40 @@ public class MtAloneProcess {
public void setProcessBomName(String processBomName) { public void setProcessBomName(String processBomName) {
this.processBomName = processBomName; this.processBomName = processBomName;
} }
/**
* 获取工序开始日期
*
* @return beg_date - 工序开始日期
*/
public Date getBegDate() {
return begDate;
}
/**
* 设置工序开始日期
*
* @param begDate 工序开始日期
*/
public void setBegDate(Date begDate) {
this.begDate = begDate;
}
/**
* 获取工序完成日期
*
* @return end_date - 工序完成日期
*/
public Date getEndDate() {
return endDate;
}
/**
* 设置工序完成日期
*
* @param endDate 工序完成日期
*/
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
} }

View File

@ -7,8 +7,20 @@ import com.deer.wms.project.seed.core.service.QueryParams;
*/ */
public class MtAloneProcessParams extends QueryParams { public class MtAloneProcessParams extends QueryParams {
private Integer processId;
private Integer productBomId; private Integer productBomId;
private Integer processBomId;
public Integer getProcessId() {
return processId;
}
public void setProcessId(Integer processId) {
this.processId = processId;
}
public Integer getProductBomId() { public Integer getProductBomId() {
return productBomId; return productBomId;
} }
@ -16,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;
}
} }

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

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

View File

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

View File

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

View File

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

View File

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

View File

@ -30,7 +30,7 @@ public class ProcessMaterials {
/** /**
* 版本号 默认为 1.1 * 版本号 默认为 1.1
*/ */
private Integer version; private String version;
/** /**
* 状态 0使用1禁用 * 状态 0使用1禁用
@ -76,11 +76,6 @@ public class ProcessMaterials {
@Column(name = "unit_id") @Column(name = "unit_id")
private Integer unitId; private Integer unitId;
/**
* 单位名称
*/
@Column(name = "unit_name")
private String unitName;
/** /**
* 备注 * 备注
@ -163,7 +158,7 @@ public class ProcessMaterials {
* *
* @return version - 版本号 默认为 1.1 * @return version - 版本号 默认为 1.1
*/ */
public Integer getVersion() { public String getVersion() {
return version; return version;
} }
@ -172,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;
} }
@ -320,24 +315,6 @@ public class ProcessMaterials {
this.unitId = unitId; this.unitId = unitId;
} }
/**
* 获取单位名称
*
* @return unit_name - 单位名称
*/
public String getUnitName() {
return unitName;
}
/**
* 设置单位名称
*
* @param unitName 单位名称
*/
public void setUnitName(String unitName) {
this.unitName = unitName;
}
/** /**
* 获取备注 * 获取备注
* *

View File

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

View File

@ -0,0 +1,18 @@
package com.deer.wms.produce.manage.model;
/**
* @Author: hy
* @Date: 2019/12/21 17:33
* @Version 1.0
*/
public class ProcessMaterialsVo extends ProcessMaterials {
private String unitName0;
public String getUnitName0() {
return unitName0;
}
public void setUnitName0(String unitName0) {
this.unitName0 = unitName0;
}
}

View File

@ -1,9 +0,0 @@
package com.deer.wms.produce.manage.model;
import com.deer.wms.project.seed.core.service.QueryParams;
/**
* Created by hy on 2019/07/19.
*/
public class ProcessParams extends QueryParams {
}

View File

@ -0,0 +1,32 @@
package com.deer.wms.produce.manage.model;
import java.util.ArrayList;
import java.util.List;
/**
* 同时获取批次产品加工信息和工序信息
* @Author: hy
* @Date: 2019/10/30 22:52
* @Version 1.0
*/
public class ProductAndProcess {
private ProductProcess productProcess;//批次生产加工信息
private List<MtAloneProcessVo> processVoList;//工序扩展信息
public ProductProcess getProductProcess() {
return productProcess;
}
public void setProductProcess(ProductProcess productProcess) {
this.productProcess = productProcess;
}
public List<MtAloneProcessVo> getProcessVoList() {
return processVoList;
}
public void setProcessVoList(List<MtAloneProcessVo> processVoList) {
this.processVoList = processVoList;
}
}

View File

@ -133,6 +133,12 @@ public class ProductProcess {
@Column(name = "product_bom_id") @Column(name = "product_bom_id")
private Integer productBomId; 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) { public void setCompanyId(Integer companyId) {
this.companyId = 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/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;
}
}

View File

@ -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;
@ -28,6 +28,9 @@ public class ProductProcessBomParams extends QueryParams {
private String productNum; private String productNum;
private String productProcessName;
/** /**
*添加时间 *添加时间
@ -141,11 +144,19 @@ 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;
} }
public String getProductProcessName() {
return productProcessName;
}
public void setProductProcessName(String productProcessName) {
this.productProcessName = productProcessName;
}
} }

View File

@ -0,0 +1,31 @@
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 ProductProcessBom productProcessBom;//产品bom
private List<ProcessBom> processBomList;//产品bom下的工序bom
public ProductProcessBom getProductProcessBom() {
return productProcessBom;
}
public void setProductProcessBom(ProductProcessBom productProcessBom) {
this.productProcessBom = productProcessBom;
}
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,21 +0,0 @@
package com.deer.wms.produce.manage.model;
import java.util.ArrayList;
/**
* 从前端同时获取批次产品加工信息和工序信息
* @Author: hy
* @Date: 2019/10/30 22:52
* @Version 1.0
*/
public class ProductProcessHaveProcess extends ProductProcess {
private static MtAloneProcess[] processes;
public static MtAloneProcess[] getProcesses() {
return processes;
}
public void setProcesses(MtAloneProcess[] processes) {
this.processes = processes;
}
}

View File

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

View File

@ -1,10 +1,31 @@
package com.deer.wms.produce.manage.model; package com.deer.wms.produce.manage.model;
import com.deer.wms.project.seed.core.service.QueryParams; import com.deer.wms.project.seed.core.service.QueryParams;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
/** /**
* Created by guo on 2019/09/24. * Created by guo on 2019/09/24.
*/ */
public class ProductProcessParams extends QueryParams { public class ProductProcessParams extends QueryParams {
private Integer productProcessId;
private String createDate;
public Integer getProductProcessId() {
return productProcessId;
}
public void setProductProcessId(Integer productProcessId) {
this.productProcessId = productProcessId;
}
public String getCreateDate() {
return createDate;
}
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
} }

View File

@ -17,7 +17,6 @@ public class ProductProcessVo extends ProductProcess {
private String productProcessName;//产品Bom名称 private String productProcessName;//产品Bom名称
public String getProductName() { public String getProductName() {
return productName; return productName;
} }
@ -42,12 +41,10 @@ public class ProductProcessVo extends ProductProcess {
this.schedule = schedule; this.schedule = schedule;
} }
public String getProductProcessName() { public String getProductProcessName() {
return productProcessName; return productProcessName;
} }
public void setProductProcessName(String productProcessName) { public void setProductProcessName(String productProcessName) {
this.productProcessName = productProcessName; this.productProcessName = productProcessName;
} }

View File

@ -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.MaterialsInfo; import com.deer.wms.produce.manage.model.MaterialsInfo;
import com.deer.wms.produce.manage.model.MaterialsInfoDto; import com.deer.wms.produce.manage.model.MaterialsInfoDto;
import com.deer.wms.produce.manage.model.MaterialsInfoParams; import com.deer.wms.produce.manage.model.MaterialsInfoParams;
@ -20,4 +21,5 @@ public interface MaterialsInfoService extends Service<MaterialsInfo, Integer> {
List<MaterialsInfoVO> findMaterialsByKeyWords(MaterialsInfoParams params); List<MaterialsInfoVO> findMaterialsByKeyWords(MaterialsInfoParams params);
void deleteRelevantById(Integer materialsId, CurrentUser currentUser);
} }

View File

@ -8,6 +8,7 @@ import com.deer.wms.produce.manage.model.MaterialsOutgoingLogVo;
import com.deer.wms.project.seed.core.service.Service; import com.deer.wms.project.seed.core.service.Service;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -18,5 +19,7 @@ public interface MaterialsOutgoingLogService extends Service<MaterialsOutgoingLo
List<MaterialsOutgoingLogVo> findListByOneMaterial(MaterialsOutgoingLogParams params) ; List<MaterialsOutgoingLogVo> findListByOneMaterial(MaterialsOutgoingLogParams params) ;
void save(MaterialsOutgoingLogDto materialsOutgoingLogDto, CurrentUser currentUser); void save(MaterialsOutgoingLog materialsOutgoingLog, CurrentUser currentUser);
void deleteByOutgoingIds(HashMap outgoingParam);
} }

View File

@ -1,8 +1,7 @@
package com.deer.wms.produce.manage.service; package com.deer.wms.produce.manage.service;
import com.deer.wms.produce.manage.model.MtAloneProcess; import com.deer.wms.intercept.common.data.CurrentUser;
import com.deer.wms.produce.manage.model.MtAloneProcessParams; import com.deer.wms.produce.manage.model.*;
import com.deer.wms.produce.manage.model.ProcessBomParams;
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;
@ -13,7 +12,11 @@ import java.util.List;
public interface MtAloneProcessService extends Service<MtAloneProcess, Integer> { public interface MtAloneProcessService extends Service<MtAloneProcess, Integer> {
List<MtAloneProcess> findProcessListByProductBom(ProcessBomParams params); List<MtAloneProcess> findProcessListByProductBom(ProcessBomParams params);
List<MtAloneProcessVo> findProcessVoListByProductProcess(ProductProcessParams params);
//List<MtAloneProcess> findList(MtAloneProcessParams params) ; ProcessHo queryProcessDetail(MtAloneProcessParams params);
void saveProcAndProcMat(ProcessAndProcMat processAndProcMat, CurrentUser currentUser);
void updateProcess(ProcessHo processHo);
} }

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.ProcessBom;
import com.deer.wms.produce.manage.model.ProcessBomDto; import com.deer.wms.produce.manage.model.ProcessBomDto;
import com.deer.wms.produce.manage.model.ProcessBomParams; 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 com.deer.wms.project.seed.core.service.Service;
import java.util.List; import java.util.List;
@ -21,4 +22,5 @@ public interface ProcessBomService extends Service<ProcessBom, Integer> {
List<ProcessBomDto> findListByProductNameId(ProcessBomParams params); List<ProcessBomDto> findListByProductNameId(ProcessBomParams params);
ProductProcessBomPo findProductAndProcessBomByProdBom(ProcessBomParams params);
} }

View File

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

View File

@ -1,7 +1,9 @@
package com.deer.wms.produce.manage.service; package com.deer.wms.produce.manage.service;
import com.deer.wms.produce.manage.model.MtAloneProcessParams;
import com.deer.wms.produce.manage.model.ProcessMaterials; import com.deer.wms.produce.manage.model.ProcessMaterials;
import com.deer.wms.produce.manage.model.ProcessMaterialsParams; import com.deer.wms.produce.manage.model.ProcessMaterialsParams;
import com.deer.wms.produce.manage.model.ProcessMaterialsVo;
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;
@ -10,8 +12,6 @@ import java.util.List;
* Created by hy on 2019/07/19. * Created by hy on 2019/07/19.
*/ */
public interface ProcessMaterialsService extends Service<ProcessMaterials, Integer> { public interface ProcessMaterialsService extends Service<ProcessMaterials, Integer> {
List<ProcessMaterialsVo> findProcMatVoListByProcess(MtAloneProcessParams params);
//List<ProcessMaterials> findList(ProcessMaterialsParams params) ;
} }

View File

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

View File

@ -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.ProductProcess; import com.deer.wms.produce.manage.model.*;
import com.deer.wms.produce.manage.model.ProductProcessHaveProcess;
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;
@ -17,5 +14,13 @@ public interface ProductProcessService extends Service<ProductProcess, Integer>
void save(ProductProcess productProcess, CurrentUser currentUser); void save(ProductProcess productProcess, CurrentUser currentUser);
void addAndUpdateProProcAndProc(ProductProcessHaveProcess productProcessHaveProcess, CurrentUser currentUser); void saveProdAndProc(ProductAndProcess productAndProcess, CurrentUser currentUser);
ProductProcessHo queryProductProcessDetail(ProductProcessParams params);
ProductProcessHo initialProdProcByProdProcBom(ProductProcessBomParams params);
void addProduceProcess(ProductProcessHo productProcessHo, CurrentUser currentUser);
} }

View File

@ -1,16 +1,19 @@
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.MaterialsInfoMapper; import com.deer.wms.produce.manage.dao.MaterialsInfoMapper;
import com.deer.wms.produce.manage.model.MaterialsInfo; import com.deer.wms.produce.manage.model.*;
import com.deer.wms.produce.manage.model.MaterialsInfoDto;
import com.deer.wms.produce.manage.model.MaterialsInfoParams;
import com.deer.wms.produce.manage.model.MaterialsInfoVO;
import com.deer.wms.produce.manage.service.MaterialsInfoService; import com.deer.wms.produce.manage.service.MaterialsInfoService;
import com.deer.wms.produce.manage.service.MaterialsOutgoingLogService;
import com.deer.wms.produce.manage.service.MaterialsStockInfoService;
import com.deer.wms.project.seed.core.service.AbstractService; import com.deer.wms.project.seed.core.service.AbstractService;
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;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -23,6 +26,11 @@ public class MaterialsInfoServiceImpl extends AbstractService<MaterialsInfo, Int
@Autowired @Autowired
private MaterialsInfoMapper materialsInfoMapper; private MaterialsInfoMapper materialsInfoMapper;
@Autowired
private MaterialsStockInfoService materialsStockInfoService;
@Autowired
private MaterialsOutgoingLogService materialsOutgoingLogService;
@Override @Override
public List<MaterialsInfoDto> findList(MaterialsInfoParams params) { public List<MaterialsInfoDto> findList(MaterialsInfoParams params) {
@ -44,5 +52,32 @@ public class MaterialsInfoServiceImpl extends AbstractService<MaterialsInfo, Int
return materialsInfoMapper.findMaterialsByKeyWords(params); return materialsInfoMapper.findMaterialsByKeyWords(params);
} }
@Override
public void deleteRelevantById(Integer materialsId, CurrentUser currentUser) {
materialsInfoMapper.deleteByPrimaryKey(materialsId);
MaterialsStockInfo stock = materialsStockInfoService.findBy("materialsId", materialsId);
if(null!=stock)
materialsStockInfoService.deleteById(stock.getId());
MaterialsOutgoingLogParams params = new MaterialsOutgoingLogParams();
params.setMaterialsId(materialsId);
params.setCompanyId(currentUser.getCompanyId());
List<MaterialsOutgoingLogVo> materialsOutgoingLogList = materialsOutgoingLogService.findListByOneMaterial(params);
if((null!=materialsOutgoingLogList) && (materialsOutgoingLogList.size()!=0)){
List<Integer> ids = new ArrayList<Integer>();
for (MaterialsOutgoingLogVo materialsOutgoingLogVo : materialsOutgoingLogList){
ids.add(materialsOutgoingLogVo.getId());
}
if((null!=ids) && (ids.size()!=0)) {
HashMap outgoingParam = new HashMap();
outgoingParam.put("companyId", currentUser.getCompanyId());
outgoingParam.put("ids", ids);
materialsOutgoingLogService.deleteByOutgoingIds(outgoingParam);
}
}
}
} }

View File

@ -6,12 +6,14 @@ import com.deer.wms.produce.manage.dao.MaterialsOutgoingLogMapper;
import com.deer.wms.produce.manage.dao.MaterialsStockInfoMapper; import com.deer.wms.produce.manage.dao.MaterialsStockInfoMapper;
import com.deer.wms.produce.manage.model.*; import com.deer.wms.produce.manage.model.*;
import com.deer.wms.produce.manage.service.MaterialsOutgoingLogService; import com.deer.wms.produce.manage.service.MaterialsOutgoingLogService;
import com.deer.wms.produce.manage.service.MaterialsStockInfoService;
import com.deer.wms.project.seed.core.service.AbstractService; import com.deer.wms.project.seed.core.service.AbstractService;
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;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -25,7 +27,7 @@ public class MaterialsOutgoingLogServiceImpl extends AbstractService<MaterialsOu
private MaterialsOutgoingLogMapper materialsOutgoingLogMapper; private MaterialsOutgoingLogMapper materialsOutgoingLogMapper;
@Autowired @Autowired
private MaterialsStockInfoMapper materialsStockInfoMapper; private MaterialsStockInfoService materialsStockInfoService;
@Override @Override
@ -34,49 +36,42 @@ public class MaterialsOutgoingLogServiceImpl extends AbstractService<MaterialsOu
} }
@Override @Override
public void save(MaterialsOutgoingLogDto materialsOutgoingLogDto, CurrentUser currentUser) { public void save(MaterialsOutgoingLog materialsOutgoingLog, CurrentUser currentUser) {
Date date = new Date(); Date date = new Date();
MaterialsOutgoingLog materialsOutgoingLog = new MaterialsOutgoingLog();
materialsOutgoingLog.setOperatorId(currentUser.getUserId()); materialsOutgoingLog.setOperatorId(currentUser.getUserId());
materialsOutgoingLog.setCreateTime(date); materialsOutgoingLog.setCreateTime(date);
materialsOutgoingLog.setMaterialsId(materialsOutgoingLogDto.getMaterialsId()); materialsOutgoingLog.setVersion("1.1");
materialsOutgoingLog.setMaterialsName(materialsOutgoingLogDto.getMaterialsName()); materialsOutgoingLog.setStatus(ProduceManageConstant.STATUS_AVAILABLE);
materialsOutgoingLog.setType(materialsOutgoingLogDto.getType());
materialsOutgoingLog.setQuantity(materialsOutgoingLogDto.getQuantity());
materialsOutgoingLog.setPositionName(materialsOutgoingLogDto.getPositionName());
materialsOutgoingLog.setCompanyId(currentUser.getCompanyId()); materialsOutgoingLog.setCompanyId(currentUser.getCompanyId());
materialsOutgoingLogMapper.insert(materialsOutgoingLog); materialsOutgoingLogMapper.insert(materialsOutgoingLog);
/**使用物料id非stock主键查询的写法**/ MaterialsStockInfo stock = materialsStockInfoService.findBy("materialsId", materialsOutgoingLog.getMaterialsId());
MaterialsStockInfo tempStock = new MaterialsStockInfo();
tempStock.setMaterialsId(materialsOutgoingLogDto.getMaterialsId());
MaterialsStockInfo stock = materialsStockInfoMapper.selectOne(tempStock);
if(stock==null){//如果是新的物料库存表中没有该物料信息则新增一条库存记录 if(stock==null){//如果是新的物料库存表中没有该物料信息则新增一条库存记录
stock = new MaterialsStockInfo(); stock = new MaterialsStockInfo();
stock.setOperatorId(currentUser.getUserId()); stock.setOperatorId(currentUser.getUserId());
stock.setMaterialsId(materialsOutgoingLogDto.getMaterialsId());
stock.setUnitId(materialsOutgoingLogDto.getUnitId());
stock.setCreateTime(date); stock.setCreateTime(date);
stock.setVersion("1.1");
stock.setMaterialsId(materialsOutgoingLog.getMaterialsId());
stock.setUnitId(materialsOutgoingLog.getUnitId());
if(materialsOutgoingLog.getType() == ProduceManageConstant.TYPE_OUT) { if(materialsOutgoingLog.getType() == ProduceManageConstant.TYPE_OUT) {
stock.setQuantity(0-materialsOutgoingLogDto.getQuantity());//新建物料的出库仓储数量为负数 stock.setQuantity(0-materialsOutgoingLog.getQuantity());//新建物料的出库仓储数量为负数
}else if(materialsOutgoingLog.getType() == ProduceManageConstant.TYPE_IN) { }else if(materialsOutgoingLog.getType() == ProduceManageConstant.TYPE_IN) {
stock.setQuantity(materialsOutgoingLogDto.getQuantity());//新建物料的入库仓储数量为正数 stock.setQuantity(materialsOutgoingLog.getQuantity());//新建物料的入库仓储数量为正数
} }
stock.setPositionName(materialsOutgoingLogDto.getPositionName()); stock.setPositionName(materialsOutgoingLog.getPositionName());
stock.setCompanyId(currentUser.getCompanyId()); stock.setCompanyId(currentUser.getCompanyId());
materialsStockInfoMapper.insert(stock); materialsStockInfoService.save(stock);
}else{//如果库存表中有该物料信息则更新对应的库存记录 }else{//如果库存表中有该物料信息则更新对应的库存记录
stock.setCreateTime(date);//日期取最新更新的日期
MaterialsInfoParams params = new MaterialsInfoParams();//查询条件赋值 MaterialsInfoParams params = new MaterialsInfoParams();//查询条件赋值
params.setMaterialsId(materialsOutgoingLogDto.getMaterialsId()); params.setMaterialsId(materialsOutgoingLog.getMaterialsId());
params.setCompanyId(currentUser.getCompanyId()); params.setCompanyId(currentUser.getCompanyId());
//设置库存数量已有库存数量+入库数量或已有库存数量-出库数量 //设置库存数量已有库存数量+入库数量或已有库存数量-出库数量
Float totalQuantity = materialsStockInfoMapper.getStockQuantityByMaId(params); Float totalQuantity = materialsStockInfoService.getStockQuantityByMaId(params);
if(materialsOutgoingLog.getType() == ProduceManageConstant.TYPE_OUT) { if(materialsOutgoingLog.getType() == ProduceManageConstant.TYPE_OUT) {
totalQuantity -= materialsOutgoingLog.getQuantity(); totalQuantity -= materialsOutgoingLog.getQuantity();
}else if(materialsOutgoingLog.getType() == ProduceManageConstant.TYPE_IN) { }else if(materialsOutgoingLog.getType() == ProduceManageConstant.TYPE_IN) {
@ -86,14 +81,19 @@ public class MaterialsOutgoingLogServiceImpl extends AbstractService<MaterialsOu
//设置库存位置已有库存仓库,出入库记录对应仓库 //设置库存位置已有库存仓库,出入库记录对应仓库
String inAndOutLogPosition = materialsOutgoingLog.getPositionName(); String inAndOutLogPosition = materialsOutgoingLog.getPositionName();
String stockPosition = materialsStockInfoMapper.getStockPositionByMaId(params); String stockPosition = materialsStockInfoService.getStockPositionByMaId(params);
if(stockPosition!=null && !stockPosition.trim().equals("")) { if((null!=stockPosition) && (!stockPosition.trim().equals(""))) {
stock.setPositionName(stockPosition + "," +inAndOutLogPosition); stock.setPositionName(stockPosition + "," +inAndOutLogPosition);
}else{ }else{
stock.setPositionName(inAndOutLogPosition); stock.setPositionName(inAndOutLogPosition);
} }
materialsStockInfoMapper.updateByPrimaryKey(stock); materialsStockInfoService.update(stock);
} }
} }
@Override
public void deleteByOutgoingIds(HashMap outgoingParam) {
materialsOutgoingLogMapper.deleteByOutgoingIds(outgoingParam);
}
} }

View File

@ -1,18 +1,20 @@
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.MtAloneProcess; import com.deer.wms.produce.manage.model.*;
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.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.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;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -28,6 +30,12 @@ public class MtAloneProcessServiceImpl extends AbstractService<MtAloneProcess, I
@Autowired @Autowired
private ProcessBomService processBomService; private ProcessBomService processBomService;
@Autowired
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
@ -38,12 +46,7 @@ public class MtAloneProcessServiceImpl extends AbstractService<MtAloneProcess, I
//循环工序bom给工序初步赋值先不保存 //循环工序bom给工序初步赋值先不保存
for (ProcessBom processBom : processBomList) { for (ProcessBom processBom : processBomList) {
MtAloneProcess process = new MtAloneProcess(); MtAloneProcess process = new MtAloneProcess();
process.setProcessName(processBom.getProcessName()); BeanUtils.copyProperties(processBom, process);
process.setProcessContent(processBom.getProcessContent());
process.setProcessStep(processBom.getProcessStep());
process.setProcessBomId(processBom.getId());
process.setProcessBomName(processBom.getProcessName());
process.setSpecification(processBom.getSpecification());
processList.add(process); processList.add(process);
} }
} }
@ -51,9 +54,72 @@ public class MtAloneProcessServiceImpl extends AbstractService<MtAloneProcess, I
return processList; return processList;
} }
@Override
public List<MtAloneProcessVo> findProcessVoListByProductProcess(ProductProcessParams params) {
return mtAloneProcessMapper.findProcessVoListByProductProcess(params);
}
//@Override @Override
//public List<MtAloneProcess> findList(MtAloneProcessParams params) { public ProcessHo queryProcessDetail(MtAloneProcessParams params) {
// return mtAloneProcessMapper.findList(params); //根据工序id查询工序详细信息
MtAloneProcessVo processVo = (MtAloneProcessVo) mtAloneProcessMapper.selectProcessVoByProcessId(params);
//根据工序id查询物料信息
List<ProcessMaterialsVo> procMatVoList = processMaterialsService.findProcMatVoListByProcess(params);
ProcessHo processHo = new ProcessHo();
if(null != processVo){
System.out.println("----------"+processVo.getId());
System.out.println("----------"+processVo.getProcessName());
BeanUtils.copyProperties(processVo, processHo);
processHo.setProcessMaterialsVoList(procMatVoList);
}
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);
//通过工序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);
//if(null != processHo.getProcessMaterialsVoList()) {
// List<ProcessMaterialsVo> procMatVoList = processHo.getProcessMaterialsVoList();
// 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);
}
}
}
} }

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.model.*;
import com.deer.wms.produce.manage.service.ProcessBomService; 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 com.deer.wms.project.seed.core.service.AbstractService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -23,6 +24,9 @@ public class ProcessBomServiceImpl extends AbstractService<ProcessBom, Integer>
@Autowired @Autowired
private ProcessBomMapper processBomMapper; private ProcessBomMapper processBomMapper;
@Autowired
private ProductProcessBomService productProcessBomService;
@Override @Override
public List<ProcessBom> findList(ProcessBomParams params) { public List<ProcessBom> findList(ProcessBomParams params) {
@ -62,4 +66,16 @@ public class ProcessBomServiceImpl extends AbstractService<ProcessBom, Integer>
public List<ProcessBomDto> findListByProductNameId(ProcessBomParams params) { public List<ProcessBomDto> findListByProductNameId(ProcessBomParams params) {
return processBomMapper.findListByProductNameId(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.setProductProcessBom(productProcessBom);
productProcessBomPo.setProcessBomList(processBomList);
return productProcessBomPo;
}
} }

View File

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

View File

@ -1,8 +1,10 @@
package com.deer.wms.produce.manage.service.impl; package com.deer.wms.produce.manage.service.impl;
import com.deer.wms.produce.manage.dao.ProcessMaterialsMapper; import com.deer.wms.produce.manage.dao.ProcessMaterialsMapper;
import com.deer.wms.produce.manage.model.MtAloneProcessParams;
import com.deer.wms.produce.manage.model.ProcessMaterials; import com.deer.wms.produce.manage.model.ProcessMaterials;
import com.deer.wms.produce.manage.model.ProcessMaterialsParams; import com.deer.wms.produce.manage.model.ProcessMaterialsParams;
import com.deer.wms.produce.manage.model.ProcessMaterialsVo;
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.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -21,6 +23,11 @@ public class ProcessMaterialsServiceImpl extends AbstractService<ProcessMaterial
@Autowired @Autowired
private ProcessMaterialsMapper processMaterialsMapper; private ProcessMaterialsMapper processMaterialsMapper;
@Override
public List<ProcessMaterialsVo> findProcMatVoListByProcess(MtAloneProcessParams params) {
return processMaterialsMapper.findProcMatVoListByProcess(params);
}
//@Override //@Override
//public List<ProcessMaterials> findList(ProcessMaterialsParams params) { //public List<ProcessMaterials> findList(ProcessMaterialsParams params) {

View File

@ -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) {
@ -61,6 +66,7 @@ public class ProductProcessBomServiceImpl extends AbstractService<ProductProcess
productProcessBom.setSpecification(params.getSpecification()); productProcessBom.setSpecification(params.getSpecification());
productProcessBom.setProductId(params.getProductId()); productProcessBom.setProductId(params.getProductId());
productProcessBom.setProcessContent(params.getProcessContent()); productProcessBom.setProcessContent(params.getProcessContent());
productProcessBom.setProductProcessName(params.getProductProcessName());
productProcessBomMapper.insert(productProcessBom); productProcessBomMapper.insert(productProcessBom);
for (ProcessBomParams processBomParams:params.getProcessBomParamsList()) { for (ProcessBomParams processBomParams:params.getProcessBomParamsList()) {
ProcessBom processBom = new ProcessBom(); ProcessBom processBom = new ProcessBom();
@ -107,7 +113,7 @@ public class ProductProcessBomServiceImpl extends AbstractService<ProductProcess
for (ProcessBomParams processBomParams:params.getProcessBomParamsList()) { for (ProcessBomParams processBomParams:params.getProcessBomParamsList()) {
ProcessBom processBom = new ProcessBom(); ProcessBom processBom = new ProcessBom();
processBom.setId(processBomParams.getId()); processBom.setId(processBomParams.getId());
processBom.setCreateTime(processBomParams.getCreateTime()); processBom.setUpdateTime(new Date());
processBom.setProcessName(processBomParams.getProcessName()); processBom.setProcessName(processBomParams.getProcessName());
processBom.setProductProcessId(processBomParams.getProductProcessId()); processBom.setProductProcessId(processBomParams.getProductProcessId());
processBom.setSpecification(processBomParams.getSpecification()); processBom.setSpecification(processBomParams.getSpecification());
@ -123,7 +129,7 @@ public class ProductProcessBomServiceImpl extends AbstractService<ProductProcess
for (ProcessMaterialsBomParams processMaterialsBomParams:params.getProcessBomParamsList().get(i).getProcessMaterialsBomParamsList()){ for (ProcessMaterialsBomParams processMaterialsBomParams:params.getProcessBomParamsList().get(i).getProcessMaterialsBomParamsList()){
ProcessMaterialsBom processMaterialsBom = new ProcessMaterialsBom(); ProcessMaterialsBom processMaterialsBom = new ProcessMaterialsBom();
processMaterialsBom.setId(processMaterialsBomParams.getId()); processMaterialsBom.setId(processMaterialsBomParams.getId());
processMaterialsBom.setCreateTime(new Date()); processMaterialsBom.setUpdateTime(new Date());
processMaterialsBom.setProcessBomId(processMaterialsBomParams.getProcessBomId()); processMaterialsBom.setProcessBomId(processMaterialsBomParams.getProcessBomId());
processMaterialsBom.setMaterialsId(processMaterialsBomParams.getMaterialsId()); processMaterialsBom.setMaterialsId(processMaterialsBomParams.getMaterialsId());
processMaterialsBom.setCode(processMaterialsBomParams.getCode()); processMaterialsBom.setCode(processMaterialsBomParams.getCode());
@ -134,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);
}
} }

View File

@ -5,19 +5,16 @@ 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.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;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
/** /**
* Created by hy on 2019/07/19. * Created by hy on 2019/07/19.
@ -29,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,48 +67,178 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
} }
@Override @Override
public void addAndUpdateProProcAndProc(ProductProcessHaveProcess productProcessHaveProcess, CurrentUser currentUser) { public void saveProdAndProc(ProductAndProcess productAndProcess, CurrentUser currentUser) {
//首先保存批次产品加工信息 //保存批次产品加工信息
ProductProcess productProcess = new ProductProcess(); ProductProcess productProcess = productAndProcess.getProductProcess();
Date date = new Date(); Date date = new Date();
productProcess.setOperatorId(1); productProcess.setOperatorId(currentUser.getUserId());
productProcess.setCreateTime(date); productProcess.setCreateTime(date);
productProcess.setUpdateTime(date); productProcess.setUpdateTime(date);
productProcess.setVersion("1.1"); productProcess.setVersion("1.1");
productProcess.setStatus(ProduceManageConstant.STATUS_AVAILABLE); productProcess.setStatus(ProduceManageConstant.STATUS_AVAILABLE);
productProcess.setSalesNumber(productProcessHaveProcess.getSalesNumber());
productProcess.setWorkOrderCode(ProduceManagePublicMethod.creatUniqueCode("PCJGD")); productProcess.setWorkOrderCode(ProduceManagePublicMethod.creatUniqueCode("PCJGD"));
productProcess.setWorkOrderName(productProcessHaveProcess.getWorkOrderName()); productProcess.setShrinkage((productProcess.getDetectionLen()/productProcess.getLen())*100+"%");
productProcess.setDeliveryCode(productProcessHaveProcess.getDeliveryCode());
productProcess.setPlanBeginTime(productProcessHaveProcess.getPlanBeginTime());
productProcess.setPlanFinishTime(productProcessHaveProcess.getPlanFinishTime());
productProcess.setClientId(productProcessHaveProcess.getClientId());
productProcess.setClientName(productProcessHaveProcess.getClientName());
productProcess.setContractCode(productProcessHaveProcess.getContractCode());
productProcess.setContractName(productProcessHaveProcess.getContractName());
productProcess.setProductProcessCode(productProcessHaveProcess.getProductProcessCode());
productProcess.setProductProcessName0(productProcessHaveProcess.getProductProcessName0());
productProcess.setSpecification(productProcessHaveProcess.getSpecification());
productProcess.setProcessPrice(productProcessHaveProcess.getProcessPrice());
productProcess.setLen(productProcessHaveProcess.getLen());
productProcess.setBatchCode(productProcessHaveProcess.getBatchCode());
productProcess.setBatchOrderCode(productProcessHaveProcess.getBatchOrderCode());
productProcess.setShrinkage((productProcessHaveProcess.getDetectionLen()/productProcessHaveProcess.getLen())*100+"%");
productProcess.setPiNum(productProcessHaveProcess.getPiNum());
productProcess.setProcessContent(productProcessHaveProcess.getProcessContent());
productProcess.setMerchandiserId(productProcessHaveProcess.getMerchandiserId());
productProcess.setMerchandiserName(productProcessHaveProcess.getMerchandiserName());
productProcess.setMemo(productProcessHaveProcess.getMemo());
productProcess.setReviewStatus(ProduceManageConstant.REVIEW_STATUS_FORREVIEW); productProcess.setReviewStatus(ProduceManageConstant.REVIEW_STATUS_FORREVIEW);
productProcess.setProductAnnexCode(productProcessHaveProcess.getProductAnnexCode()); productProcess.setCompanyId(currentUser.getCompanyId());
productProcess.setCompanyId(1);
productProcessMapper.insert(productProcess); productProcessMapper.insert(productProcess);
//其次保存由前端获取的工序信息 //保存由前端获取的工序信息
MtAloneProcess[] processes = ProductProcessHaveProcess.getProcesses(); List<MtAloneProcessVo> processVoList = productAndProcess.getProcessVoList();
for (int i = 0; i < processes.length; i++) { if(null != processVoList) {
processService.save(processes[i]); List<MtAloneProcess> processList = new ArrayList<MtAloneProcess>(processVoList.size());
for (MtAloneProcess processVo : processVoList) {
MtAloneProcess process = new MtAloneProcess();
BeanUtils.copyProperties(processVo, process);
process.setProductProcessId(productProcess.getId());
processList.add(process);
}
processService.save(processList);
} }
} }
@Override
public ProductProcessHo queryProductProcessDetail(ProductProcessParams params) {
//根据批次生产加工id查询批次产品加工单信息
ProductProcess productProcess = productProcessMapper.selectByPrimaryKey(params.getProductProcessId());
//根据批次产品加工id查询工序信息
List<MtAloneProcessVo> tempProcessVoList = processService.findProcessVoListByProductProcess(params);
ProductProcessHo productProcessHo = new ProductProcessHo();
if(null != productProcess) {
BeanUtils.copyProperties(productProcess, productProcessHo);
if (null != tempProcessVoList) {
List<ProcessHo> processHoList = new ArrayList<ProcessHo>(tempProcessVoList.size());
for (MtAloneProcessVo processVo : tempProcessVoList) {
ProcessHo processHo = new ProcessHo();
BeanUtils.copyProperties(processVo, processHo);
processHoList.add(processHo);
}
productProcessHo.setProcessHoList(processHoList);
}
}
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) && (0!=processHoList.size())) {
processList = new ArrayList<MtAloneProcess>(processHoList.size());
processMaterialsList = new ArrayList<ProcessMaterials>();
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);
List<ProcessMaterialsVo> processMaterialsVoList = processHo.getProcessMaterialsVoList();
if((null!=processMaterialsVoList) && (0!=processMaterialsVoList.size())){
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);
}
}
}
processService.save(processList);
if (0 != processMaterialsList.size())
processMaterialsService.save(processMaterialsList);
}
}
} }

View File

@ -42,14 +42,8 @@ public class MaterialsInfoController {
@Autowired @Autowired
private MaterialsInfoService materialsInfoService; private MaterialsInfoService materialsInfoService;
@Autowired
private MaterialsStockInfoService materialsStockInfoService;
@Autowired
private MaterialsOutgoingLogService materialsOutgoingLogService;
/** /**
* hy * hy正在用
* 新增物料信息 * 新增物料信息
* @param materialsInfo * @param materialsInfo
* @param currentUser * @param currentUser
@ -74,24 +68,39 @@ public class MaterialsInfoController {
materialsInfo.setCompanyId(currentUser.getCompanyId()); materialsInfo.setCompanyId(currentUser.getCompanyId());
materialsInfo.setCode(ProduceManagePublicMethod.creatUniqueCode("WL")); materialsInfo.setCode(ProduceManagePublicMethod.creatUniqueCode("WL"));
materialsInfoService.save(materialsInfo); materialsInfoService.save(materialsInfo);
return ResultGenerator.genSuccessResult(); return ResultGenerator.genSuccessResult();
} }
/**
* hy正在用
* 删除物料顺带删除相应的库存信息出入库记录
* @param materialsId
* @return
*/
@ApiImplicitParams({
@ApiImplicitParam(name = "materialsId", value = "物料id", paramType = "query", dataType = "int", required = true)
})
@OperateLog(description = "删除物料", type = "删除") @OperateLog(description = "删除物料", type = "删除")
@ApiOperation(value = "删除物料", notes = "删除物料") @ApiOperation(value = "删除物料", notes = "删除物料")
@DeleteMapping("/delete/{materialsId}") @DeleteMapping("/delete")
public Result delete(@PathVariable Integer materialsId) { public Result delete(Integer materialsId, @ApiIgnore @User CurrentUser currentUser) {
//删除物料顺带删除相应的库存信息 if(currentUser==null){
MaterialsInfo materialsInfo = materialsInfoService.findById(materialsId); return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
materialsInfoService.deleteById(materialsId); }
MaterialsStockInfo stock = materialsStockInfoService.findBy("materialsId",
materialsInfo.getId());
materialsStockInfoService.deleteById(stock.getId());
materialsInfoService.deleteRelevantById(materialsId, currentUser);
return ResultGenerator.genSuccessResult(); return ResultGenerator.genSuccessResult();
} }
/**
* hy正在用
* 物料更新
* @param materialsInfo
* @return
*/
@ApiImplicitParams({
@ApiImplicitParam(name = "materialsInfo", value = "物料", paramType = "body", dataType = "MaterialsInfo", required = true)
})
@OperateLog(description = "修改物料", type = "更新") @OperateLog(description = "修改物料", type = "更新")
@ApiOperation(value = "修改物料", notes = "修改物料") @ApiOperation(value = "修改物料", notes = "修改物料")
@PostMapping("/update") @PostMapping("/update")
@ -101,8 +110,8 @@ public class MaterialsInfoController {
} }
/** /**
* hy * hy正在用
* 获取某物料详细信息 * 获取某物料详细信息
* @param params * @param params
* @param currentUser * @param currentUser
* @return * @return
@ -126,7 +135,7 @@ public class MaterialsInfoController {
} }
/** /**
* hy * hy正在用
* 物料信息分页列表查询 * 物料信息分页列表查询
* @param params * @param params
* @param currentUser * @param currentUser
@ -135,8 +144,8 @@ public class MaterialsInfoController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false), @ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false),
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String", required = false), @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String", required = false),
@ApiImplicitParam(name = "begDate", value = "起始日期", paramType = "query", dataType = "Date", required = false), @ApiImplicitParam(name = "begDate", value = "起始日期", paramType = "query", dataType = "String", required = false),
@ApiImplicitParam(name = "endDate", value = "结束日期", paramType = "query", dataType = "Date", required = false) @ApiImplicitParam(name = "endDate", value = "结束日期", paramType = "query", dataType = "String", required = false)
}) })
@OperateLog(description = "物料信息分页查询", type = "查询") @OperateLog(description = "物料信息分页查询", type = "查询")
@ApiOperation(value = "物料信息列表分页", notes = "物料信息列表分页") @ApiOperation(value = "物料信息列表分页", notes = "物料信息列表分页")
@ -198,6 +207,7 @@ public class MaterialsInfoController {
if(currentUser==null){ if(currentUser==null){
return ResultGenerator.genFailResult( CommonCode.SERVICE_ERROR,"未登录错误",null ); return ResultGenerator.genFailResult( CommonCode.SERVICE_ERROR,"未登录错误",null );
} }
System.err.println("pageSize"+params.getPageSize()+"pageNum"+params.getPageNum()+",keyWords"+params.getKeywords());
params.setCompanyId(currentUser.getCompanyId()); params.setCompanyId(currentUser.getCompanyId());
PageHelper.startPage(params.getPageNum(), params.getPageSize()); PageHelper.startPage(params.getPageNum(), params.getPageSize());
List<MaterialsInfoVO> list = new ArrayList<>(); List<MaterialsInfoVO> list = new ArrayList<>();

View File

@ -10,6 +10,7 @@ import com.deer.wms.project.seed.annotation.OperateLog;
import com.deer.wms.project.seed.core.result.CommonCode; import com.deer.wms.project.seed.core.result.CommonCode;
import com.deer.wms.project.seed.core.result.Result; import com.deer.wms.project.seed.core.result.Result;
import com.deer.wms.project.seed.core.result.ResultGenerator; import com.deer.wms.project.seed.core.result.ResultGenerator;
import com.deer.wms.project.seed.util.StringUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -34,31 +35,25 @@ public class MaterialsOutgoingLogController {
@Autowired @Autowired
private MaterialsOutgoingLogService materialsOutgoingLogService; private MaterialsOutgoingLogService materialsOutgoingLogService;
@Autowired
private MaterialsStockInfoService materialsStockInfoService;
//@Autowired
//private MaterialsOutgoingLogDTOService materialsOutgoingLogDTOService;
/** /**
* hy * hy正在用
* 添加一条出入库记录同时更新对应的库存信息 * 出入库操作添加一条出入库记录同时更新对应的库存信息
* @param materialsOutgoingLogDto * @param materialsOutgoingLog
* @param currentUser * @param currentUser
* @return * @return
*/ */
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "materialsOutgoingLogDto", value = "物料出入库", paramType = "body", dataType = "MaterialsOutgoingLogDto", required = true) @ApiImplicitParam(name = "materialsOutgoingLog", value = "物料出入库", paramType = "body", dataType = "MaterialsOutgoingLog", required = true)
}) })
@OperateLog(description = "添加一条出入库记录", type = "增加") @OperateLog(description = "添加一条出入库记录", type = "增加")
@ApiOperation(value = "添加一条出入库记录", notes = "添加一条出入库记录") @ApiOperation(value = "添加一条出入库记录", notes = "添加一条出入库记录")
@PostMapping("/add") @PostMapping("/add")
public Result add(@RequestBody MaterialsOutgoingLogDto materialsOutgoingLogDto, @ApiIgnore @User CurrentUser currentUser) { public Result add(@RequestBody MaterialsOutgoingLog materialsOutgoingLog, @ApiIgnore @User CurrentUser currentUser) {
if(currentUser==null){ if(currentUser==null){
return ResultGenerator.genFailResult( CommonCode.SERVICE_ERROR,"未登录错误",null ); return ResultGenerator.genFailResult( CommonCode.SERVICE_ERROR,"未登录错误",null );
} }
materialsOutgoingLogService.save(materialsOutgoingLogDto, currentUser); materialsOutgoingLogService.save(materialsOutgoingLog, currentUser);
return ResultGenerator.genSuccessResult(); return ResultGenerator.genSuccessResult();
} }
@ -86,7 +81,7 @@ public class MaterialsOutgoingLogController {
} }
/** /**
* hy * hy正在用
* 获取某种物料的所有出入库记录 * 获取某种物料的所有出入库记录
* @param params * @param params
* @param currentUser * @param currentUser

View File

@ -14,6 +14,8 @@ import com.deer.wms.project.seed.core.result.ResultGenerator;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
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.*;
@ -82,6 +84,7 @@ public class MtAloneProcessController {
/** /**
* hy * hy
* 暂时没用
* 用于批次生产加工新建页面下方的工序列表展示,获取工序bom和工序如果没有工序则新建对应的工序并初步赋值 * 用于批次生产加工新建页面下方的工序列表展示,获取工序bom和工序如果没有工序则新建对应的工序并初步赋值
* @param params * @param params
* @param currentUser * @param currentUser
@ -91,15 +94,95 @@ public class MtAloneProcessController {
@ApiOperation(value = "根据产品bom查询工序", notes = "根据产品bom查询工序") @ApiOperation(value = "根据产品bom查询工序", notes = "根据产品bom查询工序")
@GetMapping("/processListByProductBom") @GetMapping("/processListByProductBom")
public Result processListByProductBom(ProcessBomParams params, @ApiIgnore @User CurrentUser currentUser) { public Result processListByProductBom(ProcessBomParams 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()); PageHelper.startPage(params.getPageNum(), params.getPageSize());
List<MtAloneProcess> list = mtAloneProcessService.findProcessListByProductBom(params); List<MtAloneProcess> list = mtAloneProcessService.findProcessListByProductBom(params);
PageInfo pageInfo = new PageInfo(list); PageInfo pageInfo = new PageInfo(list);
return ResultGenerator.genSuccessResult(pageInfo); 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.findProcessVoListByProductProcess(params);
PageInfo pageInfo = new PageInfo(list);
return ResultGenerator.genSuccessResult(pageInfo);
}
/**
* hy正在用
* 点击加工处理页面中工序列表最后一列查看或处理按钮
* 由工序id获取该工序详情及包含的物料信息
* @param params
* @param currentUser
* @return
*/
@ApiOperation(value = "工序详情查询", notes = "工序详情查询")
@ApiImplicitParams({
@ApiImplicitParam(name = "processId", value = "工序id", paramType = "query", dataType = "int", required = true),
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
})
@OperateLog(description = "工序详情查询", type = "查询")
@GetMapping("/query/process/detail")
public Result queryProcessDetail(MtAloneProcessParams params, @ApiIgnore @User CurrentUser currentUser) {
if(currentUser==null){
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
}
params.setCompanyId(currentUser.getCompanyId());
ProcessHo processHo = mtAloneProcessService.queryProcessDetail(params);
return ResultGenerator.genSuccessResult(processHo);
}
/**
* 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();
}
} }

View File

@ -128,8 +128,8 @@ public class ProcessBomController {
/** /**
* hy * hy
* * 根据选择的产品名称来展示产品其他数据和工序数据,
* 根据选择的产品名称来展示产品其他数据和工序数据 * 用于新建生产加工产品bom下拉框选择
* @param params * @param params
* @param currentUser * @param currentUser
* @return * @return
@ -144,13 +144,37 @@ public class ProcessBomController {
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()); PageHelper.startPage(params.getPageNum(), params.getPageSize());
List<ProcessBomDto> list = processBomService.findListByProductNameId(params); List<ProcessBomDto> list = processBomService.findListByProductNameId(params);
PageInfo pageInfo = new PageInfo(list); PageInfo pageInfo = new PageInfo(list);
return ResultGenerator.genSuccessResult(pageInfo); 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 = "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

@ -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;
@ -85,10 +82,6 @@ public class ProductProcessBomController {
} }
productProcessBomParams.setCreateTime(new Date()); productProcessBomParams.setCreateTime(new Date());
productProcessBomParams.setCompanyId(currentUser.getCompanyId()); productProcessBomParams.setCompanyId(currentUser.getCompanyId());
// productProcessBomParams.setProductId(1);
// productProcessBomParams.setProcessContent("1");
// productProcessBomParams.setSpecification("1");
productProcessBomService.updateProductProcessBom(productProcessBomParams); productProcessBomService.updateProductProcessBom(productProcessBomParams);
return ResultGenerator.genSuccessResult(); return ResultGenerator.genSuccessResult();
} }
@ -164,7 +157,13 @@ public class ProductProcessBomController {
return ResultGenerator.genSuccessResult(pageInfo); return ResultGenerator.genSuccessResult(pageInfo);
} }
/**根据产品bom的id获取产品bom,用于新建批次产品加工的产品bom下拉框填入名称**/ /**
* hy
* 根据产品bom的id获取产品bom,用于新建批次产品加工的产品bom下拉框填入名称
* @param params
* @param currentUser
* @return
*/
@GetMapping("/listById") @GetMapping("/listById")
public Result listByProductId(ProductProcessBomParams params, @ApiIgnore @User CurrentUser currentUser) { public Result listByProductId(ProductProcessBomParams params, @ApiIgnore @User CurrentUser currentUser) {
if(currentUser==null){ if(currentUser==null){
@ -177,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
* *

View File

@ -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.ProductProcess; import com.deer.wms.produce.manage.model.*;
import com.deer.wms.produce.manage.model.ProductProcessHaveProcess;
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;
@ -16,11 +13,15 @@ import com.deer.wms.project.seed.core.result.ResultGenerator;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
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;
@ -39,6 +40,7 @@ public class ProductProcessController {
private ProcessBomService processBomService; private ProcessBomService processBomService;
/** /**
* hy暂时没用
* 生成某种产品某一批次的生产加工单 * 生成某种产品某一批次的生产加工单
* 需要调用对应产品bom * 需要调用对应产品bom
* @param productProcess * @param productProcess
@ -79,8 +81,21 @@ public class ProductProcessController {
return ResultGenerator.genSuccessResult(productProcess); return ResultGenerator.genSuccessResult(productProcess);
} }
@OperateLog(description = "生产计划分页查询", type = "查询") /**
@ApiOperation(value = "生产计划列表分页", notes = "生产计划列表分页") * hy正在用
* 批次生产加工单分页查询
* @param params
* @param currentUser
* @return
*/
@ApiOperation(value = "批次生产加工单分页查询", notes = "批次生产加工单分页查询")
@ApiImplicitParams({
@ApiImplicitParam(name = "createDate", 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)
})
@OperateLog(description = "批次生产加工单分页查询", type = "查询")
@GetMapping("/list") @GetMapping("/list")
public Result list(ProductProcessParams params, @ApiIgnore @User CurrentUser currentUser) { public Result list(ProductProcessParams params, @ApiIgnore @User CurrentUser currentUser) {
if(currentUser==null){ if(currentUser==null){
@ -95,21 +110,118 @@ public class ProductProcessController {
} }
/** /**
*新建批次产品加工完毕时点击提交同时保存产品加工和工序信息 * hy停用
* hy * 新建批次产品加工完毕时点击提交同时保存产品加工和工序信息
* @param productProcessHaveProcess * @param productAndProcess
* @param currentUser * @param currentUser
* @return * @return
*/ */
@OperateLog(description = "批次生产加工及工序保存更新", type = "保存更新") @ApiOperation(value = "批次生产加工及工序保存", notes = "批次生产加工及工序保存")
@ApiOperation(value = "批次生产加工及工序保存更新", notes = "批次生产加工及工序保存更新") @ApiImplicitParams({
@PostMapping("/addAndUpdateProProcAndProc") @ApiImplicitParam(name = "productAndProcess", value = "批次生产加工及工序", paramType = "body", dataType = "ProductAndProcess", required = true)
public Result addAndUpdateProProcAndProc(@RequestBody ProductProcessHaveProcess productProcessHaveProcess, @ApiIgnore @User CurrentUser currentUser) { })
//if(currentUser==null){ @OperateLog(description = "批次生产加工及工序保存", type = "保存")
// return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null ); @PostMapping("/saveProdAndProc")
//} public Result saveProdAndProc(@RequestBody ProductAndProcess productAndProcess, @ApiIgnore @User CurrentUser currentUser) {
if(currentUser==null){
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
}
productProcessService.addAndUpdateProProcAndProc(productProcessHaveProcess, currentUser); 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());
ProductProcessHo productProcessHo = productProcessService.queryProductProcessDetail(params);
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(); return ResultGenerator.genSuccessResult();
} }