diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptMaCodeDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptMaCodeDTO.java index 60c74d04..f730479e 100644 --- a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptMaCodeDTO.java +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/DeptMaCodeDTO.java @@ -99,4 +99,9 @@ public class DeptMaCodeDTO implements Serializable { */ private String grid; -} \ No newline at end of file + /** + * 志愿者去哪小程序网格码 + */ + private String volunteerCodeUrl; + +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/pom.xml b/esua-epdc/epdc-admin/epdc-admin-server/pom.xml index 537f98e4..9230ffca 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/pom.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/pom.xml @@ -173,6 +173,9 @@ wx3ea0a6fb71ddf659 2154e86d56df9fae4224c93a17e01bb3 + + wxc4fe0ea629aaa309 + 34fa86621c3c1dcebd39db333e746d88 114.215.125.123:9876 @@ -213,6 +216,9 @@ wx3ea0a6fb71ddf659 2154e86d56df9fae4224c93a17e01bb3 + + wxc4fe0ea629aaa309 + 34fa86621c3c1dcebd39db333e746d88 114.215.125.123:9876 jinshui-organizationGroup @@ -241,6 +247,9 @@ wx3ea0a6fb71ddf659 2154e86d56df9fae4224c93a17e01bb3 + + wxc4fe0ea629aaa309 + 34fa86621c3c1dcebd39db333e746d88 diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/DeptMaCodeDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/DeptMaCodeDao.java index c5bb9c47..a1235662 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/DeptMaCodeDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/DeptMaCodeDao.java @@ -53,4 +53,14 @@ public interface DeptMaCodeDao extends BaseDao { * @date 2019/9/19 10:38 */ List selectListNoCodeGridId(); -} \ No newline at end of file + + /** + * 根据网格ID删除网格码 + */ + void deleteMaCodeByGridId(Long gridId); + + /** + * 根据网格长标识删除网格码 + */ + void deleteMaCodeByLeaderFlag(String leaderFlag); +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/DeptMaCodeEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/DeptMaCodeEntity.java index 18a96368..37b0f0f1 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/DeptMaCodeEntity.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/DeptMaCodeEntity.java @@ -51,4 +51,9 @@ public class DeptMaCodeEntity extends BaseEpdcEntity { */ private String leaderFlag; -} \ No newline at end of file + /** + * 志愿者去哪小程序网格码 + */ + private String volunteerCodeUrl; + +} diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/DeptMaCodeServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/DeptMaCodeServiceImpl.java index 492128a0..dfd3a77f 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/DeptMaCodeServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/DeptMaCodeServiceImpl.java @@ -17,6 +17,7 @@ package com.elink.esua.epdc.service.impl; +import cn.binarywang.wx.miniapp.api.WxMaService; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -66,7 +67,8 @@ public class DeptMaCodeServiceImpl extends BaseServiceImpl page(Map params) { @@ -150,8 +152,10 @@ public class DeptMaCodeServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); - wrapper.eq("leader_flag", YesOrNoEnum.YES.value()); - Integer selectCount = this.baseDao.selectCount(wrapper); - if (selectCount > NumConstant.ZERO) { - return new Result(); - } DeptMaCodeEntity entity = new DeptMaCodeEntity(); - entity.setCodeUrl(this.createMaCode("gridLeader", MA_FRONT_PAGE_URL)); + entity.setCodeUrl(this.createMaCode("gridLeader", MA_FRONT_PAGE_URL, NumConstant.ZERO_STR)); + entity.setVolunteerCodeUrl(this.createMaCode("gridLeader", MA_FRONT_VOLUNTEER_PAGE_URL, NumConstant.ONE_STR)); entity.setLeaderFlag(YesOrNoEnum.YES.value()); + baseDao.deleteMaCodeByLeaderFlag(NumConstant.ONE_STR); this.baseDao.insert(entity); return new Result(); } @@ -187,14 +189,21 @@ public class DeptMaCodeServiceImpl extends BaseServiceImpl - \ No newline at end of file + + DELETE FROM epdc_dept_ma_code WHERE GRID_ID = #{gridId} + + + + DELETE FROM epdc_dept_ma_code WHERE LEADER_FLAG = #{leaderFlag} + + + diff --git a/esua-epdc/epdc-commons/epdc-commons-tools-wx-ma/src/main/java/com/elink/esua/epdc/utils/WxMaServiceUtils.java b/esua-epdc/epdc-commons/epdc-commons-tools-wx-ma/src/main/java/com/elink/esua/epdc/utils/WxMaServiceUtils.java index a58ef3ed..ab8fb551 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools-wx-ma/src/main/java/com/elink/esua/epdc/utils/WxMaServiceUtils.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools-wx-ma/src/main/java/com/elink/esua/epdc/utils/WxMaServiceUtils.java @@ -23,6 +23,9 @@ public class WxMaServiceUtils { @Value("${wx.ma.appId.analysis}") private String APPID_ANALYSIS; + @Value("${wx.ma.appId.volunteer}") + private String APPID_VOLUNTEER; + /** * 获取党群e家 普通居民端配置 * @@ -60,4 +63,17 @@ public class WxMaServiceUtils { final WxMaService wxMaService = WxMaConfig.getMaService(APPID_ANALYSIS); return wxMaService; } + /** + * + * 获取党群e家 数据分析端配置 + * + * @params [] + * @return cn.binarywang.wx.miniapp.api.WxMaService + * @author liuchuang + * @since 2021/4/8 10:44 + */ + public final WxMaService volunteerWxMaService() { + final WxMaService wxMaService = WxMaConfig.getMaService(APPID_VOLUNTEER); + return wxMaService; + } } diff --git a/esua-epdc/epdc-gateway/pom.xml b/esua-epdc/epdc-gateway/pom.xml index ea352018..05c40e8a 100644 --- a/esua-epdc/epdc-gateway/pom.xml +++ b/esua-epdc/epdc-gateway/pom.xml @@ -100,16 +100,16 @@ lb://epdc-auth-server - - http://127.0.0.1:9092 + lb://epdc-admin-server + lb://epdc-activiti-server http://127.0.0.1:9040 lb://epdc-app-server - lb://epdc-heart-server - + + http://127.0.0.1:9060 lb://epdc-job-server lb://epdc-message-server diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/screen/result/UploadProjectInfoDTO.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/screen/result/UploadProjectInfoDTO.java index c3b0afbb..8e43180b 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/screen/result/UploadProjectInfoDTO.java +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/screen/result/UploadProjectInfoDTO.java @@ -103,5 +103,9 @@ public class UploadProjectInfoDTO implements Serializable { * 结案日期 */ private String closeCaseTime; + /** + * 红绿灯 + */ + private String projectLevel; } diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/common/EpdcTableName.xml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/common/EpdcTableName.xml index 566cdb25..3612c14e 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/common/EpdcTableName.xml +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/common/EpdcTableName.xml @@ -5,7 +5,7 @@ - js_esua_epdc_admin + - + esua_epdc_user diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml index dbbbb6d5..5f63b245 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -20,6 +20,7 @@ + @@ -43,7 +44,11 @@ case t1.ITEM_STATE WHEN 0 THEN 'pending' WHEN 5 THEN 'closed' WHEN '10' THEN 'closed_case' ELSE '' END AS projectStatusCode, t1.CATEGORY_FULL_NAME as allCategoryName, t2.IMG_URL as projectImgUrl, - t3.CREATED_TIME as closeCaseTime + t3.CREATED_TIME as closeCaseTime, + case + when t1.ITEM_STATE = 10 then 3 + when (select ID from esua_epdc_events.epdc_item_handle_process where STATE != 10 and DEL_FLAG ='0' and ITEM_ID = t1.ID group by t1.ID) is null then 1 + else 2 end as projectLevel from (select * from(select * from esua_epdc_events.epdc_item where DEL_FLAG = '0' and GRID_ID not in ( SELECT t.`dept_id` FROM `esua_epdc_admin`.`sys_dept_config` t diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenPublicDataDao.xml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenPublicDataDao.xml index 1616e0e5..70ab3864 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenPublicDataDao.xml +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenPublicDataDao.xml @@ -5,7 +5,7 @@ - SELECT scan_flag, maintain_flag, maintain_info FROM `epdc_scan_switch` WHERE del_flag = '0' AND version_num = #{versionNum} ORDER BY updated_time DESC LIMIT 1 + SELECT scan_flag, maintain_flag, maintain_info, platform FROM `epdc_scan_switch` WHERE del_flag = '0' AND version_num = #{versionNum} AND platform = #{platform} ORDER BY updated_time DESC LIMIT 1 - \ No newline at end of file + diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/StartupPageDao.xml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/StartupPageDao.xml index 6a92191f..3c3e6299 100755 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/StartupPageDao.xml +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/StartupPageDao.xml @@ -18,23 +18,23 @@ - \ No newline at end of file + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml index b36a34ce..2e409f54 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml @@ -187,7 +187,9 @@ wx3ea0a6fb71ddf659 2154e86d56df9fae4224c93a17e01bb3 - + + wxc4fe0ea629aaa309 + 34fa86621c3c1dcebd39db333e746d88 47.104.85.99:9876;114.215.125.123:9876 jinshui-organizationGroup @@ -235,6 +237,9 @@ wx3ea0a6fb71ddf659 2154e86d56df9fae4224c93a17e01bb3 + + wxc4fe0ea629aaa309 + 34fa86621c3c1dcebd39db333e746d88 47.104.85.99:9876;114.215.125.123:9876 jinshui-organizationGroup @@ -266,7 +271,9 @@ wx3ea0a6fb71ddf659 2154e86d56df9fae4224c93a17e01bb3 - + + wxc4fe0ea629aaa309 + 34fa86621c3c1dcebd39db333e746d88 0 172.16.0.8 diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java index a587372a..767f3c7c 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java @@ -351,8 +351,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp public Result> listIssues(IssueFormDTO formDto) { int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); formDto.setPageIndex(pageIndex); - // 查询半年内的数据 - formDto.setSomeMonthsAgo(DateUtils.addDateMonths(new Date(), -6)); + /* // 查询半年内的数据 + formDto.setSomeMonthsAgo(DateUtils.addDateMonths(new Date(), -6));*/ List data = baseDao.selectListOfNewOrHotIssues(formDto); // 查询最热评论 for (IssueResultDTO dto : diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java index fc45921a..03a4ff01 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java @@ -267,8 +267,8 @@ public class ItemServiceImpl extends BaseServiceImpl implem public Result> listItems(ItemFormDTO formDto) { int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); formDto.setPageIndex(pageIndex); - // 查询半年内的数据 - formDto.setSomeMonthsAgo(DateUtils.addDateMonths(new Date(), -6)); + /* // 查询半年内的数据 + formDto.setSomeMonthsAgo(DateUtils.addDateMonths(new Date(), -6));*/ // 查询数据状态 int[] states = {EventIssueItemState.ITEM_HANDLING, EventIssueItemState.ITEM_CLOSEING_CASE}; List data = baseDao.selectListOfItems(formDto, states); diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml index 0bc50381..c0ff4c60 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/application.yml @@ -106,6 +106,11 @@ wx: token: #微信小程序消息服务器配置的token aesKey: #微信小程序消息服务器配置的EncodingAESKey msgDataFormat: JSON + - appid: @volunteer.wx.ma.appId@ + secret: @volunteer.wx.ma.secret@ + token: #微信小程序消息服务器配置的token + aesKey: #微信小程序消息服务器配置的EncodingAESKey + msgDataFormat: JSON appId: # 普通居民端的appId normal: @wx.ma.appId@ @@ -113,6 +118,8 @@ wx: work: @work.wx.ma.appId@ # 数据分析端的appId analysis: @analysis.wx.ma.appId@ + # 志愿者去哪儿的appId + volunteer: @volunteer.wx.ma.appId@ rocketmq: name-server: @rocketmq.name.server@ diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml index e3780660..711febdb 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml @@ -223,7 +223,6 @@ WHERE t1.DEL_FLAG = '0' AND t1.ISSUE_STATE = 0 AND t1.GRID_ID = #{deptId} - = ]]> #{someMonthsAgo} #{timestamp} AND t1.ISSUE_CONTENT LIKE CONCAT('%',#{searchContent},'%') diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml index d4b37a01..16710afe 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml @@ -359,6 +359,7 @@ item.ITEM_CONTENT, item.ITEM_STATE, item.CREATED_TIME, + item.DISTRIBUTE_TIME, item.IS_PARTY_MEMBER, item.NICK_NAME, item.USER_FACE, diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java index d36946a8..56369dd3 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java @@ -22,6 +22,7 @@ import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; import com.elink.esua.epdc.activity.AppClockListDTO; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.form.EpdcClockListV2FormDTO; import com.elink.esua.epdc.modules.activity.service.ActUserRelationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -70,6 +71,16 @@ public class AppActUserRelationController { return actUserRelationService.selectListActUserRelation(actId); } + /** + * 通过活动ID查询打卡列表 - v2 + * @param formDTO + * @return + */ + @GetMapping("selectListV2ActUserRelation") + public Result selectListV2ActUserRelation(@RequestBody EpdcClockListV2FormDTO formDTO){ + return actUserRelationService.selectListV2ActUserRelation(formDTO); + } + /** * 活动时间到自动审核通过未审核的报名人员 * @param actId diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java index 581417ba..6def72e0 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java @@ -24,6 +24,7 @@ import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO; import com.elink.esua.epdc.activity.result.ActUserClockResultDTO; import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.form.EpdcClockListV2FormDTO; import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -116,4 +117,12 @@ public interface ActUserRelationDao extends BaseDao { * @Date 2020/2/7 20:53 **/ List selectAllSignUpUsers(String actId); + /** + * @Description + * @Author songyunpeng + * @Date 2021/4/16 + * @Param [formDTO] + * @return java.util.List + **/ + List selectListV2ActUserRelation(EpdcClockListV2FormDTO formDTO); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java index 357b928f..049201a2 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java @@ -27,6 +27,7 @@ import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO; import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.form.EpdcClockListV2FormDTO; import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity; import java.util.List; @@ -174,4 +175,12 @@ public interface ActUserRelationService extends BaseService exportActUserRelationListPC(Map params); + /** + * @Description 通过活动ID查询打卡列表 - v2 + * @Author songyunpeng + * @Date 2021/4/16 + * @Param [formDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result selectListV2ActUserRelation(EpdcClockListV2FormDTO formDTO); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java index 14c4a660..01be80a9 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java @@ -45,6 +45,7 @@ import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.VolunteerInfoDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; +import com.elink.esua.epdc.dto.form.EpdcClockListV2FormDTO; import com.elink.esua.epdc.dto.result.BehaviorResultDto; import com.elink.esua.epdc.modules.activity.dao.ActInfoDao; import com.elink.esua.epdc.modules.activity.dao.ActUserLogDao; @@ -522,6 +523,48 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl selectListV2ActUserRelation(EpdcClockListV2FormDTO formDTO) { + int pageIndex = (formDTO.getPageIndex() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageIndex(pageIndex); + List list = baseDao.selectListV2ActUserRelation(formDTO); + List allList = baseDao.selectListActUserRelation(formDTO.getActId()); + + if (null == list || list.size() == 0) { + return new Result(); + } + List resultList = new ArrayList(); + String[] idArr = new String[list.size()]; + for (int k = 0; k < list.size(); k++) { + Map map = new HashMap(); + map.put("nickname", list.get(k).getNickname()); + map.put("faceImg", list.get(k).getFaceImg()); + map.put("partyFlag", list.get(k).getPartyFlag()); + map.put("clockDesc", list.get(k).getClockDesc()); + map.put("createdTime", list.get(k).getClockTime()); + map.put("clockId", list.get(k).getId() == null ? "" : list.get(k).getId()); + //查询打卡对应图片 + idArr[k] = list.get(k).getId(); + resultList.add(map); + } + List listLogImg = baseDao.selectListClockImg(idArr); + for (Object objMap : resultList) { + Map mm = (Map) objMap; + List imgList = new ArrayList(); + for (int i = listLogImg.size() - 1; i >= 0; i--) { + if (mm.get("clockId").equals(listLogImg.get(i).getClockId())) { + imgList.add(listLogImg.get(i).getClockPic()); + listLogImg.remove(i); + } + } + mm.put("images", imgList); + mm.remove("clockId"); + } + AppClockListDTO appClockListDTO = new AppClockListDTO(); + appClockListDTO.setClockNum(allList.size()); + appClockListDTO.setClocks(resultList); + return new Result().ok(appClockListDTO); } + //自动审核 定时任务 消息通知 private void sendNotice(ActUserRelationDTO actUserRelationDTO, String actUserDefaultState, ActInfoDTO actInfoDTO) { EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml index 4ca5b441..58587ffb 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml @@ -272,4 +272,19 @@ AND eaur.`STATUS` IN ( '0', '1' ) AND eaur.ACT_ID = #{actId} + diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java index 975afbe2..80d65b4c 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java @@ -44,5 +44,15 @@ public interface UserFeignClient { */ @PostMapping("app-user/epdc-app/user/updateUserInfo") Result updateUserInfo(UserDTO userDTO); + /** + * 重置积分 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @params [userDTO] + * @author syp + * @since 2019/10/25 17:07 + */ + @PostMapping("app-user/user/resetPoints") + Result resetPoints(); } diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java index d3ab4b71..03ee2420 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java @@ -34,4 +34,9 @@ public class UserFeignClientFallback implements UserFeignClient { public Result updateUserInfo(UserDTO userDTO) { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "updateUserInfo", userDTO); } + + @Override + public Result resetPoints() { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "resetPoints"); + } } diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectDataPushDayTaskImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectDataPushDayTaskImpl.java index 73cf2609..929e4105 100644 --- a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectDataPushDayTaskImpl.java +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectDataPushDayTaskImpl.java @@ -41,7 +41,7 @@ public class ScreenProjectDataPushDayTaskImpl implements ScreenProjectDataMonthP @Override public void run(String param) { - for (int i = 0; i < 14; i++) { + for (int i = 0; i < 12; i++) { createThread(i); } } @@ -55,38 +55,34 @@ public class ScreenProjectDataPushDayTaskImpl implements ScreenProjectDataMonthP projectGridDaily(); } else if (methodIndex == 1) { projectOrgDaily(); - } else if (methodIndex == 2) { - uploadProjectInfo(); - } else if (methodIndex == 3) { - uploadProjectProcess(); - } else if (methodIndex == 4) { + } else if (methodIndex == 2) { //001、基层党建-党员基本情况 customerCpcbasedata(); - } else if (methodIndex == 5) { + } else if (methodIndex == 3) { //002、党建引领-先锋模范数据 customerPioneerdata(); - } else if (methodIndex == 6) { + } else if (methodIndex == 4) { //003、党建引领-党员联系群众数据 customerPartylinkmassesdata(); - } else if (methodIndex == 7) { + } else if (methodIndex == 5) { //005、党建引领|基层治理-居民(党员)积分排行榜 customerPartyuserrankdata(); - } else if (methodIndex == 8) { + } else if (methodIndex == 6) { //006、基层治理-难点赌点项目上报 customerDifficultydata(); - } else if (methodIndex == 9) { + } else if (methodIndex == 7) { // 008、公众参与各类总数 customerPublicpartitotaldata(); - } else if (methodIndex == 10) { + } else if (methodIndex == 8) { // 010、中央区各类总数 customerUsertotaldata(); - }else if (methodIndex == 11) { + }else if (methodIndex == 9) { // 011、项目分类字典上报 uploadcategorydict(); - }else if (methodIndex == 12) { + }else if (methodIndex == 10) { // 012、【事件/项目分析】按类别统计-网格 categoryGridDaily(); - }else if (methodIndex == 13) { + }else if (methodIndex == 11) { // 013、【事件/项目分析】按类别统计-组织 categoryOrgDaily(); } @@ -101,77 +97,6 @@ public class ScreenProjectDataPushDayTaskImpl implements ScreenProjectDataMonthP } return isSuccess; } - - /** - * @return void - * @Description 项目信息上报 - * @Author songyunpeng - * @Date 2021/2/24 - * @Param [] - **/ - private void uploadProjectInfo() { - // 方法名 - String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); - logger.info("<" + methodName + "|项目信息上报>定时任务开始执行"); - //获取上次统计时间 - Map param = new HashMap<>(); - param.put("JOB_NAME", "uploadProjectInfo"); - List screenRecordEntities = screenRecordDao.selectByMap(param); - ScreenRecordEntity screenRecordEntity = new ScreenRecordEntity(); - ScreenProjectFormDTO screenProjectFormDTO = new ScreenProjectFormDTO(); - if (screenRecordEntities == null || screenRecordEntities.size() == 0) { - screenProjectFormDTO.setYearMonthDay("2020-01-01"); - } else { - screenRecordEntity = screenRecordEntities.get(0); - screenProjectFormDTO.setYearMonthDay(DateUtils.format(screenRecordEntity.getStatisticsTime(), DateUtils.DATE_PATTERN)); - } - //记录此次统计时间 并更新时间或者新增 - screenRecordEntity.setStatisticsTime(DateUtils.addDateDays(new Date(), -1)); - if (StringUtils.isNotBlank(screenRecordEntity.getId())) { - screenRecordDao.updateById(screenRecordEntity); - } else { - screenRecordEntity.setJobName("uploadProjectInfo"); - screenRecordDao.insert(screenRecordEntity); - } - analysisFeignClient.uploadProjectInfo(screenProjectFormDTO); - logger.info("<" + methodName + "|项目信息上报>定时任务执行结束"); - } - - /** - * @return void - * @Description 项目处理流程信息上报 - * @Author songyunpeng - * @Date 2021/2/24 - * @Param [] - **/ - private void uploadProjectProcess() { - // 方法名 - String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); - logger.info("<" + methodName + "|项目处理流程信息上报>定时任务开始执行"); - //获取上次统计时间 - Map param = new HashMap<>(); - param.put("JOB_NAME", "uploadProjectProcess"); - List screenRecordEntities = screenRecordDao.selectByMap(param); - ScreenRecordEntity screenRecordEntity = new ScreenRecordEntity(); - ScreenProjectFormDTO screenProjectFormDTO = new ScreenProjectFormDTO(); - if (screenRecordEntities == null || screenRecordEntities.size() == 0) { - screenProjectFormDTO.setYearMonthDay("2020-01-01"); - } else { - screenRecordEntity = screenRecordEntities.get(0); - screenProjectFormDTO.setYearMonthDay(DateUtils.format(screenRecordEntity.getStatisticsTime(), DateUtils.DATE_PATTERN)); - } - //记录此次统计时间 并更新时间或者新增 - screenRecordEntity.setStatisticsTime(DateUtils.addDateDays(new Date(), -1)); - if (StringUtils.isNotBlank(screenRecordEntity.getId())) { - screenRecordDao.updateById(screenRecordEntity); - } else { - screenRecordEntity.setJobName("uploadProjectProcess"); - screenRecordDao.insert(screenRecordEntity); - } - analysisFeignClient.uploadProjectProcess(screenProjectFormDTO); - logger.info("<" + methodName + "|项目处理流程信息上报>定时任务执行结束"); - } - /** * @return void * @describe: 【事件/项目分析】网格内事件 diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectPushTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectPushTask.java new file mode 100644 index 00000000..5718f234 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectPushTask.java @@ -0,0 +1,19 @@ +package com.elink.esua.epdc.task.screen; + +/** + * 大屏项目信息统计上报 + * + * @Author: wangtong + * @Date: 2021/2/24 14:16 + */ +public interface ScreenProjectPushTask { + /** + * 大屏数据推送 + * + * @param param 入参 + * @return void + * @author wangtong + * @since 2021/2/24 14:16 + */ + void run(String param); +} diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectPushTaskImpl.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectPushTaskImpl.java new file mode 100644 index 00000000..0831409b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/screen/ScreenProjectPushTaskImpl.java @@ -0,0 +1,140 @@ +package com.elink.esua.epdc.task.screen; + +import com.elink.esua.epdc.commons.tools.utils.DateUtils; +import com.elink.esua.epdc.dao.ScreenRecordDao; +import com.elink.esua.epdc.dto.screen.form.ScreenProjectFormDTO; +import com.elink.esua.epdc.entity.ScreenRecordEntity; +import com.elink.esua.epdc.feign.AnalysisFeignClient; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +/** + * @program: esua-epdc + * @description: 大屏【事件/项目分析】信息统计上报 + * @author: wangtong + * @create: 2021-02-24 13:48 + **/ +@Component("screenProjectPushTask") +public class ScreenProjectPushTaskImpl implements ScreenProjectPushTask { + + private final Logger logger = LoggerFactory.getLogger(getClass()); + + private static final ExecutorService service = Executors.newFixedThreadPool(100); + + @Autowired + private AnalysisFeignClient analysisFeignClient; + + @Autowired + private ScreenRecordDao screenRecordDao; + + @Override + public void run(String param) { + for (int i = 0; i < 2; i++) { + createThread(i); + } + } + + public Integer createThread(Integer methodIndex) { + Future future = service.submit(new Callable() { + @Override + public Integer call() throws Exception { + Thread.sleep(200); + if (methodIndex == 0) { + uploadProjectInfo(); + } else if (methodIndex == 1) { + uploadProjectProcess(); + } + return 0; + } + }); + Integer isSuccess = 0; + try { + isSuccess = future.get(); + } catch (Exception e) { + e.printStackTrace(); + } + return isSuccess; + } + + /** + * @return void + * @Description 项目信息上报 + * @Author songyunpeng + * @Date 2021/2/24 + * @Param [] + **/ + private void uploadProjectInfo() { + // 方法名 + String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); + logger.info("<" + methodName + "|项目信息上报>定时任务开始执行"); + //获取上次统计时间 + Map param = new HashMap<>(); + param.put("JOB_NAME", "uploadProjectInfo"); + List screenRecordEntities = screenRecordDao.selectByMap(param); + ScreenRecordEntity screenRecordEntity = new ScreenRecordEntity(); + ScreenProjectFormDTO screenProjectFormDTO = new ScreenProjectFormDTO(); + if (screenRecordEntities == null || screenRecordEntities.size() == 0) { + screenProjectFormDTO.setYearMonthDay("2020-01-01"); + } else { + screenRecordEntity = screenRecordEntities.get(0); + screenProjectFormDTO.setYearMonthDay(DateUtils.format(screenRecordEntity.getStatisticsTime(), DateUtils.DATE_PATTERN)); + } + //记录此次统计时间 并更新时间或者新增 + screenRecordEntity.setStatisticsTime(DateUtils.addDateDays(new Date(), -1)); + if (StringUtils.isNotBlank(screenRecordEntity.getId())) { + screenRecordDao.updateById(screenRecordEntity); + } else { + screenRecordEntity.setJobName("uploadProjectInfo"); + screenRecordDao.insert(screenRecordEntity); + } + analysisFeignClient.uploadProjectInfo(screenProjectFormDTO); + logger.info("<" + methodName + "|项目信息上报>定时任务执行结束"); + } + + /** + * @return void + * @Description 项目处理流程信息上报 + * @Author songyunpeng + * @Date 2021/2/24 + * @Param [] + **/ + private void uploadProjectProcess() { + // 方法名 + String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); + logger.info("<" + methodName + "|项目处理流程信息上报>定时任务开始执行"); + //获取上次统计时间 + Map param = new HashMap<>(); + param.put("JOB_NAME", "uploadProjectProcess"); + List screenRecordEntities = screenRecordDao.selectByMap(param); + ScreenRecordEntity screenRecordEntity = new ScreenRecordEntity(); + ScreenProjectFormDTO screenProjectFormDTO = new ScreenProjectFormDTO(); + if (screenRecordEntities == null || screenRecordEntities.size() == 0) { + screenProjectFormDTO.setYearMonthDay("2020-01-01"); + } else { + screenRecordEntity = screenRecordEntities.get(0); + screenProjectFormDTO.setYearMonthDay(DateUtils.format(screenRecordEntity.getStatisticsTime(), DateUtils.DATE_PATTERN)); + } + //记录此次统计时间 并更新时间或者新增 + screenRecordEntity.setStatisticsTime(DateUtils.addDateDays(new Date(), -1)); + if (StringUtils.isNotBlank(screenRecordEntity.getId())) { + screenRecordDao.updateById(screenRecordEntity); + } else { + screenRecordEntity.setJobName("uploadProjectProcess"); + screenRecordDao.insert(screenRecordEntity); + } + analysisFeignClient.uploadProjectProcess(screenProjectFormDTO); + logger.info("<" + methodName + "|项目处理流程信息上报>定时任务执行结束"); + } +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/user/ScreenUserPointsResetTask.java b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/user/ScreenUserPointsResetTask.java new file mode 100644 index 00000000..deb86794 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-job/epdc-job-server/src/main/java/com/elink/esua/epdc/task/user/ScreenUserPointsResetTask.java @@ -0,0 +1,32 @@ +package com.elink.esua.epdc.task.user; + +import com.elink.esua.epdc.feign.UserFeignClient; +import com.elink.esua.epdc.task.ITask; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户积分重置模块 + * + * @Author:liuchuang + * @Date:2020/9/9 15:20 + */ +@Component("screenUserPointsResetTask") +public class ScreenUserPointsResetTask implements ITask { + + private final Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private UserFeignClient userFeignClient; + + @Override + public void run(String param) { + // 方法名 + String methodName = Thread.currentThread().getStackTrace()[2].getMethodName(); + logger.info("<" + methodName + "|用户积分季度重置>定时任务开始"); + userFeignClient.resetPoints(); + logger.info("<" + methodName + "|用户积分季度重置>定时任务结束"); + } +} diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/PointsLogsController.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/PointsLogsController.java index 248ee2fe..dda59d3b 100755 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/PointsLogsController.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/PointsLogsController.java @@ -26,6 +26,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.dto.EpdcAdjustUserPointsDTO; +import com.elink.esua.epdc.dto.PointsLogsBindUnIdDTO; import com.elink.esua.epdc.dto.PointsLogsDTO; import com.elink.esua.epdc.dto.UserPointResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; @@ -166,4 +167,18 @@ public class PointsLogsController { } + /** + * 更新过时的积分记录 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author zhy + * @date 2020/8/12 16:16 + */ + @PostMapping("maBindUnIdLogs") + public Result maBindUnIdLogs(@RequestBody PointsLogsBindUnIdDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return pointsLogsService.maBindUnIdLogs(formDto); + } + } diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/dao/PointsLogsDao.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/dao/PointsLogsDao.java index 4eac7167..19ed3d63 100755 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/dao/PointsLogsDao.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/dao/PointsLogsDao.java @@ -24,6 +24,7 @@ import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.entity.PointsLogsEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -189,4 +190,12 @@ public interface PointsLogsDao extends BaseDao { * @since 2021/1/20 9:49 */ Integer selectCountOfVerificationLogs(EpdcWorkVerificationLogsFormDTO formDto); + /** + * @Description 更新过时的积分记录 + * @Author songyunpeng + * @Date 2021/4/8 + * @Param [userId, id, faceImg] + * @return void + **/ + void maBindUnIdLogs(@Param("oldUserId") String oldUserId, @Param("newUserId") String newUserId, @Param("faceImg") String faceImg); } diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/PointsLogsService.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/PointsLogsService.java index 7cd4c617..8e6e4b20 100755 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/PointsLogsService.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/PointsLogsService.java @@ -21,10 +21,10 @@ import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.EpdcAdjustUserPointsDTO; +import com.elink.esua.epdc.dto.PointsLogsBindUnIdDTO; import com.elink.esua.epdc.dto.PointsLogsDTO; import com.elink.esua.epdc.dto.UserPointResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserPointsVerificationResultDTO; import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.entity.PointsLogsEntity; @@ -235,4 +235,12 @@ public interface PointsLogsService extends BaseService { * @since 2021/1/19 17:45 */ EpdcVerificationLogsResultDTO listOfVerificationLogs(EpdcWorkVerificationLogsFormDTO formDto); + /** + * @Description 更新过时的积分记录 + * @Author songyunpeng + * @Date 2021/4/8 + * @Param [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result maBindUnIdLogs(PointsLogsBindUnIdDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/PointsLogsServiceImpl.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/PointsLogsServiceImpl.java index a428d9fe..87fc6deb 100755 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/PointsLogsServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/PointsLogsServiceImpl.java @@ -39,7 +39,6 @@ import com.elink.esua.epdc.dto.constant.PointsNoticeConstant; import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserPointsVerificationResultDTO; import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.entity.PointsLogsEntity; @@ -469,6 +468,12 @@ public class PointsLogsServiceImpl extends BaseServiceImpl + + + UPDATE epdc_points_logs + SET FACE_IMG = #{faceImg}, + USER_ID = #{newUserId} + WHERE + id = #{oldUserId} + diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/CachingUserInfoDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/CachingUserInfoDTO.java index 896b623b..f5b48815 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/CachingUserInfoDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/CachingUserInfoDTO.java @@ -74,4 +74,15 @@ public class CachingUserInfoDTO { */ private String remark; + /** + * 积分 + */ + private Integer points; + /** + * 积分 + */ + private Integer pointsTotle; + + + } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PointsLogsBindUnIdDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PointsLogsBindUnIdDTO.java new file mode 100644 index 00000000..b8152a48 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PointsLogsBindUnIdDTO.java @@ -0,0 +1,46 @@ +/** + * 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.elink.esua.epdc.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 修改过时积分日志 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2020-04-29 + */ +@Data +public class PointsLogsBindUnIdDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + + /** + * 新用户 + */ + private UserDTO user; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/CheckRepeatUserFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/CheckRepeatUserFormDTO.java new file mode 100644 index 00000000..ccf1a9ff --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/CheckRepeatUserFormDTO.java @@ -0,0 +1,19 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author syp + * @Date 2019/11/22 13:54 + */ +@Data +public class CheckRepeatUserFormDTO implements Serializable { + private static final long serialVersionUID = -4267811821756082365L; + + private String openId; + + private String unionId; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/CombineVolunteerUserFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/CombineVolunteerUserFormDTO.java new file mode 100644 index 00000000..f54704b7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/CombineVolunteerUserFormDTO.java @@ -0,0 +1,23 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author songyunpeng + * @Description + * @create 2021-04-15 + */ +@Data +public class CombineVolunteerUserFormDTO implements Serializable { + /** + * 新用户ID + */ + private String userId; + /** + * 手机号 + */ + private String mobile; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcGridLeaderRegisterSubmitFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcGridLeaderRegisterSubmitFormDTO.java index 5dee1d70..9253c5cb 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcGridLeaderRegisterSubmitFormDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcGridLeaderRegisterSubmitFormDTO.java @@ -33,4 +33,9 @@ public class EpdcGridLeaderRegisterSubmitFormDTO implements Serializable { */ @NotBlank(message = "微信code不能为空") private String wxCode; + + /** + * 小程序类型 + */ + private String type; } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserRegistFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserRegistFormDTO.java index 97280424..0886d608 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserRegistFormDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserRegistFormDTO.java @@ -63,4 +63,10 @@ public class EpdcUserRegistFormDTO implements Serializable { */ @NotBlank(message = "微信code不能为空") private String wxCode; + + + /** + * 小程序类型 + */ + private String type; } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java index 95814a60..9f0033ef 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java @@ -31,6 +31,8 @@ import com.elink.esua.epdc.dto.PartyMemberModifyFormDTO; import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.UserPointResultDTO; import com.elink.esua.epdc.dto.UserPointsDTO; +import com.elink.esua.epdc.dto.epdc.form.CheckRepeatUserFormDTO; +import com.elink.esua.epdc.dto.epdc.form.CombineVolunteerUserFormDTO; import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; import com.elink.esua.epdc.enums.AppUserStatesEnum; import com.elink.esua.epdc.excel.UserExcel; @@ -336,8 +338,43 @@ public class UserController { * @Param [dto] **/ @PostMapping(value = "updateUserPoints") - Result updateUserPoints(@RequestBody EpdcUserPointsFormDTO epdcUserPointsFormDTO){ + public Result updateUserPoints(@RequestBody EpdcUserPointsFormDTO epdcUserPointsFormDTO){ return userService.updateUserPoints(epdcUserPointsFormDTO); } + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Description 更新用户积分信息 + * @Author songyunpeng + * @Date 2020/4/29 + * @Param [dto] + **/ + @PostMapping(value = "checkRepeatUser") + public Result checkRepeatUser(@RequestBody CheckRepeatUserFormDTO checkRepeatUserFormDTO){ + return userService.checkRepeatUser(checkRepeatUserFormDTO); + } + /** + * @Description 志愿者注册合并用户 + * @Author songyunpeng + * @Date 2021/4/15 + * @Param [checkRepeatUserFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping(value = "combineVolunteerUser") + public Result combineVolunteerUser(@RequestBody CombineVolunteerUserFormDTO formDTO){ + return userService.combineVolunteerUser(formDTO); + } + /** + * @Description 季度重置用户可兑换积分 + * @Author songyunpeng + * @Date 2021/4/19 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("resetPoints") + public Result resetPoints(){ + return userService.resetPoints(); + } + + } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java index 8615c0b2..4279f3e6 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java @@ -305,4 +305,20 @@ public interface UserDao extends BaseDao { * @return java.lang.Long **/ Long getUserGridIdByUserId(String userId); + /** + * @Description 备份积分数据 + * @Author songyunpeng + * @Date 2021/4/19 + * @Param [] + * @return void + **/ + void insertUserPointsTemp(); + /** + * @Description 重置积分 + * @Author songyunpeng + * @Date 2021/4/19 + * @Param [] + * @return void + **/ + void resetPoints(); } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserGridRelationDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserGridRelationDao.java index fe088b38..c78a6e76 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserGridRelationDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserGridRelationDao.java @@ -21,6 +21,7 @@ import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.UserGridRelationDTO; import com.elink.esua.epdc.entity.UserGridRelationEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -83,4 +84,20 @@ public interface UserGridRelationDao extends BaseDao { * @return com.elink.esua.epdc.dto.UserGridRelationDTO **/ UserGridRelationDTO getUserFirstScanGrid(String userId); + /** + * @Description 把小程序用户的userID全部替换为UidUser的ID + * @Author songyunpeng + * @Date 2021/4/8 + * @Param [openUserId, unionUserId] + * @return void + **/ + void maBindUnId(@Param("openUserId") String openUserId, @Param("unionUserId") String unionUserId); + /** + * @Description 查询重复的网格关系数据 + * @Author songyunpeng + * @Date 2021/4/8 + * @Param [userId] + * @return java.util.List + **/ + List selectRepeatRelation(String userId); } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/feign/PointsFeignClient.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/feign/PointsFeignClient.java new file mode 100644 index 00000000..3264fb29 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/feign/PointsFeignClient.java @@ -0,0 +1,33 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.PointsLogsBindUnIdDTO; +import com.elink.esua.epdc.feign.fallback.NewsFeignClientFallback; +import com.elink.esua.epdc.feign.fallback.PointsFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * 积分管理模块 + * + * @author work@yujt.net.cn + * @date 2019/9/18 15:37 + */ +@FeignClient(name = ServiceConstant.EPDC_POINTS_SERVER, fallback = PointsFeignClientFallback.class) +public interface PointsFeignClient { + + /** + * 更新积分日志 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author zhy + * @date 2020/8/12 15:55 + */ + @PostMapping(value = "points/pointslogs/maBindUnIdLogs", consumes = MediaType.APPLICATION_JSON_VALUE) + Result maBindUnIdLogs(@RequestBody PointsLogsBindUnIdDTO formDto); + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/feign/fallback/PointsFeignClientFallback.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/feign/fallback/PointsFeignClientFallback.java new file mode 100644 index 00000000..810a32dd --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/feign/fallback/PointsFeignClientFallback.java @@ -0,0 +1,21 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.PointsLogsBindUnIdDTO; +import com.elink.esua.epdc.feign.PointsFeignClient; +import org.springframework.stereotype.Component; + +/** + * @author work@yujt.net.cn + * @date 2019/9/18 15:38 + */ +@Component +public class PointsFeignClientFallback implements PointsFeignClient { + + @Override + public Result maBindUnIdLogs(PointsLogsBindUnIdDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_POINTS_SERVER, "maBindUnIdLogs", formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserGridRelationService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserGridRelationService.java index 92ca056e..ba6a16d5 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserGridRelationService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserGridRelationService.java @@ -205,4 +205,20 @@ public interface UserGridRelationService extends BaseService + **/ + List selectRepeatRelation(String userId); } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java index 5f13e93c..c48f1d49 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java @@ -417,4 +417,28 @@ public interface UserService extends BaseService { * @return com.elink.esua.epdc.commons.tools.utils.Result **/ Result getUserGridIdByUserId(String userId); + /** + * @Description 检查完善信息 合并重复用户 + * @Author songyunpeng + * @Date 2021/4/9 + * @Param [checkRepeatUserFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result checkRepeatUser(CheckRepeatUserFormDTO checkRepeatUserFormDTO); + /** + * @Description 志愿者合并用户 + * @Author songyunpeng + * @Date 2021/4/15 + * @Param [formDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result combineVolunteerUser(CombineVolunteerUserFormDTO formDTO); + /** + * @Description 季度重置积分 - 定时任务使用 + * @Author songyunpeng + * @Date 2021/4/19 + * @Param [] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result resetPoints(); } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserGridRelationServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserGridRelationServiceImpl.java index 8b54239d..c98486bc 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserGridRelationServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserGridRelationServiceImpl.java @@ -21,11 +21,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.redis.RedisKeys; import com.elink.esua.epdc.commons.tools.redis.RedisUtils; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; -import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.constant.UserFieldConsant; import com.elink.esua.epdc.dao.UserGridRelationDao; @@ -243,6 +243,16 @@ public class UserGridRelationServiceImpl extends BaseServiceImpl selectRepeatRelation(String userId) { + return baseDao.selectRepeatRelation(userId); + } + /** * * 组织机构信息处理 diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java index 3bac1324..7086dcf2 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java @@ -38,39 +38,33 @@ import com.elink.esua.epdc.commons.tools.utils.MessageUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.constant.AuthenticatedConsant; import com.elink.esua.epdc.constant.UserFieldConsant; -import com.elink.esua.epdc.dao.PartyAuthenticationFailedDao; -import com.elink.esua.epdc.dao.PartyMembersDao; -import com.elink.esua.epdc.dao.UserAuthenticateHistoryDao; -import com.elink.esua.epdc.dao.UserDao; +import com.elink.esua.epdc.dao.*; import com.elink.esua.epdc.dto.*; -import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; -import com.elink.esua.epdc.dto.epdc.form.EpdcUserRegistFormDTO; -import com.elink.esua.epdc.dto.epdc.result.*; import com.elink.esua.epdc.dto.epdc.EpdcCompleteAppUserDTO; import com.elink.esua.epdc.dto.epdc.EpdcGridLeaderRegisterDTO; import com.elink.esua.epdc.dto.epdc.form.*; -import com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterInfoResultDTO; +import com.elink.esua.epdc.dto.epdc.result.*; import com.elink.esua.epdc.entity.*; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterAuditMsgResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcWorkUserResultDTO; import com.elink.esua.epdc.enums.AppUserAuditStateEnum; import com.elink.esua.epdc.enums.AppUserStatesEnum; import com.elink.esua.epdc.enums.PartyMemberRegFlagEnum; import com.elink.esua.epdc.exception.UserModuleErrorCode; import com.elink.esua.epdc.feign.AdminFeignClient; +import com.elink.esua.epdc.feign.PointsFeignClient; import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; import com.elink.esua.epdc.service.UserGridRelationService; import com.elink.esua.epdc.service.UserInvitationRecordService; import com.elink.esua.epdc.service.UserService; import com.elink.esua.epdc.service.UserTagRelationService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.logging.Logger; /** * 用户信息表 @@ -80,6 +74,8 @@ import java.util.*; */ @Service public class UserServiceImpl extends BaseServiceImpl implements UserService { + private final org.slf4j.Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired private PartyMembersDao partyMembersDao; @@ -100,6 +96,8 @@ public class UserServiceImpl extends BaseServiceImpl implem private PartyAuthenticationFailedDao partyAuthenticationFailedDao; @Autowired private UserTagRelationService userTagRelationService; + @Autowired + private PointsFeignClient pointsFeignClient; @Override public PageData page(Map params) { @@ -1024,16 +1022,120 @@ public class UserServiceImpl extends BaseServiceImpl implem if (StringUtils.isBlank(formDTO.getOpenId())) { throw new RenException("openId不能为空"); } - CachingUserInfoDTO cachingUserInfoDTO = null; - if (StringUtils.isNotBlank(formDTO.getUnionId())) { - //根据unionId查询 - cachingUserInfoDTO = this.baseDao.selectCachingUserInfoDTO(null, formDTO.getUnionId()); - } - if (null == cachingUserInfoDTO) { - //根据openId查询 - cachingUserInfoDTO = this.baseDao.selectCachingUserInfoDTO(formDTO.getOpenId(), null); + //接口匹配志愿者小程序 - start + CachingUserInfoDTO uIdUser = this.baseDao.selectCachingUserInfoDTO(null, formDTO.getUnionId()); + CachingUserInfoDTO oIdUser = this.baseDao.selectCachingUserInfoDTO(formDTO.getOpenId(), null); + if(uIdUser != null && oIdUser != null){ + //都不为空的话 合并用户 + //如果相同,则查出的用户为同一个 + if(uIdUser.getUserId().equals(oIdUser.getUserId())){ + return new Result().ok(oIdUser); + } + this.combineUsers(oIdUser,uIdUser,formDTO.getUnionId()); + //重新获取更新后的unionIdUser + uIdUser = this.baseDao.selectCachingUserInfoDTO(null, formDTO.getUnionId()); + return new Result().ok(uIdUser); + } + //更新oIdUser的unionId + if(uIdUser == null && oIdUser != null){ + UserEntity userEntity = new UserEntity(); + userEntity.setId(oIdUser.getUserId()); + userEntity.setWxUnionId(formDTO.getUnionId()); + baseDao.updateById(userEntity); + return new Result().ok(oIdUser); + } + return new Result().ok(uIdUser); + } + /** + * @Description 合并用户 + * @Author songyunpeng + * @Date 2021/4/8 + * @Param [oIdUser, uIdUser] + * @return void + **/ + private void combineUsers(CachingUserInfoDTO oIdUser, CachingUserInfoDTO uIdUser, String unionId) { + + //判断以哪个用户为主 + if(!"0".equals(oIdUser.getState())){ + // 处理user表积分,删除小程序用户 + updateUserInfo(uIdUser, oIdUser,unionId); + // 处理网格关系表 + updateUerGridRelation(uIdUser,oIdUser ); + // 处理积分日志 + updatePointLogs(uIdUser,oIdUser ); + + }else { + // 处理user表积分,删除小程序用户 + updateUserInfo(oIdUser, uIdUser,unionId); + // 处理网格关系表 + updateUerGridRelation(oIdUser, uIdUser); + // 处理积分日志 + updatePointLogs(oIdUser, uIdUser); } - return new Result().ok(cachingUserInfoDTO); + + + + } + /** + * @Description 处理积分日志 + * @Author songyunpeng + * @Date 2021/4/8 + * @Param [oIdUser, uIdUser] + * @return void + **/ + private void updatePointLogs(CachingUserInfoDTO ljUser, CachingUserInfoDTO mainUser) { + logger.info("处理积分日志"); + // 把原有积分日志中的userid替换为新的userid,同时更新其中的用户信息 + PointsLogsBindUnIdDTO pointsLogsBindAppDTO = new PointsLogsBindUnIdDTO(); + UserDTO userDTO = ConvertUtils.sourceToTarget(mainUser, UserDTO.class); + pointsLogsBindAppDTO.setUserId(ljUser.getUserId()); + pointsLogsBindAppDTO.setUser(userDTO); + pointsFeignClient.maBindUnIdLogs(pointsLogsBindAppDTO); + } + + /** + * @Description 处理网格关系表 + * @Author songyunpeng + * @Date 2021/4/8 + * @Param [oIdUser, uIdUser] + * @return void + **/ + private void updateUerGridRelation(CachingUserInfoDTO ljUser, CachingUserInfoDTO mainUser) { + logger.info("替换网格关系,替换者ID:"+mainUser.getUserId() + ",被替换者为:"+ljUser.getUserId()); + // 把小程序用户的userID全部替换为UidUser的ID + userGridRelationService.maBindUnId(ljUser.getUserId(), mainUser.getUserId()); + // 修改完成后查询重复的网格关系数据,把重复并且createTime比较新的数据删除 + List repeatUser = userGridRelationService.selectRepeatRelation(mainUser.getUserId()); + userGridRelationService.deleteBatchIds(repeatUser); + } + + /** + * @Description 处理user表积分,删除小程序用户 + * @Author songyunpeng + * @Date 2021/4/8 + * @Param [oIdUser, uIdUser] + * @return void + **/ + private void updateUserInfo(CachingUserInfoDTO ljUser, CachingUserInfoDTO mainUser, String unionId) { + logger.info("合并积分,删除重复用户操作"); + // 求出两个账户的积分和 + int oIdPoints = ljUser.getPoints() == null?0:ljUser.getPoints(); + int uIdPoints = mainUser.getPoints() == null?0:mainUser.getPoints(); + int oIdPointsTotle = ljUser.getPointsTotle() == null?0:ljUser.getPointsTotle(); + int uIdPointsTotle = mainUser.getPointsTotle() == null?0:mainUser.getPointsTotle(); + Integer pointSum = oIdPoints + uIdPoints; + Integer pointsTotleSum = oIdPointsTotle + uIdPointsTotle; + + UserEntity updateUser = new UserEntity(); + updateUser.setId(mainUser.getUserId()); + updateUser.setPoints(pointSum); + updateUser.setPointsTotle(pointsTotleSum); + updateUser.setWxUnionId(unionId); + // 更新app账户的积分信息 + baseDao.updateById(updateUser); + + // 删除当前小程序用户 + baseDao.deleteById(ljUser.getUserId()); } @Override @@ -1390,4 +1492,63 @@ public class UserServiceImpl extends BaseServiceImpl implem public Result getUserGridIdByUserId(String userId) { return new Result().ok(baseDao.getUserGridIdByUserId(userId)); } + + @Override + public Result checkRepeatUser(CheckRepeatUserFormDTO checkRepeatUserFormDTO) { + String unionId = checkRepeatUserFormDTO.getUnionId(); + String openId = checkRepeatUserFormDTO.getOpenId(); + //根据unionId获取用户 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("UNION_ID", unionId); + UserEntity unionIdUserEntity = baseDao.selectOne(wrapper); + //根据openId获取用户 + QueryWrapper wrapper2 = new QueryWrapper<>(); + wrapper2.eq("OPEN_ID", openId); + UserEntity openIdUserEntity = baseDao.selectOne(wrapper2); + //代表两条用户记录 + if(unionIdUserEntity!=null && openIdUserEntity!=null && !unionIdUserEntity.getId().equals(openIdUserEntity.getIdentityNo())){ + CachingUserInfoDTO oIdUser = ConvertUtils.sourceToTarget(openIdUserEntity,CachingUserInfoDTO.class); + CachingUserInfoDTO uIdUser = ConvertUtils.sourceToTarget(unionIdUserEntity,CachingUserInfoDTO.class); + this.combineUsers(oIdUser,uIdUser,unionId); + return new Result().ok(unionIdUserEntity.getId()); + } + return new Result().ok(""); + } + + @Override + public Result combineVolunteerUser(CombineVolunteerUserFormDTO formDTO) { + //根据手机号获取用户 + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("MOBILE",formDTO.getMobile()); + UserEntity mobileUser = baseDao.selectOne(queryWrapper); + //根据用户ID获取用户 + UserEntity userIdUser = selectById(formDTO.getUserId()); + if("0".equals(userIdUser.getState())){ + CachingUserInfoDTO ljUser = ConvertUtils.sourceToTarget(userIdUser,CachingUserInfoDTO.class); + ljUser.setUserId(userIdUser.getId()); + CachingUserInfoDTO mainUser = ConvertUtils.sourceToTarget(mobileUser,CachingUserInfoDTO.class); + mainUser.setUserId(mobileUser.getId()); + //合并用户 + // 处理user表积分,删除小程序用户 + updateUserInfo(ljUser, mainUser,userIdUser.getWxUnionId()); + // 处理网格关系表 + updateUerGridRelation(ljUser,mainUser ); + // 处理积分日志 + updatePointLogs(ljUser,mainUser ); + UserEntity userEntity = selectById(mobileUser.getId()); + logger.info("合并志愿者用户信息完成,返回合并后的用户信息,ID:"+userEntity.getId()); + UserDTO userDTO = ConvertUtils.sourceToTarget(userEntity,UserDTO.class); + return new Result().ok(userDTO); + } + return new Result<>(); + } + + @Override + public Result resetPoints() { + //先备份积分数据 + baseDao.insertUserPointsTemp(); + //重置积分 + baseDao.resetPoints(); + return new Result(); + } } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml index 281ece22..2779570a 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml @@ -2,6 +2,10 @@ + + insert into epdc_user_points_temp(ID,POINTS,CREATED_TIME) + select ID,POINTS,now() from epdc_user where DEL_FLAG = '0' + update epdc_user set POINTS = POINTS + #{points} @@ -9,6 +13,9 @@ where ID = #{userId} + + update epdc_user set points = 0 where DEL_FLAG = '0' + DELETE FROM epdc_user WHERE WX_OPEN_ID = #{wxOpenId} AND STATE = '2' @@ -460,6 +467,8 @@ + + @@ -511,6 +520,8 @@ eu.STATE, eu.REMARK, eu.PARTY_FLAG, + eu.POINTS, + eu.POINTS_TOTLE, (select r.GRID_ID from epdc_user_grid_relation r where r.USER_ID=eu.ID @@ -567,7 +578,7 @@ SELECT (@i:=@i+1) rank, u.ID userId, - IFNULL(u.POINTS, 0) points, + IFNULL(u.POINTS_TOTLE, 0) points, GROUP_CONCAT(u.ID SEPARATOR ',') tjid FROM epdc_user u ,(select @i:=0) t1 @@ -579,8 +590,8 @@ #{userId} - GROUP BY IFNULL(u.POINTS, 0) - ORDER BY IFNULL(u.POINTS, 0) DESC + GROUP BY IFNULL(u.POINTS_TOTLE, 0) + ORDER BY IFNULL(u.POINTS_TOTLE, 0) DESC ) userRanking WHERE instr(userRanking.tjid , #{userId}) > 0 diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserGridRelationDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserGridRelationDao.xml index eed9ff01..100c296d 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserGridRelationDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserGridRelationDao.xml @@ -32,6 +32,9 @@ UPDATE epdc_user_grid_relation SET GRID = #{newDeptName}, UPDATED_TIME = NOW() WHERE GRID_ID = #{deptId} + + UPDATE epdc_user_grid_relation SET USER_ID = #{unionUserId}, UPDATED_TIME = NOW() WHERE USER_ID = #{openUserId} + +