Browse Source

Merge branch 'dev_staff_transfer' into dev

# Conflicts:
#	epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java
#	epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java
dev_shibei_match
sunyuchao 5 years ago
parent
commit
2119a0847a
  1. 21
      epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java
  2. 39
      epmet-auth/src/main/java/com/epmet/dto/form/GetResiWxPhoneFormDTO.java
  3. 9
      epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java
  4. 38
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
  5. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  6. 13
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  7. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  8. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java
  9. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java
  10. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java
  11. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
  12. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
  13. 101
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffTransferRecordDTO.java
  14. 30
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffTransferFormDTO.java
  15. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java
  16. 44
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInAgencyListResultDTO.java
  17. 6
      epmet-module/gov-org/gov-org-server/pom.xml
  18. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java
  19. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  20. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java
  21. 94
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffTransferRecordController.java
  22. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  23. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java
  24. 18
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  25. 33
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffTransferRecordDao.java
  26. 71
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffTransferRecordEntity.java
  27. 74
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/StaffTransferRecordExcel.java
  28. 47
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/StaffTransferRecordRedis.java
  29. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  30. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java
  31. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  32. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java
  33. 95
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffTransferRecordService.java
  34. 24
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  35. 24
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java
  36. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  37. 91
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
  38. 104
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java
  39. 16
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.2__staff_transfer_record.sql
  40. 14
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  41. 5
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml
  42. 17
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  43. 8
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffTransferRecordDao.xml
  44. 16
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java
  45. 11
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java
  46. 20
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java
  47. 1
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
  48. 19
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
  49. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java
  50. 15
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  51. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  52. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java
  53. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java
  54. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java
  55. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java
  56. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java
  57. 5
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

21
epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java

@ -2,13 +2,11 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.LoginFormDTO;
import com.epmet.dto.form.StaffOrgsFormDTO;
import com.epmet.dto.form.ThirdStaffOrgsFormDTO;
import com.epmet.dto.form.ThirdWxmpEnteOrgFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.StaffOrgsResultDTO;
import com.epmet.dto.result.UserTokenResultDTO;
import com.epmet.service.ThirdLoginService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -91,4 +89,19 @@ public class ThirdLoginController {
return new Result<List<StaffOrgsResultDTO>>().ok(staffOrgs);
}
/**
* @param formDTO
* @return
* @author sun
* @description 单客户-获取微信用户手机号
**/
@PostMapping("getresiwxphone")
public Result getResiWxPhone(@RequestBody GetResiWxPhoneFormDTO formDTO) {
String phone = thirdLoginService.getResiWxPhone(formDTO);
if (StringUtils.isNotBlank(phone) && !"null".equals(phone)) {
return new Result().ok(phone);
}
return new Result().ok("");
}
}

39
epmet-auth/src/main/java/com/epmet/dto/form/GetResiWxPhoneFormDTO.java

@ -0,0 +1,39 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 单客户-获取微信用户手机号
*
* @author sun
*/
@Data
public class GetResiWxPhoneFormDTO implements Serializable {
private static final long serialVersionUID = 4381236451736209332L;
/**
* 小程序appId
*/
@NotBlank(message = "appId不能为空",groups = {AddUserInternalGroup.class})
private String appId;
/**
* 微信code
*/
@NotBlank(message = "wxCode不能为空",groups = {AddUserInternalGroup.class})
private String wxCode;
/**
* 用户信息
*/
@NotBlank(message = "encryptedData不能为空",groups = {AddUserInternalGroup.class})
private String encryptedData;
/**
* 加密算法的初始向量
*/
@NotBlank(message = "iv不能为空",groups = {AddUserInternalGroup.class})
private String iv;
public interface AddUserInternalGroup {}
}

9
epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java

@ -1,5 +1,6 @@
package com.epmet.service;
import com.epmet.dto.form.GetResiWxPhoneFormDTO;
import com.epmet.dto.form.LoginFormDTO;
import com.epmet.dto.form.ThirdStaffOrgsFormDTO;
import com.epmet.dto.form.ThirdWxmpEnteOrgFormDTO;
@ -53,4 +54,12 @@ public interface ThirdLoginService {
* @description 单客户-手机号密码获取组织
**/
List<StaffOrgsResultDTO> getMyOrgByPassword(ThirdStaffOrgsFormDTO formDTO);
/**
* @param formDTO
* @return
* @author sun
* @description 单客户-获取微信用户手机号
**/
String getResiWxPhone(GetResiWxPhoneFormDTO formDTO);
}

38
epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

