Merge branch 'weihongyang' of mengtong/mt-pms-api into master

This commit is contained in:
何勇 2020-01-16 10:08:37 +08:00 committed by Gitea
commit f158de959a
9 changed files with 145 additions and 1 deletions

View File

@ -21,4 +21,6 @@ public interface ProductProcessBomMapper extends Mapper<ProductProcessBom> {
List<ProductProcessBomVO> findByProductNameAndProductNum(ProductProcessBomParams mtAloneProductProcessBomParams); List<ProductProcessBomVO> findByProductNameAndProductNum(ProductProcessBomParams mtAloneProductProcessBomParams);
ProductProcessBom selectByProdProcBom(ProductProcessBomParams params); ProductProcessBom selectByProdProcBom(ProductProcessBomParams params);
ProductProcessBomDto findDataById(Integer id);
} }

View File

@ -24,6 +24,12 @@
</resultMap> </resultMap>
<resultMap id="ProcessBomDto" type="com.deer.wms.produce.manage.model.ProcessBomDto" extends="BaseResultMap"> <resultMap id="ProcessBomDto" type="com.deer.wms.produce.manage.model.ProcessBomDto" extends="BaseResultMap">
<result column="product_name" jdbcType="VARCHAR" property="productName" />
<result column="product_specification" jdbcType="VARCHAR" property="productSpecification" />
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="product_process_name" jdbcType="VARCHAR" property="productProcessName" />
<result column="product_work_specification" jdbcType="VARCHAR" property="productWorkSpecification" />
<result column="process_content" jdbcType="VARCHAR" property="processContent" />
<collection property="processMaterialsBomDtoList" ofType="com.deer.wms.produce.manage.model.ProcessMaterialsBomDto"> <collection property="processMaterialsBomDtoList" ofType="com.deer.wms.produce.manage.model.ProcessMaterialsBomDto">
<result column="operator_id" jdbcType="INTEGER" property="operatorId" /> <result column="operator_id" jdbcType="INTEGER" property="operatorId" />
@ -67,11 +73,14 @@
<select id="findListById" resultMap="ProcessBomDto"> <select id="findListById" resultMap="ProcessBomDto">
SELECT SELECT
mapb.id,mapb.process_name,mapb.process_apartment,mapb.process_step,mapb.process_content,mapab.code,mapab.specification,mapab.dosage,mami.materials_name mapb.id,mapb.process_name,mapb.process_apartment,mapb.process_step,mapb.process_content,mapab.code,mapab.specification,mapab.dosage,mami.materials_name,mamp.product_name,mamp.specification AS product_specification,u.unit_name,mappb.product_process_name,mapb.specification AS
product_work_specification,mapb.process_content
FROM mt_alone_product_process_bom mappb FROM mt_alone_product_process_bom mappb
LEFT JOIN mt_alone_process_bom mapb ON mappb.id = mapb.product_process_id LEFT JOIN mt_alone_process_bom mapb ON mappb.id = mapb.product_process_id
LEFT JOIN mt_alone_process_materials_bom mapab ON mapb.id = mapab.process_bom_id LEFT JOIN mt_alone_process_materials_bom mapab ON mapb.id = mapab.process_bom_id
LEFT JOIN mt_alone_materials_info mami ON mapab.materials_id = mami.id LEFT JOIN mt_alone_materials_info mami ON mapab.materials_id = mami.id
LEFT JOIN mt_alone_machining_product mamp ON mappb.product_id = mamp.id
LEFT JOIN unit u ON mamp.unit_id = u.unit_id
WHERE mapb.product_process_id = #{productProcessId} WHERE mapb.product_process_id = #{productProcessId}
ORDER BY mapb.process_step ORDER BY mapb.process_step
</select> </select>

View File

