打卷系统操作页面批次加工单、工序、批次明细信息查询接口

This commit is contained in:
hy2250089 2020-03-16 19:22:38 +08:00
parent f520e678f1
commit 50f388d9fd
23 changed files with 304 additions and 13 deletions

View File

@ -16,5 +16,7 @@ public interface MtAloneProcessMapper extends Mapper<MtAloneProcess> {
void setNextProcessBeforeHandleStatus(MtAloneProcess currentProcess);
MtAloneProcessVo findProcessById(MtAloneProcessParams processParams);
//List<Integer> processStepListByProdprocid(ProductProcessParams params);
}

View File

@ -13,4 +13,6 @@ public interface ProductProcessBatchDetMapper extends Mapper<ProductProcessBatch
//List<String> volumeStepListByProdprocid(ProductProcessParams params);
List<ProductProcessBatchDet> findListByProductProcess(ProductProcessParams params);
ProductProcessBatchDet findBatchDetById(ProductProcessBatchDetParams batchDetParams);
}

View File

@ -11,4 +11,5 @@ import java.util.List;
public interface ProductProcessMapper extends Mapper<ProductProcess> {
List<ProductProcessVo> findList(ProductProcessParams params);
ProductProcessVo findProductProcessById(ProductProcessParams productProcessParams);
}

View File

@ -132,4 +132,22 @@
ORDER BY process.process_step
</select>
<select id="findProcessById"
parameterType="com.deer.wms.produce.manage.model.MtAloneProcessParams"
resultMap="MtAloneProcessVoResultMap">
SELECT process.*, supplier.supplier_name, accessory.name FROM mt_alone_process process
LEFT JOIN supplier_manage supplier ON process.supplier_id = supplier.supplier_id AND process.company_id =
supplier.company_id
LEFT JOIN mt_alone_accessory accessory ON process.product_annex_code = accessory.annex_code AND
process.company_id = accessory.company_id
<where>
<if test="processId != null">
AND process.id = #{processId}
</if>
<if test="companyId != null">
AND process.company_id = #{companyId}
</if>
</where>
</select>
</mapper>

View File

@ -12,6 +12,7 @@
<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" />

View File

@ -12,6 +12,7 @@
<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="batch_det_code" jdbcType="VARCHAR" property="batchDetCode" />
<result column="product_det_barcode" jdbcType="VARCHAR" property="productDetBarcode" />
<result column="grade" jdbcType="INTEGER" property="grade" />

View File

@ -55,5 +55,20 @@
ORDER BY CAST(det.volume_num AS DECIMAL)
</select>
<select id="findBatchDetById" parameterType="com.deer.wms.produce.manage.model.ProductProcessBatchDetParams" resultMap="BaseResultMap">
SELECT det.id, det.create_time, det.batch_code, det.delivery_code,
det.volume_num, det.batch_det_code, det.len, det.delivery_len,
det.detection_len, det.shrinkage, det.dyelot_num, det.dyelot_order
FROM mt_alone_product_process_batch_det det
<where>
<if test="batchDetId != null">
AND det.id = #{batchDetId}
</if>
<if test="companyId != null">
AND det.company_id = #{companyId}
</if>
</where>
</select>
</mapper>

View File

@ -119,5 +119,21 @@
</where> GROUP BY prodproc.id ORDER BY prodproc.create_time DESC, prodproc.update_time DESC
</select>
<select id="findProductProcessById" parameterType="com.deer.wms.produce.manage.model.ProductProcessParams" resultMap="ProductProcessVoResultMap">
SELECT prodproc.*, prodbom.product_process_name, product.product_name, SUM(process.handle_status) AS finishedProcess, COUNT(process.id) AS countProcess,
(SUM(process.handle_status)*100/COUNT(process.id)) AS schedule 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
LEFT JOIN mt_alone_process process ON prodproc.id = process.product_process_id AND prodproc.company_id = process.company_id
<where>
<if test="productProcessId != null">
AND prodproc.id = #{productProcessId}
</if>
<if test="companyId != null">
AND prodproc.company_id = #{companyId}
</if>
</where>
</select>
</mapper>

View File