@ -1,6 +1,8 @@
package com.epmet.service.impl;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import cn.binarywang.wx.miniapp.util.crypt.WxMaCryptUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.epmet.common.token.constant.LoginConstant;
@ -549,4 +551,40 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
return userWechatDTO;
}
/**
* @param formDTO
* @return
* @author sun
* @description 单客户-获取微信用户手机号
* 此接口只适配第三方客户对于党群e事通客户还是走原接口
**/
@Override
public String getResiWxPhone(GetResiWxPhoneFormDTO formDTO) {
String phone = "";
try {
//1.根据wxcode获取sessionKey
WxLoginFormDTO resiLoginFormDTO = new WxLoginFormDTO();
resiLoginFormDTO.setAppId(formDTO.getAppId());
resiLoginFormDTO.setWxCode(formDTO.getWxCode());
//此方法会校验appId是否授权,然后在判断客户是否存在,之后才是获取sessionKey,如果只想获取sessionKey需要写新接口
UserWechatDTO userWechatDTO = this.getUserWeChat(resiLoginFormDTO);
if (null == userWechatDTO || null == userWechatDTO.getSessionKey()) {
logger.error(String.format("调用生成third服务wxcode获取sessionKey失败,对应appId->" + formDTO.getAppId()));
throw new RenException("获取本机号码失败");
}
//2.使用sessionKey解密获取手机号
WxMaPhoneNumberInfo phoneNoInfo = WxMaPhoneNumberInfo.fromJson(WxMaCryptUtils.decrypt(userWechatDTO.getSessionKey(),
formDTO.getEncryptedData(),
formDTO.getIv()));
if (null != phoneNoInfo) {
phone = phoneNoInfo.getPurePhoneNumber();
}
} catch (Exception e) {
e.printStackTrace();
log.error(String.format("获取用户微信绑定的手机号接口异常%s", e.getMessage()));
}
return phone;
}
}

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -77,6 +77,8 @@ public enum EpmetErrorCode {
CANNOT_DISABLE_YOURSELF(8405,"您不能禁用自己"),
NO_SET_GRID_COUNT(8406,"您还未设置创建网格数量上限,请联系管理员设置"),
GRID_COUNT_UP(8407,"您的创建网格数量已到达上限,请联系管理员设置"),
EXIT_PEND_PROJECT(8408,"该工作人员有项目尚在处理,处理完毕方可操作"),
EXIT_PUBLISHED_ACTIVITY(8409,"该工作人员有活动尚在进行,等活动完成方可操作"),
ALREADY_EVALUATE(8501,"您已评价"),
ALREADY_VOTE(8502,"您已表态"),

13
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java

@ -2,9 +2,11 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -28,4 +30,15 @@ public interface EpmetHeartOpenFeignClient {
**/
@PostMapping("/heart/resi/volunteer/volunteeruserids")
Result<List<String>> volunteerUserIds(@RequestBody CommonCustomerFormDTO customerFormDTO);
/**
* 查询用户创建的未结束的活动
*
* @author zhaoqifeng
* @date 2020/8/28 14:38
* @param staffId
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.ActInfoDTO>>
*/
@PostMapping("/heart/resi/act/published/{staffId}")
Result<List<ActInfoDTO>> getPublishedAct(@PathVariable String staffId);
}

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java

@ -3,6 +3,7 @@ package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import org.springframework.stereotype.Component;
@ -29,4 +30,9 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result<List<String>> volunteerUserIds(CommonCustomerFormDTO customerFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "volunteerUserIds", customerFormDTO);
}
@Override
public Result<List<ActInfoDTO>> getPublishedAct(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getPublishedAct", staffId);
}
}

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java

@ -3,6 +3,7 @@ package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.form.resi.*;
import com.epmet.dto.result.resi.*;
import com.epmet.service.*;
@ -331,4 +332,16 @@ public class ResiActListController {
ValidatorUtils.validateEntity(formDTO, ResiActContentFormDTO.AddUserInternalGroup.class);
return actInfoService.checkSignInTime(formDTO);
}
/**
* 查询用户创建的未结束的活动
* @author zhaoqifeng
* @date 2020/8/28 14:37
* @param staffId
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.ActInfoDTO>>
*/
@PostMapping("published/{staffId}")
public Result<List<ActInfoDTO>> getPublishedAct(@PathVariable String staffId) {
return new Result<List<ActInfoDTO>>().ok(actInfoService.getPublishedAct(staffId));
}
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java

@ -310,4 +310,13 @@ public interface ActInfoDao extends BaseDao<ActInfoEntity> {
* @Date 11:00 2020-07-20
**/
List<ResiLookBackActResultDTO> selectListLookBackActAssembly(ResiLatestActFormDTO formDTO);
/**
* 查询用户创建的未结束的活动
* @author zhaoqifeng
* @date 2020/8/28 14:27
* @param staffId
* @return java.util.List<com.epmet.dto.ActInfoDTO>
*/
List<ActInfoDTO> selectPublishedAct(@Param("staffId") String staffId);
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java

@ -245,4 +245,13 @@ public interface ActInfoService extends BaseService<ActInfoEntity> {
* @Date 15:03 2020-08-05
**/
Result<ResiActRegistrationResultDTO> checkSignInTime(ResiActContentFormDTO formDTO);
/**
* 查询用户创建的未结束的活动
* @author zhaoqifeng
* @date 2020/8/28 14:32
* @param staffId
* @return java.util.List<com.epmet.dto.ActInfoDTO>
*/
List<ActInfoDTO> getPublishedAct(String staffId);
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java

@ -416,4 +416,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
}
return new Result<ResiActRegistrationResultDTO>().ok(resultDTO);
}
@Override
public List<ActInfoDTO> getPublishedAct(String staffId) {
return baseDao.selectPublishedAct(staffId);
}
}

8
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml

@ -758,4 +758,12 @@
ORDER BY a.CREATED_TIME DESC
LIMIT 0, #{num}
</select>
<select id="selectPublishedAct" resultType="com.epmet.dto.ActInfoDTO">
SELECT ID,
TITLE
FROM act_info
WHERE DEL_FLAG = '0'
AND ACT_STATUS = 'published'
AND CREATED_BY = #{staffId}
</select>
</mapper>

