Browse Source

1、根据项目计算水位或者数据;2、修改日志插入死锁;

prod_202403
mh 8 months ago
parent
commit
f436d1690b
  1. 1
      user-service/src/main/java/com/mh/user/constants/Constant.java
  2. 6
      user-service/src/main/java/com/mh/user/job/DealDataJob.java
  3. 3
      user-service/src/main/java/com/mh/user/serialport/SerialPortSendReceive2.java
  4. 2
      user-service/src/main/java/com/mh/user/service/impl/SysLogServiceImpl.java

1
user-service/src/main/java/com/mh/user/constants/Constant.java

@ -10,6 +10,7 @@ package com.mh.user.constants;
public class Constant { public class Constant {
public static final CharSequence CUSTOM_NAME_HUAXIA = "华厦"; public static final CharSequence CUSTOM_NAME_HUAXIA = "华厦";
public static final CharSequence CUSTOM_NAME_GUANGSHANG = "广商";
public static boolean CONTROL_WEB_FLAG = false; public static boolean CONTROL_WEB_FLAG = false;
public static boolean SEND_STATUS = false; // 指令发送状态 public static boolean SEND_STATUS = false; // 指令发送状态
public static volatile boolean FLAG = false; public static volatile boolean FLAG = false;

6
user-service/src/main/java/com/mh/user/job/DealDataJob.java

@ -47,7 +47,8 @@ public class DealDataJob {
Date date = new Date(); Date date = new Date();
String curDate = sdf1.format(date); String curDate = sdf1.format(date);
String name = dealDataService.customName(); String name = dealDataService.customName();
if (name != null && name.contains("华夏学院")) { if (name != null
&& (name.contains(Constant.CUSTOM_NAME_HUAXIA) || name.contains(Constant.CUSTOM_NAME_GUANGSHANG))) {
dealDataService.proEnergy2(curDate); dealDataService.proEnergy2(curDate);
} else { } else {
dealDataService.proEnergy(curDate); //yyyy-MM-dd HH:00:00 dealDataService.proEnergy(curDate); //yyyy-MM-dd HH:00:00
@ -141,7 +142,8 @@ public class DealDataJob {
Date date = new Date(); Date date = new Date();
String curDate = sdf1.format(date); String curDate = sdf1.format(date);
String name = dealDataService.customName(); String name = dealDataService.customName();
if (name != null && name.contains("华夏学院")) { if (name != null
&& (name.contains(Constant.CUSTOM_NAME_HUAXIA) || name.contains(Constant.CUSTOM_NAME_GUANGSHANG))) {
dealDataService.proEnergySum2(curDate); dealDataService.proEnergySum2(curDate);
} else { } else {
dealDataService.proEnergySum(curDate); dealDataService.proEnergySum(curDate);

3
user-service/src/main/java/com/mh/user/serialport/SerialPortSendReceive2.java

@ -233,7 +233,8 @@ public class SerialPortSendReceive2 {
log.info("进入水位开关,地址==>{}", registerAddr); log.info("进入水位开关,地址==>{}", registerAddr);
SysParamEntity sysParamEntity = sysParamService.selectSysParam(); SysParamEntity sysParamEntity = sysParamService.selectSysParam();
if (null != sysParamEntity && !StringUtils.isBlank(sysParamEntity.getCustomName())) { if (null != sysParamEntity && !StringUtils.isBlank(sysParamEntity.getCustomName())) {
if (sysParamEntity.getCustomName().contains(Constant.CUSTOM_NAME_HUAXIA)) { if (sysParamEntity.getCustomName().contains(Constant.CUSTOM_NAME_HUAXIA)
|| sysParamEntity.getCustomName().contains(Constant.CUSTOM_NAME_GUANGSHANG)) {
analysisReceiveOrder485.analysisRelayOrder485(dataStr,registerAddr,brand,buildingId, buildingName); //华厦 analysisReceiveOrder485.analysisRelayOrder485(dataStr,registerAddr,brand,buildingId, buildingName); //华厦
} else { } else {
analysisReceiveOrder485.analysisPumpStateOrder(dataStr, registerAddr, brand, buildingId, buildingName); //创新,热泵状态与水位共用一个8路设备 analysisReceiveOrder485.analysisPumpStateOrder(dataStr, registerAddr, brand, buildingId, buildingName); //创新,热泵状态与水位共用一个8路设备

2
user-service/src/main/java/com/mh/user/service/impl/SysLogServiceImpl.java

@ -20,7 +20,7 @@ public class SysLogServiceImpl implements SysLogService {
private SysLogMapper sysLogMapper; private SysLogMapper sysLogMapper;
@Override @Override
public int save(SysLog record) { public synchronized int save(SysLog record) {
if(record.getId() == null || record.getId() == 0) { if(record.getId() == null || record.getId() == 0) {
return sysLogMapper.insertSelective(record); return sysLogMapper.insertSelective(record);
} }

Loading…
Cancel
Save