@ -32,6 +32,7 @@
<result column="product_process_name" jdbcType="VARCHAR" property="productProcessName" /> <result column="product_process_name" jdbcType="VARCHAR" property="productProcessName" />
<result column="company_name" jdbcType="VARCHAR" property="companyName" /> <result column="company_name" jdbcType="VARCHAR" property="companyName" />
<result column="unit_name" jdbcType="VARCHAR" property="unitName" /> <result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="machining_product_id" jdbcType="INTEGER" property="machiningProductId"/>
</resultMap> </resultMap>
<resultMap id="BaseResultMap2" type="com.deer.wms.produce.manage.model.MachiningProduct"> <resultMap id="BaseResultMap2" type="com.deer.wms.produce.manage.model.MachiningProduct">
@ -155,5 +156,12 @@
</where> </where>
</select> </select>
<select id="findDataById" resultMap="ProPrcessBomDTOResultMap">
SELECT mappb.id,mamp.id AS machining_product_id,mamp.product_name,mappb.specification,u.unit_name,mappb.product_process_name,mamp.specification AS work_specification,mappb.process_content
FROM mt_alone_product_process_bom mappb
LEFT JOIN mt_alone_machining_product mamp ON mappb.product_id = mamp.id
LEFT JOIN unit u ON mamp.unit_id = u.unit_id
WHERE mappb.id = #{id}
</select>
</mapper> </mapper>

View File