101
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffTransferRecordDTO.java

@ -0,0 +1,101 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 工作人员调动记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-27
*/
@Data
public class StaffTransferRecordDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 调动人员Id(操作人)
*/
private String operateStaffId;
/**
* 被调动人员Id
*/
private String operatedStaffId;
/**
* 调动前组织Id
*/
private String oldAgencyId;
/**
* 调动后组织Id
*/
private String agencyId;
/**
* 备注说明
*/
private String remarks;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

30
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffTransferFormDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.form;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/8/27 16:05
*/
@NoArgsConstructor
@Data
public class StaffTransferFormDTO implements Serializable {
private static final long serialVersionUID = -9011669876505775874L;
/**
* 被调动工作人员Id
*/
private String staffId;
/**
* 调动后组织Id
*/
private String agencyId;
/**
* 备注说明
*/
private String remarks;
}

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java

@ -17,6 +17,7 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -40,4 +41,9 @@ public class AgencyResultDTO implements Serializable {
* 机关组织名称
*/
private String agencyName = "";
/**
* 所有上级组织机构ID(以英文:隔开)
*/
@JsonIgnore
private String pids = "";
}

44
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInAgencyListResultDTO.java

@ -0,0 +1,44 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 工作端-查询当前人员所属组织及所有下级组织--接口返参
*
* @author sun
*/
@Data
public class StaffInAgencyListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当前组织信息
*/
private AgencyResultDTO agencyList;
/**
* 下级组织信息(递归)
*/
private List<AgencySubResultDTO> subAgencyList;
}

6
epmet-module/gov-org/gov-org-server/pom.xml

@ -89,6 +89,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-heart-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java

@ -67,4 +67,8 @@ public interface CustomerAgencyConstant {
* 网格党建指导员角色
*/
String GRID_PARTY_DIRECTOR = "grid_party_director";
/**
* 获取工作人员组织信息失败
*/
String SELECT_STAFF_AGENCY_EXCEPTION = "获取工作人员组织信息失败";
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -17,7 +17,9 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -229,4 +231,15 @@ public class CustomerAgencyController {
Result<ExtUserInfoResultDTO> userInfoExt(@RequestBody ExtUserInfoResultDTO result){
return new Result<ExtUserInfoResultDTO>().ok(customerAgencyService.extUserInfo(result));
}
/**
* @param tokenDTO
* @return
* @Author sun
* @Description 工作端-查询当前人员所属组织及所有下级组织
**/
@PostMapping("staffinagencylist")
public Result<StaffInAgencyListResultDTO> staffInAgencyList(@LoginUser TokenDto tokenDTO) {
return new Result<StaffInAgencyListResultDTO>().ok(customerAgencyService.staffInAgencyList(tokenDTO.getUserId()));
}
}

16
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java

@ -10,6 +10,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.StaffInfoFromDTO;
import com.epmet.dto.form.StaffSubmitFromDTO;
import com.epmet.dto.form.StaffTransferFormDTO;
import com.epmet.dto.form.StaffsInAgencyFromDTO;
import com.epmet.dto.result.*;
import com.epmet.service.StaffService;
@ -135,4 +136,19 @@ public class StaffController {
public Result<MineResultDTO> mine(@RequestBody StaffInfoFromDTO fromDTO){
return new Result<MineResultDTO>().ok(staffService.mine(fromDTO));
}
/**
* 工作人员调动
*
* @author zhaoqifeng
* @date 2020/8/27 16:12
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("stafftransfer")
public Result staffTransfer(@LoginUser TokenDto tokenDto, @RequestBody StaffTransferFormDTO formDTO){
staffService.staffTransfer(tokenDto, formDTO);
return new Result();
}
}

94
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffTransferRecordController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.StaffTransferRecordDTO;
import com.epmet.excel.StaffTransferRecordExcel;
import com.epmet.service.StaffTransferRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 工作人员调动记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-27
*/
@RestController
@RequestMapping("stafftransferrecord")
public class StaffTransferRecordController {
@Autowired
private StaffTransferRecordService staffTransferRecordService;
@GetMapping("page")
public Result<PageData<StaffTransferRecordDTO>> page(@RequestParam Map<String, Object> params){
PageData<StaffTransferRecordDTO> page = staffTransferRecordService.page(params);
return new Result<PageData<StaffTransferRecordDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<StaffTransferRecordDTO> get(@PathVariable("id") String id){
StaffTransferRecordDTO data = staffTransferRecordService.get(id);
return new Result<StaffTransferRecordDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody StaffTransferRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
staffTransferRecordService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody StaffTransferRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
staffTransferRecordService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
staffTransferRecordService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<StaffTransferRecordDTO> list = staffTransferRecordService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, StaffTransferRecordExcel.class);
}
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -168,4 +168,11 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
**/
List<ExtDeptResultDTO> selectDeptList(@Param("agencyId") String agencyId);
/**
* @param staffId
* @return
* @Author sun
* @Description 查询工作人员所属组织信息
**/
AgencyResultDTO selectAgencyByStaffId(@Param("staffId") String staffId);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java

@ -84,4 +84,13 @@ public interface CustomerDepartmentDao extends BaseDao<CustomerDepartmentEntity>
* @Description 查询机关下部门列表信息
**/
List<AgencyDeptList> selectAgencyDeptMsgList(@Param("agencyId") String agencyId);
/**
* 删除工作人员与部门关联
* @author zhaoqifeng
* @date 2020/8/28 15:12
* @param staffId
* @return void
*/
void deleteStaffDep(@Param("staffId") String staffId);
}

18
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java

@ -224,4 +224,22 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @date 2020/8/12 5:10 下午
*/
Integer selectGridCount(@Param("customerId")String customerId);
/**
* 删除工作人员与网格关联
* @author zhaoqifeng
* @date 2020/8/28 15:32
* @param staffId
* @return void
*/
void deleteGridStaff(@Param("staffId") String staffId);
/**
* 查询工作人员所在网格
* @author zhaoqifeng
* @date 2020/8/28 15:41
* @param staffId
* @return java.util.List<com.epmet.entity.CustomerGridEntity>
*/
List<CustomerGridEntity> selectGridByStaff(@Param("staffId") String staffId);
}

33
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffTransferRecordDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.StaffTransferRecordEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 工作人员调动记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-27
*/
@Mapper
public interface StaffTransferRecordDao extends BaseDao<StaffTransferRecordEntity> {
}

71
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffTransferRecordEntity.java

@ -0,0 +1,71 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 工作人员调动记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-27
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("staff_transfer_record")
public class StaffTransferRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 调动人员Id(操作人)
*/
private String operateStaffId;
/**
* 被调动人员Id
*/
private String operatedStaffId;
/**
* 调动前组织Id
*/
private String oldAgencyId;
/**
* 调动后组织Id
*/
private String agencyId;
/**
* 备注说明
*/
private String remarks;
}