@ -9,11 +9,20 @@ import java.util.List;
* @Version 1.0
*/
public class ProcessAndDet {
private Integer productProcessId;//批次加工单id
private List<MtAloneProcessVo> processVoList;//工序扩展信息
private List<ProductProcessBatchDet> productProcessBatchDetList;//明细信息
public Integer getProductProcessId() {
return productProcessId;
}
public void setProductProcessId(Integer productProcessId) {
this.productProcessId = productProcessId;
}
public List<MtAloneProcessVo> getProcessVoList() {
return processVoList;
}

View File

@ -43,6 +43,14 @@ public class ProductBatchDetect {
@Column(name = "process_id")
private Integer processId;
/**
* 批次明细id关联表mt_alone_product_batch_detect
*/
@Column(name = "batch_det_id")
private Integer batchDetId;
/**
* 卷码code作为扫描编码关联表mt_alone_product_process_batch_det
*/
@ -276,4 +284,22 @@ public class ProductBatchDetect {
public void setCompanyId(Integer companyId) {
this.companyId = companyId;
}
/**
* 获取批次明细id
*
* @return batchDetId - 批次明细id关联表mt_alone_product_batch_detect
*/
public Integer getBatchDetId() {
return batchDetId;
}
/**
* 设置批次明细id
*
* @param batchDetId - 批次明细id关联表mt_alone_product_batch_detect
*/
public void setBatchDetId(Integer batchDetId) {
this.batchDetId = batchDetId;
}
}

View File

@ -69,6 +69,12 @@ public class ProductBatchDetectDet {
@Column(name = "company_id")
private Integer companyId;
/**
* 批次明细id关联表mt_alone_product_batch_detect
*/
@Column(name = "batch_det_id")
private Integer batchDetId;
/**
* @return id
*/
@ -276,4 +282,22 @@ public class ProductBatchDetectDet {
public void setCompanyId(Integer companyId) {
this.companyId = companyId;
}
/**
* 获取批次明细id
*
* @return batchDetId - 批次明细id关联表mt_alone_product_batch_detect
*/
public Integer getBatchDetId() {
return batchDetId;
}
/**
* 设置批次明细id
*
* @param batchDetId - 批次明细id关联表mt_alone_product_batch_detect
*/
public void setBatchDetId(Integer batchDetId) {
this.batchDetId = batchDetId;
}
}

View File

@ -0,0 +1,48 @@
package com.deer.wms.produce.manage.model;
/**
* @Author: hy
* @Date: 2020/3/16 13:59
* @Version 1.0
*/
public class ProductProcessBatchDetCondition {
private Integer productProcessId;
private Integer processId;
private Integer batchDetId;
private Integer companyId;
public Integer getProductProcessId() {
return productProcessId;
}
public void setProductProcessId(Integer productProcessId) {
this.productProcessId = productProcessId;
}
public Integer getProcessId() {
return processId;
}
public void setProcessId(Integer processId) {
this.processId = processId;
}
public Integer getBatchDetId() {
return batchDetId;
}
public void setBatchDetId(Integer batchDetId) {
this.batchDetId = batchDetId;
}
public Integer getCompanyId() {
return companyId;
}
public void setCompanyId(Integer companyId) {
this.companyId = companyId;
}
}

View File

@ -0,0 +1,39 @@
package com.deer.wms.produce.manage.model;
/**
* 某个批次加工单某个工序某卷明细的详细信息用于打卷系统打卷操作页面展示
* @Author: hy
* @Date: 2020/3/16 11:12
* @Version 1.0
*/
public class ProductProcessBatchDetInfo {
private ProductProcessVo productProcessVo;
private MtAloneProcessVo processVo;
private ProductProcessBatchDet productProcessBatchDet;
public ProductProcessVo getProductProcessVo() {
return productProcessVo;
}
public void setProductProcessVo(ProductProcessVo productProcessVo) {
this.productProcessVo = productProcessVo;
}
public MtAloneProcessVo getProcessVo() {
return processVo;
}
public void setProcessVo(MtAloneProcessVo processVo) {
this.processVo = processVo;
}
public ProductProcessBatchDet getProductProcessBatchDet() {
return productProcessBatchDet;
}
public void setProductProcessBatchDet(ProductProcessBatchDet productProcessBatchDet) {
this.productProcessBatchDet = productProcessBatchDet;
}
}

View File

@ -6,4 +6,13 @@ import com.deer.wms.project.seed.core.service.QueryParams;
* Created by on 2019/09/09.
*/
public class ProductProcessBatchDetParams extends QueryParams {
private Integer batchDetId;
public Integer getBatchDetId() {
return batchDetId;
}
public void setBatchDetId(Integer batchDetId) {
this.batchDetId = batchDetId;
}
}

View File

@ -20,5 +20,7 @@ public interface MtAloneProcessService extends Service<MtAloneProcess, Integer>
void updateProcess(ProcessHo processHo);
MtAloneProcessVo findProcessById(MtAloneProcessParams processParams);
//List<Integer> processStepListByProdprocid(ProductProcessParams params);
}

View File

@ -18,4 +18,6 @@ public interface ProductProcessBatchDetService extends Service<ProductProcessBat
//List<String> volumeStepListByProdprocid(ProductProcessParams params);
List<ProductProcessBatchDet> findListByProductProcess(ProductProcessParams params);
ProductProcessBatchDet findBatchDetById(ProductProcessBatchDetParams batchDetParams);
}

View File

@ -22,6 +22,8 @@ public interface ProductProcessService extends Service<ProductProcess, Integer>
void addProduceProcess(ProductProcessHo productProcessHo, CurrentUser currentUser);
ProductProcessVo findProductProcessById(ProductProcessParams productProcessParams);
//ProcessAndDet stepAndNumByProdprocid(ProductProcessParams params);

View File

@ -112,6 +112,11 @@ public class MtAloneProcessServiceImpl extends AbstractService<MtAloneProcess, I
}
}
@Override
public MtAloneProcessVo findProcessById(MtAloneProcessParams processParams) {
return mtAloneProcessMapper.findProcessById(processParams);
}
//@Override
//public List<Integer> processStepListByProdprocid(ProductProcessParams params) {
// return mtAloneProcessMapper.processStepListByProdprocid(params);