@ -15,6 +15,58 @@ public class ProcessBomDto extends ProcessBom{
private String companyName; private String companyName;
private String productName;
private String productSpecification;
private String unitName;
private String productWorkSpecification;
private String processContent;
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductSpecification() {
return productSpecification;
}
public void setProductSpecification(String productSpecification) {
this.productSpecification = productSpecification;
}
public String getUnitName() {
return unitName;
}
public void setUnitName(String unitName) {
this.unitName = unitName;
}
public String getProductWorkSpecification() {
return productWorkSpecification;
}
public void setProductWorkSpecification(String productWorkSpecification) {
this.productWorkSpecification = productWorkSpecification;
}
@Override
public String getProcessContent() {
return processContent;
}
@Override
public void setProcessContent(String processContent) {
this.processContent = processContent;
}
private List<ProcessMaterialsBomDto> processMaterialsBomDtoList; private List<ProcessMaterialsBomDto> processMaterialsBomDtoList;
public List<ProcessMaterialsBomDto> getProcessMaterialsBomDtoList() { public List<ProcessMaterialsBomDto> getProcessMaterialsBomDtoList() {

View File

@ -38,6 +38,28 @@ public class ProductProcessBomDto extends ProductProcessBom{
*/ */
private String unitName; private String unitName;
private String productProcessName;
private Integer machiningProductId;
public Integer getMachiningProductId() {
return machiningProductId;
}
public void setMachiningProductId(Integer machiningProductId) {
this.machiningProductId = machiningProductId;
}
@Override
public String getProductProcessName() {
return productProcessName;
}
@Override
public void setProductProcessName(String productProcessName) {
this.productProcessName = productProcessName;
}
public String getUnitName() { public String getUnitName() {
return unitName; return unitName;
} }

View File

@ -56,6 +56,12 @@ public class ProductProcessBomParams extends QueryParams {
*/ */
private Integer id; private Integer id;
private String workSpecification;
private Integer machiningProductId;
@Override @Override
public String toString() { public String toString() {
return "ProductProcessBomParams{" + return "ProductProcessBomParams{" +
@ -72,6 +78,22 @@ public class ProductProcessBomParams extends QueryParams {
'}'; '}';
} }
public Integer getMachiningProductId() {
return machiningProductId;
}
public void setMachiningProductId(Integer machiningProductId) {
this.machiningProductId = machiningProductId;
}
public String getWorkSpecification() {
return workSpecification;
}
public void setWorkSpecification(String workSpecification) {
this.workSpecification = workSpecification;
}
public Integer getId() { public Integer getId() {
return id; return id;
} }

View File

@ -24,4 +24,6 @@ public interface ProductProcessBomService extends Service<ProductProcessBom, Int
ProductProcessBomHo findAllBomByProdProcBom(ProductProcessBomParams params); ProductProcessBomHo findAllBomByProdProcBom(ProductProcessBomParams params);
ProductProcessBom selectByProdProcBom(ProductProcessBomParams params); ProductProcessBom selectByProdProcBom(ProductProcessBomParams params);
ProductProcessBomDto findDataById(Integer id);
} }

View File

@ -1,9 +1,11 @@
package com.deer.wms.produce.manage.service.impl; package com.deer.wms.produce.manage.service.impl;
import com.deer.wms.produce.manage.dao.MachiningProductMapper;
import com.deer.wms.produce.manage.dao.ProcessBomMapper; 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.MachiningProductService;
import com.deer.wms.produce.manage.service.ProcessMaterialsBomService; import com.deer.wms.produce.manage.service.ProcessMaterialsBomService;
import com.deer.wms.produce.manage.service.ProductProcessBomService; import com.deer.wms.produce.manage.service.ProductProcessBomService;
@ -37,6 +39,9 @@ public class ProductProcessBomServiceImpl extends AbstractService<ProductProcess
@Autowired @Autowired
private ProcessMaterialsBomService processMaterialsBomService; private ProcessMaterialsBomService processMaterialsBomService;
@Autowired
private MachiningProductMapper machiningProductMapper;
@Override @Override
public List<ProductProcessBomDto> findProBomAndProList(ProductProcessBomParams params) { public List<ProductProcessBomDto> findProBomAndProList(ProductProcessBomParams params) {
@ -108,7 +113,13 @@ public class ProductProcessBomServiceImpl extends AbstractService<ProductProcess
productProcessBom.setId(params.getId()); productProcessBom.setId(params.getId());
productProcessBom.setSpecification(params.getSpecification()); productProcessBom.setSpecification(params.getSpecification());
productProcessBom.setProcessContent(params.getProcessContent()); productProcessBom.setProcessContent(params.getProcessContent());
productProcessBom.setProductProcessName(params.getProductProcessName());
productProcessBomMapper.updateByPrimaryKeySelective(productProcessBom); productProcessBomMapper.updateByPrimaryKeySelective(productProcessBom);
MachiningProduct machiningProduct = new MachiningProduct();
machiningProduct.setSpecification(params.getWorkSpecification());
machiningProduct.setId(params.getMachiningProductId());
machiningProductMapper.updateByPrimaryKeySelective(machiningProduct);
List<ProcessBom> processBomList = new ArrayList<>(); List<ProcessBom> processBomList = new ArrayList<>();
for (ProcessBomParams processBomParams:params.getProcessBomParamsList()) { for (ProcessBomParams processBomParams:params.getProcessBomParamsList()) {
ProcessBom processBom = new ProcessBom(); ProcessBom processBom = new ProcessBom();
@ -177,4 +188,9 @@ public class ProductProcessBomServiceImpl extends AbstractService<ProductProcess
public ProductProcessBom selectByProdProcBom(ProductProcessBomParams params) { public ProductProcessBom selectByProdProcBom(ProductProcessBomParams params) {
return productProcessBomMapper.selectByProdProcBom(params); return productProcessBomMapper.selectByProdProcBom(params);
} }
@Override
public ProductProcessBomDto findDataById(Integer id) {
return productProcessBomMapper.findDataById(id);
}
} }

View File

@ -222,4 +222,15 @@ public class ProductProcessBomController {
PageInfo pageInfo = new PageInfo(byProductNameAndProductNum);; PageInfo pageInfo = new PageInfo(byProductNameAndProductNum);;
return ResultGenerator.genSuccessResult(pageInfo); return ResultGenerator.genSuccessResult(pageInfo);
} }
/**
* why
* 根据产品bom的id查询出来所对应的数据
*/
@GetMapping("/find/data/by/{id}")
@ApiOperation(value = "依据产品bom的id查询该产品的工艺列表", notes = "依据产品bom的id查询该产品的工艺列表")
public Result findDataById(@PathVariable Integer id) {
ProductProcessBomDto productProcessBomDto = productProcessBomService.findDataById(id);
return ResultGenerator.genSuccessResult(productProcessBomDto);
}
} }