修改根据批次明细查询已检测的工序接口,增加根据批次明细和工序查询检测结果接口

This commit is contained in:
hy2250089 2020-03-24 18:43:24 +08:00
parent 587def8f1f
commit a152f9164d
21 changed files with 282 additions and 40 deletions

View File

@ -15,7 +15,7 @@ public interface MtAloneProcessMapper extends Mapper<MtAloneProcess> {
MtAloneProcessVo findProcessById(MtAloneProcessParams processParams);
List<MtAloneProcess> findDetectProcessByBatchDet(ProductProcessBatchDetParams params);
List<MtAloneProcessDo> findDetectProcessByBatchDet(ProductProcessBatchDetParams params);
//List<Integer> processStepListByProdprocid(ProductProcessParams params);
}

View File

@ -2,10 +2,14 @@ package com.deer.wms.produce.manage.dao;
import com.deer.wms.produce.manage.model.ProductBatchDetectDet;
import com.deer.wms.produce.manage.model.ProductBatchDetectDetParams;
import com.deer.wms.produce.manage.model.ProductBatchDetectDetVo;
import com.deer.wms.produce.manage.model.ProductBatchDetectParams;
import com.deer.wms.project.seed.core.mapper.Mapper;
import java.util.List;
public interface ProductBatchDetectDetMapper extends Mapper<ProductBatchDetectDet> {
List<ProductBatchDetectDet> findList(ProductBatchDetectDetParams params);
List<ProductBatchDetectDetVo> findDetectDetVoListByBatchDetAndProcess(ProductBatchDetectParams params);
}

View File

@ -8,4 +8,6 @@ import java.util.List;
public interface ProductBatchDetectMapper extends Mapper<ProductBatchDetect> {
List<ProductBatchDetect> findList(ProductBatchDetectParams params);
ProductBatchDetect findDetectByBatchDetAndProcess(ProductBatchDetectParams params);
}

View File

@ -74,6 +74,13 @@
<result column="name" jdbcType="VARCHAR" property="accessoryName"/>
</resultMap>
<resultMap id="MtAloneProcessDoResultMap" type="com.deer.wms.produce.manage.model.MtAloneProcessDo">
<result column="process_name" jdbcType="VARCHAR" property="processName"/>
<result column="process_step" jdbcType="INTEGER" property="processStep"/>
<result column="process_id" jdbcType="INTEGER" property="processId"/>
<result column="batch_det_id" jdbcType="INTEGER" property="batchDetId"/>
</resultMap>
<select id="findProcessVoListByProductProcess"
parameterType="com.deer.wms.produce.manage.model.ProductProcessParams"
resultMap="MtAloneProcessVoResultMap">
@ -152,8 +159,8 @@
<select id="findDetectProcessByBatchDet"
parameterType="com.deer.wms.produce.manage.model.ProductProcessBatchDetParams"
resultMap="BaseResultMap">
SELECT process.process_name, process.process_step FROM mt_alone_process process
resultMap="MtAloneProcessDoResultMap">
SELECT batchdetect.process_id, batchdetect.batch_det_id, process.process_name, process.process_step FROM mt_alone_process process
RIGHT JOIN mt_alone_product_batch_detect batchdetect ON batchdetect.process_id = process.id AND batchdetect.company_id = process.company_id
<where>
<if test="batchDetId != null">

View File

