|
|
@ -1072,30 +1072,58 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
|
args.put("idcards", idCards); |
|
|
|
// todo 疫苗接种视图
|
|
|
|
String json = "[\n" + |
|
|
|
"{\n" + |
|
|
|
"\t\"idCard\":\"370785195001012558\",\n" + |
|
|
|
"\t\"inoculateDate\":\"2023-01-01 10:01\",\n" + |
|
|
|
"\t\"lastStationName\":\"北京\"\n" + |
|
|
|
"},\n" + |
|
|
|
"{\n" + |
|
|
|
"\t\"idCard\":\"370785195001012558\",\n" + |
|
|
|
"\t\"inoculateDate\":\"2022-01-01 10:01\",\n" + |
|
|
|
"\t\"lastStationName\":\"南京\"\n" + |
|
|
|
"}\n" + |
|
|
|
" {\n" + |
|
|
|
" \"id\": \"751956862490071040\",\n" + |
|
|
|
" \"cardno\": \"370785195001012558\",\n" + |
|
|
|
" \"name\": \"李国玺\",\n" + |
|
|
|
" \"data\":\n" + |
|
|
|
" {\n" + |
|
|
|
" \"vaccineList\":\n" + |
|
|
|
" [\n" + |
|
|
|
" {\n" + |
|
|
|
" \"vaccineCount\": \"1\",\n" + |
|
|
|
" \"inoculateDate\": \"2021-04-24 16:02:46\",\n" + |
|
|
|
" \"lastStationName\": \"烟台市只楚医院临时接种点\"\n" + |
|
|
|
" },\n" + |
|
|
|
" {\n" + |
|
|
|
" \"vaccineCount\": \"2\",\n" + |
|
|
|
" \"inoculateDate\": \"2021-06-10 16:20:30\",\n" + |
|
|
|
" \"lastStationName\": \"烟台市芝罘岛医院临时接种点\"\n" + |
|
|
|
" },\n" + |
|
|
|
" {\n" + |
|
|
|
" \"vaccineCount\": \"3\",\n" + |
|
|
|
" \"inoculateDate\": \"2021-12-10 15:12:24\",\n" + |
|
|
|
" \"lastStationName\": \"烟台市芝罘岛医院临时接种点\"\n" + |
|
|
|
" }\n" + |
|
|
|
" ],\n" + |
|
|
|
" \"flag\": 1\n" + |
|
|
|
" },\n" + |
|
|
|
" \"vaccineCount\": 3\n" + |
|
|
|
" }\n" + |
|
|
|
"]"; |
|
|
|
List<Map<String, Object>> vaccineList = new ArrayList<>();/*yantaiNamedParamLantuJdbcTemplate.queryForList( |
|
|
|
"select id, name,card_no, create_time from hscyxxb where card_no in (:idcards)", args);*/ |
|
|
|
Map<String, Object> m = new HashMap<>(); |
|
|
|
vaccineList.add(m); |
|
|
|
// List<Map> vaccineList = JSON.parseArray(json,Map.class);
|
|
|
|
List<Map<String,Object>> vaccineList = yantaiNamedParamLantuJdbcTemplate.queryForList( |
|
|
|
"select data, name, card_no, vaccineCount from t_ymjz_info where card_no in (:idcards)", args); |
|
|
|
List<YTVaccineListDTO> ytVaccineListDTOS = new ArrayList<>(); |
|
|
|
if (CollectionUtils.isNotEmpty(vaccineList)) { |
|
|
|
vaccineList.forEach(v -> { |
|
|
|
if (v.containsKey("data")){ |
|
|
|
Map<String, Object> data = (Map<String, Object>) v.get("data"); |
|
|
|
if (data.containsKey("vaccineList")){ |
|
|
|
List<YTVaccineListDTO> vaccineList1 = JSON.parseArray(data.get("vaccineList").toString(), YTVaccineListDTO.class); |
|
|
|
vaccineList1.forEach(v1 -> { |
|
|
|
v1.setCardno(v.get("cardno").toString()); |
|
|
|
}); |
|
|
|
ytVaccineListDTOS.addAll(vaccineList1); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
List<IcVaccineEntity> entities = new ArrayList<>(); |
|
|
|
// List<YTVaccineListDTO> ytVaccineListDTOS = ConvertUtils.sourceToTarget(vaccineList, YTVaccineListDTO.class);
|
|
|
|
List<YTVaccineListDTO> ytVaccineListDTOS = JSON.parseArray(json,YTVaccineListDTO.class); |
|
|
|
List<YTVaccineListDTO> existVaccine = icVaccineDao.getExistVaccine(ytVaccineListDTOS); |
|
|
|
if (CollectionUtils.isNotEmpty(existVaccine)){ |
|
|
|
for (YTVaccineListDTO e : existVaccine) { |
|
|
|
for (int i = 0; i < ytVaccineListDTOS.size(); i++) { |
|
|
|
if (ytVaccineListDTOS.get(i).getIdCard().equals(e.getIdCard()) && ytVaccineListDTOS.get(i).getInoculateDate().equals(e.getInoculateDate())){ |
|
|
|
if (ytVaccineListDTOS.get(i).getCardno().equals(e.getCardno()) && ytVaccineListDTOS.get(i).getInoculateDate().equals(e.getInoculateDate())){ |
|
|
|
ytVaccineListDTOS.remove(i); |
|
|
|
} |
|
|
|
} |
|
|
@ -1104,7 +1132,7 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
|
if (CollectionUtils.isNotEmpty(ytVaccineListDTOS)){ |
|
|
|
ytVaccineListDTOS.forEach(v -> { |
|
|
|
resiInfos.forEach(u -> { |
|
|
|
if (v.getIdCard().equals(u.getIdCard())){ |
|
|
|
if (v.getCardno().equals(u.getIdCard())){ |
|
|
|
IcVaccineEntity e = new IcVaccineEntity(); |
|
|
|
e.setCustomerId(customerId); |
|
|
|
e.setName(u.getName()); |
|
|
|