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

This commit is contained in:
何勇 2020-01-16 10:08:37 +08:00 gecommit door Gitea
bovenliggende ae7bb481cc 7eaa4d08e6
commit f158de959a
9 gewijzigde bestanden met toevoegingen van 145 en 1 verwijderingen

Bestand weergeven

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

Bestand weergeven

@ -24,6 +24,12 @@
</resultMap>
<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">
<result column="operator_id" jdbcType="INTEGER" property="operatorId" />
@ -67,11 +73,14 @@
<select id="findListById" resultMap="ProcessBomDto">
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
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_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}
ORDER BY mapb.process_step
</select>

Bestand weergeven

@ -32,6 +32,7 @@
<result column="product_process_name" jdbcType="VARCHAR" property="productProcessName" />
<result column="company_name" jdbcType="VARCHAR" property="companyName" />
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
<result column="machining_product_id" jdbcType="INTEGER" property="machiningProductId"/>
</resultMap>
<resultMap id="BaseResultMap2" type="com.deer.wms.produce.manage.model.MachiningProduct">
@ -155,5 +156,12 @@
</where>
</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>

Bestand weergeven

@ -15,6 +15,58 @@ public class ProcessBomDto extends ProcessBom{
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;
public List<ProcessMaterialsBomDto> getProcessMaterialsBomDtoList() {

Bestand weergeven

@ -38,6 +38,28 @@ public class ProductProcessBomDto extends ProductProcessBom{
*/
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() {
return unitName;
}

Bestand weergeven

@ -56,6 +56,12 @@ public class ProductProcessBomParams extends QueryParams {
*/
private Integer id;
private String workSpecification;
private Integer machiningProductId;
@Override
public String toString() {
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() {
return id;
}

Bestand weergeven

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

Bestand weergeven

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

Bestand weergeven

@ -222,4 +222,15 @@ public class ProductProcessBomController {
PageInfo pageInfo = new PageInfo(byProductNameAndProductNum);;
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);
}
}