@ -16,7 +16,39 @@
<result column="product_det_barcode" jdbcType="VARCHAR" property="productDetBarcode" />
<result column="position" jdbcType="REAL" property="position" />
<result column="defect_id" jdbcType="INTEGER" property="defectId" />
<result column="defect_name" jdbcType="VARCHAR" property="defectName" />
<result column="defect_name0" jdbcType="VARCHAR" property="defectName0" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
</resultMap>
<resultMap id="ProductBatchDetectDetVoResultMap" type="com.deer.wms.produce.manage.model.ProductBatchDetectDetVo">
<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="batch_det_id" jdbcType="INTEGER" property="batchDetId" />
<result column="product_det_barcode" jdbcType="VARCHAR" property="productDetBarcode" />
<result column="position" jdbcType="REAL" property="position" />
<result column="defect_id" jdbcType="INTEGER" property="defectId" />
<result column="defect_name0" jdbcType="VARCHAR" property="defectName0" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
<result column="defect_name" jdbcType="VARCHAR" property="defectName" />
</resultMap>
<select id="findDetectDetVoListByBatchDetAndProcess" parameterType="com.deer.wms.produce.manage.model.ProductBatchDetectParams" resultMap="ProductBatchDetectDetVoResultMap">
SELECT detectdet.id, detectdet.create_time, detectdet.update_time, detectdet.product_det_barcode, detectdet.position, defect.defect_name
FROM mt_alone_product_batch_detect_det detectdet LEFT JOIN mt_alone_fabric_defect defect
ON detectdet.defect_id = defect.id
<where>
<if test="batchDetId != null and processId != null">
AND detectdet.batch_det_id = #{batchDetId} AND detectdet.process_id = #{processId}
</if>
<if test="companyId != null">
AND detectdet.company_id = #{companyId}
</if>
</where> ORDER BY detectdet.position
</select>
</mapper>

View File

@ -22,4 +22,18 @@
<result column="winding_machine_id" jdbcType="INTEGER" property="windingMachineId" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
</resultMap>
<select id="findDetectByBatchDetAndProcess" parameterType="com.deer.wms.produce.manage.model.ProductBatchDetectParams" resultMap="BaseResultMap">
SELECT detect.id, detect.create_time, detect.update_time, detect.grade, detect.len, detect.delivery_len, detect.detection_len,
detect.shrinkage FROM mt_alone_product_batch_detect detect
<where>
<if test="batchDetId != null and processId != null">
AND detect.batch_det_id = #{batchDetId} AND detect.process_id = #{processId}
</if>
<if test="companyId != null">
AND detect.company_id = #{companyId}
</if>
</where>
</select>
</mapper>

View File

@ -0,0 +1,49 @@
package com.deer.wms.produce.manage.model;
/**
* 根据批次明细id查询已检测的工序用于标签显示
* @Author: hy
* @Date: 2020/3/24 15:47
* @Version 1.0
*/
public class MtAloneProcessDo {
private Integer batchDetId;
private Integer processId;
private Integer processStep;
private String processName;
public Integer getBatchDetId() {
return batchDetId;
}
public void setBatchDetId(Integer batchDetId) {
this.batchDetId = batchDetId;
}
public Integer getProcessId() {
return processId;
}
public void setProcessId(Integer processId) {
this.processId = processId;
}
public Integer getProcessStep() {
return processStep;
}
public void setProcessStep(Integer processStep) {
this.processStep = processStep;
}
public String getProcessName() {
return processName;
}
public void setProcessName(String processName) {
this.processName = processName;
}
}

View File

