Browse Source

编辑

master
zhangyuan 3 years ago
parent
commit
6ebd4c765f
  1. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java
  2. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
  3. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java
  4. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java
  5. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
  6. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  7. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java
  8. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

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

@ -107,11 +107,11 @@ public class StaffController {
* @param fromDTO 参数
* @return Result
*/
@PostMapping("editstaffv3")
@PostMapping("editstaffpy")
@RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_UPDATE)
public Result editStaff(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitPyFromDTO fromDTO){
public Result editStaffPy(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitPyFromDTO fromDTO){
ValidatorUtils.validateEntity(fromDTO);
return staffService.editStaffV3(tokenDto, fromDTO);
return staffService.editStaffPy(tokenDto, fromDTO);
}
/**

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java

@ -116,8 +116,8 @@ public interface EpmetUserFeignClient {
* @param fromDTO 参数
* @return Result
*/
@PostMapping("/epmetuser/customerstaff/editstaffv3")
Result editStaffV3(@RequestBody StaffSubmitPyFromDTO fromDTO);
@PostMapping("/epmetuser/customerstaff/editstaffpy")
Result editStaffPy(@RequestBody StaffSubmitPyFromDTO fromDTO);
/**

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java

@ -73,8 +73,8 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient {
}
@Override
public Result editStaffV3(StaffSubmitPyFromDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editStaffV3", fromDTO);
public Result editStaffPy(StaffSubmitPyFromDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editStaffPy", fromDTO);
}
@Override

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

@ -70,7 +70,7 @@ public interface StaffService {
* @param fromDTO 参数
* @return Result
*/
Result editStaffV3(TokenDto tokenDto, StaffSubmitPyFromDTO fromDTO);
Result editStaffPy(TokenDto tokenDto, StaffSubmitPyFromDTO fromDTO);
/**
* 人员详情

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

@ -196,13 +196,13 @@ public class StaffServiceImpl implements StaffService {
}
@Override
public Result editStaffV3(TokenDto tokenDto, StaffSubmitPyFromDTO fromDTO) {
public Result editStaffPy(TokenDto tokenDto, StaffSubmitPyFromDTO fromDTO) {
CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId());
fromDTO.setCustomerId(customerAgencyEntity.getCustomerId());
fromDTO.setApp(tokenDto.getApp());
fromDTO.setClient(tokenDto.getClient());
Result result = epmetUserFeignClient.editStaffV3(fromDTO);
Result result = epmetUserFeignClient.editStaffPy(fromDTO);
if (!result.success()) {
if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) {
return new Result().error(result.getCode(), result.getMsg());

6
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -311,9 +311,9 @@ public class CustomerStaffController {
* @param fromDTO 参数
* @return Result
*/
@PostMapping("editstaffv3")
public Result editStaffV3(@RequestBody StaffSubmitPyFromDTO fromDTO){
Result result = customerStaffService.editStaffV3(fromDTO);
@PostMapping("editstaffpy")
public Result editStaffPy(@RequestBody StaffSubmitPyFromDTO fromDTO){
Result result = customerStaffService.editStaffPy(fromDTO);
//2021-10-18 推送mq,数据同步到中介库 start
if (result.success()) {

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java

@ -210,7 +210,7 @@ public interface CustomerStaffService extends BaseService<CustomerStaffEntity> {
* @param fromDTO 参数
* @return Result
*/
Result editStaffV3(StaffSubmitPyFromDTO fromDTO);
Result editStaffPy(StaffSubmitPyFromDTO fromDTO);
/**
* 人员详情

13
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -511,7 +511,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
@Override
@Transactional(rollbackFor = Exception.class)
public Result editStaffV3(StaffSubmitPyFromDTO fromDTO) {
public Result editStaffPy(StaffSubmitPyFromDTO fromDTO) {
CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO();
customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId());
customerStaffFormDTO.setMobile(fromDTO.getMobile());
@ -519,7 +519,13 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
if (null != customerStaffDTO && !fromDTO.getStaffId().equals(customerStaffDTO.getUserId())) {
return new Result<CustomerStaffDTO>().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg());
}
CustomerStaffByAccountFormDTO customerStaffAccountFormDTO = new CustomerStaffByAccountFormDTO();
customerStaffAccountFormDTO.setCustomerId(fromDTO.getCustomerId());
customerStaffAccountFormDTO.setUserAccount(fromDTO.getUserAccount());
customerStaffDTO = baseDao.selectListCustomerStaffInfoByAccount(customerStaffAccountFormDTO);
if (null != customerStaffDTO && !fromDTO.getStaffId().equals(customerStaffDTO.getUserId())) {
return new Result<CustomerStaffDTO>().error(EpmetErrorCode.ACCOUNT_USED.getCode(), EpmetErrorCode.ACCOUNT_USED.getMsg());
}
CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId());
//Customer_Staff表插入数据
CustomerStaffEntity staffEntity = new CustomerStaffEntity();
@ -529,6 +535,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
staffEntity.setGender(fromDTO.getGender());
staffEntity.setUserAccount(fromDTO.getUserAccount());
staffEntity.setWorkType(fromDTO.getWorkType());
if (StringUtils.isNotBlank(fromDTO.getPwd())){
staffEntity.setPassword(PasswordUtils.encode(fromDTO.getPwd()));
}
baseDao.updateById(staffEntity);
//清空权限关联

Loading…
Cancel
Save