1.修改bug
This commit is contained in:
gaoben 2021-04-28 18:01:26 +08:00
parent 33b9d1bb76
commit bbeec0ecf6
10 changed files with 415 additions and 352 deletions

View File

@ -31,7 +31,7 @@
<jedis.version>2.9.0</jedis.version>
<druid.version>1.1.13</druid.version>
<mybatisplus.version>3.1.2</mybatisplus.version>
<mysql.version>8.0.16</mysql.version>
<mysql.version>8.0.19</mysql.version>
<mssql.version>4.0</mssql.version>
<oracle.version>11.2.0.3</oracle.version>
<commons.lang.version>2.6</commons.lang.version>

View File

@ -222,6 +222,9 @@ public class AppApiController {
//Map<String,Object> params = new HashMap<>();
// params.put("tenantId",tenantId+"");
List<TenBuildEntity> buildList = tenBuildService.selectByCellId(cellId);
for(TenBuildEntity buildEntity: buildList){
buildEntity.setName(buildEntity.getName()+buildEntity.getUnit()+"单元");
}
return R.ok().put("data", buildList);
}
@ -668,6 +671,8 @@ public class AppApiController {
}
AppUserScopeEntity scope = appUserScopeService.getById(user.getCurrentScopeId());
//不能删除自己
if (scope.getRoleId().intValue() != Constant.ROLE_TEN_CELL) {
//住户家属
for (Map<String, String> param : params) {
Long personId = Long.parseLong(param.get("personId"));
Long cellId = Long.parseLong(param.get("cellId"));
@ -679,6 +684,7 @@ public class AppApiController {
return R.error("您无权删除"+personEntity.getName());
}
}
}
tenPersonService.removeByIdList(params);
return R.ok();
}

View File