View File

@ -37,4 +37,9 @@ public class ProductProcessBatchDetServiceImpl extends AbstractService<ProductPr
public List<ProductProcessBatchDet> findListByProductProcess(ProductProcessParams params) {
return productProcessBatchDetMapper.findListByProductProcess(params);
}
@Override
public ProductProcessBatchDet findBatchDetById(ProductProcessBatchDetParams batchDetParams) {
return productProcessBatchDetMapper.findBatchDetById(batchDetParams);
}
}

View File

@ -265,6 +265,11 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
productProcessBatchDetService.save(productProcessBatchDetList);
}
@Override
public ProductProcessVo findProductProcessById(ProductProcessParams productProcessParams) {
return productProcessMapper.findProductProcessById(productProcessParams);
}
//@Override
//public ProcessAndDet stepAndNumByProdprocid(ProductProcessParams params) {
// ProcessAndDet processAndDet = new ProcessAndDet();

View File

@ -89,4 +89,16 @@ public class ProductBatchDetectController {
return ResultGenerator.genSuccessResult(pageInfo);
}
//@OperateLog(description = "保存检测结果", type = "增加")
//@ApiOperation(value = "保存检测结果", notes = "保存检测结果")
//@PostMapping("/saveDetectRusult")
//public Result saveDetectRusult(@RequestBody ProductBatchDetect productBatchDetect, @ApiIgnore @User CurrentUser currentUser) {
// if(currentUser==null){
// return ResultGenerator.genFailResult( CommonCode.SERVICE_ERROR,"未登录错误",null );
// }
//
// productBatchDetectService.saveDetectRusult(productBatchDetect);
// return ResultGenerator.genSuccessResult();
//}
}

View File

