1.增加ten_tain交易表,优化api接口
This commit is contained in:
parent
f4a96f4fea
commit
6129298f8d
|
@ -54,6 +54,8 @@ public class XaImageTask implements ITask {
|
|||
private MinioClient minioClient;
|
||||
@Autowired
|
||||
private TenAddressService tenAddressService;
|
||||
@Autowired
|
||||
private TenTranService tenTranService;
|
||||
|
||||
public void run(String params) {
|
||||
log.debug("xaImageTask定时任务正在执行", params);
|
||||
|
@ -65,7 +67,8 @@ public class XaImageTask implements ITask {
|
|||
if (type.intValue() == 1) {
|
||||
String appId = object.getString("appId");
|
||||
String appSecret = object.getString("appSecret");
|
||||
String fwikUrl = XaApi.getFwikUrl(appId, appSecret);
|
||||
// String fwikUrl = XaApi.getFwikUrl(appId, appSecret);
|
||||
String fwikUrl = "http://";
|
||||
if (fwikUrl != null) {
|
||||
List<TenCellEntity> allCells = this.tenCellService.list((Wrapper) (new QueryWrapper())
|
||||
.eq("tenant_id", sysTenUser.getTenantId()));
|
||||
|
@ -73,7 +76,12 @@ public class XaImageTask implements ITask {
|
|||
for (TenCellEntity cellEntity : allCells) {
|
||||
String xqid = cellEntity.getThirdId();
|
||||
Long cellId = cellEntity.getCellId();
|
||||
if (xqid == null || xqid.length() > 0) ;
|
||||
if (xqid == null || xqid.length() > 0){
|
||||
//人员
|
||||
processRecordPersonImage(appId, appSecret, xqid, fwikUrl, cellId,tenantId);
|
||||
//
|
||||
processRealPersonImage(appId, appSecret, xqid, fwikUrl, cellId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -92,7 +100,7 @@ public class XaImageTask implements ITask {
|
|||
for (TenRecordEntity record : records) {
|
||||
XaRYJCZPXX syncRecord = new XaRYJCZPXX();
|
||||
// TenRoomEntity roomEntity = tenRoomService.getById(person.getRoomId(), person.getCellId());
|
||||
// TenAddressEntity addressEntity = tenAddressService.getById(roomEntity.getRoomId());
|
||||
// TenAddressEntity addressEntity = tenAddressService.getById(roomEntity.getPId());
|
||||
|
||||
TenAddressEntity addressEntity = tenAddressService.getOne(new QueryWrapper<TenAddressEntity>()
|
||||
.eq("xqid", xqid).last("LIMIT 1"));
|
||||
|
@ -136,26 +144,26 @@ public class XaImageTask implements ITask {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (base64Image.length() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
syncRecord.setLV_ZPZP(base64Image);//base64图片
|
||||
|
||||
syncRecords.add(syncRecord);
|
||||
updateRecords.add(record);
|
||||
count++;
|
||||
if (count >= 30)
|
||||
break;
|
||||
}
|
||||
if(count == 0){
|
||||
return;
|
||||
}
|
||||
XaData jsonData = new XaData();
|
||||
jsonData.setDatas(syncRecords);
|
||||
|
||||
List<XaPages> listPages = new ArrayList<>();
|
||||
XaPages pages = new XaPages();
|
||||
pages.setPno("1");
|
||||
pages.setPsize("1");
|
||||
pages.setPsize(count+"");
|
||||
listPages.add(pages);
|
||||
jsonData.setPages(listPages);
|
||||
|
||||
|
@ -163,11 +171,16 @@ public class XaImageTask implements ITask {
|
|||
|
||||
String enJson = XaUtils.encryptStr(json.trim(), appSecret);
|
||||
|
||||
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "RYJCZPXX", "RYJCZPXX", appId, appSecret);
|
||||
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
|
||||
String resJson = "23232";
|
||||
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 = "23232";
|
||||
// System.out.println(s);
|
||||
log.debug("上传人员识别记录返回数据:" + resJson);
|
||||
tranEntity.setTranResult(resJson);
|
||||
tenTranService.updateById(tranEntity);
|
||||
//上传成功,修改sync状态
|
||||
if (resJson.contains("\"code\":\"0000\"")) {
|
||||
for (TenRecordEntity recordEntity : updateRecords) {
|
||||
|
@ -186,7 +199,7 @@ public class XaImageTask implements ITask {
|
|||
// XaTCCTCSBXX syncRecord = new XaTCCTCSBXX();
|
||||
//
|
||||
// TenPackEntity packEntity = tenPackService.getOne(new QueryWrapper<TenPackEntity>()
|
||||
// .eq("pack_code",record.getParkCode()));
|
||||
// .eq("park_code",record.getParkCode()));
|
||||
//
|
||||
// if(packEntity==null){
|
||||
// continue;
|
||||
|
@ -263,7 +276,7 @@ public class XaImageTask implements ITask {
|
|||
// XaTCCTCSBXXEXIT syncRecord = new XaTCCTCSBXXEXIT();
|
||||
//
|
||||
// TenPackEntity packEntity = tenPackService.getOne(new QueryWrapper<TenPackEntity>()
|
||||
// .eq("pack_code",record.getParkCode()));
|
||||
// .eq("park_code",record.getParkCode()));
|
||||
//
|
||||
// if(packEntity==null){
|
||||
// continue;
|
||||
|
@ -337,7 +350,7 @@ public class XaImageTask implements ITask {
|
|||
for (TenPersonEntity person : persons) {
|
||||
XaRYRKPHOTO realPerson = new XaRYRKPHOTO();
|
||||
TenRoomEntity roomEntity = tenRoomService.getById(person.getRoomId(), person.getCellId());
|
||||
TenAddressEntity addressEntity = tenAddressService.getById(roomEntity.getRoomId());
|
||||
TenAddressEntity addressEntity = tenAddressService.getById(roomEntity.getPId());
|
||||
|
||||
realPerson.setLV_CASE_ID(person.getUuid()); //实有人口编码
|
||||
realPerson.setLV_GMSFHM(person.getIdCard()); //身份证号
|
||||
|
@ -388,18 +401,22 @@ public class XaImageTask implements ITask {
|
|||
syncPersons.add(realPerson);
|
||||
updatePersons.add(person);
|
||||
|
||||
|
||||
count++;
|
||||
if (count >= 50)
|
||||
break;
|
||||
|
||||
}
|
||||
if(count == 0){
|
||||
return;
|
||||
}
|
||||
XaData jsonData = new XaData();
|
||||
jsonData.setDatas(syncPersons);
|
||||
|
||||
List<XaPages> listPages = new ArrayList<>();
|
||||
XaPages pages = new XaPages();
|
||||
pages.setPno("1");
|
||||
pages.setPsize("1");
|
||||
pages.setPsize(count+"");
|
||||
listPages.add(pages);
|
||||
jsonData.setPages(listPages);
|
||||
|
||||
|
@ -407,11 +424,16 @@ public class XaImageTask implements ITask {
|
|||
|
||||
String enJson = XaUtils.encryptStr(json.trim(), appSecret);
|
||||
|
||||
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "SYRK", "SYRK", appId, appSecret);
|
||||
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
|
||||
String resJson = "23232";
|
||||
TenTranEntity tranEntity = tenTranService.saveApi(fwikUrl,"","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 = "23232";
|
||||
// System.out.println(s);
|
||||
log.debug("上传实有房屋返回数据:" + resJson);
|
||||
log.debug("processRealPersonImage:" + resJson);
|
||||
tranEntity.setTranResult(resJson);
|
||||
tenTranService.updateById(tranEntity);
|
||||
//上传成功,修改sync状态
|
||||
if (resJson.contains("\"code\":\"0000\"")) {
|
||||
for (TenPersonEntity personEntity : updatePersons) {
|
||||
|
|
|
@ -39,6 +39,8 @@ public class XaRealDataTask implements ITask {
|
|||
private TenDeviceService tenDeviceService;
|
||||
@Autowired
|
||||
private TenAddressService tenAddressService;
|
||||
@Autowired
|
||||
private TenTranService tenTranService;
|
||||
|
||||
public void run(String params) {
|
||||
log.debug("一标三实定时任务正在执行", params);
|
||||
|
@ -139,26 +141,34 @@ public class XaRealDataTask implements ITask {
|
|||
break;
|
||||
}
|
||||
}
|
||||
if(count == 0){
|
||||
return;
|
||||
}
|
||||
XaData jsonData = new XaData();
|
||||
jsonData.setDatas(syncRooms);
|
||||
|
||||
List<XaPages> listPages = new ArrayList<>();
|
||||
XaPages pages = new XaPages();
|
||||
pages.setPno("1");
|
||||
pages.setPsize("1");
|
||||
pages.setPsize(count+"");
|
||||
listPages.add(pages);
|
||||
jsonData.setPages(listPages);
|
||||
|
||||
String json = JSONObject.toJSONString(jsonData);
|
||||
|
||||
String enJson = XaUtils.encryptStr(json.trim(), appSecret);
|
||||
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "SYFW", "SYFW", appId, appSecret);
|
||||
// String resJons = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
|
||||
String resJons = "23232";
|
||||
|
||||
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 = "23232";
|
||||
// System.out.println(s);
|
||||
log.debug("上传实有房屋返回数据:" + resJons);
|
||||
log.debug("上传实有房屋返回数据:" + resJson);
|
||||
tranEntity.setTranResult(resJson);
|
||||
tenTranService.updateById(tranEntity);
|
||||
//上传成功,修改sync状态
|
||||
if (resJons.contains("\"code\":\"0000\"")) {
|
||||
if (resJson.contains("\"code\":\"0000\"")) {
|
||||
for (TenRoomEntity room : updateRooms) {
|
||||
room.setXaSync(1);
|
||||
tenRoomService.updateById(room);
|
||||
|
@ -174,7 +184,7 @@ public class XaRealDataTask implements ITask {
|
|||
for (TenPersonEntity person : persons) {
|
||||
XaSYRK realPerson = new XaSYRK();
|
||||
TenRoomEntity roomEntity = tenRoomService.getById(person.getRoomId(), person.getCellId());
|
||||
TenAddressEntity addressEntity = tenAddressService.getById(roomEntity.getRoomId());
|
||||
TenAddressEntity addressEntity = tenAddressService.getById(roomEntity.getPId());
|
||||
|
||||
String idcard = person.getIdCard();
|
||||
if (idcard.length() >= 18) {
|
||||
|
@ -214,13 +224,16 @@ public class XaRealDataTask implements ITask {
|
|||
break;
|
||||
|
||||
}
|
||||
if(count == 0){
|
||||
return;
|
||||
}
|
||||
XaData jsonData = new XaData();
|
||||
jsonData.setDatas(syncPersons);
|
||||
|
||||
List<XaPages> listPages = new ArrayList<>();
|
||||
XaPages pages = new XaPages();
|
||||
pages.setPno("1");
|
||||
pages.setPsize("1");
|
||||
pages.setPsize(count+"");
|
||||
listPages.add(pages);
|
||||
jsonData.setPages(listPages);
|
||||
|
||||
|
@ -228,11 +241,15 @@ public class XaRealDataTask implements ITask {
|
|||
|
||||
String enJson = XaUtils.encryptStr(json.trim(), appSecret);
|
||||
|
||||
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "SYRK", "SYRK", appId, appSecret);
|
||||
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
|
||||
String resJson = "23232";
|
||||
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 = "23232";
|
||||
// System.out.println(s);
|
||||
log.debug("上传实有房屋返回数据:" + resJson);
|
||||
tranEntity.setTranResult(resJson);
|
||||
tenTranService.updateById(tranEntity);
|
||||
//上传成功,修改sync状态
|
||||
if (resJson.contains("\"code\":\"0000\"")) {
|
||||
for (TenPersonEntity personEntity : updatePersons) {
|
||||
|
@ -249,7 +266,7 @@ public class XaRealDataTask implements ITask {
|
|||
int count = 0;
|
||||
for (TenPersonEntity person : persons) {
|
||||
TenRoomEntity roomEntity = tenRoomService.getById(person.getRoomId(), person.getCellId());
|
||||
TenAddressEntity addressEntity = tenAddressService.getById(roomEntity.getRoomId());
|
||||
TenAddressEntity addressEntity = tenAddressService.getById(roomEntity.getPId());
|
||||
|
||||
XaMJKXX realCard = new XaMJKXX();
|
||||
realCard.setLV_MJKLX("4");
|
||||
|
@ -268,13 +285,17 @@ public class XaRealDataTask implements ITask {
|
|||
break;
|
||||
}
|
||||
|
||||
if(count == 0){
|
||||
return;
|
||||
}
|
||||
|
||||
XaData jsonData = new XaData();
|
||||
jsonData.setDatas(syncDoorCards);
|
||||
|
||||
List<XaPages> listPages = new ArrayList<>();
|
||||
XaPages pages = new XaPages();
|
||||
pages.setPno("1");
|
||||
pages.setPsize("1");
|
||||
pages.setPsize(count+"");
|
||||
listPages.add(pages);
|
||||
jsonData.setPages(listPages);
|
||||
|
||||
|
@ -282,11 +303,15 @@ public class XaRealDataTask implements ITask {
|
|||
|
||||
String enJson = XaUtils.encryptStr(json.trim(), appSecret);
|
||||
|
||||
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "MJKXX", "MJKXX", appId, appSecret);
|
||||
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
|
||||
String resJson = "23232";
|
||||
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 = "23232";
|
||||
// System.out.println(s);
|
||||
log.debug("上传实有房屋返回数据:" + resJson);
|
||||
tranEntity.setTranResult(resJson);
|
||||
tenTranService.updateById(tranEntity);
|
||||
//上传成功,修改sync状态
|
||||
if (resJson.contains("\"code\":\"0000\"")) {
|
||||
for (TenPersonEntity personEntity : updatePersons) {
|
||||
|
@ -325,13 +350,16 @@ public class XaRealDataTask implements ITask {
|
|||
break;
|
||||
}
|
||||
|
||||
if(count == 0){
|
||||
return;
|
||||
}
|
||||
XaData jsonData = new XaData();
|
||||
jsonData.setDatas(syncDevices);
|
||||
|
||||
List<XaPages> listPages = new ArrayList<>();
|
||||
XaPages pages = new XaPages();
|
||||
pages.setPno("1");
|
||||
pages.setPsize("1");
|
||||
pages.setPsize(count+"");
|
||||
listPages.add(pages);
|
||||
jsonData.setPages(listPages);
|
||||
|
||||
|
@ -339,11 +367,15 @@ public class XaRealDataTask implements ITask {
|
|||
|
||||
String enJson = XaUtils.encryptStr(json.trim(), appSecret);
|
||||
|
||||
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "MJSBXX", "MJSBXX", appId, appSecret);
|
||||
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
|
||||
String resJson = "23232";
|
||||
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 = "23232";
|
||||
// System.out.println(s);
|
||||
log.debug("上传实有房屋返回数据:" + resJson);
|
||||
tranEntity.setTranResult(resJson);
|
||||
tenTranService.updateById(tranEntity);
|
||||
//上传成功,修改sync状态
|
||||
if (resJson.contains("\"code\":\"0000\"")) {
|
||||
for (TenDeviceEntity deviceEntity : updateDevices) {
|
||||
|
|
|
@ -39,6 +39,8 @@ public class XaRecordTask implements ITask {
|
|||
private TenPackService tenPackService;
|
||||
@Autowired
|
||||
private TenPackChannalService tenPackChannalService;
|
||||
@Autowired
|
||||
private TenTranService tenTranService;
|
||||
|
||||
public void run(String params) {
|
||||
log.debug("xaRecordTask{}", params);
|
||||
|
@ -84,7 +86,7 @@ public class XaRecordTask implements ITask {
|
|||
for (TenRecordEntity record : records) {
|
||||
XaRYSKZPXX syncRecord = new XaRYSKZPXX();
|
||||
// TenRoomEntity roomEntity = tenRoomService.getById(person.getRoomId(), person.getCellId());
|
||||
// TenAddressEntity addressEntity = tenAddressService.getById(roomEntity.getRoomId());
|
||||
// TenAddressEntity addressEntity = tenAddressService.getById(roomEntity.getPId());
|
||||
|
||||
TenAddressEntity addressEntity = tenAddressService.getOne(new QueryWrapper<TenAddressEntity>()
|
||||
.eq("xqid",xqid).last("LIMIT 1"));
|
||||
|
@ -106,13 +108,16 @@ public class XaRecordTask implements ITask {
|
|||
if (count >= 30)
|
||||
break;
|
||||
}
|
||||
if(count == 0){
|
||||
return;
|
||||
}
|
||||
XaData jsonData = new XaData();
|
||||
jsonData.setDatas(syncRecords);
|
||||
|
||||
List<XaPages> listPages = new ArrayList<>();
|
||||
XaPages pages = new XaPages();
|
||||
pages.setPno("1");
|
||||
pages.setPsize("1");
|
||||
pages.setPsize(count+"");
|
||||
listPages.add(pages);
|
||||
jsonData.setPages(listPages);
|
||||
|
||||
|
@ -120,11 +125,16 @@ public class XaRecordTask implements ITask {
|
|||
|
||||
String enJson = XaUtils.encryptStr(json.trim(), appSecret);
|
||||
|
||||
// String resJson = XaApi.httpPOSTJson(fwikUrl, enJson, "RYSKZPXX", "RYSKZPXX", appId, appSecret);
|
||||
// String resJson = "{\"sta\":{\"code\":\"0000\",\"des\":\"成功\",\"ErrorLineParameter\":\"empty\"},\"datas\":[{\"Result\":\"接收成功\"}],\"pages\":[{\"psize\":\"1\",\"tcount\":\"1\",\"pno\":\"1\",\"tsize\":\"0\"}]}";
|
||||
String resJson = "23232";
|
||||
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 = "23232";
|
||||
// System.out.println(s);
|
||||
log.debug("上传人员识别记录返回数据:" + resJson);
|
||||
tranEntity.setTranResult(resJson);
|
||||
tenTranService.updateById(tranEntity);
|
||||
//上传成功,修改sync状态
|
||||
if (resJson.contains("\"code\":\"0000\"")) {
|
||||
for (TenRecordEntity recordEntity : updateRecords) {
|
||||
|
@ -143,7 +153,7 @@ public class XaRecordTask implements ITask {
|
|||
XaTCCTCSBXX syncRecord = new XaTCCTCSBXX();
|
||||
|
||||
TenPackEntity packEntity = tenPackService.getOne(new QueryWrapper<TenPackEntity>()
|
||||
.eq("pack_code",record.getParkCode()));
|
||||
.eq("park_code",record.getParkCode()));
|
||||
|
||||
if(packEntity==null){
|
||||
continue;
|
||||
|
@ -180,13 +190,16 @@ public class XaRecordTask implements ITask {
|
|||
if (count >= 30)
|
||||
break;
|
||||
}
|
||||
if(count == 0){
|
||||
return;
|
||||
}
|
||||
XaData jsonData = new XaData();
|
||||
jsonData.setDatas(syncRecords);
|
||||
|
||||
List<XaPages> listPages = new ArrayList<>();
|
||||
XaPages pages = new XaPages();
|
||||
pages.setPno("1");
|
||||
pages.setPsize("1");
|
||||
pages.setPsize(count+"");
|
||||
listPages.add(pages);
|
||||
jsonData.setPages(listPages);
|
||||
|
||||
|
@ -194,11 +207,16 @@ public class XaRecordTask implements ITask {
|
|||
|
||||
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\"}]}";
|
||||
String resJson = "23232";
|
||||
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 = "23232";
|
||||
// System.out.println(s);
|
||||
log.debug("上传车辆进场记录返回数据:" + resJson);
|
||||
tranEntity.setTranResult(resJson);
|
||||
tenTranService.updateById(tranEntity);
|
||||
//上传成功,修改sync状态
|
||||
if (resJson.contains("\"code\":\"0000\"")) {
|
||||
for (TenPackRecordEnterEntity recordEntity : updateRecords) {
|
||||
|
@ -220,7 +238,7 @@ public class XaRecordTask implements ITask {
|
|||
XaTCCTCSBXXEXIT syncRecord = new XaTCCTCSBXXEXIT();
|
||||
|
||||
TenPackEntity packEntity = tenPackService.getOne(new QueryWrapper<TenPackEntity>()
|
||||
.eq("pack_code",record.getParkCode()));
|
||||
.eq("park_code",record.getParkCode()));
|
||||
|
||||
if(packEntity==null){
|
||||
continue;
|
||||
|
@ -257,13 +275,16 @@ public class XaRecordTask implements ITask {
|
|||
if (count >= 30)
|
||||
break;
|
||||
}
|
||||
if(count == 0){
|
||||
return;
|
||||
}
|
||||
XaData jsonData = new XaData();
|
||||
jsonData.setDatas(syncRecords);
|
||||
|
||||
List<XaPages> listPages = new ArrayList<>();
|
||||
XaPages pages = new XaPages();
|
||||
pages.setPno("1");
|
||||
pages.setPsize("1");
|
||||
pages.setPsize(count+"");
|
||||
listPages.add(pages);
|
||||
jsonData.setPages(listPages);
|
||||
|
||||
|
@ -271,11 +292,16 @@ public class XaRecordTask implements ITask {
|
|||
|
||||
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\"}]}";
|
||||
String resJson = "23232";
|
||||
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 = "23232";
|
||||
// System.out.println(s);
|
||||
log.debug("上传车辆进场记录返回数据:" + resJson);
|
||||
tranEntity.setTranResult(resJson);
|
||||
tenTranService.updateById(tranEntity);
|
||||
//上传成功,修改sync状态
|
||||
if (resJson.contains("\"code\":\"0000\"")) {
|
||||
for (TenPackRecordExitEntity recordEntity : updateRecords) {
|
||||
|
|
|
@ -164,7 +164,8 @@ public class DeviceApiServiceImpl implements DeviceApiService {
|
|||
dataMap.put("area_id",cellEntity.getCellId().toString());
|
||||
dataMap.put("area_name",cellEntity.getName());
|
||||
dataMap.put("building_id",cellEntity.getCellId().toString());
|
||||
dataMap.put("building_name",cellEntity.getName());
|
||||
// dataMap.put("building_name",cellEntity.getName());
|
||||
dataMap.put("building_name","");
|
||||
|
||||
Map<String,Object> configMap = new HashMap<>();
|
||||
configMap.put("work_mode",deviceEntity.getHealthCodeFlag());
|
||||
|
|
|
@ -76,6 +76,19 @@ public class TenPackChannalController extends AbstractController {
|
|||
@ApiOperation(value = "保存")
|
||||
public R save(@RequestBody TenPackChannalEntity tenPackChannal) {
|
||||
tenPackChannal.setTenantId(getUser().getTenantId());
|
||||
List<TenPackChannalEntity> entities = tenPackChannalService.list(new QueryWrapper<TenPackChannalEntity>()
|
||||
.eq("channal_code",tenPackChannal.getChannalCode()));
|
||||
if(entities.size()>0){
|
||||
return R.error("通道编码已注册");
|
||||
}
|
||||
if(tenPackChannal.getChannalCodeXa()!=null && tenPackChannal.getChannalCodeXa().length()>0){
|
||||
entities = tenPackChannalService.list(new QueryWrapper<TenPackChannalEntity>()
|
||||
.eq("channal_code_xa",tenPackChannal.getChannalCodeXa()));
|
||||
if(entities.size()>0){
|
||||
return R.error("通道对接编码已注册");
|
||||
}
|
||||
}
|
||||
|
||||
this.tenPackChannalService.save(tenPackChannal);
|
||||
return R.ok();
|
||||
}
|
||||
|
@ -84,6 +97,22 @@ public class TenPackChannalController extends AbstractController {
|
|||
@RequiresPermissions({"ten:packchannal"})
|
||||
@ApiOperation(value = "修改")
|
||||
public R update(@RequestBody TenPackChannalEntity tenPackChannal) {
|
||||
|
||||
TenPackChannalEntity packEntity = tenPackChannalService.getById(tenPackChannal.getParkChannalId());
|
||||
if(!packEntity.getChannalCode().equals(tenPackChannal.getChannalCode())){
|
||||
List<TenPackChannalEntity> tenPackEntitys = tenPackChannalService.list(new QueryWrapper<TenPackChannalEntity>()
|
||||
.eq("channal_code",tenPackChannal.getChannalCode()));
|
||||
if(tenPackEntitys.size()>0){
|
||||
return R.error("停车场编码已注册");
|
||||
}
|
||||
}
|
||||
// if(tenPackChannal.getChannalCodeXa()!=null && tenPackChannal.getChannalCodeXa().length()>0){
|
||||
// entities = tenPackChannalService.list(new QueryWrapper<TenPackChannalEntity>()
|
||||
// .eq("channal_code_xa",tenPackChannal.getChannalCodeXa()));
|
||||
// if(entities.size()>0){
|
||||
// return R.error("通道对接编码已注册");
|
||||
// }
|
||||
// }
|
||||
this.tenPackChannalService.updateById(tenPackChannal);
|
||||
return R.ok();
|
||||
}
|
||||
|
|
|
@ -74,6 +74,18 @@ public class TenPackController extends AbstractController {
|
|||
@RequiresPermissions({"ten:pack"})
|
||||
public R save(@RequestBody TenPackEntity tenPack) {
|
||||
tenPack.setTenantId(getUser().getTenantId());
|
||||
List<TenPackEntity> tenPackEntitys = tenPackService.list(new QueryWrapper<TenPackEntity>()
|
||||
.eq("park_code",tenPack.getParkCode()));
|
||||
if(tenPackEntitys.size()>0){
|
||||
return R.error("停车场编码已注册");
|
||||
}
|
||||
if(tenPack.getParkCodeXa()!=null && tenPack.getParkCodeXa().length()>0){
|
||||
tenPackEntitys = tenPackService.list(new QueryWrapper<TenPackEntity>()
|
||||
.eq("park_code_xa",tenPack.getParkCodeXa()));
|
||||
if(tenPackEntitys.size()>0){
|
||||
return R.error("停车场对接编码已注册");
|
||||
}
|
||||
}
|
||||
this.tenPackService.save(tenPack);
|
||||
return R.ok();
|
||||
}
|
||||
|
@ -82,6 +94,26 @@ public class TenPackController extends AbstractController {
|
|||
@ApiOperation(value = "修改")
|
||||
@RequiresPermissions({"ten:pack"})
|
||||
public R update(@RequestBody TenPackEntity tenPack) {
|
||||
|
||||
|
||||
TenPackEntity packEntity = tenPackService.getById(tenPack.getParkId());
|
||||
if(!packEntity.getParkCode().equals(tenPack.getParkCode())){
|
||||
List<TenPackEntity> tenPackEntitys = tenPackService.list(new QueryWrapper<TenPackEntity>()
|
||||
.eq("park_code",tenPack.getParkCode()));
|
||||
if(tenPackEntitys.size()>0){
|
||||
return R.error("停车场编码已注册");
|
||||
}
|
||||
}
|
||||
//
|
||||
//
|
||||
// if(tenPack.getParkCodeXa()!=null && tenPack.getParkCodeXa().length()>0){
|
||||
// tenPackEntitys = tenPackService.list(new QueryWrapper<TenPackEntity>()
|
||||
// .eq("park_code_xa",tenPack.getParkCodeXa()));
|
||||
// if(tenPackEntitys.size()>0){
|
||||
// return R.error("停车场对接编码已注册");
|
||||
// }
|
||||
// }
|
||||
|
||||
this.tenPackService.updateById(tenPack);
|
||||
return R.ok();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package net.shapelight.modules.ten.dao;
|
||||
|
||||
import net.shapelight.modules.ten.entity.TenTranEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Mapper
|
||||
public interface TenTranDao extends BaseMapper<TenTranEntity> {
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package net.shapelight.modules.ten.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@TableName("ten_tran")
|
||||
public class TenTranEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 交易id
|
||||
*/
|
||||
@TableId
|
||||
private Long tranId;
|
||||
/**
|
||||
* 交易时间
|
||||
*/
|
||||
private Date tranDate;
|
||||
/**
|
||||
* 交易内容
|
||||
*/
|
||||
private String tranContent;
|
||||
|
||||
/**
|
||||
* 内容回复
|
||||
*/
|
||||
private String tranResult;
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package net.shapelight.modules.ten.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import net.shapelight.common.utils.PageUtils;
|
||||
import net.shapelight.modules.ten.entity.TenTranEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface TenTranService extends IService<TenTranEntity> {
|
||||
|
||||
TenTranEntity saveApi(String url, Object jsonObject, String serviceId, String serviceValue, String appid, String secre);
|
||||
|
||||
}
|
||||
|
|
@ -262,6 +262,7 @@ public class TenDeviceServiceImpl extends ServiceImpl<TenDeviceDao, TenDeviceEnt
|
|||
}
|
||||
|
||||
@CacheEvict(value="TenDevice",allEntries = true)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean evictRemoveByIds(Collection<? extends Serializable> idList) {
|
||||
//删除同步人员
|
||||
for(Long devId: (List<Long>)idList){
|
||||
|
|
|
@ -61,24 +61,20 @@ public class TenPackRecordEnterServiceImpl extends ServiceImpl<TenPackRecordEnte
|
|||
}
|
||||
@Override
|
||||
public List<TenPackRecordEnterEntity> getNotSync(Long cellId) {
|
||||
String todayString = DateUtils.format(new Date(),DateUtils.DATE_PATTERN);
|
||||
String todayStart = todayString+" 00:00:00";
|
||||
String todayEnd = todayString+" 23:59:59";
|
||||
// String todayString = DateUtils.format(new Date(),DateUtils.DATE_PATTERN);
|
||||
// String todayStart = todayString+" 00:00:00";
|
||||
// String todayEnd = todayString+" 23:59:59";
|
||||
return this.list(new QueryWrapper<TenPackRecordEnterEntity>()
|
||||
.eq("cell_id",cellId)
|
||||
.eq("xa_sync",0)
|
||||
.gt("enter_time",todayStart)
|
||||
.lt("enter_time",todayEnd));
|
||||
.last(" and TO_DAYS(enter_time) = TO_DAYS(NOW())"));
|
||||
}
|
||||
@Override
|
||||
public List<TenPackRecordEnterEntity> getNotSyncImage(Long cellId) {
|
||||
String todayString = DateUtils.format(new Date(),DateUtils.DATE_PATTERN);
|
||||
String todayStart = todayString+" 00:00:00";
|
||||
String todayEnd = todayString+" 23:59:59";
|
||||
return this.list(new QueryWrapper<TenPackRecordEnterEntity>()
|
||||
.eq("cell_id",cellId)
|
||||
.eq("xa_sync_image",0)
|
||||
.gt("enter_time",todayStart)
|
||||
.lt("enter_time",todayEnd));
|
||||
.eq("xa_sync",1)
|
||||
.last(" and TO_DAYS(enter_time) = TO_DAYS(NOW())"));
|
||||
}
|
||||
}
|
|
@ -61,12 +61,15 @@ public class TenPackRecordExitServiceImpl extends ServiceImpl<TenPackRecordExitD
|
|||
public List<TenPackRecordExitEntity> getNotSync(Long cellId) {
|
||||
return this.list(new QueryWrapper<TenPackRecordExitEntity>()
|
||||
.eq("cell_id",cellId)
|
||||
.eq("xa_sync",0));
|
||||
.eq("xa_sync",0)
|
||||
.last(" and TO_DAYS(exit_time) = TO_DAYS(NOW())"));
|
||||
}
|
||||
@Override
|
||||
public List<TenPackRecordExitEntity> getNotSyncImage(Long cellId) {
|
||||
return this.list(new QueryWrapper<TenPackRecordExitEntity>()
|
||||
.eq("cell_id",cellId)
|
||||
.eq("xa_sync_image",0));
|
||||
.eq("xa_sync_image",0)
|
||||
.eq("xa_sync",1)
|
||||
.last(" and TO_DAYS(exit_time) = TO_DAYS(NOW())"));
|
||||
}
|
||||
}
|
|
@ -50,6 +50,7 @@ public class TenPersonSyncServiceImpl implements TenPersonSyncService {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void removeByDeviceId(Long deviceId,Long tenantId) {
|
||||
tenPersonSyncDao.removeByDeviceId(deviceId,tenantId);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package net.shapelight.modules.ten.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
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;
|
||||
import net.shapelight.common.utils.PageUtils;
|
||||
import net.shapelight.common.utils.Query;
|
||||
|
||||
import net.shapelight.modules.ten.dao.TenTranDao;
|
||||
import net.shapelight.modules.ten.entity.TenTranEntity;
|
||||
import net.shapelight.modules.ten.service.TenTranService;
|
||||
|
||||
|
||||
@Service("tenTranService")
|
||||
public class TenTranServiceImpl extends ServiceImpl<TenTranDao, TenTranEntity> implements TenTranService {
|
||||
|
||||
@Override
|
||||
public TenTranEntity saveApi(String url, Object jsonObject, String serviceId, String serviceValue, String appid, String secre) {
|
||||
TenTranEntity tranEntity = new TenTranEntity();
|
||||
tranEntity.setTranDate(new Date());
|
||||
Map<String,Object> contentMap = new HashMap<>();
|
||||
contentMap.put("url",url);
|
||||
contentMap.put("data",jsonObject);
|
||||
contentMap.put("serviceId",serviceId);
|
||||
contentMap.put("serviceValue",serviceValue);
|
||||
contentMap.put("appId",appid);
|
||||
contentMap.put("appSecret",secre);
|
||||
String content = JSONObject.toJSONString(contentMap);
|
||||
tranEntity.setTranContent(content);
|
||||
this.save(tranEntity);
|
||||
return tranEntity;
|
||||
}
|
||||
}
|
|
@ -97,7 +97,7 @@ public class XaApi {
|
|||
* @param secre
|
||||
* @return
|
||||
*/
|
||||
public static String httpPOSTJson(String url, String json, String serviceId, String serviceValue, String appid, String secre) {
|
||||
public static String httpPOSTJson(String url, String json, String serviceId, String serviceValue, String appid, String secre,String tranId) {
|
||||
String data = "";
|
||||
try {
|
||||
URL dataurl = new URL(url);
|
||||
|
@ -115,7 +115,7 @@ public class XaApi {
|
|||
|
||||
conn.setRequestProperty("appid", appid);
|
||||
conn.setRequestProperty("token", token);
|
||||
conn.setRequestProperty("tranId", "12312321312321321321312");//可固定这么写
|
||||
conn.setRequestProperty("tranId", tranId);//可固定这么写
|
||||
conn.setRequestProperty("serviceId", serviceId);
|
||||
conn.setRequestProperty("serviceValue", serviceValue);
|
||||
conn.setRequestProperty("versionCode", "");
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="net.shapelight.modules.ten.dao.TenTranDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<!-- <resultMap type="net.shapelight.modules.ten.entity.TenTranEntity" id="tenTranMap">-->
|
||||
<!-- <result property="tranId" column="tran_id"/>-->
|
||||
<!-- <result property="tranDate" column="tran_date"/>-->
|
||||
<!-- <result property="tranContent" column="tran_content"/>-->
|
||||
<!-- </resultMap>-->
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue