Merge branch 'master' of https://git.picaiba.com/mengtong/mt-pms-api into weihongyang
This commit is contained in:
commit
0e1eae73bc
@ -2,6 +2,7 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CompilerConfiguration">
|
<component name="CompilerConfiguration">
|
||||||
<annotationProcessing>
|
<annotationProcessing>
|
||||||
|
<profile default="true" name="Default" enabled="true" />
|
||||||
<profile name="Maven default annotation processors profile" enabled="true">
|
<profile name="Maven default annotation processors profile" enabled="true">
|
||||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||||
|
@ -2,11 +2,14 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="dataSourceStorageLocal">
|
<component name="dataSourceStorageLocal">
|
||||||
<data-source name="mt_erp@47.96.183.77" uuid="b3cb0d92-041d-41fc-ace7-4cc9410e1df1">
|
<data-source name="mt_erp@47.96.183.77" uuid="b3cb0d92-041d-41fc-ace7-4cc9410e1df1">
|
||||||
<database-info product="" version="" jdbc-version="" driver-name="" driver-version="" />
|
<database-info product="" version="" jdbc-version="" driver-name="" driver-version="" dbms="MYSQL" exact-version="0" />
|
||||||
<secret-storage>master_key</secret-storage>
|
<secret-storage>master_key</secret-storage>
|
||||||
<first-sync>true</first-sync>
|
|
||||||
<user-name>root</user-name>
|
<user-name>root</user-name>
|
||||||
<introspection-schemas>*:</introspection-schemas>
|
<schema-mapping>
|
||||||
|
<introspection-scope>
|
||||||
|
<node kind="schema" qname="" />
|
||||||
|
</introspection-scope>
|
||||||
|
</schema-mapping>
|
||||||
</data-source>
|
</data-source>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -3,5 +3,6 @@
|
|||||||
<component name="Encoding">
|
<component name="Encoding">
|
||||||
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/wms-produce-manage" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/wms-produce-manage" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/wms-produce-manage/src/main/java" charset="UTF-8" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
6
pom.xml
6
pom.xml
@ -106,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>
|
||||||
|
@ -76,13 +76,20 @@
|
|||||||
<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" />
|
||||||
<orderEntry type="module-library">
|
<orderEntry type="module-library">
|
||||||
<library name="Maven: com.alibaba:jconsole:1.8.0">
|
<library name="Maven: com.alibaba:jconsole:1.8.0">
|
||||||
<CLASSES>
|
<CLASSES>
|
||||||
<root url="jar://C:/Program Files/Java/jdk1.8.0_171/lib/jconsole.jar!/" />
|
<root url="jar://C:/Program Files/Java/jdk1.8.0_231/lib/jconsole.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
@ -91,7 +98,7 @@
|
|||||||
<orderEntry type="module-library">
|
<orderEntry type="module-library">
|
||||||
<library name="Maven: com.alibaba:tools:1.8.0">
|
<library name="Maven: com.alibaba:tools:1.8.0">
|
||||||
<CLASSES>
|
<CLASSES>
|
||||||
<root url="jar://C:/Program Files/Java/jdk1.8.0_171/lib/tools.jar!/" />
|
<root url="jar://C:/Program Files/Java/jdk1.8.0_231/lib/tools.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES />
|
||||||
|
@ -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;
|
||||||
|
@ -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);
|
||||||
|
|
||||||
}
|
}
|
@ -25,26 +25,34 @@
|
|||||||
<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>
|
||||||
|
|
||||||
<resultMap extends="BaseResultMap" id="mtAloneProcessMaterialsBomVO" type="com.deer.wms.produce.manage.model.MaterialsInfoVO">
|
<resultMap extends="BaseResultMap" id="mtAloneProcessMaterialsBomVO" type="com.deer.wms.produce.manage.model.MaterialsInfoVO">
|
||||||
<result column="process_bom_id" jdbcType="INTEGER" property="processBomId" />
|
<result column="process_bom_id" jdbcType="INTEGER" property="processBomId" />
|
||||||
<result column="dosage" jdbcType="REAL" property="dosage" />
|
<result column="dosage" jdbcType="REAL" property="dosage" />
|
||||||
|
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
<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 +86,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 +119,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>
|
||||||
@ -126,6 +139,7 @@
|
|||||||
|
|
||||||
<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
|
SELECT * from mt_alone_materials_info materialsInfo
|
||||||
|
LEFT JOIN unit u ON materialsInfo.unit_id = u.unit_id
|
||||||
<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}, '%')
|
||||||
@ -133,7 +147,7 @@
|
|||||||
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}, '%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where> ORDER BY materialsInfo.create_time
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@ -47,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>
|
@ -118,21 +118,5 @@
|
|||||||
</where> ORDER BY prodproc.create_time DESC, prodproc.update_time DESC
|
</where> ORDER BY prodproc.create_time DESC, prodproc.update_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--没用
|
|
||||||
<select id="findProductProcessPoById" parameterType="com.deer.wms.produce.manage.model.ProductProcessParams" resultMap="ProductProcessPoResultMap">
|
|
||||||
SELECT prodproc.*, prodbom.product_process_name, product.product_name
|
|
||||||
FROM mt_alone_product_process prodproc
|
|
||||||
LEFT JOIN mt_alone_product_process_bom prodbom ON prodproc.product_bom_id = prodbom.id AND prodproc.company_id = prodbom.company_id
|
|
||||||
LEFT JOIN mt_alone_machining_product product ON prodbom.product_id = product.id AND prodbom.company_id = product.company_id
|
|
||||||
<where>
|
|
||||||
<if test=" != null">
|
|
||||||
AND DATE_FORMAT(prodproc.create_time,'%Y-%m-%d') = DATE_FORMAT(#{createDate}, '%Y-%m-%d')
|
|
||||||
</if>
|
|
||||||
<if test="companyId != null">
|
|
||||||
AND prodproc.company_id = #{companyId}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
-->
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -7,7 +7,7 @@ package com.deer.wms.produce.manage.model;
|
|||||||
*/
|
*/
|
||||||
public class MachiningProductVo extends MachiningProduct {
|
public class MachiningProductVo extends MachiningProduct {
|
||||||
private String specificationBom;
|
private String specificationBom;
|
||||||
private Integer unitName;
|
private String unitName;
|
||||||
|
|
||||||
public String getSpecificationBom() {
|
public String getSpecificationBom() {
|
||||||
return specificationBom;
|
return specificationBom;
|
||||||
@ -17,11 +17,11 @@ public class MachiningProductVo extends MachiningProduct {
|
|||||||
this.specificationBom = specificationBom;
|
this.specificationBom = specificationBom;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getUnitName() {
|
public String getUnitName() {
|
||||||
return unitName;
|
return unitName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUnitName(Integer unitName) {
|
public void setUnitName(String unitName) {
|
||||||
this.unitName = unitName;
|
this.unitName = unitName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,19 @@ public class MaterialsInfoVO extends MaterialsInfo {
|
|||||||
**/
|
**/
|
||||||
private Integer unitId;
|
private Integer unitId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位名称
|
||||||
|
**/
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
public String getUnitName() {
|
||||||
|
return unitName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnitName(String unitName) {
|
||||||
|
this.unitName = unitName;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
**/
|
**/
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -19,4 +20,6 @@ public interface MaterialsOutgoingLogService extends Service<MaterialsOutgoingLo
|
|||||||
List<MaterialsOutgoingLogVo> findListByOneMaterial(MaterialsOutgoingLogParams params) ;
|
List<MaterialsOutgoingLogVo> findListByOneMaterial(MaterialsOutgoingLogParams params) ;
|
||||||
|
|
||||||
void save(MaterialsOutgoingLog materialsOutgoingLog, CurrentUser currentUser);
|
void save(MaterialsOutgoingLog materialsOutgoingLog, CurrentUser currentUser);
|
||||||
|
|
||||||
|
void deleteByOutgoingIds(HashMap outgoingParam);
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ 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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,18 +39,22 @@ public class MaterialsOutgoingLogServiceImpl extends AbstractService<MaterialsOu
|
|||||||
public void save(MaterialsOutgoingLog materialsOutgoingLog, CurrentUser currentUser) {
|
public void save(MaterialsOutgoingLog materialsOutgoingLog, CurrentUser currentUser) {
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
|
|
||||||
materialsOutgoingLog.setOperatorId(1);
|
materialsOutgoingLog.setOperatorId(currentUser.getUserId());
|
||||||
materialsOutgoingLog.setCreateTime(date);
|
materialsOutgoingLog.setCreateTime(date);
|
||||||
materialsOutgoingLog.setCompanyId(1);
|
materialsOutgoingLog.setVersion("1.1");
|
||||||
|
materialsOutgoingLog.setStatus(ProduceManageConstant.STATUS_AVAILABLE);
|
||||||
|
materialsOutgoingLog.setCompanyId(currentUser.getCompanyId());
|
||||||
materialsOutgoingLogMapper.insert(materialsOutgoingLog);
|
materialsOutgoingLogMapper.insert(materialsOutgoingLog);
|
||||||
|
|
||||||
MaterialsStockInfo stock = materialsStockInfoService.findBy("materialsId", materialsOutgoingLog.getMaterialsId());
|
MaterialsStockInfo stock = materialsStockInfoService.findBy("materialsId", materialsOutgoingLog.getMaterialsId());
|
||||||
if(stock==null){//如果是新的物料,库存表中没有该物料信息,则新增一条库存记录
|
if(stock==null){//如果是新的物料,库存表中没有该物料信息,则新增一条库存记录
|
||||||
stock = new MaterialsStockInfo();
|
stock = new MaterialsStockInfo();
|
||||||
stock.setOperatorId(1);
|
stock.setOperatorId(currentUser.getUserId());
|
||||||
|
stock.setCreateTime(date);
|
||||||
|
stock.setVersion("1.1");
|
||||||
stock.setMaterialsId(materialsOutgoingLog.getMaterialsId());
|
stock.setMaterialsId(materialsOutgoingLog.getMaterialsId());
|
||||||
stock.setUnitId(materialsOutgoingLog.getUnitId());
|
stock.setUnitId(materialsOutgoingLog.getUnitId());
|
||||||
stock.setCreateTime(date);
|
|
||||||
if(materialsOutgoingLog.getType() == ProduceManageConstant.TYPE_OUT) {
|
if(materialsOutgoingLog.getType() == ProduceManageConstant.TYPE_OUT) {
|
||||||
stock.setQuantity(0-materialsOutgoingLog.getQuantity());//新建物料的出库仓储数量为负数
|
stock.setQuantity(0-materialsOutgoingLog.getQuantity());//新建物料的出库仓储数量为负数
|
||||||
}else if(materialsOutgoingLog.getType() == ProduceManageConstant.TYPE_IN) {
|
}else if(materialsOutgoingLog.getType() == ProduceManageConstant.TYPE_IN) {
|
||||||
@ -57,14 +62,13 @@ public class MaterialsOutgoingLogServiceImpl extends AbstractService<MaterialsOu
|
|||||||
}
|
}
|
||||||
|
|
||||||
stock.setPositionName(materialsOutgoingLog.getPositionName());
|
stock.setPositionName(materialsOutgoingLog.getPositionName());
|
||||||
stock.setCompanyId(1);
|
stock.setCompanyId(currentUser.getCompanyId());
|
||||||
|
|
||||||
materialsStockInfoService.save(stock);
|
materialsStockInfoService.save(stock);
|
||||||
}else{//如果库存表中有该物料信息,则更新对应的库存记录
|
}else{//如果库存表中有该物料信息,则更新对应的库存记录
|
||||||
stock.setCreateTime(date);//日期取最新更新的日期
|
|
||||||
MaterialsInfoParams params = new MaterialsInfoParams();//查询条件赋值
|
MaterialsInfoParams params = new MaterialsInfoParams();//查询条件赋值
|
||||||
params.setMaterialsId(materialsOutgoingLog.getMaterialsId());
|
params.setMaterialsId(materialsOutgoingLog.getMaterialsId());
|
||||||
params.setCompanyId(1);
|
params.setCompanyId(currentUser.getCompanyId());
|
||||||
|
|
||||||
//设置库存数量:已有库存数量+入库数量(或已有库存数量-出库数量)
|
//设置库存数量:已有库存数量+入库数量(或已有库存数量-出库数量)
|
||||||
Float totalQuantity = materialsStockInfoService.getStockQuantityByMaId(params);
|
Float totalQuantity = materialsStockInfoService.getStockQuantityByMaId(params);
|
||||||
@ -78,7 +82,7 @@ public class MaterialsOutgoingLogServiceImpl extends AbstractService<MaterialsOu
|
|||||||
//设置库存位置:已有库存仓库,出入库记录对应仓库
|
//设置库存位置:已有库存仓库,出入库记录对应仓库
|
||||||
String inAndOutLogPosition = materialsOutgoingLog.getPositionName();
|
String inAndOutLogPosition = materialsOutgoingLog.getPositionName();
|
||||||
String stockPosition = materialsStockInfoService.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);
|
||||||
@ -87,4 +91,9 @@ public class MaterialsOutgoingLogServiceImpl extends AbstractService<MaterialsOu
|
|||||||
materialsStockInfoService.update(stock);
|
materialsStockInfoService.update(stock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteByOutgoingIds(HashMap outgoingParam) {
|
||||||
|
materialsOutgoingLogMapper.deleteByOutgoingIds(outgoingParam);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -198,8 +198,9 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
|||||||
List<ProcessHo> processHoList = productProcessHo.getProcessHoList();
|
List<ProcessHo> processHoList = productProcessHo.getProcessHoList();
|
||||||
List<MtAloneProcess> processList;
|
List<MtAloneProcess> processList;
|
||||||
List<ProcessMaterials> processMaterialsList;
|
List<ProcessMaterials> processMaterialsList;
|
||||||
if(null != processHoList) {
|
if((null!=processHoList) && (0!=processHoList.size())) {
|
||||||
processList = new ArrayList<MtAloneProcess>(processHoList.size());
|
processList = new ArrayList<MtAloneProcess>(processHoList.size());
|
||||||
|
processMaterialsList = new ArrayList<ProcessMaterials>();
|
||||||
for (ProcessHo processHo : processHoList) {
|
for (ProcessHo processHo : processHoList) {
|
||||||
MtAloneProcess process = new MtAloneProcess();
|
MtAloneProcess process = new MtAloneProcess();
|
||||||
BeanUtils.copyProperties(processHo, process);
|
BeanUtils.copyProperties(processHo, process);
|
||||||
@ -213,15 +214,8 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
|||||||
process.setCompanyId(currentUser.getCompanyId());
|
process.setCompanyId(currentUser.getCompanyId());
|
||||||
processList.add(process);
|
processList.add(process);
|
||||||
|
|
||||||
}
|
|
||||||
processService.save(processList);
|
|
||||||
|
|
||||||
processMaterialsList = new ArrayList<ProcessMaterials>();
|
|
||||||
for (int i=0; i<processList.size(); i++) {
|
|
||||||
MtAloneProcess process = processList.get(i);
|
|
||||||
ProcessHo processHo = processHoList.get(i);
|
|
||||||
List<ProcessMaterialsVo> processMaterialsVoList = processHo.getProcessMaterialsVoList();
|
List<ProcessMaterialsVo> processMaterialsVoList = processHo.getProcessMaterialsVoList();
|
||||||
if(null != processMaterialsVoList) {
|
if((null!=processMaterialsVoList) && (0!=processMaterialsVoList.size())){
|
||||||
for (ProcessMaterialsVo processMaterialsVo : processMaterialsVoList) {
|
for (ProcessMaterialsVo processMaterialsVo : processMaterialsVoList) {
|
||||||
ProcessMaterials processMaterials = new ProcessMaterials();
|
ProcessMaterials processMaterials = new ProcessMaterials();
|
||||||
BeanUtils.copyProperties(processMaterialsVo, processMaterials);
|
BeanUtils.copyProperties(processMaterialsVo, processMaterials);
|
||||||
@ -238,7 +232,10 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
processMaterialsService.save(processMaterialsList);
|
|
||||||
|
processService.save(processList);
|
||||||
|
if (0 != processMaterialsList.size())
|
||||||
|
processMaterialsService.save(processMaterialsList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,8 +109,8 @@ public class MachiningProductController {
|
|||||||
|
|
||||||
params.setCompanyId(currentUser.getCompanyId());
|
params.setCompanyId(currentUser.getCompanyId());
|
||||||
PageHelper.startPage(params.getPageNum(), params.getPageSize());
|
PageHelper.startPage(params.getPageNum(), params.getPageSize());
|
||||||
//List<MachiningProduct> list = machiningProductService.findProductList(params);
|
List<MachiningProduct> list = machiningProductService.findProductList(params);
|
||||||
List<MachiningProductVo> list = machiningProductService.findProductListBom(params);
|
//List<MachiningProductVo> list = machiningProductService.findProductListBom(params);
|
||||||
|
|
||||||
PageInfo pageInfo = new PageInfo(list);
|
PageInfo pageInfo = new PageInfo(list);
|
||||||
return ResultGenerator.genSuccessResult(pageInfo);
|
return ResultGenerator.genSuccessResult(pageInfo);
|
||||||
@ -119,11 +119,11 @@ public class MachiningProductController {
|
|||||||
//获取已生成对应bom的所有产品
|
//获取已生成对应bom的所有产品
|
||||||
@GetMapping("/productHaveBomList")
|
@GetMapping("/productHaveBomList")
|
||||||
public Result productHaveBomList(MachiningProductParams params, @ApiIgnore @User CurrentUser currentUser) {
|
public Result productHaveBomList(MachiningProductParams 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<MachiningProductHaveBom> list = machiningProductService.findProductHaveBomList(params);
|
List<MachiningProductHaveBom> list = machiningProductService.findProductHaveBomList(params);
|
||||||
PageInfo pageInfo = new PageInfo(list);
|
PageInfo pageInfo = new PageInfo(list);
|
||||||
|
@ -42,12 +42,6 @@ public class MaterialsInfoController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MaterialsInfoService materialsInfoService;
|
private MaterialsInfoService materialsInfoService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MaterialsStockInfoService materialsStockInfoService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MaterialsOutgoingLogService materialsOutgoingLogService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hy正在用
|
* hy正在用
|
||||||
* 新增物料信息
|
* 新增物料信息
|
||||||
@ -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")
|
||||||
@ -115,12 +124,12 @@ public class MaterialsInfoController {
|
|||||||
@ApiOperation(value = "获取某种物料详细信息", notes = "获取某种物料详细信息")
|
@ApiOperation(value = "获取某种物料详细信息", notes = "获取某种物料详细信息")
|
||||||
@GetMapping("/detail")
|
@GetMapping("/detail")
|
||||||
public Result detail(MaterialsInfoParams params, @ApiIgnore @User CurrentUser currentUser) {
|
public Result detail(MaterialsInfoParams 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 );
|
||||||
}
|
//}
|
||||||
StringUtil.trimObjectStringProperties(params);
|
StringUtil.trimObjectStringProperties(params);
|
||||||
|
|
||||||
params.setCompanyId(currentUser.getCompanyId());
|
params.setCompanyId(1);
|
||||||
MaterialsInfoDto materialsInfoDto = materialsInfoService.findDetailById(params);
|
MaterialsInfoDto materialsInfoDto = materialsInfoService.findDetailById(params);
|
||||||
return ResultGenerator.genSuccessResult(materialsInfoDto);
|
return ResultGenerator.genSuccessResult(materialsInfoDto);
|
||||||
}
|
}
|
||||||
|
@ -35,12 +35,6 @@ public class MaterialsOutgoingLogController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MaterialsOutgoingLogService materialsOutgoingLogService;
|
private MaterialsOutgoingLogService materialsOutgoingLogService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MaterialsStockInfoService materialsStockInfoService;
|
|
||||||
|
|
||||||
//@Autowired
|
|
||||||
//private MaterialsOutgoingLogDTOService materialsOutgoingLogDTOService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hy正在用
|
* hy正在用
|
||||||
* 出入库操作,添加一条出入库记录,同时更新对应的库存信息
|
* 出入库操作,添加一条出入库记录,同时更新对应的库存信息
|
||||||
|
Loading…
Reference in New Issue
Block a user