diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/job/task/XaRealDataTask.java b/shapelight-admin/src/main/java/net/shapelight/modules/job/task/XaRealDataTask.java index 8f43d58..3476679 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/job/task/XaRealDataTask.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/job/task/XaRealDataTask.java @@ -1,6 +1,7 @@ package net.shapelight.modules.job.task; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -382,6 +383,7 @@ public class XaRealDataTask implements ITask { if(resJson.contains("ErrorLineParameter")){ JSONObject resJsonObject = JSONObject.parseObject(resJson); String errLine = resJsonObject.getJSONObject("sta").getString("ErrorLineParameter").trim(); + JSONArray datas = resJsonObject.getJSONArray("datas"); if(errLine.equals("empty")){ for (TenPersonEntity recordEntity : updatePersons) { recordEntity.setXaSyncCard(1); @@ -400,6 +402,16 @@ public class XaRealDataTask implements ITask { } } } + if(datas!=null){ + for(int i = 0;i0){ + TenPersonEntity recordEntity = updatePersons.get(i); + recordEntity.setXaSyncCard(1); + tenPersonService.updateById(recordEntity); + } + } + } } } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/job/task/XaRecordTask.java b/shapelight-admin/src/main/java/net/shapelight/modules/job/task/XaRecordTask.java index 7c948ed..b950341 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/job/task/XaRecordTask.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/job/task/XaRecordTask.java @@ -171,7 +171,7 @@ public class XaRecordTask implements ITask { if(datas!=null){ for(int i = 0;i0){ + if(((String)resData.get("Result")).indexOf("重复申报")>0){ TenRecordEntity recordEntity = updateRecords.get(i); recordEntity.setXaSync(1); tenRecordService.updateById(recordEntity); @@ -265,6 +265,7 @@ public class XaRecordTask implements ITask { try{ JSONObject resJsonObject = JSONObject.parseObject(resJson); String errLine = resJsonObject.getJSONObject("sta").getString("ErrorLineParameter").trim(); + JSONArray datas = resJsonObject.getJSONArray("datas"); if(errLine.equals("empty")){ for (TenPackRecordEnterEntity recordEntity : updateRecords) { recordEntity.setXaSync(1); @@ -287,6 +288,16 @@ public class XaRecordTask implements ITask { } } } + if(datas!=null){ + for(int i = 0;i0){ + TenPackRecordEnterEntity recordEntity = updateRecords.get(i); + recordEntity.setXaSync(1); + tenPackRecordEnterService.updateById(recordEntity); + } + } + } }catch (Exception e){ e.printStackTrace(); log.error("停车记录入场记录上报返回数据格式化错误,全部修改为已上传:"+resJson); diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRecordServiceImpl.java b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRecordServiceImpl.java index 2beabe9..f0bc1d3 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRecordServiceImpl.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/ten/service/impl/TenRecordServiceImpl.java @@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import net.shapelight.modules.ten.dao.TenRecordDao; +import org.springframework.transaction.annotation.Transactional; @Service("tenRecordService") @@ -238,6 +239,7 @@ public class TenRecordServiceImpl implements TenRecordService { } @Override + @Transactional(rollbackFor = Exception.class) public boolean updateById(TenRecordEntity entity) { return tenRecordDao.updateById(entity); } @@ -346,9 +348,10 @@ public class TenRecordServiceImpl implements TenRecordService { if(dev==null){ rec.setDeviceName(""); 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()); if (person == null) { person = new TenPersonEntity();