74
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/StaffTransferRecordExcel.java

@ -0,0 +1,74 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 工作人员调动记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-27
*/
@Data
public class StaffTransferRecordExcel {
@Excel(name = "ID")
private String id;
@Excel(name = "客户ID")
private String customerId;
@Excel(name = "调动人员Id(操作人)")
private String operateStaffId;
@Excel(name = "被调动人员Id")
private String operatedStaffId;
@Excel(name = "调动前组织Id")
private String oldAgencyId;
@Excel(name = "调动后组织Id")
private String agencyId;
@Excel(name = "备注说明")
private String remarks;
@Excel(name = "删除标识")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

47
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/StaffTransferRecordRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.redis;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 工作人员调动记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-27
*/
@Component
public class StaffTransferRecordRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -205,4 +205,12 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @date 2020.08.21 17:31
**/
ExtUserInfoResultDTO extUserInfo(ExtUserInfoResultDTO result);
/**
* @param staffId
* @return
* @Author sun
* @Description 工作端-查询当前人员所属组织及所有下级组织
**/
StaffInAgencyListResultDTO staffInAgencyList(String staffId);
}

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java

@ -92,4 +92,14 @@ public interface CustomerDepartmentService extends BaseService<CustomerDepartmen
* @date 2020-04-20
*/
void delete(String[] ids);
/**
* 更新部门工作人员关系
*
* @author zhaoqifeng
* @date 2020/8/28 15:20
* @param staffId
* @return void
*/
void updateDepartment(String staffId);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java

@ -259,4 +259,13 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @date 2020/8/14 9:31 上午
*/
CustomerGridCountResultDTO selectGridCount( CustomerIdFormDTO customerIdFormDTO);
/**
* 更新网格工作人员关系
* @author zhaoqifeng
* @date 2020/8/28 15:36
* @param staffId
* @return void
*/
void updateGrid(String staffId);
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.StaffInfoFromDTO;
import com.epmet.dto.form.StaffSubmitFromDTO;
import com.epmet.dto.form.StaffTransferFormDTO;
import com.epmet.dto.form.StaffsInAgencyFromDTO;
import com.epmet.dto.result.*;
@ -84,11 +85,22 @@ public interface StaffService {
/**
* 我的基本信息
*
* @author zhaoqifeng
* @date 2020/5/22 16:57
* @param fromDTO
* @return com.epmet.dto.result.MineResultDTO
*/
MineResultDTO mine(StaffInfoFromDTO fromDTO);
/**
* 工作人员调动
* @author zhaoqifeng
* @date 2020/8/27 16:13
* @param tokenDto
* @param fromDTO
* @return void
*/
void staffTransfer(TokenDto tokenDto, StaffTransferFormDTO fromDTO);
}

95
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffTransferRecordService.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.StaffTransferRecordDTO;
import com.epmet.entity.StaffTransferRecordEntity;
import java.util.List;
import java.util.Map;
/**
* 工作人员调动记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-27
*/
public interface StaffTransferRecordService extends BaseService<StaffTransferRecordEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<StaffTransferRecordDTO>
* @author generator
* @date 2020-08-27
*/
PageData<StaffTransferRecordDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<StaffTransferRecordDTO>
* @author generator
* @date 2020-08-27
*/
List<StaffTransferRecordDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return StaffTransferRecordDTO
* @author generator
* @date 2020-08-27
*/
StaffTransferRecordDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-08-27
*/
void save(StaffTransferRecordDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-08-27
*/
void update(StaffTransferRecordDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-08-27
*/
void delete(String[] ids);
}

24
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -970,4 +970,28 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
}
}
/**
* @param staffId
* @return
* @Author sun
* @Description 工作端-查询当前人员所属组织及所有下级组织
**/
@Override
public StaffInAgencyListResultDTO staffInAgencyList(String staffId) {
StaffInAgencyListResultDTO resultDTO = new StaffInAgencyListResultDTO();
//1.查询工作人员所属组织信息
AgencyResultDTO agencyList = baseDao.selectAgencyByStaffId(staffId);
if (null == agencyList) {
logger.error(String.format("查询工作人员所属组织信息失败,staffId->%s", staffId));
throw new RenException(CustomerAgencyConstant.SELECT_STAFF_AGENCY_EXCEPTION);
}
resultDTO.setAgencyList(agencyList);
//2.递归查询所有下级组织信息
List<AgencySubResultDTO> subAgencyList = getDepartmentList(("".equals(agencyList.getPids()) ? "" : agencyList.getPids() + ":") + agencyList.getAgencyId());
resultDTO.setSubAgencyList(subAgencyList);
return resultDTO;
}
}

