1.netty延时启动 2.获取doorcard getone重复数据bug 3.公安接口

This commit is contained in:
gaoben 2021-04-08 19:29:13 +08:00
parent 2fab6df4a4
commit f4a96f4fea
27 changed files with 849 additions and 236 deletions

View File

@ -291,7 +291,7 @@ public class CarOpenApi {
this.minioClient.putObject(this.minioConfig this.minioClient.putObject(this.minioConfig
.getBucketName(), fileName, is, putObjectOptions); .getBucketName(), fileName, is, putObjectOptions);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
fileName = ""; fileName = "";
} finally { } finally {
if (is != null) if (is != null)

View File

@ -4,6 +4,7 @@ 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;
import io.minio.MinioClient; import io.minio.MinioClient;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -18,21 +19,11 @@ import net.shapelight.common.utils.DateUtils;
import net.shapelight.modules.job.task.ITask; import net.shapelight.modules.job.task.ITask;
import net.shapelight.modules.sys.entity.SysUserEntity; import net.shapelight.modules.sys.entity.SysUserEntity;
import net.shapelight.modules.sys.service.SysUserService; import net.shapelight.modules.sys.service.SysUserService;
import net.shapelight.modules.ten.entity.TenCellEntity; import net.shapelight.modules.ten.entity.*;
import net.shapelight.modules.ten.entity.TenPackRecordEntity; import net.shapelight.modules.ten.service.*;
import net.shapelight.modules.ten.entity.TenPersonEntity;
import net.shapelight.modules.ten.entity.TenRecordEntity;
import net.shapelight.modules.ten.service.TenCellService;
import net.shapelight.modules.ten.service.TenDeviceService;
import net.shapelight.modules.ten.service.TenDoorCardService;
import net.shapelight.modules.ten.service.TenPackRecordService;
import net.shapelight.modules.ten.service.TenPersonService;
import net.shapelight.modules.ten.service.TenRecordService;
import net.shapelight.modules.ten.service.TenRoomService;
import net.shapelight.modules.xian.service.XaApi; import net.shapelight.modules.xian.service.XaApi;
import net.shapelight.modules.xian.vo.XaRYJCZPXX; import net.shapelight.modules.xian.utils.XaUtils;
import net.shapelight.modules.xian.vo.XaRYRKPHOTO; import net.shapelight.modules.xian.vo.*;
import net.shapelight.modules.xian.vo.XaTCCTCSBZPXX;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -61,6 +52,8 @@ public class XaImageTask implements ITask {
private MinioConfig minioConfig; private MinioConfig minioConfig;
@Autowired @Autowired
private MinioClient minioClient; private MinioClient minioClient;
@Autowired
private TenAddressService tenAddressService;
public void run(String params) { public void run(String params) {
log.debug("xaImageTask定时任务正在执行", params); log.debug("xaImageTask定时任务正在执行", params);
@ -75,7 +68,6 @@ public class XaImageTask implements ITask {
String fwikUrl = XaApi.getFwikUrl(appId, appSecret); String fwikUrl = XaApi.getFwikUrl(appId, appSecret);
if (fwikUrl != null) { if (fwikUrl != null) {
List<TenCellEntity> allCells = this.tenCellService.list((Wrapper) (new QueryWrapper()) List<TenCellEntity> allCells = this.tenCellService.list((Wrapper) (new QueryWrapper())
.eq("tenant_id", sysTenUser.getTenantId())); .eq("tenant_id", sysTenUser.getTenantId()));
Long tenantId = sysTenUser.getTenantId(); Long tenantId = sysTenUser.getTenantId();
for (TenCellEntity cellEntity : allCells) { for (TenCellEntity cellEntity : allCells) {
@ -90,112 +82,342 @@ public class XaImageTask implements ITask {
log.debug("xaImageTask定时任务执行完毕"); log.debug("xaImageTask定时任务执行完毕");
} }
private void processRecordPerson(String appId, String appSecret, String xqid, String fwikUrl, Long cellId, Long tenantId) {
//人员出入记录
private void processRecordPersonImage(String appId, String appSecret, String xqid, String fwikUrl, Long cellId, Long tenantId) {
List<TenRecordEntity> records = this.tenRecordService.getNotSyncImage(cellId, tenantId); List<TenRecordEntity> records = this.tenRecordService.getNotSyncImage(cellId, tenantId);
List<XaRYJCZPXX> syncrecords = new ArrayList<>(); List<XaRYJCZPXX> syncRecords = new ArrayList();
List<TenRecordEntity> updateRecords = new ArrayList<>();
int count = 0; int count = 0;
for (TenRecordEntity record : records) { for (TenRecordEntity record : records) {
XaRYJCZPXX syncRecord = new XaRYJCZPXX(); XaRYJCZPXX syncRecord = new XaRYJCZPXX();
syncRecord.setLV_ZPSJ(DateUtils.format(record.getRecordTime(), "yyyyMMdd24HHmmss")); // TenRoomEntity roomEntity = tenRoomService.getById(person.getRoomId(), person.getCellId());
syncRecord.setLV_MJXTWYBM(record.getRecordId().toString()); // TenAddressEntity addressEntity = tenAddressService.getById(roomEntity.getRoomId());
String faceUrl = record.getRecordFace();
if (faceUrl != null && !faceUrl.isEmpty()) { TenAddressEntity addressEntity = tenAddressService.getOne(new QueryWrapper<TenAddressEntity>()
String encode = ""; .eq("xqid", xqid).last("LIMIT 1"));
String ssxqbm = addressEntity.getSsxqbm();
syncRecord.setLV_SSXQBM(ssxqbm); //小区申报编码
syncRecord.setLV_ZPSJ(DateUtils.format(record.getRecordTime(), "yyyyMMddHHmmss"));
syncRecord.setLV_MJXTWYBM(record.getRecordId() + "");//出入记录主键
String base64Image = "";
InputStream inStream = null; InputStream inStream = null;
ByteArrayOutputStream outStream = null; ByteArrayOutputStream outStream = null;
try { try {
this.minioClient.statObject(this.minioConfig.getBucketName(), faceUrl); minioClient.statObject(minioConfig.getBucketName(), record.getRecordFace());
inStream = this.minioClient.getObject(this.minioConfig.getBucketName(), faceUrl);
inStream = minioClient.getObject(minioConfig.getBucketName(), record.getRecordFace());
outStream = new ByteArrayOutputStream(); outStream = new ByteArrayOutputStream();
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];
int length; int length;
while ((length = inStream.read(buffer)) != -1) while ((length = inStream.read(buffer)) != -1) {
outStream.write(buffer, 0, length); outStream.write(buffer, 0, length);
encode = Base64.getEncoder().encodeToString(outStream.toByteArray()); }
syncRecord.setLV_ZPSJ(encode); base64Image = Base64.getEncoder().encodeToString(outStream.toByteArray());
} catch (Exception e) { } catch (Exception e) {
log.error("底库不存在"+ faceUrl); log.error("照片不存在:" + record.getRecordFace());
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
if (inStream != null) if (inStream != null) {
try { try {
inStream.close(); inStream.close();
} catch (IOException e) { } catch (IOException e) {
log.debug("inputStream close IOException:" + e.getMessage()); log.error("inputStream close IOException:" + e.getMessage());
} }
if (outStream != null) }
if (outStream != null) {
try { try {
outStream.close(); outStream.close();
} catch (IOException e) { } catch (IOException e) {
log.debug("outStream close IOException:" + e.getMessage()); log.error("outStream close IOException:" + e.getMessage());
} }
} }
} }
syncrecords.add(syncRecord);
count++;
if (count >= 60)
break;
}
}
private void processRecordCar(String appId, String appSecret, String xqid, String fwikUrl, Long cellId) { if (base64Image.length() == 0) {
List<TenPackRecordEntity> records = this.tenPackRecordService.getNotSync(cellId); continue;
List<XaTCCTCSBZPXX> syncrecords = new ArrayList<>(); }
int count = 0;
for (TenPackRecordEntity record : records) { syncRecord.setLV_ZPZP(base64Image);//base64图片
XaTCCTCSBZPXX syncRecord = new XaTCCTCSBZPXX();
syncRecord.setLV_ZPSJ(DateUtils.format(record.getInTime(), "yyyyMMdd24HHmmss")); syncRecords.add(syncRecord);
syncrecords.add(syncRecord); updateRecords.add(record);
count++; count++;
if (count >= 60) if (count >= 30)
break; 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, "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";
// System.out.println(s);
log.debug("上传人员识别记录返回数据:" + resJson);
//上传成功修改sync状态
if (resJson.contains("\"code\":\"0000\"")) {
for (TenRecordEntity recordEntity : updateRecords) {
recordEntity.setXaSyncImage(1);
tenRecordService.updateById(recordEntity);
}
}
} }
private void processPerson(String appId, String appSecret, String xqid, String fwikUrl, Long cellId) { // 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("pack_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\"}]}";
// 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("pack_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\"}]}";
// 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);
// }
// }
// }
private void processRealPersonImage(String appId, String appSecret, String xqid, String fwikUrl, Long cellId) {
List<TenPersonEntity> persons = this.tenPersonService.getNotSyncImage(cellId); List<TenPersonEntity> persons = this.tenPersonService.getNotSyncImage(cellId);
List<XaRYRKPHOTO> syncPersons = new ArrayList<>(); List<XaRYRKPHOTO> syncPersons = new ArrayList();
List<TenPersonEntity> updatePersons = new ArrayList<>();
int count = 0; int count = 0;
for (TenPersonEntity person : persons) { for (TenPersonEntity person : persons) {
XaRYRKPHOTO syncPerson = new XaRYRKPHOTO(); XaRYRKPHOTO realPerson = new XaRYRKPHOTO();
syncPerson.setLV_GMSFHM(person.getIdCard()); TenRoomEntity roomEntity = tenRoomService.getById(person.getRoomId(), person.getCellId());
syncPerson.setLV_DJSJ(DateUtils.format(new Date(), "yyyyMMdd24HHmmss")); TenAddressEntity addressEntity = tenAddressService.getById(roomEntity.getRoomId());
String faceUrl = person.getFaceImage();
if (faceUrl != null && !faceUrl.isEmpty()) { realPerson.setLV_CASE_ID(person.getUuid()); //实有人口编码
String encode = ""; realPerson.setLV_GMSFHM(person.getIdCard()); //身份证号
realPerson.setLV_DJSJ(DateUtils.format(new Date(), "yyyyMMddHHmmss"));
realPerson.setLV_SSXQBM(addressEntity.getSsxqbm());
String base64Image = "";
InputStream inStream = null; InputStream inStream = null;
ByteArrayOutputStream outStream = null; ByteArrayOutputStream outStream = null;
try { try {
this.minioClient.statObject(this.minioConfig.getBucketName(), faceUrl); minioClient.statObject(minioConfig.getBucketName(), person.getOrgImage());
inStream = this.minioClient.getObject(this.minioConfig.getBucketName(), faceUrl);
inStream = minioClient.getObject(minioConfig.getBucketName(), person.getOrgImage());
outStream = new ByteArrayOutputStream(); outStream = new ByteArrayOutputStream();
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];
int length; int length;
while ((length = inStream.read(buffer)) != -1) while ((length = inStream.read(buffer)) != -1) {
outStream.write(buffer, 0, length); outStream.write(buffer, 0, length);
encode = Base64.getEncoder().encodeToString(outStream.toByteArray()); }
syncPerson.setLV_ZP(encode); base64Image = Base64.getEncoder().encodeToString(outStream.toByteArray());
} catch (Exception e) { } catch (Exception e) {
log.error("底库不存在"+ faceUrl); log.error("照片不存在:" + person.getOrgImage());
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
if (inStream != null) if (inStream != null) {
try { try {
inStream.close(); inStream.close();
} catch (IOException e) { } catch (IOException e) {
log.debug("inputStream close IOException:" + e.getMessage()); log.error("inputStream close IOException:" + e.getMessage());
} }
if (outStream != null) }
if (outStream != null) {
try { try {
outStream.close(); outStream.close();
} catch (IOException e) { } catch (IOException e) {
log.debug("outStream close IOException:" + e.getMessage()); log.error("outStream close IOException:" + e.getMessage());
} }
} }
} }
if (base64Image.length() == 0) {
continue;
}
realPerson.setLV_ZP(base64Image);
syncPersons.add(realPerson);
updatePersons.add(person);
count++; count++;
if (count >= 60) if (count >= 50)
break; break;
}
XaData jsonData = new XaData();
jsonData.setDatas(syncPersons);
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, "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";
// System.out.println(s);
log.debug("上传实有房屋返回数据:" + resJson);
//上传成功修改sync状态
if (resJson.contains("\"code\":\"0000\"")) {
for (TenPersonEntity personEntity : updatePersons) {
personEntity.setXaSyncImage(1);
tenPersonService.updateNonal(personEntity);
}
} }
} }
} }

View File

@ -63,9 +63,13 @@ public class XaRealDataTask implements ITask {
String xqid = cellEntity.getThirdId(); String xqid = cellEntity.getThirdId();
Long cellId = cellEntity.getCellId(); Long cellId = cellEntity.getCellId();
if (xqid != null && xqid.length() > 0) { if (xqid != null && xqid.length() > 0) {
//实有房屋
processRealRoom(appId, appSecret, xqid, fwikUrl, cellId); processRealRoom(appId, appSecret, xqid, fwikUrl, cellId);
//门禁
processDoorCard(appId, appSecret, xqid, fwikUrl, cellId); processDoorCard(appId, appSecret, xqid, fwikUrl, cellId);
//实有人口
processRealPerson(appId, appSecret, xqid, fwikUrl, cellId); processRealPerson(appId, appSecret, xqid, fwikUrl, cellId);
//门禁设备
processDevice(appId, appSecret, xqid, fwikUrl, cellId); processDevice(appId, appSecret, xqid, fwikUrl, cellId);
} }
} }
@ -185,6 +189,9 @@ public class XaRealDataTask implements ITask {
} }
String syrkbm = String.format("10%s%012d", idcard, addressEntity.getPId());//证件类型10+身份证号(18位)+p_id(12位) String syrkbm = String.format("10%s%012d", idcard, addressEntity.getPId());//证件类型10+身份证号(18位)+p_id(12位)
person.setUuid(syrkbm);
realPerson.setLV_SYRKBM(syrkbm); //实有人口编码 realPerson.setLV_SYRKBM(syrkbm); //实有人口编码
realPerson.setLV_GMSFHM(person.getIdCard()); //身份证号 realPerson.setLV_GMSFHM(person.getIdCard()); //身份证号
realPerson.setLV_XM(person.getName()); //姓名 realPerson.setLV_XM(person.getName()); //姓名

View File

@ -4,6 +4,7 @@ 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;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -11,19 +12,11 @@ import net.shapelight.common.utils.DateUtils;
import net.shapelight.modules.job.task.ITask; import net.shapelight.modules.job.task.ITask;
import net.shapelight.modules.sys.entity.SysUserEntity; import net.shapelight.modules.sys.entity.SysUserEntity;
import net.shapelight.modules.sys.service.SysUserService; import net.shapelight.modules.sys.service.SysUserService;
import net.shapelight.modules.ten.entity.TenCellEntity; import net.shapelight.modules.ten.entity.*;
import net.shapelight.modules.ten.entity.TenPackRecordEntity; import net.shapelight.modules.ten.service.*;
import net.shapelight.modules.ten.entity.TenRecordEntity;
import net.shapelight.modules.ten.service.TenCellService;
import net.shapelight.modules.ten.service.TenDeviceService;
import net.shapelight.modules.ten.service.TenDoorCardService;
import net.shapelight.modules.ten.service.TenPackRecordService;
import net.shapelight.modules.ten.service.TenPersonService;
import net.shapelight.modules.ten.service.TenRecordService;
import net.shapelight.modules.ten.service.TenRoomService;
import net.shapelight.modules.xian.service.XaApi; import net.shapelight.modules.xian.service.XaApi;
import net.shapelight.modules.xian.vo.XaRYSKZPXX; import net.shapelight.modules.xian.utils.XaUtils;
import net.shapelight.modules.xian.vo.XaTCCTCSBXX; import net.shapelight.modules.xian.vo.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -37,7 +30,15 @@ public class XaRecordTask implements ITask {
@Autowired @Autowired
private TenRecordService tenRecordService; private TenRecordService tenRecordService;
@Autowired @Autowired
private TenPackRecordService tenPackRecordService; private TenPackRecordEnterService tenPackRecordEnterService;
@Autowired
private TenPackRecordExitService tenPackRecordExitService;
@Autowired
private TenAddressService tenAddressService;
@Autowired
private TenPackService tenPackService;
@Autowired
private TenPackChannalService tenPackChannalService;
public void run(String params) { public void run(String params) {
log.debug("xaRecordTask{}", params); log.debug("xaRecordTask{}", params);
@ -49,16 +50,23 @@ public class XaRecordTask implements ITask {
if (type.intValue() == 1) { if (type.intValue() == 1) {
String appId = object.getString("appId"); String appId = object.getString("appId");
String appSecret = object.getString("appSecret"); String appSecret = object.getString("appSecret");
String fwikUrl = XaApi.getFwikUrl(appId, appSecret); // String fwikUrl = XaApi.getFwikUrl(appId, appSecret);
String fwikUrl = "http://";
if (fwikUrl != null) { if (fwikUrl != null) {
List<TenCellEntity> allCells = this.tenCellService.list((Wrapper)(new QueryWrapper()) List<TenCellEntity> allCells = this.tenCellService.list((Wrapper)(new QueryWrapper())
.eq("tenant_id", sysTenUser.getTenantId())); .eq("tenant_id", sysTenUser.getTenantId()));
Long tenantId = sysTenUser.getTenantId(); Long tenantId = sysTenUser.getTenantId();
for (TenCellEntity cellEntity : allCells) { for (TenCellEntity cellEntity : allCells) {
String xqid = cellEntity.getThirdId(); String xqid = cellEntity.getThirdId();
Long cellId = cellEntity.getCellId(); Long cellId = cellEntity.getCellId();
if (xqid == null || xqid.length() > 0); if (xqid == null || xqid.length() > 0){
//人员出入记录
processRecordPerson(appId, appSecret, xqid, fwikUrl, cellId,tenantId);
//车辆进入记录
processRecordCarEnter(appId, appSecret, xqid, fwikUrl, cellId);
//车辆出场记录
processRecordCarExit(appId, appSecret, xqid, fwikUrl, cellId);
}
} }
} }
} }
@ -68,42 +76,214 @@ public class XaRecordTask implements ITask {
} }
private void processRecordPerson(String appId, String appSecret, String xqid, String fwikUrl, Long cellId, Long tenantId) { private void processRecordPerson(String appId, String appSecret, String xqid, String fwikUrl, Long cellId, Long tenantId) {
List<TenRecordEntity> records = this.tenRecordService.getNotSync(cellId,tenantId); List<TenRecordEntity> records = this.tenRecordService.getNotSync(cellId,tenantId);
List<XaRYSKZPXX> syncrecords = new ArrayList<>(); List<XaRYSKZPXX> syncRecords = new ArrayList();
List<TenRecordEntity> updateRecords = new ArrayList<>();
int count = 0; int count = 0;
for (TenRecordEntity record : records) { for (TenRecordEntity record : records) {
XaRYSKZPXX syncRecord = new XaRYSKZPXX(); XaRYSKZPXX syncRecord = new XaRYSKZPXX();
// TenRoomEntity roomEntity = tenRoomService.getById(person.getRoomId(), person.getCellId());
// TenAddressEntity addressEntity = tenAddressService.getById(roomEntity.getRoomId());
TenAddressEntity addressEntity = tenAddressService.getOne(new QueryWrapper<TenAddressEntity>()
.eq("xqid",xqid).last("LIMIT 1"));
String ssxqbm = addressEntity.getSsxqbm();
syncRecord.setLV_SSXQBM(ssxqbm); //小区申报编码
syncRecord.setLV_MJBH(record.getDeviceSn()); syncRecord.setLV_MJBH(record.getDeviceSn());
syncRecord.setLV_CRLB("1"); syncRecord.setLV_CRLB("1");//1进2出
syncRecord.setLV_ZPSJ(DateUtils.format(record.getRecordTime(), "yyyyMMdd24HHmmss")); syncRecord.setLV_ZPSJ(DateUtils.format(record.getRecordTime(), "yyyyMMddHHmmss"));
syncRecord.setLV_SBXT("10"); syncRecord.setLV_SBXT("10");//申报系统,默认10
syncRecord.setLV_MJXTWYBM(record.getRecordId().toString()); syncRecord.setLV_MJXTWYBM(record.getRecordId()+"");//出入记录主键
syncRecord.setLV_RY_ID(record.getPersonId().toString()); syncRecord.setLV_RY_ID(record.getPersonId()+"");
syncRecord.setLV_FFMS("1"); syncRecord.setLV_FFMS("1");//1住户2访客
syncRecord.setLV_PROCMODE("PMINSERT"); syncRecord.setLV_PROCMODE("PMINSERT");
syncrecords.add(syncRecord);
syncRecords.add(syncRecord);
updateRecords.add(record);
count++; count++;
if (count >= 60) if (count >= 30)
break; 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, "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";
// System.out.println(s);
log.debug("上传人员识别记录返回数据:" + resJson);
//上传成功修改sync状态
if (resJson.contains("\"code\":\"0000\"")) {
for (TenRecordEntity recordEntity : updateRecords) {
recordEntity.setXaSync(1);
tenRecordService.updateById(recordEntity);
}
}
} }
private void processRecordCar(String appId, String appSecret, String xqid, String fwikUrl, Long cellId) { private void processRecordCarEnter(String appId, String appSecret, String xqid, String fwikUrl, Long cellId) {
List<TenPackRecordEntity> records = this.tenPackRecordService.getNotSync(cellId); List<TenPackRecordEnterEntity> records = this.tenPackRecordEnterService.getNotSync(cellId);
List<XaTCCTCSBXX> syncrecords = new ArrayList<>(); List<XaTCCTCSBXX> syncRecords = new ArrayList();
List<TenPackRecordEnterEntity> updateRecords = new ArrayList<>();
int count = 0; int count = 0;
for (TenPackRecordEntity record : records) { for (TenPackRecordEnterEntity record : records) {
XaTCCTCSBXX syncRecord = new XaTCCTCSBXX(); XaTCCTCSBXX syncRecord = new XaTCCTCSBXX();
syncRecord.setLV_CPHM(record.getVlp());
syncRecord.setLV_CPLX(record.getVTypeName()); TenPackEntity packEntity = tenPackService.getOne(new QueryWrapper<TenPackEntity>()
syncRecord.setLV_GCSJ(DateUtils.format(record.getInTime(), "YYYYMMDDHHMMSS")); .eq("pack_code",record.getParkCode()));
syncRecord.setLV_GCLX("1");
syncRecord.setLV_SBXT("10"); 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"); syncRecord.setLV_PROCMODE("PMINSERT");
syncrecords.add(syncRecord);
syncRecords.add(syncRecord);
updateRecords.add(record);
count++; count++;
if (count >= 60) if (count >= 30)
break; 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\"}]}";
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 processRecordCarExit(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("pack_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\"}]}";
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);
}
}
}
}

View File

@ -3,6 +3,7 @@ package net.shapelight.modules.nettyapi.config;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import io.netty.util.AttributeKey; import io.netty.util.AttributeKey;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Collection; import java.util.Collection;
@ -11,6 +12,7 @@ import java.util.concurrent.ConcurrentHashMap;
@Component @Component
@Data @Data
@Slf4j
public class ClientMap { public class ClientMap {
//用户id=>channel示例 //用户id=>channel示例
@ -43,6 +45,12 @@ public class ClientMap {
this.channelMap.put(userId, channel); this.channelMap.put(userId, channel);
AttributeKey<String> key = AttributeKey.valueOf("user"); AttributeKey<String> key = AttributeKey.valueOf("user");
channel.attr(key).set(userId); channel.attr(key).set(userId);
StringBuffer loginBuf = new StringBuffer();
for (String sn : this.channelMap.keySet()) {
loginBuf.append(sn+"----");
}
log.debug("当前登录:"+loginBuf.toString()+"\n\n");
} }
/** /**

View File

@ -40,7 +40,7 @@ public class MyServer {
// Encoder // Encoder
pipeline.addLast("encoder", new MyMessageEncoder()); pipeline.addLast("encoder", new MyMessageEncoder());
//pipeline.addLast("idleStateHandler", new IdleStateHandler(6, 3, 0));//心跳机制 //pipeline.addLast("idleStateHandler", new IdleStateHandler(6, 3, 0));//心跳机制
pipeline.addLast("idleStateHandler", new IdleStateHandler(40, 40, 40));//心跳机制 pipeline.addLast("idleStateHandler", new IdleStateHandler(40, 0, 0));//心跳机制
pipeline.addLast(new MyServerHandler()); pipeline.addLast(new MyServerHandler());
} }
}).option(ChannelOption.SO_BACKLOG, 128) // (5)//BACKLOG用于构造服务端套接字ServerSocket对象标识当服务器请求处理线程全满时用于临时存放已完成三次握手的请求的队列的最大长度如果未设置或所设置的值小于1Java将使用默认值50 }).option(ChannelOption.SO_BACKLOG, 128) // (5)//BACKLOG用于构造服务端套接字ServerSocket对象标识当服务器请求处理线程全满时用于临时存放已完成三次握手的请求的队列的最大长度如果未设置或所设置的值小于1Java将使用默认值50

View File

@ -1,5 +1,6 @@
package net.shapelight.modules.nettyapi.config; package net.shapelight.modules.nettyapi.config;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler; import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.group.ChannelGroup; import io.netty.channel.group.ChannelGroup;
@ -58,17 +59,26 @@ public class MyServerHandler extends SimpleChannelInboundHandler<MyMessage> {
@Override @Override
public void handlerAdded(ChannelHandlerContext ctx) throws Exception { public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
clients.add(ctx.channel()); clients.add(ctx.channel());
StringBuffer logBuf = new StringBuffer();
for(Channel channel: clients){
logBuf.append(channel.remoteAddress()+"\n");
}
log.debug("当前连接:"+logBuf.toString());
} }
// 移除对应客户端的channel // 移除对应客户端的channel
@Override @Override
public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
// 长短id // 长短id
System.out.println(ctx.channel().id().asLongText()); // System.out.println("移除客户端"+ctx.channel().id().asLongText());
System.out.println(ctx.channel().id().asShortText()); // System.out.println(ctx.channel().id().asShortText());
log.debug("移除客户端长id:"+ctx.channel().id().asLongText()+" 短id"+ctx.channel().id().asShortText());
clients.remove(ctx.channel()); clients.remove(ctx.channel());
clientMap.offline(ctx.channel()); clientMap.offline(ctx.channel());
log.info("客户端断开");
} }
/** /**
@ -91,7 +101,7 @@ public class MyServerHandler extends SimpleChannelInboundHandler<MyMessage> {
if (e.state() == IdleState.READER_IDLE) {//没收到任何数据就关掉链接 if (e.state() == IdleState.READER_IDLE) {//没收到任何数据就关掉链接
ctx.close(); ctx.close();
clientMap.offline(ctx.channel()); clientMap.offline(ctx.channel());
log.info("无数据设备离线"); log.debug("无数据设备离线");
} else if (e.state() == IdleState.WRITER_IDLE) { } else if (e.state() == IdleState.WRITER_IDLE) {
} }
} }

View File

@ -107,6 +107,7 @@ public class StartInit implements ServletContextListener {
new Thread() { new Thread() {
public void run() { public void run() {
try { try {
sleep(20000);
server.run(); server.run();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -291,11 +291,15 @@ public class DeviceApiServiceImpl implements DeviceApiService {
if(doorCardEntity!=null){ if(doorCardEntity!=null){
puser.setCard_id(doorCardEntity.getDoorCard()); puser.setCard_id(doorCardEntity.getDoorCard());
}else{ }else{
TenDoorCardEntity doorCardRoom = tenDoorCardService.getOne( List<TenDoorCardEntity> doorCardRooms = tenDoorCardService.list(
new QueryWrapper<TenDoorCardEntity>() new QueryWrapper<TenDoorCardEntity>()
.eq("room_id",p.getRoomId()) .eq("room_id",p.getRoomId())
); );
if(doorCardEntity!=null){ TenDoorCardEntity doorCardRoom = null;
if(doorCardRooms.size()>0){
doorCardRoom = doorCardRooms.get(0);
}
if(doorCardRoom!=null){
puser.setCard_id(doorCardRoom.getDoorCard()); puser.setCard_id(doorCardRoom.getDoorCard());
} }

View File

@ -64,8 +64,10 @@ public class ServerApiServiceImpl implements ServerApiService {
@Override @Override
public int personOperation(String sn,List<TenPersonOperationVo> operationVoList) { public int personOperation(String sn,List<TenPersonOperationVo> operationVoList) {
log.debug("下发同步信息:"+sn);
Channel channel = clientMap.getChannelByUserId(sn); Channel channel = clientMap.getChannelByUserId(sn);
if(channel == null){ if(channel == null){
log.debug("下发同步信息:"+sn+" 不在线");
return -1; return -1;
} }
String content = JSONObject.toJSONString(operationVoList); String content = JSONObject.toJSONString(operationVoList);

View File

@ -2,11 +2,17 @@ package net.shapelight.modules.ten.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map; import java.util.Map;
import net.shapelight.common.utils.PageUtils; import net.shapelight.common.utils.PageUtils;
import net.shapelight.modules.ten.entity.TenPackRecordEnterEntity; import net.shapelight.modules.ten.entity.TenPackRecordEnterEntity;
import net.shapelight.modules.ten.entity.TenRecordEntity;
public interface TenPackRecordEnterService extends IService<TenPackRecordEnterEntity> { public interface TenPackRecordEnterService extends IService<TenPackRecordEnterEntity> {
PageUtils queryPage(Map<String, Object> paramMap); PageUtils queryPage(Map<String, Object> paramMap);
List<TenPackRecordEnterEntity> getNotSync(Long cellId);
List<TenPackRecordEnterEntity> getNotSyncImage(Long cellId);
} }

View File

@ -2,11 +2,18 @@ package net.shapelight.modules.ten.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map; import java.util.Map;
import net.shapelight.common.utils.PageUtils; import net.shapelight.common.utils.PageUtils;
import net.shapelight.modules.ten.entity.TenPackRecordExitEntity; import net.shapelight.modules.ten.entity.TenPackRecordExitEntity;
import net.shapelight.modules.ten.entity.TenRecordEntity;
public interface TenPackRecordExitService extends IService<TenPackRecordExitEntity> { public interface TenPackRecordExitService extends IService<TenPackRecordExitEntity> {
PageUtils queryPage(Map<String, Object> paramMap); PageUtils queryPage(Map<String, Object> paramMap);
List<TenPackRecordExitEntity> getNotSync(Long cellId);
List<TenPackRecordExitEntity> getNotSyncImage(Long cellId);
} }

View File

@ -34,9 +34,9 @@ public interface TenRecordService {
List<TenRecordEntity> getLastRecord(Map<String, Object> params); List<TenRecordEntity> getLastRecord(Map<String, Object> params);
List<TenRecordEntity> getNotSync(Long paramLong1, Long paramLong2); List<TenRecordEntity> getNotSync(Long cellId, Long tenantId);
List<TenRecordEntity> getNotSyncImage(Long paramLong1, Long paramLong2); List<TenRecordEntity> getNotSyncImage(Long cellId, Long tenantId);
} }

View File

@ -6,14 +6,18 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import net.shapelight.common.utils.DateUtils;
import net.shapelight.common.utils.PageUtils; import net.shapelight.common.utils.PageUtils;
import net.shapelight.common.utils.Query; import net.shapelight.common.utils.Query;
import net.shapelight.modules.ten.dao.TenPackRecordEnterDao; import net.shapelight.modules.ten.dao.TenPackRecordEnterDao;
import net.shapelight.modules.ten.entity.TenCellEntity; import net.shapelight.modules.ten.entity.TenCellEntity;
import net.shapelight.modules.ten.entity.TenPackChannalEntity; import net.shapelight.modules.ten.entity.TenPackChannalEntity;
import net.shapelight.modules.ten.entity.TenPackRecordEnterEntity; import net.shapelight.modules.ten.entity.TenPackRecordEnterEntity;
import net.shapelight.modules.ten.entity.TenRecordEntity;
import net.shapelight.modules.ten.service.TenCellService; import net.shapelight.modules.ten.service.TenCellService;
import net.shapelight.modules.ten.service.TenPackRecordEnterService; import net.shapelight.modules.ten.service.TenPackRecordEnterService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -55,4 +59,26 @@ public class TenPackRecordEnterServiceImpl extends ServiceImpl<TenPackRecordEnte
} }
return new PageUtils(page); return new PageUtils(page);
} }
@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";
return this.list(new QueryWrapper<TenPackRecordEnterEntity>()
.eq("cell_id",cellId)
.eq("xa_sync",0)
.gt("enter_time",todayStart)
.lt("enter_time",todayEnd));
}
@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));
}
} }

View File

@ -14,6 +14,7 @@ import net.shapelight.modules.ten.dao.TenPackRecordExitDao;
import net.shapelight.modules.ten.entity.TenCellEntity; import net.shapelight.modules.ten.entity.TenCellEntity;
import net.shapelight.modules.ten.entity.TenPackRecordEnterEntity; import net.shapelight.modules.ten.entity.TenPackRecordEnterEntity;
import net.shapelight.modules.ten.entity.TenPackRecordExitEntity; import net.shapelight.modules.ten.entity.TenPackRecordExitEntity;
import net.shapelight.modules.ten.entity.TenRecordEntity;
import net.shapelight.modules.ten.service.TenCellService; import net.shapelight.modules.ten.service.TenCellService;
import net.shapelight.modules.ten.service.TenPackRecordExitService; import net.shapelight.modules.ten.service.TenPackRecordExitService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -55,4 +56,17 @@ public class TenPackRecordExitServiceImpl extends ServiceImpl<TenPackRecordExitD
} }
return new PageUtils(page); return new PageUtils(page);
} }
@Override
public List<TenPackRecordExitEntity> getNotSync(Long cellId) {
return this.list(new QueryWrapper<TenPackRecordExitEntity>()
.eq("cell_id",cellId)
.eq("xa_sync",0));
}
@Override
public List<TenPackRecordExitEntity> getNotSyncImage(Long cellId) {
return this.list(new QueryWrapper<TenPackRecordExitEntity>()
.eq("cell_id",cellId)
.eq("xa_sync_image",0));
}
} }

View File

@ -1,36 +1,51 @@
package net.shapelight.modules.xian.vo; package net.shapelight.modules.xian.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data; import lombok.Data;
@Data @Data
public class XaCYRY { public class XaCYRY {
@JSONField(name="LV_CYRYBM")
private String LV_CYRYBM; private String LV_CYRYBM;
@JSONField(name="LV_GMSFHM")
private String LV_GMSFHM; private String LV_GMSFHM;
@JSONField(name="LV_XM")
private String LV_XM; private String LV_XM;
@JSONField(name="LV_DWBM")
private String LV_DWBM; private String LV_DWBM;
@JSONField(name="LV_DWMC")
private String LV_DWMC; private String LV_DWMC;
@JSONField(name="LV_ZY")
private String LV_ZY; private String LV_ZY;
@JSONField(name="LV_ZYLB")
private String LV_ZYLB; private String LV_ZYLB;
@JSONField(name="LV_DJDWGAJGJGDM")
private String LV_DJDWGAJGJGDM; private String LV_DJDWGAJGJGDM;
@JSONField(name="LV_DJDWGAJGJGMC")
private String LV_DJDWGAJGJGMC; private String LV_DJDWGAJGJGMC;
@JSONField(name="LV_DJR")
private String LV_DJR; private String LV_DJR;
@JSONField(name="LV_DJSJ")
private String LV_DJSJ; private String LV_DJSJ;
@JSONField(name="LV_LXFS")
private String LV_LXFS; private String LV_LXFS;
@JSONField(name="LV_COMPUTERID")
private String LV_COMPUTERID; private String LV_COMPUTERID;
@JSONField(name="LV_PROCMODE")
private String LV_PROCMODE = "PMINSERT"; private String LV_PROCMODE = "PMINSERT";
} }

View File

@ -1,21 +1,30 @@
package net.shapelight.modules.xian.vo; package net.shapelight.modules.xian.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data; import lombok.Data;
@Data @Data
public class XaMJKXX { public class XaMJKXX {
@JSONField(name="LV_MJKLX")
private String LV_MJKLX; private String LV_MJKLX;
@JSONField(name="LV_DJSJ")
private String LV_DJSJ; private String LV_DJSJ;
@JSONField(name="LV_SSXQBM")
private String LV_SSXQBM; private String LV_SSXQBM;
@JSONField(name="LV_SBXT")
private String LV_SBXT; private String LV_SBXT;
@JSONField(name="LV_CKR")
private String LV_CKR; private String LV_CKR;
@JSONField(name="LV_BH")
private String LV_BH; private String LV_BH;
@JSONField(name="LV_PROCMODE")
private String LV_PROCMODE = "PMINSERT"; private String LV_PROCMODE = "PMINSERT";
} }

View File

@ -1,23 +1,31 @@
package net.shapelight.modules.xian.vo; package net.shapelight.modules.xian.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data; import lombok.Data;
@Data @Data
public class XaMJSBXX { public class XaMJSBXX {
@JSONField(name="LV_MJMC")
private String LV_MJMC; private String LV_MJMC;
@JSONField(name="LV_WZMS")
private String LV_WZMS; private String LV_WZMS;
@JSONField(name="LV_SFYSXT")
private String LV_SFYSXT; private String LV_SFYSXT;
@JSONField(name="LV_SSXQBM")
private String LV_SSXQBM; private String LV_SSXQBM;
@JSONField(name="LV_SBXT")
private String LV_SBXT; private String LV_SBXT;
@JSONField(name="LV_MJXTWYBM")
private String LV_MJXTWYBM; private String LV_MJXTWYBM;
@JSONField(name="LV_PROCMODE")
private String LV_PROCMODE = "PMINSERT"; private String LV_PROCMODE = "PMINSERT";
} }

View File

@ -1,18 +1,23 @@
package net.shapelight.modules.xian.vo; package net.shapelight.modules.xian.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data; import lombok.Data;
@Data @Data
public class XaRYJCZPXX { public class XaRYJCZPXX {
@JSONField(name="LV_SSXQBM")
private String LV_SSXQBM; private String LV_SSXQBM;
@JSONField(name="LV_MJXTWYBM")
private String LV_MJXTWYBM; private String LV_MJXTWYBM;
@JSONField(name="LV_ZPZP")
private String LV_ZPZP; private String LV_ZPZP;
@JSONField(name="LV_ZPSJ")
private String LV_ZPSJ; private String LV_ZPSJ;

View File

@ -1,12 +1,23 @@
package net.shapelight.modules.xian.vo; package net.shapelight.modules.xian.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data; import lombok.Data;
@Data @Data
public class XaRYRKPHOTO { public class XaRYRKPHOTO {
@JSONField(name="LV_CASE_ID")
private String LV_CASE_ID; private String LV_CASE_ID;
@JSONField(name="LV_SSXQBM")
private String LV_SSXQBM; private String LV_SSXQBM;
@JSONField(name="LV_ZP")
private String LV_ZP; private String LV_ZP;
@JSONField(name="LV_DJSJ")
private String LV_DJSJ; private String LV_DJSJ;
@JSONField(name="LV_GMSFHM")
private String LV_GMSFHM; private String LV_GMSFHM;
} }

View File

@ -1,28 +1,37 @@
package net.shapelight.modules.xian.vo; package net.shapelight.modules.xian.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data; import lombok.Data;
@Data @Data
public class XaRYSKZPXX { public class XaRYSKZPXX {
@JSONField(name="LV_SSXQBM")
private String LV_SSXQBM; private String LV_SSXQBM;
@JSONField(name="LV_MJBH")
private String LV_MJBH; private String LV_MJBH;
@JSONField(name="LV_CRLB")
private String LV_CRLB; private String LV_CRLB;
@JSONField(name="LV_ZPSJ")
private String LV_ZPSJ; private String LV_ZPSJ;
@JSONField(name="LV_SBXT")
private String LV_SBXT = "10"; private String LV_SBXT = "10";
@JSONField(name="LV_MJXTWYBM")
private String LV_MJXTWYBM; private String LV_MJXTWYBM;
@JSONField(name="LV_RY_ID")
private String LV_RY_ID; private String LV_RY_ID;
@JSONField(name="LV_FFMS")
private String LV_FFMS; private String LV_FFMS;
@JSONField(name="LV_PROCMODE")
private String LV_PROCMODE = "PMINSERT"; private String LV_PROCMODE = "PMINSERT";
} }

View File

@ -1,36 +1,49 @@
package net.shapelight.modules.xian.vo; package net.shapelight.modules.xian.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data; import lombok.Data;
@Data @Data
public class XaSYDW { public class XaSYDW {
@JSONField(name="LV_DWBM")
private String LV_DWBM; private String LV_DWBM;
@JSONField(name="LV_DWMC")
private String LV_DWMC; private String LV_DWMC;
@JSONField(name="LV_DWDZBM")
private String LV_DWDZBM; private String LV_DWDZBM;
@JSONField(name="LV_DZLB")
private String LV_DZLB; private String LV_DZLB;
@JSONField(name="LV_HZDWLX")
private String LV_HZDWLX; private String LV_HZDWLX;
@JSONField(name="LV_DWXZ")
private String LV_DWXZ; private String LV_DWXZ;
@JSONField(name="LV_DJDWGAJGJGMC")
private String LV_DJDWGAJGJGMC; private String LV_DJDWGAJGJGMC;
@JSONField(name="LV_DJDWGAJGJGDM")
private String LV_DJDWGAJGJGDM; private String LV_DJDWGAJGJGDM;
@JSONField(name="LV_DJSJ")
private String LV_DJSJ; private String LV_DJSJ;
@JSONField(name="LV_DJR")
private String LV_DJR; private String LV_DJR;
@JSONField(name="LV_COMPUTERID")
private String LV_COMPUTERID; private String LV_COMPUTERID;
@JSONField(name="LV_SSXQBM")
private String LV_SSXQBM; private String LV_SSXQBM;
@JSONField(name="LV_PROCMODE")
private String LV_PROCMODE = "PMINSERT"; private String LV_PROCMODE = "PMINSERT";

View File

@ -1,26 +1,36 @@
package net.shapelight.modules.xian.vo; package net.shapelight.modules.xian.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data; import lombok.Data;
@Data @Data
public class XaTCCTCSBXX { public class XaTCCTCSBXX {
@JSONField(name="LV_TCCBH")
private String LV_TCCBH; private String LV_TCCBH;
@JSONField(name="LV_CPHM")
private String LV_CPHM; private String LV_CPHM;
@JSONField(name="LV_CPLX")
private String LV_CPLX; private String LV_CPLX;
@JSONField(name="LV_GCSJ")
private String LV_GCSJ; private String LV_GCSJ;
@JSONField(name="LV_GCLX")
private String LV_GCLX; private String LV_GCLX;
@JSONField(name="LV_SBXT")
private String LV_SBXT = "10"; private String LV_SBXT = "10";
@JSONField(name="LV_KKSBBH")
private String LV_KKSBBH; private String LV_KKSBBH;
@JSONField(name="LV_PROCMODE")
private String LV_PROCMODE = "PMINSERT"; private String LV_PROCMODE = "PMINSERT";
@JSONField(name="LV_JKBM")
private String LV_JKBM;
} }

View File

@ -0,0 +1,38 @@
package net.shapelight.modules.xian.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class XaTCCTCSBXXEXIT {
@JSONField(name="LV_TCCBH")
private String LV_TCCBH;
@JSONField(name="LV_CPHM")
private String LV_CPHM;
@JSONField(name="LV_CPLX")
private String LV_CPLX;
@JSONField(name="LV_GCSJ")
private String LV_GCSJ;
@JSONField(name="LV_GCLX")
private String LV_GCLX;
@JSONField(name="LV_SBXT")
private String LV_SBXT = "10";
@JSONField(name="LV_KKSBBH")
private String LV_KKSBBH;
@JSONField(name="LV_PROCMODE")
private String LV_PROCMODE = "PMINSERT";
@JSONField(name="LV_CKBM")
private String LV_CKBM;
}

View File

@ -1,16 +1,20 @@
package net.shapelight.modules.xian.vo; package net.shapelight.modules.xian.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data; import lombok.Data;
@Data @Data
public class XaTCCTCSBZPXX { public class XaTCCTCSBZPXX {
@JSONField(name="LV_TCCBH")
private String LV_TCCBH; private String LV_TCCBH;
@JSONField(name="LV_ZPZP")
private String LV_ZPZP; private String LV_ZPZP;
@JSONField(name="LV_ZPSJ")
private String LV_ZPSJ; private String LV_ZPSJ;

View File

@ -929,6 +929,7 @@
where cell_id = #{cellId} where cell_id = #{cellId}
and delete_flag = 0 and (person_type = 5000 || person_type = 5001) and delete_flag = 0 and (person_type = 5000 || person_type = 5001)
and xa_sync_image = 0 and xa_sync_image = 0
and xa_sync = 1
</select> </select>

View File

@ -409,12 +409,15 @@
select * from ten_record_${tenantId} select * from ten_record_${tenantId}
where cell_id = #{cellId} where cell_id = #{cellId}
and xa_sync = 0 and xa_sync = 0
and TO_DAYS(record_time) = TO_DAYS(NOW())
</select> </select>
<select id="getNotSyncImage" resultType="net.shapelight.modules.ten.entity.TenRecordEntity"> <select id="getNotSyncImage" resultType="net.shapelight.modules.ten.entity.TenRecordEntity">
select * from ten_record_${tenantId} select * from ten_record_${tenantId}
where cell_id = #{cellId} where cell_id = #{cellId}
and xa_sync_image = 0 and xa_sync_image = 0
and xa_sync = 1
and TO_DAYS(record_time) = TO_DAYS(NOW())
</select> </select>