修改设备数据上传代码
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/impl/UserDataServiceImpl.java b/src/main/java/com/supwisdom/dlpay/system/service/impl/UserDataServiceImpl.java
index 51177e4..8f2716e 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/impl/UserDataServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/impl/UserDataServiceImpl.java
@@ -239,8 +239,8 @@
@Override
public PageResult<UserAccountDTO> queryUserAccByParam(UserAccountSearchBean param) {
- StringBuffer querySql = new StringBuffer("select t1.status,t1.third_uid cardno,t1.accamount,t1.coamount,t2.name username from tb_person_identity t1 left join tb_person t2 on t1.userid=t2.userid where 1=1");
- StringBuffer countSql = new StringBuffer("select count(t1.userid) from tb_person_identity t1 left join tb_person t2 on t1.userid=t2.userid where 1=1");
+ StringBuilder querySql = new StringBuilder("select t1.status,t1.third_uid cardno,t1.accamount,t1.coamount,t2.name username from tb_person_identity t1 left join tb_person t2 on t1.userid=t2.userid where 1=1");
+ StringBuilder countSql = new StringBuilder("select count(t1.userid) from tb_person_identity t1 left join tb_person t2 on t1.userid=t2.userid where 1=1");
if (!StringUtil.isEmpty(param.getCardno())) {
querySql.append(" and t1.third_uid like :cardno");
countSql.append(" and t1.third_uid like :cardno");
@@ -272,7 +272,7 @@
public TPersonIdentity saveUserInfoFromPayApi(UserInforResponse payApiUser, TPersonIdentity localIdentity,TPerson person) {
String dateTime = systemUtilService.getSysdatetime().getHostdatetime();
if (null == localIdentity) {
- TPersonIdentity identity = buildNwIdentity(person, payApiUser, dateTime);
+ TPersonIdentity identity = buildNewIdentity(person, payApiUser, dateTime);
identity.setCoamount(0.0);
identity.setAccamount(0.0);
return personIdentityDao.save(identity);
@@ -283,7 +283,7 @@
localIdentity.setPerson(person);
return personIdentityDao.save(localIdentity);
} else {
- TPersonIdentity identity = buildNwIdentity(person, payApiUser, dateTime);
+ TPersonIdentity identity = buildNewIdentity(person, payApiUser, dateTime);
identity.setCoamount(localIdentity.getCoamount());
identity.setAccamount(localIdentity.getAccamount());
personIdentityDao.delete(localIdentity);
@@ -308,6 +308,7 @@
}
}
+ @Override
public double subtract(Double minuend, Double subtractor){
if (minuend == null) {
minuend = 0.0;
@@ -335,7 +336,7 @@
person.setStatus(payApiUser.getTransstatus());
}
- private TPersonIdentity buildNwIdentity(TPerson person, UserInforResponse payApiUser,String dateTime) {
+ private TPersonIdentity buildNewIdentity(TPerson person, UserInforResponse payApiUser,String dateTime) {
TPersonIdentity identity = new TPersonIdentity();
identity.setThirdUid(payApiUser.getCardno());
identity.setCardphyId(payApiUser.getCardphyid());
diff --git a/src/main/java/com/supwisdom/dlpay/water/service/impl/DeviceServiceImpl.java b/src/main/java/com/supwisdom/dlpay/water/service/impl/DeviceServiceImpl.java
index 12d3d56..929ea0d 100644
--- a/src/main/java/com/supwisdom/dlpay/water/service/impl/DeviceServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/water/service/impl/DeviceServiceImpl.java
@@ -124,8 +124,7 @@
// 上传设备数据
MonitorResult monitorResult = deviceRegister(region, device,Constants.DEVICE_STATUS_NORMAL);
if (Constants.MONITOR_SUCCESS_CODE != monitorResult.getCode()) {
- logger.error(monitorResult.getMsg());
- throw new RuntimeException("设备数据上传失败:" + monitorResult.getMsg());
+ logger.error("设备数据上传失败:" + monitorResult.getMsg());
}
return true;
}
@@ -188,8 +187,7 @@
TArea area = optional.get();
MonitorResult monitorResult = deviceRegister(area, device,Constants.DEVICE_STATUS_CLOSED);
if (Constants.MONITOR_SUCCESS_CODE != monitorResult.getCode()) {
- logger.error(monitorResult.getMsg());
- throw new RuntimeException("设备数据上传失败:" + monitorResult.getMsg());
+ logger.error("设备数据上传失败:" + monitorResult.getMsg());
}
return true;
}
@@ -258,10 +256,7 @@
//向监控程序上传设备信息
MonitorResult monitorResult = deviceRegister(area, device,Constants.DEVICE_STATUS_NORMAL);
if (Constants.MONITOR_SUCCESS_CODE != monitorResult.getCode()) {
- logger.error(monitorResult.getMsg());
- result.put("flag", false);
- result.put("errorMsg", "设备信息上传失败:" + monitorResult.getMsg());
- return result;
+ logger.error("errorMsg", "设备信息上传失败:" + monitorResult.getMsg());
}
result.put("flag", true);
@@ -284,7 +279,7 @@
data.put("devverno", device.getSoftVer());
data.put("source", Constants.MONITOR_SUBAPP_WATER);
String url = businessparaService.findByParakey(WaterBudinessConstants.WATER_MONITOR_URL).getParaval();
- String response = httpPost(url + "register", JSON.toJSONString(data));
+ String response = httpPost(url + "device/register", JSON.toJSONString(data));
return JSON.parseObject(response, MonitorResult.class);
}
@@ -293,7 +288,7 @@
data.put("devphyid", device.getDeviceno());
data.put("source", Constants.MONITOR_SUBAPP_WATER);
String url = businessparaService.findByParakey(WaterBudinessConstants.WATER_MONITOR_URL).getParaval();
- String response = httpPost(url + "beat", JSON.toJSONString(data));
+ String response = httpPost(url + "device/beat", JSON.toJSONString(data));
return JSON.parseObject(response, MonitorResult.class);
}
@@ -324,8 +319,7 @@
//向监控程序上传设备数据
MonitorResult monitorResult = deviceHeartBeat(device);
if (Constants.MONITOR_SUCCESS_CODE != monitorResult.getCode()) {
- logger.error(monitorResult.getMsg());
- throw new RuntimeException("设备数据上传失败:" + monitorResult.getMsg());
+ logger.error("设备数据上传失败:" + monitorResult.getMsg());
}
return device;
}
diff --git a/src/main/kotlin/com/supwisdom/dlpay/water/controller/water_controller.kt b/src/main/kotlin/com/supwisdom/dlpay/water/controller/water_controller.kt
index 8dbd922..561d31f 100644
--- a/src/main/kotlin/com/supwisdom/dlpay/water/controller/water_controller.kt
+++ b/src/main/kotlin/com/supwisdom/dlpay/water/controller/water_controller.kt
@@ -692,6 +692,8 @@
val searchBean = UserAccountSearchBean().apply {
this.username = username
this.cardno = cardno
+ this.pageNo = pageNo
+ this.pageSize = pageSize
}
userDataService.queryUserAccByParam(searchBean)?.let {
pageResult ->