24
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java

@ -20,11 +20,13 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.CustomerDepartmentDao;
import com.epmet.dto.CustomerDepartmentDTO;
import com.epmet.dto.result.DepartmentListResultDTO;
import com.epmet.entity.CustomerDepartmentEntity;
import com.epmet.redis.CustomerDepartmentRedis;
import com.epmet.service.CustomerDepartmentService;
@ -33,6 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -101,4 +104,25 @@ public class CustomerDepartmentServiceImpl extends BaseServiceImpl<CustomerDepar
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateDepartment(String staffId) {
//获取工作人员所在部门及部门总人数
List<DepartmentListResultDTO> list = baseDao.listDepartmentListByStaffId(staffId);
if (null != list && list.size() > NumConstant.ZERO) {
List<CustomerDepartmentEntity> entityList = new ArrayList<>();
for (DepartmentListResultDTO dto : list) {
CustomerDepartmentEntity entity = new CustomerDepartmentEntity();
entity.setId(dto.getDepartmentId());
entity.setTotalUser(dto.getTotalUser() - NumConstant.ONE);
entityList.add(entity);
}
//更新部门总人数
updateBatchById(entityList);
//删除工作人员与部门关联
baseDao.deleteStaffDep(staffId);
}
}
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -649,4 +649,17 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
return customerGridCount;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateGrid(String staffId) {
List<CustomerGridEntity> gridList = baseDao.selectGridByStaff(staffId);
if(null != gridList && gridList.size() > NumConstant.ZERO) {
gridList.forEach(entity -> {
entity.setTotalUser(entity.getTotalUser() - 1);
});
updateBatchById(gridList);
baseDao.deleteGridStaff(staffId);
}
}
}

91
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

@ -1,22 +1,17 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerStaffAgencyDTO;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.form.StaffInfoFromDTO;
import com.epmet.dto.form.StaffSubmitFromDTO;
import com.epmet.dto.form.StaffsInAgencyFromDTO;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerStaffAgencyEntity;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.OperCrmFeignClient;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerStaffAgencyService;
import com.epmet.service.StaffService;
import com.epmet.feign.*;
import com.epmet.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -40,6 +35,18 @@ public class StaffServiceImpl implements StaffService {
private CustomerAgencyService customerAgencyService;
@Autowired
private CustomerStaffAgencyService customerStaffAgencyService;
@Autowired
private GovProjectOpenFeignClient govProjectOpenFeignClient;
@Autowired
private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient;
@Autowired
private CustomerDepartmentService customerDepartmentService;
@Autowired
private CustomerGridService customerGridService;
@Autowired
private StaffTransferRecordService staffTransferRecordService;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public Result<StaffsInAgencyResultDTO> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) {
@ -183,4 +190,66 @@ public class StaffServiceImpl implements StaffService {
}
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void staffTransfer(TokenDto tokenDto, StaffTransferFormDTO fromDTO) {
//1.获取工作人员与机关关系
CustomerStaffAgencyDTO staffAgencyDTO = customerStaffAgencyService.getInfoByUserId(fromDTO.getStaffId());
String oldAgency = staffAgencyDTO.getAgencyId();
//2.查询是否有未处理项目
ProjectListFromDTO projectFromDTO = new ProjectListFromDTO();
projectFromDTO.setCustomerId(staffAgencyDTO.getCustomerId());
projectFromDTO.setUserId(fromDTO.getStaffId());
projectFromDTO.setPageNo(1);
projectFromDTO.setPageSize(10);
Result<List<PendProjectListResultDTO>> pendResult = govProjectOpenFeignClient.getPendProjectList(projectFromDTO);
if (!pendResult.success()) {
throw new RenException(pendResult.getCode(), pendResult.getMsg());
}
if (null != pendResult.getData() && pendResult.getData().size() > NumConstant.ZERO) {
throw new RenException(EpmetErrorCode.EXIT_PEND_PROJECT.getCode());
}
//3.查询是否有活动未结束
Result<List<ActInfoDTO>> actInfoResult = epmetHeartOpenFeignClient.getPublishedAct(fromDTO.getStaffId());
if (!actInfoResult.success()) {
throw new RenException(actInfoResult.getCode(), actInfoResult.getMsg());
}
if (null != actInfoResult.getData() && actInfoResult.getData().size() > NumConstant.ZERO) {
throw new RenException(EpmetErrorCode.EXIT_PUBLISHED_ACTIVITY.getCode());
}
//4.修改人员所属组织
CustomerStaffAgencyDTO staffAgency = new CustomerStaffAgencyDTO();
staffAgency.setId(staffAgencyDTO.getId());
staffAgency.setAgencyId(fromDTO.getAgencyId());
customerStaffAgencyService.update(staffAgency);
//原来组织总人数减一
CustomerAgencyDTO oldAgencyDTO = customerAgencyService.get(oldAgency);
oldAgencyDTO.setTotalUser(oldAgencyDTO.getTotalUser() - NumConstant.ONE);
customerAgencyService.update(oldAgencyDTO);
//新组织总人数加一
CustomerAgencyDTO newAgencyDTO = customerAgencyService.get(fromDTO.getAgencyId());
newAgencyDTO.setTotalUser(newAgencyDTO.getTotalUser() - NumConstant.ONE);
customerAgencyService.update(newAgencyDTO);
//5.逻辑删除工作人员原组织加入的部门、网格,部门、网格总人数减1
customerDepartmentService.updateDepartment(fromDTO.getStaffId());
customerGridService.updateGrid(fromDTO.getStaffId());
//6.更改工作人员组织角色
StaffRoleDTO staffRoleDTO = new StaffRoleDTO();
staffRoleDTO.setOrgId(fromDTO.getAgencyId());
staffRoleDTO.setStaffId(fromDTO.getStaffId());
Result result = epmetUserOpenFeignClient.changeRoleOrg(staffRoleDTO);
if (!result.success()) {
throw new RenException(result.getCode(), result.getMsg());
}
//7.操作记录表新增调动记录
StaffTransferRecordDTO staffTransferRecordDTO = new StaffTransferRecordDTO();
staffTransferRecordDTO.setCustomerId(tokenDto.getCustomerId());
staffTransferRecordDTO.setOperateStaffId(tokenDto.getUserId());
staffTransferRecordDTO.setOperatedStaffId(fromDTO.getStaffId());
staffTransferRecordDTO.setOldAgencyId(oldAgency);
staffTransferRecordDTO.setAgencyId(fromDTO.getAgencyId());
staffTransferRecordDTO.setRemarks(fromDTO.getRemarks());
staffTransferRecordService.save(staffTransferRecordDTO);
}
}

