Compare commits
No commits in common. "936dc5b71a8f8846fc96e1c6b265e65c5fff921b" and "c324aa524f2b6b06956cd4bb89995256974df633" have entirely different histories.
936dc5b71a
...
c324aa524f
@ -100,19 +100,6 @@ 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,8 +99,5 @@ 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,10 +139,6 @@ 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
|
||||
@ -172,30 +168,27 @@ 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();
|
||||
}
|
||||
|
||||
if (apmsCreateProcessSheet)
|
||||
//通知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())
|
||||
{
|
||||
//apms创建成功后写入数据库
|
||||
R<IdVo> mainTask = currTaskService.createProcessTask(param);
|
||||
@ -234,6 +227,7 @@ 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);
|
||||
@ -246,7 +240,6 @@ public class CurrTaskController extends BaseController {
|
||||
{
|
||||
return failed("创建失败,APMS报错:" + processSheet.getData().getMsg());
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -271,8 +264,8 @@ public class CurrTaskController extends BaseController {
|
||||
|
||||
@PostMapping(value = "deleteBySheetNo")
|
||||
@ApiOperation(value = "人工通过生产单编号删除未正式开始的生产单(通知APMS)")
|
||||
public R<String> deleteBySheetNo(@Validated @RequestBody CurrTaskQueryParam param) {
|
||||
return currTaskService.deleteBySheetNo(param.getSheetNo());
|
||||
public R<String> deleteBySheetNo(@Validated @RequestBody String sheetNo) {
|
||||
return currTaskService.deleteBySheetNo(sheetNo);
|
||||
}
|
||||
@PostMapping(value = "runTask")
|
||||
@ApiOperation(value = "执行任务")
|
||||
|
@ -23,7 +23,4 @@ public class CurrTaskQueryParam extends BasePageParam {
|
||||
@ApiModelProperty(value = "车辆id")
|
||||
private String vehicleId;
|
||||
|
||||
private String sheetNo;
|
||||
|
||||
|
||||
}
|
||||
|
@ -76,8 +76,6 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
||||
RunTaskUtils runTaskUtils;
|
||||
@Autowired
|
||||
AutoExeTaskServiceBiz autoExeTaskServiceBiz;
|
||||
@Autowired
|
||||
KilnInfoServiceBiz kilnInfoServiceBiz;
|
||||
|
||||
@Override
|
||||
public CurrTaskVo getCurrTask(IdParam idParam) {
|
||||
@ -103,11 +101,9 @@ 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值
|
||||
CraftInfo one = craftInfoServiceBiz.getOne(new QueryWrapper<CraftInfo>().eq(CraftInfo.CRAFT_CODE, param.getCraftCode()));
|
||||
currTask.setTargetPosition(kilnInfo.getCode());
|
||||
// TODO: 2022/7/7 工艺号临时
|
||||
CraftInfo one = craftInfoServiceBiz.getOne(new QueryWrapper<CraftInfo>().eq(CraftInfo.CRAFT_CODE, 1));
|
||||
currTask.setCraftCodeId(one.getId());
|
||||
currTask.setPlcValue(one.getPlcValue());
|
||||
currTask.setInterCode(IDGenerator.gen("RW", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "TASK_CODE"));
|
||||
@ -158,15 +154,8 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
||||
R<ApmsEndProcessVo> apmsStartProcessR = apmsControl.deleteBySheetNo(sheetNo);
|
||||
if (apmsStartProcessR.getData().getSuccess())
|
||||
{
|
||||
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());
|
||||
}
|
||||
}
|
||||
currTaskServiceBiz.removeById(byId.getId());
|
||||
currTaskDetService.deleteByCurrTaskId(byId.getId());
|
||||
return successful("APMS生产单删除成功。");
|
||||
}
|
||||
else
|
||||
@ -174,9 +163,6 @@ 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(0,"Wms接收Apms订单成功。", "");
|
||||
return successful("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,7 +181,6 @@ 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)
|
||||
@ -266,7 +265,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
byId.setUpdateTime(LocalDateTime.now());
|
||||
byId.setOrderVoid(0);
|
||||
orderInfoService.updateById(byId);
|
||||
return successful(0,"操作成功,订单状态置为作废。", "");
|
||||
return successful("操作成功,订单状态置为作废。", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -311,7 +310,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
one.setMetallography(apmsCompleteOrder.getMetallographic());
|
||||
apmsCheckResultServiceBiz.save(one);
|
||||
//订单不应该在该地方完成,额外提供一个完成接口供人工完成,不通知apms
|
||||
return successful(0,"操作成功,接收检验结果完成。", "");
|
||||
return successful("操作成功,接收检验结果完成。", "");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -320,7 +319,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
|
||||
one1.setMetallography(apmsCompleteOrder.getMetallographic());
|
||||
one1.setUpdateTime(LocalDateTime.now());
|
||||
apmsCheckResultServiceBiz.updateById(one1);
|
||||
return successful(0,"操作成功,更新检验结果完成。", "");
|
||||
return successful("操作成功,更新检验结果完成。", "");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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,9 +436,8 @@ public class AsynRunTaskService extends BaseService {
|
||||
//更新小车状态
|
||||
vehicle.setStatus(0);
|
||||
vehicleInfoServiceBiz.updateById(vehicle);
|
||||
// TODO: 2022/7/6 上报apms加工完成.每次进炉加工完成后就上报apms完成处理生产单,等所有加工步骤都完成后上报apms完成生产单。
|
||||
logger.info("任务:"+currTaskId+" 生产单号:"+currTask.getSheetNo()+"开始上报apm完成处理生产单!");
|
||||
ApmsEndProcess apmsEndProcess=new ApmsEndProcess();
|
||||
// TODO: 2022/7/6 上报apms加工完成
|
||||
/* ApmsEndProcess apmsEndProcess=new ApmsEndProcess();
|
||||
apmsEndProcess.setEndTime(LocalDateTime.now().toString());
|
||||
apmsEndProcess.setEndUser("QJJP03");
|
||||
apmsEndProcess.setSheetNo(currTask.getSheetNo());
|
||||
@ -459,7 +458,6 @@ public class AsynRunTaskService extends BaseService {
|
||||
return;
|
||||
}
|
||||
}
|
||||
logger.info("任务:"+currTask.getTaskCode()+"开始上报apms完成生产单!");
|
||||
ApmsFinishProcessSheet apmsFinishProcessSheet=new ApmsFinishProcessSheet();
|
||||
apmsFinishProcessSheet.setSheetNo(currTask.getSheetNo());
|
||||
apmsFinishProcessSheet.setEndTime(LocalDateTime.now().toString());
|
||||
@ -479,7 +477,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());
|
||||
@ -583,7 +581,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.getName();
|
||||
String nameSpaceNote = nameSpace.getNote();
|
||||
switch (kilnInfo.getType()){
|
||||
//加工炉
|
||||
case 1:
|
||||
@ -602,7 +600,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parTemValue.setOilTankActTemValue(actualOilTemp.floatValue());
|
||||
parTemValue.setKilnId(kilnId);
|
||||
parTemValue.setTaskId(currTaskId);
|
||||
parTemValue.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parTemValue);
|
||||
parTemValueServiceBiz.save(parTemValue);
|
||||
//电度值
|
||||
Double electricalValue = readPlc(nameSpaceNote,"ElectricalValue");
|
||||
@ -617,7 +615,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue.setKilnId(kilnId);
|
||||
parEleValue.setTaskId(currTaskId);
|
||||
parEleValue.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parEleValue);
|
||||
parEleValueServiceBiz.save(parEleValue);
|
||||
//一号油搅拌转速
|
||||
Double oilStirringSpeed1 = readPlc(nameSpaceNote, "OilStirringSpeed1");
|
||||
@ -628,7 +626,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parRotSpeedValue.setOilStiSpeedAValue(oilStirringSpeed2.floatValue());
|
||||
parRotSpeedValue.setKilnId(kilnId);
|
||||
parRotSpeedValue.setTaskId(currTaskId);
|
||||
parRotSpeedValue.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parRotSpeedValue);
|
||||
parRotSpeedValueServiceBiz.save(parRotSpeedValue);
|
||||
//氮气
|
||||
Double nitrogenFlow = readPlc(nameSpaceNote, "NitrogenFlow");
|
||||
@ -651,7 +649,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parGasValue.setSetNitPotValue(setupCarbon.floatValue());
|
||||
parGasValue.setKilnId(kilnId);
|
||||
parGasValue.setTaskId(currTaskId);
|
||||
parGasValue.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parGasValue);
|
||||
parGasValueServiceBiz.save(parGasValue);
|
||||
break;
|
||||
//回火炉
|
||||
@ -665,7 +663,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parTemValue2.setActTemValue(actualTemp.floatValue());
|
||||
parTemValue2.setKilnId(kilnId);
|
||||
parTemValue2.setTaskId(currTaskId);
|
||||
parTemValue2.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parTemValue2);
|
||||
parTemValueServiceBiz.save(parTemValue2);
|
||||
//电度值
|
||||
electricalValue = readPlc(nameSpaceNote,"TotalElectricity");
|
||||
@ -680,7 +678,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue2.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue2.setKilnId(kilnId);
|
||||
parEleValue2.setTaskId(currTaskId);
|
||||
parEleValue2.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parEleValue2);
|
||||
parEleValueServiceBiz.save(parEleValue2);
|
||||
break;
|
||||
//氮化炉
|
||||
@ -703,7 +701,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parTemValue3.setFurnacePressure(furnacePressure.floatValue());
|
||||
parTemValue3.setKilnId(kilnId);
|
||||
parTemValue3.setTaskId(currTaskId);
|
||||
parTemValue3.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parTemValue3);
|
||||
parTemValueServiceBiz.save(parTemValue3);
|
||||
//电度值
|
||||
electricalValue = readPlc(nameSpaceNote,"ElectricalValue");
|
||||
@ -718,7 +716,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue3.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue3.setKilnId(kilnId);
|
||||
parEleValue3.setTaskId(currTaskId);
|
||||
parEleValue3.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parEleValue3);
|
||||
parEleValueServiceBiz.save(parEleValue3);
|
||||
//实际氮势
|
||||
actualCarbon = readPlc(nameSpaceNote, "ActualCarbon");
|
||||
@ -743,7 +741,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parGasValue3.setDecompositionRate(decompositionRate.floatValue());
|
||||
parGasValue3.setKilnId(kilnId);
|
||||
parGasValue3.setTaskId(currTaskId);
|
||||
parGasValue3.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parGasValue3);
|
||||
parGasValueServiceBiz.save(parGasValue3);
|
||||
break;
|
||||
//清洗炉
|
||||
@ -761,7 +759,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue4.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue4.setKilnId(kilnId);
|
||||
parEleValue4.setTaskId(currTaskId);
|
||||
parEleValue4.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parEleValue4);
|
||||
parEleValueServiceBiz.save(parEleValue4);
|
||||
break;
|
||||
default:
|
||||
@ -775,7 +773,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.getName();
|
||||
String nameSpaceNote = nameSpace.getNote();
|
||||
switch (kilnInfo.getType()){
|
||||
//加工炉
|
||||
case 1:
|
||||
@ -794,7 +792,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parTemValue.setOilTankActTemValue(actualOilTemp.floatValue());
|
||||
parTemValue.setKilnId(kilnId);
|
||||
parTemValue.setTaskId(currTaskId);
|
||||
parTemValue.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parTemValue);
|
||||
parTemValueServiceBiz.save(parTemValue);
|
||||
//电度值
|
||||
Double electricalValue = readPlc(nameSpaceNote,"ElectricalValue");
|
||||
@ -809,7 +807,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue.setKilnId(kilnId);
|
||||
parEleValue.setTaskId(currTaskId);
|
||||
parEleValue.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parEleValue);
|
||||
parEleValueServiceBiz.save(parEleValue);
|
||||
//一号油搅拌转速
|
||||
Double oilStirringSpeed1 = readPlc(nameSpaceNote, "OilStirringSpeed1");
|
||||
@ -820,7 +818,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parRotSpeedValue.setOilStiSpeedAValue(oilStirringSpeed2.floatValue());
|
||||
parRotSpeedValue.setKilnId(kilnId);
|
||||
parRotSpeedValue.setTaskId(currTaskId);
|
||||
parRotSpeedValue.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parRotSpeedValue);
|
||||
parRotSpeedValueServiceBiz.save(parRotSpeedValue);
|
||||
//氮气
|
||||
Double nitrogenFlow = readPlc(nameSpaceNote, "NitrogenFlow");
|
||||
@ -843,7 +841,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parGasValue.setSetNitPotValue(setupCarbon.floatValue());
|
||||
parGasValue.setKilnId(kilnId);
|
||||
parGasValue.setTaskId(currTaskId);
|
||||
parGasValue.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parGasValue);
|
||||
parGasValueServiceBiz.save(parGasValue);
|
||||
break;
|
||||
//回火炉
|
||||
@ -857,7 +855,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parTemValue2.setActTemValue(actualTemp.floatValue());
|
||||
parTemValue2.setKilnId(kilnId);
|
||||
parTemValue2.setTaskId(currTaskId);
|
||||
parTemValue2.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parTemValue2);
|
||||
parTemValueServiceBiz.save(parTemValue2);
|
||||
//电度值
|
||||
electricalValue = readPlc(nameSpaceNote,"TotalElectricity");
|
||||
@ -872,7 +870,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue2.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue2.setKilnId(kilnId);
|
||||
parEleValue2.setTaskId(currTaskId);
|
||||
parEleValue2.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parEleValue2);
|
||||
parEleValueServiceBiz.save(parEleValue2);
|
||||
break;
|
||||
//氮化炉
|
||||
@ -895,7 +893,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parTemValue3.setFurnacePressure(furnacePressure.floatValue());
|
||||
parTemValue3.setKilnId(kilnId);
|
||||
parTemValue3.setTaskId(currTaskId);
|
||||
parTemValue3.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parTemValue3);
|
||||
parTemValueServiceBiz.save(parTemValue3);
|
||||
//电度值
|
||||
electricalValue = readPlc(nameSpaceNote,"ElectricalValue");
|
||||
@ -910,7 +908,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue3.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue3.setKilnId(kilnId);
|
||||
parEleValue3.setTaskId(currTaskId);
|
||||
parEleValue3.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parEleValue3);
|
||||
parEleValueServiceBiz.save(parEleValue3);
|
||||
//实际氮势
|
||||
actualCarbon = readPlc(nameSpaceNote, "ActualCarbon");
|
||||
@ -935,7 +933,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parGasValue3.setDecompositionRate(decompositionRate.floatValue());
|
||||
parGasValue3.setKilnId(kilnId);
|
||||
parGasValue3.setTaskId(currTaskId);
|
||||
parGasValue3.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parGasValue3);
|
||||
parGasValueServiceBiz.save(parGasValue3);
|
||||
break;
|
||||
//清洗炉
|
||||
@ -953,7 +951,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
parEleValue4.setTotalBat(electricalValue.floatValue());
|
||||
parEleValue4.setKilnId(kilnId);
|
||||
parEleValue4.setTaskId(currTaskId);
|
||||
parEleValue4.setCreateTime(LocalDateTime.now());
|
||||
setCommonField(parEleValue4);
|
||||
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 = readPlc(nameSpace, "ProgramTimeRemain").intValue();
|
||||
remainingTime = Integer.parseInt(readPlcToString(nameSpace, "ProgramTimeRemain"));
|
||||
}
|
||||
if(kilnInfo.getType()==1||kilnInfo.getType()==3){
|
||||
//运行时间
|
||||
Integer runTime = readPlc(nameSpace, "ProgramRunTime").intValue();
|
||||
Integer runTime = Integer.parseInt(readPlcToString(nameSpace, "ProgramRunTime"));
|
||||
setupTime=runTime+remainingTime;
|
||||
}
|
||||
if (kilnInfo.getType()==2){
|
||||
setupTime=readPlc(nameSpace, "SetTime").intValue();
|
||||
setupTime=Integer.parseInt(readPlcToString(nameSpace, "SetTime"));
|
||||
}
|
||||
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