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">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="true" />
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
|
@ -2,11 +2,14 @@
|
||||
<project version="4">
|
||||
<component name="dataSourceStorageLocal">
|
||||
<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>
|
||||
<first-sync>true</first-sync>
|
||||
<user-name>root</user-name>
|
||||
<introspection-schemas>*:</introspection-schemas>
|
||||
<schema-mapping>
|
||||
<introspection-scope>
|
||||
<node kind="schema" qname="" />
|
||||
</introspection-scope>
|
||||
</schema-mapping>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
@ -3,5 +3,6 @@
|
||||
<component name="Encoding">
|
||||
<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/src/main/java" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
6
pom.xml
6
pom.xml
@ -106,6 +106,12 @@
|
||||
<artifactId>pagehelper</artifactId>
|
||||
<version>4.2.1</version>
|
||||
</dependency>
|
||||
<!-- MyBatis 通用 Mapper -->
|
||||
<dependency>
|
||||
<groupId>tk.mybatis</groupId>
|
||||
<artifactId>mapper-spring-boot-starter</artifactId>
|
||||
<version>2.0.2</version>
|
||||
</dependency>
|
||||
<!--阿里 FastJson依赖-->
|
||||
<dependency>
|
||||
<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: 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: 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:druid-spring-boot-starter:1.1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.2" level="project" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: com.alibaba:jconsole:1.8.0">
|
||||
<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>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
@ -91,7 +98,7 @@
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: com.alibaba:tools:1.8.0">
|
||||
<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>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.deer.wms.produce.manage;
|
||||
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
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.project.seed.core.mapper.Mapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public interface MaterialsOutgoingLogMapper extends Mapper<MaterialsOutgoingLog> {
|
||||
List<MaterialsOutgoingLogVo> findListByOneMaterial(MaterialsOutgoingLogParams params);
|
||||
|
||||
void deleteByOutgoingIds(HashMap outgoingParam);
|
||||
|
||||
}
|
@ -25,26 +25,34 @@
|
||||
<result column="materials_name" jdbcType="VARCHAR" property="materialsName" />
|
||||
<result column="position_name" jdbcType="VARCHAR" property="positionName" />
|
||||
<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="parent_id" jdbcType="INTEGER" property="parentId" />
|
||||
<result column="parent_name" jdbcType="VARCHAR" property="parentName" />
|
||||
<result column="supplier_id" jdbcType="INTEGER" property="supplierId" />
|
||||
<result column="supplier_name" jdbcType="VARCHAR" property="supplierName" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap extends="BaseResultMap" id="mtAloneProcessMaterialsBomVO" type="com.deer.wms.produce.manage.model.MaterialsInfoVO">
|
||||
<result column="process_bom_id" jdbcType="INTEGER" property="processBomId" />
|
||||
<result column="dosage" jdbcType="REAL" property="dosage" />
|
||||
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="findList" parameterType="com.deer.wms.produce.manage.model.MaterialsInfoParams" resultMap="MatInfoDTOResultMap">
|
||||
SELECT
|
||||
materials.id,
|
||||
materials.code,
|
||||
materials.create_time,
|
||||
materials.materials_name,
|
||||
materials.parent_id,
|
||||
(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.memo,
|
||||
materials.supplier_id,
|
||||
IFNULL(stock.quantity,0) quantity,
|
||||
stock.position_name,
|
||||
unit.unit_name,
|
||||
@ -78,17 +86,22 @@
|
||||
<if test="companyId != null">
|
||||
AND com.company_id = #{companyId}
|
||||
</if>
|
||||
</where> order by materials.id
|
||||
</where> ORDER BY materials.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="findDetailById" parameterType="com.deer.wms.produce.manage.model.MaterialsInfoParams" resultMap="MatInfoDTOResultMap">
|
||||
SELECT
|
||||
materials.id,
|
||||
materials.code,
|
||||
materials.create_time,
|
||||
materials.materials_name,
|
||||
materials.parent_id,
|
||||
(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.memo,
|
||||
materials.supplier_id,
|
||||
IFNULL(stock.quantity,0) quantity,
|
||||
stock.position_name,
|
||||
unit.unit_name,
|
||||
@ -106,7 +119,7 @@
|
||||
AND materials.id = #{materialsId}
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
AND com.company_id = #{companyId}
|
||||
AND materials.company_id = #{companyId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -126,6 +139,7 @@
|
||||
|
||||
<select id="findMaterialsByKeyWords" parameterType="com.deer.wms.produce.manage.model.MaterialsInfoParams" resultMap="mtAloneProcessMaterialsBomVO">
|
||||
SELECT * from mt_alone_materials_info materialsInfo
|
||||
LEFT JOIN unit u ON materialsInfo.unit_id = u.unit_id
|
||||
<where>
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND materialsInfo.materials_name LIKE CONCAT('%', #{keywords}, '%')
|
||||
@ -133,7 +147,7 @@
|
||||
OR materialsInfo.specification LIKE CONCAT('%', #{keywords}, '%')
|
||||
OR materialsInfo.unit_id LIKE CONCAT('%', #{keywords}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</where> ORDER BY materialsInfo.create_time
|
||||
|
||||
</select>
|
||||
</mapper>
|
@ -47,6 +47,15 @@
|
||||
<if test="companyId != null">
|
||||
AND outgoing.company_id = #{companyId}
|
||||
</if>
|
||||
</where> ORDER BY outgoing.id
|
||||
</where> ORDER BY outgoing.create_time DESC
|
||||
</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>
|
@ -118,21 +118,5 @@
|
||||
</where> ORDER BY prodproc.create_time DESC, prodproc.update_time DESC
|
||||
</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>
|
@ -7,7 +7,7 @@ package com.deer.wms.produce.manage.model;
|
||||
*/
|
||||
public class MachiningProductVo extends MachiningProduct {
|
||||
private String specificationBom;
|
||||
private Integer unitName;
|
||||
private String unitName;
|
||||
|
||||
public String getSpecificationBom() {
|
||||
return specificationBom;
|
||||
@ -17,11 +17,11 @@ public class MachiningProductVo extends MachiningProduct {
|
||||
this.specificationBom = specificationBom;
|
||||
}
|
||||
|
||||
public Integer getUnitName() {
|
||||
public String getUnitName() {
|
||||
return unitName;
|
||||
}
|
||||
|
||||
public void setUnitName(Integer unitName) {
|
||||
public void setUnitName(String unitName) {
|
||||
this.unitName = unitName;
|
||||
}
|
||||
}
|
||||
|
@ -36,6 +36,19 @@ public class MaterialsInfoVO extends MaterialsInfo {
|
||||
**/
|
||||
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 {
|
||||
|
||||
private Integer type = ProduceManageConstant.TYPE_IN;//默认为入库记录
|
||||
private Integer type;
|
||||
|
||||
private Integer materialsId;
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
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.MaterialsInfoDto;
|
||||
import com.deer.wms.produce.manage.model.MaterialsInfoParams;
|
||||
@ -20,4 +21,5 @@ public interface MaterialsInfoService extends Service<MaterialsInfo, Integer> {
|
||||
|
||||
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 java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -19,4 +20,6 @@ public interface MaterialsOutgoingLogService extends Service<MaterialsOutgoingLo
|
||||
List<MaterialsOutgoingLogVo> findListByOneMaterial(MaterialsOutgoingLogParams params) ;
|
||||
|
||||
void save(MaterialsOutgoingLog materialsOutgoingLog, CurrentUser currentUser);
|
||||
|
||||
void deleteByOutgoingIds(HashMap outgoingParam);
|
||||
}
|
||||
|
@ -1,16 +1,19 @@
|
||||
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.model.MaterialsInfo;
|
||||
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.model.*;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -23,6 +26,11 @@ public class MaterialsInfoServiceImpl extends AbstractService<MaterialsInfo, Int
|
||||
@Autowired
|
||||
private MaterialsInfoMapper materialsInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private MaterialsStockInfoService materialsStockInfoService;
|
||||
|
||||
@Autowired
|
||||
private MaterialsOutgoingLogService materialsOutgoingLogService;
|
||||
|
||||
@Override
|
||||
public List<MaterialsInfoDto> findList(MaterialsInfoParams params) {
|
||||
@ -44,5 +52,32 @@ public class MaterialsInfoServiceImpl extends AbstractService<MaterialsInfo, Int
|
||||
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 java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -38,18 +39,22 @@ public class MaterialsOutgoingLogServiceImpl extends AbstractService<MaterialsOu
|
||||
public void save(MaterialsOutgoingLog materialsOutgoingLog, CurrentUser currentUser) {
|
||||
Date date = new Date();
|
||||
|
||||
materialsOutgoingLog.setOperatorId(1);
|
||||
materialsOutgoingLog.setOperatorId(currentUser.getUserId());
|
||||
materialsOutgoingLog.setCreateTime(date);
|
||||
materialsOutgoingLog.setCompanyId(1);
|
||||
materialsOutgoingLog.setVersion("1.1");
|
||||
materialsOutgoingLog.setStatus(ProduceManageConstant.STATUS_AVAILABLE);
|
||||
materialsOutgoingLog.setCompanyId(currentUser.getCompanyId());
|
||||
materialsOutgoingLogMapper.insert(materialsOutgoingLog);
|
||||
|
||||
MaterialsStockInfo stock = materialsStockInfoService.findBy("materialsId", materialsOutgoingLog.getMaterialsId());
|
||||
if(stock==null){//如果是新的物料,库存表中没有该物料信息,则新增一条库存记录
|
||||
stock = new MaterialsStockInfo();
|
||||
stock.setOperatorId(1);
|
||||
stock.setOperatorId(currentUser.getUserId());
|
||||
stock.setCreateTime(date);
|
||||
stock.setVersion("1.1");
|
||||
stock.setMaterialsId(materialsOutgoingLog.getMaterialsId());
|
||||
stock.setUnitId(materialsOutgoingLog.getUnitId());
|
||||
stock.setCreateTime(date);
|
||||
|
||||
if(materialsOutgoingLog.getType() == ProduceManageConstant.TYPE_OUT) {
|
||||
stock.setQuantity(0-materialsOutgoingLog.getQuantity());//新建物料的出库仓储数量为负数
|
||||
}else if(materialsOutgoingLog.getType() == ProduceManageConstant.TYPE_IN) {
|
||||
@ -57,14 +62,13 @@ public class MaterialsOutgoingLogServiceImpl extends AbstractService<MaterialsOu
|
||||
}
|
||||
|
||||
stock.setPositionName(materialsOutgoingLog.getPositionName());
|
||||
stock.setCompanyId(1);
|
||||
stock.setCompanyId(currentUser.getCompanyId());
|
||||
|
||||
materialsStockInfoService.save(stock);
|
||||
}else{//如果库存表中有该物料信息,则更新对应的库存记录
|
||||
stock.setCreateTime(date);//日期取最新更新的日期
|
||||
MaterialsInfoParams params = new MaterialsInfoParams();//查询条件赋值
|
||||
params.setMaterialsId(materialsOutgoingLog.getMaterialsId());
|
||||
params.setCompanyId(1);
|
||||
params.setCompanyId(currentUser.getCompanyId());
|
||||
|
||||
//设置库存数量:已有库存数量+入库数量(或已有库存数量-出库数量)
|
||||
Float totalQuantity = materialsStockInfoService.getStockQuantityByMaId(params);
|
||||
@ -78,7 +82,7 @@ public class MaterialsOutgoingLogServiceImpl extends AbstractService<MaterialsOu
|
||||
//设置库存位置:已有库存仓库,出入库记录对应仓库
|
||||
String inAndOutLogPosition = materialsOutgoingLog.getPositionName();
|
||||
String stockPosition = materialsStockInfoService.getStockPositionByMaId(params);
|
||||
if(stockPosition!=null && !stockPosition.trim().equals("")) {
|
||||
if((null!=stockPosition) && (!stockPosition.trim().equals(""))) {
|
||||
stock.setPositionName(stockPosition + "," +inAndOutLogPosition);
|
||||
}else{
|
||||
stock.setPositionName(inAndOutLogPosition);
|
||||
@ -87,4 +91,9 @@ public class MaterialsOutgoingLogServiceImpl extends AbstractService<MaterialsOu
|
||||
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<MtAloneProcess> processList;
|
||||
List<ProcessMaterials> processMaterialsList;
|
||||
if(null != processHoList) {
|
||||
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);
|
||||
@ -213,15 +214,8 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
||||
process.setCompanyId(currentUser.getCompanyId());
|
||||
processList.add(process);
|
||||
|
||||
}
|
||||
processService.save(processList);
|
||||
|
||||
processMaterialsList = new ArrayList<ProcessMaterials>();
|
||||
for (int i=0; i<processList.size(); i++) {
|
||||
MtAloneProcess process = processList.get(i);
|
||||
ProcessHo processHo = processHoList.get(i);
|
||||
List<ProcessMaterialsVo> processMaterialsVoList = processHo.getProcessMaterialsVoList();
|
||||
if(null != processMaterialsVoList) {
|
||||
if((null!=processMaterialsVoList) && (0!=processMaterialsVoList.size())){
|
||||
for (ProcessMaterialsVo processMaterialsVo : processMaterialsVoList) {
|
||||
ProcessMaterials processMaterials = new ProcessMaterials();
|
||||
BeanUtils.copyProperties(processMaterialsVo, processMaterials);
|
||||
@ -238,6 +232,9 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
processService.save(processList);
|
||||
if (0 != processMaterialsList.size())
|
||||
processMaterialsService.save(processMaterialsList);
|
||||
}
|
||||
}
|
||||
|
@ -109,8 +109,8 @@ public class MachiningProductController {
|
||||
|
||||
params.setCompanyId(currentUser.getCompanyId());
|
||||
PageHelper.startPage(params.getPageNum(), params.getPageSize());
|
||||
//List<MachiningProduct> list = machiningProductService.findProductList(params);
|
||||
List<MachiningProductVo> list = machiningProductService.findProductListBom(params);
|
||||
List<MachiningProduct> list = machiningProductService.findProductList(params);
|
||||
//List<MachiningProductVo> list = machiningProductService.findProductListBom(params);
|
||||
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
return ResultGenerator.genSuccessResult(pageInfo);
|
||||
@ -119,11 +119,11 @@ public class MachiningProductController {
|
||||
//获取已生成对应bom的所有产品
|
||||
@GetMapping("/productHaveBomList")
|
||||
public Result productHaveBomList(MachiningProductParams params, @ApiIgnore @User CurrentUser currentUser) {
|
||||
//if(currentUser==null){
|
||||
// return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
|
||||
//}
|
||||
if(currentUser==null){
|
||||
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
|
||||
}
|
||||
|
||||
params.setCompanyId(1);
|
||||
params.setCompanyId(currentUser.getCompanyId());
|
||||
PageHelper.startPage(params.getPageNum(), params.getPageSize());
|
||||
List<MachiningProductHaveBom> list = machiningProductService.findProductHaveBomList(params);
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
|
@ -42,12 +42,6 @@ public class MaterialsInfoController {
|
||||
@Autowired
|
||||
private MaterialsInfoService materialsInfoService;
|
||||
|
||||
@Autowired
|
||||
private MaterialsStockInfoService materialsStockInfoService;
|
||||
|
||||
@Autowired
|
||||
private MaterialsOutgoingLogService materialsOutgoingLogService;
|
||||
|
||||
/**
|
||||
* hy正在用
|
||||
* 新增物料信息
|
||||
@ -74,24 +68,39 @@ public class MaterialsInfoController {
|
||||
materialsInfo.setCompanyId(currentUser.getCompanyId());
|
||||
materialsInfo.setCode(ProduceManagePublicMethod.creatUniqueCode("WL"));
|
||||
materialsInfoService.save(materialsInfo);
|
||||
|
||||
return ResultGenerator.genSuccessResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* hy正在用
|
||||
* 删除物料,顺带删除相应的库存信息、出入库记录
|
||||
* @param materialsId
|
||||
* @return
|
||||
*/
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "materialsId", value = "物料id", paramType = "query", dataType = "int", required = true)
|
||||
})
|
||||
@OperateLog(description = "删除物料", type = "删除")
|
||||
@ApiOperation(value = "删除物料", notes = "删除物料")
|
||||
@DeleteMapping("/delete/{materialsId}")
|
||||
public Result delete(@PathVariable Integer materialsId) {
|
||||
//删除物料,顺带删除相应的库存信息
|
||||
MaterialsInfo materialsInfo = materialsInfoService.findById(materialsId);
|
||||
materialsInfoService.deleteById(materialsId);
|
||||
MaterialsStockInfo stock = materialsStockInfoService.findBy("materialsId",
|
||||
materialsInfo.getId());
|
||||
materialsStockInfoService.deleteById(stock.getId());
|
||||
@DeleteMapping("/delete")
|
||||
public Result delete(Integer materialsId, @ApiIgnore @User CurrentUser currentUser) {
|
||||
if(currentUser==null){
|
||||
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
|
||||
}
|
||||
|
||||
materialsInfoService.deleteRelevantById(materialsId, currentUser);
|
||||
return ResultGenerator.genSuccessResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* hy正在用
|
||||
* 物料更新
|
||||
* @param materialsInfo
|
||||
* @return
|
||||
*/
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "materialsInfo", value = "物料", paramType = "body", dataType = "MaterialsInfo", required = true)
|
||||
})
|
||||
@OperateLog(description = "修改物料", type = "更新")
|
||||
@ApiOperation(value = "修改物料", notes = "修改物料")
|
||||
@PostMapping("/update")
|
||||
@ -115,12 +124,12 @@ public class MaterialsInfoController {
|
||||
@ApiOperation(value = "获取某种物料详细信息", notes = "获取某种物料详细信息")
|
||||
@GetMapping("/detail")
|
||||
public Result detail(MaterialsInfoParams params, @ApiIgnore @User CurrentUser currentUser) {
|
||||
if(currentUser==null){
|
||||
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
|
||||
}
|
||||
//if(currentUser==null){
|
||||
// return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
|
||||
//}
|
||||
StringUtil.trimObjectStringProperties(params);
|
||||
|
||||
params.setCompanyId(currentUser.getCompanyId());
|
||||
params.setCompanyId(1);
|
||||
MaterialsInfoDto materialsInfoDto = materialsInfoService.findDetailById(params);
|
||||
return ResultGenerator.genSuccessResult(materialsInfoDto);
|
||||
}
|
||||
|
@ -35,12 +35,6 @@ public class MaterialsOutgoingLogController {
|
||||
@Autowired
|
||||
private MaterialsOutgoingLogService materialsOutgoingLogService;
|
||||
|
||||
@Autowired
|
||||
private MaterialsStockInfoService materialsStockInfoService;
|
||||
|
||||
//@Autowired
|
||||
//private MaterialsOutgoingLogDTOService materialsOutgoingLogDTOService;
|
||||
|
||||
/**
|
||||
* hy正在用
|
||||
* 出入库操作,添加一条出入库记录,同时更新对应的库存信息
|
||||
|
Loading…
Reference in New Issue
Block a user