1.人员记录,车辆记录重复提交bug
2.删除设备后识别记录找不到设备报空指针bug
This commit is contained in:
gaoben 2021-08-09 09:53:56 +08:00
parent f285572689
commit 122f8ac4d3
3 changed files with 29 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package net.shapelight.modules.job.task; package net.shapelight.modules.job.task;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -382,6 +383,7 @@ public class XaRealDataTask implements ITask {
if(resJson.contains("ErrorLineParameter")){ if(resJson.contains("ErrorLineParameter")){
JSONObject resJsonObject = JSONObject.parseObject(resJson); JSONObject resJsonObject = JSONObject.parseObject(resJson);
String errLine = resJsonObject.getJSONObject("sta").getString("ErrorLineParameter").trim(); String errLine = resJsonObject.getJSONObject("sta").getString("ErrorLineParameter").trim();
JSONArray datas = resJsonObject.getJSONArray("datas");
if(errLine.equals("empty")){ if(errLine.equals("empty")){
for (TenPersonEntity recordEntity : updatePersons) { for (TenPersonEntity recordEntity : updatePersons) {
recordEntity.setXaSyncCard(1); recordEntity.setXaSyncCard(1);
@ -400,6 +402,16 @@ public class XaRealDataTask implements ITask {
} }
} }
} }
if(datas!=null){
for(int i = 0;i<datas.size();i++){
JSONObject resData = (JSONObject) datas.get(i);
if(((String)resData.get("Result")).indexOf("重复申报")>0){
TenPersonEntity recordEntity = updatePersons.get(i);
recordEntity.setXaSyncCard(1);
tenPersonService.updateById(recordEntity);
}
}
}
} }
} }

View File

@ -171,7 +171,7 @@ public class XaRecordTask implements ITask {
if(datas!=null){ if(datas!=null){
for(int i = 0;i<datas.size();i++){ for(int i = 0;i<datas.size();i++){
JSONObject resData = (JSONObject) datas.get(i); JSONObject resData = (JSONObject) datas.get(i);
if(((String)resData.get("Result")).indexOf("请勿重复申报")>0){ if(((String)resData.get("Result")).indexOf("重复申报")>0){
TenRecordEntity recordEntity = updateRecords.get(i); TenRecordEntity recordEntity = updateRecords.get(i);
recordEntity.setXaSync(1); recordEntity.setXaSync(1);
tenRecordService.updateById(recordEntity); tenRecordService.updateById(recordEntity);
@ -265,6 +265,7 @@ public class XaRecordTask implements ITask {
try{ try{
JSONObject resJsonObject = JSONObject.parseObject(resJson); JSONObject resJsonObject = JSONObject.parseObject(resJson);
String errLine = resJsonObject.getJSONObject("sta").getString("ErrorLineParameter").trim(); String errLine = resJsonObject.getJSONObject("sta").getString("ErrorLineParameter").trim();
JSONArray datas = resJsonObject.getJSONArray("datas");
if(errLine.equals("empty")){ if(errLine.equals("empty")){
for (TenPackRecordEnterEntity recordEntity : updateRecords) { for (TenPackRecordEnterEntity recordEntity : updateRecords) {
recordEntity.setXaSync(1); recordEntity.setXaSync(1);
@ -287,6 +288,16 @@ public class XaRecordTask implements ITask {
} }
} }
} }
if(datas!=null){
for(int i = 0;i<datas.size();i++){
JSONObject resData = (JSONObject) datas.get(i);
if(((String)resData.get("Result")).indexOf("请勿重复申报")>0){
TenPackRecordEnterEntity recordEntity = updateRecords.get(i);
recordEntity.setXaSync(1);
tenPackRecordEnterService.updateById(recordEntity);
}
}
}
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
log.error("停车记录入场记录上报返回数据格式化错误,全部修改为已上传:"+resJson); log.error("停车记录入场记录上报返回数据格式化错误,全部修改为已上传:"+resJson);

View File

@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.shapelight.modules.ten.dao.TenRecordDao; import net.shapelight.modules.ten.dao.TenRecordDao;
import org.springframework.transaction.annotation.Transactional;
@Service("tenRecordService") @Service("tenRecordService")
@ -238,6 +239,7 @@ public class TenRecordServiceImpl implements TenRecordService {
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public boolean updateById(TenRecordEntity entity) { public boolean updateById(TenRecordEntity entity) {
return tenRecordDao.updateById(entity); return tenRecordDao.updateById(entity);
} }
@ -346,9 +348,10 @@ public class TenRecordServiceImpl implements TenRecordService {
if(dev==null){ if(dev==null){
rec.setDeviceName(""); rec.setDeviceName("");
rec.setGateFlag(1); rec.setGateFlag(1);
}else{
rec.setDeviceName(dev.getName());
rec.setGateFlag(dev.getGateFlag());
} }
rec.setDeviceName(dev.getName());
rec.setGateFlag(dev.getGateFlag());
TenPersonEntity person = tenPersonService.getById(rec.getPersonId(), rec.getCellId()); TenPersonEntity person = tenPersonService.getById(rec.getPersonId(), rec.getCellId());
if (person == null) { if (person == null) {
person = new TenPersonEntity(); person = new TenPersonEntity();