diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/job/task/XaRealDataTask.java b/shapelight-admin/src/main/java/net/shapelight/modules/job/task/XaRealDataTask.java index 3476679..aa4a907 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/job/task/XaRealDataTask.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/job/task/XaRealDataTask.java @@ -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 lineList = Arrays.asList(lines); - for (int i = 0;i syncPersonsDelete = new ArrayList(); + //一条一条判断 + for(int i = 0;i0){ + 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 lineList = Arrays.asList(lines); +// for (int i = 0;i syncPersons) { + XaData jsonData = new XaData(); + jsonData.setDatas(syncPersons); + + List 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{ +// //一条一条判断 +// } +// } + } } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/xian/service/XaApi.java b/shapelight-admin/src/main/java/net/shapelight/modules/xian/service/XaApi.java index 8a0af7c..5d45c6a 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/xian/service/XaApi.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/xian/service/XaApi.java @@ -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); diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/xian/utils/XaUtils.java b/shapelight-admin/src/main/java/net/shapelight/modules/xian/utils/XaUtils.java index 675dc39..abc9b56 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/xian/utils/XaUtils.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/xian/utils/XaUtils.java @@ -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 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); diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/xian/vo/XaSYFW.java b/shapelight-admin/src/main/java/net/shapelight/modules/xian/vo/XaSYFW.java index e0aa9f9..4dd51fb 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/xian/vo/XaSYFW.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/xian/vo/XaSYFW.java @@ -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"; + } diff --git a/shapelight-admin/src/main/java/net/shapelight/modules/xian/vo/XaSYRK.java b/shapelight-admin/src/main/java/net/shapelight/modules/xian/vo/XaSYRK.java index 6dd6198..b76ec31 100644 --- a/shapelight-admin/src/main/java/net/shapelight/modules/xian/vo/XaSYRK.java +++ b/shapelight-admin/src/main/java/net/shapelight/modules/xian/vo/XaSYRK.java @@ -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"; + }