@ -15,6 +15,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;
@ -80,6 +82,12 @@ public class ProductProcessBatchDetController {
* @param currentUser
* @return
*/
@ApiOperation(value = "批次生产加工单下的明细查询", notes = "批次生产加工单下的明细查询")
@ApiImplicitParams({
@ApiImplicitParam(name = "productProcessId", value = "批次生产加工单id", paramType = "query", dataType = "int", required = true),
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
})
@OperateLog(description = "批次生产加工单下的明细查询", type = "查询")
@GetMapping("/listByProductProcess")
public Result listByProductProcess(ProductProcessParams params, @ApiIgnore @User CurrentUser currentUser) {
if(currentUser==null){

View File

@ -107,8 +107,7 @@ public class ProductProcessController {
@ApiOperation(value = "批次生产加工单分页查询", notes = "批次生产加工单分页查询")
@ApiImplicitParams({
@ApiImplicitParam(name = "createDate", value = "创建时间", paramType = "query", dataType = "String", required = false),
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String", required = false),
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String", required = false)
})
@OperateLog(description = "批次生产加工单分页查询", type = "查询")
@ -157,8 +156,7 @@ public class ProductProcessController {
*/
@ApiOperation(value = "批次生产加工单详情查询", notes = "批次生产加工单详情查询")
@ApiImplicitParams({
@ApiImplicitParam(name = "productProcessId", value = "批次生产加工单id", paramType = "query", dataType = "int", required = true),
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
@ApiImplicitParam(name = "productProcessId", value = "批次生产加工单id", paramType = "query", dataType = "int", required = true)
})
@OperateLog(description = "批次生产加工单详情查询", type = "查询")
@GetMapping("/query/product/process/detail")
@ -182,8 +180,7 @@ public class ProductProcessController {
*/
@ApiOperation(value = "初始化批次生产加工单信息", notes = "初始化批次生产加工单信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "productBomId", value = "产品bom的id", paramType = "query", dataType = "int", required = true),
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
@ApiImplicitParam(name = "productBomId", value = "产品bom的id", paramType = "query", dataType = "int", required = true)
})
@OperateLog(description = "初始化批次生产加工单信息", type = "查询")
@ -248,12 +245,11 @@ public class ProductProcessController {
* @param currentUser
* @return
*/
@ApiOperation(value = "批次生产加工单下的工序和明细查询", notes = "批次生产加工单下的工序和卷号查询")
@ApiOperation(value = "批次生产加工单下的工序和批次明细查询", notes = "批次生产加工单下的工序和批次明细查询")
@ApiImplicitParams({
@ApiImplicitParam(name = "productProcessId", value = "批次生产加工单id", paramType = "query", dataType = "int", required = true),
@ApiImplicitParam(name = "companyId", value = "公司id", paramType = "query", dataType = "int", required = false)
@ApiImplicitParam(name = "productProcessId", value = "批次生产加工单id", paramType = "query", dataType = "int", required = true)
})
@OperateLog(description = "批次生产加工单下的工序和卷号查询", type = "查询")
@OperateLog(description = "批次生产加工单下的工序和批次明细查询", type = "查询")
@GetMapping("/processAndDetByProductProcess")
public Result processAndDetByProductProcess(ProductProcessParams params, @ApiIgnore @User CurrentUser currentUser) {
if(currentUser==null){
@ -264,11 +260,54 @@ public class ProductProcessController {
ProcessAndDet processAndDet = new ProcessAndDet();
//获取工序
List<MtAloneProcessVo> processVoList = processService.findProcessVoListByProductProcess(params);
//获取明细
//获取批次明细
List<ProductProcessBatchDet> productProcessBatchDetList = productProcessBatchDetService.findListByProductProcess(params);
processAndDet.setProcessVoList(processVoList);
processAndDet.setProductProcessBatchDetList(productProcessBatchDetList);
processAndDet.setProductProcessId(params.getProductProcessId());//批次加工单id赋值
processAndDet.setProcessVoList(processVoList);//所有工序赋值
processAndDet.setProductProcessBatchDetList(productProcessBatchDetList);//所有批次明细赋值
return ResultGenerator.genSuccessResult(processAndDet);
}
/**
* hy正在用打卷系统
* 根据批次加工单id工序id明细id获取批次加工单工序明细信息用于打卷页面信息展示
* @param condition
* @param currentUser
* @return
*/
@ApiOperation(value = "根据批次加工单id、工序id、批次明细id获取批次加工单、工序、批次明细信息", notes = "根据批次加工单id、工序id、批次明细id获取批次加工单、工序、批次明细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "productProcessId", value = "批次生产加工单id", paramType = "query", dataType = "int", required = true),
@ApiImplicitParam(name = "processId", value = "工序id", paramType = "query", dataType = "int", required = true),
@ApiImplicitParam(name = "batchDetId", value = "批次明细id", paramType = "query", dataType = "int", required = true)
})
@OperateLog(description = "根据批次加工单id、工序id、批次明细id获取批次加工单、工序、批次明细信息", type = "查询")
@GetMapping("/productProcessBatchDetInfoByProductProcess")
public Result productProcessBatchDetInfoByProductProcess(ProductProcessBatchDetCondition condition, @ApiIgnore @User CurrentUser currentUser) {
if(currentUser==null){
return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
}
condition.setCompanyId(currentUser.getCompanyId());
ProductProcessBatchDetInfo productProcessBatchDetInfo = new ProductProcessBatchDetInfo();
//获取批次加工单
ProductProcessParams productProcessParams = new ProductProcessParams();
BeanUtils.copyProperties(condition, productProcessParams);
ProductProcessVo productProcessVo = productProcessService.findProductProcessById(productProcessParams);
productProcessBatchDetInfo.setProductProcessVo(productProcessVo);
//获取工序
MtAloneProcessParams processParams = new MtAloneProcessParams();
BeanUtils.copyProperties(condition, processParams);
MtAloneProcessVo processVo = processService.findProcessById(processParams);
productProcessBatchDetInfo.setProcessVo(processVo);
//获取批次明细
ProductProcessBatchDetParams batchDetParams = new ProductProcessBatchDetParams();
BeanUtils.copyProperties(condition, batchDetParams);
ProductProcessBatchDet batchDet = productProcessBatchDetService.findBatchDetById(batchDetParams);
productProcessBatchDetInfo.setProductProcessBatchDet(batchDet);
return ResultGenerator.genSuccessResult(productProcessBatchDetInfo);
}
}