@ -63,8 +63,8 @@ public class ProductBatchDetectDet {
/**
* 瑕疵点名称
*/
@Column(name = "defect_name")
private String defectName;
@Column(name = "defect_name0")
private String defectName0;
@Column(name = "company_id")
private Integer companyId;
@ -254,19 +254,19 @@ public class ProductBatchDetectDet {
/**
* 获取瑕疵点名称
*
* @return defect_name - 瑕疵点名称
* @return defect_name0 - 瑕疵点名称
*/
public String getDefectName() {
return defectName;
public String getDefectName0() {
return defectName0;
}
/**
* 设置瑕疵点名称
*
* @param defectName 瑕疵点名称
* @param defectName0 瑕疵点名称
*/
public void setDefectName(String defectName) {
this.defectName = defectName;
public void setDefectName0(String defectName0) {
this.defectName0 = defectName0;
}
/**

View File

@ -0,0 +1,19 @@
package com.deer.wms.produce.manage.model;
/**
* @Author: hy
* @Date: 2020/3/24 18:35
* @Version 1.0
*/
public class ProductBatchDetectDetVo extends ProductBatchDetectDet {
private String defectName;//瑕疵表mt_alone_fabric_defect中关联查询出的瑕疵名称
public String getDefectName() {
return defectName;
}
public void setDefectName(String defectName) {
this.defectName = defectName;
}
}

View File

@ -6,4 +6,34 @@ import com.deer.wms.project.seed.core.service.QueryParams;
* Created by on 2019/09/09.
*/
public class ProductBatchDetectParams extends QueryParams {
private Integer productBatchDetectId;//检测等级id
private Integer batchDetId;//批次明细id
private Integer processId;//工序id
public Integer getProductBatchDetectId() {
return productBatchDetectId;
}
public void setProductBatchDetectId(Integer productBatchDetectId) {
this.productBatchDetectId = productBatchDetectId;
}
public Integer getBatchDetId() {
return batchDetId;
}
public void setBatchDetId(Integer batchDetId) {
this.batchDetId = batchDetId;
}
public Integer getProcessId() {
return processId;
}
public void setProcessId(Integer processId) {
this.processId = processId;
}
}

View File

@ -0,0 +1,30 @@
package com.deer.wms.produce.manage.model;
import java.util.List;
/**
* @Author: hy
* @Date: 2020/3/24 16:20
* @Version 1.0
*/
public class ProductBatchDetectResult {
private ProductBatchDetect productBatchDetect;
private List<ProductBatchDetectDetVo> productBatchDetectDetVoList;
public ProductBatchDetect getProductBatchDetect() {
return productBatchDetect;
}
public void setProductBatchDetect(ProductBatchDetect productBatchDetect) {
this.productBatchDetect = productBatchDetect;
}
public List<ProductBatchDetectDetVo> getProductBatchDetectDetVoList() {
return productBatchDetectDetVoList;
}
public void setProductBatchDetectDetVoList(List<ProductBatchDetectDetVo> productBatchDetectDetVoList) {
this.productBatchDetectDetVoList = productBatchDetectDetVoList;
}
}

View File

@ -22,7 +22,7 @@ public interface MtAloneProcessService extends Service<MtAloneProcess, Integer>
MtAloneProcessVo findProcessById(MtAloneProcessParams processParams);
List<MtAloneProcess> findDetectProcessByBatchDet(ProductProcessBatchDetParams params);
List<MtAloneProcessDo> findDetectProcessByBatchDet(ProductProcessBatchDetParams params);
//List<Integer> processStepListByProdprocid(ProductProcessParams params);
}

View File

@ -3,6 +3,8 @@ package com.deer.wms.produce.manage.service;
import com.deer.wms.produce.manage.model.ProductBatchDetectDet;
import com.deer.wms.produce.manage.model.ProductBatchDetectDetParams;
import com.deer.wms.produce.manage.model.ProductBatchDetectDetVo;
import com.deer.wms.produce.manage.model.ProductBatchDetectParams;
import com.deer.wms.project.seed.core.service.Service;
import java.util.List;
@ -14,4 +16,5 @@ public interface ProductBatchDetectDetService extends Service<ProductBatchDetect
List<ProductBatchDetectDet> findList(ProductBatchDetectDetParams params) ;
List<ProductBatchDetectDetVo> findDetectDetVoListByBatchDetAndProcess(ProductBatchDetectParams params);
}

View File

@ -5,6 +5,7 @@ import com.deer.wms.produce.manage.model.ProductBatchDetect;
import com.deer.wms.produce.manage.model.ProductBatchDetectInfo;
import com.deer.wms.produce.manage.model.ProductBatchDetectParams;
import com.deer.wms.produce.manage.model.ProductBatchDetectResult;
import com.deer.wms.project.seed.core.service.Service;
import java.util.List;
@ -17,4 +18,6 @@ public interface ProductBatchDetectService extends Service<ProductBatchDetect, I
List<ProductBatchDetect> findList(ProductBatchDetectParams params) ;
void saveDetectRusult(ProductBatchDetectInfo productBatchDetectInfo, CurrentUser currentUser);
ProductBatchDetectResult findDetectResultByBatchDetAndProcess(ProductBatchDetectParams params);
}

View File

@ -118,7 +118,7 @@ public class MtAloneProcessServiceImpl extends AbstractService<MtAloneProcess, I
}
@Override
public List<MtAloneProcess> findDetectProcessByBatchDet(ProductProcessBatchDetParams params) {
public List<MtAloneProcessDo> findDetectProcessByBatchDet(ProductProcessBatchDetParams params) {
return mtAloneProcessMapper.findDetectProcessByBatchDet(params);
}

View File

@ -3,6 +3,8 @@ package com.deer.wms.produce.manage.service.impl;
import com.deer.wms.produce.manage.dao.ProductBatchDetectDetMapper;
import com.deer.wms.produce.manage.model.ProductBatchDetectDet;
import com.deer.wms.produce.manage.model.ProductBatchDetectDetParams;
import com.deer.wms.produce.manage.model.ProductBatchDetectDetVo;
import com.deer.wms.produce.manage.model.ProductBatchDetectParams;
import com.deer.wms.produce.manage.service.ProductBatchDetectDetService;
import com.deer.wms.project.seed.core.service.AbstractService;
@ -26,4 +28,9 @@ public class ProductBatchDetectDetServiceImpl extends AbstractService<ProductBat
public List<ProductBatchDetectDet> findList(ProductBatchDetectDetParams params) {
return productBatchDetectDetMapper.findList(params);
}
@Override
public List<ProductBatchDetectDetVo> findDetectDetVoListByBatchDetAndProcess(ProductBatchDetectParams params) {
return productBatchDetectDetMapper.findDetectDetVoListByBatchDetAndProcess(params);
}
}

