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-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/ScanSwitchDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/ScanSwitchDTO.java index dd3e60d0..af164ea2 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/ScanSwitchDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/ScanSwitchDTO.java @@ -86,4 +86,9 @@ public class ScanSwitchDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file + /** + * 平台:0-e锦水,1-志愿者去哪 + */ + private String platform; + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/StartupPageDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/StartupPageDTO.java index b3d0086a..e25bf5fe 100755 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/StartupPageDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/StartupPageDTO.java @@ -98,4 +98,9 @@ public class StartupPageDTO implements Serializable { */ private String delFlag; -} \ No newline at end of file + /** + * 平台:0-e锦水,1-志愿者去哪 + */ + private String platform; + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppSaveWxFormIdFormDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppSaveWxFormIdFormDTO.java index 1e7c5af6..af25b6d8 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppSaveWxFormIdFormDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppSaveWxFormIdFormDTO.java @@ -19,4 +19,9 @@ public class EpdcAppSaveWxFormIdFormDTO implements Serializable { @NotBlank(message = "wxFormId不能为空") private String wxFormId; + + /** + * 小程序类型 + */ + private String type; } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppScanVersionNumDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppScanVersionNumDTO.java index 2ead545d..7ceba6b7 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppScanVersionNumDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppScanVersionNumDTO.java @@ -38,4 +38,9 @@ public class EpdcAppScanVersionNumDTO implements Serializable { @NotBlank(message = "版本号不能为空") private String versionNum; -} \ No newline at end of file + /** + * 平台:0-e锦水,1-志愿者去哪 + */ + private String platform; + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserMaInfoFormDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserMaInfoFormDTO.java index 47ecf25c..33ca79d0 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserMaInfoFormDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserMaInfoFormDTO.java @@ -33,4 +33,11 @@ public class EpdcAppUserMaInfoFormDTO implements Serializable { */ @NotBlank(message = "初始向量不能为空") private String iv; + + /** + * 小程序类型 + */ + private String type; + + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserMaTokenFormDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserMaTokenFormDTO.java index 901255fd..ef4e9d7a 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserMaTokenFormDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserMaTokenFormDTO.java @@ -23,6 +23,13 @@ public class EpdcAppUserMaTokenFormDTO implements Serializable { @NotBlank(message = "微信code不能为空") private String wxCode; + + + /** + * 小程序类型 + */ + private String type; + /*@NotBlank(message = "用户信息不能为空") private String encryptedData; diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserRegisterFormDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserRegisterFormDTO.java index 937dcd47..dc9e225f 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserRegisterFormDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserRegisterFormDTO.java @@ -33,4 +33,11 @@ public class EpdcAppUserRegisterFormDTO implements Serializable { * 邀请人ID */ private String inviteUserId; + + /** + * 小程序类型 + */ + private String type; + + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserTokenFormDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserTokenFormDTO.java index a486ccb0..1021158e 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserTokenFormDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppUserTokenFormDTO.java @@ -22,4 +22,10 @@ public class EpdcAppUserTokenFormDTO implements Serializable { */ @NotBlank(message = "微信code不能为空") private String wxCode; + + + /** + * 小程序类型 + */ + private String type; } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcClockListV2FormDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcClockListV2FormDTO.java new file mode 100644 index 00000000..ed469128 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcClockListV2FormDTO.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 活动打卡 + * @Author zhangyong + * @Date 2020-04-29 + */ +@Data +public class EpdcClockListV2FormDTO implements Serializable { + + private static final long serialVersionUID = 202049992792275120L; + + /** + * 页码 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 1, message = "页容量必须大于0") + private Integer pageSize; + + /** + * 用户ID + */ + private String actId; + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java index ca49d2f3..8a4ea7ff 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java @@ -77,4 +77,10 @@ public class EpdcCompleteUserInfoFormDTO implements Serializable { * 居住网格id */ private Long gridId; + + + /** + * 小程序类型 + */ + private String type; } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/v2/EpdcCompleteUserInfoFormV2DTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/v2/EpdcCompleteUserInfoFormV2DTO.java index 149c47af..e70b5d53 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/v2/EpdcCompleteUserInfoFormV2DTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/v2/EpdcCompleteUserInfoFormV2DTO.java @@ -3,7 +3,6 @@ package com.elink.esua.epdc.dto.form.v2; import lombok.Data; import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Size; import java.io.Serializable; /** @@ -99,4 +98,9 @@ public class EpdcCompleteUserInfoFormV2DTO implements Serializable { * 自我介绍 */ private String introduce; + + /** + * 小程序类型 + */ + private String type; } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppScanFlagDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppScanFlagDTO.java index 3a2027af..5856e375 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppScanFlagDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppScanFlagDTO.java @@ -49,4 +49,9 @@ public class EpdcAppScanFlagDTO implements Serializable { */ private String maintainInfo; -} \ No newline at end of file + /** + * 平台:0-e锦水,1-志愿者去哪 + */ + private String platform; + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcStartupPageFormDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcStartupPageFormDTO.java new file mode 100644 index 00000000..e4940a17 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcStartupPageFormDTO.java @@ -0,0 +1,18 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author Liuchuang + */ +@Data +public class EpdcStartupPageFormDTO implements Serializable { + private static final long serialVersionUID = 8243694943324254390L; + + /** + * 平台:0-e锦水,1-志愿者去哪 + */ + private String platform; +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/StartupPageResultDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/StartupPageResultDTO.java index 1e21d3d9..b0c12bc2 100755 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/StartupPageResultDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/StartupPageResultDTO.java @@ -47,6 +47,9 @@ public class StartupPageResultDTO implements Serializable { */ private Integer duration; + /** + * 平台:0-e锦水,1-志愿者去哪 + */ + private String platform; - -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml index 9a5a2b8d..4c0ccb28 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/pom.xml @@ -188,6 +188,10 @@ wx3ea0a6fb71ddf659 2154e86d56df9fae4224c93a17e01bb3 + + + wxc4fe0ea629aaa309 + 34fa86621c3c1dcebd39db333e746d88 47.104.85.99:9876;114.215.125.123:9876 jinshui-organizationGroup @@ -235,7 +239,9 @@ wx3ea0a6fb71ddf659 2154e86d56df9fae4224c93a17e01bb3 - + + wxc4fe0ea629aaa309 + 34fa86621c3c1dcebd39db333e746d88 47.104.85.99:9876;114.215.125.123:9876 jinshui-organizationGroup @@ -268,7 +274,9 @@ wx3ea0a6fb71ddf659 2154e86d56df9fae4224c93a17e01bb3 - + + wxc4fe0ea629aaa309 + 34fa86621c3c1dcebd39db333e746d88 0 172.16.0.8 diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java index 6e481c54..e11cfeda 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java @@ -7,6 +7,7 @@ import com.elink.esua.epdc.activity.AppClockListDTO; import com.elink.esua.epdc.activity.result.AppActInfoDTO; import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.annotation.LoginUser; +import com.elink.esua.epdc.commons.tools.constant.Constant; import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; @@ -16,6 +17,7 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; import com.elink.esua.epdc.dto.form.EpdcAppActUserCancelsignupDTO; import com.elink.esua.epdc.dto.form.EpdcAppActUserClockLogDTO; +import com.elink.esua.epdc.dto.form.EpdcClockListV2FormDTO; import com.elink.esua.epdc.dto.result.EpdcAppClockListDTO; import com.elink.esua.epdc.service.ActUserRelationService; import com.elink.esua.epdc.service.AppUserService; @@ -151,6 +153,23 @@ public class ApiActUserRelationController { } + /** + * 获取打卡列表 - v2 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author syp + * @date 2020/4/16 14:41 + */ + @GetMapping(Constant.VERSION_CONTROL+"/clockList") + public Result getV2ClockList(EpdcClockListV2FormDTO epdcClockListV2FormDTO) { + Result result = actUserRelationService.getV2ClockList(epdcClockListV2FormDTO); + EpdcAppClockListDTO epdcAppClockListDTO = ConvertUtils.sourceToTarget(result.getData(), EpdcAppClockListDTO.class); + Result result1 = new Result(); + result1.setData(epdcAppClockListDTO); + return result1; + + } + /** * 获取活动打卡地点详情 * diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScanSwitchController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScanSwitchController.java index 137b8ffb..c40e4764 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScanSwitchController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiScanSwitchController.java @@ -17,6 +17,7 @@ package com.elink.esua.epdc.controller; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.AssertUtils; @@ -28,6 +29,7 @@ import com.elink.esua.epdc.dto.ScanSwitchDTO; import com.elink.esua.epdc.dto.form.EpdcAppScanVersionNumDTO; import com.elink.esua.epdc.dto.result.EpdcAppScanFlagDTO; import com.elink.esua.epdc.service.ScanSwitchService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -43,7 +45,7 @@ import java.util.Map; @RestController @RequestMapping("ma") public class ApiScanSwitchController { - + @Autowired private ScanSwitchService scanSwitchService; @@ -92,9 +94,12 @@ public class ApiScanSwitchController { */ @GetMapping("scanSwitch") public Result get(EpdcAppScanVersionNumDTO scanVersionNumDTO){ + if (StringUtils.isEmpty(scanVersionNumDTO.getPlatform())) { + scanVersionNumDTO.setPlatform(NumConstant.ZERO_STR); + } //效验数据 ValidatorUtils.validateEntity(scanVersionNumDTO); EpdcAppScanFlagDTO data = scanSwitchService.getOneScanInfo(scanVersionNumDTO); return new Result().ok(data); } -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/StartupController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/StartupController.java index 6b9dadd8..4b7f1cca 100755 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/StartupController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/StartupController.java @@ -17,9 +17,12 @@ package com.elink.esua.epdc.controller; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.result.EpdcStartupPageFormDTO; import com.elink.esua.epdc.dto.result.StartupPageResultDTO; import com.elink.esua.epdc.service.StartupPageService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -46,9 +49,12 @@ public class StartupController { * @Param [] **/ @GetMapping("getStartupPage") - public Result getStartupPage() { - StartupPageResultDTO data = startupPageService.getStartupPage(); + public Result getStartupPage(EpdcStartupPageFormDTO formDto) { + if (StringUtils.isEmpty(formDto.getPlatform())) { + formDto.setPlatform(NumConstant.ZERO_STR); + } + StartupPageResultDTO data = startupPageService.getStartupPage(formDto); return new Result().ok(data); } -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/v2/ApiStartupV2Controller.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/v2/ApiStartupV2Controller.java index 898146d5..a0e3b4cc 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/v2/ApiStartupV2Controller.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/v2/ApiStartupV2Controller.java @@ -2,9 +2,12 @@ package com.elink.esua.epdc.controller.v2; import com.elink.esua.epdc.commons.api.version.ApiVersion; import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.result.EpdcStartupPageFormDTO; import com.elink.esua.epdc.dto.result.StartupPageResultDTO; import com.elink.esua.epdc.service.StartupPageService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -33,8 +36,11 @@ public class ApiStartupV2Controller { * @Param [] **/ @GetMapping("getStartupPage") - public Result> getStartupPage() { - List data = startupPageService.getStartupPageV2(); + public Result> getStartupPage(EpdcStartupPageFormDTO formDto) { + if (StringUtils.isEmpty(formDto.getPlatform())) { + formDto.setPlatform(NumConstant.ZERO_STR); + } + List data = startupPageService.getStartupPageV2(formDto); return new Result>().ok(data); } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/dao/StartupPageDao.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/dao/StartupPageDao.java index e749077b..43c25b1a 100755 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/dao/StartupPageDao.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/dao/StartupPageDao.java @@ -19,6 +19,7 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.StartupPageDTO; +import com.elink.esua.epdc.dto.result.EpdcStartupPageFormDTO; import com.elink.esua.epdc.dto.result.StartupPageResultDTO; import com.elink.esua.epdc.entity.StartupPageEntity; import org.apache.ibatis.annotations.Mapper; @@ -49,7 +50,7 @@ public interface StartupPageDao extends BaseDao { * @Param [] * @return com.elink.esua.dto.StartupPageDTO **/ - StartupPageResultDTO getStartupPage(); + StartupPageResultDTO getStartupPage(EpdcStartupPageFormDTO formDto); /** * @Description 获取欢迎页信息 v2 * @Author songyunpeng @@ -57,5 +58,5 @@ public interface StartupPageDao extends BaseDao { * @Param [] * @return com.elink.esua.dto.StartupPageDTO **/ - List getStartupPageV2(); -} \ No newline at end of file + List getStartupPageV2(EpdcStartupPageFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/ScanSwitchEntity.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/ScanSwitchEntity.java index f6e916e7..582bd05b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/ScanSwitchEntity.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/ScanSwitchEntity.java @@ -56,4 +56,9 @@ public class ScanSwitchEntity extends BaseEpdcEntity { */ private String maintainInfo; -} \ No newline at end of file + /** + * 平台:0-e锦水,1-志愿者去哪 + */ + private String platform; + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/StartupPageEntity.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/StartupPageEntity.java index 3f932087..6467f480 100755 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/StartupPageEntity.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/entity/StartupPageEntity.java @@ -59,4 +59,9 @@ public class StartupPageEntity extends BaseEpdcEntity { */ private String remark; -} \ No newline at end of file + /** + * 平台:0-e锦水,1-志愿者去哪 + */ + private String platform; + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java index 00f257f1..6bfa1a43 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java @@ -7,6 +7,7 @@ import com.elink.esua.epdc.activity.AppClockListDTO; import com.elink.esua.epdc.activity.result.AppActInfoDTO; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.form.EpdcClockListV2FormDTO; import com.elink.esua.epdc.feign.fallback.AppActUserRelationFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; @@ -62,5 +63,13 @@ public interface AppActUserRelationFeignClient { */ @GetMapping("heart/appactinfo/clockAddressDetail/{actId}") Result clockAddressDetail(@PathVariable("actId") String actId); - + /** + * @Description 通过活动ID查询打卡列表 - v2 + * @Author songyunpeng + * @Date 2021/4/16 + * @Param [epdcClockListV2FormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @GetMapping(value = "heart/appactuserrelation/selectListV2ActUserRelation",consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result selectListV2ActUserRelation(EpdcClockListV2FormDTO epdcClockListV2FormDTO); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java index c7b33fa9..9038e209 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java @@ -1,5 +1,6 @@ package com.elink.esua.epdc.feign; +import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; @@ -603,5 +604,22 @@ public interface UserFeignClient { */ @GetMapping("app-user/epdc-app/volunteerinfo/tags") Result> getVolunteerTags(); - + /** + * @Description 检查用户重复信息 + * @Author songyunpeng + * @Date 2021/4/9 + * @Param [wxMaUserInfo] + * @return java.lang.String + **/ + @PostMapping("app-user/user/checkRepeatUser") + Result checkRepeatUser(CheckRepeatUserFormDTO checkRepeatUserFormDTO); + /** + * @Description + * @Author songyunpeng + * @Date 2021/4/15 + * @Param [userId, mobile] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("app-user/user/combineVolunteerUser") + Result combineVolunteerUser(CombineVolunteerUserFormDTO combineVolunteerUserFormDTO); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java index 3954ce30..95473ce3 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java @@ -3,10 +3,12 @@ package com.elink.esua.epdc.feign.fallback; import com.elink.esua.epdc.activity.ActUserRelationDTO; import com.elink.esua.epdc.activity.AppActUserCancelsignupDTO; import com.elink.esua.epdc.activity.AppActUserClockLogDTO; +import com.elink.esua.epdc.activity.AppClockListDTO; import com.elink.esua.epdc.activity.result.AppActInfoDTO; 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.form.EpdcClockListV2FormDTO; import com.elink.esua.epdc.feign.AppActUserRelationFeignClient; import org.springframework.stereotype.Component; @@ -41,4 +43,9 @@ public class AppActUserRelationFeignClientFallback implements AppActUserRelation return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "clockAddressDetail", actId); } + @Override + public Result selectListV2ActUserRelation(EpdcClockListV2FormDTO epdcClockListV2FormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "selectListV2ActUserRelation", epdcClockListV2FormDTO); + } + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java index e49cd132..1a8d4c94 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java @@ -1,5 +1,6 @@ package com.elink.esua.epdc.feign.fallback; +import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; @@ -10,7 +11,6 @@ import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; import com.elink.esua.epdc.dto.epdc.result.*; import com.elink.esua.epdc.feign.UserFeignClient; import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.PathVariable; import java.util.List; @@ -293,4 +293,14 @@ public class UserFeignClientFallback implements UserFeignClient { public Result> getVolunteerTags() { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getVolunteerTags", null); } + + @Override + public Result checkRepeatUser(CheckRepeatUserFormDTO checkRepeatUserFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "checkRepeatUser", checkRepeatUserFormDTO); + } + + @Override + public Result combineVolunteerUser(CombineVolunteerUserFormDTO combineVolunteerUserFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "combineVolunteerUser", combineVolunteerUserFormDTO); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java index d85f6ba4..e81512a1 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java @@ -6,6 +6,7 @@ import com.elink.esua.epdc.activity.AppActUserClockLogDTO; import com.elink.esua.epdc.activity.AppClockListDTO; import com.elink.esua.epdc.activity.result.AppActInfoDTO; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.form.EpdcClockListV2FormDTO; /** * @author wanggongfeng @@ -52,5 +53,12 @@ public interface ActUserRelationService { * @return */ Result clockAddressDetail(String actId); - + /** + * @Description 获取打卡列表 - v2 + * @Author songyunpeng + * @Date 2021/4/16 + * @Param [epdcClockListV2FormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result getV2ClockList(EpdcClockListV2FormDTO epdcClockListV2FormDTO); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/StartupPageService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/StartupPageService.java index b5eebbe1..e658c3dd 100755 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/StartupPageService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/StartupPageService.java @@ -20,6 +20,7 @@ package com.elink.esua.epdc.service; import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.dto.StartupPageDTO; +import com.elink.esua.epdc.dto.result.EpdcStartupPageFormDTO; import com.elink.esua.epdc.dto.result.StartupPageResultDTO; import com.elink.esua.epdc.entity.StartupPageEntity; @@ -109,7 +110,7 @@ public interface StartupPageService extends BaseService { * @Date 2020/3/24 * @Param [] **/ - StartupPageResultDTO getStartupPage(); + StartupPageResultDTO getStartupPage(EpdcStartupPageFormDTO formDto); /** * @return com.elink.esua.dto.StartupPageResultDTO * @Description 获取欢迎页信息 v2 @@ -117,5 +118,5 @@ public interface StartupPageService extends BaseService { * @Date 2020/3/24 * @Param [] **/ - List getStartupPageV2(); -} \ No newline at end of file + List getStartupPageV2(EpdcStartupPageFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java index 26d89d25..3a8605ac 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java @@ -6,6 +6,7 @@ import com.elink.esua.epdc.activity.AppActUserClockLogDTO; import com.elink.esua.epdc.activity.AppClockListDTO; import com.elink.esua.epdc.activity.result.AppActInfoDTO; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.form.EpdcClockListV2FormDTO; import com.elink.esua.epdc.feign.AppActUserRelationFeignClient; import com.elink.esua.epdc.service.ActUserRelationService; import lombok.extern.slf4j.Slf4j; @@ -54,4 +55,9 @@ public class ActUserRelationServiceImpl implements ActUserRelationService { return dataResult; } + @Override + public Result getV2ClockList(EpdcClockListV2FormDTO epdcClockListV2FormDTO) { + Result result = actInfoFeignClient.selectListV2ActUserRelation(epdcClockListV2FormDTO); + return result; } + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java index d86d1ab1..fc384318 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java @@ -124,12 +124,12 @@ public class AppUserServiceImpl implements AppUserService { @Override public Result getMpToken(EpdcAppUserTokenFormDTO formDto) { - return this.getTokenByOpenId(this.getWxMaUser(formDto.getWxCode())); + return this.getTokenByOpenId(this.getWxMaUser(formDto.getWxCode(), formDto.getType())); } @Override public Result getMaToken(EpdcAppUserMaTokenFormDTO formDto) { - return this.getTokenByOpenId(this.getWxMaUser(formDto.getWxCode())); + return this.getTokenByOpenId(this.getWxMaUser(formDto.getWxCode(),formDto.getType())); } @Override @@ -144,7 +144,7 @@ public class AppUserServiceImpl implements AppUserService { EpdcUserSaveWxFormIdFormDTO saveFormId = new EpdcUserSaveWxFormIdFormDTO(); saveFormId.setWxFormId(formDto.getWxFormId()); - saveFormId.setWxOpenId(this.getWxMaUser(formDto.getWxCode()).getOpenid()); + saveFormId.setWxOpenId(this.getWxMaUser(formDto.getWxCode(), formDto.getType()).getOpenid()); return this.userFeignClient.saveWxFormId(saveFormId); } @@ -224,6 +224,8 @@ public class AppUserServiceImpl implements AppUserService { formDTO.setOpenId(wxMaJscode2SessionResult.getOpenid()); formDTO.setUnionId(wxMaJscode2SessionResult.getUnionid()); // Result userInfoResult = userFeignClient.queryUserDto(formDTO); + logger.info("getToken接口调用,unionId:" + wxMaJscode2SessionResult.getUnionid()); + logger.info("getToken接口调用,openId:" + wxMaJscode2SessionResult.getOpenid()); Result userInfoResult = userFeignClient.needCachingUserInfo(formDTO); if (!userInfoResult.success()) { return new Result().error(userInfoResult.getMsg()); @@ -267,7 +269,7 @@ public class AppUserServiceImpl implements AppUserService { this.verifyUserRegisterData(formDto); - WxMaJscode2SessionResult wxMaUser = this.getWxMaUser(formDto.getWxCode()); + WxMaJscode2SessionResult wxMaUser = this.getWxMaUser(formDto.getWxCode(), formDto.getType()); UserDTO userDto = this.packageUserDto(formDto, null, wxMaUser); // IP地址 HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); @@ -300,7 +302,7 @@ public class AppUserServiceImpl implements AppUserService { GridLeaderRegisterDTO leaderRegisterDto = adminResult.getData(); // 组装用户注册信息 - EpdcGridLeaderRegisterDTO gridLeaderRegister = this.packageGridLeaderWhileRegister(leaderRegisterDto.getSysUser(), formDto.getWxCode()); + EpdcGridLeaderRegisterDTO gridLeaderRegister = this.packageGridLeaderWhileRegister(leaderRegisterDto.getSysUser(), formDto.getWxCode(),formDto.getType()); List userGridList = ConvertUtils.sourceToTarget(leaderRegisterDto.getLeaderGridList(), UserGridRelationDTO.class); for (UserGridRelationDTO item : userGridList) { item.setAllDeptNames(item.getDistrict() + "-" + item.getStreet() + "-" + item.getCommunity() + "-" + item.getGrid()); @@ -336,13 +338,14 @@ public class AppUserServiceImpl implements AppUserService { * * @param sysUser 后台管理端管理员账号 * @param wxCode + * @param formDto * @return com.elink.esua.epdc.dto.UserDTO * @author work@yujt.net.cn * @date 2019/10/23 10:01 */ - private EpdcGridLeaderRegisterDTO packageGridLeaderWhileRegister(SysUserDTO sysUser, String wxCode) { + private EpdcGridLeaderRegisterDTO packageGridLeaderWhileRegister(SysUserDTO sysUser, String wxCode, String formDto) { - WxMaJscode2SessionResult wxMaUser = this.getWxMaUser(wxCode); + WxMaJscode2SessionResult wxMaUser = this.getWxMaUser(wxCode, formDto); Date now = new Date(); String mobile = sysUser.getMobile(); @@ -569,14 +572,19 @@ public class AppUserServiceImpl implements AppUserService { * 解析微信code获取小程序用户信息 * * @param wxCode + * @param type * @return cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult * @author work@yujt.net.cn * @date 2019/9/19 19:32 */ - private WxMaJscode2SessionResult getWxMaUser(String wxCode) { + private WxMaJscode2SessionResult getWxMaUser(String wxCode, String type) { WxMaJscode2SessionResult wxMaJscode2SessionResult = null; try { - wxMaJscode2SessionResult = wxMaServiceUtils.normalWxMaService().jsCode2SessionInfo(wxCode); + if(StringUtils.isNotBlank(type) && "volunteer".equals(type)){ + wxMaJscode2SessionResult = wxMaServiceUtils.volunteerWxMaService().jsCode2SessionInfo(wxCode); + } else { + wxMaJscode2SessionResult = wxMaServiceUtils.normalWxMaService().jsCode2SessionInfo(wxCode); + } } catch (WxErrorException e) { log.error("->[getMaOpenId]::error[{}]", "解析微信code失败"); } @@ -680,9 +688,11 @@ public class AppUserServiceImpl implements AppUserService { @Override public Result getMaV2Token(EpdcAppUserRegisterFormDTO formDto) { - WxMaJscode2SessionResult wxMaResult = this.getWxMaUser(formDto.getWxCode()); + WxMaJscode2SessionResult wxMaResult = this.getWxMaUser(formDto.getWxCode(), formDto.getType()); String openId = wxMaResult.getOpenid(); String unionId = wxMaResult.getUnionid(); + logger.info("getTokenV2接口调用,unionId:" + openId); + logger.info("getTokenV2接口调用,openId:" + unionId); // if (null == formDto.getGridId()) { // // 获取用户绑定网格信息 // Result dtoResult = userFeignClient.getUserLastSwitchGrid(openId); @@ -804,12 +814,19 @@ public class AppUserServiceImpl implements AppUserService { userDto.setId(tokenDto.getUserId()); if (StringUtils.isNotBlank(infoDto.getWxCode())) { - String sessionKey = this.getUserSessionKey(infoDto.getWxCode()); + String sessionKey = this.getUserSessionKey(infoDto.getWxCode(),infoDto.getType()); WxMaUserInfo wxMaUserInfo = wxMaServiceUtils.normalWxMaService().getUserService().getUserInfo(sessionKey, infoDto.getEncryptedData(), infoDto.getIv()); if (StringUtils.isBlank(wxMaUserInfo.getUnionId())) { return new Result().error("解析微信开放平台ID失败"); } + logger.info("完善用户信息(带验证码)接口调用,unionId:" + wxMaUserInfo.getUnionId()); + logger.info("完善用户信息(带验证码)接口调用,openId:" + wxMaUserInfo.getOpenId()); userDto.setWxUnionId(wxMaUserInfo.getUnionId()); + //检验志愿者去哪儿 和 居民端 用户重复问题 + /* String userId = this.checkRepeatUser(wxMaUserInfo); + if(StringUtils.isNotBlank(userId)){ + userDto.setId(userId); + }*/ } // 党员提交,验证身份证号 @@ -893,6 +910,28 @@ public class AppUserServiceImpl implements AppUserService { //获取用户认证网格ID - 积分使用 - end return new Result().ok(authorizationDto); } + /** + * @Description 检验用户重复问题,并返回合并后的userId + * @Author songyunpeng + * @Date 2021/4/9 + * @Param [wxMaUserInfo] + * @return void + **/ + private String checkRepeatUser(WxMaUserInfo wxMaUserInfo) { + String unionId = wxMaUserInfo.getUnionId(); + String openId = wxMaUserInfo.getOpenId(); + if(StringUtils.isBlank(unionId) || StringUtils.isBlank(openId)){ + return ""; + } + CheckRepeatUserFormDTO checkRepeatUserFormDTO = new CheckRepeatUserFormDTO(); + checkRepeatUserFormDTO.setOpenId(openId); + checkRepeatUserFormDTO.setUnionId(unionId); + Result userIdResult = userFeignClient.checkRepeatUser(checkRepeatUserFormDTO); + if(userIdResult.success()){ + userIdResult.getData(); + } + return ""; + } @Override public Result prepareCompleteUserInfo(TokenDto tokenDto) { @@ -1008,7 +1047,7 @@ public class AppUserServiceImpl implements AppUserService { if (null == userDetail || StringUtils.isEmpty(userDetail.getUserId())) { return new Result().error("获取用户信息失败"); } - String sessionKey = this.getUserSessionKey(formDto.getWxCode()); + String sessionKey = this.getUserSessionKey(formDto.getWxCode(), formDto.getType()); WxMaUserInfo wxMaUserInfo = wxMaServiceUtils.normalWxMaService().getUserService().getUserInfo(sessionKey, formDto.getEncryptedData(), formDto.getIv()); // 是否需要unionId,0 否 1 是 Object requireUnionid = redisUtils.get("epdc:unionid:require"); @@ -1062,9 +1101,14 @@ public class AppUserServiceImpl implements AppUserService { * @author liuchuang * @since 2019/10/25 16:31 */ - private String getUserSessionKey(String code) { + private String getUserSessionKey(String code, String type) { try { - WxMaJscode2SessionResult wxMaJscode2SessionResult = wxMaServiceUtils.normalWxMaService().jsCode2SessionInfo(code); + WxMaJscode2SessionResult wxMaJscode2SessionResult; + if(StringUtils.isNotBlank(type) && "volunteer".equals(type)){ + wxMaJscode2SessionResult = wxMaServiceUtils.volunteerWxMaService().jsCode2SessionInfo(code); + } else { + wxMaJscode2SessionResult = wxMaServiceUtils.normalWxMaService().jsCode2SessionInfo(code); + } if (wxMaJscode2SessionResult != null) { return wxMaJscode2SessionResult.getSessionKey(); } @@ -1348,7 +1392,9 @@ public class AppUserServiceImpl implements AppUserService { String encryptedData = infoDto.getEncryptedData(); if (StringUtils.isNotBlank(wxCode)) { // 解析微信用户openid - WxMaJscode2SessionResult maJscode2SessionResult = getWxMaUser(wxCode); + WxMaJscode2SessionResult maJscode2SessionResult = getWxMaUser(wxCode, infoDto.getType()); + logger.info("完善用户信息(不带验证码)接口调用,unionId:" + maJscode2SessionResult.getUnionid()); + logger.info("完善用户信息(不带验证码)接口调用,openId:" + maJscode2SessionResult.getOpenid()); userDto.setWxOpenId(maJscode2SessionResult.getOpenid()); // 解析微信用户加密数据 if (StringUtils.isNotBlank(iv) && StringUtils.isNotBlank(encryptedData)) { @@ -1368,6 +1414,11 @@ public class AppUserServiceImpl implements AppUserService { } userDto.setWxUnionId(wxMaUserInfo.getUnionId()); userDto.setFaceImg(wxMaUserInfo.getAvatarUrl()); + //检验志愿者去哪儿 和 居民端 用户重复问题 + /*String unionUserId = this.checkRepeatUser(wxMaUserInfo); + if(StringUtils.isNotBlank(unionUserId)){ + userDto.setId(unionUserId); + }*/ } } EpdcCompleteAppUserDTO completeAppUserDto = ConvertUtils.sourceToTarget(userDto, EpdcCompleteAppUserDTO.class); @@ -1409,7 +1460,12 @@ public class AppUserServiceImpl implements AppUserService { @Override public Result getUserWxPhone(EpdcAppUserMaInfoFormDTO formDto) { try { - WxMaService wxMaService = wxMaServiceUtils.normalWxMaService(); + WxMaService wxMaService; + if(StringUtils.isNotBlank(formDto.getType()) && "volunteer".equals(formDto.getType())){ + wxMaService = wxMaServiceUtils.volunteerWxMaService(); + } else { + wxMaService = wxMaServiceUtils.normalWxMaService(); + } WxMaJscode2SessionResult wxMaJscode2SessionResult = wxMaService.jsCode2SessionInfo(formDto.getWxCode()); WxMaPhoneNumberInfo phoneNoInfo = wxMaService.getUserService().getPhoneNoInfo(wxMaJscode2SessionResult.getSessionKey(), formDto.getEncryptedData(), formDto.getIv()); if (null != phoneNoInfo) { @@ -1497,6 +1553,21 @@ public class AppUserServiceImpl implements AppUserService { if (StringUtils.isNotBlank(formDto.getSmsCode())) { this.checkSmsCode(formDto.getMobile(), formDto.getSmsCode()); } + + // 合并用户开始 ----- start + CombineVolunteerUserFormDTO combineVolunteerUserFormDTO = new CombineVolunteerUserFormDTO(); + combineVolunteerUserFormDTO.setMobile(formDto.getMobile()); + combineVolunteerUserFormDTO.setUserId(tokenDto.getUserId()); + Result combineUserDto = userFeignClient.combineVolunteerUser(combineVolunteerUserFormDTO); + if (combineUserDto.success() && combineUserDto.getData() != null) { + UserDTO userDTO = combineUserDto.getData(); + tokenDto = ConvertUtils.sourceToTarget(userDTO,TokenDto.class); + tokenDto.setUserId(userDTO.getId()); + tokenDto.setGridId(userDTO.getDeptId()); + } + logger.info("返回后的UserID userID:" + tokenDto.getUserId()); + // 合并用户开始 ----- end + // 此次完善信息后是否变为党员 boolean newPartyFlag = Boolean.FALSE; diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/StartupPageServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/StartupPageServiceImpl.java index 055c29de..9835c11b 100755 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/StartupPageServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/StartupPageServiceImpl.java @@ -25,6 +25,7 @@ import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.dao.StartupPageDao; import com.elink.esua.epdc.dto.StartupPageDTO; +import com.elink.esua.epdc.dto.result.EpdcStartupPageFormDTO; import com.elink.esua.epdc.dto.result.StartupPageResultDTO; import com.elink.esua.epdc.entity.StartupPageEntity; import com.elink.esua.epdc.service.StartupPageService; @@ -111,13 +112,13 @@ public class StartupPageServiceImpl extends BaseServiceImpl getStartupPageV2() { - return baseDao.getStartupPageV2(); + public List getStartupPageV2(EpdcStartupPageFormDTO formDto) { + return baseDao.getStartupPageV2(formDto); } -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml index e10bf7f1..7d2c6975 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/application.yml @@ -119,6 +119,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@ @@ -126,6 +131,8 @@ wx: work: @work.wx.ma.appId@ # 数据分析端的appId analysis: @analysis.wx.ma.appId@ + # 志愿者去哪儿的appId + volunteer: @volunteer.wx.ma.appId@ diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/ScanSwitchDao.xml b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/ScanSwitchDao.xml index 9acb3bcf..afe13bfb 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/ScanSwitchDao.xml +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/resources/mapper/ScanSwitchDao.xml @@ -17,8 +17,8 @@ - \ 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-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-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..fe59b8a5 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; @@ -340,4 +342,30 @@ public class UserController { 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") + 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") + Result combineVolunteerUser(@RequestBody CombineVolunteerUserFormDTO formDTO){ + return userService.combineVolunteerUser(formDTO); + } + + + + } 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..f916386d 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,20 @@ 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); } 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..aa4d6966 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,54 @@ 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<>(); + } } 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..4bccf4cf 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 @@ -460,6 +460,8 @@ + + @@ -511,6 +513,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 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} + +