From a5e8dc52dbf29b0ea4b39c00bfe8f88efb6aa76c Mon Sep 17 00:00:00 2001 From: 罗元桥 <2376770955@qq.com> Date: 星期二, 28 九月 2021 20:58:41 +0800 Subject: [PATCH] Merge branch 'test_bak' into 'master' --- springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysRoleMenuDAO.java | 13 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientMerchantMapper.xml | 2 springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommunityConvenientApi.java | 1 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientProductServiceImpl.java | 22 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java | 117 +++--- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductSpecificationMapper.xml | 2 springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/config/WebSocketClient.java | 129 +++++++ springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java | 8 springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/config/WebSocketConfig.java | 136 ++++++++ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/EldersAuthServiceImpl.java | 71 ++++ springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysRoleMenuDAO.xml | 9 springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/resources/bootstrap.yml | 30 - springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java | 7 springcloud_k8s_panzhihuazhihuishequ/service_property/pom.xml | 18 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java | 7 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActMicroWishService.java | 7 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComPensionAuthRecordServiceImpl.java | 16 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java | 10 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDiscussDO.java | 1 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml | 2 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComPensionAuthRecordMapper.xml | 7 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java | 1 springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java | 168 ++++---- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMicroWishServiceImpl.java | 33 + /dev/null | 54 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java | 10 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientServiceCategoryMapper.xml | 2 springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/DeviceDto.java | 33 + springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDiscussCommentDOMapper.xml | 2 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComPropertyVO.java | 3 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActCommiteeVO.java | 3 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComPensionAuthHistoryRecordDO.java | 8 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductMapper.xml | 1 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientProductSpecificationDAO.java | 3 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActMicroWishDOMapper.xml | 55 +++ 35 files changed, 711 insertions(+), 280 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommunityConvenientApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommunityConvenientApi.java index 52c6126..01a42df 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommunityConvenientApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommunityConvenientApi.java @@ -307,7 +307,6 @@ @ApiOperation(value = "新增便民服务商家") @PostMapping("/merchant/add") public R addMerchant(@RequestBody @Validated(AddGroup.class) ConvenientMerchantDTO convenientMerchantDTO) { - log.error("catTimeStamp进入appletsbackstage", Instant.now().toEpochMilli()); convenientMerchantDTO.setCreatedBy(this.getUserId()); return communityService.addMerchant(convenientMerchantDTO); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActCommiteeVO.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActCommiteeVO.java index a19503e..0e971bb 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActCommiteeVO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActCommiteeVO.java @@ -1,5 +1,7 @@ package com.panzhihua.common.model.vos.community; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -38,6 +40,7 @@ * 小区id */ @ApiModelProperty(value = "小区id") + @JsonSerialize(using = ToStringSerializer.class) private Long areaId; /** diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComPropertyVO.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComPropertyVO.java index 86a1555..4b4382a 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComPropertyVO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComPropertyVO.java @@ -1,5 +1,7 @@ package com.panzhihua.common.model.vos.community; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -76,5 +78,6 @@ private String areaName; @ApiModelProperty("小区id") + @JsonSerialize(using = ToStringSerializer.class) private Long areaId; } diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java index eeb6b1c..2e2332e 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java @@ -6555,4 +6555,12 @@ */ @PostMapping("/cluster/member/export/admin") R exportClusterMember(@RequestBody PageClusterMemberAdminDto pageClusterMemberAdminDto); + + /** + * 社区后台分页查询微心愿 + * @param comActMicroWishVO 请求参数 + * @return 微心愿列表 + */ + @PostMapping("pagemicrowishAdmin") + R pageMicroWishAdmin(@RequestBody ComActMicroWishVO comActMicroWishVO); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java index e45a7d3..8459cff 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java @@ -26,6 +26,7 @@ private static DateTimeFormatter format_ymdhmssss = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); private static DateTimeFormatter format_ymds = DateTimeFormatter.ofPattern("yyyyMMdd"); private static DateTimeFormatter format_yms = DateTimeFormatter.ofPattern("yyyyMM"); + private static DateTimeFormatter format_y = DateTimeFormatter.ofPattern("yyyy"); /** * 将日期对象格式化成指定的字符串格式 @@ -901,4 +902,13 @@ String nowtime = getCurrentDate().format(format_yms); return nowtime; } + + /** + * 获取当前年字符串 + * @return + */ + public static String getCurrentDateString_YYYY() { + String nowtime = getCurrentDate().format(format_y); + return nowtime; + } } diff --git a/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java b/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java index 6644d2e..9e60390 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java @@ -1226,15 +1226,15 @@ List<String> head5 = new ArrayList<String>(); head5.add("与户主关系"); List<String> head6 = new ArrayList<String>(); - head6.add("*街/路/巷"); + head6.add("*街/路/巷(如:格沙拉大道)"); List<String> head7 = new ArrayList<String>(); - head7.add("*小区号(政府对于每个小区都有特定编号)"); + head7.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); List<String> head8 = new ArrayList<String>(); - head8.add("楼排号"); + head8.add("*楼排号(注:仅填写数字即可)"); List<String> head9 = new ArrayList<String>(); - head9.add("单元号"); + head9.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); List<String> head10 = new ArrayList<String>(); - head10.add("户室(四位数表示。前两位楼层,后两位户号)"); + head10.add("户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); List<String> head11 = new ArrayList<String>(); head11.add("建筑用途"); List<String> head12 = new ArrayList<String>(); @@ -1357,19 +1357,19 @@ List<String> head2 = new ArrayList<String>(); head2.add("民族"); List<String> head3 = new ArrayList<String>(); - head3.add("*身份证号码"); + head3.add("*身份证(性别和年龄自动根据身份证号识别)"); List<String> head4 = new ArrayList<String>(); head4.add("联系电话"); List<String> head5 = new ArrayList<String>(); - head5.add("*街/路/巷"); + head5.add("*街/路/巷(如:格沙拉大道)"); List<String> head6 = new ArrayList<String>(); - head6.add("*小区号(政府对于每个小区都有特定编号)"); + head6.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); List<String> head7 = new ArrayList<String>(); - head7.add("楼排号"); + head7.add("*楼排号(注:仅填写数字即可)"); List<String> head8 = new ArrayList<String>(); - head8.add("单元号"); + head8.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); List<String> head9 = new ArrayList<String>(); - head9.add("户室(四位数表示。前两位楼层,后两位户号)"); + head9.add("户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); List<String> head10 = new ArrayList<String>(); head10.add("是否租住(是/否)"); List<String> head11 = new ArrayList<String>(); @@ -1447,19 +1447,19 @@ List<String> head2 = new ArrayList<String>(); head2.add("民族"); List<String> head3 = new ArrayList<String>(); - head3.add("*身份证号码"); + head3.add("*身份证(性别和年龄自动根据身份证号识别)"); List<String> head4 = new ArrayList<String>(); head4.add("联系电话"); List<String> head5 = new ArrayList<String>(); - head5.add("*街/路/巷"); + head5.add("*街/路/巷(如:格沙拉大道)"); List<String> head6 = new ArrayList<String>(); - head6.add("*小区号(政府对于每个小区都有特定编号)"); + head6.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); List<String> head7 = new ArrayList<String>(); - head7.add("楼排号"); + head7.add("*楼排号(注:仅填写数字即可)"); List<String> head8 = new ArrayList<String>(); - head8.add("单元号"); + head8.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); List<String> head9 = new ArrayList<String>(); - head9.add("户室(四位数表示。前两位楼层,后两位户号)"); + head9.add("*户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); List<String> head10 = new ArrayList<String>(); head10.add("是否租住(是/否)"); List<String> head11 = new ArrayList<String>(); @@ -1487,13 +1487,13 @@ List<String> head22 = new ArrayList<String>(); head22.add("原判刑期"); List<String> head23 = new ArrayList<String>(); - head23.add("原判刑开始日期"); + head23.add("原判刑开始日期(日期格式:2020/02/05)"); List<String> head24 = new ArrayList<String>(); - head24.add("原判刑结束日期"); + head24.add("原判刑结束日期(日期格式:2020/02/05)"); List<String> head25 = new ArrayList<String>(); - head25.add("矫正开始日期"); + head25.add("矫正开始日期(日期格式:2020/02/05)"); List<String> head26 = new ArrayList<String>(); - head26.add("矫正结束日期"); + head26.add("矫正结束日期(日期格式:2020/02/05)"); List<String> head27 = new ArrayList<String>(); head27.add("接收方式"); List<String> head28 = new ArrayList<String>(); @@ -1592,17 +1592,17 @@ List<String> head1 = new ArrayList<String>(); head1.add("*姓名"); List<String> head2 = new ArrayList<String>(); - head2.add("*身份证号码"); + head2.add("*身份证(性别和年龄自动根据身份证号识别)"); List<String> head3 = new ArrayList<String>(); - head3.add("*街/路/巷"); + head3.add("*街/路/巷(如:格沙拉大道)"); List<String> head4 = new ArrayList<String>(); - head4.add("*小区号(政府对于每个小区都有特定编号)"); + head4.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); List<String> head5 = new ArrayList<String>(); - head5.add("楼排号"); + head5.add("*楼排号(注:仅填写数字即可)"); List<String> head6 = new ArrayList<String>(); - head6.add("单元号"); + head6.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); List<String> head7 = new ArrayList<String>(); - head7.add("户室(四位数表示。前两位楼层,后两位户号)"); + head7.add("*户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); List<String> head8 = new ArrayList<String>(); head8.add("是否租住(是/否)"); List<String> head9 = new ArrayList<String>(); @@ -1685,7 +1685,7 @@ List<String> head1 = new ArrayList<String>(); head1.add("*姓名"); List<String> head2 = new ArrayList<String>(); - head2.add("*身份证号码"); + head2.add("*身份证(性别和年龄自动根据身份证号识别)"); List<String> head3 = new ArrayList<String>(); head3.add("民族"); List<String> head4 = new ArrayList<String>(); @@ -1697,15 +1697,15 @@ List<String> head7 = new ArrayList<String>(); head7.add("政治面貌"); List<String> head8 = new ArrayList<String>(); - head8.add("*街/路/巷"); + head8.add("*街/路/巷(如:格沙拉大道)"); List<String> head9 = new ArrayList<String>(); - head9.add("*小区号(政府对于每个小区都有特定编号)"); + head9.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); List<String> head10 = new ArrayList<String>(); - head10.add("楼排号"); + head10.add("*楼排号(注:仅填写数字即可)"); List<String> head11 = new ArrayList<String>(); - head11.add("单元号"); + head11.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); List<String> head12 = new ArrayList<String>(); - head12.add("户室(四位数表示。前两位楼层,后两位户号)"); + head12.add("*户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); List<String> head13 = new ArrayList<String>(); head13.add("是否租住(是/否)"); List<String> head14 = new ArrayList<String>(); @@ -1723,7 +1723,7 @@ List<String> head20 = new ArrayList<String>(); head20.add("基本情况(参加邪教的活动情况)"); List<String> head21 = new ArrayList<String>(); - head21.add("参加邪教时间"); + head21.add("参加邪教时间(日期格式:2020/02/05))"); List<String> head22 = new ArrayList<String>(); head22.add("是否对外宣传"); List<String> head23 = new ArrayList<String>(); @@ -1765,21 +1765,21 @@ List<String> head2 = new ArrayList<String>(); head2.add("民族"); List<String> head3 = new ArrayList<String>(); - head3.add("*身份证号码"); + head3.add("*身份证(性别和年龄自动根据身份证号识别)"); List<String> head4 = new ArrayList<String>(); head4.add("联系电话"); List<String> head5 = new ArrayList<String>(); head5.add("籍贯"); List<String> head6 = new ArrayList<String>(); - head6.add("*街/路/巷"); + head6.add("*街/路/巷(如:格沙拉大道)"); List<String> head7 = new ArrayList<String>(); - head7.add("*小区号(政府对于每个小区都有特定编号)"); + head7.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); List<String> head8 = new ArrayList<String>(); - head8.add("楼排号"); + head8.add("*楼排号(注:仅填写数字即可)"); List<String> head9 = new ArrayList<String>(); - head9.add("单元号"); + head9.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); List<String> head10 = new ArrayList<String>(); - head10.add("户室(四位数表示。前两位楼层,后两位户号)"); + head10.add("*户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); List<String> head11 = new ArrayList<String>(); head11.add("是否租住(是/否)"); List<String> head12 = new ArrayList<String>(); @@ -1803,19 +1803,19 @@ List<String> head21 = new ArrayList<String>(); head21.add("是否累犯"); List<String> head22 = new ArrayList<String>(); - head22.add("原判刑期"); + head22.add("原判刑期(日期格式:2020/02/05)"); List<String> head23 = new ArrayList<String>(); - head23.add("服刑日期"); + head23.add("服刑日期(日期格式:2020/02/05)"); List<String> head24 = new ArrayList<String>(); head24.add("原罪名"); List<String> head25 = new ArrayList<String>(); - head25.add("释放日期"); + head25.add("释放日期(日期格式:2020/02/05)"); List<String> head26 = new ArrayList<String>(); head26.add("服刑场所"); List<String> head27 = new ArrayList<String>(); head27.add("危险性评估"); List<String> head28 = new ArrayList<String>(); - head28.add("衔接日期"); + head28.add("衔接日期(日期格式:2020/02/05)"); List<String> head29 = new ArrayList<String>(); head29.add("衔接情况"); List<String> head30 = new ArrayList<String>(); @@ -1825,7 +1825,7 @@ List<String> head32 = new ArrayList<String>(); head32.add("安置情况"); List<String> head33 = new ArrayList<String>(); - head33.add("安置日期"); + head33.add("安置日期(日期格式:2020/02/05)"); List<String> head34 = new ArrayList<String>(); head34.add("未安置原因"); List<String> head35 = new ArrayList<String>(); @@ -1888,21 +1888,21 @@ List<String> head2 = new ArrayList<String>(); head2.add("民族"); List<String> head3 = new ArrayList<String>(); - head3.add("*身份证号码"); + head3.add("*身份证(性别和年龄自动根据身份证号识别)"); List<String> head4 = new ArrayList<String>(); head4.add("联系电话"); List<String> head5 = new ArrayList<String>(); head5.add("籍贯"); List<String> head6 = new ArrayList<String>(); - head6.add("*街/路/巷"); + head6.add("*街/路/巷(如:格沙拉大道)"); List<String> head7 = new ArrayList<String>(); - head7.add("*小区号(政府对于每个小区都有特定编号)"); + head7.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); List<String> head8 = new ArrayList<String>(); - head8.add("楼排号"); + head8.add("*楼排号(注:仅填写数字即可)"); List<String> head9 = new ArrayList<String>(); - head9.add("单元号"); + head9.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); List<String> head10 = new ArrayList<String>(); - head10.add("户室(四位数表示。前两位楼层,后两位户号)"); + head10.add("*户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); List<String> head11 = new ArrayList<String>(); head11.add("是否租住(是/否)"); List<String> head12 = new ArrayList<String>(); @@ -2025,27 +2025,27 @@ List<String> head3 = new ArrayList<String>(); head3.add("*姓名"); List<String> head4 = new ArrayList<String>(); - head4.add("*身份证号码"); + head4.add("*身份证(性别和年龄自动根据身份证号识别)"); List<String> head5 = new ArrayList<String>(); head5.add("联系电话"); List<String> head6 = new ArrayList<String>(); head6.add("照片"); List<String> head7 = new ArrayList<String>(); - head7.add("户籍性质"); + head7.add("户籍性质(城镇户口、农村户口)"); List<String> head8 = new ArrayList<String>(); head8.add("户口所在地(身份证地址)"); List<String> head9 = new ArrayList<String>(); head9.add("本地/外地"); List<String> head10 = new ArrayList<String>(); - head10.add("*街/路/巷"); + head10.add("*街/路/巷(如:格沙拉大道)"); List<String> head11 = new ArrayList<String>(); - head11.add("*小区号(政府对于每个小区都有特定编号)"); + head11.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); List<String> head12 = new ArrayList<String>(); - head12.add("楼排号"); + head12.add("*楼排号(注:仅填写数字即可)"); List<String> head13 = new ArrayList<String>(); - head13.add("单元号"); + head13.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); List<String> head14 = new ArrayList<String>(); - head14.add("户室(四位数表示。前两位楼层,后两位户号)"); + head14.add("户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); List<String> head15 = new ArrayList<String>(); head15.add("是否租住(是/否)"); List<String> head16 = new ArrayList<String>(); @@ -2053,11 +2053,11 @@ List<String> head17 = new ArrayList<String>(); head17.add("房屋用途(住宅/公寓/宿舍/仓库/其他)"); List<String> head18 = new ArrayList<String>(); - head18.add("控状态(常规/关注/管控)"); + head18.add("管控状态(常规/关注/管控)"); List<String> head19 = new ArrayList<String>(); - head19.add("入伍时间"); + head19.add("入伍时间(初次发现日期(日期格式:2020/02/05)"); List<String> head20 = new ArrayList<String>(); - head20.add("退伍时间"); + head20.add("退伍时间(日期格式:2020/02/05)"); List<String> head21 = new ArrayList<String>(); head21.add("人员类别"); List<String> head22 = new ArrayList<String>(); @@ -2213,7 +2213,7 @@ List<String> head1 = new ArrayList<String>(); head1.add("*姓名"); List<String> head2 = new ArrayList<String>(); - head2.add("*身份证号码"); + head2.add("*身份证(性别和年龄自动根据身份证号识别)"); List<String> head3 = new ArrayList<String>(); head3.add("办证状况"); List<String> head4 = new ArrayList<String>(); @@ -2227,15 +2227,15 @@ List<String> head8 = new ArrayList<String>(); head8.add("联系电话"); List<String> head9 = new ArrayList<String>(); - head9.add("*街/路/巷"); + head9.add("*街/路/巷(如:格沙拉大道)"); List<String> head10 = new ArrayList<String>(); - head10.add("*小区号(政府对于每个小区都有特定编号)"); + head10.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); List<String> head11 = new ArrayList<String>(); - head11.add("楼排号"); + head11.add("*楼排号(注:仅填写数字即可)"); List<String> head12 = new ArrayList<String>(); - head12.add("单元号"); + head12.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); List<String> head13 = new ArrayList<String>(); - head13.add("户室(四位数表示。前两位楼层,后两位户号)"); + head13.add("户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); List<String> head14 = new ArrayList<String>(); head14.add("是否租住(是/否)"); List<String> head15 = new ArrayList<String>(); @@ -2282,7 +2282,7 @@ List<String> head1 = new ArrayList<String>(); head1.add("*姓名"); List<String> head2 = new ArrayList<String>(); - head2.add("*身份证号码"); + head2.add("*身份证(性别和年龄自动根据身份证号识别)"); List<String> head3 = new ArrayList<String>(); head3.add("联系电话"); List<String> head4 = new ArrayList<String>(); @@ -2302,15 +2302,15 @@ List<String> head11 = new ArrayList<String>(); head11.add("户主编码"); List<String> head12 = new ArrayList<String>(); - head12.add("*街/路/巷"); + head12.add("*街/路/巷(如:格沙拉大道)"); List<String> head13 = new ArrayList<String>(); - head13.add("*小区号(政府对于每个小区都有特定编号)"); + head13.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); List<String> head14 = new ArrayList<String>(); - head14.add("楼排号"); + head14.add("*楼排号(注:仅填写数字即可)"); List<String> head15 = new ArrayList<String>(); - head15.add("单元号"); + head15.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); List<String> head16 = new ArrayList<String>(); - head16.add("户室(四位数表示。前两位楼层,后两位户号)"); + head16.add("户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); List<String> head17 = new ArrayList<String>(); head17.add("是否租住(是/否)"); List<String> head18 = new ArrayList<String>(); @@ -2362,7 +2362,7 @@ List<String> head41 = new ArrayList<String>(); head41.add("纬度"); List<String> head42 = new ArrayList<String>(); - head42.add("始发年月"); + head42.add("始发年月(初次发现日期(日期格式:2020/02/05)"); List<String> head43 = new ArrayList<String>(); head43.add("护理费"); List<String> head44 = new ArrayList<String>(); @@ -2432,15 +2432,15 @@ List<String> head4 = new ArrayList<String>(); head4.add("是否租住"); List<String> head5 = new ArrayList<String>(); - head5.add("*街/路/巷"); + head5.add("*街/路/巷(如:格沙拉大道)"); List<String> head6 = new ArrayList<String>(); - head6.add("*小区号(政府对于每个小区都有特定编号)"); + head6.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); List<String> head7 = new ArrayList<String>(); - head7.add("楼排号"); + head7.add("*楼排号(注:仅填写数字即可)"); List<String> head8 = new ArrayList<String>(); - head8.add("单元号"); + head8.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); List<String> head9 = new ArrayList<String>(); - head9.add("户室(四位数表示。前两位楼层,后两位户号)"); + head9.add("*户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); List<String> head10 = new ArrayList<String>(); head10.add("房屋状态(自住/租住/其他)"); List<String> head11 = new ArrayList<String>(); @@ -2514,15 +2514,15 @@ List<String> head4 = new ArrayList<String>(); head4.add("是否租住"); List<String> head5 = new ArrayList<String>(); - head5.add("*街/路/巷(社区内无住所可填写社区街路巷地址)"); + head5.add("*街/路/巷(如:格沙拉大道)"); List<String> head6 = new ArrayList<String>(); - head6.add("*小区号(政府对于每个小区都有特定编号)(社区内无住所可填写社区街路巷号)"); + head6.add("*地址号(对于地址都有特定编号,如:格萨拉大道11号) 注:仅填写数字即可"); List<String> head7 = new ArrayList<String>(); - head7.add("楼排号"); + head7.add("*楼排号(注:仅填写数字即可)"); List<String> head8 = new ArrayList<String>(); - head8.add("单元号"); + head8.add("*单元号(注:仅填写数字即可.老式楼栋若没有单元划分则默认为一单元)"); List<String> head9 = new ArrayList<String>(); - head9.add("户室(四位数表示。前两位楼层,后两位户号)"); + head9.add("*户室(只能识别纯数字。根据实际有以下几种户室类型,请根据实际填写:①9楼1号—901;12楼10号—1210②没有楼层只有号。如9号—9:;13号—13)"); List<String> head10 = new ArrayList<String>(); head10.add("房屋状态(自住/租住/其他)"); List<String> head11 = new ArrayList<String>(); diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java index 0ef6120..d941e18 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java @@ -2446,4 +2446,14 @@ public R wishHandleListAdmin(@RequestParam(value = "communityId") Long communityId,@RequestParam("type") Integer type){ return R.ok(comActMicroWishService.wishHandleListAdmin(communityId,type)); } + + /** + * 社区后台分页查询微心愿 + * @param comActMicroWishVO 请求参数 + * @return 微心愿列表 + */ + @PostMapping("pagemicrowishAdmin") + public R pageMicroWishAdmin(@RequestBody ComActMicroWishVO comActMicroWishVO) { + return comActMicroWishService.pageMicroWishAdmin(comActMicroWishVO); + } } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java index 9a8c8b5..0c4c4c4 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ConvenientApi.java @@ -365,7 +365,6 @@ */ @PostMapping("/merchant/add") public R addMerchant(@RequestBody ConvenientMerchantDTO convenientMerchantDTO) { - log.error("catTimeStamp进入service_community", Instant.now().toEpochMilli()); return convenientMerchantService.addMerchant(convenientMerchantDTO); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java index 8fc1bff..c29a459 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java @@ -107,6 +107,13 @@ "</script>") IPage<ComActMicroWishVO> pageMicroWish(Page page, @Param("comActMicroWishVO") ComActMicroWishVO comActMicroWishVO); + /** + * 社区后台分页查询微心愿 + * @param comActMicroWishVO 请求参数 + * @return 微心愿列表 + */ + IPage<ComActMicroWishVO> pageMicroWishAdmin(Page page, @Param("comActMicroWishVO") ComActMicroWishVO comActMicroWishVO); + IPage<ComActMicroWishVO> pageMicroWishApplets(Page page, @Param("comActMicroWishVO") ComActMicroWishVO comActMicroWishVO); @Select("SELECT " + "w.id, " + diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientProductSpecificationDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientProductSpecificationDAO.java index 78c99f6..0ae2b5b 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientProductSpecificationDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientProductSpecificationDAO.java @@ -27,9 +27,10 @@ /** * 删除传入ID以外的关联 * @param notNeedDelIds + * @param productId * @return */ - int deleteLoseRelationSpecifications(@Param("notNeedDelIds") List<Long> notNeedDelIds); + int deleteLoseRelationSpecifications(@Param("notNeedDelIds") List<Long> notNeedDelIds, @Param("productId") Long productId); /** * 通过产品ID删除相关规格 diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDiscussDO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDiscussDO.java index 455b4e2..990b0a6 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDiscussDO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDiscussDO.java @@ -38,6 +38,7 @@ /** * 图片地址 多个用逗号隔开 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) private String photoPah; /** diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComPensionAuthHistoryRecordDO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComPensionAuthHistoryRecordDO.java index 6b82b5f..ff43aeb 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComPensionAuthHistoryRecordDO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComPensionAuthHistoryRecordDO.java @@ -137,6 +137,14 @@ */ private Long approverId; + /** + * 本期是否已认证(1.是 2.否) + */ + public interface isAuth{ + int yes = 1; + int no = 2; + } + @Override public String toString() { return "ComPensionAuthHistoryRecordDO{" + diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActMicroWishService.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActMicroWishService.java index 4b26570..0502d58 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActMicroWishService.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActMicroWishService.java @@ -100,4 +100,11 @@ * @return 处理人列表 */ R wishHandleListAdmin(Long communityId,Integer type); + + /** + * 社区后台分页查询微心愿 + * @param comActMicroWishVO 请求参数 + * @return 微心愿列表 + */ + R pageMicroWishAdmin(ComActMicroWishVO comActMicroWishVO); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMicroWishServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMicroWishServiceImpl.java index d0a6cf3..4361752 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMicroWishServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMicroWishServiceImpl.java @@ -484,4 +484,37 @@ } return result; } + + /** + * 社区后台分页查询微心愿 + * @param comActMicroWishVO 请求参数 + * @return 微心愿列表 + */ + @Override + public R pageMicroWishAdmin(ComActMicroWishVO comActMicroWishVO) { + Long userId = comActMicroWishVO.getResponsibleId(); + IPage<ComActMicroWishVO> iPage = comActMicroWishDAO.pageMicroWishAdmin(new Page(comActMicroWishVO.getPageNum() + ,comActMicroWishVO.getPageSize()), comActMicroWishVO); + + List<ComActMicroWishVO> records = iPage.getRecords(); + if (!ObjectUtils.isEmpty(records)) { + records.forEach(comActMicroWishVO1 -> { + if(userId != null){ + Long id = comActMicroWishVO1.getId(); + ComActMicroWishUserDO comActMicroWishUserDO = comActMicroWishUserDAO.selectOne(new QueryWrapper<ComActMicroWishUserDO>().lambda().eq(ComActMicroWishUserDO::getMicroWishId, id) + .eq(ComActMicroWishUserDO::getUserId, userId)); + if (ObjectUtils.isEmpty(comActMicroWishUserDO)) { + comActMicroWishVO1.setHaveGiveThumbsUp(0); + } else { + comActMicroWishVO1.setHaveGiveThumbsUp(1); + } + } + comActMicroWishVO1.setSponsorPhone(SensitiveUtil.desensitizedPhoneNumber(comActMicroWishVO1.getSponsorPhone())); + //查询处理人 + comActMicroWishVO1.setResponsibleName(this.getWishHandleName(comActMicroWishVO1.getHandleId())); + }); + iPage.setRecords(records); + } + return R.ok(iPage); + } } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComPensionAuthRecordServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComPensionAuthRecordServiceImpl.java index 585c71c..56be9f5 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComPensionAuthRecordServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComPensionAuthRecordServiceImpl.java @@ -106,6 +106,13 @@ } page.setSize(pageSize); page.setCurrent(pageNum); + try { + //关键词为空时需要进行加密,通过加密去检索身份证号筛选高龄认证记录 + String idCard = AESUtil.encrypt128(pageElderAuthRecordsDTO.getSearchKey(), aesKey); + pageElderAuthRecordsDTO.setIdCard(idCard); + }catch (Exception e){ + log.error("查询高龄认证记录转换身份证号失败"); + } IPage<ComPensionAuthRecordVO> iPage = comPensionAuthRecordDAO.pagePensionAuthRecords(page, pageElderAuthRecordsDTO); if (!iPage.getRecords().isEmpty()) { iPage.getRecords().forEach(comPensionAuthRecordVO -> { @@ -375,14 +382,9 @@ comPensionAuthStatisticsDO.setSum(comPensionAuthPensionerDOS.size()); } comPensionAuthStatisticsDAO.insert(comPensionAuthStatisticsDO); - //上期已认证人数 - int authSum = comPensionAuthPensionerDAO.havePensionAuthPensionerAmount(act.getCommunityId(), String.valueOf(year - 1)); - ComPensionAuthStatisticsDO comPensionAuthStatisticsDO1 = comPensionAuthStatisticsDAO.selectOne(new QueryWrapper<ComPensionAuthStatisticsDO>() - .lambda().eq(ComPensionAuthStatisticsDO::getCommunityId, act.getCommunityId()).eq(ComPensionAuthStatisticsDO::getYear, year - 1)); - comPensionAuthStatisticsDO1.setAuthSum(authSum); - comPensionAuthStatisticsDO1.setNoAuthSum(comPensionAuthStatisticsDO1.getSum() - comPensionAuthStatisticsDO1.getAuthSum()); - comPensionAuthStatisticsDAO.updateById(comPensionAuthStatisticsDO1); }); + + return R.ok(); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java index 86fd04c..1487dd1 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java @@ -5,7 +5,6 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank; import java.text.SimpleDateFormat; -import java.time.Instant; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -13,7 +12,6 @@ import javax.annotation.Resource; -import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -56,6 +54,8 @@ import com.panzhihua.service_community.model.dos.ConvenientViewStatisticsDO; import com.panzhihua.service_community.service.ConvenientMerchantService; +import lombok.extern.slf4j.Slf4j; + /** * @title: ConvenientMerchantServiceImpl * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 @@ -83,7 +83,6 @@ @Override @Transactional(rollbackFor = Exception.class) public R addMerchant(ConvenientMerchantDTO convenientMerchantDTO) { - log.error("catTimeStamp开始执行addMerchant", Instant.now().toEpochMilli()); ComActDO comActDO = comActDAO.selectById(convenientMerchantDTO.getCommunityId()); ConvenientMerchantDO convenientMerchantDO = new ConvenientMerchantDO(); BeanUtils.copyProperties(convenientMerchantDTO, convenientMerchantDO); @@ -103,7 +102,6 @@ }); } } - log.error("catTimeStamp商家创建完成开始添加用户", Instant.now().toEpochMilli()); //添加user R addUserResult = userService.addConvenientMerchantUser(convenientMerchantDTO); if (R.isOk(addUserResult)) { @@ -113,7 +111,6 @@ } else { throw new ServiceException("406", addUserResult.getMsg()); } - log.error("catTimeStamp全部完成", Instant.now().toEpochMilli()); return R.ok(); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientProductServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientProductServiceImpl.java index 9fbaf17..0c51aed 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientProductServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientProductServiceImpl.java @@ -106,8 +106,7 @@ convenientProductDO.setUpdatedBy(updatedBy); this.baseMapper.updateById(convenientProductDO); List<ConvenientProductSpecificationDTO> productSpecificationDTOList = convenientProductDTO.getProductSpecificationDTOList(); - List<Long> notNeedDelIds = productSpecificationDTOList.stream().filter(specificationDTO -> nonNull(specificationDTO.getId())) - .map(ConvenientProductSpecificationDTO::getId).collect(Collectors.toList()); + List<Long> notNeedDelIds = new ArrayList<>(); productSpecificationDTOList.forEach(specificationDTO -> { Long specificationId = specificationDTO.getId(); if (isNull(specificationId)) { @@ -118,16 +117,18 @@ convenientProductSpecificationDO.setCreatedAt(nowDate); convenientProductSpecificationDO.setCreatedBy(updatedBy); convenientProductSpecificationDAO.insert(convenientProductSpecificationDO); + notNeedDelIds.add(convenientProductSpecificationDO.getId()); } else { //更新 ConvenientProductSpecificationDO convenientProductSpecificationDO = convenientProductSpecificationDAO.selectById(specificationId); BeanUtils.copyProperties(specificationDTO, convenientProductSpecificationDO); convenientProductSpecificationDO.setUpdatedBy(updatedBy); convenientProductSpecificationDAO.updateById(convenientProductSpecificationDO); + notNeedDelIds.add(specificationId); } }); //删除已失去关联的规格 - convenientProductSpecificationDAO.deleteLoseRelationSpecifications(notNeedDelIds); + convenientProductSpecificationDAO.deleteLoseRelationSpecifications(notNeedDelIds, productId); return R.ok(); } @@ -215,6 +216,7 @@ List<ConvenientProductVO> productVOList = this.baseMapper.getMerchantProduct(merchantId); List<ConvenientProductSpecificationVO> specificationVOList = this.baseMapper.getProductSpecifications(merchantId); List<ConvenientProductLevelInfoVO> levelInfoVOList = new ArrayList<>(); + List<String> categoryList = new ArrayList<>(); if (!productVOList.isEmpty()) { productVOList.forEach(productVO -> { List<ConvenientProductSpecificationVO> currentProductSpecificationVOList = new ArrayList<>(); @@ -224,22 +226,22 @@ } }); productVO.setProductSpecificationVOList(currentProductSpecificationVOList); + if (!categoryList.contains(productVO.getCategoryName())) { + categoryList.add(productVO.getCategoryName()); + } }); //分类 Map<String, List<ConvenientProductVO>> levelGroup = productVOList.stream() .collect(Collectors.groupingBy(ConvenientProductVO::getCategoryName)); - Set<String> categoryNames = levelGroup.keySet(); - Iterator<String> iterator = categoryNames.iterator(); - while (iterator.hasNext()) { - String categoryName = iterator.next(); + categoryList.forEach(category -> { ConvenientProductLevelInfoVO levelInfoVOLevelInfoVO = new ConvenientProductLevelInfoVO(); - levelInfoVOLevelInfoVO.setCategoryName(categoryName); - List<ConvenientProductVO> productVOS = levelGroup.get(categoryName); + levelInfoVOLevelInfoVO.setCategoryName(category); + List<ConvenientProductVO> productVOS = levelGroup.get(category); List<ConvenientProductVO> sortedProductVOS = productVOS.stream() .sorted(Comparator.comparing(ConvenientProductVO::getOnShelfAt).reversed()).collect(Collectors.toList()); levelInfoVOLevelInfoVO.setProductVOList(sortedProductVOS); levelInfoVOList.add(levelInfoVOLevelInfoVO); - } + }); } return R.ok(levelInfoVOList); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/EldersAuthServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/EldersAuthServiceImpl.java index 9a9cef8..2877469 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/EldersAuthServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/EldersAuthServiceImpl.java @@ -71,6 +71,12 @@ private ComElderAuthRecordsDAO comElderAuthRecordsDAO; @Resource private ComElderAuthElderliesDAO comElderAuthElderliesDAO; + @Resource + private ComPensionAuthHistoryRecordMapper comPensionAuthHistoryRecordMapper; + @Resource + private ComPensionAuthRecordDAO comPensionAuthRecordDAO; + @Resource + private ComPensionAuthPensionerDAO comPensionAuthPensionerDAO; @Value("${domain.aesKey:}") private String aesKey; @@ -573,21 +579,41 @@ public R timedTaskEldersRecordAuthJobHandler(){ Date nowDate = new Date(); - String authPeriod = DateUtils.getCurrentDateString_YYYY_MM(); + //高龄认证本期期数 + String elderAuthPeriod = DateUtils.getCurrentDateString_YYYY_MM(); + //养老认证本期期数 + String pensionAuthPeriod = DateUtils.getCurrentDateString_YYYY(); + + //养老认证本期期数 //查询所有老人信息并加入到老人认证历史记录表中,如果不存在则新增,存在则不做操作 List<ComElderAuthElderliesDO> authElderliesList = comElderAuthElderliesDAO.selectList(new QueryWrapper<>()); authElderliesList.forEach(authElderlies -> { + //查询高龄认证记录 ComEldersAuthHistoryRecordDO authHistoryRecordDO = comEldersAuthHistoryRecordMapper.selectOne(new QueryWrapper<ComEldersAuthHistoryRecordDO>().lambda() .eq(ComEldersAuthHistoryRecordDO::getElderliesId,authElderlies.getId()) - .eq(ComEldersAuthHistoryRecordDO::getAuthPeriod,authPeriod)); + .eq(ComEldersAuthHistoryRecordDO::getAuthPeriod,elderAuthPeriod)); if(authHistoryRecordDO == null){ authHistoryRecordDO = new ComEldersAuthHistoryRecordDO(); BeanUtils.copyProperties(authElderlies,authHistoryRecordDO); authHistoryRecordDO.setIsAuth(ComEldersAuthHistoryRecordDO.isAuth.no); authHistoryRecordDO.setElderliesId(authElderlies.getId()); - authHistoryRecordDO.setAuthPeriod(authPeriod); + authHistoryRecordDO.setAuthPeriod(elderAuthPeriod); authHistoryRecordDO.setCreateAt(nowDate); comEldersAuthHistoryRecordMapper.insert(authHistoryRecordDO); + } + + //查询养老认证记录 + ComPensionAuthHistoryRecordDO pensionAuthDO = comPensionAuthHistoryRecordMapper.selectOne(new QueryWrapper<ComPensionAuthHistoryRecordDO>().lambda() + .eq(ComPensionAuthHistoryRecordDO::getElderliesId,authElderlies.getId()) + .eq(ComPensionAuthHistoryRecordDO::getAuthPeriod,pensionAuthPeriod)); + if(pensionAuthDO == null){ + pensionAuthDO = new ComPensionAuthHistoryRecordDO(); + BeanUtils.copyProperties(authElderlies,pensionAuthDO); + pensionAuthDO.setIsAuth(ComPensionAuthHistoryRecordDO.isAuth.no); + pensionAuthDO.setElderliesId(authElderlies.getId()); + pensionAuthDO.setAuthPeriod(pensionAuthPeriod); + pensionAuthDO.setCreateAt(nowDate); + comPensionAuthHistoryRecordMapper.insert(pensionAuthDO); } }); @@ -614,12 +640,51 @@ }else{ authHistoryRecordDO = new ComEldersAuthHistoryRecordDO(); BeanUtils.copyProperties(authRecords,authHistoryRecordDO); + //查询老人信息 + ComElderAuthElderliesDO authElderliesDO = comElderAuthElderliesDAO.selectById(authRecords.getElderliesId()); + if(authElderliesDO != null){ + BeanUtils.copyProperties(authElderliesDO,authHistoryRecordDO); + } authHistoryRecordDO.setIsAuth(ComEldersAuthHistoryRecordDO.isAuth.yes); authHistoryRecordDO.setAuthId(authRecords.getId()); comEldersAuthHistoryRecordMapper.insert(authHistoryRecordDO); } } }); + + //查询养老认证记录列表 + List<ComPensionAuthRecordDO> pensionAuthList = comPensionAuthRecordDAO.selectList(new QueryWrapper<ComPensionAuthRecordDO>().lambda() + .ge(ComPensionAuthRecordDO::getCreateAt,DateUtils.getFirstDayOfMonth())); + //遍历养老认证记录列表 + pensionAuthList.forEach(authRecords -> { + ComPensionAuthHistoryRecordDO pensionAuthDO = comPensionAuthHistoryRecordMapper.selectOne(new QueryWrapper<ComPensionAuthHistoryRecordDO>().lambda() + .eq(ComPensionAuthHistoryRecordDO::getElderliesId,authRecords.getPensionerId()) + .eq(ComPensionAuthHistoryRecordDO::getAuthPeriod,authRecords.getAuthPeriod())); + if(pensionAuthDO != null){//存在记录 + if(pensionAuthDO.getIsAuth().equals(ComPensionAuthHistoryRecordDO.isAuth.no)){ + pensionAuthDO.setIsAuth(ComPensionAuthHistoryRecordDO.isAuth.yes); + pensionAuthDO.setAuthDate(authRecords.getApprovalDate()); + pensionAuthDO.setApprovalDate(authRecords.getApprovalDate()); + pensionAuthDO.setApproverId(authRecords.getApproverId()); + pensionAuthDO.setSubmitUserId(authRecords.getSubmitUserId()); + pensionAuthDO.setAuthMethod(authRecords.getAuthMethod()); + pensionAuthDO.setVerificationResult(authRecords.getVerificationResult()); + pensionAuthDO.setAuthId(authRecords.getId()); + comPensionAuthHistoryRecordMapper.updateById(pensionAuthDO); + } + }else{ + pensionAuthDO = new ComPensionAuthHistoryRecordDO(); + BeanUtils.copyProperties(authRecords,pensionAuthDO); + //查询老人信息 + ComPensionAuthPensionerDO authPensionerDO = comPensionAuthPensionerDAO.selectById(authRecords.getPensionerId()); + if(authPensionerDO != null){ + BeanUtils.copyProperties(authPensionerDO,pensionAuthDO); + } + pensionAuthDO.setIsAuth(ComPensionAuthHistoryRecordDO.isAuth.yes); + pensionAuthDO.setAuthId(authRecords.getId()); + comPensionAuthHistoryRecordMapper.insert(pensionAuthDO); + } + }); return R.ok(); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml index 60d2511..566e221 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml @@ -54,6 +54,6 @@ </select> <select id="getIndexTopActivityList" resultMap="BaseResultMap"> SELECT * FROM `com_act_activity` - WHERE community_id = #{communityId} and is_top = 1 and sign_up_end >= now() and sign_up_begin <= now() + WHERE community_id = #{communityId} and is_top = 1 and sign_up_end >= now() </select> </mapper> \ No newline at end of file diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDiscussCommentDOMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDiscussCommentDOMapper.xml index d511f6c..6906ac4 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDiscussCommentDOMapper.xml +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDiscussCommentDOMapper.xml @@ -27,7 +27,7 @@ cadc.`comment`, cadc.`is_author`, su.`image_url`, - IFNULL( su.`name`, su.nick_name ) AS userNameBack, + IFNULL( su.`name`, su.nick_name ) AS userName, cadc.create_at FROM com_act_discuss_comment AS cadc diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActMicroWishDOMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActMicroWishDOMapper.xml index b12276b..37e9dcd 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActMicroWishDOMapper.xml +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActMicroWishDOMapper.xml @@ -108,4 +108,59 @@ select user_id,IFNULL(`name`,nick_name) as `name`,`type`,is_volunteer,is_partymember from sys_user where user_id = #{userId} </select> + <select id="pageMicroWishAdmin" resultType="com.panzhihua.common.model.vos.community.ComActMicroWishVO"> + SELECT + w.id, + u.`name` sponsor_name, + u.nick_name userNickName, + u.image_url , + w.sponsor_phone, + w.wish_name, + w.`status`, + w.`feedback_at`, + w.`examine_at`, + w.`distribution_at`, + w.`evaluate_at`, + w.`photo_path_list`, + count(wu.id)star_num, + w.`detail`, + w.form, + w.reject_reason, + su1.`name` responsible_name, + w.score, + w.img_width, + w.finish_at, + w.aim_num, + w.img_height, + w.handle_id, + w.create_at + FROM + com_act_micro_wish w + left join com_act_micro_wish_user wu on w.id=wu.micro_wish_id + left JOIN sys_user u ON w.sponsor_id = u.user_id + LEFT JOIN sys_user su1 ON w.responsible_id = su1.user_id + <where> + <if test='comActMicroWishVO.communityId != null and comActMicroWishVO.communityId != 0'> + and w.community_id=#{comActMicroWishVO.communityId} + </if> + <if test='comActMicroWishVO.createBegin != null '> + AND w.create_at BETWEEN #{comActMicroWishVO.createBegin} + AND #{comActMicroWishVO.createEnd} + </if> + <if test='comActMicroWishVO.sponsorPhone != null and comActMicroWishVO.sponsorPhone != ""'> + AND u.`phone` like concat(#{comActMicroWishVO.sponsorPhone},'%') + </if> + <if test='comActMicroWishVO.sponsorName != null and comActMicroWishVO.sponsorName != ""'> + AND u.`name` like concat(#{comActMicroWishVO.sponsorName},'%') + </if> + <if test='comActMicroWishVO.responsibleName != null and comActMicroWishVO.responsibleName != ""'> + AND su1.`name` like concat(#{comActMicroWishVO.responsibleName},'%') + </if> + <if test='comActMicroWishVO.status != null'> + AND w.`status` = #{comActMicroWishVO.status} + </if> + </where> + ORDER BY w.create_at desc + </select> + </mapper> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComPensionAuthRecordMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComPensionAuthRecordMapper.xml index a47c000..7f0d206 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComPensionAuthRecordMapper.xml +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComPensionAuthRecordMapper.xml @@ -59,10 +59,10 @@ and cpar.auth_method = #{pageElderAuthRecordsDTO.authMethod} </if> <if test="pageElderAuthRecordsDTO.authDateBegin != null and pageElderAuthRecordsDTO.authDateBegin != ''"> - and cpar.auth_date after #{pageElderAuthRecordsDTO.authDateBegin} + and cpar.auth_date <![CDATA[ >= ]]> #{pageElderAuthRecordsDTO.authDateBegin} </if> <if test="pageElderAuthRecordsDTO.authDateEnd != null and pageElderAuthRecordsDTO.authDateEnd != ''"> - and cpar.auth_date before #{pageElderAuthRecordsDTO.authDateEnd} + and cpar.auth_date <![CDATA[ <= ]]> #{pageElderAuthRecordsDTO.authDateEnd} </if> <if test="pageElderAuthRecordsDTO.approvalStatus != null and pageElderAuthRecordsDTO.approvalStatus != 0"> and cpar.approval_status = #{pageElderAuthRecordsDTO.approvalStatus} @@ -78,7 +78,8 @@ </if> <if test="pageElderAuthRecordsDTO.searchKey != null and pageElderAuthRecordsDTO.searchKey != ''"> and (cpap.`name` like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%') - or cpar.mark like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%')) + or cpar.mark like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%') + or cpap.id_card = #{pageElderAuthRecordsDTO.idCard}) </if> order by cpar.create_at desc </select> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientMerchantMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientMerchantMapper.xml index 817fb12..cf9f857 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientMerchantMapper.xml +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientMerchantMapper.xml @@ -60,7 +60,7 @@ OR ccm.phone LIKE CONCAT('%', #{pageConvenientMerchantDTO.keyword}, '%') ) </if> - GROUP BY ccm.id + GROUP BY ccm.id ORDER BY ccm.created_at DESC </select> <select id="selectMerchantById" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO"> SELECT ccm.*, su.account, su.status AS accountStatus diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductMapper.xml index 043bf27..aa2c148 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductMapper.xml +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductMapper.xml @@ -56,6 +56,7 @@ <if test="pageConvenientProductDTO.onShelf != null"> AND ccp.on_shelf = #{pageConvenientProductDTO.onShelf} </if> + ORDER BY ccp.created_at DESC </select> <select id="getMerchantProduct" resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientProductVO"> SELECT ccp.id, ccp.name, ccp.category_id, ccp.on_shelf_at, ccp.introduction, ccpc.name AS categoryName diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductSpecificationMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductSpecificationMapper.xml index 19d3b9e..1e8eec7 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductSpecificationMapper.xml +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductSpecificationMapper.xml @@ -29,7 +29,7 @@ </insert> <update id="deleteLoseRelationSpecifications" parameterType="java.util.List"> UPDATE com_convenient_product_specifications SET is_del = 1 - WHERE id NOT IN + WHERE product_id = #{productId} AND id NOT IN <foreach collection="notNeedDelIds" open="(" separator="," close=")" index="index" item="item"> #{item} </foreach> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientServiceCategoryMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientServiceCategoryMapper.xml index 304e214..227ced0 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientServiceCategoryMapper.xml +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientServiceCategoryMapper.xml @@ -50,6 +50,6 @@ FROM com_convenient_service_categories ccsc INNER JOIN com_convenient_service_scope ccss ON ccsc.id = ccss.service_category_id LEFT JOIN com_convenient_merchants ccm ON ccss.merchant_id = ccm.id - WHERE ccsc.is_del = 0 AND ccm.is_del = 0 AND ccm.community_id = #{communityId} AND ccm.business_status = 1 GROUP BY ccsc.id + WHERE ccsc.is_del = 0 AND ccm.is_del = 0 AND ccm.community_id = #{communityId} AND ccm.business_status = 1 GROUP BY ccsc.id ORDER BY ccsc.weight desc </select> </mapper> \ No newline at end of file diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/pom.xml b/springcloud_k8s_panzhihuazhihuishequ/service_property/pom.xml index 72e03e4..201fe1c 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_property/pom.xml +++ b/springcloud_k8s_panzhihuazhihuishequ/service_property/pom.xml @@ -111,22 +111,10 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> - <!--kafka依赖 --> <dependency> - <groupId>org.springframework.kafka</groupId> - <artifactId>spring-kafka</artifactId> - <version>2.7.6</version> - </dependency> - <dependency> - <groupId>org.springframework.kafka</groupId> - <artifactId>spring-kafka-test</artifactId> - <scope>test</scope> - <version>2.7.6</version> - </dependency> - <!--json转换工具包依赖 --> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-websocket</artifactId> + <version>2.3.4.RELEASE</version> </dependency> </dependencies> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/config/KafkaConfig.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/config/KafkaConfig.java deleted file mode 100644 index 0c1da98..0000000 --- a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/config/KafkaConfig.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.panzhihua.service_property.config; - -import org.apache.kafka.clients.admin.NewTopic; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.kafka.annotation.EnableKafka; -import org.springframework.kafka.config.TopicBuilder; - -/** - * @author manailin - * @version 1.0 - * @description kafka配置类 开启Kafka监听器标注的端点 - * @date 2021/9/26 15:33 - */ -@Configuration -@EnableKafka -public class KafkaConfig { - - @Value("${kafka.topic.kafka-demo-topic}") - private String orderTopic; - - /** 条件匹配,如果配置kafka.topic.autoCreate=true的话,该配置类生效,反之则无效 */ - @Bean - @ConditionalOnProperty(name = "kafka.topic.autoCreate", havingValue = "true") - public NewTopic orderTopic() { - return TopicBuilder.name(orderTopic).build(); - } - -} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/config/WebSocketClient.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/config/WebSocketClient.java new file mode 100644 index 0000000..fe1d535 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/config/WebSocketClient.java @@ -0,0 +1,129 @@ +package com.panzhihua.service_property.config; + +import java.io.IOException; +import java.util.Date; + +import javax.annotation.Resource; +import javax.websocket.*; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import com.alibaba.fastjson.JSONObject; +import com.panzhihua.service_property.dao.ComPropertyAlarmDao; +import com.panzhihua.service_property.dto.DeviceDto; +import com.panzhihua.service_property.entity.ComPropertyAlarm; + +import cn.hutool.extra.spring.SpringUtil; +import lombok.extern.slf4j.Slf4j; + +/** + * 应用模块名称 + * <p> + * 一键报警设备消息 代码描述 + * <p> + * Copyright: Copyright (C) 2021 XXX, Inc. All rights reserved. + * <p> + * Company: 成都呐喊信息技术有限公司 + * <p> + * + * @author manailin + * @since 2021/9/27 16:31 + */ +@Slf4j +@Component +@ClientEndpoint +public class WebSocketClient { + + private static final Logger logger = LoggerFactory.getLogger(WebSocketClient.class); + + /** 保存报警记录服务 */ + @Resource + private ComPropertyAlarmDao comPropertyAlarmDao; + /** + * session + */ + private Session session; + + /** + * <beforeInit> + * + * @throws + */ + public static void beforeInit() { + // 在socket配置类中调用此方法可以完成一些需要初始化注入的操作 + } + + @OnOpen + public void onOpen(Session session) { + logger.info("连接开启..."); + this.session = session; + } + + @OnMessage + public void onMessage(String message, Session session) { + // 提取数据 + dealData(message); + } + + @Async + void dealData(String message) { + comPropertyAlarmDao = SpringUtil.getBean(ComPropertyAlarmDao.class); + DeviceDto deviceInfo = JSONObject.parseObject(message, DeviceDto.class); + if (deviceInfo.getCallstatus().equals("RINGING")) { + logger.info("收到设备报警信息:{}", message); + ComPropertyAlarm comPropertyAlarm = new ComPropertyAlarm(); + comPropertyAlarm.setSerialNo(deviceInfo.getCallid()); + comPropertyAlarm.setStatus(1); + comPropertyAlarm.setCreateTime(new Date()); + comPropertyAlarmDao.insert(comPropertyAlarm); + } + } + + @OnClose + public void onClose() { + logger.info("长连接关闭..."); + } + + @OnError + public void onError(Session session, Throwable t) { + logger.error("error, cause: ", t); + } + + /** + * <异步发送message> + * + * @param message + * message @throws + */ + public void send(String message) { + this.session.getAsyncRemote().sendText(message); + } + + /** + * <发送message> + * + * @param message + * message @throws + */ + public void sendMessage(String message) { + try { + session.getBasicRemote().sendText(message); + } catch (IOException ex) { + logger.error("error, cause: ", ex); + } + } + + /** + * <关闭连接> + * + * @throws + */ + public void close() throws IOException { + if (this.session.isOpen()) { + this.session.close(); + } + } +} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/config/WebSocketConfig.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/config/WebSocketConfig.java new file mode 100644 index 0000000..b0912f2 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/config/WebSocketConfig.java @@ -0,0 +1,136 @@ +package com.panzhihua.service_property.config; + +import java.net.URI; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +import javax.websocket.ContainerProvider; +import javax.websocket.WebSocketContainer; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; + +/** + * 应用模块名称 + * <p> + * 一键报警websocket 配置 代码描述 + * <p> + * Copyright: Copyright (C) 2021 XXX, Inc. All rights reserved. + * <p> + * Company: 成都呐喊信息技术有限公司 + * <p> + * + * @author manailin + * @since 2021/9/27 16:31 + */ +@Configuration +@Order(1) +public class WebSocketConfig implements ApplicationRunner { + + private static final Logger logger = LoggerFactory.getLogger(WebSocketConfig.class); + + private static Boolean isOk; + + private static WebSocketContainer container = ContainerProvider.getWebSocketContainer(); + + private WebSocketClient client; + + /** + * 定义定时任务线程 + */ + private ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1); + + @Value("${websocket.uri}") + private String uri; + + @Value("${websocket.ip}") + private String ip; + + /** + * <run> + * + * @param args + * args @throws + */ + @Override + public void run(ApplicationArguments args) throws Exception { + logger.info("[WebSocketConfig] web socket init start."); + + // websocket客户端初始化 + wsClientInit(); + } + + /** + * <websocket客户端初始化> + * + * @throws + */ + public void wsClientInit() { + logger.info("[WebSocketConfig] start to wsClientInit"); + try { + client = new WebSocketClient(); + WebSocketClient.beforeInit(); + container.connectToServer(client, new URI(uri)); + + isOk = true; + } catch (Exception e) { + isOk = false; + logger.error("error, cause: ", e); + } + + /** + * 参数:1、任务体 2、首次执行的延时时间 3、任务执行间隔 4、间隔时间单位 + **/ + scheduledExecutorService.scheduleAtFixedRate(new Runnable() { + @Override + public void run() { + // 心跳检测 断线重连 + heartbeatCheck(); + } + }, 1, 30, TimeUnit.SECONDS); + + logger.info("[WebSocketConfig] end to wsClientInit"); + } + + /** + * <心跳检测 断线重连> + * + * + */ + private void heartbeatCheck() { + logger.info("[WebSocketConfig] start to heartbeatCheck"); + if (isOk != null && isOk) { + try { + client.send("ping " + ip); + } catch (Exception e) { + isOk = false; + } + } else { + // 系统连接失败进行重试 + logger.warn("系统连接失败,正在重连..."); + try { + client.send("ping " + ip); + logger.warn("系统重连成功!"); + isOk = true; + } catch (Exception e) { + try { + client = new WebSocketClient(); + container.connectToServer(client, new URI(uri)); + + isOk = true; + } catch (Exception e1) { + isOk = false; + } + if (isOk != null && isOk) { + logger.warn("系统重连成功!"); + } + } + } + } +} \ No newline at end of file diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/CallForward.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/CallForward.java deleted file mode 100644 index 7e5ad3f..0000000 --- a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/CallForward.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.panzhihua.service_property.dto; - -import lombok.Data; - -/** - * 应用模块名称 - * <p> - * * 应用模块名称 - * <p> - * 订阅一键报警的设备信息主题返回的对象 代码描述 - * <p> - * Copyright; Copyright (C) 2021 XXX, Inc. All rights reserved. - * <p> - * Company; 成都呐喊信息技术有限公司 - * <p> - * - * @author manailin - * @since 2021/9/26 16;33 - */ -@Data -public class CallForward { - /** - * 呼叫转移记录GUID - */ - private String CallForwardId; - /** - * 呼叫者GUID - */ - private String Caller; - /** - * 呼叫顺序 - */ - private String Order; - /** - * 被呼叫者GUID - */ - private String Callee; - /** - * 预定的呼叫时间 - */ - private String CallDateTime; - /** - * 呼叫次数 - */ - private String CallNums; - /** - * 呼叫持续时间 - */ - private String CallSeconds; - /** - * 呼叫策略 - */ - private String CallStrate; - /** - * 策略名称 - */ - private String ProName; - /** - * 是否自动接听 - */ - private String AutoAnswer; - /** - * 呼叫等待mp3文件id - */ - private String WaitMp3Id; - /** - * 呼叫应答mp3文件id - */ - private String CallMp3Id; -} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/CallForwardDto.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/CallForwardDto.java deleted file mode 100644 index 5af6e36..0000000 --- a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/CallForwardDto.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.panzhihua.service_property.dto; - -import lombok.Data; - -/** - * 应用模块名称 - * <p> - * 订阅一键报警的设备信息主题返回的对象 代码描述 - * <p> - * Copyright: Copyright (C) 2021 XXX, Inc. All rights reserved. - * <p> - * Company: 成都呐喊信息技术有限公司 - * <p> - * - * @author manailin - * @since 2021/9/26 16:23 - */ -@Data -public class CallForwardDto { - - private String CallForwardId; - /** 呼叫转移记录GUID */ - private String Caller; - /** 呼叫者GUID */ - private String Order; - /** 呼叫顺序 */ - private String Callee; - /** 被呼叫者GUID */ - private String CallDateTime; - /** 预定的呼叫时间 */ - private String CallNums; - /** 呼叫次数 */ - private String CallSeconds; - /** 呼叫持续时间 */ - private String CallStratus; - /** 呼叫策略 */ - private String ProName; - /** 策略名称 */ - private String AutoAnswer; - /** 是否自动接听 */ - private String WaitMp3Id; - /** 呼叫等待mp3文件id */ - private String CallMp3Id; - /** 呼叫应答mp3文件id */ -} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/CustomBtn.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/CustomBtn.java deleted file mode 100644 index ddc6b55..0000000 --- a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/CustomBtn.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.panzhihua.service_property.dto; - -import lombok.Data; - -/** - * 应用模块名称 - * <p> - * 代码描述 - * <p> - * Copyright: Copyright (C) 2021 XXX, Inc. All rights reserved. - * <p> - * Company: 成都呐喊信息技术有限公司 - * <p> - * - * @author manailin - * @since 2021/9/26 16:23 - */ -@Data -public class CustomBtn { - - /** - * 按键所属终端id - */ - private String TerminalId; - /** - * 按键编码 - */ - private String BtnCode; - /** - * 按键任务guid - */ - private String TskGuid; - /** - * 按键对应的响应终端id - */ - private String ResTerminalId; - /** - * 播放曲目文件id - */ - private String FileId; - /** - * 播放音量 - */ - private String SoundVol; - /** - * 灯光模式 - */ - private String LightMode; - /** - * 报警强切 - */ - private String CutAlarm; - /** - * 短路输出1 - */ - private String IoOut1; - /** - * 短路输出2 - */ - private String IoOut2; - /** - * 终端短路输出频率 - */ - private String IoOutFreQuency; - /** - * 终端短路输出持续时间 - */ - private String IoOutDuration; -} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/DeviceDto.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/DeviceDto.java new file mode 100644 index 0000000..bda08c6 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/DeviceDto.java @@ -0,0 +1,33 @@ +package com.panzhihua.service_property.dto; + +import lombok.Data; + +/** + * 应用模块名称 + * <p> + * 一键报警设备消息 代码描述 + * <p> + * Copyright: Copyright (C) 2021 XXX, Inc. All rights reserved. + * <p> + * Company: 成都呐喊信息技术有限公司 + * <p> + * + * @author manailin + * @since 2021/9/27 16:31 + */ +@Data +public class DeviceDto { + + /** 呼叫状态 */ + private String callstatus; + /** 指令 */ + private String cmd; + /** 状态 */ + private String status; + /** 呼叫人员ID */ + private String userid; + /** 呼叫iD */ + private String callid; + /** 呼叫时间 */ + private String _ts; +} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/DeviceInfoDto.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/DeviceInfoDto.java deleted file mode 100644 index 67b5f84..0000000 --- a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/DeviceInfoDto.java +++ /dev/null @@ -1,255 +0,0 @@ -package com.panzhihua.service_property.dto; - -import java.util.ArrayList; - -import lombok.*; - -/** - * 应用模块名称 - * <p> - * 订阅一键报警的设备信息主题返回的对象 代码描述 - * <p> - * Copyright;Copyright (C) 2021 XXX Inc. All rights reserved. - * <p> - * Company;成都呐喊信息技术有限公司 - * <p> - * - * @author manailin - * @since 2021/9/26 16:33 - */ -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class DeviceInfoDto { - - private String DeviceType; - /** - * 设备类型 - */ - private String DeviceName; - /** - * 设备用户名 - */ - private String DeviceNickName; - /** - * 设备用户昵称 - */ - private String DeviceGuid; - /** - * 设备GUID - */ - private String DevicePwd; - /** - * 设备用户密码 - */ - private String DeviceAreaId; - /** - * 用户所在分区GUID - */ - private String DeviceIp; - /** - * 设备IP - */ - private String DevicePriority; - /** - * 设备用户级别 - */ - private String DeviceStatus; - /** - * 设备用户状态 - */ - private String HasVid; - /** - * 有无视频 - */ - private String HasTalk; - /** - * 有无对讲 - */ - private String RtspUrl; - /** - * 关联rtsp相机流地址 - */ - private String IoInCnt; - /** - * IO输入口数量 - */ - private String IoIn1State; - /** - * IO输入口1状态 - */ - private String IoIn2State; - /** - * IO输入口2状态 - */ - private String IoIn3State; - /** - * IO输入口3状态 - */ - private String IoIn4State; - /** - * IO输入口4状态 - */ - private String IoIn5State; - /** - * IO输入口5状态 - */ - private String IoIn6State; - /** - * IO输入口6状态 - */ - private String IoIn2Tp; - /** - * 报警输入2类型 - */ - private String IoOutCnt; - /** - * IO输出口数量 - */ - private String IoOut1State; - /** - * IO输出口1状态 - */ - private String IoOut2State; - /** - * IO输出口2状态 - */ - private String IoOut3State; - /** - * IO输出口3状态 - */ - private String IoOut4State; - /** - * IO输出口4状态 - */ - private String IoOut5State; - /** - * IO输出口5状态 - */ - private String IoOut6State; - /** - * IO输出口6状态 - */ - private String PlayTalkVol; - /** - * 对讲的播放音量 - */ - private String PlayBcVol; - /** - * 广播的播放音量 - */ - private String PlayBellVol; - /** - * 铃声的播放音量 - */ - private String CollTalkVol; - /** - * 采集的对讲音量 - */ - private String CollWatchVol; - /** - * 采集的监视音量 - */ - private String DeviceSerialNumber; - /** - * 设备序列号 - */ - private String ManufactureDate; - /** - * 出厂日期 - */ - private String DbAlarm; - /** - * 喧哗报警阈值 - */ - private String Model; - /** - * 设备模式 - */ - private String MoDet1; - /** - * 设备模式 - */ - private String MoDet2; - /** - * 设备模式 - */ - private String DeamonTime; - /** - * ARM守护程序发布时间 - */ - private String CompileTime; - /** - * ARM主程序发布时间 - */ - private String DeviceAbility; - /** - * 设备功能 - */ - private String DeviceCode; - /** - * 设备编码 - */ - private String DeviceDesc; - /** - * 设备描述 - */ - private String DeviceToken; - /** - * 加密狗id - */ - private String TimeStamp; - /** - * 当前时间戳 - */ - private String DeviceVer; - /** - * 设备版本 - */ - private String CurrentTaskGuid; - /** - * 当前执行的任务guid - */ - private String CurrentSoundSrc; - /** - * 当前音源 - */ - private String SipUsr; - /** - * sip账号 - */ - private String SipPwd; - /** - * sip密码 - */ - private String ProtocalType; - /** - * 协议类型 1:私有协议 2:sip协议 3:都有 - */ - private String TaskStatus; - /** - * 任务状态 - */ - private String CtlType; - /** - * 更改类型 1 添加 2 更新 3 删除 4权限改变 - */ - private String ReservedField1; - /** - * 扩展字段1 - */ - private String ReservedField2; - /** - * 扩展字段2 - */ - private String ReservedField3; - /** - * 扩展字段3 - */ - - private ArrayList<CallForwardDto> CallForwardList; - - private ArrayList<CustomBtn> customBtns; -} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/TaskDetail.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/TaskDetail.java deleted file mode 100644 index 330db85..0000000 --- a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/TaskDetail.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.panzhihua.service_property.dto; - -import java.util.ArrayList; - -import lombok.Data; - -/** - * 应用模块名称 - * <p> - * 一键报警kafka 订阅主题 任务消息对象 代码描述 - * <p> - * Copyright;Copyright (C) 2021 XXX Inc. All rights reserved. - * <p> - * Company;成都呐喊信息技术有限公司 - * <p> - * - * @author manailin - * @since 2021/9/26 16:33 - */ -@Data -public class TaskDetail { - /** - * 对讲服务地址 - */ - private String TalkServer; - /** - * 对讲服务端口 - */ - private String TalkPort; - /** - * 任务拨号时间 - */ - private String TskCallStartTime; - /** - * 任务启动时间 - */ - private String TskStartTime; - /** - * 任务guid - */ - private String TskGuid; - /** - * 任务级别 - */ - private String TskPrio; - /** - * 呼叫者guid - */ - private String CallerGuid; - /** - * 被呼叫者guid - */ - private String CalleeGuid; - /** - * 呼叫者等级 - */ - private String CallerLevel; - /** - * 任务状态 - */ - private String TskStatus; - /** - * 任务参数:通道号 - */ - private String ChIdx; - /** - * 任务参数:传输方式 - */ - private String TransProto; - /** - * 任务参数:数据类型 - */ - private String MdTp; - /** - * 对讲音量 - */ - private String TalkVolumn; - /** - * 第三方厂家策略 - */ - private String CustomJson; - /** - * 呼叫转移记录GUID - */ - private ArrayList<CallForward> CallForwardList; - /** - * 任务超时时间unix时间戳 - */ - private String TskTimeout; - /** - * 码流属性,0主码流 1子码流 - */ - private String StrmMode; - /** - * 是否已处理 1未 2已 - */ - private String AlreadyDeal; - /** - * 创建者guid - */ - private String Creater; - /** - * 启动者guid - */ - private String Starter; - /** - * 呼叫者名字 - */ - private String CallerName; - /** - * 被呼叫者名字 - */ - private String CalleeName; - /** - * 协议类型 1:私有协议 2:sip协议 3:都有 - */ - private String ProtocalType; - /** - * 扩展字段1 发起者类型 1 ARM 2 PC - */ - private String ReservedField1; - /** - * 扩展字段2 - */ - private String ReservedField2; - /** - * 扩展字段3 - */ - private String ReservedField3; -} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/TaskInfo.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/TaskInfo.java deleted file mode 100644 index 5ab5e00..0000000 --- a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/dto/TaskInfo.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.panzhihua.service_property.dto; - -import lombok.Data; - -/** - * 应用模块名称 - * <p> - * 一键报警kafka 订阅主题 任务消息对象 代码描述 - * <p> - * Copyright: Copyright (C) 2021 XXX, Inc. All rights reserved. - * <p> - * Company: 成都呐喊信息技术有限公司 - * <p> - * - * @author manailin - * @since 2021/9/26 16:30 - */ -@Data -public class TaskInfo { - - /** 任务类型(1) */ - private Integer task_type; - /** 更改类型 1 添加 2 更新 3 删除 */ - private Integer CtlType; - /** 任务 */ - private TaskDetail talk; - -} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/listener/OrderListener.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/listener/OrderListener.java deleted file mode 100644 index e4ded06..0000000 --- a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/listener/OrderListener.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.panzhihua.service_property.listener; - -import java.util.Date; - -import javax.annotation.Resource; - -import org.springframework.kafka.annotation.KafkaListener; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; - -import com.alibaba.fastjson.JSONObject; -import com.panzhihua.service_property.dao.ComPropertyAlarmDao; -import com.panzhihua.service_property.dto.TaskInfo; -import com.panzhihua.service_property.entity.ComPropertyAlarm; - -import lombok.extern.slf4j.Slf4j; - -/** - * @author manailin - * @version 1.0 - * @description kafka 消息消费者 - * @date 2021/9/26 15:33 - */ -@Slf4j -@Component -public class OrderListener { - - @Resource - private ComPropertyAlarmDao comPropertyAlarmDao; - - /** 用于监听kafka,符合条件的消息能够即时消费 */ - @KafkaListener(topics = {"${kafka.topic.kafka-demo-topic}"}, autoStartup = "${kafka.topic.autoCreate:true}") - public void processing(String message) throws Exception { - log.info("监控来消息了:{}", message); - try { - TaskInfo task = JSONObject.parseObject(message, TaskInfo.class); - if (task.getCtlType() == 1) { - saveTask(task); - } - } catch (Exception e) { - throw new Exception(); - } - } - - @Async - void saveTask(TaskInfo task) { - ComPropertyAlarm comPropertyAlarm = new ComPropertyAlarm(); - comPropertyAlarm.setSerialNo(task.getTalk().getCallerGuid()); - comPropertyAlarm.setStatus(1); - comPropertyAlarm.setCreateTime(new Date()); - comPropertyAlarmDao.insert(comPropertyAlarm); - } - -} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/resources/bootstrap.yml b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/resources/bootstrap.yml index 5cb2f94..1b70c66 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/resources/bootstrap.yml +++ b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/resources/bootstrap.yml @@ -1,25 +1,6 @@ spring: application: name: property - kafka: - bootstrap-servers: 182.151.37.143:9092 #kafka地址 - consumer: - group-id: order-consumer - key-deserializer: org.apache.kafka.common.serialization.StringDeserializer #kafkaTemplate.send()方法参数类型 - value-deserializer: org.apache.kafka.common.serialization.StringDeserializer - auto-offset-reset: earliest - security: - protocol: PLAINTEXT - producer: - batch-size: 16384 - buffer-memory: 33554432 - retries: 0 - key-deserializer: org.apache.kafka.common.serialization.StringDeserializer - value-deserializer: org.apache.kafka.common.serialization.StringDeserializer - properties: - linger.ms: 1 - security: - protocol: PLAINTEXT cloud: config: discovery: @@ -39,7 +20,6 @@ client: service-url: defaultZone: http://${EUREKA_URL:localhost}:8192/eureka - #实体加密、解密、字段脱敏拦截设置 domain: @@ -62,9 +42,7 @@ tags: application: property -# kafka自定义消息发送配置 -kafka: - topic: - kafka-demo-topic: Task_Info - kafka-demo-key: order-key - autoCreate: false \ No newline at end of file +#从一键报警设备websocket订阅时间消息配置 +websocket: + uri: ws://182.151.37.143:8086/status + ip: 182.151.37.143 \ No newline at end of file diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysRoleMenuDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysRoleMenuDAO.java index 0726207..1da2760 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysRoleMenuDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/SysRoleMenuDAO.java @@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.panzhihua.service_user.model.dos.SysRoleMenuDO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * @program: springcloud_k8s_panzhihuazhihuishequ @@ -12,4 +15,12 @@ * @create: 2020-12-25 09:51 **/ @Mapper -public interface SysRoleMenuDAO extends BaseMapper<SysRoleMenuDO> {} +public interface SysRoleMenuDAO extends BaseMapper<SysRoleMenuDO> { + /** + * 批量插入角色菜单关系 + * @param menuIds + * @param roleId + * @return + */ + int batchInsertWithRoleId(@Param("menuIds") List<Long> menuIds, @Param("roleId") Long roleId); +} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java index cedecbf..6590422 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java @@ -3,7 +3,6 @@ import static java.util.Objects.isNull; import static java.util.Objects.nonNull; -import java.time.Instant; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -1203,19 +1202,28 @@ // 获取所有权限id List<SysMenuDO> menuDOList = sysMenuDAO.selectList(new QueryWrapper<SysMenuDO>().lambda() - .eq(SysMenuDO::getCommunityId, 2l).orderByAsc(SysMenuDO::getOrderNum)); + .eq(SysMenuDO::getCommunityId, 2L).orderByAsc(SysMenuDO::getOrderNum)); if (!menuDOList.isEmpty()) { menuIds = menuDOList.stream().map(sysMenuDO -> sysMenuDO.getMenuId()).collect(Collectors.toList()); - for (int i = 0; i < menuIds.size(); i++) { - SysRoleMenuDO sysRoleMenuDO = sysRoleMenuDAO.selectOne(new QueryWrapper<SysRoleMenuDO>().lambda() - .eq(SysRoleMenuDO::getMenuId, menuIds.get(i)).eq(SysRoleMenuDO::getRoleId, roleId)); - if (sysRoleMenuDO == null) { - sysRoleMenuDO = new SysRoleMenuDO(); - sysRoleMenuDO.setMenuId(menuIds.get(i)); - sysRoleMenuDO.setRoleId(roleId); - sysRoleMenuDAO.insert(sysRoleMenuDO); - } + + List<SysRoleMenuDO> sysRoleMenuDOList = sysRoleMenuDAO.selectList(new QueryWrapper<SysRoleMenuDO>().lambda().eq(SysRoleMenuDO::getRoleId, roleId).in(SysRoleMenuDO::getMenuId, menuIds)); + if (!sysRoleMenuDOList.isEmpty()) { + menuIds = menuIds.stream().filter(menuId -> !sysRoleMenuDOList.stream() + .anyMatch(sysRoleMenuDO -> sysRoleMenuDO.getMenuId().equals(menuId))).collect(Collectors.toList()); } + if (!menuIds.isEmpty()) { + sysRoleMenuDAO.batchInsertWithRoleId(menuIds, roleId); + } +// for (int i = 0; i < menuIds.size(); i++) { +// SysRoleMenuDO sysRoleMenuDO = sysRoleMenuDAO.selectOne(new QueryWrapper<SysRoleMenuDO>().lambda() +// .eq(SysRoleMenuDO::getMenuId, menuIds.get(i)).eq(SysRoleMenuDO::getRoleId, roleId)); +// if (sysRoleMenuDO == null) { +// sysRoleMenuDO = new SysRoleMenuDO(); +// sysRoleMenuDO.setMenuId(menuIds.get(i)); +// sysRoleMenuDO.setRoleId(roleId); +// sysRoleMenuDAO.insert(sysRoleMenuDO); +// } +// } } return R.ok(); } @@ -2168,7 +2176,6 @@ @Override @Transactional(rollbackFor = Exception.class) public R addGridUser(EventGridMemberAddDTO eventGridMemberAddDTO) { - //todo 网格 SysRoleDO gridMemberDefaultRole = roleDAO.selectOne( new QueryWrapper<SysRoleDO>().lambda().eq(SysRoleDO::getRoleKey, Constants.GRID_DEFAULT_ROLE_KEY)); if (gridMemberDefaultRole == null) { @@ -2591,41 +2598,17 @@ @Override @Transactional(rollbackFor = Exception.class) public R addConvenientMerchantUser(ConvenientMerchantDTO convenientMerchantDTO) { - // todo 便民 - log.error("catTimeStamp进入addConvenientMerchantUser", Instant.now().toEpochMilli()); - SysUserDO sysUserDO = new SysUserDO(); - Long communityId = 0L; - // 新增社区高级管理员角色 - SysRoleDO sysRoleDO = new SysRoleDO(); - sysRoleDO.setCommunityId(communityId); - sysRoleDO.setRoleName(convenientMerchantDTO.getName()); - sysRoleDO.setRoleKey(Constants.CONVENIENT_MERCHANT_ROLE_KEY + convenientMerchantDTO.getAccount()); - sysRoleDO.setRoleSort(0); - sysRoleDO.setCreateBy(convenientMerchantDTO.getCreatedBy()); - try { - int insert = roleDAO.insert(sysRoleDO); - if (insert != 1) { - return R.fail("网络错误"); - } - } catch (Exception e) { - log.error("新增角色报错【{}】", e.getMessage()); - if (e.getMessage().contains("unique_role_name_community_id")) { - return R.fail("商家名称已被占用"); - } else { - return R.fail("建立商家角色失败,商家名称可能已被占用!"); - } + SysUserDO sysUserDO; + sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getAccount, convenientMerchantDTO.getAccount())); + if (nonNull(sysUserDO)) { + return R.fail("账户已经存在"); } - log.error("catTimeStamp-SysRoleDO创建完成", Instant.now().toEpochMilli()); - // 新角色设置所有权限 - MenuRoleVO menuRoleVO = new MenuRoleVO(); - menuRoleVO.setIsAll(1); - menuRoleVO.setCommunityId(communityId); - menuRoleVO.setRoleId(sysRoleDO.getRoleId()); - this.putMenuRole(menuRoleVO); - - log.error("catTimeStamp-MenuRoleVO创建完成", Instant.now().toEpochMilli()); - + sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getPhone, convenientMerchantDTO.getPhone())); + if (nonNull(sysUserDO)) { + return R.fail("手机号已经存在"); + } // sys_user 表 + sysUserDO = new SysUserDO(); String encode = new BCryptPasswordEncoder().encode(convenientMerchantDTO.getPassword()); BeanUtils.copyProperties(convenientMerchantDTO, sysUserDO); sysUserDO.setAccount(convenientMerchantDTO.getAccount()); @@ -2637,17 +2620,10 @@ sysUserDO.setPassword(encode); try { userDao.insert(sysUserDO); - log.error("catTimeStamp-sysUserDO创建完成", Instant.now().toEpochMilli()); return R.ok(sysUserDO.getUserId()); } catch (Exception e) { e.printStackTrace(); log.error("新增后台用户报错【{}】", e.getMessage()); - roleDAO.deleteByRoleKey(Constants.CONVENIENT_MERCHANT_ROLE_KEY + convenientMerchantDTO.getAccount()); - if (e.getMessage().contains("union_phone_type")) { - return R.fail("手机号已经存在"); - } else if (e.getMessage().contains("union_account_type")) { - return R.fail("账户已经存在"); - } } return R.fail("新增商户发生错误"); } @@ -2664,20 +2640,37 @@ if (isNull(sysUserDO)) { return R.fail("用户不存在"); } - String oldAccount = sysUserDO.getAccount(); sysUserDO.setAccount(account); - int result = userDao.updateById(sysUserDO); - if (result > 0) { - SysRoleDO sysRoleDO = roleDAO.selectOne(new QueryWrapper<SysRoleDO>() - .lambda().eq(SysRoleDO::getRoleKey, Constants.CONVENIENT_MERCHANT_ROLE_KEY + oldAccount)); - if (nonNull(sysRoleDO)) { - sysRoleDO.setRoleKey(Constants.CONVENIENT_MERCHANT_ROLE_KEY + account); - roleDAO.updateById(sysRoleDO); - } - } + userDao.updateById(sysUserDO); return R.ok(); } + // /** + // * 修改便民服务商家绑定账号 + // * @param userId 用户id + // * @param account 修改账户 + // * @return 修改结果 + // */ + // @Override + // public R putUserAccount(Long userId, String account) { + // SysUserDO sysUserDO = userDao.selectById(userId); + // if (isNull(sysUserDO)) { + // return R.fail("用户不存在"); + // } + // String oldAccount = sysUserDO.getAccount(); + // sysUserDO.setAccount(account); + // int result = userDao.updateById(sysUserDO); + // if (result > 0) { + // SysRoleDO sysRoleDO = roleDAO.selectOne(new QueryWrapper<SysRoleDO>() + // .lambda().eq(SysRoleDO::getRoleKey, Constants.CONVENIENT_MERCHANT_ROLE_KEY + oldAccount)); + // if (nonNull(sysRoleDO)) { + // sysRoleDO.setRoleKey(Constants.CONVENIENT_MERCHANT_ROLE_KEY + account); + // roleDAO.updateById(sysRoleDO); + // } + // } + // return R.ok(); + // } + @Override public R disableOrEnableMerchantUsers(DisableOrEnableConvenientMerchantDTO disableOrEnableConvenientMerchantDTO) { userDao.disableOrEnableMerchantUsers(disableOrEnableConvenientMerchantDTO.getType(), disableOrEnableConvenientMerchantDTO.getUserIds()); diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysRoleMenuDAO.xml b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysRoleMenuDAO.xml index da7ee28..f2e6028 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysRoleMenuDAO.xml +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/SysRoleMenuDAO.xml @@ -9,6 +9,11 @@ <sql id="columns"> `role_id`,`menu_id` </sql> - - + <insert id="batchInsertWithRoleId"> + INSERT INTO `sys_role_menu`(role_id,menu_id) + VALUES + <foreach collection="menuIds" item="item" index="index" separator="," > + (#{roleId}, #{item}) + </foreach> + </insert> </mapper> -- Gitblit v1.7.1