apms的ip端口号修改

能源消耗统计优化
新增生产单用临时工艺号(前端修改后要改回)
多步骤任务执行bug修改
This commit is contained in:
lgh 2022-07-07 23:50:43 +08:00
parent 0c67641710
commit 9cc6ef98f9
6 changed files with 26 additions and 12 deletions

View File

@ -50,7 +50,7 @@ public class ApmsController extends BaseController {
// static String Token = "eyJhbGciOiJIUzI1NiJ9.eyJkYXRlIjozMTkyNzU4NDk4ODA3LCJwbGF0Rm9ybUlkIjoyLCJhcGlLZXkiOiI3ZWU4ZjU5YmJhZWFlMjdlIiwiZXhwIjozMTkyNzU4NDk4LCJpYXQiOjE2Mzc1NTg0OTh9.RH3MRQr1dCBYW996-WXN69eXu1ZFblAQHfhZHNbTmCg";
static String Token = "";
static LocalDateTime TokenExpireTime = LocalDateTime.now();
static String ApiAddress = "http://59.110.171.25:9010";
static String ApiAddress = "http://192.168.1.109:80";
@PostMapping(value = "apmsPostOrder")
@ApiOperation(value = "WMS接收APMS推送订单信息")

View File

@ -233,7 +233,7 @@ public class CurrTaskController extends BaseController {
currTaskById.setSheetNo(sheetNo);
currTaskService.updateCurrTaskById(currTaskById);
//生成详细任务中的检验结果数据在apms推送生产单结果时创建
return successful("创建成功,任务添加至等待执行队列。");
//return successful("创建成功,任务添加至等待执行队列。");
}
else

View File

@ -102,10 +102,12 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
BeanUtils.copyProperties(param, currTask);
currTask.setTaskType(TaskTypeEnum.WTK.getValue());
//根据工艺号查询工艺id以及工艺plc值
CraftInfo one = craftInfoServiceBiz.getOne(new QueryWrapper<CraftInfo>().eq(CraftInfo.CREATOR_ID, param.getCraftCode()));
// 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"));
currTask.setTaskCode(IDGenerator.gen("RW", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "TASK_CODE"));
setCommonField(currTask);
currTaskServiceBiz.save(currTask);
return successful(IdVo.builder().id(currTask.getId()).build());

View File

@ -132,7 +132,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());

View File

@ -203,7 +203,7 @@ public class RunTaskUtils {
} else {
//当前加工步骤不为第一步
int secondCount = autoExeTaskServiceBiz.count(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.T_TASK_ID, currTask.getId()));
if (secondCount == 2) {
if (secondCount == 1) {
//当前为自动任务第二步
AutoExeTask autoExeTask = autoExeTaskServiceBiz.getOne(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.T_TASK_ID, currTask.getId()));
//该自动任务的工艺类型为2还有第三步

View File

@ -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));
@ -212,8 +212,9 @@ public class ScheduledTask extends BaseService {
}
//查询出正在加工的窑炉遍历根据采集频率的不同采集高频数据能源消耗暂定30秒
//@Scheduled(fixedDelay = 1000*30)
@Scheduled(fixedDelay = 1000*30)
public void getFastValue(){
logger.info("==采集高频能耗数据开始==");
//加工炉列表
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list(new QueryWrapper<KilnInfo>().in(KilnInfo.TYPE,1,3));
for (KilnInfo kilnInfo:kilnInfoList
@ -230,6 +231,10 @@ public class ScheduledTask extends BaseService {
Long kilnId = kilnInfo.getId();
String identificationNumber = readPlcToString(nameSpaceNote, "DischargeIdentNumber");
Long currTaskId = Long.valueOf(JSONObject.parseObject(identificationNumber).get("result").toString());
if (currTaskId==0){
logger.info("==当前加工的为手动加工任务,不记录能耗==");
continue;
}
//加工炉
if (kilnInfo.getType()==1){
//一号油搅拌转速
@ -295,14 +300,16 @@ public class ScheduledTask extends BaseService {
parGasValue3.setCreateTime(LocalDateTime.now());
parGasValueServiceBiz.save(parGasValue3);
}
}
}
logger.info("==采集高频能耗数据结束==");
}
//查询出正在加工的窑炉遍历根据采集频率的不同采集低频数据能源消耗暂定3分钟一次
//@Scheduled(fixedDelay = 1000*60*3)
@Scheduled(fixedDelay = 1000*60*3)
public void getSlowValue(){
System.out.println("开始采集数据");
logger.info("==开始采集低频数据==");
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list();
for (KilnInfo kilnInfo:kilnInfoList
) {
@ -317,6 +324,10 @@ public class ScheduledTask extends BaseService {
Long kilnId = kilnInfo.getId();
String identificationNumber = readPlcToString(nameSpaceNote, "DischargeIdentNumber");
Long currTaskId = Long.valueOf(JSONObject.parseObject(identificationNumber).get("result").toString());
if (currTaskId==0){
logger.info("==当前加工的为手动加工任务,不记录能耗==");
continue;
}
//加工炉
if (kilnInfo.getType()==1){
//实际温度
@ -439,7 +450,7 @@ public class ScheduledTask extends BaseService {
}
}
}
System.out.println("采集完成");
logger.info("==结束采集低频数据==");
}
//遍历窑炉空窑炉查询缓存区是否有等待加工的任务
@ -491,9 +502,10 @@ public class ScheduledTask extends BaseService {
}
//遍历正在工作炉子的报警变量记录报警
//@Scheduled(fixedDelay = 1000*30)
@Scheduled(fixedDelay = 1000*60)
public void listenKilnAlarm(){
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list();
logger.info("==开始查询炉子是否有报警==");
for (KilnInfo kilnInfo:kilnInfoList
) {
PlcNameSpace kilnNameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
@ -545,7 +557,7 @@ public class ScheduledTask extends BaseService {
}
}
}
logger.info("==结束查询炉子是否有报警==");
}
//监听车辆是否在线暂时不用