diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index a059504d2e..3b1ed3c0c4 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -253,6 +253,7 @@ public enum EpmetErrorCode { NEIGHBORHOOD_DEL_FAILED(8922,""), IC_NAT_IDCARD_NATTIME(8923,"已存在相同记录"), IC_NAT(8924,"平台已存在记录,请去修改原有记录"), + RESI_IC_NAT(8925,"已存在记录,请联系社区工作人员修改"), //通用错误码 start diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerUserDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerUserDao.java deleted file mode 100644 index efd5cde8c0..0000000000 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerUserDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.dataaggre.dao.epmetuser; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dataaggre.entity.epmetuser.CustomerUserEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 居民用户信息,此表已作废 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-12-25 - */ -@Mapper -public interface CustomerUserDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/CustomerUserEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/CustomerUserEntity.java deleted file mode 100644 index bad1b5b830..0000000000 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/CustomerUserEntity.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.dataaggre.entity.epmetuser; - -import com.baomidou.mybatisplus.annotation.TableName; - -import com.epmet.commons.mybatis.entity.BaseEpmetEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.Date; - -/** - * 居民用户信息,此表已作废 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-12-25 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("customer_user") -public class CustomerUserEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户Id CUSTOMER.id - */ - private String customerId; - - /** - * 微信openId - */ - private String wxOpenId; - - /** - * 微信unionId - */ - private String wxUnionId; - - /** - * 手机号 - */ - private String mobile; - - /** - * 昵称 - */ - private String nickname; - - /** - * 性别:0.未知 1.男性2女性 - */ - private Integer sex; - - /** - * 头像 - */ - private String headImgUrl; - - /** - * 国家 - */ - private String country; - - /** - * 省份 - */ - private String province; - - /** - * 城市 - */ - private String city; - - /** - * 语言 - */ - private String language; - -} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerUserDao.xml deleted file mode 100644 index 9676ace2cc..0000000000 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerUserDao.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java index e15f7f5057..e6e567c43b 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java @@ -22,6 +22,10 @@ public interface ImportTaskConstants { * 核酸检测 */ String BIZ_TYPE_IC_NAT = "ic_nat"; + /** + * 疫苗接种 + */ + String BIZ_TYPE_IC_VACCINE = "ic_vaccine"; /** * 行程上报 */ diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeDictFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeDictFormDTO.java index 4340d4d015..47d915cd4c 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeDictFormDTO.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeDictFormDTO.java @@ -13,6 +13,7 @@ public class AreaCodeDictFormDTO implements Serializable { private static final long serialVersionUID = 5780301376757138238L; + //平阴传参:rootAreaCode=370124, rootAreaLevel=district /** * 根结点code 不传,则返回全部 */ diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeChildDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeChildDao.java index 24339f6397..169449fc2f 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeChildDao.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeChildDao.java @@ -34,7 +34,7 @@ import java.util.List; @Mapper public interface AreaCodeChildDao extends BaseDao { - List selectAllChild(); + List selectAllChild(String areaCode); AreaCodeChildDTO selectByCode(@Param("code") String code); diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java index 6f4ad9f000..4d873b333e 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java @@ -137,7 +137,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl areaCodeDictResultDTOS = disposeTree(); + List areaCodeDictResultDTOS = disposeTree(formDTO); areaCodeRedis.set(AreaCodeConstant.SCREEN_TREE,areaCodeDictResultDTOS); tree = areaCodeDictResultDTOS; } @@ -154,11 +154,11 @@ public class AreaCodeServiceImpl extends BaseServiceImpl disposeTree(){ + public List disposeTree(AreaCodeDictFormDTO formDTO){ // 查询所有省市区 List areaCodeDTOS = baseDao.selectAllArea(); // 查询所有街道、社区 - List areaCodeChildDTOS = childDao.selectAllChild(); + List areaCodeChildDTOS = childDao.selectAllChild(formDTO.getRootAreaCode()); List result = new ArrayList<>(); List fourResult = new ArrayList<>(); List cityResult = new ArrayList<>(); @@ -388,21 +388,21 @@ public class AreaCodeServiceImpl extends BaseServiceImpl afterTwoTree(){ + public List afterTwoTree(AreaCodeDictFormDTO form){ // 查询所有街道、社区 - List areaCodeChildDTOS = childDao.selectAllChild(); + List areaCodeChildDTOS = childDao.selectAllChild(form.getRootAreaCode()); List fourResult = new ArrayList<>(); List fiveResult = new ArrayList<>(); // 街道-社区 Map> groupByLevel = areaCodeChildDTOS.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getLevel)); //社区 - List levelFive = groupByLevel.get(NumConstant.FIVE); - Map> groupByPCode = levelFive.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getPCode)); + List levelFive = org.apache.commons.collections4.CollectionUtils.isNotEmpty(groupByLevel.get(NumConstant.FIVE)) ? groupByLevel.get(NumConstant.FIVE) : new ArrayList<>(); + Map> groupByPCode = CollectionUtils.isEmpty(levelFive) ? new HashMap<>() : levelFive.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getPCode)); //街道 - List levelFour = groupByLevel.get(NumConstant.FOUR); + List levelFour = org.apache.commons.collections4.CollectionUtils.isNotEmpty(groupByLevel.get(NumConstant.FOUR)) ?groupByLevel.get(NumConstant.FOUR):new ArrayList<>(); // 6级 List levelSix = groupByLevel.get(NumConstant.SIX); - Map> groupBySixPCode = levelSix.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getPCode)); + Map> groupBySixPCode = CollectionUtils.isEmpty(levelSix) ? new HashMap<>() : levelSix.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getPCode)); levelFive.forEach(f -> { AreaCodeDictResultDTO dto = new AreaCodeDictResultDTO(); @@ -450,7 +450,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl disposeAfterTwoLevel(AreaCodeDictFormDTO form){ List result = new ArrayList<>(); - List areaCodeDictResultDTOS = afterTwoTree(); + List areaCodeDictResultDTOS = afterTwoTree(form); if (CollectionUtils.isEmpty(areaCodeDictResultDTOS)){ return new ArrayList<>(); } @@ -532,7 +532,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl disposeBeforeThreeLevelFinal(AreaCodeDictFormDTO form,List tree){ List threeDto = disposeBeforeThreeLevel(form, tree); - List twoDto = afterTwoTree(); + List twoDto = afterTwoTree(form); if (CollectionUtils.isEmpty(threeDto)){ return new ArrayList<>(); } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeChildDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeChildDao.xml index c918bb7702..34877f6c08 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeChildDao.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeChildDao.xml @@ -5,7 +5,9 @@ - \ No newline at end of file + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index 8392bf5856..5c4ad0b6e7 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -15,7 +15,8 @@ nat_result natResult, nat_address natAddress, file_name fileName, - attachment_url attachmentUrl + attachment_url attachmentUrl, + created_time reportTime FROM ic_nat WHERE diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml index 98725fa04e..777622c9f5 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml @@ -84,6 +84,5 @@ AND ( m.CREATED_BY = #{userId} OR m.UPDATED_BY = #{userId} ) ORDER BY m.UPDATED_TIME DESC - LIMIT 1 \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index b3fef04dbc..d5fb91de45 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -658,7 +658,7 @@ ic_resi_user a LEFT JOIN ( SELECT ID_CARD, count( id ) AS count - FROM ic_resi_vaccine + FROM ic_vaccine WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} AND DATE_FORMAT(INOCULATE_TIME,"%Y-%m-%d") > #{startDate} @@ -680,6 +680,7 @@ GROUP BY ID_CARD ) c ON a.ID_CARD = c.ID_CARD WHERE a.DEL_FLAG = '0' + AND a.`STATUS` = '0' AND a.CUSTOMER_ID = #{customerId} @@ -738,6 +739,7 @@ FROM ic_resi_user a LEFT JOIN ( SELECT ID_CARD, count( id ) AS count,created_time FROM ic_nat WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) c ON a.ID_CARD = c.ID_CARD WHERE a.DEL_FLAG = '0' + and a.status = 0 AND a.CUSTOMER_ID = #{customerId} @@ -773,8 +775,9 @@ b.created_time, IFNULL( b.count, 0 ) AS vaccineCount FROM ic_resi_user a - LEFT JOIN ( SELECT ID_CARD, count( id ) AS count,created_time FROM ic_resi_vaccine WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) b ON a.ID_CARD = b.ID_CARD + LEFT JOIN ( SELECT ID_CARD, count( id ) AS count,created_time FROM ic_vaccine WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY ID_CARD ) b ON a.ID_CARD = b.ID_CARD WHERE a.DEL_FLAG = '0' + and a.status = 0 AND a.CUSTOMER_ID = #{customerId} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiVaccineDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiVaccineDao.xml deleted file mode 100644 index a330bccba9..0000000000 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiVaccineDao.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml index f667e9826d..0ccd2c31d8 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml @@ -57,7 +57,7 @@ AND ARRIVE_DATE #{endDate} ORDER BY - r.CREATED_TIME DESC + r.ARRIVE_DATE DESC diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml new file mode 100644 index 0000000000..9eb104ad06 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + DELETE FROM ic_nat WHERE id = #{icNatId} + + + + INSERT INTO epmet_user.ic_nat + (ID, CUSTOMER_ID, AGENCY_ID, PIDS, USER_ID, + USER_TYPE, NAME, MOBILE, ID_CARD, NAT_TIME, NAT_RESULT, NAT_ADDRESS, FILE_NAME, ATTACHMENT_TYPE, ATTACHMENT_URL, + DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + VALUES (#{id}, #{customerId}, #{agencyId}, #{pids}, #{userId}, + #{userType}, #{name}, #{mobile}, #{idCard}, #{natTime}, + #{natResult}, #{natAddress}, #{fileName}, #{attachmentType}, #{attachmentUrl}, + #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, + #{updatedTime}) + ON DUPLICATE KEY update + NAME=#{name}, + MOBILE=#{mobile}, + NAT_ADDRESS=#{natAddress}, + NAT_RESULT=#{natResult}, + UPDATED_BY=#{updatedBy}, + UPDATED_TIME=NOW() + + + UPDATE ic_nat m, + ( + SELECT if(DEL_FLAG,0,1) resiFlag, ID_CARD FROM ic_resi_user + WHERE + 1=1 + + AND ID = #{icResiUserId} + + AND CUSTOMER_ID = #{customerId} + AND DEL_FLAG = '0' + ) t + SET m.IS_RESI_USER = t.resiFlag + WHERE + m.ID_CARD = t.ID_CARD + AND m.DEL_FLAG = '0' + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineRelationDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineRelationDao.xml new file mode 100644 index 0000000000..011c1c7de1 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineRelationDao.xml @@ -0,0 +1,16 @@ + + + + + + + DELETE + FROM ic_vaccine_relation + WHERE + ic_vaccine_id = #{icVaccineId} + + AND AGENCY_ID = #{agencyId} + + + + \ No newline at end of file