@ -1,6 +1,7 @@
package net.shapelight.modules.car.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.minio.MinioClient;
import io.minio.PutObjectOptions;
import io.swagger.annotations.Api;
@ -23,14 +24,8 @@ import java.util.Map;
import net.shapelight.common.config.GlobalValue;
import net.shapelight.common.config.MinioConfig;
import net.shapelight.common.utils.*;
import net.shapelight.modules.ten.entity.TenCarEntity;
import net.shapelight.modules.ten.entity.TenPackRecordEnterEntity;
import net.shapelight.modules.ten.entity.TenPackRecordEntity;
import net.shapelight.modules.ten.entity.TenPackRecordExitEntity;
import net.shapelight.modules.ten.service.TenCarService;
import net.shapelight.modules.ten.service.TenPackRecordEnterService;
import net.shapelight.modules.ten.service.TenPackRecordExitService;
import net.shapelight.modules.ten.service.TenPackRecordService;
import net.shapelight.modules.ten.entity.*;
import net.shapelight.modules.ten.service.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -70,6 +65,9 @@ public class CarOpenApi {
@Autowired
private TenPackRecordExitService tenPackRecordExitService;
@Autowired
private TenPackService tenPackService;
@PostMapping({"/getMsg/{cellId}"})
@ApiOperation("获取MSG")
@ApiImplicitParams({@ApiImplicitParam(name = "sn", value = "设备sn", paramType = "query", dataType = "String", required = true)})
@ -304,6 +302,8 @@ public class CarOpenApi {
*/
//https://c.xitu3d.com:1002/cell/api/car/v1/pushCarRecord
@PostMapping({"/pushCarRecord"})
@ApiOperation("第三方推送")
public Map pushCarRecord(@RequestBody Object object) {
@ -379,6 +379,16 @@ public class CarOpenApi {
httpUrl.disconnect();
}
}
//
Long cellId = null;
Long tenantId = null;
TenPackEntity packEntity = tenPackService.getOne(new QueryWrapper<TenPackEntity>()
.eq("park_code",parkCode));
if(packEntity!=null){
cellId = packEntity.getCellId();
tenantId = packEntity.getTenantId();
}
if (serviceName.equals("enter")) {
long enterTimeLong = bizContent.getLongValue("enterTime");
Date enterTime = new Date(enterTimeLong * 1000L);
@ -391,6 +401,8 @@ public class CarOpenApi {
enter.setType(Integer.valueOf(type));
enter.setCarType(Integer.valueOf(carType));
enter.setEnterTime(enterTime);
enter.setCellId(cellId);
enter.setTenantId(tenantId);
if (fileName.length() > 0)
enter.setImage(fileName);
this.tenPackRecordEnterService.save(enter);
@ -408,6 +420,8 @@ public class CarOpenApi {
exit.setCarType(Integer.valueOf(carType));
exit.setExitTime(exitTime);
exit.setPackTime(Long.valueOf(parkTime));
exit.setCellId(cellId);
exit.setTenantId(tenantId);
if (fileName.length() > 0)
exit.setImage(fileName);
this.tenPackRecordExitService.save(exit);

View File

@ -60,10 +60,10 @@ public class XaAddressTask implements ITask {
if (xqid != null && xqid.length() > 0) {
//调用第三方接口获取所有信息
//6.1 获取标准地址接口---------------------------------------------------------------------------
// String address = XaApi.getAddress(xqid, appId, appSecret);
String address = XaApi.getAddress(xqid, appId, appSecret);
// String address = "{\"xml\":{\"data\":\"信息验证失败\"}}";
String address = "{\"xml\":{\"data\":{\"NEXTPAGE\":\"END\",\"HLWTable\":[{\"@JWSID\":\"610113600000000001202\",\"@SWJID\":\"610113003012013\",\"@SSXQBM\":\"A61011304538\",\"@XZQHNAME\":\"西安市雁塔区\",\"@DZSC\":\"殴风园\",\"@DZQC\":\"陕西省西安市雁塔区长安南路439号\",\"@P_ID\":\"1544038\",\"@JLXMC\":\"长安南路\",\"@WD\":\"34.207728945844494\",\"@DZJB\":\"10\",\"@MPHLX\":\"10\",\"@XQID\":\"610113600000000004538\",\"@DZGSDW\":\"610113600000\",\"@XT_ZHXGSJ\":\"2021-03-23 16:50:08\",\"@SJ\":\"\",\"@XZQH\":\"610113\",\"@XQ\":\"欧风园小区\",\"@JD\":\"108.94238923458721\",\"@JWSMC\":\"陕师大警务室\",\"@DZDM\":\"000268000029\",\"@JLXDM\":\"000268\"},{\"@JWSID\":\"610113600000000001202\",\"@SWJID\":\"610113003012013\",\"@SSXQBM\":\"A61011304538\",\"@XZQHNAME\":\"西安市雁塔区\",\"@DZSC\":\"\",\"@DZQC\":\"陕西省西安市雁塔区长安南路439号1栋\",\"@P_ID\":\"1820578255\",\"@JLXMC\":\"长安南路\",\"@WD\":\"34.206951\",\"@DZJB\":\"11\",\"@MPHLX\":\"10\",\"@XQID\":\"610113600000000004538\",\"@DZGSDW\":\"610113600000\",\"@XT_ZHXGSJ\":\"2021-03-23 16:50:08\",\"@SJ\":\"\",\"@XZQH\":\"610113\",\"@XQ\":\"欧风园小区\",\"@JD\":\"108.942541\",\"@JWSMC\":\"陕师大警务室\",\"@DZDM\":\"000268000029000010\",\"@JLXDM\":\"000268\"}]}}}";
// String address = "{\"xml\":{\"data\":{\"NEXTPAGE\":\"END\",\"HLWTable\":[{\"@JWSID\":\"610113600000000001202\",\"@SWJID\":\"610113003012013\",\"@SSXQBM\":\"A61011304538\",\"@XZQHNAME\":\"西安市雁塔区\",\"@DZSC\":\"殴风园\",\"@DZQC\":\"陕西省西安市雁塔区长安南路439号\",\"@P_ID\":\"1544038\",\"@JLXMC\":\"长安南路\",\"@WD\":\"34.207728945844494\",\"@DZJB\":\"10\",\"@MPHLX\":\"10\",\"@XQID\":\"610113600000000004538\",\"@DZGSDW\":\"610113600000\",\"@XT_ZHXGSJ\":\"2021-03-23 16:50:08\",\"@SJ\":\"\",\"@XZQH\":\"610113\",\"@XQ\":\"欧风园小区\",\"@JD\":\"108.94238923458721\",\"@JWSMC\":\"陕师大警务室\",\"@DZDM\":\"000268000029\",\"@JLXDM\":\"000268\"},{\"@JWSID\":\"610113600000000001202\",\"@SWJID\":\"610113003012013\",\"@SSXQBM\":\"A61011304538\",\"@XZQHNAME\":\"西安市雁塔区\",\"@DZSC\":\"\",\"@DZQC\":\"陕西省西安市雁塔区长安南路439号1栋\",\"@P_ID\":\"1820578255\",\"@JLXMC\":\"长安南路\",\"@WD\":\"34.206951\",\"@DZJB\":\"11\",\"@MPHLX\":\"10\",\"@XQID\":\"610113600000000004538\",\"@DZGSDW\":\"610113600000\",\"@XT_ZHXGSJ\":\"2021-03-23 16:50:08\",\"@SJ\":\"\",\"@XZQH\":\"610113\",\"@XQ\":\"欧风园小区\",\"@JD\":\"108.942541\",\"@JWSMC\":\"陕师大警务室\",\"@DZDM\":\"000268000029000010\",\"@JLXDM\":\"000268\"}]}}}";
log.debug("获取小区标准地址-" + cellEntity.getName() + ":返回数据" + address);
//解析json

View File

@ -56,6 +56,14 @@ public class XaImageTask implements ITask {
private TenAddressService tenAddressService;
@Autowired
private TenTranService tenTranService;
@Autowired
private TenPackRecordEnterService tenPackRecordEnterService;
@Autowired
private TenPackRecordExitService tenPackRecordExitService;
@Autowired
private TenPackService tenPackService;
@Autowired
private TenPackChannalService tenPackChannalService;
public void run(String params) {
log.debug("xaImageTask定时任务正在执行", params);
@ -77,10 +85,14 @@ public class XaImageTask implements ITask {
String xqid = cellEntity.getThirdId();
Long cellId = cellEntity.getCellId();
if (xqid == null || xqid.length() > 0){
//人员
//人员记录图片
processRecordPersonImage(appId, appSecret, xqid, fwikUrl, cellId,tenantId);
//
//人员图片
processRealPersonImage(appId, appSecret, xqid, fwikUrl, cellId);
//车辆进入图片
processRecordCarEnterImage(appId, appSecret, xqid, fwikUrl, cellId);
//车辆离开图片
processRecordCarExitImage(appId, appSecret, xqid, fwikUrl, cellId);
}
}
}
@ -104,6 +116,7 @@ public class XaImageTask implements ITask {
TenAddressEntity addressEntity = tenAddressService.getOne(new QueryWrapper<TenAddressEntity>()
.eq("xqid", xqid).last("LIMIT 1"));
if(addressEntity!=null){
String ssxqbm = addressEntity.getSsxqbm();
syncRecord.setLV_SSXQBM(ssxqbm); //小区申报编码
@ -154,6 +167,7 @@ public class XaImageTask implements ITask {
if (count >= 30)
break;
}
}
if(count == 0){
return;
}
@ -174,8 +188,8 @@ public class XaImageTask implements ITask {
TenTranEntity tranEntity = tenTranService.saveApi(fwikUrl,"","RYJCZPXX", "RYJCZPXX", appId, appSecret);
String tranId = String.format("%s%016d",DateUtils.format(tranEntity.getTranDate(),"yyyyMMddHHmmss"),tranEntity.getTranId());
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "RYJCZPXX", "RYJCZPXX", appId, appSecret,tranId);
String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "RYJCZPXX", "RYJCZPXX", appId, appSecret,tranId);
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
// String resJson = "23232";
// System.out.println(s);
log.debug("上传人员识别记录返回数据:" + resJson);
@ -190,156 +204,163 @@ public class XaImageTask implements ITask {
}
}
// private void processRecordCarEnterImage(String appId, String appSecret, String xqid, String fwikUrl, Long cellId) {
// List<TenPackRecordEnterEntity> records = this.tenPackRecordEnterService.getNotSync(cellId);
// List<XaTCCTCSBXX> syncRecords = new ArrayList();
// List<TenPackRecordEnterEntity> updateRecords = new ArrayList<>();
// int count = 0;
// for (TenPackRecordEnterEntity record : records) {
// XaTCCTCSBXX syncRecord = new XaTCCTCSBXX();
//
// TenPackEntity packEntity = tenPackService.getOne(new QueryWrapper<TenPackEntity>()
// .eq("park_code",record.getParkCode()));
//
// if(packEntity==null){
// continue;
// }
// String packCodeXa = packEntity.getParkCodeXa();
// if(packCodeXa==null || packCodeXa.length()==0){
// continue;
// }
//
// TenPackChannalEntity channalEntity = tenPackChannalService.getOne(new QueryWrapper<TenPackChannalEntity>()
// .eq("channal_name",record.getChannelName()));
// if(channalEntity==null){
// continue;
// }
// String channalCodeXa = channalEntity.getChannalCodeXa();
// if(channalCodeXa==null || channalCodeXa.length()==0){
// continue;
// }
//
//
// syncRecord.setLV_TCCBH(packCodeXa);
// syncRecord.setLV_CPHM(record.getPlateNumber());
// syncRecord.setLV_CPLX("03");//01 大型汽车号牌 2 小型汽车号牌 03 使馆汽车号牌 04 领馆汽车号牌
// syncRecord.setLV_GCSJ(DateUtils.format(record.getEnterTime(), "yyyyMMddHHmmss"));
// syncRecord.setLV_GCLX("1");//1进场2出场
// syncRecord.setLV_JKBM(record.getRecordEnterId()+"");
// syncRecord.setLV_SBXT("10");//申报系统,默认10
// syncRecord.setLV_KKSBBH(channalCodeXa);
// syncRecord.setLV_PROCMODE("PMINSERT");
//
// syncRecords.add(syncRecord);
// updateRecords.add(record);
// count++;
// if (count >= 30)
// break;
// }
// XaData jsonData = new XaData();
// jsonData.setDatas(syncRecords);
//
// List<XaPages> listPages = new ArrayList<>();
// XaPages pages = new XaPages();
// pages.setPno("1");
// pages.setPsize("1");
// listPages.add(pages);
// jsonData.setPages(listPages);
//
// String json = JSONObject.toJSONString(jsonData);
//
// String enJson = XaUtils.encryptStr(json.trim(), appSecret);
//
//// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "TCCTCSBXX", "TCCTCSBXX", appId, appSecret);
//// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
private void processRecordCarEnterImage(String appId, String appSecret, String xqid, String fwikUrl, Long cellId) {
List<TenPackRecordEnterEntity> records = this.tenPackRecordEnterService.getNotSync(cellId);
List<XaTCCTCSBXX> syncRecords = new ArrayList();
List<TenPackRecordEnterEntity> updateRecords = new ArrayList<>();
int count = 0;
for (TenPackRecordEnterEntity record : records) {
XaTCCTCSBXX syncRecord = new XaTCCTCSBXX();
TenPackEntity packEntity = tenPackService.getOne(new QueryWrapper<TenPackEntity>()
.eq("park_code",record.getParkCode()));
if(packEntity==null){
continue;
}
String packCodeXa = packEntity.getParkCodeXa();
if(packCodeXa==null || packCodeXa.length()==0){
continue;
}
TenPackChannalEntity channalEntity = tenPackChannalService.getOne(new QueryWrapper<TenPackChannalEntity>()
.eq("channal_name",record.getChannelName()));
if(channalEntity==null){
continue;
}
String channalCodeXa = channalEntity.getChannalCodeXa();
if(channalCodeXa==null || channalCodeXa.length()==0){
continue;
}
syncRecord.setLV_TCCBH(packCodeXa);
syncRecord.setLV_CPHM(record.getPlateNumber());
syncRecord.setLV_CPLX("03");//01 大型汽车号牌 2 小型汽车号牌 03 使馆汽车号牌 04 领馆汽车号牌
syncRecord.setLV_GCSJ(DateUtils.format(record.getEnterTime(), "yyyyMMddHHmmss"));
syncRecord.setLV_GCLX("1");//1进场2出场
syncRecord.setLV_JKBM(record.getRecordEnterId()+"");
syncRecord.setLV_SBXT("10");//申报系统,默认10
syncRecord.setLV_KKSBBH(channalCodeXa);
syncRecord.setLV_PROCMODE("PMINSERT");
syncRecords.add(syncRecord);
updateRecords.add(record);
count++;
if (count >= 30)
break;
}
XaData jsonData = new XaData();
jsonData.setDatas(syncRecords);
List<XaPages> listPages = new ArrayList<>();
XaPages pages = new XaPages();
pages.setPno("1");
pages.setPsize("1");
listPages.add(pages);
jsonData.setPages(listPages);
String json = JSONObject.toJSONString(jsonData);
String enJson = XaUtils.encryptStr(json.trim(), appSecret);
TenTranEntity tranEntity = tenTranService.saveApi(fwikUrl,"","TCCTCSBXX", "TCCTCSBXX", appId, appSecret);
String tranId = String.format("%s%016d",DateUtils.format(tranEntity.getTranDate(),"yyyyMMddHHmmss"),tranEntity.getTranId());
String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "TCCTCSBXX", "TCCTCSBXX", appId, appSecret,tranId);
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
// String resJson = "23232";
//// System.out.println(s);
// log.debug("上传车辆进场记录返回数据:" + resJson);
// //上传成功修改sync状态
// if (resJson.contains("\"code\":\"0000\"")) {
// for (TenPackRecordEnterEntity recordEntity : updateRecords) {
// recordEntity.setXaSync(1);
// tenPackRecordEnterService.updateById(recordEntity);
// }
// }
// }
//
//
//
//
// private void processRecordCarExitImage(String appId, String appSecret, String xqid, String fwikUrl, Long cellId) {
// List<TenPackRecordExitEntity> records = this.tenPackRecordExitService.getNotSync(cellId);
// List<XaTCCTCSBXXEXIT> syncRecords = new ArrayList();
// List<TenPackRecordExitEntity> updateRecords = new ArrayList<>();
// int count = 0;
// for (TenPackRecordExitEntity record : records) {
// XaTCCTCSBXXEXIT syncRecord = new XaTCCTCSBXXEXIT();
//
// TenPackEntity packEntity = tenPackService.getOne(new QueryWrapper<TenPackEntity>()
// .eq("park_code",record.getParkCode()));
//
// if(packEntity==null){
// continue;
// }
// String packCodeXa = packEntity.getParkCodeXa();
// if(packCodeXa==null || packCodeXa.length()==0){
// continue;
// }
//
// TenPackChannalEntity channalEntity = tenPackChannalService.getOne(new QueryWrapper<TenPackChannalEntity>()
// .eq("channal_name",record.getChannelName()));
// if(channalEntity==null){
// continue;
// }
// String channalCodeXa = channalEntity.getChannalCodeXa();
// if(channalCodeXa==null || channalCodeXa.length()==0){
// continue;
// }
//
//
// syncRecord.setLV_TCCBH(packCodeXa);
// syncRecord.setLV_CPHM(record.getPlateNumber());
// syncRecord.setLV_CPLX("03");//01 大型汽车号牌 2 小型汽车号牌 03 使馆汽车号牌 04 领馆汽车号牌
// syncRecord.setLV_GCSJ(DateUtils.format(record.getExitTime(), "yyyyMMddHHmmss"));
// syncRecord.setLV_GCLX("1");//1进场2出场
// syncRecord.setLV_CKBM(record.getRecordExitId()+"");
// syncRecord.setLV_SBXT("10");//申报系统,默认10
// syncRecord.setLV_KKSBBH(channalCodeXa);
// syncRecord.setLV_PROCMODE("PMINSERT");
//
// syncRecords.add(syncRecord);
// updateRecords.add(record);
// count++;
// if (count >= 30)
// break;
// }
// XaData jsonData = new XaData();
// jsonData.setDatas(syncRecords);
//
// List<XaPages> listPages = new ArrayList<>();
// XaPages pages = new XaPages();
// pages.setPno("1");
// pages.setPsize("1");
// listPages.add(pages);
// jsonData.setPages(listPages);
//
// String json = JSONObject.toJSONString(jsonData);
//
// String enJson = XaUtils.encryptStr(json.trim(), appSecret);
//
//// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "TCCTCSBXX", "TCCTCSBXX", appId, appSecret);
//// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
// System.out.println(s);
log.debug("上传车辆进场记录返回数据:" + resJson);
//上传成功修改sync状态
if (resJson.contains("\"code\":\"0000\"")) {
for (TenPackRecordEnterEntity recordEntity : updateRecords) {
recordEntity.setXaSync(1);
tenPackRecordEnterService.updateById(recordEntity);
}
}
}
private void processRecordCarExitImage(String appId, String appSecret, String xqid, String fwikUrl, Long cellId) {
List<TenPackRecordExitEntity> records = this.tenPackRecordExitService.getNotSync(cellId);
List<XaTCCTCSBXXEXIT> syncRecords = new ArrayList();
List<TenPackRecordExitEntity> updateRecords = new ArrayList<>();
int count = 0;
for (TenPackRecordExitEntity record : records) {
XaTCCTCSBXXEXIT syncRecord = new XaTCCTCSBXXEXIT();
TenPackEntity packEntity = tenPackService.getOne(new QueryWrapper<TenPackEntity>()
.eq("park_code",record.getParkCode()));
if(packEntity==null){
continue;
}
String packCodeXa = packEntity.getParkCodeXa();
if(packCodeXa==null || packCodeXa.length()==0){
continue;
}
TenPackChannalEntity channalEntity = tenPackChannalService.getOne(new QueryWrapper<TenPackChannalEntity>()
.eq("channal_name",record.getChannelName()));
if(channalEntity==null){
continue;
}
String channalCodeXa = channalEntity.getChannalCodeXa();
if(channalCodeXa==null || channalCodeXa.length()==0){
continue;
}
syncRecord.setLV_TCCBH(packCodeXa);
syncRecord.setLV_CPHM(record.getPlateNumber());
syncRecord.setLV_CPLX("03");//01 大型汽车号牌 2 小型汽车号牌 03 使馆汽车号牌 04 领馆汽车号牌
syncRecord.setLV_GCSJ(DateUtils.format(record.getExitTime(), "yyyyMMddHHmmss"));
syncRecord.setLV_GCLX("1");//1进场2出场
syncRecord.setLV_CKBM(record.getRecordExitId()+"");
syncRecord.setLV_SBXT("10");//申报系统,默认10
syncRecord.setLV_KKSBBH(channalCodeXa);
syncRecord.setLV_PROCMODE("PMINSERT");
syncRecords.add(syncRecord);
updateRecords.add(record);
count++;
if (count >= 30)
break;
}
XaData jsonData = new XaData();
jsonData.setDatas(syncRecords);
List<XaPages> listPages = new ArrayList<>();
XaPages pages = new XaPages();
pages.setPno("1");
pages.setPsize("1");
listPages.add(pages);
jsonData.setPages(listPages);
String json = JSONObject.toJSONString(jsonData);
String enJson = XaUtils.encryptStr(json.trim(), appSecret);
TenTranEntity tranEntity = tenTranService.saveApi(fwikUrl,"","TCCTCSBXX", "TCCTCSBXX", appId, appSecret);
String tranId = String.format("%s%016d",DateUtils.format(tranEntity.getTranDate(),"yyyyMMddHHmmss"),tranEntity.getTranId());
String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "TCCTCSBXX", "TCCTCSBXX", appId, appSecret,tranId);
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
// String resJson = "23232";
//// System.out.println(s);
// log.debug("上传车辆进场记录返回数据:" + resJson);
// //上传成功修改sync状态
// if (resJson.contains("\"code\":\"0000\"")) {
// for (TenPackRecordExitEntity recordEntity : updateRecords) {
// recordEntity.setXaSync(1);
// tenPackRecordExitService.updateById(recordEntity);
// }
// }
// }
// System.out.println(s);
log.debug("上传车辆进场记录返回数据:" + resJson);
//上传成功修改sync状态
if (resJson.contains("\"code\":\"0000\"")) {
for (TenPackRecordExitEntity recordEntity : updateRecords) {
recordEntity.setXaSync(1);
tenPackRecordExitService.updateById(recordEntity);
}
}
}
private void processRealPersonImage(String appId, String appSecret, String xqid, String fwikUrl, Long cellId) {
@ -352,6 +373,7 @@ public class XaImageTask implements ITask {
TenRoomEntity roomEntity = tenRoomService.getById(person.getRoomId(), person.getCellId());
TenAddressEntity addressEntity = tenAddressService.getById(roomEntity.getPId());
if(addressEntity!=null){
realPerson.setLV_CASE_ID(person.getUuid()); //实有人口编码
realPerson.setLV_GMSFHM(person.getIdCard()); //身份证号
realPerson.setLV_DJSJ(DateUtils.format(new Date(), "yyyyMMddHHmmss"));
@ -405,7 +427,7 @@ public class XaImageTask implements ITask {
count++;
if (count >= 50)
break;
}
}
if(count == 0){
return;

View File

@ -54,8 +54,8 @@ public class XaRealDataTask implements ITask {
String appSecret = object.getString("appSecret");
//6.2 获取数据对接接口---------------------------------------------------------------------------
// String fwikUrl = XaApi.getFwikUrl(appId, appSecret);
String fwikUrl = "http://";
String fwikUrl = XaApi.getFwikUrl(appId, appSecret);
// String fwikUrl = "http://";
if (fwikUrl != null) {
List<TenCellEntity> allCells = this.tenCellService.list((Wrapper) (new QueryWrapper())
@ -160,8 +160,8 @@ public class XaRealDataTask implements ITask {
TenTranEntity tranEntity = tenTranService.saveApi(fwikUrl,jsonData,"SYFW", "SYFW", appId, appSecret);
String tranId = String.format("%s%016d",DateUtils.format(tranEntity.getTranDate(),"yyyyMMddHHmmss"),tranEntity.getTranId());
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "SYFW", "SYFW", appId, appSecret,tranId);
String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "SYFW", "SYFW", appId, appSecret,tranId);
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
// String resJson = "23232";
// System.out.println(s);
log.debug("上传实有房屋返回数据:" + resJson);
@ -245,8 +245,8 @@ public class XaRealDataTask implements ITask {
TenTranEntity tranEntity = tenTranService.saveApi(fwikUrl,jsonData,"SYRK", "SYRK", appId, appSecret);
String tranId = String.format("%s%016d",DateUtils.format(tranEntity.getTranDate(),"yyyyMMddHHmmss"),tranEntity.getTranId());
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "SYRK", "SYRK", appId, appSecret,tranId);
String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "SYRK", "SYRK", appId, appSecret,tranId);
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
// String resJson = "23232";
// System.out.println(s);
log.debug("上传实有房屋返回数据:" + resJson);
@ -308,8 +308,8 @@ public class XaRealDataTask implements ITask {
TenTranEntity tranEntity = tenTranService.saveApi(fwikUrl,jsonData,"MJKXX", "MJKXX", appId, appSecret);
String tranId = String.format("%s%016d",DateUtils.format(tranEntity.getTranDate(),"yyyyMMddHHmmss"),tranEntity.getTranId());
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "MJKXX", "MJKXX", appId, appSecret,tranId);
String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "MJKXX", "MJKXX", appId, appSecret,tranId);
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
// String resJson = "23232";
// System.out.println(s);
log.debug("上传实有房屋返回数据:" + resJson);
@ -372,8 +372,8 @@ public class XaRealDataTask implements ITask {
TenTranEntity tranEntity = tenTranService.saveApi(fwikUrl,jsonData,"MJSBXX", "MJSBXX", appId, appSecret);
String tranId = String.format("%s%016d",DateUtils.format(tranEntity.getTranDate(),"yyyyMMddHHmmss"),tranEntity.getTranId());
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "MJSBXX", "MJSBXX", appId, appSecret,tranId);
String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "MJSBXX", "MJSBXX", appId, appSecret,tranId);
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
// String resJson = "23232";
// System.out.println(s);
log.debug("上传实有房屋返回数据:" + resJson);

View File

@ -90,6 +90,7 @@ public class XaRecordTask implements ITask {
TenAddressEntity addressEntity = tenAddressService.getOne(new QueryWrapper<TenAddressEntity>()
.eq("xqid",xqid).last("LIMIT 1"));
if(addressEntity!=null){
String ssxqbm = addressEntity.getSsxqbm();
syncRecord.setLV_SSXQBM(ssxqbm); //小区申报编码
@ -108,6 +109,7 @@ public class XaRecordTask implements ITask {
if (count >= 30)
break;
}
}
if(count == 0){
return;
}
@ -128,8 +130,8 @@ public class XaRecordTask implements ITask {
TenTranEntity tranEntity = tenTranService.saveApi(fwikUrl,jsonData,"RYSKZPXX", "RYSKZPXX", appId, appSecret);
String tranId = String.format("%s%016d",DateUtils.format(tranEntity.getTranDate(),"yyyyMMddHHmmss"),tranEntity.getTranId());
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "RYSKZPXX", "RYSKZPXX", appId, appSecret,tranId);
String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "RYSKZPXX", "RYSKZPXX", appId, appSecret,tranId);
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
// String resJson = "23232";
// System.out.println(s);
log.debug("上传人员识别记录返回数据:" + resJson);
@ -210,8 +212,8 @@ public class XaRecordTask implements ITask {
TenTranEntity tranEntity = tenTranService.saveApi(fwikUrl,jsonData,"TCCTCSBXX", "TCCTCSBXX", appId, appSecret);
String tranId = String.format("%s%016d",DateUtils.format(tranEntity.getTranDate(),"yyyyMMddHHmmss"),tranEntity.getTranId());
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "TCCTCSBXX", "TCCTCSBXX", appId, appSecret,tranId);
String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "TCCTCSBXX", "TCCTCSBXX", appId, appSecret,tranId);
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
// String resJson = "23232";
// System.out.println(s);
log.debug("上传车辆进场记录返回数据:" + resJson);
@ -295,8 +297,8 @@ public class XaRecordTask implements ITask {
TenTranEntity tranEntity = tenTranService.saveApi(fwikUrl,jsonData,"TCCTCSBXX", "TCCTCSBXX", appId, appSecret);
String tranId = String.format("%s%016d",DateUtils.format(tranEntity.getTranDate(),"yyyyMMddHHmmss"),tranEntity.getTranId());
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "TCCTCSBXX", "TCCTCSBXX", appId, appSecret,tranId);
String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "TCCTCSBXX", "TCCTCSBXX", appId, appSecret,tranId);
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
// String resJson = "23232";
// System.out.println(s);
log.debug("上传车辆进场记录返回数据:" + resJson);

View File

@ -120,6 +120,9 @@ public class TenBuildController extends AbstractController {
Map<String,Object> params = new HashMap<>();
params.put("tenantId",tenantId+"");
List<TenBuildEntity> buildList = tenBuildService.selectByCellId(cellId);
// for(TenBuildEntity buildEntity: buildList){
// buildEntity.setName(buildEntity.getName()+buildEntity.getUnit()+"单元");
// }
return R.ok().put("data", buildList);
}

View File

@ -11,6 +11,7 @@ import net.shapelight.modules.vo.TenPersonIdUpdateAllVo;
import net.shapelight.modules.vo.TenPersonIdUpdateVo;
import net.shapelight.modules.vo.TenPersonVo;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
@ -22,6 +23,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -62,6 +64,10 @@ public class TenDeviceServiceImpl extends ServiceImpl<TenDeviceDao, TenDeviceEnt
List<Long> cellIds = new ArrayList<>();
// cellIds.add(709832651506188289L);
String cellId = (String) params.get("cellId");
String key = (String) params.get("key");
// if(key == null){
// key = "";
// }
if (cellId != null && !cellId.isEmpty()) {
Long cellLong = Long.parseLong(cellId);
cellIds.add(cellLong);
@ -80,6 +86,12 @@ public class TenDeviceServiceImpl extends ServiceImpl<TenDeviceDao, TenDeviceEnt
new QueryWrapper<TenDeviceEntity>()
.eq("tenant_id", params.get("tenantId"))
.in("cell_id", cellIds)
.and(StringUtils.isNotBlank(key),
i -> i
.like("sn", key)
.or()
.like("name", key)
)
);
for (TenDeviceEntity dev : page.getRecords()) {
StringBuffer scope = new StringBuffer();
@ -255,6 +267,7 @@ public class TenDeviceServiceImpl extends ServiceImpl<TenDeviceDao, TenDeviceEnt
public TenPersonEntity getByMemberId(Integer memberId, Long cellId) {
return tenPersonService.getByMemberId(memberId, cellId);
}
@Override
@Cacheable(value = "TenDevice", key = "#psersonId+'-'+#cellId")
public TenPersonEntity getByPersonId(Long psersonId, Long cellId) {

View File

@ -335,7 +335,7 @@ public class XaApi {
syncRecord.setLV_TCCBH("610113100000000000267");
syncRecord.setLV_CPHM("陕A66GB0");
syncRecord.setLV_CPHM("陕AK8L34");
syncRecord.setLV_CPLX("03");//01 大型汽车号牌 2 小型汽车号牌 03 使馆汽车号牌 04 领馆汽车号牌
syncRecord.setLV_GCSJ(DateUtils.format(new Date(), "yyyyMMddHHmmss"));
syncRecord.setLV_GCLX("1");//1进场2出场
@ -389,6 +389,9 @@ public class XaApi {
*/
String appid = "1297164778041095";
String appsecret = "22971647780410956329716477804109";
//伟丰花园610113600000000005977 欧风园610113600000000004538
//西安文理学院610113630000000010348 绿地花都610113610000000017653
String xqid = "610113600000000004538";
String address = getAddress(xqid, appid, appsecret);
System.out.println(address);
@ -398,8 +401,8 @@ public class XaApi {
String apiUrl = getFwikUrl(appid, appsecret);
System.out.println(apiUrl);
//6.1 获取标准地址接口---------------------------------------------------------------------------
// String address = getAddress(xqid, appid, appsecret);
// System.out.println(address);
String addressCell = getAddress(xqid, appid, appsecret);
System.out.println(addressCell);
//6.3.1 实有房屋信息----------------------------------------------------------------------------
// 1820591355 610113600000000001202 610113003012013 陕西省西安市雁塔区长安南路439号4栋1单元3层4131号 长安南路 108.942481 34.207741 14 10 610113600000000004538 欧风园小区 610113 陕师大警务室 000268000029000013000001000003000002 000268 A61011304538 西安市雁塔区 610113600000 2021-03-23 16:50:08
/*
@ -413,11 +416,11 @@ public class XaApi {
1820580970 610113600000000001202 610113003012013 陕西省西安市雁塔区长安南路439号1栋1单元4层1142号 长安南路 108.942541 34.206951 14 10 610113600000000004538 欧风园小区 610113 陕师大警务室 000268000029000010000001000004000002 000268 A61011304538 西安市雁塔区 610113600000 2021-03-23 16:50:08
1820581243 610113600000000001202 610113003012013 陕西省西安市雁塔区长安南路439号1栋1单元5层1152号 长安南路 108.942541 34.206951 14 10 610113600000000004538 欧风园小区 610113 陕师大警务室 000268000029000010000001000005000001 000268 A61011304538 西安市雁塔区 610113600000 2021-03-23 16:50:08
*/
syncRoom();
// syncRoom();
//6.3.2 实有人口信息----------------------------------------------------------------------------
// syncPerson();
//6.3.9 车辆出入记录-------------------------------------------------------------
processRecordCarEnter();
// processRecordCarEnter();
}