任务明细非空判定,
手动进炉的任务生成炉号
Tento commit je obsažen v:
lgh 2022-11-24 08:41:38 +08:00
rodič bcff5830f4
revize 7e9d8f5e64
2 změnil soubory, kde provedl 33 přidání a 3 odebrání

Zobrazit soubor

@ -139,9 +139,6 @@ public class CurrTaskController extends BaseController {
@ApiOperation(value = "订单加工-创建多个个分步骤加工任务至任务队列")
public R<String> createAutoTask(@Validated @RequestBody AutoCurrTaskParam autoCurrTaskParam) {
List<TaskCreateParam> detParams = autoCurrTaskParam.getTaskCreateParamList();
if (detParams.size() == 0) {
return failed("请添加至少一个标识卡!");
}
Boolean apmsCreateProcessSheet = false;
String sheetNo = null;
int i = 1;
@ -150,6 +147,9 @@ public class CurrTaskController extends BaseController {
AutoExeTask autoExeTask = new AutoExeTask();
for (TaskCreateParam param : detParams
) {
if(param.getDetParams().size()==0){
return failed("请添加至少一个标识卡!");
}
//验证标识卡号正确无误
orderInfoService.verifyTaskInfoByIdenCardNum(param.getDetParams());
//验证炉子编码信息在apms正确无误

Zobrazit soubor

@ -17,6 +17,7 @@ import com.mt.wms.empty.enums.TaskTypeEnum;
import com.mt.wms.empty.params.*;
import com.mt.wms.empty.service.*;
import com.mt.wms.empty.task.RunTaskUtils;
import com.mt.wms.empty.task.StoveCodeUtils;
import com.mt.wms.empty.task.TaskDistanceUtils;
import com.mt.wms.empty.vo.*;
import com.mt.wms.empty.websocket.WebSocketServer;
@ -435,6 +436,8 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
currTask.setUpdaterId(99);
currTask.setUpdateTime(LocalDateTime.now());
currTask.setBeginTime(LocalDateTime.now());
//生产炉号
createStoveCode(currTask);
currTaskServiceBiz.updateById(currTask);
logger.info("修改任务" + currTask.getId() + "状态为加工中成功");
}
@ -778,4 +781,31 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
return true;
}
}
/**
* 生成炉号
* 多步骤任务除了第一步为清洗炉外,每步都生成炉号
* 单步骤任务都生成炉号
*/
private void createStoveCode(CurrTask currTask) {
//单步骤任务,直接生成炉号
if (currTask.getIsAuto() == 0) {
String stoveCode = StoveCodeUtils.getStoveCode(currTask.getTargetPosition(), currTask.getPlcValue());
currTask.setStoveCode(stoveCode);
currTaskServiceBiz.updateById(currTask);
return;
}
//多步骤任务,只有BMA,BMB步骤生成炉号
else {
//获取加工炉
KilnInfo kilnInfo = kilnInfoServiceBiz.getById(currTask.getKilnId());
//只有BMA,BMB生成炉号
if (kilnInfo.getType() == 1 || kilnInfo.getType() == 3) {
String stoveCode = StoveCodeUtils.getStoveCode(currTask.getTargetPosition(), currTask.getPlcValue());
currTask.setStoveCode(stoveCode);
currTaskServiceBiz.updateById(currTask);
} else {
logger.info(currTask.getId() + "任务为多步骤任务但该步骤不生成洗炉炉号.");
}
}
}
}