|
|
@ -9,6 +9,7 @@ |
|
|
|
package com.elink.esua.epdc.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum; |
|
|
@ -23,6 +24,7 @@ import com.elink.esua.epdc.commons.tools.security.password.PasswordUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.DateUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.dao.SysUserDao; |
|
|
|
import com.elink.esua.epdc.dto.*; |
|
|
@ -41,6 +43,7 @@ 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 springfox.documentation.spring.web.json.Json; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
@ -392,18 +395,21 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit |
|
|
|
userAddFormDTO.setGridId(sysDeptInfoResultDTO.getGridManageId()); |
|
|
|
userAddFormDTO.setUserName(entity.getUsername()); |
|
|
|
userAddFormDTO.setPhone(entity.getMobile()); |
|
|
|
userAddFormDTO.setGender(entity.getGender() == null ? "" : entity.getGender().toString()); |
|
|
|
userAddFormDTO.setBornTime(""); |
|
|
|
userAddFormDTO.setWorkDate(""); |
|
|
|
userAddFormDTO.setGender(entity.getGender() == null ? null : entity.getGender().toString()); |
|
|
|
userAddFormDTO.setBornTime(null); |
|
|
|
userAddFormDTO.setWorkDate(null); |
|
|
|
userAddFormDTO.setHeadImage(entity.getHeadUrl()); |
|
|
|
userAddFormDTO.setIntroduction(entity.getRemark()); |
|
|
|
userAddFormDTO.setDescription(""); |
|
|
|
userAddFormDTO.setCreateTime(entity.getCreateDate().toString()); |
|
|
|
userAddFormDTO.setDescription(null); |
|
|
|
userAddFormDTO.setCreateTime(DateUtils.format(entity.getCreateDate(), DateUtils.DATE_TIME_PATTERN)); |
|
|
|
userAddFormDTO.setOldManageId(entity.getId().toString()); |
|
|
|
|
|
|
|
log.info("++++++++++++++++++++++++++++++++++++++++++++sysUserAddFormDTO:" + userAddFormDTO); |
|
|
|
Result<GlobalResultDTO> result = communityManageFeignClient.addManageUser(userAddFormDTO); |
|
|
|
log.info("++++++++++++++++++++++++++++++++++++++++++++sysUserAdd result:" + result); |
|
|
|
log.info("++++++++++++++++++++++++++++++++++++++++++++sysUserAdd result.getMsg():" + result.getMsg()); |
|
|
|
log.info("++++++++++++++++++++++++++++++++++++++++++++sysUserAdd result.getCode():" + result.getCode()); |
|
|
|
log.info("++++++++++++++++++++++++++++++++++++++++++++sysUserAdd result.getData():" + result.getData()); |
|
|
|
log.info("++++++++++++++++++++++++++++++++++++++++++++sysUserAdd result:" + JSON.toJSONString(result)); |
|
|
|
communityManageHandle(result, dto, entity); |
|
|
|
} |
|
|
|
} else if (type == NumConstant.ONE) { |
|
|
@ -412,18 +418,18 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit |
|
|
|
ManageUserUpdFormDTO userUpdFormDTO = new ManageUserUpdFormDTO(); |
|
|
|
|
|
|
|
userUpdFormDTO.setUserName(entity.getUsername()); |
|
|
|
userUpdFormDTO.setGender(entity.getGender() == null ? "" : entity.getGender().toString()); |
|
|
|
userUpdFormDTO.setBornTime(""); |
|
|
|
userUpdFormDTO.setWorkDate(""); |
|
|
|
userUpdFormDTO.setGender(entity.getGender() == null ? null : entity.getGender().toString()); |
|
|
|
userUpdFormDTO.setBornTime(null); |
|
|
|
userUpdFormDTO.setWorkDate(null); |
|
|
|
userUpdFormDTO.setHeadImage(entity.getHeadUrl()); |
|
|
|
userUpdFormDTO.setIntroduction(entity.getRemark()); |
|
|
|
userUpdFormDTO.setDescription(""); |
|
|
|
userUpdFormDTO.setDescription(null); |
|
|
|
userUpdFormDTO.setId(userEntity.getManageId()); |
|
|
|
userUpdFormDTO.setGridId(sysDeptInfoResultDTO.getGridManageId()); |
|
|
|
|
|
|
|
log.info("++++++++++++++++++++++++++++++++++++++++++++sysUserUpdFormDTO:" + userUpdFormDTO); |
|
|
|
Result<GlobalResultDTO> result = communityManageFeignClient.updManageUser(userUpdFormDTO); |
|
|
|
log.info("++++++++++++++++++++++++++++++++++++++++++++sysUserupd result:" + result); |
|
|
|
log.info("++++++++++++++++++++++++++++++++++++++++++++sysUserupd result:" + JSON.toJSONString(result)); |
|
|
|
communityManageHandle(result, dto, entity); |
|
|
|
} |
|
|
|
} else if (type == NumConstant.TWO) { |
|
|
@ -433,7 +439,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit |
|
|
|
userDelFormDTO.setId(userEntity.getManageId()); |
|
|
|
log.info("++++++++++++++++++++++++++++++++++++++++++++sysUserDelFormDTO:" + userDelFormDTO); |
|
|
|
Result<GlobalResultDTO> result = communityManageFeignClient.delManageUser(userDelFormDTO); |
|
|
|
log.info("++++++++++++++++++++++++++++++++++++++++++++sysUserDel result:" + result); |
|
|
|
log.info("++++++++++++++++++++++++++++++++++++++++++++sysUserDel result:" + JSON.toJSONString(result)); |
|
|
|
// communityManageHandle(result, dto, entity);
|
|
|
|
} |
|
|
|
} |
|
|
@ -451,6 +457,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit |
|
|
|
* @param entity |
|
|
|
*/ |
|
|
|
private void communityManageHandle(Result<GlobalResultDTO> result, SysUserDTO dto, SysUserEntity entity) { |
|
|
|
log.info("++++++++++++++++++++++++++++++++++++++++++++进入设置【设置ManageId】"); |
|
|
|
if (result.success()) { |
|
|
|
Object resultObject = result.getData().getResult(); |
|
|
|
Integer mId = null; |
|
|
@ -458,6 +465,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit |
|
|
|
if (resultObject != null) { |
|
|
|
mId = Integer.valueOf(resultObject.toString()); |
|
|
|
} |
|
|
|
log.info("++++++++++++++++++++++++++++++++++++++++++++进入设置【设置ManageId】++++ mId: " + mId); |
|
|
|
SysUserEntity userEntity = baseDao.selectById(entity.getId()); |
|
|
|
// 表里没有直接插入
|
|
|
|
if (userEntity == null) { |
|
|
|