根据批次加工单id获取其下的所有工序序号和卷号

This commit is contained in:
hy2250089 2020-03-11 22:18:24 +08:00
parent 21829c4a9c
commit 3295968f76
13 changed files with 118 additions and 0 deletions

View File

@ -15,4 +15,6 @@ public interface MtAloneProcessMapper extends Mapper<MtAloneProcess> {
MtAloneProcessVo selectProcessVoByProcessId(MtAloneProcessParams params);
void setNextProcessBeforeHandleStatus(MtAloneProcess currentProcess);
List<Integer> processStepListByProdprocid(ProductProcessParams params);
}

View File

@ -2,10 +2,13 @@ package com.deer.wms.produce.manage.dao;
import com.deer.wms.produce.manage.model.ProductProcessBatchDet;
import com.deer.wms.produce.manage.model.ProductProcessBatchDetParams;
import com.deer.wms.produce.manage.model.ProductProcessParams;
import com.deer.wms.project.seed.core.mapper.Mapper;
import java.util.List;
public interface ProductProcessBatchDetMapper extends Mapper<ProductProcessBatchDet> {
List<ProductProcessBatchDet> findList(ProductProcessBatchDetParams params);
List<String> volumeStepListByProdprocid(ProductProcessParams params);
}

View File

@ -1,6 +1,7 @@
package com.deer.wms.produce.manage.dao;
import com.deer.wms.produce.manage.model.ProcessStepAndVolumeNum;
import com.deer.wms.produce.manage.model.ProductProcess;
import com.deer.wms.produce.manage.model.ProductProcessParams;
import com.deer.wms.produce.manage.model.ProductProcessVo;

View File

@ -119,4 +119,17 @@
WHERE process_step = (#{processStep}+1) AND product_process_id = #{productProcessId} AND company_id = #{companyId}
</update>
<select id="processStepListByProdprocid" parameterType="com.deer.wms.produce.manage.model.ProductProcessParams" resultType="java.lang.Integer">
SELECT process.process_step FROM mt_alone_process process
<where>
<if test="productProcessId != null">
AND process.product_process_id = #{productProcessId}
</if>
<if test="companyId != null">
AND process.company_id = #{companyId}
</if>
</where>
ORDER BY process.process_step
</select>
</mapper>

View File

@ -25,4 +25,17 @@
<result column="product_annex_code" jdbcType="VARCHAR" property="productAnnexCode" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
</resultMap>
<select id="volumeStepListByProdprocid" parameterType="com.deer.wms.produce.manage.model.ProductProcessParams" resultType="java.lang.String">
SELECT det.volume_num FROM mt_alone_product_process_batch_det det
<where>
<if test="productProcessId != null">
AND det.product_process_id = #{productProcessId}
</if>
<if test="companyId != null">
AND det.company_id = #{companyId}
</if>
</where>
ORDER BY CAST(det.volume_num AS DECIMAL)
</select>
</mapper>

View File

@ -0,0 +1,31 @@
package com.deer.wms.produce.manage.model;
import java.util.List;
/**
* 用于打卷系统根据批次加工单号获取其下的所有工序和卷号
* @Author: hy
* @Date: 2020/3/11 15:10
* @Version 1.0
*/
public class ProcessStepAndVolumeNum {
private List<Integer> processStepList;
private List<String> volumeStepList;
public List<Integer> getProcessStepList() {
return processStepList;
}
public void setProcessStepList(List<Integer> processStepList) {
this.processStepList = processStepList;
}
public List<String> getVolumeStepList() {
return volumeStepList;
}
public void setVolumeStepList(List<String> volumeStepList) {
this.volumeStepList = volumeStepList;
}
}

View File

@ -19,4 +19,6 @@ public interface MtAloneProcessService extends Service<MtAloneProcess, Integer>
void saveProcAndProcMat(ProcessAndProcMat processAndProcMat, CurrentUser currentUser);
void updateProcess(ProcessHo processHo);
List<Integer> processStepListByProdprocid(ProductProcessParams params);
}

View File