104
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.StaffTransferRecordDao;
import com.epmet.dto.StaffTransferRecordDTO;
import com.epmet.entity.StaffTransferRecordEntity;
import com.epmet.redis.StaffTransferRecordRedis;
import com.epmet.service.StaffTransferRecordService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 工作人员调动记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-27
*/
@Service
public class StaffTransferRecordServiceImpl extends BaseServiceImpl<StaffTransferRecordDao, StaffTransferRecordEntity> implements StaffTransferRecordService {
@Autowired
private StaffTransferRecordRedis staffTransferRecordRedis;
@Override
public PageData<StaffTransferRecordDTO> page(Map<String, Object> params) {
IPage<StaffTransferRecordEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, StaffTransferRecordDTO.class);
}
@Override
public List<StaffTransferRecordDTO> list(Map<String, Object> params) {
List<StaffTransferRecordEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, StaffTransferRecordDTO.class);
}
private QueryWrapper<StaffTransferRecordEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<StaffTransferRecordEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public StaffTransferRecordDTO get(String id) {
StaffTransferRecordEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, StaffTransferRecordDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(StaffTransferRecordDTO dto) {
StaffTransferRecordEntity entity = ConvertUtils.sourceToTarget(dto, StaffTransferRecordEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(StaffTransferRecordDTO dto) {
StaffTransferRecordEntity entity = ConvertUtils.sourceToTarget(dto, StaffTransferRecordEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

16
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.2__staff_transfer_record.sql

@ -0,0 +1,16 @@
CREATE TABLE `staff_transfer_record` (
`ID` varchar(64) NOT NULL COMMENT 'ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`OPERATE_STAFF_ID` varchar(64) NOT NULL COMMENT '调动人员Id(操作人)',
`OPERATED_STAFF_ID` varchar(64) NOT NULL COMMENT '被调动人员Id',
`OLD_AGENCY_ID` varchar(64) NOT NULL COMMENT '调动前组织Id',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '调动后组织Id',
`REMARKS` varchar(255) DEFAULT NULL COMMENT '备注说明',
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识',
`REVISION` int(10) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作人员调动记录表';

14
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -277,4 +277,18 @@
AND agency.PID = #{pid}
</select>
<select id="selectAgencyByStaffId" resultType="com.epmet.dto.result.AgencyResultDTO">
SELECT
ca.id AS "agencyId",
ca.organization_name AS "agencyName",
ca.pids AS "pids"
FROM
customer_agency ca
INNER JOIN customer_staff_agency csa ON ca.id = csa.agency_id
WHERE
ca.del_flag = '0'
AND csa.del_flag = '0'
AND csa.user_id = #{staffId}
</select>
</mapper>

5
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml

@ -2,6 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.CustomerDepartmentDao">
<delete id="deleteStaffDep">
UPDATE customer_staff_department SET DEL_FLAG = '1'
WHERE USER_ID = #{staffId} AND DEL_FLAG = '0'
</delete>
<select id="selectDepartmentListByAgencyId" resultType="com.epmet.dto.result.DepartmentListResultDTO">
SELECT
@ -32,6 +36,7 @@
from customer_staff_department csd
inner join customer_department cd on (csd.DEPARTMENT_ID = cd.ID)
where csd.USER_ID = #{staffId}
and csd.DEL_FLAG = '0'
</select>
<!-- 根据部门id查询customerId -->

17
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -2,6 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.CustomerGridDao">
<delete id="deleteGridStaff">
UPDATE customer_staff_grid SET DEL_FLAG = '1'
WHERE USER_ID = #{staffId} AND DEL_FLAG = '0'
</delete>
<select id="getCustomerGridByGridId" parameterType="com.epmet.dto.form.CustomerGridFormDTO"
resultType="com.epmet.dto.CustomerGridDTO">
SELECT
@ -473,4 +477,17 @@
del_flag = '0'
AND customer_id = #{customerId}
</select>
<select id="selectGridByStaff" resultType="com.epmet.entity.CustomerGridEntity">
SELECT
g.ID,
g.GRID_NAME,
g.TOTAL_USER
FROM
customer_staff_grid sg
INNER JOIN customer_grid g ON ( sg.GRID_ID = g.ID )
WHERE
sg.DEL_FLAG = '0'
AND g.DEL_FLAG = '0'
AND sg.USER_ID = #{staffId}
</select>
</mapper>

8
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffTransferRecordDao.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.StaffTransferRecordDao">
</mapper>

16
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java

@ -1,9 +1,16 @@
package com.epmet.feign;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.ProjectListFromDTO;
import com.epmet.dto.result.PendProjectListResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@ -13,4 +20,13 @@ import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback;
*/
@FeignClient(name = ServiceConstant.GOV_PROJECT_SERVER, fallback = GovProjectOpenFeignClientFallback.class)
public interface GovProjectOpenFeignClient {
/**
* 待处理项目列表
* @author zhaoqifeng
* @date 2020/8/27 16:56
* @param fromDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.PendProjectListResultDTO>>
*/
@PostMapping("gov/project/project/pendprojectlist")
Result<List<PendProjectListResultDTO>> getPendProjectList(@RequestBody ProjectListFromDTO fromDTO);
}

11
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java

@ -1,8 +1,15 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.ProjectListFromDTO;
import com.epmet.dto.result.PendProjectListResultDTO;
import com.epmet.feign.GovProjectOpenFeignClient;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
*
@ -11,4 +18,8 @@ import org.springframework.stereotype.Component;
*/
@Component
public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignClient {
@Override
public Result<List<PendProjectListResultDTO>> getPendProjectList(ProjectListFromDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getPendProjectList", fromDTO);
}
}

20
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java

@ -17,7 +17,11 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -27,10 +31,12 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.form.LatestListFormDTO;
import com.epmet.dto.form.ProjectListFromDTO;
import com.epmet.dto.form.ShiftProjectFormDTO;
import com.epmet.dto.form.ShiftProjectsFromDTO;
import com.epmet.dto.result.IssueProjectResultDTO;
import com.epmet.dto.result.LatestListResultDTO;
import com.epmet.dto.result.PendProjectListResultDTO;
import com.epmet.dto.result.ShiftProjectResultDTO;
import com.epmet.excel.ProjectExcel;
import com.epmet.service.ProjectService;
@ -132,4 +138,18 @@ public class ProjectController {
return new Result<List<LatestListResultDTO>>().ok(projectService.getClosedProjectList(formDTO));
}
/**
* 获取待处理项目列表
* @author zhaoqifeng
* @date 2020/8/27 16:55
* @param fromDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.PendProjectListResultDTO>>
*/
@PostMapping("pendprojectlist")
public Result<List<PendProjectListResultDTO>> getPendProjectList(@RequestBody ProjectListFromDTO fromDTO) {
List<PendProjectListResultDTO> result = projectService.getPendProjectList(fromDTO);
return new Result<List<PendProjectListResultDTO>>().ok(result);
}
}

1
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java

@ -106,6 +106,7 @@ public interface ProjectService extends BaseService<ProjectEntity> {
*/
List<PendProjectListResultDTO> getPendProjectList(ProjectListFromDTO fromDTO);
/**
* 我发起的项目列表
*

19
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java

@ -173,15 +173,16 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
Result result = new Result();
//校验手机验证码是否正常
//TODO 党员认证信息提交暂时注释验证码校验
/*String code = partyMemberInfoRedis.getUserMobileCode(partyMemberInfoDTO.getUserId(),
partyMemberInfoDTO.getMobile(),
partyMemberInfoDTO.getCode());
if (null == code) {
saveOrUpdateVisit(partyMemberInfoDTO.getPartymemberVisitId(), null,
PartyMemberConstant.OPERATE_AUTO_FAILED);
return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode());
}*/
if (StringUtils.isNotBlank(partyMemberInfoDTO.getCode())) {
String code = partyMemberInfoRedis.getUserMobileCode(partyMemberInfoDTO.getUserId(),
partyMemberInfoDTO.getMobile(),
partyMemberInfoDTO.getCode());
if (null == code) {
saveOrUpdateVisit(partyMemberInfoDTO.getPartymemberVisitId(), null,
PartyMemberConstant.OPERATE_AUTO_FAILED);
return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode());
}
}
//获取党员基本信息(匹配)
PartymemberConfirmAutoDTO confirmAutoDTO =

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java

@ -82,7 +82,7 @@ public class InfoSubmitFromDTO implements Serializable {
/**
* 手机验证码
*/
@NotBlank(message = "手机验证码不能为空")
// @NotBlank(message = "手机验证码不能为空")
@Length(max=6,message = "手机验证码不能超过6位")
private String mobileCode;

15
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -4,10 +4,7 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.UserDTO;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.EpmetUserOpenFeignClientFallback;
@ -299,4 +296,14 @@ public interface EpmetUserOpenFeignClient {
**/
@PostMapping("/epmetuser/userbaseinfo/extuserinfo")
Result<ExtUserInfoResultDTO> extUserInfo( @RequestBody CommonUserIdFormDTO param);
/**
* 更改角色所属组织
* @author zhaoqifeng
* @date 2020/8/31 10:36
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("epmetuser/staffrole/changeroleorg")
Result changeRoleOrg(@RequestBody StaffRoleDTO formDTO);
}

10
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -4,10 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.UserDTO;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetUserOpenFeignClient;
@ -203,4 +200,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<ExtUserInfoResultDTO> extUserInfo(CommonUserIdFormDTO param) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "extUserInfo", param);
}
@Override
public Result changeRoleOrg(StaffRoleDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "changeRoleOrg", formDTO);
}
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java

@ -5,6 +5,7 @@ import com.epmet.commons.mybatis.entity.DataScope;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.CustomerRoleFormDTO;
import com.epmet.dto.form.RolesUsersListFormDTO;
@ -167,4 +168,17 @@ public class StaffRoleController {
public Result<List<CustomerStaffRoleResultDTO>> getStaffRoles(@PathVariable String staffId) {
return new Result<List<CustomerStaffRoleResultDTO>>().ok(staffRoleService.getStaffRoles(staffId));
}
/**
* 更改角色所属组织
* @author zhaoqifeng
* @date 2020/8/31 10:29
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("changeroleorg")
public Result changeRoleOrg(@RequestBody StaffRoleDTO formDTO) {
staffRoleService.changeRoleOrg(formDTO);
return new Result();
}
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java

@ -17,6 +17,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.annotation.DataFilter;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.mybatis.entity.DataScope;
import com.epmet.dto.StaffRoleDTO;
@ -112,4 +113,13 @@ public interface StaffRoleDao extends BaseDao<StaffRoleEntity> {
* @Date 10:45 2020-08-25
**/
StaffRoleDTO selectStaffRoleByStaffIdAndRoleId(@Param("staffId") String staffId, @Param("roleId") String roleId);
/**
* 更改角色所属组织
* @author zhaoqifeng
* @date 2020/8/31 10:33
* @param dto
* @return void
*/
void updateStaffRoleOrgId(StaffRoleDTO dto);
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffRoleService.java

@ -150,4 +150,13 @@ public interface StaffRoleService extends BaseService<StaffRoleEntity> {
List<CustomerStaffRoleResultDTO> getStaffRoles(String staffId);
List<StaffRoleEntity> getStaffRoleEntytiesByStaffIdAndOrgId(String agencyId, String staffId);
/**
* 更改角色组织
* @author zhaoqifeng
* @date 2020/8/31 10:31
* @param formDTO
* @return void
*/
void changeRoleOrg(StaffRoleDTO formDTO);
}

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java

@ -182,4 +182,10 @@ public class StaffRoleServiceImpl extends BaseServiceImpl<StaffRoleDao, StaffRol
return baseDao.listStaffRoleEntytiesByStaffIdAndOrgId(agencyId, staffId);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void changeRoleOrg(StaffRoleDTO formDTO) {
baseDao.updateStaffRoleOrgId(formDTO);
}
}

16
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

@ -162,13 +162,15 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
public Result submit(UserResiInfoDTO userResiInfoDTO) {
Result result = new Result();
//1:手机验证码数据校验
//TODO 完善居民信息暂时注释验证码校验
/*String verificationCode = userResiInfoRedis.getUserResiMobileCode(userResiInfoDTO.getUserId(),userResiInfoDTO.getRegMobile(),userResiInfoDTO.getMobileCode());
if(null == verificationCode || StringUtils.isBlank(verificationCode)){
//验证码校验失败则更新行为记录表数据 返回前台结果
userResiRegisterVisitService.updateResiRegisterVisit(false, userResiInfoDTO);
return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode());
}*/
if (StringUtils.isNotBlank(userResiInfoDTO.getMobileCode())) {
String verificationCode = userResiInfoRedis.getUserResiMobileCode(userResiInfoDTO.getUserId(), userResiInfoDTO.getRegMobile(), userResiInfoDTO.getMobileCode());
if (null == verificationCode || StringUtils.isBlank(verificationCode)) {
//验证码校验失败则更新行为记录表数据 返回前台结果
userResiRegisterVisitService.updateResiRegisterVisit(false, userResiInfoDTO);
return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode());
}
}
//2:再次判断手机号是否在客户下可用
if (!getResiInfoByMobile(userResiInfoDTO.getRegMobile(), userResiInfoDTO.getCustomerId())) {
//手机号验证失败则更新行为记录表数据 返回前台结果

5
epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

@ -23,6 +23,11 @@
and sr.ORG_ID = #{orgId}
and sr.DEL_FLAG = '0'
</update>
<update id="updateStaffRoleOrgId" parameterType="com.epmet.dto.StaffRoleDTO">
UPDATE staff_role SET ORG_ID = #{orgId}
WHERE STAFF_ID = #{staffId}
AND DEL_FLAG = '0'
</update>
<!--查询具有某角色的staff列表-->

Loading…
Cancel
Save