View File

@ -67,4 +67,14 @@ public class ProductBatchDetectServiceImpl extends AbstractService<ProductBatchD
}
}
@Override
public ProductBatchDetectResult findDetectResultByBatchDetAndProcess(ProductBatchDetectParams params) {
ProductBatchDetectResult productBatchDetectResult = new ProductBatchDetectResult();
ProductBatchDetect productBatchDetect = productBatchDetectMapper.findDetectByBatchDetAndProcess(params);
List<ProductBatchDetectDetVo> productBatchDetectDetVoList = productBatchDetectDetService.findDetectDetVoListByBatchDetAndProcess(params);
productBatchDetectResult.setProductBatchDetect(productBatchDetect);
productBatchDetectResult.setProductBatchDetectDetVoList(productBatchDetectDetVoList);
return productBatchDetectResult;
}
}

View File

@ -186,4 +186,29 @@ public class MtAloneProcessController {
return ResultGenerator.genSuccessResult();
}
/**
* hy正在用
* 根据批次明细id查询已检测的工序,用于点击查看明细的工序瑕疵后显示的标签名称
* @param params
* @param currentUser
* @return
*/
@ApiOperation(value = "根据批次明细id查询已检测的工序", notes = "根据批次明细id查询已检测的工序")
@ApiImplicitParams({
@ApiImplicitParam(name = "batchDetId", value = "批次明细id", paramType = "query", dataType = "int", required = true)
})
@OperateLog(description = "根据批次明细id查询已检测的工序", type = "查询")
@GetMapping("/detectProcessByBatchDet")
public Result detectProcessByBatchDet(ProductProcessBatchDetParams params, @ApiIgnore @User CurrentUser currentUser) {
if(currentUser==null){
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
}
params.setCompanyId(currentUser.getCompanyId());
PageHelper.startPage(params.getPageNum(), params.getPageSize());
List<MtAloneProcessDo> list = mtAloneProcessService.findDetectProcessByBatchDet(params);
PageInfo pageInfo = new PageInfo(list);
return ResultGenerator.genSuccessResult(pageInfo);
}
}

