diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/excel/GridOpiningExcel.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/excel/GridOpiningExcel.java index 2249c5647..4ba5922cd 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/excel/GridOpiningExcel.java +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/excel/GridOpiningExcel.java @@ -16,16 +16,16 @@ public class GridOpiningExcel { @Excel(name = "网格党建指导员姓名") private String gridLeader; - @Excel(name = "注册用户数") + @Excel(name = "用户总数") private Integer registerCount; @Excel(name = "党员数") private Integer partyCount; - @Excel(name = "未认证用户数") + @Excel(name = "未注册居民") private Integer unAuthorizedCount; - @Excel(name = "认证居民数") + @Excel(name = "已注册居民") private int residentCount; @Excel(name = "新闻发布数") diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/excel/RegisterExcel.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/excel/RegisterExcel.java index bfa291e94..2f9ee8c11 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/excel/RegisterExcel.java +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/excel/RegisterExcel.java @@ -16,16 +16,16 @@ public class RegisterExcel { @Excel(name = "街道名称") private String streetName; - @Excel(name = "注册用户数") + @Excel(name = "用户总数") private Integer userCount; @Excel(name = "党员数") private Integer partyMemberCount; - @Excel(name = "认证居民数") + @Excel(name = "已注册居民") private Integer residentCount; - @Excel(name = "未认证用户数") + @Excel(name = "未注册居民") private Integer unAuthorizedCount; @Excel(name = "男") diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/UserAnalysisServiceImpl.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/UserAnalysisServiceImpl.java index 51afd0ab9..02108205f 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/UserAnalysisServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/UserAnalysisServiceImpl.java @@ -147,6 +147,8 @@ public class UserAnalysisServiceImpl extends BaseServiceImpl AND ad.del_flag = 0 AND ama.ID IS NOT NULL - and (ad1.id = #{gridId} or ad2.id = #{gridId}) + and (ad.id = #{gridId} or ad1.id = #{gridId} or ad2.id = #{gridId}) GROUP BY ad.id ORDER BY ama.CREATED_TIME DESC, ad.create_date DESC 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 e3d32b785..6f9193efc 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 @@ -45,6 +45,7 @@ import com.elink.esua.epdc.redis.AppUserRedis; import com.elink.esua.epdc.service.AppUserService; import com.elink.esua.epdc.utils.UserTagUtils; import com.elink.esua.epdc.utils.WxMaServiceUtils; +import com.sun.org.apache.regexp.internal.RE; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.mp.api.WxMpService; @@ -766,48 +767,120 @@ public class AppUserServiceImpl implements AppUserService { return userDto; } - @Override - public Result completeUserInfo(TokenDto tokenDto, EpdcCompleteUserInfoFormDTO infoDto) { - - // 验证手机号 - this.checkSmsCode(infoDto.getMobile(), infoDto.getSmsCode()); + /** + * 验证用户手机号和身份证号码 + * + * @param userId 用户id + * @param mobile 手机号 + * @param partyFlag 是否党员 + * @param identityNo 身份证号码 + * @return java.lang.String 用户认证状态 + * @author work@yujt.net.cn + * @date 2020/3/12 19:15 + */ + private String checkMobileAndIdentityNo(String userId, String mobile, String partyFlag, String identityNo) { + UserDTO userDto = new UserDTO(); + userDto.setId(userId); + userDto.setMobile(mobile); + userDto.setIdentityNo(identityNo); + userDto.setPartyFlag(partyFlag); + // 验证用户手机号和身份证号是否被注册 + Result verifyResult = userFeignClient.verifyUserCompleteData(userDto); + if (!verifyResult.success()) { + throw new RenException(verifyResult.getMsg()); + } + return verifyResult.getData(); + } - String userId = tokenDto.getUserId(); - Long gridId = getGridId(infoDto.getGridId(), tokenDto.getGridId(), userId); + /** + * 校验用身份证号码 + * + * @param identityNo 身份证号码 + * @param partyFlag 是否党员,非党员身份证号码置空 + * @return java.lang.String 身份证号码 + * @author work@yujt.net.cn + * @date 2020/3/12 19:16 + */ + private String fixAndCheckIdentityNo(String identityNo, String partyFlag) { + if (YesOrNoEnum.NO.value().equals(partyFlag)) { + return null; + } + // 党员提交,验证身份证号 + identityNo = ModuleUtils.replaceIllegalCharacter(identityNo); + if (StringUtils.isBlank(identityNo)) { + throw new RenException("身份证号不能为空"); + } + String verification = IdentityNoUtils.IdentityNoVerification(identityNo); + if (StringUtils.isNotBlank(verification)) { + throw new RenException(verification); + } + return identityNo; + } + /** + * 组装用户数据,解析用户微信unionid、头像 + * + * @param userId 用户id + * @param userState 用户认证状态 + * @param infoDto 用户提交的表单数据 + * @return EpdcCompleteAppUserDTO + * @author work@yujt.net.cn + * @date 2020/3/12 19:20 + */ + private EpdcCompleteAppUserDTO packageUserCompleteInfo(String userId, String userState, EpdcCompleteUserInfoFormDTO infoDto) { UserDTO userDto = ConvertUtils.sourceToTarget(infoDto, UserDTO.class); - userDto.setDeptId(gridId); + userDto.setDeptId(infoDto.getGridId()); userDto.setId(userId); userDto.setRealName(ModuleUtils.replaceIllegalCharacter(infoDto.getRealName())); - // 党员提交,验证身份证号 - String identityNo = ModuleUtils.replaceIllegalCharacter(infoDto.getIdentityNo()); - if (YesOrNoEnum.YES.value().equals(userDto.getPartyFlag())) { - if (StringUtils.isBlank(identityNo)) { - return new Result().error("身份证号不能为空"); + String wxCode = infoDto.getWxCode(); + String iv = infoDto.getIv(); + String encryptedData = infoDto.getEncryptedData(); + if (StringUtils.isNotBlank(wxCode) && StringUtils.isNotBlank(iv) && StringUtils.isNotBlank(encryptedData)) { + WxMaUserInfo wxMaUserInfo = null; + String decrypt = null; + try { + decrypt = WxMaCryptUtils.decrypt(this.getUserSessionKey(wxCode), encryptedData, iv); + if (StringUtils.isNotBlank(decrypt)) { + wxMaUserInfo = JSONObject.parseObject(decrypt, WxMaUserInfo.class); + } + } catch (Exception e) { + log.error("解析或组装用户微信信息失败,用户id:::::{},解密数据:::::{}", userId, decrypt); + log.error(e.getMessage()); } - String verification = IdentityNoUtils.IdentityNoVerification(identityNo); - if (StringUtils.isNotBlank(verification)) { - return new Result().error(verification); + if (null == wxMaUserInfo || StringUtils.isBlank(wxMaUserInfo.getUnionId())) { + throw new RenException("解析微信数据失败,请刷新后重试"); } - userDto.setIdentityNo(identityNo); - } - // 验证用户提交的信息 - Result verifyResult = userFeignClient.verifyUserCompleteData(userDto); - if (!verifyResult.success()) { - return new Result().error(verifyResult.getMsg()); + userDto.setWxUnionId(wxMaUserInfo.getUnionId()); + userDto.setFaceImg(wxMaUserInfo.getAvatarUrl()); } - String userState = verifyResult.getData(); - userDto.setWxUnionId(this.getWxUnionId(infoDto.getWxCode(), infoDto.getIv(), infoDto.getEncryptedData(), userId)); - UserGridRelationDTO userGrid = this.packageUserGridRelationInfo(gridId); EpdcCompleteAppUserDTO completeAppUserDto = ConvertUtils.sourceToTarget(userDto, EpdcCompleteAppUserDTO.class); - completeAppUserDto = this.packageUserCompleteInfo(completeAppUserDto, userState); - // 组装对象,准备保存用户信息 + return this.packageUserCompleteInfo(completeAppUserDto, userState); + } + + + @Override + public Result completeUserInfo(TokenDto tokenDto, EpdcCompleteUserInfoFormDTO infoDto) { + + String userId = tokenDto.getUserId(); + + // 验证手机号、验证码 + this.checkSmsCode(infoDto.getMobile(), infoDto.getSmsCode()); + // 验证身份证号格式,身份证号码字符串校正 + String identityNo = fixAndCheckIdentityNo(infoDto.getIdentityNo(), infoDto.getPartyFlag()); + // 验证手机号身份证号是否已被注册,若未被注册,返回当前用户的状态 + String userState = checkMobileAndIdentityNo(userId, infoDto.getMobile(), infoDto.getPartyFlag(), identityNo); + + Long gridId = getGridId(infoDto.getGridId(), tokenDto.getGridId(), userId); + infoDto.setGridId(gridId); + infoDto.setIdentityNo(identityNo); + + // 组装对象,准备保存用户信息与网格信息 EpdcAppUserCompleteInfoFormDTO dto = new EpdcAppUserCompleteInfoFormDTO(); - dto.setCompleteAppUser(completeAppUserDto); - dto.setUserGridRelation(userGrid); + dto.setUserGridRelation(this.packageUserGridRelationInfo(gridId)); + dto.setCompleteAppUser(this.packageUserCompleteInfo(userId, userState, infoDto)); Result completeResult = userFeignClient.completeUserInfo(dto); if (!completeResult.success()) { @@ -827,8 +900,7 @@ public class AppUserServiceImpl implements AppUserService { Result cachingUserResult = userFeignClient.needCachingUserInfoByUserId(tokenDto.getUserId()); CachingUserInfoDTO cachingUserInfoDTO = cachingUserResult.getData(); TokenDto newTokenDto = ConvertUtils.sourceToTarget(cachingUserInfoDTO, TokenDto.class); - tokenDto.setUserId(userDto.getId()); - EpdcAppAuthorizationDTO authorizationDto = this.packageEpdcAppAuthorization(newTokenDto, userGrid.getGrid(), userDto.getState()); + EpdcAppAuthorizationDTO authorizationDto = this.packageEpdcAppAuthorization(newTokenDto, String.valueOf(gridId), userState); // 更新社群用户党员标识并加入关联的所有网格党员群 boolean partyFlag = UserTagUtils.containIdentity(cachingUserInfoDTO.getUserTagInfos(), UserTagEnum.PARTY_MEMBER); @@ -880,11 +952,8 @@ public class AppUserServiceImpl implements AppUserService { * @author work@yujt.net.cn * @date 2020/2/28 14:51 */ + @Deprecated private String getWxUnionId(String wxCode, String iv, String encryptedData, String userId) { - if (StringUtils.isBlank(wxCode) || StringUtils.isBlank(iv) || StringUtils.isBlank(encryptedData)) { - return null; - } - String sessionKey = this.getUserSessionKey(wxCode); /** * 代码说明: * 本来使用{@link cn.binarywang.wx.miniapp.api.WxMaUserService#getUserInfo(String, String, String)}方法解析用户unionid @@ -892,21 +961,7 @@ public class AppUserServiceImpl implements AppUserService { * 上述方法本质上是通过{@link WxMaCryptUtils}工具类解密微信用户数据,遂直接换用{@link WxMaCryptUtils#decrypt(String, String, String)}方法。 * 将解密得到的JSON字符串,用{@link JSONObject}组装为目标对象,添加异常捕获与日志输出 */ - WxMaUserInfo wxMaUserInfo = null; - String decrypt = null; - try { - decrypt = WxMaCryptUtils.decrypt(sessionKey, encryptedData, iv); - if (StringUtils.isNotBlank(decrypt)) { - wxMaUserInfo = JSONObject.parseObject(decrypt, WxMaUserInfo.class); - } - } catch (Exception e) { - log.error("解析或组装用户{}的微信信息失败,解密数据:::::", userId, decrypt); - log.error(e.getMessage()); - } - if (null == wxMaUserInfo || StringUtils.isBlank(wxMaUserInfo.getUnionId())) { - throw new RenException("解析微信数据失败,请刷新后重试"); - } - return wxMaUserInfo.getUnionId(); + return null; } @Override diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/GridOperatorInfoDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/GridOperatorInfoDTO.java index b6d6e9b01..766fc4722 100755 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/GridOperatorInfoDTO.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/GridOperatorInfoDTO.java @@ -19,6 +19,8 @@ package com.elink.esua.epdc.dto.consult; import java.io.Serializable; import java.util.Date; +import java.util.List; + import lombok.Data; @@ -36,113 +38,118 @@ public class GridOperatorInfoDTO implements Serializable { /** * 主键 */ - private String id; + private String id; /** * 用户姓名 */ - private String realName; + private String realName; /** * 性别 0女 1男 */ - private String sex; + private String sex; /** * 排序 */ - private Integer sort; + private Integer sort; /** * 联系电话 */ - private String mobile; + private String mobile; /** * 身份证号 */ - private String identityNo; + private String identityNo; /** * 头像访问地址 */ - private String faceImg; + private String faceImg; /** * 工作单位 */ - private String workUnit; + private String workUnit; /** * 职责类别id */ - private String dutyCategoryId; + private String dutyCategoryId; /** * 前端收费展示 0否 1是 */ - private String showFlag; + private String showFlag; /** * 备注 */ - private String remark; + private String remark; /** * 居住网格id */ - private Long deptId; + private Long deptId; /** * 父所有部门 */ - private String parentDeptIds; + private String parentDeptIds; /** * 父所有部门 */ - private String parentDeptNames; + private String parentDeptNames; /** * 所有部门ID */ - private String[] allDeptIds; - - private String allDeptIdsStr; + private String allDeptIds; /** * 所有部门名称 */ - private String allDeptNames; + private String allDeptNames; /** * 乐观锁 */ - private Integer revision; + private Integer revision; /** * 删除标识 0:否,1:是 */ - private String delFlag; + private String delFlag; /** * 创建人 */ - private String createdBy; + private String createdBy; /** * 创建时间 */ - private Date createdTime; + private Date createdTime; /** * 更新人 */ - private String updatedBy; + private String updatedBy; /** * 更新时间 */ - private Date updatedTime; + private Date updatedTime; + + ///////////////////下面的字段,为pc页面上送数据的绑定字段///////////////////////////////// + + /** + * 新增是,选择所属网格,多选 + */ + private List selectedDeptIds; } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/MajorFunctionConfDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/MajorFunctionConfDTO.java index 660659a51..01301ad20 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/MajorFunctionConfDTO.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/MajorFunctionConfDTO.java @@ -19,6 +19,7 @@ package com.elink.esua.epdc.dto.consult; import java.io.Serializable; import java.util.Date; + import lombok.Data; @@ -36,68 +37,73 @@ public class MajorFunctionConfDTO implements Serializable { /** * 主键 */ - private String id; + private String id; /** * 功能编码,不可重复,与前端商定一致。目前包括consultState:咨询;cadreEvaluationState:干部评价; */ - private String code; + private String code; /** * 功能名称 */ - private String name; + private String name; /** * 是否可用 0:否,1:是 */ - private String availableFlag; + private String availableFlag; /** * 是否访问外链 0:否,1:是 */ - private String externalFlag; + private String externalFlag; + + /** + * 需要拼接token 0:否,1:是 + */ + private String tokenFlag; /** * 外链访问地址,external_flag = 1则非空 */ - private String externalUrl; + private String externalUrl; /** * 备注 */ - private String remark; + private String remark; /** * 删除标识 0:否,1:是 */ - private String delFlag; + private String delFlag; /** * 乐观锁 */ - private Integer revision; + private Integer revision; /** * 创建人 */ - private String createdBy; + private String createdBy; /** * 创建时间 */ - private Date createdTime; + private Date createdTime; /** * 更新人 */ - private String updatedBy; + private String updatedBy; /** * 更新时间 */ - private Date updatedTime; + private Date updatedTime; - private String imgUrl; + private String imgUrl; } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/result/CheckStateResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/result/CheckStateResultDTO.java index 1c445102b..141a0bba7 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/result/CheckStateResultDTO.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/consult/result/CheckStateResultDTO.java @@ -13,15 +13,9 @@ import java.io.Serializable; public class CheckStateResultDTO implements Serializable { private static final long serialVersionUID = -8559260405823478733L; - /** - * availableFlag : 1 - * externalFlag : 0 - * externalUrl : http://pyt.kuntowcd.vztgvnx - * name : cadreEvaluationState - */ - private String availableFlag; private String externalFlag; + private String tokenFlag; private String externalUrl; private String name; private String imgUrl; diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml index d574ff518..7a2470a04 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml @@ -306,6 +306,9 @@ wx9b6102a8ee5add65 394f47d4e08fc0fd629231d3f68a34dc + + 172.16.0.52:9876;172.16.0.54:9876 + organizationGroup diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/controller/GridOperatorInfoController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/controller/GridOperatorInfoController.java index c23ace98d..7d74f57b1 100755 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/controller/GridOperatorInfoController.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/controller/GridOperatorInfoController.java @@ -18,6 +18,7 @@ package com.elink.esua.epdc.modules.consult.controller; import com.elink.esua.epdc.commons.mybatis.annotation.DataFilter; +import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; import com.elink.esua.epdc.commons.tools.utils.IdentityNoUtils; @@ -32,6 +33,7 @@ import com.elink.esua.epdc.dto.consult.form.GridOperatorListFormDTO; import com.elink.esua.epdc.dto.consult.result.GridOperatorListResultDTO; import com.elink.esua.epdc.modules.consult.excel.GridOperatorInfoExcel; import com.elink.esua.epdc.modules.consult.service.GridOperatorInfoService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -71,11 +73,13 @@ public class GridOperatorInfoController { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); //校验身份证 - String idenNoMsg = IdentityNoUtils.IdentityNoVerification(dto.getIdentityNo()); - if (idenNoMsg != null) { - return new Result().error(idenNoMsg); + if (StringUtils.isNotBlank(dto.getIdentityNo())) { + String idenNoMsg = IdentityNoUtils.IdentityNoVerification(dto.getIdentityNo()); + if (idenNoMsg != null) { + return new Result().error(idenNoMsg); + } } - dto.setShowFlag("0"); + dto.setShowFlag(YesOrNoEnum.NO.value()); gridOperatorInfoService.save(dto); return new Result(); } @@ -85,9 +89,11 @@ public class GridOperatorInfoController { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); //校验身份证 - String idenNoMsg = IdentityNoUtils.IdentityNoVerification(dto.getIdentityNo()); - if (idenNoMsg != null) { - return new Result().error(idenNoMsg); + if (StringUtils.isNotBlank(dto.getIdentityNo())) { + String idenNoMsg = IdentityNoUtils.IdentityNoVerification(dto.getIdentityNo()); + if (idenNoMsg != null) { + return new Result().error(idenNoMsg); + } } gridOperatorInfoService.update(dto); return new Result(); diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/entity/MajorFunctionConfEntity.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/entity/MajorFunctionConfEntity.java index be9f13119..70f8c06d9 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/entity/MajorFunctionConfEntity.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/entity/MajorFunctionConfEntity.java @@ -23,7 +23,6 @@ import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; /** * 小程序首页主要功能按钮状态配置 @@ -32,45 +31,50 @@ import java.util.Date; * @since v1.0.0 2020-03-06 */ @Data -@EqualsAndHashCode(callSuper=false) +@EqualsAndHashCode(callSuper = false) @TableName("epdc_major_function_conf") public class MajorFunctionConfEntity extends BaseEpdcEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; /** * 功能编码,不可重复,与前端商定一致。目前包括consultState:咨询;cadreEvaluationState:干部评价; */ - private String code; + private String code; /** * 功能名称 */ - private String name; + private String name; /** * 是否可用 0:否,1:是 */ - private String availableFlag; + private String availableFlag; /** * 是否访问外链 0:否,1:是 */ - private String externalFlag; + private String externalFlag; + + /** + * 需要拼接token 0:否,1:是 + */ + private String tokenFlag; /** * 外链访问地址,external_flag = 1则非空 */ - private String externalUrl; + private String externalUrl; /** * 备注 */ - private String remark; + private String remark; - /** - * 图标 - */ - private String imgUrl; + /** + * 图标 + */ + private String imgUrl; } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/redis/GridOperatorInfoRedis.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/redis/GridOperatorInfoRedis.java deleted file mode 100755 index 4acf8d2cb..000000000 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/redis/GridOperatorInfoRedis.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

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

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

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.elink.esua.epdc.modules.consult.redis; - -import com.elink.esua.epdc.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * 网格员信息 - * - * @author elink elink@elink-cn.com - * @since v1.0.0 2020-03-02 - */ -@Component -public class GridOperatorInfoRedis { - @Autowired - private RedisUtils redisUtils; - - public void delete(Object[] ids) { - - } - - public void set(){ - - } - - public String get(String id){ - return null; - } - -} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorInfoServiceImpl.java index 06e7bdff8..30bb4c1ff 100755 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorInfoServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/GridOperatorInfoServiceImpl.java @@ -17,6 +17,7 @@ package com.elink.esua.epdc.modules.consult.service.impl; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; @@ -32,10 +33,10 @@ import com.elink.esua.epdc.dto.consult.form.GridOperatorListFormDTO; import com.elink.esua.epdc.dto.consult.result.GridOperatorListResultDTO; import com.elink.esua.epdc.modules.consult.dao.GridOperatorInfoDao; import com.elink.esua.epdc.modules.consult.entity.GridOperatorInfoEntity; -import com.elink.esua.epdc.modules.consult.redis.GridOperatorInfoRedis; import com.elink.esua.epdc.modules.consult.service.GridOperatorInfoService; import com.elink.esua.epdc.modules.feign.AdminFeignClient; import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; +import com.google.common.collect.Lists; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -55,9 +56,6 @@ import java.util.Map; @Service public class GridOperatorInfoServiceImpl extends BaseServiceImpl implements GridOperatorInfoService { - @Autowired - private GridOperatorInfoRedis gridOperatorInfoRedis; - @Autowired private AdminFeignClient adminFeignClient; @@ -89,55 +87,105 @@ public class GridOperatorInfoServiceImpl extends BaseServiceImpl ids = Arrays.asList(depts); - String[] allDeptIds = new String[(ids.subList(1, ids.size())).size()]; - gridOperatorInfoDTO.setAllDeptIds((ids.subList(1, ids.size())).toArray(allDeptIds)); - } - return gridOperatorInfoDTO; + return ConvertUtils.sourceToTarget(entity, GridOperatorInfoDTO.class); } @Override @Transactional(rollbackFor = Exception.class) public void save(GridOperatorInfoDTO dto) { + List operatorGridIdList = getOperatorGridId(dto); + if (CollUtil.isEmpty(operatorGridIdList)) { + return; + } GridOperatorInfoEntity entity = ConvertUtils.sourceToTarget(dto, GridOperatorInfoEntity.class); - Result parentResult = null; - if (dto.getAllDeptIds() != null && dto.getAllDeptIds().length > 1) { - parentResult = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]); + for (Long deptId : operatorGridIdList) { + // 填充部门信息字段 + this.fillDeptInfoByGridId(entity, deptId); + if (null == entity.getDeptId() || StringUtils.isBlank(entity.getAllDeptNames())) { + continue; + } + entity.setId(null); + baseDao.insert(entity); } - if (parentResult != null) { - if (!parentResult.success() || parentResult.getData() == null) { - throw new RenException("获取部门信息失败"); - } else { - ParentAndAllDeptDTO deptDTO = parentResult.getData(); - entity.setAllDeptIds(deptDTO.getAllDeptIds()); - entity.setAllDeptNames(deptDTO.getAllDeptNames()); - entity.setParentDeptIds(deptDTO.getParentDeptIds()); - entity.setParentDeptNames(deptDTO.getParentDeptNames()); - entity.setDeptId(deptDTO.getGridId()); + } + + /** + * 通过前端选择的部门id,组装网格id集合 + * + * @param selectedDeptIds + * @return java.util.List + * @author work@yujt.net.cn + * @date 2020/3/12 10:30 + */ + private List getOperatorGridId(List selectedDeptIds) { + if (CollUtil.isEmpty(selectedDeptIds)) { + throw new RenException("请选择网格人员所属部门"); + } + List operatorGridIdList = Lists.newArrayList(); + for (Long[] selectedDeptIdArray : selectedDeptIds) { + if (selectedDeptIdArray.length == NumConstant.THREE) { + operatorGridIdList.add(selectedDeptIdArray[NumConstant.TWO]); } } - insert(entity); + return operatorGridIdList; } + /** + * 获取需要进行绑定的网格id,并移除已绑定的网格 + * + * @param operatorInfo + * @return java.util.List + * @author work@yujt.net.cn + * @date 2020/3/12 11:19 + */ + private List getOperatorGridId(GridOperatorInfoDTO operatorInfo) { + List operatorGridIdList = getOperatorGridId(operatorInfo.getSelectedDeptIds()); + if (CollUtil.isEmpty(operatorGridIdList)) { + throw new RenException("获取网格人员所属网格失败"); + } + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("real_name", operatorInfo.getRealName()) + .eq("mobile", operatorInfo.getMobile()); + List entityList = baseDao.selectList(wrapper); + if (CollUtil.isNotEmpty(entityList)) { + for (GridOperatorInfoEntity operatorInfoEntity : entityList) { + Long deptId = operatorInfoEntity.getDeptId(); + if (operatorGridIdList.contains(deptId)) { + operatorGridIdList.remove(deptId); + } + } + } + return operatorGridIdList; + } + + /** + * 组装网格人员机构信息 + * + * @param gridOperator 网格员对象 + * @param gridId 网格id + * @return void + * @author work@yujt.net.cn + * @date 2020/3/12 13:37 + */ + private void fillDeptInfoByGridId(GridOperatorInfoEntity gridOperator, Long gridId) { + Result adminResult = adminFeignClient.getParentAndAllDept(String.valueOf(gridId)); + if (!adminResult.success() || null == adminResult.getData()) { + return; + } + ParentAndAllDeptDTO deptInfo = adminResult.getData(); + gridOperator.setAllDeptIds(deptInfo.getAllDeptIds()); + gridOperator.setAllDeptNames(deptInfo.getAllDeptNames()); + gridOperator.setParentDeptIds(deptInfo.getParentDeptIds()); + gridOperator.setParentDeptNames(deptInfo.getParentDeptNames()); + gridOperator.setDeptId(gridId); + } + + @Override @Transactional(rollbackFor = Exception.class) public void update(GridOperatorInfoDTO dto) { GridOperatorInfoEntity entity = ConvertUtils.sourceToTarget(dto, GridOperatorInfoEntity.class); - String[] allDeptIds = dto.getAllDeptIds(); - Result parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(allDeptIds[allDeptIds.length - 1])); - if (!parentResult.success() || parentResult.getData() == null) { - throw new RenException("获取部门信息失败"); - } else { - ParentAndAllDeptDTO deptDTO = parentResult.getData(); - entity.setAllDeptIds(deptDTO.getAllDeptIds()); - entity.setAllDeptNames(deptDTO.getAllDeptNames()); - entity.setParentDeptIds(deptDTO.getParentDeptIds()); - entity.setParentDeptNames(deptDTO.getParentDeptNames()); - entity.setDeptId(deptDTO.getGridId()); - } updateById(entity); } @@ -174,10 +222,10 @@ public class GridOperatorInfoServiceImpl extends BaseServiceImpl0){ + if (integer > 0) { return true; } return false; @@ -197,17 +245,16 @@ public class GridOperatorInfoServiceImpl extends BaseServiceImpl + * @params [dto, gridList] * @author liuchuang * @since 2020/3/7 14:12 */ private List handleOrganizationInfo(OrganizationModifyDTO dto, List gridList) { List entities = new ArrayList<>(); - for (GridOperatorInfoDTO grid: gridList) { + for (GridOperatorInfoDTO grid : gridList) { GridOperatorInfoEntity entity = new GridOperatorInfoEntity(); if (StringUtils.isNotEmpty(grid.getParentDeptIds()) && StringUtils.isNotEmpty(grid.getParentDeptNames())) { List parentDeptIds = Arrays.asList(grid.getParentDeptIds().split(",")); @@ -220,8 +267,8 @@ public class GridOperatorInfoServiceImpl extends BaseServiceImpl allDeptIds = Arrays.asList(grid.getAllDeptIdsStr().split(",")); + if (StringUtils.isNotEmpty(grid.getAllDeptIds()) && StringUtils.isNotEmpty(grid.getAllDeptNames())) { + List allDeptIds = Arrays.asList(grid.getAllDeptIds().split(",")); List allDeptNames = Arrays.asList(grid.getAllDeptNames().split("-")); int index = allDeptIds.indexOf(dto.getDeptId().toString()); if (index >= 0 && allDeptNames.size() > index) { diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/MajorFunctionConfServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/MajorFunctionConfServiceImpl.java index 5e6d45023..6091d36ed 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/MajorFunctionConfServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/consult/service/impl/MajorFunctionConfServiceImpl.java @@ -115,8 +115,8 @@ public class MajorFunctionConfServiceImpl extends BaseServiceImpl> getCheckState() { QueryWrapper queryWrapper = new QueryWrapper(); List list = baseDao.selectList(queryWrapper); - List checkStateResultDTOS = ConvertUtils.sourceToTarget(list, CheckStateResultDTO.class); - return new Result>().ok(checkStateResultDTOS); + List checkStateResults = ConvertUtils.sourceToTarget(list, CheckStateResultDTO.class); + return new Result>().ok(checkStateResults); } } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml index 7394b2726..eefc22311 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml @@ -278,6 +278,9 @@ true 172.16.0.52:8848 + + 172.16.0.52:9876;172.16.0.54:9876 + organizationGroup diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml b/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml index af450723f..24d51ec04 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-server/pom.xml @@ -251,6 +251,10 @@ true 172.16.0.52:8848 + + + 172.16.0.52:9876;172.16.0.54:9876 + organizationGroup diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/EpdcCompleteAppUserDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/EpdcCompleteAppUserDTO.java index e5afc26b2..b80b8dac6 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/EpdcCompleteAppUserDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/EpdcCompleteAppUserDTO.java @@ -108,4 +108,9 @@ public class EpdcCompleteAppUserDTO implements Serializable { * 居住网格id */ private Long deptId; + + /** + * 用户头像 + */ + private String faceImg; } diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml index 9c87463e6..513a12ddc 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml @@ -274,6 +274,9 @@ true 172.16.0.52:8848 + + 172.16.0.52:9876;172.16.0.54:9876 + organizationGroup