Compare commits
3 Commits
c324aa524f
...
936dc5b71a
Author | SHA1 | Date | |
---|---|---|---|
|
936dc5b71a | ||
|
722ecf61c0 | ||
|
b12bd2294f |
@ -100,6 +100,19 @@ public abstract class BaseSupport {
|
||||
protected <T> R<T> successful(String msg, T data) {
|
||||
return R.ok(msg, data);
|
||||
}
|
||||
/**
|
||||
* <p>
|
||||
* 请求成功
|
||||
* </p>
|
||||
* @param code 正确码
|
||||
* @param msg 提示内容
|
||||
* @param data 数据内容
|
||||
* @param <T> 对象泛型
|
||||
* @return
|
||||
*/
|
||||
protected <T> R<T> successful(int code,String msg, T data) {
|
||||
return R.ok(code,msg, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -99,5 +99,8 @@ public class R<T> implements Serializable {
|
||||
public static <T> R<T> ok(String msg, T data) {
|
||||
return new R<T>().msg(msg).data(data);
|
||||
}
|
||||
public static <T> R<T> ok(int code,String msg, T data) {
|
||||
return new R<T>().code(code).msg(msg).data(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -139,6 +139,10 @@ public class CurrTaskController extends BaseController {
|
||||
@ApiOperation(value = "订单加工-创建多个个分步骤加工任务至任务队列")
|
||||
public R<String> createAutoTask(@Validated @RequestBody AutoCurrTaskParam autoCurrTaskParam){
|
||||
List<TaskCreateParam> detParams = autoCurrTaskParam.getTaskCreateParamList();
|
||||
Boolean apmsCreateProcessSheet=false;
|
||||
String sheetNo=null;
|
||||
int i=1;
|
||||
R<ApmsCreateProcessSheetVo> processSheet=null;
|
||||
//自动任务循环添加多条currTask
|
||||
AutoExeTask autoExeTask=new AutoExeTask();
|
||||
for (TaskCreateParam param:detParams
|
||||
@ -168,27 +172,30 @@ public class CurrTaskController extends BaseController {
|
||||
{
|
||||
return failed("创建失败,APMS中验证炉号" + kilnCode + "失败!");
|
||||
}
|
||||
if (i==1){
|
||||
//通知apms创建一个生产单
|
||||
ApmsCreateProcessSheet apmsCreateSheet = new ApmsCreateProcessSheet();
|
||||
apmsCreateSheet.setWorkShopCode("BM");
|
||||
apmsCreateSheet.setStartTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
apmsCreateSheet.setTechCode(param.getCraftCode());
|
||||
//fixme 暂时没有正式user,使用测试账户
|
||||
apmsCreateSheet.setStartUser("QJJP03");
|
||||
ArrayList<CreateItem> createItems = new ArrayList<>();
|
||||
param.getDetParams().forEach(e -> {
|
||||
CreateItem createItem = new CreateItem();
|
||||
createItem.setItemCode(e.getIdenCardNum());
|
||||
createItem.setQuantity(e.getQuantity().intValue());
|
||||
createItem.setWeight(e.getWeight().doubleValue());
|
||||
createItems.add(createItem);
|
||||
});
|
||||
apmsCreateSheet.setStoveCode(kilnCode);
|
||||
apmsCreateSheet.setItems(createItems);
|
||||
processSheet = apmsControl.createProcessSheet(apmsCreateSheet);
|
||||
apmsCreateProcessSheet=processSheet.getData().getSuccess();
|
||||
sheetNo=processSheet.getData().getSheetNo();
|
||||
}
|
||||
|
||||
//通知apms创建一个生产单
|
||||
ApmsCreateProcessSheet apmsCreateSheet = new ApmsCreateProcessSheet();
|
||||
apmsCreateSheet.setWorkShopCode("BM");
|
||||
apmsCreateSheet.setStartTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
apmsCreateSheet.setTechCode(param.getCraftCode());
|
||||
//fixme 暂时没有正式user,使用测试账户
|
||||
apmsCreateSheet.setStartUser("QJJP03");
|
||||
ArrayList<CreateItem> createItems = new ArrayList<>();
|
||||
param.getDetParams().forEach(e -> {
|
||||
CreateItem createItem = new CreateItem();
|
||||
createItem.setItemCode(e.getIdenCardNum());
|
||||
createItem.setQuantity(e.getQuantity().intValue());
|
||||
createItem.setWeight(e.getWeight().doubleValue());
|
||||
createItems.add(createItem);
|
||||
});
|
||||
apmsCreateSheet.setStoveCode(kilnCode);
|
||||
apmsCreateSheet.setItems(createItems);
|
||||
R<ApmsCreateProcessSheetVo> processSheet = apmsControl.createProcessSheet(apmsCreateSheet);
|
||||
|
||||
if (processSheet.getData().getSuccess())
|
||||
if (apmsCreateProcessSheet)
|
||||
{
|
||||
//apms创建成功后写入数据库
|
||||
R<IdVo> mainTask = currTaskService.createProcessTask(param);
|
||||
@ -227,7 +234,6 @@ public class CurrTaskController extends BaseController {
|
||||
setUpdateCommonField(autoExeTask);
|
||||
autoExeTaskServiceBiz.updateById(autoExeTask);
|
||||
}
|
||||
String sheetNo = processSheet.getData().getSheetNo();
|
||||
//将返回的生产单号写入到主任务中。
|
||||
CurrTask currTaskById = currTaskService.getCurrTaskById(mainTask.getData().getId());
|
||||
currTaskById.setSheetNo(sheetNo);
|
||||
@ -240,6 +246,7 @@ public class CurrTaskController extends BaseController {
|
||||
{
|
||||
return failed("创建失败,APMS报错:" + processSheet.getData().getMsg());
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -264,8 +271,8 @@ public class CurrTaskController extends BaseController {
|
||||
|
||||
@PostMapping(value = "deleteBySheetNo")
|
||||
@ApiOperation(value = "人工通过生产单编号删除未正式开始的生产单(通知APMS)")
|
||||
public R<String> deleteBySheetNo(@Validated @RequestBody String sheetNo) {
|
||||
return currTaskService.deleteBySheetNo(sheetNo);
|
||||
public R<String> deleteBySheetNo(@Validated @RequestBody CurrTaskQueryParam param) {
|
||||
return currTaskService.deleteBySheetNo(param.getSheetNo());
|
||||
}
|
||||
@PostMapping(value = "runTask")
|
||||
@ApiOperation(value = "执行任务")
|
||||
|
@ -23,4 +23,7 @@ public class CurrTaskQueryParam extends BasePageParam {
|
||||
@ApiModelProperty(value = "车辆id")
|
||||
private String vehicleId;
|
||||
|
||||
private String sheetNo;
|
||||
|
||||
|
||||
}
|
||||
|
@ -76,6 +76,8 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
||||
RunTaskUtils runTaskUtils;
|
||||
@Autowired
|
||||
AutoExeTaskServiceBiz autoExeTaskServiceBiz;
|
||||
@Autowired
|
||||
KilnInfoServiceBiz kilnInfoServiceBiz;
|
||||
|
||||
@Override
|
||||
public CurrTaskVo getCurrTask(IdParam idParam) {
|
||||
@ -101,9 +103,11 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
||||
CurrTask currTask = new CurrTask();
|
||||
BeanUtils.copyProperties(param, currTask);
|
||||
currTask.setTaskType(TaskTypeEnum.WTK.getValue());
|
||||
KilnInfo kilnInfo = kilnInfoServiceBiz.getById(currTask.getKilnId());
|
||||
|
||||
//根据工艺号查询工艺id以及工艺plc值
|
||||
// TODO: 2022/7/7 工艺号临时
|
||||
CraftInfo one = craftInfoServiceBiz.getOne(new QueryWrapper<CraftInfo>().eq(CraftInfo.CRAFT_CODE, 1));
|
||||
CraftInfo one = craftInfoServiceBiz.getOne(new QueryWrapper<CraftInfo>().eq(CraftInfo.CRAFT_CODE, param.getCraftCode()));
|
||||
currTask.setTargetPosition(kilnInfo.getCode());
|
||||
currTask.setCraftCodeId(one.getId());
|
||||
currTask.setPlcValue(one.getPlcValue());
|
||||
currTask.setInterCode(IDGenerator.gen("RW", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "TASK_CODE"));
|
||||
@ -154,8 +158,15 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
||||
R<ApmsEndProcessVo> apmsStartProcessR = apmsControl.deleteBySheetNo(sheetNo);
|
||||
if (apmsStartProcessR.getData().getSuccess())
|
||||
{
|
||||
currTaskServiceBiz.removeById(byId.getId());
|
||||
currTaskDetService.deleteByCurrTaskId(byId.getId());
|
||||
Long currTaskId = byId.getId();
|
||||
currTaskServiceBiz.removeById(currTaskId);
|
||||
currTaskDetService.deleteByCurrTaskId(currTaskId);
|
||||
if (byId.getIsAuto()==1){
|
||||
List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>().eq(CurrTask.AUTO_EXE_TASK_ID, byId.getAutoExeTaskId()));
|
||||
if (currTaskList.size()==0){
|
||||
autoExeTaskServiceBiz.removeById(byId.getAutoExeTaskId());
|
||||
}
|
||||
}
|
||||
return successful("APMS生产单删除成功。");
|
||||
}
|
||||
else
|
||||
@ -163,6 +174,9 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
||||
return failed(apmsStartProcessR.getData().getMsg());
|
||||
}
|
||||
}
|
||||
if (byId.getStatus()==2){
|
||||
return failed("无法删除,任务已加工完成。");
|
||||
}
|
||||
return failed("无法删除,任务正在执行中。");
|
||||
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
return failed(1, "操作失败,接收到重复订单信息:" + apmsPostOrderParam.getOrderNo());
|
||||
}
|
||||
orderInfoService.save(orderInfo);
|
||||
return successful("Wms接收Apms订单成功。", "");
|
||||
return successful(0,"Wms接收Apms订单成功。", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -165,8 +165,8 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
PageVo<OrderInfoTaskDetVo> currOrderCurrTask = currTaskDetService.getCurrOrderCurrTask(param);
|
||||
Assert.notNull("该订单暂无详细任务记录。", currOrderCurrTask.getRecords());
|
||||
//获取车辆信息
|
||||
R<List<VehicleVo>> vehicle = vehicleService.list(new VehicleQueryParam());
|
||||
Map<Long, List<VehicleVo>> collect = vehicle.getData().stream().collect(Collectors.groupingBy(VehicleVo::getId));
|
||||
//R<List<VehicleVo>> vehicle = vehicleService.list(new VehicleQueryParam());
|
||||
//Map<Long, List<VehicleVo>> collect = vehicle.getData().stream().collect(Collectors.groupingBy(VehicleVo::getId));
|
||||
//获取窑炉信息
|
||||
R<List<KilnInfoVo>> kiln = kilnInfoService.list(new KilnInfoQueryParam());
|
||||
Map<Long, List<KilnInfoVo>> collect2 = kiln.getData().stream().collect(Collectors.groupingBy(KilnInfoVo::getId));
|
||||
@ -181,6 +181,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
orderInfo.setKilnId(currTask.getKilnId());
|
||||
orderInfo.setStartPosition(currTask.getStartPosition());
|
||||
orderInfo.setTargetPosition(currTask.getTargetPosition());
|
||||
orderInfo.setTaskCode(currTask.getTaskCode());
|
||||
//orderInfo.setVehicleId(currTask.getVehicleId());
|
||||
//获取窑炉和车辆的名称信息
|
||||
if (orderInfo.getKilnId() != null)
|
||||
@ -265,7 +266,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
byId.setUpdateTime(LocalDateTime.now());
|
||||
byId.setOrderVoid(0);
|
||||
orderInfoService.updateById(byId);
|
||||
return successful("操作成功,订单状态置为作废。", "");
|
||||
return successful(0,"操作成功,订单状态置为作废。", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -310,7 +311,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
one.setMetallography(apmsCompleteOrder.getMetallographic());
|
||||
apmsCheckResultServiceBiz.save(one);
|
||||
//订单不应该在该地方完成,额外提供一个完成接口供人工完成,不通知apms
|
||||
return successful("操作成功,接收检验结果完成。", "");
|
||||
return successful(0,"操作成功,接收检验结果完成。", "");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -319,7 +320,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
one1.setMetallography(apmsCompleteOrder.getMetallographic());
|
||||
one1.setUpdateTime(LocalDateTime.now());
|
||||
apmsCheckResultServiceBiz.updateById(one1);
|
||||
return successful("操作成功,更新检验结果完成。", "");
|
||||
return successful(0,"操作成功,更新检验结果完成。", "");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
vehicle.setStatus(0);
|
||||
vehicleInfoServiceBiz.updateById(vehicle);
|
||||
// TODO: 2022/7/6 上报apms加工单开始
|
||||
//apmsStartProcess(currTask);
|
||||
apmsStartProcess(currTask);
|
||||
|
||||
}else {
|
||||
runTask.setStatus(3);
|
||||
@ -217,7 +217,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
//执行成功,托盘进炉
|
||||
if (status==1){
|
||||
// TODO: 2022/7/7
|
||||
//asynStartRecordConsume(currTaskId,currTask.getKilnId());
|
||||
asynStartRecordConsume(currTaskId,currTask.getKilnId());
|
||||
logger.info("===执行任务:"+currTaskId+" ,车辆搬运任务,车辆:"+vehicleId+" ,起点:"+startPoint+" ,终点:"+endPoint+"任务执行成功===");
|
||||
//更新调度表状态为完成
|
||||
runTask.setUpdateTime(LocalDateTime.now());
|
||||
@ -244,7 +244,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
vehicle.setStatus(0);
|
||||
vehicleInfoServiceBiz.updateById(vehicle);
|
||||
// TODO: 2022/7/6 上报apms生产单开始加工
|
||||
//apmsStartProcess(currTask);
|
||||
apmsStartProcess(currTask);
|
||||
}else {
|
||||
runTask.setStatus(3);
|
||||
runTask.setUpdateTime(LocalDateTime.now());
|
||||
@ -417,7 +417,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
if (status==1){
|
||||
|
||||
// TODO: 2022/7/7 加工完成,记录结束时能源消耗
|
||||
//asynEndRecordConsume(currTaskId,currTask.getKilnId());
|
||||
asynEndRecordConsume(currTaskId,currTask.getKilnId());
|
||||
logger.info("===执行任务:"+currTaskId+" ,车辆搬运任务,车辆:"+vehicleId+" ,起点:"+startPoint+" ,终点:"+endPoint+"任务执行成功===");
|
||||
//更新关系表状态为完成
|
||||
runTask.setUpdateTime(LocalDateTime.now());
|
||||
@ -436,8 +436,9 @@ public class AsynRunTaskService extends BaseService {
|
||||
//更新小车状态
|
||||
vehicle.setStatus(0);
|
||||
vehicleInfoServiceBiz.updateById(vehicle);
|
||||
// TODO: 2022/7/6 上报apms加工完成
|
||||
/* ApmsEndProcess apmsEndProcess=new ApmsEndProcess();
|
||||
// TODO: 2022/7/6 上报apms加工完成.每次进炉加工完成后就上报apms完成处理生产单,等所有加工步骤都完成后上报apms完成生产单。
|
||||
logger.info("任务:"+currTaskId+" 生产单号:"+currTask.getSheetNo()+"开始上报apm完成处理生产单!");
|
||||
ApmsEndProcess apmsEndProcess=new ApmsEndProcess();
|
||||
apmsEndProcess.setEndTime(LocalDateTime.now().toString());
|
||||
apmsEndProcess.setEndUser("QJJP03");
|
||||
apmsEndProcess.setSheetNo(currTask.getSheetNo());
|
||||
@ -458,6 +459,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
return;
|
||||
}
|
||||
}
|
||||
logger.info("任务:"+currTask.getTaskCode()+"开始上报apms完成生产单!");
|
||||
ApmsFinishProcessSheet apmsFinishProcessSheet=new ApmsFinishProcessSheet();
|
||||
apmsFinishProcessSheet.setSheetNo(currTask.getSheetNo());
|
||||
apmsFinishProcessSheet.setEndTime(LocalDateTime.now().toString());
|
||||
@ -477,7 +479,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
R<ApmsFinishProcessSheetVo> apmsFinishProcessSheetVoR = apmsController.finishProcessSheet(apmsFinishProcessSheet);
|
||||
if (apmsFinishProcessSheetVoR.getCode()!=0){
|
||||
logger.info("任务:"+currTask.getTaskCode()+"完成后上报apms完成生产单失败!");
|
||||
}*/
|
||||
}
|
||||
}else {
|
||||
runTask.setStatus(3);
|
||||
runTask.setUpdateTime(LocalDateTime.now());
|
||||
@ -581,7 +583,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
|
||||
.eq(PlcNameSpace.EQ_ID, kilnId)
|
||||
.eq(PlcNameSpace.EQ_TYPE, 0));
|
||||
String nameSpaceNote = nameSpace.getNote();
|
||||
String nameSpaceNote = nameSpace.getName();
|
||||
switch (kilnInfo.getType()){
|
||||
//加工炉
|
||||
case 1:
|
||||
@ -600,7 +602,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parTemValue.setOilTankActTemValue(actualOilTemp.floatValue());
|
||||
parTemValue.setKilnId(kilnId);
|
||||
parTemValue.setTaskId(currTaskId);
|
||||
setCommonField(parTemValue);
|
||||
parTemValue.setCreateTime(LocalDateTime.now());
|
||||
parTemValueServiceBiz.save(parTemValue);
|
||||
//电度值
|
||||
Double electricalValue = readPlc(nameSpaceNote,"ElectricalValue");
|
||||
@ -615,7 +617,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue.setKilnId(kilnId);
|
||||
parEleValue.setTaskId(currTaskId);
|
||||
setCommonField(parEleValue);
|
||||
parEleValue.setCreateTime(LocalDateTime.now());
|
||||
parEleValueServiceBiz.save(parEleValue);
|
||||
//一号油搅拌转速
|
||||
Double oilStirringSpeed1 = readPlc(nameSpaceNote, "OilStirringSpeed1");
|
||||
@ -626,7 +628,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parRotSpeedValue.setOilStiSpeedAValue(oilStirringSpeed2.floatValue());
|
||||
parRotSpeedValue.setKilnId(kilnId);
|
||||
parRotSpeedValue.setTaskId(currTaskId);
|
||||
setCommonField(parRotSpeedValue);
|
||||
parRotSpeedValue.setCreateTime(LocalDateTime.now());
|
||||
parRotSpeedValueServiceBiz.save(parRotSpeedValue);
|
||||
//氮气
|
||||
Double nitrogenFlow = readPlc(nameSpaceNote, "NitrogenFlow");
|
||||
@ -649,7 +651,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parGasValue.setSetNitPotValue(setupCarbon.floatValue());
|
||||
parGasValue.setKilnId(kilnId);
|
||||
parGasValue.setTaskId(currTaskId);
|
||||
setCommonField(parGasValue);
|
||||
parGasValue.setCreateTime(LocalDateTime.now());
|
||||
parGasValueServiceBiz.save(parGasValue);
|
||||
break;
|
||||
//回火炉
|
||||
@ -663,7 +665,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parTemValue2.setActTemValue(actualTemp.floatValue());
|
||||
parTemValue2.setKilnId(kilnId);
|
||||
parTemValue2.setTaskId(currTaskId);
|
||||
setCommonField(parTemValue2);
|
||||
parTemValue2.setCreateTime(LocalDateTime.now());
|
||||
parTemValueServiceBiz.save(parTemValue2);
|
||||
//电度值
|
||||
electricalValue = readPlc(nameSpaceNote,"TotalElectricity");
|
||||
@ -678,7 +680,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue2.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue2.setKilnId(kilnId);
|
||||
parEleValue2.setTaskId(currTaskId);
|
||||
setCommonField(parEleValue2);
|
||||
parEleValue2.setCreateTime(LocalDateTime.now());
|
||||
parEleValueServiceBiz.save(parEleValue2);
|
||||
break;
|
||||
//氮化炉
|
||||
@ -701,7 +703,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parTemValue3.setFurnacePressure(furnacePressure.floatValue());
|
||||
parTemValue3.setKilnId(kilnId);
|
||||
parTemValue3.setTaskId(currTaskId);
|
||||
setCommonField(parTemValue3);
|
||||
parTemValue3.setCreateTime(LocalDateTime.now());
|
||||
parTemValueServiceBiz.save(parTemValue3);
|
||||
//电度值
|
||||
electricalValue = readPlc(nameSpaceNote,"ElectricalValue");
|
||||
@ -716,7 +718,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue3.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue3.setKilnId(kilnId);
|
||||
parEleValue3.setTaskId(currTaskId);
|
||||
setCommonField(parEleValue3);
|
||||
parEleValue3.setCreateTime(LocalDateTime.now());
|
||||
parEleValueServiceBiz.save(parEleValue3);
|
||||
//实际氮势
|
||||
actualCarbon = readPlc(nameSpaceNote, "ActualCarbon");
|
||||
@ -741,7 +743,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parGasValue3.setDecompositionRate(decompositionRate.floatValue());
|
||||
parGasValue3.setKilnId(kilnId);
|
||||
parGasValue3.setTaskId(currTaskId);
|
||||
setCommonField(parGasValue3);
|
||||
parGasValue3.setCreateTime(LocalDateTime.now());
|
||||
parGasValueServiceBiz.save(parGasValue3);
|
||||
break;
|
||||
//清洗炉
|
||||
@ -759,7 +761,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue4.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue4.setKilnId(kilnId);
|
||||
parEleValue4.setTaskId(currTaskId);
|
||||
setCommonField(parEleValue4);
|
||||
parEleValue4.setCreateTime(LocalDateTime.now());
|
||||
parEleValueServiceBiz.save(parEleValue4);
|
||||
break;
|
||||
default:
|
||||
@ -773,7 +775,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
|
||||
.eq(PlcNameSpace.EQ_ID, kilnId)
|
||||
.eq(PlcNameSpace.EQ_TYPE, 0));
|
||||
String nameSpaceNote = nameSpace.getNote();
|
||||
String nameSpaceNote = nameSpace.getName();
|
||||
switch (kilnInfo.getType()){
|
||||
//加工炉
|
||||
case 1:
|
||||
@ -792,7 +794,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parTemValue.setOilTankActTemValue(actualOilTemp.floatValue());
|
||||
parTemValue.setKilnId(kilnId);
|
||||
parTemValue.setTaskId(currTaskId);
|
||||
setCommonField(parTemValue);
|
||||
parTemValue.setCreateTime(LocalDateTime.now());
|
||||
parTemValueServiceBiz.save(parTemValue);
|
||||
//电度值
|
||||
Double electricalValue = readPlc(nameSpaceNote,"ElectricalValue");
|
||||
@ -807,7 +809,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue.setKilnId(kilnId);
|
||||
parEleValue.setTaskId(currTaskId);
|
||||
setCommonField(parEleValue);
|
||||
parEleValue.setCreateTime(LocalDateTime.now());
|
||||
parEleValueServiceBiz.save(parEleValue);
|
||||
//一号油搅拌转速
|
||||
Double oilStirringSpeed1 = readPlc(nameSpaceNote, "OilStirringSpeed1");
|
||||
@ -818,7 +820,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parRotSpeedValue.setOilStiSpeedAValue(oilStirringSpeed2.floatValue());
|
||||
parRotSpeedValue.setKilnId(kilnId);
|
||||
parRotSpeedValue.setTaskId(currTaskId);
|
||||
setCommonField(parRotSpeedValue);
|
||||
parRotSpeedValue.setCreateTime(LocalDateTime.now());
|
||||
parRotSpeedValueServiceBiz.save(parRotSpeedValue);
|
||||
//氮气
|
||||
Double nitrogenFlow = readPlc(nameSpaceNote, "NitrogenFlow");
|
||||
@ -841,7 +843,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parGasValue.setSetNitPotValue(setupCarbon.floatValue());
|
||||
parGasValue.setKilnId(kilnId);
|
||||
parGasValue.setTaskId(currTaskId);
|
||||
setCommonField(parGasValue);
|
||||
parGasValue.setCreateTime(LocalDateTime.now());
|
||||
parGasValueServiceBiz.save(parGasValue);
|
||||
break;
|
||||
//回火炉
|
||||
@ -855,7 +857,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parTemValue2.setActTemValue(actualTemp.floatValue());
|
||||
parTemValue2.setKilnId(kilnId);
|
||||
parTemValue2.setTaskId(currTaskId);
|
||||
setCommonField(parTemValue2);
|
||||
parTemValue2.setCreateTime(LocalDateTime.now());
|
||||
parTemValueServiceBiz.save(parTemValue2);
|
||||
//电度值
|
||||
electricalValue = readPlc(nameSpaceNote,"TotalElectricity");
|
||||
@ -870,7 +872,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue2.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue2.setKilnId(kilnId);
|
||||
parEleValue2.setTaskId(currTaskId);
|
||||
setCommonField(parEleValue2);
|
||||
parEleValue2.setCreateTime(LocalDateTime.now());
|
||||
parEleValueServiceBiz.save(parEleValue2);
|
||||
break;
|
||||
//氮化炉
|
||||
@ -893,7 +895,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parTemValue3.setFurnacePressure(furnacePressure.floatValue());
|
||||
parTemValue3.setKilnId(kilnId);
|
||||
parTemValue3.setTaskId(currTaskId);
|
||||
setCommonField(parTemValue3);
|
||||
parTemValue3.setCreateTime(LocalDateTime.now());
|
||||
parTemValueServiceBiz.save(parTemValue3);
|
||||
//电度值
|
||||
electricalValue = readPlc(nameSpaceNote,"ElectricalValue");
|
||||
@ -908,7 +910,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue3.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue3.setKilnId(kilnId);
|
||||
parEleValue3.setTaskId(currTaskId);
|
||||
setCommonField(parEleValue3);
|
||||
parEleValue3.setCreateTime(LocalDateTime.now());
|
||||
parEleValueServiceBiz.save(parEleValue3);
|
||||
//实际氮势
|
||||
actualCarbon = readPlc(nameSpaceNote, "ActualCarbon");
|
||||
@ -933,7 +935,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parGasValue3.setDecompositionRate(decompositionRate.floatValue());
|
||||
parGasValue3.setKilnId(kilnId);
|
||||
parGasValue3.setTaskId(currTaskId);
|
||||
setCommonField(parGasValue3);
|
||||
parGasValue3.setCreateTime(LocalDateTime.now());
|
||||
parGasValueServiceBiz.save(parGasValue3);
|
||||
break;
|
||||
//清洗炉
|
||||
@ -951,7 +953,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue4.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue4.setKilnId(kilnId);
|
||||
parEleValue4.setTaskId(currTaskId);
|
||||
setCommonField(parEleValue4);
|
||||
parEleValue4.setCreateTime(LocalDateTime.now());
|
||||
parEleValueServiceBiz.save(parEleValue4);
|
||||
break;
|
||||
default:
|
||||
|
@ -123,7 +123,7 @@ public class ScheduledTask extends BaseService {
|
||||
/**
|
||||
* 正在加工的加工任务详情
|
||||
*/
|
||||
//@Scheduled(fixedDelay = 1000*60)
|
||||
@Scheduled(fixedDelay = 1000*60)
|
||||
public void screen() throws IOException {
|
||||
//查询出正在进炉加工的curr_task,查询对应炉号是否Working,查询计划时间,剩余时间,查询标识卡详情
|
||||
List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>().eq(CurrTask.IS_IN, 1));
|
||||
@ -148,15 +148,15 @@ public class ScheduledTask extends BaseService {
|
||||
//剩余时间
|
||||
Integer remainingTime=0;
|
||||
if (kilnInfo.getType()!=4){
|
||||
remainingTime = Integer.parseInt(readPlcToString(nameSpace, "ProgramTimeRemain"));
|
||||
remainingTime = readPlc(nameSpace, "ProgramTimeRemain").intValue();
|
||||
}
|
||||
if(kilnInfo.getType()==1||kilnInfo.getType()==3){
|
||||
//运行时间
|
||||
Integer runTime = Integer.parseInt(readPlcToString(nameSpace, "ProgramRunTime"));
|
||||
Integer runTime = readPlc(nameSpace, "ProgramRunTime").intValue();
|
||||
setupTime=runTime+remainingTime;
|
||||
}
|
||||
if (kilnInfo.getType()==2){
|
||||
setupTime=Integer.parseInt(readPlcToString(nameSpace, "SetTime"));
|
||||
setupTime=readPlc(nameSpace, "SetTime").intValue();
|
||||
}
|
||||
nowCurrTask.setSetupTime(setupTime);
|
||||
nowCurrTask.setRemainingTime(remainingTime);
|
||||
@ -179,7 +179,7 @@ public class ScheduledTask extends BaseService {
|
||||
/**
|
||||
* 查询加工完成的窑炉
|
||||
*/
|
||||
//@Scheduled(fixedDelay = 1000*60*2)
|
||||
@Scheduled(fixedDelay = 1000*60*2)
|
||||
public void taskForStockToKiln() throws IOException {
|
||||
//两辆车是否都空闲,只有两辆车都空闲才被允许做任务
|
||||
List<VehicleInfo> vehicleInfoList = vehicleInfoServiceBiz.list(new QueryWrapper<VehicleInfo>().eq(VehicleInfo.STATUS, 0));
|
||||
|
Loading…
Reference in New Issue
Block a user