parent
1c6fb64a91
commit
ec5b95dde1
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
|
||||
import java.util.*;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.shapelight.common.utils.Constant;
|
||||
import net.shapelight.common.utils.DateUtils;
|
||||
|
@ -298,23 +299,47 @@ public class XaRealDataTask implements ITask {
|
|||
if(resJson.contains("ErrorLineParameter")){
|
||||
JSONObject resJsonObject = JSONObject.parseObject(resJson);
|
||||
String errLine = resJsonObject.getJSONObject("sta").getString("ErrorLineParameter").trim();
|
||||
JSONArray datas = resJsonObject.getJSONArray("datas");
|
||||
if(errLine.equals("empty")){
|
||||
for (TenPersonEntity recordEntity : updatePersons) {
|
||||
recordEntity.setXaSync(1);
|
||||
tenPersonService.updateById(recordEntity);
|
||||
}
|
||||
}else{
|
||||
String[] lines = errLine.split(",");
|
||||
List<String> lineList = Arrays.asList(lines);
|
||||
for (int i = 0;i<updatePersons.size();i++) {
|
||||
if(lineList.contains(i+1+"")){
|
||||
continue;
|
||||
}else {
|
||||
// List<XaSYRK> syncPersonsDelete = new ArrayList();
|
||||
//一条一条判断
|
||||
for(int i = 0;i<datas.size();i++){
|
||||
JSONObject dataResult = datas.getJSONObject(i);
|
||||
String res = dataResult.getString("Result");
|
||||
if(res.equals("接收成功")){
|
||||
TenPersonEntity recordEntity = updatePersons.get(i);
|
||||
recordEntity.setXaSync(1);
|
||||
tenPersonService.updateById(recordEntity);
|
||||
}else if(res.indexOf("违反唯一约束条件")>0){
|
||||
TenPersonEntity recordEntity = updatePersons.get(i);
|
||||
recordEntity.setXaSync(1);
|
||||
tenPersonService.updateById(recordEntity);
|
||||
//页面删除过,但是没有上报,这次上报
|
||||
// XaSYRK realPerson = syncPersons.get(i);
|
||||
// realPerson.setLV_ZXSJ(DateUtils.format(new Date(),DateUtils.DATE_YEAR_MONTH));
|
||||
// syncPersonsDelete.add(realPerson);
|
||||
}
|
||||
}
|
||||
// if(syncPersonsDelete.size()>0){
|
||||
// processRealPersonDelete(appId, appSecret, xqid, fwikUrl, cellId,syncPersonsDelete);
|
||||
// }
|
||||
// String[] lines = errLine.split(",");
|
||||
// List<String> lineList = Arrays.asList(lines);
|
||||
// for (int i = 0;i<updatePersons.size();i++) {
|
||||
// if(lineList.contains(i+1+"")){
|
||||
// //判断错误信息
|
||||
// continue;
|
||||
// }else {
|
||||
// TenPersonEntity recordEntity = updatePersons.get(i);
|
||||
// recordEntity.setXaSync(1);
|
||||
// tenPersonService.updateById(recordEntity);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -500,4 +525,40 @@ public class XaRealDataTask implements ITask {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void processRealPersonDelete(String appId, String appSecret, String xqid, String fwikUrl, Long cellId,List<XaSYRK> syncPersons) {
|
||||
XaData jsonData = new XaData();
|
||||
jsonData.setDatas(syncPersons);
|
||||
|
||||
List<XaPages> listPages = new ArrayList<>();
|
||||
XaPages pages = new XaPages();
|
||||
pages.setPno("1");
|
||||
pages.setPsize(syncPersons.size()+"");
|
||||
listPages.add(pages);
|
||||
jsonData.setPages(listPages);
|
||||
|
||||
String json = JSONObject.toJSONString(jsonData);
|
||||
|
||||
String enJson = XaUtils.encryptStr(json.trim(), appSecret);
|
||||
|
||||
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);
|
||||
log.debug("上传删除实有人口返回数据:" + resJson);
|
||||
tranEntity.setTranResult(resJson);
|
||||
tenTranService.updateById(tranEntity);
|
||||
// if(resJson.contains("ErrorLineParameter")){
|
||||
// JSONObject resJsonObject = JSONObject.parseObject(resJson);
|
||||
// String errLine = resJsonObject.getJSONObject("sta").getString("ErrorLineParameter").trim();
|
||||
// JSONArray datas = resJsonObject.getJSONArray("datas");
|
||||
// if(errLine.equals("empty")){
|
||||
//
|
||||
// }else{
|
||||
// //一条一条判断
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,9 +26,9 @@ public class XaApi {
|
|||
|
||||
private static final Logger log = LoggerFactory.getLogger(net.shapelight.modules.xian.service.XaApi.class);
|
||||
|
||||
private static final String XqAddrUrl = "http://117.34.12.66:10011/zhxqgl/interface/get_xq_addr.jsp";
|
||||
private static final String XqAddrUrl = "http://police.xa.gov.cn/ZHXQ/zhxqgl/interface/get_xq_addr.jsp";
|
||||
|
||||
private static final String FwikUrl = "http://117.34.12.66:10011/ywxzservice/get_fwjk_url.jsp";
|
||||
private static final String FwikUrl = "http://police.xa.gov.cn/ZHXQ/ywxzservice/get_fwjk_url.jsp";
|
||||
|
||||
/**
|
||||
* appid: 1297164778041095
|
||||
|
@ -125,6 +125,8 @@ public class XaApi {
|
|||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
|
||||
conn.setRequestProperty("User-Agent","Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 Edg/95.0.1020.30");
|
||||
|
||||
//连接建立超时时间还有读取数据超时时间,
|
||||
conn.setConnectTimeout(60000);
|
||||
conn.setReadTimeout(60000);
|
||||
|
|
|
@ -261,6 +261,7 @@ public class XaUtils {
|
|||
conn.setRequestMethod("POST");
|
||||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
conn.setRequestProperty("User-Agent","Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 Edg/95.0.1020.30");
|
||||
StringBuffer paramsBuffer = new StringBuffer();
|
||||
mapParams.forEach((key,value)->{
|
||||
paramsBuffer.append("&"+key+"=");
|
||||
|
@ -426,7 +427,7 @@ public class XaUtils {
|
|||
Map<String,String> paramMap = new HashMap<>();
|
||||
paramMap.put("appid",appid);
|
||||
paramMap.put("appsecret",md5(secre));
|
||||
String FwjkUrl = httpPOSTParam("http://117.34.12.66:10011/ywxzservice/get_fwjk_url.jsp",
|
||||
String FwjkUrl = httpPOSTParam("http://police.xa.gov.cn/ZHXQ/ywxzservice/get_fwjk_url.jsp",
|
||||
appid,secre,paramMap);
|
||||
System.out.println("FwjkUrl:"+FwjkUrl);
|
||||
|
||||
|
|
|
@ -61,5 +61,8 @@ public class XaSYFW {
|
|||
@JSONField(name="LV_PROCMODE")
|
||||
private String LV_PROCMODE = "PMINSERT";
|
||||
|
||||
@JSONField(name="LV_ZXSJ")
|
||||
private String LV_ZXSJ = "11111111";
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -131,5 +131,8 @@ public class XaSYRK {
|
|||
@JSONField(name="LV_ZJZL")
|
||||
private String LV_ZJZL = "10";
|
||||
|
||||
@JSONField(name="LV_ZXSJ")
|
||||
private String LV_ZXSJ = "11111111";
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue