|
|
|
@ -3,6 +3,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesTemplateService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProduceSnPrintService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesRedisLockUtil;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesProduceSnPrintModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesPrintQueue;
|
|
|
|
@ -35,6 +36,8 @@ import java.util.Objects;
|
|
|
|
|
public class MesProduceSnPrintController {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesRedisLockUtil mesRedisLockUtil;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesProduceSnPrintService mesProduceSnPrintService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@ -136,14 +139,20 @@ public class MesProduceSnPrintController {
|
|
|
|
|
@PostMapping("/mes-print-queue/find")
|
|
|
|
|
@ApiOperation(value = "打印队列查询")
|
|
|
|
|
public ResultBean findMesWorkOrderPrintQueue(MesPrintQueue printQueue) {
|
|
|
|
|
boolean lockFlag = false;
|
|
|
|
|
String moduleKey="";
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(printQueue.getPrintQueueType(), "打印类型不能为空");
|
|
|
|
|
|
|
|
|
|
MesRedisLockUtil mesRedisLockUtil = new MesRedisLockUtil();
|
|
|
|
|
String workCenterCodeQuery = printQueue.getWorkCenterCodeQuery();
|
|
|
|
|
String partProdGroupCodeQuery = printQueue.getPartProdGroupCodeQuery();
|
|
|
|
|
if (printQueue.getPrintQueueType() == MesExtEnumUtil.PRINT_QUEUE_TYPE.WORK_ORDER_ASSEMBLY.getValue()) {
|
|
|
|
|
ValidatorBean.checkNotNull(printQueue.getWorkCenterCodeQuery(), "产线代码不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(printQueue.getPartProdGroupCodeQuery(), "零件生产组代码不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(workCenterCodeQuery, "产线代码不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(partProdGroupCodeQuery, "零件生产组代码不能为空");
|
|
|
|
|
}
|
|
|
|
|
moduleKey = workCenterCodeQuery+":"+partProdGroupCodeQuery;
|
|
|
|
|
lockFlag = mesRedisLockUtil.redisLock(moduleKey);
|
|
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(printQueue.getPrintQueueType(), "打印队列类型不能为空");
|
|
|
|
|
ValidatorBean.checkNotNull(printQueue.getOrganizeCode(), "工厂代码不能为空");
|
|
|
|
@ -156,6 +165,10 @@ public class MesProduceSnPrintController {
|
|
|
|
|
return ResultBean.fail(imppException);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}finally {
|
|
|
|
|
if (lockFlag){
|
|
|
|
|
mesRedisLockUtil.redisUnLock(lockFlag,moduleKey);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|