@ -3,6 +3,7 @@ package com.deer.wms.produce.manage.service;
import com.deer.wms.produce.manage.model.ProductProcessBatchDet;
import com.deer.wms.produce.manage.model.ProductProcessBatchDetParams;
import com.deer.wms.produce.manage.model.ProductProcessParams;
import com.deer.wms.project.seed.core.service.Service;
import java.util.List;
@ -14,4 +15,5 @@ public interface ProductProcessBatchDetService extends Service<ProductProcessBat
List<ProductProcessBatchDet> findList(ProductProcessBatchDetParams params) ;
List<String> volumeStepListByProdprocid(ProductProcessParams params);
}

View File

@ -22,5 +22,8 @@ public interface ProductProcessService extends Service<ProductProcess, Integer>
void addProduceProcess(ProductProcessHo productProcessHo, CurrentUser currentUser);
ProcessStepAndVolumeNum stepAndNumByProdprocid(ProductProcessParams params);
//void deleteRelevantById(Integer produceProcessId, CurrentUser currentUser);
}

View File

@ -112,6 +112,11 @@ public class MtAloneProcessServiceImpl extends AbstractService<MtAloneProcess, I
}
}
@Override
public List<Integer> processStepListByProdprocid(ProductProcessParams params) {
return mtAloneProcessMapper.processStepListByProdprocid(params);
}
//设置下一道工序的前道工序处理状态
public void setNextProcessBeforeHandleStatus(MtAloneProcess currentProcess) {
mtAloneProcessMapper.setNextProcessBeforeHandleStatus(currentProcess);

View File

@ -3,6 +3,7 @@ package com.deer.wms.produce.manage.service.impl;
import com.deer.wms.produce.manage.dao.ProductProcessBatchDetMapper;
import com.deer.wms.produce.manage.model.ProductProcessBatchDet;
import com.deer.wms.produce.manage.model.ProductProcessBatchDetParams;
import com.deer.wms.produce.manage.model.ProductProcessParams;
import com.deer.wms.produce.manage.service.ProductProcessBatchDetService;
import com.deer.wms.project.seed.core.service.AbstractService;
@ -26,4 +27,9 @@ public class ProductProcessBatchDetServiceImpl extends AbstractService<ProductPr
public List<ProductProcessBatchDet> findList(ProductProcessBatchDetParams params) {
return productProcessBatchDetMapper.findList(params);
}
@Override
public List<String> volumeStepListByProdprocid(ProductProcessParams params) {
return productProcessBatchDetMapper.volumeStepListByProdprocid(params);
}
}

View File

@ -262,10 +262,22 @@ public class ProductProcessServiceImpl extends AbstractService<ProductProcess, I
productProcessBatchDetList.add(productProcessBatchDet);
}
if (productProcessBatchDetList.size() != 0)
productProcessBatchDetService.save(productProcessBatchDetList);
}
@Override
public ProcessStepAndVolumeNum stepAndNumByProdprocid(ProductProcessParams params) {
ProcessStepAndVolumeNum processStepAndVolumeNum = new ProcessStepAndVolumeNum();
List<Integer> processStepList = processService.processStepListByProdprocid(params);
List<String> volumeStepList = productProcessBatchDetService.volumeStepListByProdprocid(params);
processStepAndVolumeNum.setProcessStepList(processStepList);
processStepAndVolumeNum.setVolumeStepList(volumeStepList);
return processStepAndVolumeNum;
}
//@Override
//public void deleteRelevantById(Integer produceProcessId, CurrentUser currentUser) {
// productProcessMapper.deleteByPrimaryKey(produceProcessId);

View File

@ -236,4 +236,29 @@ public class ProductProcessController {
return ResultGenerator.genSuccessResult();
}
/**
* hy正在用打卷系统
* 根据批次加工单id获取其下的卷号和工序
* @param params
* @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("/step/and/num/by/prodprocid")
public Result stepAndNumByProdprocid(ProductProcessParams params, @ApiIgnore @User CurrentUser currentUser) {
//if(currentUser==null){
// return ResultGenerator.genFailResult(CommonCode.SERVICE_ERROR,"未登录错误",null );
//}
params.setCompanyId(1);
ProcessStepAndVolumeNum processStepAndVolumeNum = productProcessService.stepAndNumByProdprocid(params);
return ResultGenerator.genSuccessResult(processStepAndVolumeNum);
}
}