View File

@ -1,6 +1,7 @@
package com.deer.wms.produce.manage.web;
import com.deer.wms.produce.manage.model.ProductBatchDetectInfo;
import com.deer.wms.produce.manage.model.ProductBatchDetectResult;
import com.deer.wms.project.seed.annotation.OperateLog;
import com.deer.wms.project.seed.constant.SystemManageConstant;
import com.deer.wms.project.seed.core.result.CommonCode;
@ -114,4 +115,33 @@ public class ProductBatchDetectController {
productBatchDetectService.saveDetectRusult(productBatchDetectInfo, currentUser);
return ResultGenerator.genSuccessResult();
}
/**
* hy正在用
* 根据批次明细id和已检测工序id获取检测详细信息检测长度等级以及瑕疵明细
* @param params
* @param currentUser
* @return
*/
@ApiOperation(value = "检测结果和瑕疵明细查询", notes = "检测结果和瑕疵明细查询")
@ApiImplicitParams({
@ApiImplicitParam(name = "batchDetId", value = "批次明细id", paramType = "query", dataType = "int", required = true),
@ApiImplicitParam(name = "processId", value = "工序id", paramType = "query", dataType = "int", required = true)
})
@OperateLog(description = "检测结果和瑕疵明细查询", type = "查询")
@GetMapping("/detectResultByBatchDetAndProcess")
public Result detectResultByBatchDetAndProcess(ProductBatchDetectParams params, @ApiIgnore @User CurrentUser currentUser) {
if(currentUser==null){
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
}
params.setCompanyId(currentUser.getCompanyId());
PageHelper.startPage(params.getPageNum(), params.getPageSize());
ProductBatchDetectResult productBatchDetectResult = productBatchDetectService.findDetectResultByBatchDetAndProcess(params);
return ResultGenerator.genSuccessResult(productBatchDetectResult);
}
}

View File

@ -1,12 +1,11 @@
package com.deer.wms.produce.manage.web;
import com.deer.wms.produce.manage.model.*;
import com.deer.wms.project.seed.annotation.OperateLog;
import com.deer.wms.project.seed.constant.SystemManageConstant;
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.ResultGenerator;
import com.deer.wms.produce.manage.model.ProductBatchDetectDet;
import com.deer.wms.produce.manage.model.ProductBatchDetectDetParams;
import com.deer.wms.produce.manage.service.ProductBatchDetectDetService;
import com.deer.wms.intercept.annotation.User;
import com.deer.wms.intercept.common.data.CurrentUser;
@ -14,6 +13,8 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.annotations.ApiIgnore;

View File

@ -102,28 +102,4 @@ public class ProductProcessBatchDetController {
return ResultGenerator.genSuccessResult(pageInfo);
}
/**
* hy正在用
* 根据批次明细id查询已检测的工序,用于点击查看明细的工序瑕疵后显示的标签名称
* @param params
* @param currentUser
* @return
*/
@ApiOperation(value = "根据批次明细id查询已检测的工序", notes = "根据批次明细id查询已检测的工序")
@ApiImplicitParams({
@ApiImplicitParam(name = "batchDetId", value = "批次明细id", paramType = "query", dataType = "int", required = true)
})
@OperateLog(description = "根据批次明细id查询已检测的工序", type = "查询")
@GetMapping("/detectProcessByBatchDet")
public Result detectProcessByBatchDet(ProductProcessBatchDetParams params, @ApiIgnore @User CurrentUser currentUser) {
if(currentUser==null){
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
}
params.setCompanyId(currentUser.getCompanyId());
PageHelper.startPage(params.getPageNum(), params.getPageSize());
List<MtAloneProcess> list = mtAloneProcessService.findDetectProcessByBatchDet(params);
PageInfo pageInfo = new PageInfo(list);
return ResultGenerator.genSuccessResult(pageInfo);
}
}