From 122f8ac4d3fb26457916984def03fbf28f0f93bf Mon Sep 17 00:00:00 2001 From: gaoben Date: Mon, 9 Aug 2021 09:53:56 +0800 Subject: [PATCH] =?UTF-8?q?v2.0.17=201.=E4=BA=BA=E5=91=98=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=EF=BC=8C=E8=BD=A6=E8=BE=86=E8=AE=B0=E5=BD=95=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E6=8F=90=E4=BA=A4bug=202.=E5=88=A0=E9=99=A4=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=90=8E=E8=AF=86=E5=88=AB=E8=AE=B0=E5=BD=95=E6=89=BE?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E8=AE=BE=E5=A4=87=E6=8A=A5=E7=A9=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shapelight/modules/job/task/XaRealDataTask.java | 12 ++++++++++++ .../shapelight/modules/job/task/XaRecordTask.java | 13 ++++++++++++- .../ten/service/impl/TenRecordServiceImpl.java | 7 +++++-- 3 files changed, 29 insertions(+), 3 deletions(-) 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();