Browse Source

Merge branch 'dev_compare_data' of http://git.elinkit.com.cn:7070/r/epmet-cloud

feature/evaluate
wangxianzhang 3 years ago
parent
commit
a15eb27033
  1. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java
  2. 20
      epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml

14
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java

@ -1119,6 +1119,12 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao
List<YTVaccineListDTO> vaccineList1 = vaccineListJA.toJavaList(YTVaccineListDTO.class); List<YTVaccineListDTO> vaccineList1 = vaccineListJA.toJavaList(YTVaccineListDTO.class);
vaccineList1.forEach(v1 -> { vaccineList1.forEach(v1 -> {
v1.setCardno(v.get("cardno").toString()); v1.setCardno(v.get("cardno").toString());
// 秒转换成:00
Matcher matcher = VACCINE_DATE_OF_API_PATTERN.matcher(v1.getInoculateDate());
if (matcher.matches()) {
v1.setInoculateDate(matcher.group(1).concat(":00"));
}
}); });
ytVaccineListFromApi.addAll(vaccineList1); ytVaccineListFromApi.addAll(vaccineList1);
} }
@ -1142,11 +1148,11 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao
Iterator<YTVaccineListDTO> iterator = ytVaccineListFromApi.iterator(); Iterator<YTVaccineListDTO> iterator = ytVaccineListFromApi.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
YTVaccineListDTO vaccineFromApi = iterator.next(); YTVaccineListDTO vaccineFromApi = iterator.next();
Matcher matcher = VACCINE_DATE_OF_API_PATTERN.matcher(vaccineFromApi.getInoculateDate());
// 身份证号和接种时间都一致,移除
if (vaccineFromApi.getCardno().equals(existVaccineItem.getCardno()) if (vaccineFromApi.getCardno().equals(existVaccineItem.getCardno())
&& matcher.matches() && vaccineFromApi.getInoculateDate().equals(existVaccineItem.getInoculateDate())) {
&& matcher.group(1).equals(existVaccineItem.getInoculateDate())
) {
iterator.remove(); iterator.remove();
} }
} }

20
epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml

@ -227,17 +227,21 @@
</if> </if>
</update> </update>
<!-- 根据 身份证 + 疫苗接种时间 查询库里存在的 --> <!-- 根据 身份证 查询库里存在的 -->
<select id="getExistVaccine" resultType="com.epmet.dto.YTVaccineListDTO"> <select id="getExistVaccine" resultType="com.epmet.dto.YTVaccineListDTO">
SELECT SELECT
ID_CARD, ID_CARD,
DATE_FORMAT(INOCULATE_TIME, '%Y-%m-%d %H:%i') AS inoculateDate INOCULATE_TIME
FROM ic_vaccine FROM ic_vaccine
WHERE DEL_FLAG = '0' WHERE DEL_FLAG = '0'
AND ( and ID_CARD IN
<foreach collection="list" item="l" separator=" OR "> <foreach collection="list" item="v" separator="," open="(" close=")">
(ID_CARD = #{l.cardno} AND DATE_FORMAT(INOCULATE_TIME, '%Y-%m-%d %H:%i') = #{l.inoculateDate}) #{v.cardno}
</foreach> </foreach>
) <!--AND (-->
<!-- <foreach collection="list" item="l" separator=" OR ">-->
<!-- (ID_CARD = #{l.cardno} AND INOCULATE_TIME = #{l.inoculateDate})-->
<!-- </foreach>-->
<!-- )-->
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save