deleted
This commit is contained in:
@@ -38,7 +38,6 @@ public class CommonConstants {
|
|||||||
|
|
||||||
public static final String WX_APP_SECRET_KEY = "wx_app_secret_key:{0}";
|
public static final String WX_APP_SECRET_KEY = "wx_app_secret_key:{0}";
|
||||||
public static final String MINI_PROGRAM_SESSION_KEY = "mini_program_session_key:{0}:{1}";
|
public static final String MINI_PROGRAM_SESSION_KEY = "mini_program_session_key:{0}:{1}";
|
||||||
public static final String ENTERPRISE_OPEN_STATUS_KEY = "enterprise_open_status:{0}_{1}";
|
|
||||||
|
|
||||||
public static final String ROOT_DEPT_ID_STR = "1";
|
public static final String ROOT_DEPT_ID_STR = "1";
|
||||||
|
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
package com.cool.store.dao;
|
|
||||||
|
|
||||||
import com.cool.store.mapper.EnterpriseConfigMapper;
|
|
||||||
import com.cool.store.entity.EnterpriseConfigDO;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @FileName: EnterpriseConfigDAO
|
|
||||||
* @Description:
|
|
||||||
* @date 2023-05-18 11:15
|
|
||||||
*/
|
|
||||||
@Repository
|
|
||||||
public class EnterpriseConfigDAO {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private EnterpriseConfigMapper enterpriseConfigMapper;
|
|
||||||
|
|
||||||
|
|
||||||
public EnterpriseConfigDO selectByEnterpriseId() {
|
|
||||||
//return enterpriseConfigMapper.selectByEnterpriseId(enterpriseId);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnterpriseConfigDO getDbInfoByDbName(String dbName) {
|
|
||||||
if(StringUtils.isBlank(dbName)){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return enterpriseConfigMapper.getDbInfoByDbName(dbName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<EnterpriseConfigDO> getDistinctDbServer() {
|
|
||||||
return enterpriseConfigMapper.getDistinctDbServer();
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnterpriseConfigDO getConfigByCorpIdAndAppType(String corpId, String appType){
|
|
||||||
if(StringUtils.isAnyBlank(corpId, appType)){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return enterpriseConfigMapper.getConfigByCorpIdAndAppType(corpId, appType);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package com.cool.store.dao;
|
|
||||||
|
|
||||||
import com.cool.store.entity.EnterpriseDO;
|
|
||||||
import com.cool.store.mapper.EnterpriseMapper;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @FileName: EnterpriseDAO
|
|
||||||
* @Description:
|
|
||||||
* @date 2023-05-23 13:52
|
|
||||||
*/
|
|
||||||
@Repository
|
|
||||||
public class EnterpriseDAO {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private EnterpriseMapper enterpriseMapper;
|
|
||||||
|
|
||||||
|
|
||||||
public EnterpriseDO getEnterpriseById(){
|
|
||||||
//return enterpriseMapper.getEnterpriseById(enterpriseId);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +1,12 @@
|
|||||||
package com.cool.store.dao;
|
package com.cool.store.dao;
|
||||||
|
|
||||||
import com.cool.store.entity.EnterpriseUserDO;
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
import com.cool.store.enums.UserSelectRangeEnum;
|
|
||||||
import com.cool.store.enums.UserStatusEnum;
|
|
||||||
import com.cool.store.mapper.EnterpriseUserMapper;
|
import com.cool.store.mapper.EnterpriseUserMapper;
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zhangchenbiao
|
* @author zhangchenbiao
|
||||||
@@ -32,111 +26,16 @@ public class EnterpriseUserDAO {
|
|||||||
return enterpriseUserMapper.getUserInfoById(userId);
|
return enterpriseUserMapper.getUserInfoById(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void batchInsertOrUpdate(List<EnterpriseUserDO> users) {
|
public void batchInsertOrUpdate(List<EnterpriseUserDO> collect) {
|
||||||
List<EnterpriseUserDO> result = new ArrayList<>();
|
|
||||||
users.forEach(user -> {
|
|
||||||
if (StringUtils.isBlank(user.getUnionid()) || StringUtils.isBlank(user.getUserId())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (StringUtils.isBlank(user.getName())) {
|
|
||||||
user.setName(user.getUserId());
|
|
||||||
}
|
|
||||||
result.add(user);
|
|
||||||
});
|
|
||||||
enterpriseUserMapper.batchInsertOrUpdate(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void batchUpdateDiffUserDiffRegionIds(List<EnterpriseUserDO> enterpriseUserList) {
|
public void insertEnterpriseUser(EnterpriseUserDO enterpriseUser) {
|
||||||
if(CollectionUtils.isEmpty(enterpriseUserList)){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
enterpriseUserMapper.batchUpdateDiffUserDiffRegionIds(enterpriseUserList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EnterpriseUserDO> fuzzyUsersByDepartment(
|
public void updateEnterpriseUser(EnterpriseUserDO enterpriseUser) {
|
||||||
String deptId,
|
|
||||||
Long roleId,
|
|
||||||
String orderBy,
|
|
||||||
String orderRule,
|
|
||||||
String userName,
|
|
||||||
String jobnumber,
|
|
||||||
Integer userStatus,
|
|
||||||
List<String> userIdList,
|
|
||||||
String regionId){
|
|
||||||
return enterpriseUserMapper.fuzzyUsersByDepartment(deptId, roleId, orderBy, orderRule, userName, jobnumber, userStatus, userIdList, regionId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EnterpriseUserDO> fuzzyUsersByNotRole(
|
public List<String> getMainAdminUserIds() {
|
||||||
String deptId,
|
return null;
|
||||||
String orderBy,
|
|
||||||
String orderRule,
|
|
||||||
String userName,
|
|
||||||
String jobnumber,
|
|
||||||
Integer userStatus,
|
|
||||||
List<String> userIdList,
|
|
||||||
String regionId){
|
|
||||||
return enterpriseUserMapper.fuzzyUsersByNotRole(deptId, orderBy, orderRule, userName, jobnumber, userStatus, userIdList, regionId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<EnterpriseUserDO> selectUsersByUserIds(List<String> userIds) {
|
|
||||||
return enterpriseUserMapper.selectUsersByUserIds(userIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<EnterpriseUserDO> listUserByGroupId(String groupId, String userName, List<String> userIdList){
|
|
||||||
if(StringUtils.isAnyBlank(groupId)){
|
|
||||||
return Lists.newArrayList();
|
|
||||||
}
|
|
||||||
return enterpriseUserMapper.listUserByGroupId(groupId, userName, userIdList);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<EnterpriseUserDO> listByRegionIdList(List<String> regionIdList){
|
|
||||||
if(CollectionUtils.isEmpty(regionIdList)){
|
|
||||||
return Lists.newArrayList();
|
|
||||||
}
|
|
||||||
return enterpriseUserMapper.listByRegionIdList(regionIdList);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean insertEnterpriseUser(EnterpriseUserDO entity) {
|
|
||||||
if(Objects.isNull(entity.getUserStatus())){
|
|
||||||
entity.setUserStatus(UserStatusEnum.NORMAL.getCode());
|
|
||||||
}
|
|
||||||
if(Objects.isNull(entity.getActive())){
|
|
||||||
entity.setActive(true);
|
|
||||||
}
|
|
||||||
if(StringUtils.isBlank(entity.getThirdOaUniqueFlag())){
|
|
||||||
entity.setThirdOaUniqueFlag(null);
|
|
||||||
}
|
|
||||||
entity.setSubordinateRange(UserSelectRangeEnum.ALL.getCode());
|
|
||||||
if (StringUtils.isBlank(entity.getUnionid()) || StringUtils.isBlank(entity.getUserId())) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (StringUtils.isBlank(entity.getName())) {
|
|
||||||
entity.setName(entity.getUserId());
|
|
||||||
}
|
|
||||||
enterpriseUserMapper.insertEnterpriseUser(entity);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateEnterpriseUser(EnterpriseUserDO enterpriseUser){
|
|
||||||
if(Objects.isNull(enterpriseUser)){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
enterpriseUserMapper.updateEnterpriseUser(enterpriseUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getMainAdminUserIds(){
|
|
||||||
return enterpriseUserMapper.getMainAdminUserIds();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> selectSpecifyNodeUserIds( String dingDeptId) {
|
|
||||||
return enterpriseUserMapper.selectSpecifyNodeUserIds(dingDeptId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> selectAllUserId() {
|
|
||||||
return enterpriseUserMapper.selectAllUserIds();
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnterpriseUserDO selectByUserIdIgnoreActive(String userId) {
|
|
||||||
return enterpriseUserMapper.selectByUserIdIgnoreActive(userId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package com.cool.store.mapper;
|
|
||||||
|
|
||||||
import com.cool.store.entity.EnterpriseConfigDO;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @date 2023-05-18 11:09
|
|
||||||
*/
|
|
||||||
public interface EnterpriseConfigMapper {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据企业id获取config
|
|
||||||
* @param enterpriseId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
EnterpriseConfigDO selectByEnterpriseId(@Param("enterpriseId") String enterpriseId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取dbServer
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<EnterpriseConfigDO> getDistinctDbServer();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据dbName 获取数据库信息
|
|
||||||
* @param dbName
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
EnterpriseConfigDO getDbInfoByDbName(@Param("dbName")String dbName);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据corpId 和 appType 获取config信息
|
|
||||||
* @param corpId
|
|
||||||
* @param appType
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
EnterpriseConfigDO getConfigByCorpIdAndAppType(@Param("corpId")String corpId, @Param("appType")String appType);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
package com.cool.store.mapper;
|
|
||||||
|
|
||||||
import com.cool.store.entity.EnterpriseDO;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @date 2023-05-23 11:36
|
|
||||||
*/
|
|
||||||
public interface EnterpriseMapper {
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 默认插入方法,只会给有值的字段赋值
|
|
||||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
|
||||||
* dateTime:2023-05-23 11:36
|
|
||||||
*/
|
|
||||||
int insertSelective(EnterpriseDO record);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
|
||||||
* dateTime:2023-05-23 11:36
|
|
||||||
*/
|
|
||||||
int updateByPrimaryKeySelective(EnterpriseDO record);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取企业信息
|
|
||||||
* @param enterpriseId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
EnterpriseDO getEnterpriseById(@Param("id") String id);
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
package com.cool.store.mapper;
|
|
||||||
|
|
||||||
import com.cool.store.dto.enterprise.EnterpriseUserDTO;
|
|
||||||
import com.cool.store.entity.EnterpriseUserDO;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @date 2023-05-19 02:58
|
|
||||||
*/
|
|
||||||
public interface EnterpriseUserMapper {
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 默认插入方法,只会给有值的字段赋值
|
|
||||||
* 会对传进来的字段做判空处理,如果字段为空,则使用数据库默认字段或者null
|
|
||||||
* dateTime:2023-05-19 02:58
|
|
||||||
*/
|
|
||||||
int insertSelective(@Param("record") EnterpriseUserDO record);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
|
||||||
* dateTime:2023-05-19 02:58
|
|
||||||
*/
|
|
||||||
int updateByPrimaryKeySelective(@Param("record") EnterpriseUserDO record);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param enterpriseId
|
|
||||||
* @param userId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
EnterpriseUserDO getUserInfoById(@Param("userId")String userId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量插入或更新
|
|
||||||
* @param enterpriseId
|
|
||||||
* @param users
|
|
||||||
*/
|
|
||||||
void batchInsertOrUpdate(@Param("list") List<EnterpriseUserDO> users);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量更新不同用户 不同的userRegionids
|
|
||||||
* @param eid
|
|
||||||
* @param enterpriseUserDOList
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
Boolean batchUpdateDiffUserDiffRegionIds(@Param("list") List<EnterpriseUserDO> enterpriseUserDOList);
|
|
||||||
|
|
||||||
List<EnterpriseUserDO> fuzzyUsersByDepartment(@Param("deptId") String deptId,
|
|
||||||
@Param("roleId") Long roleId,
|
|
||||||
@Param("orderBy") String orderBy,
|
|
||||||
@Param("orderRule") String orderRule,
|
|
||||||
@Param("userName") String userName,
|
|
||||||
@Param("jobNumber") String jobnumber,
|
|
||||||
@Param("userStatus") Integer userStatus,
|
|
||||||
@Param("userIdList") List<String> userIdList,
|
|
||||||
@Param("regionId") String regionId);
|
|
||||||
|
|
||||||
List<EnterpriseUserDO> fuzzyUsersByNotRole(@Param("deptId") String deptId,
|
|
||||||
@Param("orderBy") String orderBy,
|
|
||||||
@Param("orderRule") String orderRule,
|
|
||||||
@Param("userName") String userName,
|
|
||||||
@Param("jobNumber") String jobnumber,
|
|
||||||
@Param("userStatus") Integer userStatus,
|
|
||||||
@Param("userIdList") List<String> userIdList,
|
|
||||||
@Param("regionId") String regionId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据用户id数组获取用户
|
|
||||||
* @param eid
|
|
||||||
* @param userIds
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<EnterpriseUserDO> selectUsersByUserIds(@Param("userIds") List<String> userIds);
|
|
||||||
|
|
||||||
|
|
||||||
List<EnterpriseUserDO> listUserByGroupId(@Param("groupId") String groupId,
|
|
||||||
@Param("userName") String userName,
|
|
||||||
@Param("userIdList") List<String> userIdList);
|
|
||||||
|
|
||||||
List<EnterpriseUserDO> listByRegionIdList(@Param("regionIdList") List<String> regionIdList);
|
|
||||||
|
|
||||||
void updateEnterpriseUser(@Param("enterpriseUserDO") EnterpriseUserDO enterpriseUserDO);
|
|
||||||
|
|
||||||
|
|
||||||
List<String> getMainAdminUserIds();
|
|
||||||
|
|
||||||
List<String> selectSpecifyNodeUserIds(@Param("dingDeptId") String dingDeptId);
|
|
||||||
|
|
||||||
List<String> selectAllUserIds();
|
|
||||||
|
|
||||||
EnterpriseUserDO selectByUserIdIgnoreActive(@Param("userId") String userId);
|
|
||||||
|
|
||||||
void insertEnterpriseUser(@Param("entity") EnterpriseUserDO entity);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
<?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.cool.store.mapper.EnterpriseConfigMapper">
|
|
||||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.EnterpriseConfigDO">
|
|
||||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
|
||||||
<result column="current_package" jdbcType="BIGINT" property="currentPackage"/>
|
|
||||||
<result column="enterprise_id" jdbcType="VARCHAR" property="enterpriseId"/>
|
|
||||||
<result column="staff_count" jdbcType="INTEGER" property="staffCount"/>
|
|
||||||
<result column="db_source_name" jdbcType="VARCHAR" property="dbSourceName"/>
|
|
||||||
<result column="db_server" jdbcType="VARCHAR" property="dbServer"/>
|
|
||||||
<result column="db_port" jdbcType="INTEGER" property="dbPort"/>
|
|
||||||
<result column="db_name" jdbcType="VARCHAR" property="dbName"/>
|
|
||||||
<result column="db_user" jdbcType="VARCHAR" property="dbUser"/>
|
|
||||||
<result column="db_pwd" jdbcType="VARCHAR" property="dbPwd"/>
|
|
||||||
<result column="license" jdbcType="VARCHAR" property="license"/>
|
|
||||||
<result column="license_expires" jdbcType="TIMESTAMP" property="licenseExpires"/>
|
|
||||||
<result column="license_type" jdbcType="INTEGER" property="licenseType"/>
|
|
||||||
<result column="ding_corp_id" jdbcType="VARCHAR" property="dingCorpId"/>
|
|
||||||
<result column="ding_corp_secret" jdbcType="VARCHAR" property="dingCorpSecret"/>
|
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
||||||
<result column="create_user" jdbcType="VARCHAR" property="createUser"/>
|
|
||||||
<result column="main_corp_id" jdbcType="VARCHAR" property="mainCorpId"/>
|
|
||||||
<result column="app_type" jdbcType="VARCHAR" property="appType"/>
|
|
||||||
<result column="permanent_code" jdbcType="VARCHAR" property="permanentCode"/>
|
|
||||||
<result column="agentid" jdbcType="VARCHAR" property="agentid"/>
|
|
||||||
<result column="cool_college_enterprise_id" jdbcType="VARCHAR" property="coolCollegeEnterpriseId"/>
|
|
||||||
<result column="cool_college_secret" jdbcType="VARCHAR" property="coolCollegeSecret"/>
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
id, current_package, enterprise_id, staff_count, db_source_name, db_server, db_port,
|
|
||||||
db_name, db_user, db_pwd, license, license_expires, license_type, ding_corp_id, ding_corp_secret,
|
|
||||||
create_time, create_user, main_corp_id, app_type, permanent_code, agentid, cool_college_enterprise_id,
|
|
||||||
cool_college_secret
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<select id="selectByEnterpriseId" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
from
|
|
||||||
enterprise_config
|
|
||||||
where
|
|
||||||
enterprise_id = #{enterpriseId}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getDistinctDbServer" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
distinct db_server, db_port, db_user, db_pwd, db_name
|
|
||||||
from
|
|
||||||
enterprise_config
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getDbInfoByDbName" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
db_server, db_port, db_user, db_pwd
|
|
||||||
from
|
|
||||||
enterprise_config
|
|
||||||
where
|
|
||||||
db_name = #{dbName} limit 1
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getConfigByCorpIdAndAppType" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
from
|
|
||||||
enterprise_config
|
|
||||||
where
|
|
||||||
ding_corp_id = #{corpId} and app_type = #{appType}
|
|
||||||
</select>
|
|
||||||
</mapper>
|
|
||||||
@@ -1,295 +0,0 @@
|
|||||||
<?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.cool.store.mapper.EnterpriseMapper">
|
|
||||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.EnterpriseDO">
|
|
||||||
<id column="id" jdbcType="VARCHAR" property="id"/>
|
|
||||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
|
||||||
<result column="original_name" jdbcType="VARCHAR" property="originalName"/>
|
|
||||||
<result column="mobile" jdbcType="CHAR" property="mobile"/>
|
|
||||||
<result column="province" jdbcType="VARCHAR" property="province"/>
|
|
||||||
<result column="city" jdbcType="VARCHAR" property="city"/>
|
|
||||||
<result column="status" jdbcType="INTEGER" property="status"/>
|
|
||||||
<result column="logo" jdbcType="VARCHAR" property="logo"/>
|
|
||||||
<result column="is_vip" jdbcType="INTEGER" property="isVip"/>
|
|
||||||
<result column="auth_type" jdbcType="INTEGER" property="authType"/>
|
|
||||||
<result column="auth_user_id" jdbcType="VARCHAR" property="authUserId"/>
|
|
||||||
<result column="industry" jdbcType="VARCHAR" property="industry"/>
|
|
||||||
<result column="logo_name" jdbcType="VARCHAR" property="logoName"/>
|
|
||||||
<result column="corp_logo_url" jdbcType="VARCHAR" property="corpLogoUrl"/>
|
|
||||||
<result column="is_authenticated" jdbcType="INTEGER" property="isAuthenticated"/>
|
|
||||||
<result column="auth_level" jdbcType="INTEGER" property="authLevel"/>
|
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
||||||
<result column="package_begin_date" jdbcType="TIMESTAMP" property="packageBeginDate"/>
|
|
||||||
<result column="package_end_date" jdbcType="TIMESTAMP" property="packageEndDate"/>
|
|
||||||
<result column="aliyun_person_group_crop_id" jdbcType="VARCHAR" property="aliyunPersonGroupCropId"/>
|
|
||||||
<result column="app_type" jdbcType="VARCHAR" property="appType"/>
|
|
||||||
<result column="tag" jdbcType="VARCHAR" property="tag"/>
|
|
||||||
<result column="dataware_config" jdbcType="VARCHAR" property="datawareConfig"/>
|
|
||||||
<result column="is_leave_info" jdbcType="BIT" property="isLeaveInfo"/>
|
|
||||||
<result column="limit_store_count" jdbcType="INTEGER" property="limitStoreCount"/>
|
|
||||||
<result column="limit_device_count" jdbcType="INTEGER" property="limitDeviceCount"/>
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
id, name, original_name, mobile, province, city, status, logo, is_vip, auth_type,
|
|
||||||
auth_user_id, industry, logo_name, corp_logo_url, is_authenticated, auth_level, create_time,
|
|
||||||
update_time, package_begin_date, package_end_date, aliyun_person_group_crop_id, app_type,
|
|
||||||
tag, dataware_config, is_leave_info, limit_store_count, limit_device_count
|
|
||||||
</sql>
|
|
||||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
|
||||||
insert into enterprise
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="name != null">
|
|
||||||
name,
|
|
||||||
</if>
|
|
||||||
<if test="originalName != null">
|
|
||||||
original_name,
|
|
||||||
</if>
|
|
||||||
<if test="mobile != null">
|
|
||||||
mobile,
|
|
||||||
</if>
|
|
||||||
<if test="province != null">
|
|
||||||
province,
|
|
||||||
</if>
|
|
||||||
<if test="city != null">
|
|
||||||
city,
|
|
||||||
</if>
|
|
||||||
<if test="status != null">
|
|
||||||
status,
|
|
||||||
</if>
|
|
||||||
<if test="logo != null">
|
|
||||||
logo,
|
|
||||||
</if>
|
|
||||||
<if test="isVip != null">
|
|
||||||
is_vip,
|
|
||||||
</if>
|
|
||||||
<if test="authType != null">
|
|
||||||
auth_type,
|
|
||||||
</if>
|
|
||||||
<if test="authUserId != null">
|
|
||||||
auth_user_id,
|
|
||||||
</if>
|
|
||||||
<if test="industry != null">
|
|
||||||
industry,
|
|
||||||
</if>
|
|
||||||
<if test="logoName != null">
|
|
||||||
logo_name,
|
|
||||||
</if>
|
|
||||||
<if test="corpLogoUrl != null">
|
|
||||||
corp_logo_url,
|
|
||||||
</if>
|
|
||||||
<if test="isAuthenticated != null">
|
|
||||||
is_authenticated,
|
|
||||||
</if>
|
|
||||||
<if test="authLevel != null">
|
|
||||||
auth_level,
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
create_time,
|
|
||||||
</if>
|
|
||||||
<if test="updateTime != null">
|
|
||||||
update_time,
|
|
||||||
</if>
|
|
||||||
<if test="packageBeginDate != null">
|
|
||||||
package_begin_date,
|
|
||||||
</if>
|
|
||||||
<if test="packageEndDate != null">
|
|
||||||
package_end_date,
|
|
||||||
</if>
|
|
||||||
<if test="aliyunPersonGroupCropId != null">
|
|
||||||
aliyun_person_group_crop_id,
|
|
||||||
</if>
|
|
||||||
<if test="appType != null">
|
|
||||||
app_type,
|
|
||||||
</if>
|
|
||||||
<if test="tag != null">
|
|
||||||
tag,
|
|
||||||
</if>
|
|
||||||
<if test="datawareConfig != null">
|
|
||||||
dataware_config,
|
|
||||||
</if>
|
|
||||||
<if test="isLeaveInfo != null">
|
|
||||||
is_leave_info,
|
|
||||||
</if>
|
|
||||||
<if test="limitStoreCount != null">
|
|
||||||
limit_store_count,
|
|
||||||
</if>
|
|
||||||
<if test="limitDeviceCount != null">
|
|
||||||
limit_device_count,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="name != null">
|
|
||||||
#{name},
|
|
||||||
</if>
|
|
||||||
<if test="originalName != null">
|
|
||||||
#{originalName},
|
|
||||||
</if>
|
|
||||||
<if test="mobile != null">
|
|
||||||
#{mobile},
|
|
||||||
</if>
|
|
||||||
<if test="province != null">
|
|
||||||
#{province},
|
|
||||||
</if>
|
|
||||||
<if test="city != null">
|
|
||||||
#{city},
|
|
||||||
</if>
|
|
||||||
<if test="status != null">
|
|
||||||
#{status},
|
|
||||||
</if>
|
|
||||||
<if test="logo != null">
|
|
||||||
#{logo},
|
|
||||||
</if>
|
|
||||||
<if test="isVip != null">
|
|
||||||
#{isVip},
|
|
||||||
</if>
|
|
||||||
<if test="authType != null">
|
|
||||||
#{authType},
|
|
||||||
</if>
|
|
||||||
<if test="authUserId != null">
|
|
||||||
#{authUserId},
|
|
||||||
</if>
|
|
||||||
<if test="industry != null">
|
|
||||||
#{industry},
|
|
||||||
</if>
|
|
||||||
<if test="logoName != null">
|
|
||||||
#{logoName},
|
|
||||||
</if>
|
|
||||||
<if test="corpLogoUrl != null">
|
|
||||||
#{corpLogoUrl},
|
|
||||||
</if>
|
|
||||||
<if test="isAuthenticated != null">
|
|
||||||
#{isAuthenticated},
|
|
||||||
</if>
|
|
||||||
<if test="authLevel != null">
|
|
||||||
#{authLevel},
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
#{createTime},
|
|
||||||
</if>
|
|
||||||
<if test="updateTime != null">
|
|
||||||
#{updateTime},
|
|
||||||
</if>
|
|
||||||
<if test="packageBeginDate != null">
|
|
||||||
#{packageBeginDate},
|
|
||||||
</if>
|
|
||||||
<if test="packageEndDate != null">
|
|
||||||
#{packageEndDate},
|
|
||||||
</if>
|
|
||||||
<if test="aliyunPersonGroupCropId != null">
|
|
||||||
#{aliyunPersonGroupCropId},
|
|
||||||
</if>
|
|
||||||
<if test="appType != null">
|
|
||||||
#{appType},
|
|
||||||
</if>
|
|
||||||
<if test="tag != null">
|
|
||||||
#{tag},
|
|
||||||
</if>
|
|
||||||
<if test="datawareConfig != null">
|
|
||||||
#{datawareConfig},
|
|
||||||
</if>
|
|
||||||
<if test="isLeaveInfo != null">
|
|
||||||
#{isLeaveInfo},
|
|
||||||
</if>
|
|
||||||
<if test="limitStoreCount != null">
|
|
||||||
#{limitStoreCount},
|
|
||||||
</if>
|
|
||||||
<if test="limitDeviceCount != null">
|
|
||||||
#{limitDeviceCount},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
<update id="updateByPrimaryKeySelective">
|
|
||||||
update enterprise
|
|
||||||
<set>
|
|
||||||
<if test="name != null">
|
|
||||||
name = #{name},
|
|
||||||
</if>
|
|
||||||
<if test="originalName != null">
|
|
||||||
original_name = #{originalName},
|
|
||||||
</if>
|
|
||||||
<if test="mobile != null">
|
|
||||||
mobile = #{mobile},
|
|
||||||
</if>
|
|
||||||
<if test="province != null">
|
|
||||||
province = #{province},
|
|
||||||
</if>
|
|
||||||
<if test="city != null">
|
|
||||||
city = #{city},
|
|
||||||
</if>
|
|
||||||
<if test="status != null">
|
|
||||||
status = #{status},
|
|
||||||
</if>
|
|
||||||
<if test="logo != null">
|
|
||||||
logo = #{logo},
|
|
||||||
</if>
|
|
||||||
<if test="isVip != null">
|
|
||||||
is_vip = #{isVip},
|
|
||||||
</if>
|
|
||||||
<if test="authType != null">
|
|
||||||
auth_type = #{authType},
|
|
||||||
</if>
|
|
||||||
<if test="authUserId != null">
|
|
||||||
auth_user_id = #{authUserId},
|
|
||||||
</if>
|
|
||||||
<if test="industry != null">
|
|
||||||
industry = #{industry},
|
|
||||||
</if>
|
|
||||||
<if test="logoName != null">
|
|
||||||
logo_name = #{logoName},
|
|
||||||
</if>
|
|
||||||
<if test="corpLogoUrl != null">
|
|
||||||
corp_logo_url = #{corpLogoUrl},
|
|
||||||
</if>
|
|
||||||
<if test="isAuthenticated != null">
|
|
||||||
is_authenticated = #{isAuthenticated},
|
|
||||||
</if>
|
|
||||||
<if test="authLevel != null">
|
|
||||||
auth_level = #{authLevel},
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
create_time = #{createTime},
|
|
||||||
</if>
|
|
||||||
<if test="updateTime != null">
|
|
||||||
update_time = #{updateTime},
|
|
||||||
</if>
|
|
||||||
<if test="packageBeginDate != null">
|
|
||||||
package_begin_date = #{packageBeginDate},
|
|
||||||
</if>
|
|
||||||
<if test="packageEndDate != null">
|
|
||||||
package_end_date = #{packageEndDate},
|
|
||||||
</if>
|
|
||||||
<if test="aliyunPersonGroupCropId != null">
|
|
||||||
aliyun_person_group_crop_id = #{aliyunPersonGroupCropId},
|
|
||||||
</if>
|
|
||||||
<if test="appType != null">
|
|
||||||
app_type = #{appType},
|
|
||||||
</if>
|
|
||||||
<if test="tag != null">
|
|
||||||
tag = #{tag},
|
|
||||||
</if>
|
|
||||||
<if test="datawareConfig != null">
|
|
||||||
dataware_config = #{datawareConfig},
|
|
||||||
</if>
|
|
||||||
<if test="isLeaveInfo != null">
|
|
||||||
is_leave_info = #{isLeaveInfo},
|
|
||||||
</if>
|
|
||||||
<if test="limitStoreCount != null">
|
|
||||||
limit_store_count = #{limitStoreCount},
|
|
||||||
</if>
|
|
||||||
<if test="limitDeviceCount != null">
|
|
||||||
limit_device_count = #{limitDeviceCount},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where id = #{id}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<select id="getEnterpriseById" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
from
|
|
||||||
enterprise
|
|
||||||
where
|
|
||||||
id = #{id}
|
|
||||||
</select>
|
|
||||||
</mapper>
|
|
||||||
@@ -1,888 +0,0 @@
|
|||||||
<?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.cool.store.mapper.EnterpriseUserMapper">
|
|
||||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.EnterpriseUserDO">
|
|
||||||
<id column="id" jdbcType="VARCHAR" property="id"/>
|
|
||||||
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
|
||||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
|
||||||
<result column="tel" jdbcType="VARCHAR" property="tel"/>
|
|
||||||
<result column="work_place" jdbcType="VARCHAR" property="workPlace"/>
|
|
||||||
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
|
||||||
<result column="mobile" jdbcType="VARCHAR" property="mobile"/>
|
|
||||||
<result column="email" jdbcType="VARCHAR" property="email"/>
|
|
||||||
<result column="org_email" jdbcType="VARCHAR" property="orgEmail"/>
|
|
||||||
<result column="active" jdbcType="BIT" property="active"/>
|
|
||||||
<result column="order_in_depts" jdbcType="VARCHAR" property="orderInDepts"/>
|
|
||||||
<result column="main_admin" jdbcType="TINYINT" property="mainAdmin"/>
|
|
||||||
<result column="is_admin" jdbcType="BIT" property="isAdmin"/>
|
|
||||||
<result column="is_boss" jdbcType="BIT" property="isBoss"/>
|
|
||||||
<result column="dingId" jdbcType="VARCHAR" property="dingid"/>
|
|
||||||
<result column="unionid" jdbcType="VARCHAR" property="unionid"/>
|
|
||||||
<result column="is_hide" jdbcType="BIT" property="isHide"/>
|
|
||||||
<result column="position" jdbcType="VARCHAR" property="position"/>
|
|
||||||
<result column="avatar" jdbcType="VARCHAR" property="avatar"/>
|
|
||||||
<result column="extattr" jdbcType="VARCHAR" property="extattr"/>
|
|
||||||
<result column="is_enterprise" jdbcType="BIT" property="isEnterprise"/>
|
|
||||||
<result column="roles" jdbcType="VARCHAR" property="roles"/>
|
|
||||||
<result column="is_leader" jdbcType="BIT" property="isLeader"/>
|
|
||||||
<result column="face_url" jdbcType="VARCHAR" property="faceUrl"/>
|
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
|
||||||
<result column="language" jdbcType="CHAR" property="language"/>
|
|
||||||
<result column="user_status" jdbcType="TINYINT" property="userStatus"/>
|
|
||||||
<result column="third_oa_unique_flag" jdbcType="VARCHAR" property="thirdOaUniqueFlag"/>
|
|
||||||
<result column="subordinate_change" jdbcType="TINYINT" property="subordinateChange"/>
|
|
||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
||||||
<result column="subordinate_range" jdbcType="VARCHAR" property="subordinateRange"/>
|
|
||||||
</resultMap>
|
|
||||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.EnterpriseUserDO">
|
|
||||||
<result column="is_leader_in_depts" jdbcType="LONGVARCHAR" property="isLeaderInDepts"/>
|
|
||||||
<result column="department" jdbcType="LONGVARCHAR" property="department"/>
|
|
||||||
<result column="jobnumber" jdbcType="LONGVARCHAR" property="jobnumber"/>
|
|
||||||
<result column="monitored_departments" jdbcType="LONGVARCHAR" property="monitoredDepartments"/>
|
|
||||||
<result column="departments" jdbcType="LONGVARCHAR" property="departments"/>
|
|
||||||
<result column="user_region_ids" jdbcType="LONGVARCHAR" property="userRegionIds"/>
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
id, user_id, name, tel, work_place, remark, mobile, email, org_email, active, order_in_depts,
|
|
||||||
main_admin, is_admin, is_boss, dingId, unionid, is_hide, position, avatar, extattr,
|
|
||||||
is_enterprise, roles, is_leader, face_url, create_time, language, user_status, third_oa_unique_flag,
|
|
||||||
subordinate_change, update_time, subordinate_range
|
|
||||||
</sql>
|
|
||||||
<sql id="Blob_Column_List">
|
|
||||||
is_leader_in_depts, department, jobnumber, monitored_departments, departments, user_region_ids
|
|
||||||
</sql>
|
|
||||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
|
||||||
insert into enterprise_user
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="record.userId != null">
|
|
||||||
user_id,
|
|
||||||
</if>
|
|
||||||
<if test="record.name != null">
|
|
||||||
name,
|
|
||||||
</if>
|
|
||||||
<if test="record.tel != null">
|
|
||||||
tel,
|
|
||||||
</if>
|
|
||||||
<if test="record.workPlace != null">
|
|
||||||
work_place,
|
|
||||||
</if>
|
|
||||||
<if test="record.remark != null">
|
|
||||||
remark,
|
|
||||||
</if>
|
|
||||||
<if test="record.mobile != null">
|
|
||||||
mobile,
|
|
||||||
</if>
|
|
||||||
<if test="record.email != null">
|
|
||||||
email,
|
|
||||||
</if>
|
|
||||||
<if test="record.orgEmail != null">
|
|
||||||
org_email,
|
|
||||||
</if>
|
|
||||||
<if test="record.active != null">
|
|
||||||
active,
|
|
||||||
</if>
|
|
||||||
<if test="record.orderInDepts != null">
|
|
||||||
order_in_depts,
|
|
||||||
</if>
|
|
||||||
<if test="record.mainAdmin != null">
|
|
||||||
main_admin,
|
|
||||||
</if>
|
|
||||||
<if test="record.isAdmin != null">
|
|
||||||
is_admin,
|
|
||||||
</if>
|
|
||||||
<if test="record.isBoss != null">
|
|
||||||
is_boss,
|
|
||||||
</if>
|
|
||||||
<if test="record.dingid != null">
|
|
||||||
dingId,
|
|
||||||
</if>
|
|
||||||
<if test="record.unionid != null">
|
|
||||||
unionid,
|
|
||||||
</if>
|
|
||||||
<if test="record.isHide != null">
|
|
||||||
is_hide,
|
|
||||||
</if>
|
|
||||||
<if test="record.position != null">
|
|
||||||
position,
|
|
||||||
</if>
|
|
||||||
<if test="record.avatar != null">
|
|
||||||
avatar,
|
|
||||||
</if>
|
|
||||||
<if test="record.extattr != null">
|
|
||||||
extattr,
|
|
||||||
</if>
|
|
||||||
<if test="record.isEnterprise != null">
|
|
||||||
is_enterprise,
|
|
||||||
</if>
|
|
||||||
<if test="record.roles != null">
|
|
||||||
roles,
|
|
||||||
</if>
|
|
||||||
<if test="record.isLeader != null">
|
|
||||||
is_leader,
|
|
||||||
</if>
|
|
||||||
<if test="record.faceUrl != null">
|
|
||||||
face_url,
|
|
||||||
</if>
|
|
||||||
<if test="record.createTime != null">
|
|
||||||
create_time,
|
|
||||||
</if>
|
|
||||||
<if test="record.language != null">
|
|
||||||
language,
|
|
||||||
</if>
|
|
||||||
<if test="record.userStatus != null">
|
|
||||||
user_status,
|
|
||||||
</if>
|
|
||||||
<if test="record.thirdOaUniqueFlag != null">
|
|
||||||
third_oa_unique_flag,
|
|
||||||
</if>
|
|
||||||
<if test="record.subordinateChange != null">
|
|
||||||
subordinate_change,
|
|
||||||
</if>
|
|
||||||
<if test="record.updateTime != null">
|
|
||||||
update_time,
|
|
||||||
</if>
|
|
||||||
<if test="record.subordinateRange != null">
|
|
||||||
subordinate_range,
|
|
||||||
</if>
|
|
||||||
<if test="record.isLeaderInDepts != null">
|
|
||||||
is_leader_in_depts,
|
|
||||||
</if>
|
|
||||||
<if test="record.department != null">
|
|
||||||
department,
|
|
||||||
</if>
|
|
||||||
<if test="record.jobnumber != null">
|
|
||||||
jobnumber,
|
|
||||||
</if>
|
|
||||||
<if test="record.monitoredDepartments != null">
|
|
||||||
monitored_departments,
|
|
||||||
</if>
|
|
||||||
<if test="record.departments != null">
|
|
||||||
departments,
|
|
||||||
</if>
|
|
||||||
<if test="record.userRegionIds != null">
|
|
||||||
user_region_ids,
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="record.userId != null">
|
|
||||||
#{record.userId},
|
|
||||||
</if>
|
|
||||||
<if test="record.name != null">
|
|
||||||
#{record.name},
|
|
||||||
</if>
|
|
||||||
<if test="record.tel != null">
|
|
||||||
#{record.tel},
|
|
||||||
</if>
|
|
||||||
<if test="record.workPlace != null">
|
|
||||||
#{record.workPlace},
|
|
||||||
</if>
|
|
||||||
<if test="record.remark != null">
|
|
||||||
#{record.remark},
|
|
||||||
</if>
|
|
||||||
<if test="record.mobile != null">
|
|
||||||
#{record.mobile},
|
|
||||||
</if>
|
|
||||||
<if test="record.email != null">
|
|
||||||
#{record.email},
|
|
||||||
</if>
|
|
||||||
<if test="record.orgEmail != null">
|
|
||||||
#{record.orgEmail},
|
|
||||||
</if>
|
|
||||||
<if test="record.active != null">
|
|
||||||
#{record.active},
|
|
||||||
</if>
|
|
||||||
<if test="record.orderInDepts != null">
|
|
||||||
#{record.orderInDepts},
|
|
||||||
</if>
|
|
||||||
<if test="record.mainAdmin != null">
|
|
||||||
#{record.mainAdmin},
|
|
||||||
</if>
|
|
||||||
<if test="record.isAdmin != null">
|
|
||||||
#{record.isAdmin},
|
|
||||||
</if>
|
|
||||||
<if test="record.isBoss != null">
|
|
||||||
#{record.isBoss},
|
|
||||||
</if>
|
|
||||||
<if test="record.dingid != null">
|
|
||||||
#{record.dingid},
|
|
||||||
</if>
|
|
||||||
<if test="record.unionid != null">
|
|
||||||
#{record.unionid},
|
|
||||||
</if>
|
|
||||||
<if test="record.isHide != null">
|
|
||||||
#{record.isHide},
|
|
||||||
</if>
|
|
||||||
<if test="record.position != null">
|
|
||||||
#{record.position},
|
|
||||||
</if>
|
|
||||||
<if test="record.avatar != null">
|
|
||||||
#{record.avatar},
|
|
||||||
</if>
|
|
||||||
<if test="record.extattr != null">
|
|
||||||
#{record.extattr},
|
|
||||||
</if>
|
|
||||||
<if test="record.isEnterprise != null">
|
|
||||||
#{record.isEnterprise},
|
|
||||||
</if>
|
|
||||||
<if test="record.roles != null">
|
|
||||||
#{record.roles},
|
|
||||||
</if>
|
|
||||||
<if test="record.isLeader != null">
|
|
||||||
#{record.isLeader},
|
|
||||||
</if>
|
|
||||||
<if test="record.faceUrl != null">
|
|
||||||
#{record.faceUrl},
|
|
||||||
</if>
|
|
||||||
<if test="record.createTime != null">
|
|
||||||
#{record.createTime},
|
|
||||||
</if>
|
|
||||||
<if test="record.language != null">
|
|
||||||
#{record.language},
|
|
||||||
</if>
|
|
||||||
<if test="record.userStatus != null">
|
|
||||||
#{record.userStatus},
|
|
||||||
</if>
|
|
||||||
<if test="record.thirdOaUniqueFlag != null">
|
|
||||||
#{record.thirdOaUniqueFlag},
|
|
||||||
</if>
|
|
||||||
<if test="record.subordinateChange != null">
|
|
||||||
#{record.subordinateChange},
|
|
||||||
</if>
|
|
||||||
<if test="record.updateTime != null">
|
|
||||||
#{record.updateTime},
|
|
||||||
</if>
|
|
||||||
<if test="record.subordinateRange != null">
|
|
||||||
#{record.subordinateRange},
|
|
||||||
</if>
|
|
||||||
<if test="record.isLeaderInDepts != null">
|
|
||||||
#{record.isLeaderInDepts},
|
|
||||||
</if>
|
|
||||||
<if test="record.department != null">
|
|
||||||
#{record.department},
|
|
||||||
</if>
|
|
||||||
<if test="record.jobnumber != null">
|
|
||||||
#{record.jobnumber},
|
|
||||||
</if>
|
|
||||||
<if test="record.monitoredDepartments != null">
|
|
||||||
#{record.monitoredDepartments},
|
|
||||||
</if>
|
|
||||||
<if test="record.departments != null">
|
|
||||||
#{record.departments},
|
|
||||||
</if>
|
|
||||||
<if test="record.userRegionIds != null">
|
|
||||||
#{record.userRegionIds},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
<update id="updateByPrimaryKeySelective">
|
|
||||||
update enterprise_user
|
|
||||||
<set>
|
|
||||||
<if test="record.userId != null">
|
|
||||||
user_id = #{record.userId},
|
|
||||||
</if>
|
|
||||||
<if test="record.name != null">
|
|
||||||
name = #{record.name},
|
|
||||||
</if>
|
|
||||||
<if test="record.tel != null">
|
|
||||||
tel = #{record.tel},
|
|
||||||
</if>
|
|
||||||
<if test="record.workPlace != null">
|
|
||||||
work_place = #{record.workPlace},
|
|
||||||
</if>
|
|
||||||
<if test="record.remark != null">
|
|
||||||
remark = #{record.remark},
|
|
||||||
</if>
|
|
||||||
<if test="record.mobile != null">
|
|
||||||
mobile = #{record.mobile},
|
|
||||||
</if>
|
|
||||||
<if test="record.email != null">
|
|
||||||
email = #{record.email},
|
|
||||||
</if>
|
|
||||||
<if test="record.orgEmail != null">
|
|
||||||
org_email = #{record.orgEmail},
|
|
||||||
</if>
|
|
||||||
<if test="record.active != null">
|
|
||||||
active = #{record.active},
|
|
||||||
</if>
|
|
||||||
<if test="record.orderInDepts != null">
|
|
||||||
order_in_depts = #{record.orderInDepts},
|
|
||||||
</if>
|
|
||||||
<if test="record.mainAdmin != null">
|
|
||||||
main_admin = #{record.mainAdmin},
|
|
||||||
</if>
|
|
||||||
<if test="record.isAdmin != null">
|
|
||||||
is_admin = #{record.isAdmin},
|
|
||||||
</if>
|
|
||||||
<if test="record.isBoss != null">
|
|
||||||
is_boss = #{record.isBoss},
|
|
||||||
</if>
|
|
||||||
<if test="record.dingid != null">
|
|
||||||
dingId = #{record.dingid},
|
|
||||||
</if>
|
|
||||||
<if test="record.unionid != null">
|
|
||||||
unionid = #{record.unionid},
|
|
||||||
</if>
|
|
||||||
<if test="record.isHide != null">
|
|
||||||
is_hide = #{record.isHide},
|
|
||||||
</if>
|
|
||||||
<if test="record.position != null">
|
|
||||||
position = #{record.position},
|
|
||||||
</if>
|
|
||||||
<if test="record.avatar != null">
|
|
||||||
avatar = #{record.avatar},
|
|
||||||
</if>
|
|
||||||
<if test="record.extattr != null">
|
|
||||||
extattr = #{record.extattr},
|
|
||||||
</if>
|
|
||||||
<if test="record.isEnterprise != null">
|
|
||||||
is_enterprise = #{record.isEnterprise},
|
|
||||||
</if>
|
|
||||||
<if test="record.roles != null">
|
|
||||||
roles = #{record.roles},
|
|
||||||
</if>
|
|
||||||
<if test="record.isLeader != null">
|
|
||||||
is_leader = #{record.isLeader},
|
|
||||||
</if>
|
|
||||||
<if test="record.faceUrl != null">
|
|
||||||
face_url = #{record.faceUrl},
|
|
||||||
</if>
|
|
||||||
<if test="record.createTime != null">
|
|
||||||
create_time = #{record.createTime},
|
|
||||||
</if>
|
|
||||||
<if test="record.language != null">
|
|
||||||
language = #{record.language},
|
|
||||||
</if>
|
|
||||||
<if test="record.userStatus != null">
|
|
||||||
user_status = #{record.userStatus},
|
|
||||||
</if>
|
|
||||||
<if test="record.thirdOaUniqueFlag != null">
|
|
||||||
third_oa_unique_flag = #{record.thirdOaUniqueFlag},
|
|
||||||
</if>
|
|
||||||
<if test="record.subordinateChange != null">
|
|
||||||
subordinate_change = #{record.subordinateChange},
|
|
||||||
</if>
|
|
||||||
<if test="record.updateTime != null">
|
|
||||||
update_time = #{record.updateTime},
|
|
||||||
</if>
|
|
||||||
<if test="record.subordinateRange != null">
|
|
||||||
subordinate_range = #{record.subordinateRange},
|
|
||||||
</if>
|
|
||||||
<if test="record.isLeaderInDepts != null">
|
|
||||||
is_leader_in_depts = #{record.isLeaderInDepts},
|
|
||||||
</if>
|
|
||||||
<if test="record.department != null">
|
|
||||||
department = #{record.department},
|
|
||||||
</if>
|
|
||||||
<if test="record.jobnumber != null">
|
|
||||||
jobnumber = #{record.jobnumber},
|
|
||||||
</if>
|
|
||||||
<if test="record.monitoredDepartments != null">
|
|
||||||
monitored_departments = #{record.monitoredDepartments},
|
|
||||||
</if>
|
|
||||||
<if test="record.departments != null">
|
|
||||||
departments = #{record.departments},
|
|
||||||
</if>
|
|
||||||
<if test="record.userRegionIds != null">
|
|
||||||
user_region_ids = #{record.userRegionIds},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where id = #{record.id}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<select id="getUserInfoById" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List"/>,
|
|
||||||
<include refid="Blob_Column_List"/>
|
|
||||||
from
|
|
||||||
enterprise_user
|
|
||||||
where
|
|
||||||
user_id = #{userId}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
<insert id="batchInsertOrUpdate" parameterType="java.util.List">
|
|
||||||
insert into enterprise_user (
|
|
||||||
id,
|
|
||||||
user_id,
|
|
||||||
`name`,
|
|
||||||
mobile,
|
|
||||||
email,
|
|
||||||
active,
|
|
||||||
order_in_depts,
|
|
||||||
main_admin,
|
|
||||||
is_admin,
|
|
||||||
is_boss,
|
|
||||||
dingId,
|
|
||||||
unionid,
|
|
||||||
is_leader_in_depts,
|
|
||||||
is_hide,
|
|
||||||
departments,
|
|
||||||
`position`,
|
|
||||||
avatar,
|
|
||||||
jobnumber,
|
|
||||||
extattr,
|
|
||||||
roles,
|
|
||||||
is_leader,
|
|
||||||
create_time
|
|
||||||
) values
|
|
||||||
|
|
||||||
<foreach collection="list" item="it" separator=",">
|
|
||||||
|
|
||||||
(
|
|
||||||
#{it.id, jdbcType=VARCHAR},
|
|
||||||
#{it.userId, jdbcType=VARCHAR},
|
|
||||||
#{it.name, jdbcType=VARCHAR},
|
|
||||||
#{it.mobile, jdbcType=VARCHAR},
|
|
||||||
#{it.email, jdbcType=VARCHAR},
|
|
||||||
#{it.active, jdbcType=BOOLEAN},
|
|
||||||
#{it.orderInDepts, jdbcType=VARCHAR},
|
|
||||||
#{it.mainAdmin, jdbcType=BOOLEAN},
|
|
||||||
#{it.isAdmin, jdbcType=BOOLEAN},
|
|
||||||
#{it.isBoss, jdbcType=BOOLEAN},
|
|
||||||
#{it.dingid, jdbcType=VARCHAR},
|
|
||||||
#{it.unionid, jdbcType=VARCHAR},
|
|
||||||
#{it.isLeaderInDepts, jdbcType=VARCHAR},
|
|
||||||
#{it.isHide, jdbcType=BOOLEAN},
|
|
||||||
#{it.departments, jdbcType=VARCHAR},
|
|
||||||
#{it.position, jdbcType=VARCHAR},
|
|
||||||
#{it.avatar, jdbcType=VARCHAR},
|
|
||||||
#{it.jobnumber, jdbcType=VARCHAR},
|
|
||||||
#{it.extattr, jdbcType=VARCHAR},
|
|
||||||
#{it.roles, jdbcType=VARCHAR},
|
|
||||||
#{it.isLeader, jdbcType=BOOLEAN},
|
|
||||||
sysdate()
|
|
||||||
)
|
|
||||||
</foreach>
|
|
||||||
ON DUPLICATE KEY UPDATE
|
|
||||||
departments=values(departments),
|
|
||||||
`name`=values(name),
|
|
||||||
main_admin=values(main_admin),
|
|
||||||
is_admin=values(is_admin),
|
|
||||||
mobile = values(mobile),
|
|
||||||
order_in_depts=values(order_in_depts),
|
|
||||||
is_leader_in_depts=values(is_leader_in_depts),
|
|
||||||
avatar=values(avatar),
|
|
||||||
active=values(active),
|
|
||||||
`position`=values(position),
|
|
||||||
roles=values(roles),
|
|
||||||
jobnumber=values(jobnumber)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="batchUpdateDiffUserDiffRegionIds">
|
|
||||||
update enterprise_user
|
|
||||||
set user_region_ids =
|
|
||||||
<foreach collection="list" item="item" index="index" separator=" " open="case user_id" close="end">
|
|
||||||
when #{item.userId} then #{item.userRegionIds}
|
|
||||||
</foreach>
|
|
||||||
where user_id in
|
|
||||||
<foreach collection="list" item="item" index="index" separator="," open="(" close=")">
|
|
||||||
#{item.userId}
|
|
||||||
</foreach>
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<select id="fuzzyUsersByDepartment" resultType="com.cool.store.entity.EnterpriseUserDO">
|
|
||||||
select
|
|
||||||
u.user_id as userId,
|
|
||||||
u.name as name,
|
|
||||||
u.roles as roles,
|
|
||||||
u.jobnumber as jobnumber,
|
|
||||||
u.remark as remark,
|
|
||||||
u.mobile as mobile,
|
|
||||||
u.email as email,
|
|
||||||
u.org_email as orgEmail,
|
|
||||||
u.avatar as avatar,
|
|
||||||
u.user_status as userStatus,
|
|
||||||
u.unionid as unionid
|
|
||||||
from enterprise_user u
|
|
||||||
left join enterprise_user_role ul on u.user_id=ul.user_id
|
|
||||||
left join sys_role r on ul.role_id=r.id
|
|
||||||
<where>
|
|
||||||
u.active = true and u.user_id != 'a100000001'
|
|
||||||
<if test="deptId !=null and deptId !=''">
|
|
||||||
and u.departments like concat('%/',#{deptId},'/%')
|
|
||||||
</if>
|
|
||||||
<if test="userName !=null and userName !=''">
|
|
||||||
and u.name like concat('%',#{userName},'%')
|
|
||||||
</if>
|
|
||||||
<if test="jobNumber !=null and jobNumber !=''">
|
|
||||||
and u.jobnumber = #{jobNumber}
|
|
||||||
</if>
|
|
||||||
<if test="roleId !=null ">
|
|
||||||
and r.id=#{roleId}
|
|
||||||
</if>
|
|
||||||
<if test="userStatus !=null ">
|
|
||||||
and u.user_status=#{userStatus}
|
|
||||||
</if>
|
|
||||||
<if test="regionId !=null and regionId !=''">
|
|
||||||
and user_region_ids like concat('%/',#{regionId},'/%')
|
|
||||||
</if>
|
|
||||||
<if test="userIdList != null and userIdList.size > 0">
|
|
||||||
and u.user_id in
|
|
||||||
<foreach collection="userIdList" item="userId" separator="," open="(" close=")">
|
|
||||||
#{userId}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
GROUP BY u.user_id
|
|
||||||
<if test="orderBy != null and orderBy != '' ">
|
|
||||||
order by u.${orderBy} ${orderRule}
|
|
||||||
</if>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
<select id="fuzzyUsersByNotRole" resultType="com.cool.store.entity.EnterpriseUserDO">
|
|
||||||
select
|
|
||||||
user_id as userId,
|
|
||||||
name as name,
|
|
||||||
jobnumber as jobnumber,
|
|
||||||
remark as remark,
|
|
||||||
mobile as mobile,
|
|
||||||
email as email,
|
|
||||||
org_email as orgEmail,
|
|
||||||
avatar as avatar,
|
|
||||||
roles as roles,
|
|
||||||
departments as departments,
|
|
||||||
user_status as userStatus,
|
|
||||||
unionid
|
|
||||||
from enterprise_user
|
|
||||||
<where>
|
|
||||||
active = true and user_id != 'a100000001'
|
|
||||||
<if test="deptId !=null and deptId !=''">
|
|
||||||
and departments like concat('%/',#{deptId},'/%')
|
|
||||||
</if>
|
|
||||||
<if test="userName !=null and userName !=''">
|
|
||||||
and name like concat('%',#{userName},'%')
|
|
||||||
</if>
|
|
||||||
<if test="jobNumber !=null and jobNumber !=''">
|
|
||||||
and jobnumber = #{jobNumber}
|
|
||||||
</if>
|
|
||||||
<if test="userStatus !=null">
|
|
||||||
and user_status = #{userStatus}
|
|
||||||
</if>
|
|
||||||
<if test="regionId !=null and regionId !=''">
|
|
||||||
and user_region_ids like concat('%/',#{regionId},'/%')
|
|
||||||
</if>
|
|
||||||
<if test="userIdList != null and userIdList.size > 0">
|
|
||||||
and user_id in
|
|
||||||
<foreach collection="userIdList" item="userId" separator="," open="(" close=")">
|
|
||||||
#{userId}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
|
|
||||||
</where>
|
|
||||||
ORDER BY user_id
|
|
||||||
<if test="orderBy != null and orderBy != '' ">
|
|
||||||
, ${orderBy}
|
|
||||||
</if>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectUsersByUserIds" resultType="com.cool.store.entity.EnterpriseUserDO">
|
|
||||||
select
|
|
||||||
id,
|
|
||||||
user_id as userId,
|
|
||||||
`name` as name,
|
|
||||||
avatar,
|
|
||||||
active,
|
|
||||||
mobile,
|
|
||||||
jobnumber,
|
|
||||||
`language`,
|
|
||||||
user_status as userStatus,
|
|
||||||
subordinate_range as subordinateRange
|
|
||||||
from enterprise_user
|
|
||||||
<where>
|
|
||||||
user_id != 'a100000001'
|
|
||||||
and
|
|
||||||
<if test="userIds.size()>0 and userIds!=null">or
|
|
||||||
user_id in
|
|
||||||
<foreach
|
|
||||||
collection="userIds" item="userId" separator="," open="(" close=")">
|
|
||||||
#{userId, jdbcType=VARCHAR}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="listUserByGroupId" resultType="com.cool.store.entity.EnterpriseUserDO">
|
|
||||||
select
|
|
||||||
u.user_id as userId,
|
|
||||||
u.name as name,
|
|
||||||
u.roles as roles,
|
|
||||||
u.jobnumber as jobnumber,
|
|
||||||
u.mobile as mobile,
|
|
||||||
u.email as email,
|
|
||||||
u.org_email as orgEmail,
|
|
||||||
u.avatar as avatar,
|
|
||||||
u.departments as departments,
|
|
||||||
u.user_status as userStatus,
|
|
||||||
u.unionid as unionid
|
|
||||||
from enterprise_user u
|
|
||||||
left join enterprise_user_group_mapping ug on u.user_id=ug.user_id
|
|
||||||
<where>
|
|
||||||
ug.group_id = #{groupId} and u.active = true and u.user_id != 'a100000001'
|
|
||||||
<if test="userName !=null and userName !=''">
|
|
||||||
and u.name like concat('%',#{userName},'%')
|
|
||||||
</if>
|
|
||||||
<if test="userIdList != null and userIdList.size > 0">
|
|
||||||
and u.user_id in
|
|
||||||
<foreach collection="userIdList" item="userId" separator="," open="(" close=")">
|
|
||||||
#{userId}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
GROUP BY u.user_id
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="listByRegionIdList" resultType="com.cool.store.entity.EnterpriseUserDO">
|
|
||||||
select
|
|
||||||
id as id,
|
|
||||||
user_id as userId,
|
|
||||||
`name` as name,
|
|
||||||
tel as tel,
|
|
||||||
work_place as workPlace,
|
|
||||||
remark as remark,
|
|
||||||
mobile as mobile,
|
|
||||||
email as email,
|
|
||||||
org_email as orgEmail,
|
|
||||||
active as active,
|
|
||||||
order_in_depts as orderInDepts,
|
|
||||||
is_admin as isAdmin,
|
|
||||||
is_boss as isBoss,
|
|
||||||
dingId as dingId,
|
|
||||||
unionid as unionid,
|
|
||||||
is_leader_in_depts as isLeaderInDepts,
|
|
||||||
is_hide as isHide,
|
|
||||||
`position` as position,
|
|
||||||
avatar as avatar,
|
|
||||||
jobnumber as jobnumber,
|
|
||||||
extattr as extattr,
|
|
||||||
is_enterprise as isEnterprise,
|
|
||||||
roles as roles,
|
|
||||||
monitored_departments as monitoredDepartments,
|
|
||||||
departments as departments,
|
|
||||||
is_leader as isLeader,
|
|
||||||
face_url as faceUrl,
|
|
||||||
create_time as createTime,
|
|
||||||
`language` as language
|
|
||||||
from enterprise_user where user_id != 'a100000001'
|
|
||||||
<foreach collection="regionIdList" item="regionId" separator=" or " open="and (" close=" )">
|
|
||||||
user_region_ids like concat('%/', #{regionId}, '/%')
|
|
||||||
</foreach>
|
|
||||||
order by id
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<update id="updateEnterpriseUser">
|
|
||||||
update enterprise_user
|
|
||||||
<set>
|
|
||||||
<if test="enterpriseUserDO.name != null and enterpriseUserDO.name !=''">`name` = #{enterpriseUserDO.name},</if>
|
|
||||||
<if test="enterpriseUserDO.tel != null and enterpriseUserDO.tel !=''">`tel` = #{enterpriseUserDO.tel},</if>
|
|
||||||
<if test="enterpriseUserDO.workPlace != null and enterpriseUserDO.workPlace !=''">`work_place` =
|
|
||||||
#{enterpriseUserDO.workPlace},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.mobile != null and enterpriseUserDO.mobile !=''">`mobile` =
|
|
||||||
#{enterpriseUserDO.mobile},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.email != null and enterpriseUserDO.email !=''">`email` = #{enterpriseUserDO.email},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.orgEmail != null and enterpriseUserDO.orgEmail !=''">`org_email` =
|
|
||||||
#{enterpriseUserDO.orgEmail},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.active != null">`active` =
|
|
||||||
#{enterpriseUserDO.active},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.orderInDepts != null and enterpriseUserDO.orderInDepts !=''">`order_in_depts` =
|
|
||||||
#{enterpriseUserDO.orderInDepts},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.mainAdmin != null">`main_admin` = #{enterpriseUserDO.mainAdmin},</if>
|
|
||||||
<if test="enterpriseUserDO.isAdmin != null">`is_admin` = #{enterpriseUserDO.isAdmin},</if>
|
|
||||||
<if test="enterpriseUserDO.isBoss != null">`is_boss` = #{enterpriseUserDO.isBoss},</if>
|
|
||||||
<if test="enterpriseUserDO.dingid != null and enterpriseUserDO.dingid !=''">`dingId` =
|
|
||||||
#{enterpriseUserDO.dingid},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.unionid != null and enterpriseUserDO.unionid !=''">`unionid` =
|
|
||||||
#{enterpriseUserDO.unionid},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.isLeaderInDepts != null and enterpriseUserDO.isLeaderInDepts !=''">
|
|
||||||
`is_leader_in_depts` = #{enterpriseUserDO.isLeaderInDepts},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.isHide != null">`is_hide` = #{enterpriseUserDO.isHide},</if>
|
|
||||||
|
|
||||||
<if test="enterpriseUserDO.position != null and enterpriseUserDO.position !=''">`position` =
|
|
||||||
#{enterpriseUserDO.position},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.avatar != null and enterpriseUserDO.avatar !=''">`avatar` =
|
|
||||||
#{enterpriseUserDO.avatar},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.jobnumber != null and enterpriseUserDO.jobnumber !=''">`jobnumber` =
|
|
||||||
#{enterpriseUserDO.jobnumber},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.extattr != null and enterpriseUserDO.extattr !=''">`extattr` =
|
|
||||||
#{enterpriseUserDO.extattr},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.isEnterprise != null">`is_enterprise` =
|
|
||||||
#{enterpriseUserDO.isEnterprise},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.roles != null and enterpriseUserDO.roles !=''">`roles` = #{enterpriseUserDO.roles},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.monitoredDepartments != null and enterpriseUserDO.monitoredDepartments !=''">`
|
|
||||||
monitored_departments` = #{enterpriseUserDO.monitoredDepartments},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.departments != null and enterpriseUserDO.departments !=''">`departments` =
|
|
||||||
#{enterpriseUserDO.departments},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.isLeader != null">`is_leader` = #{enterpriseUserDO.isLeader},</if>
|
|
||||||
<if test="enterpriseUserDO.faceUrl != null and enterpriseUserDO.faceUrl !=''">`face_url` =
|
|
||||||
#{enterpriseUserDO.faceUrl},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.createTime != null">`create_time` = #{enterpriseUserDO.createTime},</if>
|
|
||||||
<if test="enterpriseUserDO.language != null and enterpriseUserDO.language !=''">`language` =
|
|
||||||
#{enterpriseUserDO.language},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.userStatus != null">`user_status` =
|
|
||||||
#{enterpriseUserDO.userStatus},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.thirdOaUniqueFlag != null and enterpriseUserDO.thirdOaUniqueFlag !=''">`third_oa_unique_flag` =
|
|
||||||
#{enterpriseUserDO.thirdOaUniqueFlag},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.userRegionIds != null and enterpriseUserDO.userRegionIds !=''">
|
|
||||||
`user_region_ids` = #{enterpriseUserDO.userRegionIds},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.subordinateChange != null and enterpriseUserDO.subordinateChange !=''">
|
|
||||||
`subordinate_change` = #{enterpriseUserDO.subordinateChange},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.subordinateRange != null and enterpriseUserDO.subordinateRange !=''">
|
|
||||||
`subordinate_range` = #{enterpriseUserDO.subordinateRange},
|
|
||||||
</if>
|
|
||||||
<if test="enterpriseUserDO.remark != null and enterpriseUserDO.remark !=''">
|
|
||||||
`remark` = #{enterpriseUserDO.remark},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where user_id =#{enterpriseUserDO.userId}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<select id="getMainAdminUserIds" resultType="string">
|
|
||||||
select user_id from enterprise_user where main_admin = true and active = true
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectSpecifyNodeUserIds" resultType="string">
|
|
||||||
select
|
|
||||||
user_id
|
|
||||||
from
|
|
||||||
enterprise_user
|
|
||||||
where
|
|
||||||
departments like concat('%/',#{dingDeptId},'/%')
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectAllUserIds" resultType="java.lang.String">
|
|
||||||
select user_id as userId from enterprise_user
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectByUserIdIgnoreActive" resultType="com.cool.store.entity.EnterpriseUserDO">
|
|
||||||
select
|
|
||||||
id as id,
|
|
||||||
user_id as userId,
|
|
||||||
`name` as name,
|
|
||||||
tel as tel,
|
|
||||||
work_place as workPlace,
|
|
||||||
remark as remark,
|
|
||||||
mobile as mobile,
|
|
||||||
email as email,
|
|
||||||
org_email as orgEmail,
|
|
||||||
active as active,
|
|
||||||
order_in_depts as orderInDepts,
|
|
||||||
is_admin as isAdmin,
|
|
||||||
is_boss as isBoss,
|
|
||||||
dingId as dingId,
|
|
||||||
unionid as unionid,
|
|
||||||
is_leader_in_depts as isLeaderInDepts,
|
|
||||||
is_hide as isHide,
|
|
||||||
`position` as position,
|
|
||||||
avatar as avatar,
|
|
||||||
face_url as faceUrl,
|
|
||||||
jobnumber as jobnumber,
|
|
||||||
extattr as extattr,
|
|
||||||
is_enterprise as isEnterprise,
|
|
||||||
roles as roles,
|
|
||||||
monitored_departments as monitoredDepartments,
|
|
||||||
departments as departments,
|
|
||||||
is_leader as isLeader,
|
|
||||||
create_time as createTime,
|
|
||||||
`language` as language,
|
|
||||||
third_oa_unique_flag as thirdOaUniqueFlag,
|
|
||||||
subordinate_change as subordinateChange,
|
|
||||||
subordinate_range as subordinateRange
|
|
||||||
from enterprise_user where user_id = #{userId, jdbcType=VARCHAR}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="insertEnterpriseUser">
|
|
||||||
insert into enterprise_user
|
|
||||||
( `id`,
|
|
||||||
`user_id`,
|
|
||||||
`name`,
|
|
||||||
`tel`,
|
|
||||||
`work_place`,
|
|
||||||
`remark`,
|
|
||||||
`mobile`,
|
|
||||||
`email`,
|
|
||||||
`org_email`,
|
|
||||||
`active`,
|
|
||||||
`order_in_depts`,
|
|
||||||
`main_admin`,
|
|
||||||
`is_admin`,
|
|
||||||
`is_boss`,
|
|
||||||
`dingId`,
|
|
||||||
`unionid`,
|
|
||||||
`is_leader_in_depts`,
|
|
||||||
`is_hide`,
|
|
||||||
`position`,
|
|
||||||
`avatar`,
|
|
||||||
`jobnumber`,
|
|
||||||
`extattr`,
|
|
||||||
`is_enterprise`,
|
|
||||||
`roles`,
|
|
||||||
`monitored_departments`,
|
|
||||||
`departments`,
|
|
||||||
`is_leader`,
|
|
||||||
`face_url`,
|
|
||||||
`create_time`,
|
|
||||||
`user_status`,
|
|
||||||
`third_oa_unique_flag`,
|
|
||||||
`subordinate_range`
|
|
||||||
)
|
|
||||||
values
|
|
||||||
(
|
|
||||||
#{entity.id},
|
|
||||||
#{entity.userId},
|
|
||||||
#{entity.name},
|
|
||||||
#{entity.tel},
|
|
||||||
#{entity.workPlace},
|
|
||||||
#{entity.remark},
|
|
||||||
#{entity.mobile},
|
|
||||||
#{entity.email},
|
|
||||||
#{entity.orgEmail},
|
|
||||||
#{entity.active},
|
|
||||||
#{entity.orderInDepts},
|
|
||||||
#{entity.mainAdmin},
|
|
||||||
#{entity.isAdmin},
|
|
||||||
#{entity.isBoss},
|
|
||||||
#{entity.dingid},
|
|
||||||
#{entity.unionid},
|
|
||||||
#{entity.isLeaderInDepts},
|
|
||||||
#{entity.isHide},
|
|
||||||
#{entity.position},
|
|
||||||
#{entity.avatar},
|
|
||||||
#{entity.jobnumber},
|
|
||||||
#{entity.extattr},
|
|
||||||
#{entity.isEnterprise},
|
|
||||||
#{entity.roles},
|
|
||||||
#{entity.monitoredDepartments},
|
|
||||||
#{entity.departments},
|
|
||||||
#{entity.isLeader},
|
|
||||||
#{entity.faceUrl},
|
|
||||||
now(),
|
|
||||||
#{entity.userStatus},
|
|
||||||
#{entity.thirdOaUniqueFlag},
|
|
||||||
#{entity.subordinateRange}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
jdbc.driver = com.mysql.cj.jdbc.Driver
|
jdbc.driver = com.mysql.cj.jdbc.Driver
|
||||||
jdbc.url = jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_base?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
|
jdbc.url = jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcollege_intelligent_hy?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true
|
||||||
jdbc.user= coolstore
|
jdbc.user= coolstore
|
||||||
jdbc.password = CSCErYcXniNYm7bT
|
jdbc.password = CSCErYcXniNYm7bT
|
||||||
|
|
||||||
table.name = enterprise_user_department_e88b6a2bc1334164b54977a4dbfe5d9d
|
table.name = enterprise_user
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
package com.cool.store.dto;
|
|
||||||
|
|
||||||
import com.cool.store.entity.EnterpriseConfigDO;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @FileName: DatasourceInfoDTO
|
|
||||||
* @Description:
|
|
||||||
* @date 2023-05-18 14:28
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class DatasourceInfoDTO {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* serverurl
|
|
||||||
*/
|
|
||||||
private String dbServer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 端口
|
|
||||||
*/
|
|
||||||
private Integer dbPort;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据库用户
|
|
||||||
*/
|
|
||||||
private String dbUser;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据库密码
|
|
||||||
*/
|
|
||||||
private String dbPwd;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbName
|
|
||||||
*/
|
|
||||||
private String dbName;
|
|
||||||
|
|
||||||
|
|
||||||
public static List<DatasourceInfoDTO> convertList(List<EnterpriseConfigDO> configList){
|
|
||||||
if (CollectionUtils.isEmpty(configList)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
List<DatasourceInfoDTO> resultList = new ArrayList<>();
|
|
||||||
for (EnterpriseConfigDO enterpriseConfig : configList) {
|
|
||||||
DatasourceInfoDTO datasource = new DatasourceInfoDTO();
|
|
||||||
datasource.setDbServer(enterpriseConfig.getDbServer());
|
|
||||||
datasource.setDbPort(enterpriseConfig.getDbPort());
|
|
||||||
datasource.setDbUser(enterpriseConfig.getDbUser());
|
|
||||||
datasource.setDbPwd(enterpriseConfig.getDbPwd());
|
|
||||||
datasource.setDbName(enterpriseConfig.getDbName());
|
|
||||||
resultList.add(datasource);
|
|
||||||
}
|
|
||||||
return resultList;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package com.cool.store.dto.enterprise;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author chenyupeng
|
|
||||||
* @since 2022/1/26
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class EnterpriseInitDTO {
|
|
||||||
|
|
||||||
private String appType;
|
|
||||||
|
|
||||||
private String corpId;
|
|
||||||
|
|
||||||
private String eid;
|
|
||||||
|
|
||||||
private String dbName;
|
|
||||||
|
|
||||||
private String userId;
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package com.cool.store.dto.enterprise;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业开通相关的参数
|
|
||||||
* @author :xugangkun
|
|
||||||
* @date :2022/2/11 14:14
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class EnterpriseOpenMsg {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业id
|
|
||||||
*/
|
|
||||||
private String eid;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* corpId
|
|
||||||
*/
|
|
||||||
private String corpId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开通类型
|
|
||||||
*/
|
|
||||||
private String appType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 授权用户id
|
|
||||||
*/
|
|
||||||
private String authUserId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据库名
|
|
||||||
*/
|
|
||||||
private String dbName;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -132,8 +132,6 @@ public class EnterpriseUserDTO implements Serializable {
|
|||||||
|
|
||||||
public static EnterpriseUserDO transUserDtoToDo(EnterpriseUserDTO enterpriseUserDTO) {
|
public static EnterpriseUserDO transUserDtoToDo(EnterpriseUserDTO enterpriseUserDTO) {
|
||||||
EnterpriseUserDO enterpriseUserDO = new EnterpriseUserDO();
|
EnterpriseUserDO enterpriseUserDO = new EnterpriseUserDO();
|
||||||
enterpriseUserDO.setTel(enterpriseUserDTO.getTel());
|
|
||||||
enterpriseUserDO.setWorkPlace(enterpriseUserDTO.getWorkPlace());
|
|
||||||
enterpriseUserDO.setRemark(enterpriseUserDTO.getRemark());
|
enterpriseUserDO.setRemark(enterpriseUserDTO.getRemark());
|
||||||
enterpriseUserDO.setPosition(enterpriseUserDTO.getPosition());
|
enterpriseUserDO.setPosition(enterpriseUserDTO.getPosition());
|
||||||
enterpriseUserDO.setMobile(enterpriseUserDTO.getMobile());
|
enterpriseUserDO.setMobile(enterpriseUserDTO.getMobile());
|
||||||
@@ -142,12 +140,8 @@ public class EnterpriseUserDTO implements Serializable {
|
|||||||
enterpriseUserDO.setName(enterpriseUserDTO.getName());
|
enterpriseUserDO.setName(enterpriseUserDTO.getName());
|
||||||
enterpriseUserDO.setEmail(enterpriseUserDTO.getEmail());
|
enterpriseUserDO.setEmail(enterpriseUserDTO.getEmail());
|
||||||
enterpriseUserDO.setOrgEmail(enterpriseUserDTO.getOrgEmail());
|
enterpriseUserDO.setOrgEmail(enterpriseUserDTO.getOrgEmail());
|
||||||
enterpriseUserDO.setActive(Boolean.TRUE);
|
|
||||||
enterpriseUserDO.setIsBoss(enterpriseUserDTO.getIsBoss());
|
|
||||||
enterpriseUserDO.setUnionid(enterpriseUserDTO.getUnionid());
|
enterpriseUserDO.setUnionid(enterpriseUserDTO.getUnionid());
|
||||||
enterpriseUserDO.setAvatar(enterpriseUserDTO.getAvatar());
|
enterpriseUserDO.setAvatar(enterpriseUserDTO.getAvatar());
|
||||||
enterpriseUserDO.setIsLeaderInDepts(JSONObject.toJSONString(enterpriseUserDTO.getIsLeaderInDepts()));
|
|
||||||
enterpriseUserDO.setExtattr(enterpriseUserDTO.getExtattr());
|
|
||||||
enterpriseUserDO.setCreateTime(new Date());
|
enterpriseUserDO.setCreateTime(new Date());
|
||||||
enterpriseUserDO.setJobnumber(enterpriseUserDTO.getJobnumber());
|
enterpriseUserDO.setJobnumber(enterpriseUserDTO.getJobnumber());
|
||||||
return enterpriseUserDO;
|
return enterpriseUserDO;
|
||||||
@@ -162,33 +156,17 @@ public class EnterpriseUserDTO implements Serializable {
|
|||||||
enterpriseUserDO.setName(dto.getName());
|
enterpriseUserDO.setName(dto.getName());
|
||||||
enterpriseUserDO.setId(dto.getId());
|
enterpriseUserDO.setId(dto.getId());
|
||||||
enterpriseUserDO.setUserId(dto.getUserId());
|
enterpriseUserDO.setUserId(dto.getUserId());
|
||||||
enterpriseUserDO.setTel(dto.getTel());
|
|
||||||
enterpriseUserDO.setWorkPlace(dto.getWorkPlace());
|
|
||||||
enterpriseUserDO.setRemark(dto.getRemark());
|
enterpriseUserDO.setRemark(dto.getRemark());
|
||||||
enterpriseUserDO.setMobile(dto.getMobile());
|
enterpriseUserDO.setMobile(dto.getMobile());
|
||||||
enterpriseUserDO.setEmail(dto.getEmail());
|
enterpriseUserDO.setEmail(dto.getEmail());
|
||||||
enterpriseUserDO.setOrgEmail(dto.getOrgEmail());
|
enterpriseUserDO.setOrgEmail(dto.getOrgEmail());
|
||||||
enterpriseUserDO.setActive(dto.getActive());
|
|
||||||
enterpriseUserDO.setOrderInDepts(dto.getOrderInDepts());
|
|
||||||
enterpriseUserDO.setIsAdmin(dto.getIsAdmin());
|
enterpriseUserDO.setIsAdmin(dto.getIsAdmin());
|
||||||
enterpriseUserDO.setIsBoss(dto.getIsBoss());
|
|
||||||
enterpriseUserDO.setDingid(dto.getDingid());
|
|
||||||
enterpriseUserDO.setUnionid(dto.getUnionid());
|
enterpriseUserDO.setUnionid(dto.getUnionid());
|
||||||
enterpriseUserDO.setIsHide(dto.getIsHide());
|
|
||||||
enterpriseUserDO.setPosition(dto.getPosition());
|
enterpriseUserDO.setPosition(dto.getPosition());
|
||||||
enterpriseUserDO.setAvatar(dto.getAvatar());
|
enterpriseUserDO.setAvatar(dto.getAvatar());
|
||||||
enterpriseUserDO.setExtattr(dto.getExtattr());
|
|
||||||
enterpriseUserDO.setIsEnterprise(dto.getIsEnterprise());
|
|
||||||
enterpriseUserDO.setRoles(dto.getRoles());
|
|
||||||
enterpriseUserDO.setIsLeader(dto.getIsLeader());
|
enterpriseUserDO.setIsLeader(dto.getIsLeader());
|
||||||
enterpriseUserDO.setCreateTime(dto.getCreateTime());
|
enterpriseUserDO.setCreateTime(dto.getCreateTime());
|
||||||
enterpriseUserDO.setLanguage(dto.getLanguage());
|
|
||||||
enterpriseUserDO.setIsLeaderInDepts(JSONObject.toJSONString(dto.getIsLeaderInDepts()));
|
|
||||||
enterpriseUserDO.setJobnumber(dto.getJobnumber());
|
enterpriseUserDO.setJobnumber(dto.getJobnumber());
|
||||||
enterpriseUserDO.setMonitoredDepartments(dto.getMonitoredDepartments());
|
|
||||||
/*enterpriseUserDO.setAppType(dto.getAppType());
|
|
||||||
enterpriseUserDO.setPassword(dto.getPassword());*/
|
|
||||||
enterpriseUserDO.setThirdOaUniqueFlag(dto.getThirdOaUniqueFlag());
|
|
||||||
return enterpriseUserDO;
|
return enterpriseUserDO;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,91 +0,0 @@
|
|||||||
package com.cool.store.entity;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @date 2023-05-18 11:09
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class EnterpriseConfigDO implements Serializable {
|
|
||||||
|
|
||||||
@ApiModelProperty("自增主键")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@ApiModelProperty("当前套餐")
|
|
||||||
private Long currentPackage;
|
|
||||||
|
|
||||||
@ApiModelProperty("企业id")
|
|
||||||
private String enterpriseId;
|
|
||||||
|
|
||||||
@ApiModelProperty("员工人数")
|
|
||||||
private Integer staffCount;
|
|
||||||
|
|
||||||
@ApiModelProperty("数据库名称")
|
|
||||||
private String dbSourceName;
|
|
||||||
|
|
||||||
@ApiModelProperty("数据库服务器")
|
|
||||||
private String dbServer;
|
|
||||||
|
|
||||||
@ApiModelProperty("端口")
|
|
||||||
private Integer dbPort;
|
|
||||||
|
|
||||||
@ApiModelProperty("数据库名称")
|
|
||||||
private String dbName;
|
|
||||||
|
|
||||||
@ApiModelProperty("数据库用户")
|
|
||||||
private String dbUser;
|
|
||||||
|
|
||||||
@ApiModelProperty("数据库密码")
|
|
||||||
private String dbPwd;
|
|
||||||
|
|
||||||
@ApiModelProperty("授权私钥")
|
|
||||||
private String license;
|
|
||||||
|
|
||||||
@ApiModelProperty("授权到期")
|
|
||||||
private Date licenseExpires;
|
|
||||||
|
|
||||||
@ApiModelProperty("授权类型")
|
|
||||||
private Integer licenseType;
|
|
||||||
|
|
||||||
@ApiModelProperty("钉钉业务id")
|
|
||||||
private String dingCorpId;
|
|
||||||
|
|
||||||
@ApiModelProperty("钉钉秘钥")
|
|
||||||
private String dingCorpSecret;
|
|
||||||
|
|
||||||
@ApiModelProperty("创建时间")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("创建人")
|
|
||||||
private String createUser;
|
|
||||||
|
|
||||||
@ApiModelProperty("主应用Id")
|
|
||||||
private String mainCorpId;
|
|
||||||
|
|
||||||
@ApiModelProperty("来源类型:默认dingding钉钉,qw企业微信 mobile")
|
|
||||||
private String appType;
|
|
||||||
|
|
||||||
@ApiModelProperty("授权码")
|
|
||||||
private String permanentCode;
|
|
||||||
|
|
||||||
@ApiModelProperty("应用id")
|
|
||||||
private String agentid;
|
|
||||||
|
|
||||||
@ApiModelProperty("开通酷学院企业映射的企业id")
|
|
||||||
private String coolCollegeEnterpriseId;
|
|
||||||
|
|
||||||
@ApiModelProperty("开通酷学院企业返回的企业秘钥")
|
|
||||||
private String coolCollegeSecret;
|
|
||||||
}
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
package com.cool.store.entity;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @date 2023-05-23 11:36
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class EnterpriseDO implements Serializable {
|
|
||||||
@ApiModelProperty("企业主键")
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
@ApiModelProperty("企业名称")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@ApiModelProperty("原始名称")
|
|
||||||
private String originalName;
|
|
||||||
|
|
||||||
@ApiModelProperty("电话")
|
|
||||||
private String mobile;
|
|
||||||
|
|
||||||
@ApiModelProperty("省")
|
|
||||||
private String province;
|
|
||||||
|
|
||||||
@ApiModelProperty("市")
|
|
||||||
private String city;
|
|
||||||
|
|
||||||
@ApiModelProperty("状态")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@ApiModelProperty("")
|
|
||||||
private String logo;
|
|
||||||
|
|
||||||
@ApiModelProperty("用户类型(1:普通用户 2:付费用户 3:试用用户 4:共创用户)")
|
|
||||||
private Integer isVip;
|
|
||||||
|
|
||||||
@ApiModelProperty("授权人数")
|
|
||||||
private Integer authType;
|
|
||||||
|
|
||||||
@ApiModelProperty("")
|
|
||||||
private String authUserId;
|
|
||||||
|
|
||||||
@ApiModelProperty("")
|
|
||||||
private String industry;
|
|
||||||
|
|
||||||
@ApiModelProperty("logo名称")
|
|
||||||
private String logoName;
|
|
||||||
|
|
||||||
@ApiModelProperty("企业logo")
|
|
||||||
private String corpLogoUrl;
|
|
||||||
|
|
||||||
@ApiModelProperty("企业是否认证")
|
|
||||||
private Integer isAuthenticated;
|
|
||||||
|
|
||||||
@ApiModelProperty("企业认证等级,0:未认证,1:高级认证,2:中级认证,3:初级认证")
|
|
||||||
private Integer authLevel;
|
|
||||||
|
|
||||||
@ApiModelProperty("注册时间")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("修改时间")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("套餐开始时间")
|
|
||||||
private Date packageBeginDate;
|
|
||||||
|
|
||||||
@ApiModelProperty("套餐结束时间")
|
|
||||||
private Date packageEndDate;
|
|
||||||
|
|
||||||
@ApiModelProperty("人员分组的cropId")
|
|
||||||
private String aliyunPersonGroupCropId;
|
|
||||||
|
|
||||||
@ApiModelProperty("来源类型:默认dingding钉钉,qw企业微信 mobile")
|
|
||||||
private String appType;
|
|
||||||
|
|
||||||
@ApiModelProperty("企业标签")
|
|
||||||
private String tag;
|
|
||||||
|
|
||||||
@ApiModelProperty("数仓设置")
|
|
||||||
private String datawareConfig;
|
|
||||||
|
|
||||||
@ApiModelProperty("是否留资")
|
|
||||||
private Boolean isLeaveInfo;
|
|
||||||
|
|
||||||
@ApiModelProperty("限制的门店数量")
|
|
||||||
private Integer limitStoreCount;
|
|
||||||
|
|
||||||
@ApiModelProperty("设备数量")
|
|
||||||
private Integer limitDeviceCount;
|
|
||||||
}
|
|
||||||
@@ -1,132 +0,0 @@
|
|||||||
package com.cool.store.entity;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @date 2023-05-19 02:58
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class EnterpriseUserDO implements Serializable {
|
|
||||||
|
|
||||||
@ApiModelProperty("用户主键id")
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
@ApiModelProperty("钉钉用户id")
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
@ApiModelProperty("")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@ApiModelProperty("分机号")
|
|
||||||
private String tel;
|
|
||||||
|
|
||||||
@ApiModelProperty("")
|
|
||||||
private String workPlace;
|
|
||||||
|
|
||||||
@ApiModelProperty("备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
@ApiModelProperty("手机号码")
|
|
||||||
private String mobile;
|
|
||||||
|
|
||||||
@ApiModelProperty("员工的电子邮箱")
|
|
||||||
private String email;
|
|
||||||
|
|
||||||
@ApiModelProperty("员工的企业邮箱")
|
|
||||||
private String orgEmail;
|
|
||||||
|
|
||||||
@ApiModelProperty("是否已经激活, true表示已激活, false表示未激活")
|
|
||||||
private Boolean active;
|
|
||||||
|
|
||||||
@ApiModelProperty("")
|
|
||||||
private String orderInDepts;
|
|
||||||
|
|
||||||
@ApiModelProperty("是否是主管理员,0:否,1:是")
|
|
||||||
private Boolean mainAdmin;
|
|
||||||
|
|
||||||
@ApiModelProperty("是否为企业的管理员, true表示是, false表示不是")
|
|
||||||
private Boolean isAdmin;
|
|
||||||
|
|
||||||
@ApiModelProperty("是否为企业的老板, true表示是, false表示不是")
|
|
||||||
private Boolean isBoss;
|
|
||||||
|
|
||||||
@ApiModelProperty("钉钉Id,在钉钉全局范围内标识用户的身份,但用户可以自行修改一次")
|
|
||||||
private String dingid;
|
|
||||||
|
|
||||||
@ApiModelProperty("在当前isv全局范围内唯一标识一个用户的身份,用户无法修改")
|
|
||||||
private String unionid;
|
|
||||||
|
|
||||||
@ApiModelProperty("是否号码隐藏, true表示隐藏, false表示不隐藏")
|
|
||||||
private Boolean isHide;
|
|
||||||
|
|
||||||
@ApiModelProperty("")
|
|
||||||
private String position;
|
|
||||||
|
|
||||||
@ApiModelProperty("头像url")
|
|
||||||
private String avatar;
|
|
||||||
|
|
||||||
@ApiModelProperty("扩展属性,可以设置多种属性(但手机上最多只能显示10个扩展属性,具体显示哪些属性,请到OA管理后台->设置->通讯录信息设置和OA管理后台->设置->手机端显示信息设置)性")
|
|
||||||
private String extattr;
|
|
||||||
|
|
||||||
@ApiModelProperty("")
|
|
||||||
private Boolean isEnterprise;
|
|
||||||
|
|
||||||
@ApiModelProperty("")
|
|
||||||
private String roles;
|
|
||||||
|
|
||||||
@ApiModelProperty("是否是部门的主管, true表示是, false表示不是")
|
|
||||||
private Boolean isLeader;
|
|
||||||
|
|
||||||
@ApiModelProperty("人脸照片url")
|
|
||||||
private String faceUrl;
|
|
||||||
|
|
||||||
@ApiModelProperty("用户创建时间")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("用户语言环境:en_us/英语_美国,zh_cn/中文_简体,zh_hk/中文_繁体_HK")
|
|
||||||
private String language;
|
|
||||||
|
|
||||||
@ApiModelProperty("用户状态 0待审核 1正常 2冻结")
|
|
||||||
private Integer userStatus;
|
|
||||||
|
|
||||||
@ApiModelProperty("第三方OA系统唯一标识")
|
|
||||||
private String thirdOaUniqueFlag;
|
|
||||||
|
|
||||||
@ApiModelProperty("下级是否变动,0 没变动,1 变动")
|
|
||||||
private Integer subordinateChange;
|
|
||||||
|
|
||||||
@ApiModelProperty("修改时间")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("管辖用户范围:self-仅自己,all-全部人员,define-自定义")
|
|
||||||
private String subordinateRange;
|
|
||||||
|
|
||||||
@ApiModelProperty("")
|
|
||||||
private String isLeaderInDepts;
|
|
||||||
|
|
||||||
@ApiModelProperty("")
|
|
||||||
private String department;
|
|
||||||
|
|
||||||
@ApiModelProperty("工号")
|
|
||||||
private String jobnumber;
|
|
||||||
|
|
||||||
@ApiModelProperty("")
|
|
||||||
private String monitoredDepartments;
|
|
||||||
|
|
||||||
@ApiModelProperty("部门全路径")
|
|
||||||
private String departments;
|
|
||||||
|
|
||||||
@ApiModelProperty("部门集合(region_ids)")
|
|
||||||
private String userRegionIds;
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
package com.cool.store.entity;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @date 2023-06-02 05:01
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class EnterpriseUserDepartmentDO implements Serializable {
|
|
||||||
@ApiModelProperty("")
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@ApiModelProperty("用户id")
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
@ApiModelProperty("部门id")
|
|
||||||
private String departmentId;
|
|
||||||
|
|
||||||
@ApiModelProperty("创建时间")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("更新时间")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("是否是部门权限数据:0否,1是")
|
|
||||||
private Boolean isHasAuth;
|
|
||||||
|
|
||||||
public EnterpriseUserDepartmentDO(String userId, String departmentId, Boolean isHasAuth) {
|
|
||||||
this.userId = userId;
|
|
||||||
this.departmentId = departmentId;
|
|
||||||
this.isHasAuth = isHasAuth;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnterpriseUserDepartmentDO() {}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package com.cool.store.entity;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @date 2023-05-31 02:43
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class EnterpriseUserGroupDO implements Serializable {
|
|
||||||
@ApiModelProperty("主键")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@ApiModelProperty("组别id")
|
|
||||||
private String groupId;
|
|
||||||
|
|
||||||
@ApiModelProperty("组别名称")
|
|
||||||
private String groupName;
|
|
||||||
|
|
||||||
@ApiModelProperty("创建时间")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("创建人id")
|
|
||||||
private String createUserId;
|
|
||||||
|
|
||||||
@ApiModelProperty("更新时间")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("更新人")
|
|
||||||
private String updateUserId;
|
|
||||||
|
|
||||||
@ApiModelProperty("删除标识")
|
|
||||||
private Boolean deleted;
|
|
||||||
|
|
||||||
@ApiModelProperty("共同编辑人userId集合(前后逗号分隔)")
|
|
||||||
private String commonEditUserids;
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
package com.cool.store.entity;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @date 2023-05-31 02:43
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class EnterpriseUserGroupMappingDO implements Serializable {
|
|
||||||
@ApiModelProperty("主键")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@ApiModelProperty("用户id")
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
@ApiModelProperty("组别id")
|
|
||||||
private String groupId;
|
|
||||||
|
|
||||||
@ApiModelProperty("创建时间")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("创建人id")
|
|
||||||
private String createUserId;
|
|
||||||
|
|
||||||
@ApiModelProperty("更新时间")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("更新人")
|
|
||||||
private String updateUserId;
|
|
||||||
|
|
||||||
@ApiModelProperty("删除标识")
|
|
||||||
private Boolean deleted;
|
|
||||||
}
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
package com.cool.store.entity;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @date 2023-05-31 11:51
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class StoreDO implements Serializable {
|
|
||||||
@ApiModelProperty("自增ID")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@ApiModelProperty("门店ID")
|
|
||||||
private String storeId;
|
|
||||||
|
|
||||||
@ApiModelProperty("门店名称")
|
|
||||||
private String storeName;
|
|
||||||
|
|
||||||
@ApiModelProperty("门店编号")
|
|
||||||
private String storeNum;
|
|
||||||
|
|
||||||
@ApiModelProperty("门头照")
|
|
||||||
private String avatar;
|
|
||||||
|
|
||||||
@ApiModelProperty("钉钉id")
|
|
||||||
private String dingId;
|
|
||||||
|
|
||||||
@ApiModelProperty("所属区域id")
|
|
||||||
private Long regionId;
|
|
||||||
|
|
||||||
@ApiModelProperty("省")
|
|
||||||
private String province;
|
|
||||||
|
|
||||||
@ApiModelProperty("市")
|
|
||||||
private String city;
|
|
||||||
|
|
||||||
@ApiModelProperty("区")
|
|
||||||
private String county;
|
|
||||||
|
|
||||||
@ApiModelProperty("门店地址")
|
|
||||||
private String storeAddress;
|
|
||||||
|
|
||||||
@ApiModelProperty("定位地址")
|
|
||||||
private String locationAddress;
|
|
||||||
|
|
||||||
@ApiModelProperty("锁定定位:locked/锁定,not_locked/未锁定")
|
|
||||||
private String isLock;
|
|
||||||
|
|
||||||
@ApiModelProperty("经纬度")
|
|
||||||
private String longitudeLatitude;
|
|
||||||
|
|
||||||
@ApiModelProperty("经度")
|
|
||||||
private String longitude;
|
|
||||||
|
|
||||||
@ApiModelProperty("纬度")
|
|
||||||
private String latitude;
|
|
||||||
|
|
||||||
@ApiModelProperty("状态:effective/有效,invalid/失效,ignored/不可用, unSync/未同步")
|
|
||||||
private String isDelete;
|
|
||||||
|
|
||||||
@ApiModelProperty("电话号码")
|
|
||||||
private String telephone;
|
|
||||||
|
|
||||||
@ApiModelProperty("营业时间")
|
|
||||||
private String businessHours;
|
|
||||||
|
|
||||||
@ApiModelProperty("门店面积")
|
|
||||||
private String storeAcreage;
|
|
||||||
|
|
||||||
@ApiModelProperty("门店带宽")
|
|
||||||
private String storeBandwidth;
|
|
||||||
|
|
||||||
@ApiModelProperty("创建时间")
|
|
||||||
private Long createTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("创建人")
|
|
||||||
private String createName;
|
|
||||||
|
|
||||||
@ApiModelProperty("创建人id")
|
|
||||||
private String createUser;
|
|
||||||
|
|
||||||
@ApiModelProperty("更新时间")
|
|
||||||
private Long updateTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("更新人")
|
|
||||||
private String updateName;
|
|
||||||
|
|
||||||
@ApiModelProperty("修改人id")
|
|
||||||
private String updateUser;
|
|
||||||
|
|
||||||
@ApiModelProperty("阿里云corpId")
|
|
||||||
private String aliyunCorpId;
|
|
||||||
|
|
||||||
@ApiModelProperty("门店来源")
|
|
||||||
private String source;
|
|
||||||
|
|
||||||
@ApiModelProperty("vds的corpId")
|
|
||||||
private String vdsCorpId;
|
|
||||||
|
|
||||||
@ApiModelProperty("dinging部门id")
|
|
||||||
private String synDingDeptId;
|
|
||||||
|
|
||||||
@ApiModelProperty("区域路径")
|
|
||||||
private String regionPath;
|
|
||||||
|
|
||||||
@ApiModelProperty("是否绑定绑定摄像头,0:未绑定;1:已绑定")
|
|
||||||
private Boolean hasCamera;
|
|
||||||
|
|
||||||
@ApiModelProperty("门店状态(open:营业;closed:闭店;not_open:未开业)")
|
|
||||||
private String storeStatus;
|
|
||||||
|
|
||||||
@ApiModelProperty("第三方唯一id")
|
|
||||||
private String thirdDeptId;
|
|
||||||
|
|
||||||
@ApiModelProperty("备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
@ApiModelProperty("动态扩展字段")
|
|
||||||
private String extendField;
|
|
||||||
|
|
||||||
@ApiModelProperty("地址经纬度point")
|
|
||||||
private String addressPoint;
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
package com.cool.store.entity;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @date 2023-05-31 02:27
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class SubordinateMappingDO implements Serializable {
|
|
||||||
@ApiModelProperty("主键")
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@ApiModelProperty("用户ID")
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
@ApiModelProperty("部门ID")
|
|
||||||
private String regionId;
|
|
||||||
|
|
||||||
@ApiModelProperty("人员ID")
|
|
||||||
private String personalId;
|
|
||||||
|
|
||||||
@ApiModelProperty("0 下属 , 1 直属上级")
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@ApiModelProperty("创建人")
|
|
||||||
private String createId;
|
|
||||||
|
|
||||||
@ApiModelProperty("创建时间")
|
|
||||||
private Long createTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("更新人")
|
|
||||||
private String updateId;
|
|
||||||
|
|
||||||
@ApiModelProperty("更新时间")
|
|
||||||
private Long updateTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("管辖用户范围:self-仅自己,all-全部人员,define-自定义")
|
|
||||||
private String userRange;
|
|
||||||
|
|
||||||
@ApiModelProperty("auto自动关联 select手动选择")
|
|
||||||
private String source;
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
package com.cool.store.entity;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @date 2023-05-19 02:54
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class UserAuthMappingDO implements Serializable {
|
|
||||||
|
|
||||||
@ApiModelProperty("主键")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@ApiModelProperty("用户ID")
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
@ApiModelProperty("映射主键(区域或者是门店)")
|
|
||||||
private String mappingId;
|
|
||||||
|
|
||||||
@ApiModelProperty("映射类型 region (区域) store(门店)")
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
@ApiModelProperty("来源:create-数智门店创建 sync-钉钉同步")
|
|
||||||
private String source;
|
|
||||||
|
|
||||||
@ApiModelProperty("创建人")
|
|
||||||
private String createId;
|
|
||||||
|
|
||||||
@ApiModelProperty("创建时间")
|
|
||||||
private Long createTime;
|
|
||||||
|
|
||||||
@ApiModelProperty("更新人")
|
|
||||||
private String updateId;
|
|
||||||
|
|
||||||
@ApiModelProperty("更新时间")
|
|
||||||
private Long updateTime;
|
|
||||||
|
|
||||||
public UserAuthMappingDO(String userId, String mappingId, String type, String source, String createId, Long createTime) {
|
|
||||||
this.userId = userId;
|
|
||||||
this.mappingId = mappingId;
|
|
||||||
this.type = type;
|
|
||||||
this.source = source;
|
|
||||||
this.createId = createId;
|
|
||||||
this.createTime = createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public UserAuthMappingDO(){}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.cool.store.vo.buser;
|
package com.cool.store.vo.buser;
|
||||||
|
|
||||||
import com.cool.store.dto.auth.AuthRegionStoreUserDTO;
|
import com.cool.store.dto.auth.AuthRegionStoreUserDTO;
|
||||||
import com.cool.store.entity.EnterpriseUserDO;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -88,7 +87,7 @@ public class EnterpriseUserPageVO implements Serializable {
|
|||||||
private Boolean selectFlag;
|
private Boolean selectFlag;
|
||||||
|
|
||||||
|
|
||||||
public static List<EnterpriseUserPageVO> transUserDOToVO(List<EnterpriseUserDO> enterpriseUserList) {
|
/*public static List<EnterpriseUserPageVO> transUserDOToVO(List<EnterpriseUserDO> enterpriseUserList) {
|
||||||
List<EnterpriseUserPageVO> resultList = new ArrayList<>();
|
List<EnterpriseUserPageVO> resultList = new ArrayList<>();
|
||||||
for (EnterpriseUserDO enterpriseUserDTO : enterpriseUserList) {
|
for (EnterpriseUserDO enterpriseUserDTO : enterpriseUserList) {
|
||||||
EnterpriseUserPageVO enterpriseUserDO = new EnterpriseUserPageVO();
|
EnterpriseUserPageVO enterpriseUserDO = new EnterpriseUserPageVO();
|
||||||
@@ -107,6 +106,6 @@ public class EnterpriseUserPageVO implements Serializable {
|
|||||||
resultList.add(enterpriseUserDO);
|
resultList.add(enterpriseUserDO);
|
||||||
}
|
}
|
||||||
return resultList;
|
return resultList;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@ import com.cool.store.dto.enterprise.SysDepartmentDTO;
|
|||||||
import com.cool.store.dto.login.UserIdInfoDTO;
|
import com.cool.store.dto.login.UserIdInfoDTO;
|
||||||
import com.cool.store.dto.response.ResultDTO;
|
import com.cool.store.dto.response.ResultDTO;
|
||||||
import com.cool.store.entity.EnterpriseUserDO;
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
|
import com.cool.store.mq.util.HttpRestTemplateService;
|
||||||
import com.cool.store.request.EnterpriseUserRequest;
|
import com.cool.store.request.EnterpriseUserRequest;
|
||||||
import com.cool.store.utils.RestTemplateUtil;
|
import com.cool.store.utils.RestTemplateUtil;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
@@ -17,6 +18,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -34,10 +36,8 @@ public class ISVHttpRequest {
|
|||||||
|
|
||||||
@Value("${isv.domain:null}")
|
@Value("${isv.domain:null}")
|
||||||
private String isvDomain;
|
private String isvDomain;
|
||||||
|
@Resource
|
||||||
@Value("${get.user.id.by.code:null}")
|
private HttpRestTemplateService httpRestTemplateService;
|
||||||
private String getUserIdByCode;
|
|
||||||
|
|
||||||
|
|
||||||
public UserIdInfoDTO getUserIdByCode(String paramStr){
|
public UserIdInfoDTO getUserIdByCode(String paramStr){
|
||||||
String url = isvDomain + "/isv/user/getUserIdByCode?" + paramStr;
|
String url = isvDomain + "/isv/user/getUserIdByCode?" + paramStr;
|
||||||
@@ -54,18 +54,16 @@ public class ISVHttpRequest {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public EnterpriseUserDTO getUserDetailByUserId(String corpId, String userId, String appType){
|
public EnterpriseUserDTO getUserDetailByUserId(String userId){
|
||||||
String url = isvDomain + "/isv/user/getUserDetail";
|
String url = isvDomain + "/isv/user/getUserDetail";
|
||||||
HashMap requestMap = new HashMap();
|
HashMap requestMap = new HashMap();
|
||||||
requestMap.put("corpId", corpId);
|
|
||||||
requestMap.put("userId", userId);
|
requestMap.put("userId", userId);
|
||||||
requestMap.put("appType", appType);
|
ResultDTO responseEntity = null;
|
||||||
ResponseEntity<ResultDTO> responseEntity = null;
|
|
||||||
try {
|
try {
|
||||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
responseEntity = httpRestTemplateService.getForObject(url, ResultDTO.class, requestMap);
|
||||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
if(Objects.nonNull(responseEntity.getData()) && responseEntity.isSuccess()){
|
||||||
return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getBody().getData()), EnterpriseUserDTO.class);
|
return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getData()), EnterpriseUserDTO.class);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("调用isv出错{}", e);
|
log.info("调用isv出错{}", e);
|
||||||
@@ -73,17 +71,15 @@ public class ISVHttpRequest {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getAdminUserList(String corpId, String appType){
|
public List<String> getAdminUserList(){
|
||||||
String url = isvDomain + "/isv/corp/getAdminUserList";
|
String url = isvDomain + "/isv/corp/getAdminUserList";
|
||||||
HashMap requestMap = new HashMap();
|
HashMap requestMap = new HashMap();
|
||||||
requestMap.put("corpId", corpId);
|
ResultDTO responseEntity = null;
|
||||||
requestMap.put("appType", appType);
|
|
||||||
ResponseEntity<ResultDTO> responseEntity = null;
|
|
||||||
try {
|
try {
|
||||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
responseEntity = httpRestTemplateService.getForObject(url, ResultDTO.class, requestMap);
|
||||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
if(Objects.nonNull(responseEntity.getData()) && responseEntity.isSuccess()){
|
||||||
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getBody().getData()), String.class);
|
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getData()), String.class);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("调用isv出错{}", e);
|
log.info("调用isv出错{}", e);
|
||||||
@@ -91,17 +87,15 @@ public class ISVHttpRequest {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AuthInfoDTO getAuthInfo(String corpId, String appType){
|
public AuthInfoDTO getAuthInfo(){
|
||||||
String url = isvDomain + "/isv/corp/getAuthInfo";
|
String url = isvDomain + "/isv/corp/getAuthInfo";
|
||||||
HashMap requestMap = new HashMap();
|
HashMap requestMap = new HashMap();
|
||||||
requestMap.put("corpId", corpId);
|
ResultDTO responseEntity = null;
|
||||||
requestMap.put("appType", appType);
|
|
||||||
ResponseEntity<ResultDTO> responseEntity = null;
|
|
||||||
try {
|
try {
|
||||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
responseEntity = httpRestTemplateService.getForObject(url, ResultDTO.class, requestMap);
|
||||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
if(Objects.nonNull(responseEntity.getData()) && responseEntity.isSuccess()){
|
||||||
return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getBody().getData()), AuthInfoDTO.class);
|
return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getData()), AuthInfoDTO.class);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("调用isv出错{}", e);
|
log.info("调用isv出错{}", e);
|
||||||
@@ -109,18 +103,16 @@ public class ISVHttpRequest {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SysDepartmentDTO> getDepartments(String corpId, String appType, String parentId){
|
public List<SysDepartmentDTO> getDepartments(String parentId){
|
||||||
String url = isvDomain + "/isv/corp/getDepartments";
|
String url = isvDomain + "/isv/corp/getDepartments";
|
||||||
HashMap requestMap = new HashMap();
|
HashMap requestMap = new HashMap();
|
||||||
requestMap.put("corpId", corpId);
|
|
||||||
requestMap.put("appType", appType);
|
|
||||||
requestMap.put("parentId", parentId);
|
requestMap.put("parentId", parentId);
|
||||||
ResponseEntity<ResultDTO> responseEntity = null;
|
ResultDTO responseEntity = null;
|
||||||
try {
|
try {
|
||||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
responseEntity = httpRestTemplateService.getForObject(url, ResultDTO.class, requestMap);
|
||||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
if(Objects.nonNull(responseEntity.getData()) && responseEntity.isSuccess()){
|
||||||
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getBody().getData()), SysDepartmentDTO.class);
|
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getData()), SysDepartmentDTO.class);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("调用isv出错{}", e);
|
log.info("调用isv出错{}", e);
|
||||||
@@ -128,17 +120,15 @@ public class ISVHttpRequest {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AuthScopeDTO getAuthScope(String corpId, String appType){
|
public AuthScopeDTO getAuthScope(){
|
||||||
String url = isvDomain + "/isv/corp/getAuthScope";
|
String url = isvDomain + "/isv/corp/getAuthScope";
|
||||||
HashMap requestMap = new HashMap();
|
HashMap requestMap = new HashMap();
|
||||||
requestMap.put("corpId", corpId);
|
ResultDTO responseEntity = null;
|
||||||
requestMap.put("appType", appType);
|
|
||||||
ResponseEntity<ResultDTO> responseEntity = null;
|
|
||||||
try {
|
try {
|
||||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
responseEntity = httpRestTemplateService.getForObject(url, ResultDTO.class, requestMap);
|
||||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
if(Objects.nonNull(responseEntity.getData()) && responseEntity.isSuccess()){
|
||||||
return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getBody().getData()), AuthScopeDTO.class);
|
return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getData()), AuthScopeDTO.class);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("调用isv出错{}", e);
|
log.info("调用isv出错{}", e);
|
||||||
@@ -146,18 +136,16 @@ public class ISVHttpRequest {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EnterpriseUserDTO> getDepartmentUsers(String corpId, String appType, String deptId){
|
public List<EnterpriseUserDTO> getDepartmentUsers(String deptId){
|
||||||
String url = isvDomain + "/isv/corp/getDepartmentUsers";
|
String url = isvDomain + "/isv/corp/getDepartmentUsers";
|
||||||
HashMap requestMap = new HashMap();
|
HashMap requestMap = new HashMap();
|
||||||
requestMap.put("corpId", corpId);
|
|
||||||
requestMap.put("appType", appType);
|
|
||||||
requestMap.put("deptId", deptId);
|
requestMap.put("deptId", deptId);
|
||||||
ResponseEntity<ResultDTO> responseEntity = null;
|
ResultDTO responseEntity = null;
|
||||||
try {
|
try {
|
||||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
responseEntity = httpRestTemplateService.getForObject(url, ResultDTO.class, requestMap);
|
||||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
if(Objects.nonNull(responseEntity.getData()) && responseEntity.isSuccess()){
|
||||||
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getBody().getData()), EnterpriseUserDTO.class);
|
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getData()), EnterpriseUserDTO.class);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("调用isv出错{}", e);
|
log.info("调用isv出错{}", e);
|
||||||
@@ -165,18 +153,16 @@ public class ISVHttpRequest {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EnterpriseUserDTO> getUserDetailByUserIds(String corpId, List<String> userIdList, String appType) {
|
public List<EnterpriseUserDTO> getUserDetailByUserIds(List<String> userIdList) {
|
||||||
String url = isvDomain + "/isv/corp/getDepartmentUsers";
|
String url = isvDomain + "/isv/corp/getDepartmentUsers";
|
||||||
HashMap requestMap = new HashMap();
|
HashMap requestMap = new HashMap();
|
||||||
requestMap.put("corpId", corpId);
|
|
||||||
requestMap.put("appType", appType);
|
|
||||||
requestMap.put("userIds", userIdList);
|
requestMap.put("userIds", userIdList);
|
||||||
ResponseEntity<ResultDTO> responseEntity = null;
|
ResultDTO responseEntity = null;
|
||||||
try {
|
try {
|
||||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
responseEntity = httpRestTemplateService.getForObject(url, ResultDTO.class, requestMap);
|
||||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
if(Objects.nonNull(responseEntity.getData()) && responseEntity.isSuccess()){
|
||||||
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getBody().getData()), EnterpriseUserDTO.class);
|
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getData()), EnterpriseUserDTO.class);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("调用isv出错{}", e);
|
log.info("调用isv出错{}", e);
|
||||||
@@ -184,19 +170,17 @@ public class ISVHttpRequest {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SysDepartmentDTO> getSubDepartments(String corpId, String appType, String parentId, Boolean fetchChild) {
|
public List<SysDepartmentDTO> getSubDepartments(String parentId, Boolean fetchChild) {
|
||||||
String url = isvDomain + "/isv/corp/getSubDepartments";
|
String url = isvDomain + "/isv/corp/getSubDepartments";
|
||||||
HashMap requestMap = new HashMap();
|
HashMap requestMap = new HashMap();
|
||||||
requestMap.put("corpId", corpId);
|
|
||||||
requestMap.put("appType", appType);
|
|
||||||
requestMap.put("parentId", parentId);
|
requestMap.put("parentId", parentId);
|
||||||
requestMap.put("fetchChild", fetchChild);
|
requestMap.put("fetchChild", fetchChild);
|
||||||
ResponseEntity<ResultDTO> responseEntity = null;
|
ResultDTO responseEntity = null;
|
||||||
try {
|
try {
|
||||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
responseEntity = httpRestTemplateService.getForObject(url, ResultDTO.class, requestMap);
|
||||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
if(Objects.nonNull(responseEntity.getData()) && responseEntity.isSuccess()){
|
||||||
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getBody().getData()), SysDepartmentDTO.class);
|
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getData()), SysDepartmentDTO.class);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("调用isv出错{}", e);
|
log.info("调用isv出错{}", e);
|
||||||
@@ -204,8 +188,8 @@ public class ISVHttpRequest {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EnterpriseUserRequest> getDeptUsers(String corpId, String deptId, String appType) {
|
public List<EnterpriseUserRequest> getDeptUsers(String deptId) {
|
||||||
List<EnterpriseUserDTO> departmentUsers = getDepartmentUsers(corpId, deptId, appType);
|
List<EnterpriseUserDTO> departmentUsers = getDepartmentUsers(deptId);
|
||||||
if (CollectionUtils.isEmpty(departmentUsers)){
|
if (CollectionUtils.isEmpty(departmentUsers)){
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
}
|
}
|
||||||
@@ -217,10 +201,10 @@ public class ISVHttpRequest {
|
|||||||
enterpriseUser.setRemark(enterpriseUserDTO.getRemark());
|
enterpriseUser.setRemark(enterpriseUserDTO.getRemark());
|
||||||
enterpriseUser.setUserId(enterpriseUserDTO.getUserId());
|
enterpriseUser.setUserId(enterpriseUserDTO.getUserId());
|
||||||
if (enterpriseUserDTO.getIsLeaderInDepts() != null) {
|
if (enterpriseUserDTO.getIsLeaderInDepts() != null) {
|
||||||
enterpriseUser.setIsLeaderInDepts(JSONObject.toJSONString(enterpriseUserDTO.getIsLeaderInDepts()));
|
//enterpriseUser.setIsLeaderInDepts(JSONObject.toJSONString(enterpriseUserDTO.getIsLeaderInDepts()));
|
||||||
}
|
}
|
||||||
EnterpriseUserRequest enterpriseUserRequest = new EnterpriseUserRequest();
|
EnterpriseUserRequest enterpriseUserRequest = new EnterpriseUserRequest();
|
||||||
enterpriseUserRequest.setEnterpriseUserDO(enterpriseUser);
|
//enterpriseUserRequest.setEnterpriseUserDO(enterpriseUser);
|
||||||
if (CollectionUtils.isNotEmpty(enterpriseUserDTO.getDepartmentLists())) {
|
if (CollectionUtils.isNotEmpty(enterpriseUserDTO.getDepartmentLists())) {
|
||||||
enterpriseUserRequest.setDepartment(JSONObject.toJSONString(enterpriseUserDTO.getDepartmentLists()));
|
enterpriseUserRequest.setDepartment(JSONObject.toJSONString(enterpriseUserDTO.getDepartmentLists()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,14 @@
|
|||||||
package com.cool.store.mq.consumer.listener;
|
package com.cool.store.mq.consumer.listener;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.aliyun.openservices.ons.api.Action;
|
import com.aliyun.openservices.ons.api.Action;
|
||||||
import com.aliyun.openservices.ons.api.ConsumeContext;
|
import com.aliyun.openservices.ons.api.ConsumeContext;
|
||||||
import com.aliyun.openservices.ons.api.Message;
|
import com.aliyun.openservices.ons.api.Message;
|
||||||
import com.aliyun.openservices.ons.api.MessageListener;
|
import com.aliyun.openservices.ons.api.MessageListener;
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.dto.enterprise.EnterpriseInitDTO;
|
|
||||||
import com.cool.store.enums.AppTypeEnum;
|
|
||||||
import com.cool.store.enums.EnterpriseStatusEnum;
|
|
||||||
import com.cool.store.service.EnterpriseInitService;
|
|
||||||
import com.cool.store.utils.RedisUtilPool;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.text.MessageFormat;
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业开通初始化
|
* 企业开通初始化
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,177 @@
|
|||||||
|
package com.cool.store.mq.util;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.exception.ServiceException;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpEntity;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.util.LinkedMultiValueMap;
|
||||||
|
import org.springframework.util.MultiValueMap;
|
||||||
|
import org.springframework.web.client.HttpStatusCodeException;
|
||||||
|
import org.springframework.web.client.RestClientException;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class HttpRestTemplateService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RestTemplate restTemplate;
|
||||||
|
|
||||||
|
|
||||||
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取请求实体对象
|
||||||
|
*
|
||||||
|
* @param object
|
||||||
|
* @param tenantAccessToken
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private HttpEntity getHttpEntity(Object object, String tenantAccessToken) {
|
||||||
|
return new HttpEntity(object, this.getHeaders(tenantAccessToken));
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> T getForObject(String url, Class<T> responseType, Map<String, ?> uriVariables , Map<String, String> headMap) {
|
||||||
|
logger.info("getForObject start:url={},responseType={},uriVariables={}", url, responseType.getName(),
|
||||||
|
JSONObject.toJSONString(uriVariables));
|
||||||
|
ResponseEntity<T> result = null;
|
||||||
|
try {
|
||||||
|
//封装请求头
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headMap.forEach((k, v)->{
|
||||||
|
headers.add(k, v);
|
||||||
|
});
|
||||||
|
HttpEntity<MultiValueMap<String, Object>> formEntity = new HttpEntity<MultiValueMap<String, Object>>(headers);
|
||||||
|
result = exchange(url, HttpMethod.GET, formEntity, responseType, uriVariables);
|
||||||
|
} catch (RestClientException e) {
|
||||||
|
logger.error("getForObject error:{}", e);
|
||||||
|
throw new ServiceException(ErrorCodeEnum.UNKNOWN);
|
||||||
|
}
|
||||||
|
logger.info("getForObject end:result={}", JSONObject.toJSONString(result));
|
||||||
|
return result.getBody();
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> T getForObject(String url, Class<T> responseType, Map<String, ?> uriVariables) {
|
||||||
|
logger.info("getForObject start:url={},responseType={},uriVariables={}", url, responseType.getName(), JSONObject.toJSONString(uriVariables));
|
||||||
|
T result = null;
|
||||||
|
try {
|
||||||
|
result = restTemplate.getForObject(transUrl(url, uriVariables), responseType, uriVariables);
|
||||||
|
} catch (RestClientException e) {
|
||||||
|
logger.error("getForObject error:{}", e);
|
||||||
|
throw new ServiceException(ErrorCodeEnum.UNKNOWN);
|
||||||
|
}
|
||||||
|
logger.info("getForObject end:result={}", JSONObject.toJSONString(result));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String transUrl(String url, Map<String, ?> uriVariables) {
|
||||||
|
StringBuilder finalUrl = new StringBuilder(url);
|
||||||
|
if (Objects.isNull(uriVariables)) {
|
||||||
|
return finalUrl.toString();
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(url)) {
|
||||||
|
if (url.contains("?")) {
|
||||||
|
if (url.endsWith("?")) {
|
||||||
|
finalUrl.append("1=1");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
finalUrl.append("?1=1");
|
||||||
|
}
|
||||||
|
uriVariables.forEach((k, v) -> {
|
||||||
|
finalUrl.append("&").append(k).append("={").append(k).append("}");
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
return finalUrl.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public <T> T postForObject(String url, Object request, Class<T> responseType) {
|
||||||
|
logger.info("postForObject start:url={},request={},responseType={}",
|
||||||
|
url, JSONObject.toJSONString(request), responseType.getName());
|
||||||
|
T result = null;
|
||||||
|
try {
|
||||||
|
result = restTemplate.postForObject(url, getHttpEntity(request, null), responseType);
|
||||||
|
} catch (RestClientException e) {
|
||||||
|
logger.error("postForObject error:{}", e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
logger.info("postForObject end:result={}", JSONObject.toJSONString(result));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> T postForObject(String url, Object request, String tenantAccessToken, Class<T> responseType) {
|
||||||
|
logger.info("postForObject start:url={},request={},responseType={}, tenantAccessToken:{}",
|
||||||
|
url, JSONObject.toJSONString(request), responseType.getName(), tenantAccessToken);
|
||||||
|
T result = null;
|
||||||
|
try {
|
||||||
|
result = restTemplate.postForObject(url, getHttpEntity(request, tenantAccessToken), responseType);
|
||||||
|
} catch (RestClientException e) {
|
||||||
|
logger.error("postForObject error:{}", JSONObject.toJSONString(result));
|
||||||
|
logger.error("postForObject error:{}", e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
logger.info("postForObject end:result={}", JSONObject.toJSONString(result));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取Headers
|
||||||
|
*
|
||||||
|
* @param tenantAccessToken
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private MultiValueMap<String, String> getHeaders(String tenantAccessToken) {
|
||||||
|
MultiValueMap<String, String> headers = new LinkedMultiValueMap();
|
||||||
|
if (StringUtils.isNotEmpty(tenantAccessToken)) {
|
||||||
|
headers.add("Authorization", "Bearer " + tenantAccessToken);
|
||||||
|
}
|
||||||
|
headers.add("Content-Type", "application/json");
|
||||||
|
return headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> ResponseEntity<T> exchange(String uri, HttpMethod httpMethod, HttpEntity httpEntity,
|
||||||
|
Class<T> responseEntity, Map<String, ?> params) {
|
||||||
|
List<String> queryStrings = Lists.newArrayList();
|
||||||
|
if (!CollectionUtils.isEmpty(params)) {
|
||||||
|
params.forEach((k, v) -> {
|
||||||
|
queryStrings.add(k + "=" + v);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
String queryString = null;
|
||||||
|
if (!CollectionUtils.isEmpty(queryStrings)) {
|
||||||
|
queryString = String.join("&", queryStrings);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(queryString)) {
|
||||||
|
uri = uri + "?" + queryString;
|
||||||
|
}
|
||||||
|
ResponseEntity<T> exchange = null;
|
||||||
|
logger.info("start exchange=uri:{},httpMethod:{},httpEntity:{},responseEntity:{},params:{}", uri,
|
||||||
|
httpMethod.toString(), httpEntity.toString(), responseEntity.toString(),
|
||||||
|
Objects.nonNull(params) ? params.toString() : null);
|
||||||
|
try {
|
||||||
|
exchange = restTemplate.exchange(uri, httpMethod, httpEntity, responseEntity);
|
||||||
|
} catch (HttpStatusCodeException e) {
|
||||||
|
logger.error("exchange err, resp={}", e.getResponseBodyAsString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("exchange err:", e);
|
||||||
|
}
|
||||||
|
logger.info("end exchange=exchange:{},", exchange);
|
||||||
|
return exchange;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
package com.cool.store.service;
|
|
||||||
|
|
||||||
|
|
||||||
import com.cool.store.entity.EnterpriseConfigDO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
public interface EnterpriseConfigService {
|
|
||||||
|
|
||||||
EnterpriseConfigDO selectByEnterpriseId();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据dbName获取dbServer
|
|
||||||
* @param dbName
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
EnterpriseConfigDO getDbInfoByDbName(String dbName);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取dbServer
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<EnterpriseConfigDO> getDistinctDbServer();
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package com.cool.store.service;
|
|
||||||
|
|
||||||
import com.cool.store.dto.enterprise.EnterpriseOpenMsg;
|
|
||||||
import com.cool.store.enums.AppTypeEnum;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @FileName: EnterpriseInitService
|
|
||||||
* @Description:
|
|
||||||
* @date 2023-05-29 15:43
|
|
||||||
*/
|
|
||||||
public interface EnterpriseInitService {
|
|
||||||
|
|
||||||
void sync(String userName, String userId, Long regionId);
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.cool.store.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @FileName: EnterpriseInitService
|
||||||
|
* @Description:
|
||||||
|
* @date 2023-05-29 15:43
|
||||||
|
*/
|
||||||
|
public interface EnterpriseSyncService {
|
||||||
|
|
||||||
|
void syncAll();
|
||||||
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
package com.cool.store.service;
|
package com.cool.store.service;
|
||||||
|
|
||||||
import com.cool.store.entity.EnterpriseUserDO;
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
import com.cool.store.request.EnterpriseUserRequest;
|
import com.cool.store.request.EnterpriseUserRequest;
|
||||||
import com.cool.store.vo.buser.EnterpriseUserPageVO;
|
import com.cool.store.vo.buser.EnterpriseUserPageVO;
|
||||||
@@ -23,14 +22,6 @@ public interface EnterpriseUserService {
|
|||||||
|
|
||||||
List<String> initUserRole(List<EnterpriseUserPageVO> enterpriseUserList);
|
List<String> initUserRole(List<EnterpriseUserPageVO> enterpriseUserList);
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取人员所属部门
|
|
||||||
* @param enterpriseId
|
|
||||||
* @param userIdList
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
Map<String, String> getUserRegion(List<String> userIdList);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新用户的部门全路径
|
* 更新用户的部门全路径
|
||||||
* @param user
|
* @param user
|
||||||
@@ -38,6 +29,6 @@ public interface EnterpriseUserService {
|
|||||||
*/
|
*/
|
||||||
void updateUserDeptPath(EnterpriseUserRequest user, Map<String, String> deptIdMap);
|
void updateUserDeptPath(EnterpriseUserRequest user, Map<String, String> deptIdMap);
|
||||||
|
|
||||||
EnterpriseUserDO selectByUserIdIgnoreActive(String userId);
|
EnterpriseUserDO getUserInfoByUserId(String userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
package com.cool.store.service.impl;
|
|
||||||
|
|
||||||
import com.cool.store.service.EnterpriseConfigService;
|
|
||||||
import com.cool.store.dao.EnterpriseConfigDAO;
|
|
||||||
import com.cool.store.entity.EnterpriseConfigDO;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName EnterpriseConfigServiceImpl
|
|
||||||
* @Description 用一句话描述什么
|
|
||||||
*/
|
|
||||||
@Service(value = "enterpriseConfigService")
|
|
||||||
@Slf4j
|
|
||||||
public class EnterpriseConfigServiceImpl implements EnterpriseConfigService {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private EnterpriseConfigDAO enterpriseConfigDAO;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnterpriseConfigDO selectByEnterpriseId() {
|
|
||||||
//return enterpriseConfigDAO.selectByEnterpriseId(enterpriseId);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public EnterpriseConfigDO getDbInfoByDbName(String dbName) {
|
|
||||||
return enterpriseConfigDAO.getDbInfoByDbName(dbName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<EnterpriseConfigDO> getDistinctDbServer() {
|
|
||||||
return enterpriseConfigDAO.getDistinctDbServer();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,31 @@
|
|||||||
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import com.cool.store.constants.CommonConstants;
|
||||||
|
import com.cool.store.dto.enterprise.*;
|
||||||
|
import com.cool.store.http.ISVHttpRequest;
|
||||||
|
import com.cool.store.service.EnterpriseSyncService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @FileName: EnterpriseInitService
|
||||||
|
* @Description: 企业初始化
|
||||||
|
* @date 2023-05-26 16:28
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
|
||||||
|
@Resource
|
||||||
|
private ISVHttpRequest isvHttpRequest;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void syncAll() {
|
||||||
|
//同步部门
|
||||||
|
List<SysDepartmentDTO> departments = isvHttpRequest.getSubDepartments(CommonConstants.ROOT_DEPT_ID_STR, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.cool.store.service.impl;
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.context.CurrentUser;
|
import com.cool.store.context.CurrentUser;
|
||||||
import com.cool.store.dao.*;
|
import com.cool.store.dao.*;
|
||||||
@@ -9,14 +8,10 @@ import com.cool.store.entity.*;
|
|||||||
import com.cool.store.request.EnterpriseUserRequest;
|
import com.cool.store.request.EnterpriseUserRequest;
|
||||||
import com.cool.store.service.EnterpriseUserService;
|
import com.cool.store.service.EnterpriseUserService;
|
||||||
import com.cool.store.vo.buser.EnterpriseUserPageVO;
|
import com.cool.store.vo.buser.EnterpriseUserPageVO;
|
||||||
import com.github.pagehelper.PageHelper;
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.collections4.ListUtils;
|
import org.apache.commons.collections4.ListUtils;
|
||||||
import org.apache.commons.collections4.MapUtils;
|
|
||||||
import org.apache.commons.collections4.SetUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -95,68 +90,15 @@ public class EnterpriseUserServiceImpl implements EnterpriseUserService {
|
|||||||
}
|
}
|
||||||
enterpriseUserList.add(enterpriseUserDO);
|
enterpriseUserList.add(enterpriseUserDO);
|
||||||
}
|
}
|
||||||
enterpriseUserDAO.batchUpdateDiffUserDiffRegionIds(enterpriseUserList);
|
//enterpriseUserDAO.batchUpdateDiffUserDiffRegionIds(enterpriseUserList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<EnterpriseUserPageVO> listUser(String userName, String deptId,
|
public List<EnterpriseUserPageVO> listUser(String userName, String deptId,
|
||||||
String orderBy, String orderRule,
|
String orderBy, String orderRule,
|
||||||
Long roleId, Integer userStatus, Integer pageNum, Integer pageSize, String jobNumber, String regionId, Boolean hasPage) {
|
Long roleId, Integer userStatus, Integer pageNum, Integer pageSize, String jobNumber, String regionId, Boolean hasPage) {
|
||||||
if (hasPage){
|
|
||||||
PageHelper.startPage(pageNum,pageSize);
|
|
||||||
}
|
|
||||||
List<EnterpriseUserDO> enterpriseUserList = new ArrayList<>();
|
|
||||||
//企微用户 用户名在数据表中加密,需要再次请求企业端接口根据名称去筛选数据
|
|
||||||
if(roleId!=null){
|
|
||||||
enterpriseUserList = enterpriseUserDAO.fuzzyUsersByDepartment(deptId, roleId, orderBy, orderRule, userName, jobNumber, userStatus, null,regionId);
|
|
||||||
}else {
|
|
||||||
enterpriseUserList= enterpriseUserDAO.fuzzyUsersByNotRole(deptId, orderBy, orderRule, userName, jobNumber, userStatus, null,regionId);
|
|
||||||
}
|
|
||||||
List<EnterpriseUserPageVO> resultList = new ArrayList<>();
|
|
||||||
if(CollectionUtils.isEmpty(enterpriseUserList)){
|
|
||||||
return resultList;
|
|
||||||
}
|
|
||||||
resultList = EnterpriseUserPageVO.transUserDOToVO(enterpriseUserList);
|
|
||||||
//填充角色信息如果存在角色信息
|
|
||||||
List<String> userIdList = initUserRole(resultList);
|
|
||||||
//根据人员查询该人员所在部门集合
|
|
||||||
List<UserRegionMappingDO> userRegionMappingDOS = userRegionMappingDAO.listUserRegionMappingByUserId(userIdList);
|
|
||||||
//regionids 集合
|
|
||||||
List<String> regionIds = ListUtils.emptyIfNull(userRegionMappingDOS).stream().map(UserRegionMappingDO::getRegionId).distinct().collect(Collectors.toList());
|
|
||||||
|
|
||||||
List<RegionDO> regionDOs = new ArrayList<>();
|
return null;
|
||||||
if (CollectionUtils.isNotEmpty(regionIds)){
|
|
||||||
regionDOs = regionDAO.getRegionByRegionIds(regionIds);
|
|
||||||
}
|
|
||||||
//部门map KV key-部门id value-部门名称
|
|
||||||
Map<String, String> regionMap = ListUtils.emptyIfNull(regionDOs)
|
|
||||||
.stream()
|
|
||||||
.filter(a->a.getId()!=null&&a.getName()!=null)
|
|
||||||
.collect(Collectors.toMap(data->data.getId().toString(), RegionDO::getName, (a, b) -> a));
|
|
||||||
//人员所在部门map key-人员id value-部门set集合(set去重)
|
|
||||||
Map<String, Set<String>> userRegionMap = ListUtils.emptyIfNull(userRegionMappingDOS)
|
|
||||||
.stream().filter(a->a.getId()!=null&&a.getRegionId()!=null)
|
|
||||||
.collect(Collectors.groupingBy(UserRegionMappingDO::getUserId,
|
|
||||||
Collectors.mapping(UserRegionMappingDO::getRegionId, Collectors.toSet())));
|
|
||||||
|
|
||||||
resultList.stream()
|
|
||||||
.forEach(data->{
|
|
||||||
if(MapUtils.isNotEmpty(userRegionMap)&&MapUtils.isNotEmpty(regionMap)) {
|
|
||||||
Set<String> regions = userRegionMap.get(data.getUserId());
|
|
||||||
String deptNames = SetUtils.emptyIfNull(regions)
|
|
||||||
.stream()
|
|
||||||
.map(dept -> regionMap.get(dept.toString()))
|
|
||||||
.filter(StringUtils::isNotBlank)
|
|
||||||
.collect(Collectors.joining(CommonConstants.COMMA));
|
|
||||||
data.setDepartment(deptNames);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 添加至常用联系人
|
|
||||||
if (StringUtils.isNotBlank(userName)) {
|
|
||||||
List<String> userIds = enterpriseUserList.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList());
|
|
||||||
//lruService.putRecentUseUser(enterpriseId, UserHolder.getUser().getUserId(), userIds);
|
|
||||||
}
|
|
||||||
return resultList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addUserRegionMappingDO(String userId,String regionId,CurrentUser currentUser){
|
private void addUserRegionMappingDO(String userId,String regionId,CurrentUser currentUser){
|
||||||
@@ -212,45 +154,6 @@ public class EnterpriseUserServiceImpl implements EnterpriseUserService {
|
|||||||
return userIdList;
|
return userIdList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, String> getUserRegion(List<String> userIdList) {
|
|
||||||
Map<String, String> resultMap = Maps.newHashMap();
|
|
||||||
//根据人员查询该人员所在部门集合
|
|
||||||
List<UserRegionMappingDO> userRegionMappingDOS = userRegionMappingDAO.listUserRegionMappingByUserId(userIdList);
|
|
||||||
//regionids 集合
|
|
||||||
List<String> regionIds = ListUtils.emptyIfNull(userRegionMappingDOS).stream()
|
|
||||||
.map(UserRegionMappingDO::getRegionId).distinct().collect(Collectors.toList());
|
|
||||||
|
|
||||||
List<RegionDO> regionDOs = new ArrayList<>();
|
|
||||||
if (CollectionUtils.isNotEmpty(regionIds)){
|
|
||||||
regionDOs = regionDAO.getRegionByRegionIds(regionIds);
|
|
||||||
}
|
|
||||||
//部门map KV key-部门id value-部门名称
|
|
||||||
Map<String, String> regionMap = ListUtils.emptyIfNull(regionDOs)
|
|
||||||
.stream()
|
|
||||||
.filter(a->a.getId()!=null&&a.getName()!=null)
|
|
||||||
.collect(Collectors.toMap(data->data.getId().toString(), RegionDO::getName, (a, b) -> a));
|
|
||||||
//人员所在部门map key-人员id value-部门set集合(set去重)
|
|
||||||
Map<String, Set<String>> userRegionMap = ListUtils.emptyIfNull(userRegionMappingDOS)
|
|
||||||
.stream().filter(a->a.getId()!=null&&a.getRegionId()!=null)
|
|
||||||
.collect(Collectors.groupingBy(UserRegionMappingDO::getUserId,
|
|
||||||
Collectors.mapping(UserRegionMappingDO::getRegionId, Collectors.toSet())));
|
|
||||||
userIdList.stream()
|
|
||||||
.forEach(userId->{
|
|
||||||
if(MapUtils.isNotEmpty(userRegionMap)&&MapUtils.isNotEmpty(regionMap)) {
|
|
||||||
Set<String> regions = userRegionMap.get(userId);
|
|
||||||
|
|
||||||
String deptNames = SetUtils.emptyIfNull(regions)
|
|
||||||
.stream()
|
|
||||||
.map(dept -> regionMap.get(dept.toString()))
|
|
||||||
.filter(StrUtil::isNotBlank)
|
|
||||||
.collect(Collectors.joining(CommonConstants.COMMA));
|
|
||||||
resultMap.put(userId, deptNames);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return resultMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateUserDeptPath(EnterpriseUserRequest user, Map<String, String> deptIdMap) {
|
public void updateUserDeptPath(EnterpriseUserRequest user, Map<String, String> deptIdMap) {
|
||||||
List<String> departmentLists = user.getDepartmentLists();
|
List<String> departmentLists = user.getDepartmentLists();
|
||||||
@@ -271,12 +174,11 @@ public class EnterpriseUserServiceImpl implements EnterpriseUserService {
|
|||||||
deptList.add(data);
|
deptList.add(data);
|
||||||
});
|
});
|
||||||
user.setDepartments("[" + String.join(",", deptList) + "]");
|
user.setDepartments("[" + String.join(",", deptList) + "]");
|
||||||
user.getEnterpriseUserDO().setDepartments("[" + String.join(",", deptList) + "]");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnterpriseUserDO selectByUserIdIgnoreActive(String userId) {
|
public EnterpriseUserDO getUserInfoByUserId(String userId) {
|
||||||
return enterpriseUserDAO.selectByUserIdIgnoreActive(userId);
|
return enterpriseUserDAO.getUserInfoById(userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import com.cool.store.context.CurrentUser;
|
|||||||
import com.cool.store.context.DataSourceContext;
|
import com.cool.store.context.DataSourceContext;
|
||||||
import com.cool.store.dao.*;
|
import com.cool.store.dao.*;
|
||||||
import com.cool.store.dto.login.RefreshUser;
|
import com.cool.store.dto.login.RefreshUser;
|
||||||
import com.cool.store.entity.EnterpriseConfigDO;
|
|
||||||
import com.cool.store.entity.EnterpriseDO;
|
|
||||||
import com.cool.store.entity.EnterpriseUserDO;
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
import com.cool.store.entity.SysRoleDO;
|
import com.cool.store.entity.SysRoleDO;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
@@ -34,11 +32,6 @@ import java.util.Objects;
|
|||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class LoginServiceImpl implements LoginService {
|
public class LoginServiceImpl implements LoginService {
|
||||||
|
|
||||||
@Resource
|
|
||||||
private EnterpriseConfigDAO enterpriseConfigDAO;
|
|
||||||
@Resource
|
|
||||||
private EnterpriseDAO enterpriseDAO;
|
|
||||||
@Resource
|
@Resource
|
||||||
private EnterpriseUserDAO enterpriseUserDAO;
|
private EnterpriseUserDAO enterpriseUserDAO;
|
||||||
@Resource
|
@Resource
|
||||||
@@ -58,28 +51,13 @@ public class LoginServiceImpl implements LoginService {
|
|||||||
if (StringUtils.isEmpty(corpId)) {
|
if (StringUtils.isEmpty(corpId)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.ENTERPRISE_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.ENTERPRISE_NOT_EXIST);
|
||||||
}
|
}
|
||||||
EnterpriseConfigDO enterpriseConfig = enterpriseConfigDAO.getConfigByCorpIdAndAppType(corpId, appType);
|
|
||||||
if (enterpriseConfig == null) {
|
|
||||||
throw new ServiceException(ErrorCodeEnum.ENTERPRISE_INIT);
|
|
||||||
}
|
|
||||||
EnterpriseDO enterprise = enterpriseDAO.getEnterpriseById();
|
|
||||||
if (enterprise == null || enterprise.getStatus() == CommonConstants.ZERO) {
|
|
||||||
throw new ServiceException(ErrorCodeEnum.ENTERPRISE_INIT);
|
|
||||||
}
|
|
||||||
CurrentUser currentUser = new CurrentUser();
|
CurrentUser currentUser = new CurrentUser();
|
||||||
RefreshUser refreshUser = new RefreshUser();
|
RefreshUser refreshUser = new RefreshUser();
|
||||||
String dbName = enterpriseConfig.getDbName();
|
|
||||||
// 切到企业库
|
|
||||||
DataSourceContext.setDataSourceType(dbName);
|
|
||||||
// 查企业用户
|
// 查企业用户
|
||||||
EnterpriseUserDO enterpriseUser = enterpriseUserDAO.getUserInfoById(userId);
|
EnterpriseUserDO enterpriseUser = enterpriseUserDAO.getUserInfoById(userId);
|
||||||
if(enterpriseUser == null){
|
if(enterpriseUser == null){
|
||||||
throw new ServiceException(ErrorCodeEnum.NOT_AUTH);
|
throw new ServiceException(ErrorCodeEnum.NOT_AUTH);
|
||||||
}
|
}
|
||||||
//冻结登录 超登用户过滤
|
|
||||||
if (enterprise.getStatus() == CommonConstants.HUNDRED && !StringUtils.equals(enterpriseUser.getUserId(), "a100000001")) {
|
|
||||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR.getCode(), "企业被冻结");
|
|
||||||
}
|
|
||||||
SysRoleDO sysRole = sysRoleDAO.getHighestPrioritySysRoleDoByUserId(userId);
|
SysRoleDO sysRole = sysRoleDAO.getHighestPrioritySysRoleDoByUserId(userId);
|
||||||
if(Objects.isNull(sysRole)){
|
if(Objects.isNull(sysRole)){
|
||||||
log.info("当前用户没角色:{}", userId);
|
log.info("当前用户没角色:{}", userId);
|
||||||
@@ -97,19 +75,15 @@ public class LoginServiceImpl implements LoginService {
|
|||||||
enterpriseUser.setAvatar(finalAvatar);
|
enterpriseUser.setAvatar(finalAvatar);
|
||||||
enterpriseUser.setFaceUrl(finalAvatar);
|
enterpriseUser.setFaceUrl(finalAvatar);
|
||||||
currentUser.setUserId(enterpriseUser.getUserId());
|
currentUser.setUserId(enterpriseUser.getUserId());
|
||||||
currentUser.setDbName(enterpriseConfig.getDbName());
|
|
||||||
currentUser.setIsAdmin(enterpriseUser.getIsAdmin());
|
currentUser.setIsAdmin(enterpriseUser.getIsAdmin());
|
||||||
currentUser.setMainCorpId(enterpriseConfig.getMainCorpId());
|
|
||||||
//设置当前登录人使用的企业相关信息
|
//设置当前登录人使用的企业相关信息
|
||||||
currentUser.setRoleAuth(sysRole.getRoleAuth());
|
currentUser.setRoleAuth(sysRole.getRoleAuth());
|
||||||
currentUser.setSysRoleDO(sysRole);
|
currentUser.setSysRoleDO(sysRole);
|
||||||
currentUser.setEnterpriseId(enterprise.getId());
|
|
||||||
//生成令牌
|
//生成令牌
|
||||||
RandomNumberGenerator randomNumberGenerator = new SecureRandomNumberGenerator();
|
RandomNumberGenerator randomNumberGenerator = new SecureRandomNumberGenerator();
|
||||||
String token = randomNumberGenerator.nextBytes().toHex();
|
String token = randomNumberGenerator.nextBytes().toHex();
|
||||||
String refreshToken = randomNumberGenerator.nextBytes().toHex();
|
String refreshToken = randomNumberGenerator.nextBytes().toHex();
|
||||||
currentUser.setName(enterpriseUser.getName());
|
currentUser.setName(enterpriseUser.getName());
|
||||||
currentUser.setDingCorpId(enterpriseConfig.getDingCorpId());
|
|
||||||
currentUser.setAccessToken(token);
|
currentUser.setAccessToken(token);
|
||||||
currentUser.setAppType(appType);
|
currentUser.setAppType(appType);
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ import javax.sql.DataSource;
|
|||||||
*/
|
*/
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@MapperScan("com.cool.store.mapper")
|
@MapperScan("com.cool.store.mapper")
|
||||||
@EnableAsync
|
|
||||||
@EnableCaching
|
|
||||||
@ServletComponentScan
|
|
||||||
public class PartnerBWebApplication {
|
public class PartnerBWebApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
package com.cool.store.config;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.cool.store.config.datasource.DynamicDataSourceServiceImpl;
|
|
||||||
import com.cool.store.dto.DatasourceInfoDTO;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zhangchenbiao
|
|
||||||
* @FileName: CommonBeanConfig
|
|
||||||
* @Description:
|
|
||||||
* @date 2023-05-19 18:41
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
public class CommonBeanConfig {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private DynamicDataSourceServiceImpl dynamicDataSourceServiceImpl;
|
|
||||||
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void loadDataSource(){
|
|
||||||
List<DatasourceInfoDTO> dbServerList = dynamicDataSourceServiceImpl.getDbNodes();
|
|
||||||
if (CollectionUtils.isEmpty(dbServerList)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
dbServerList.forEach(node -> {
|
|
||||||
dynamicDataSourceServiceImpl.createDataSource(node);
|
|
||||||
});
|
|
||||||
log.info("数据源加载完毕:{}", JSONObject.toJSONString(dbServerList));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
package com.cool.store.config.datasource;
|
|
||||||
|
|
||||||
import com.cool.store.constants.CommonConstants;
|
|
||||||
import com.cool.store.context.DataSourceContext;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
|
||||||
import org.springframework.jdbc.datasource.AbstractDataSource;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Primary
|
|
||||||
@Component
|
|
||||||
public class DynamicDataSource extends AbstractDataSource {
|
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(DynamicDataSource.class);
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private DataSource defaultDataSource;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private DynamicDataSourceServiceImpl dynamicDataSourceService;
|
|
||||||
|
|
||||||
@Value("${default.database.name:coolcollege_intelligent_config}")
|
|
||||||
private String defaultDb;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Connection getConnection() throws SQLException {
|
|
||||||
String currentDbName = getCurrentDbName();
|
|
||||||
if(defaultDb.equals(currentDbName)){
|
|
||||||
Connection connection = defaultDataSource.getConnection();
|
|
||||||
connection.setCatalog(currentDbName);
|
|
||||||
return connection;
|
|
||||||
}
|
|
||||||
Connection connection = this.determineTargetDataSource().getConnection();
|
|
||||||
connection.setCatalog(currentDbName);
|
|
||||||
return connection;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Connection getConnection(String username, String password) throws SQLException {
|
|
||||||
String currentDbName = getCurrentDbName();
|
|
||||||
if(defaultDb.equals(currentDbName)){
|
|
||||||
Connection connection = defaultDataSource.getConnection();
|
|
||||||
connection.setCatalog(currentDbName);
|
|
||||||
return connection;
|
|
||||||
}
|
|
||||||
Connection connection = this.determineTargetDataSource().getConnection(username, password);
|
|
||||||
connection.setCatalog(getCurrentDbName());
|
|
||||||
return connection;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public <T> T unwrap(Class<T> iface) throws SQLException {
|
|
||||||
return iface.isInstance(this) ? (T) this : this.determineTargetDataSource().unwrap(iface);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isWrapperFor(Class<?> iface) throws SQLException {
|
|
||||||
return iface.isInstance(this) || this.determineTargetDataSource().isWrapperFor(iface);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected DataSource determineTargetDataSource() {
|
|
||||||
DataSource dataSource = null;
|
|
||||||
Map<String, DataSource> resolvedDataSources = dynamicDataSourceService.getResolvedDataSources();
|
|
||||||
if (resolvedDataSources != null) {
|
|
||||||
String lookupKey = getDbServerByDbName();
|
|
||||||
if (StringUtils.isNotBlank(lookupKey)) {
|
|
||||||
dataSource = resolvedDataSources.get(lookupKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (dataSource == null) {
|
|
||||||
dataSource = defaultDataSource;
|
|
||||||
}
|
|
||||||
return dataSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过dbName获取dbServer
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
protected String getDbServerByDbName() {
|
|
||||||
String dbName = getCurrentDbName();
|
|
||||||
return dynamicDataSourceService.getDbServerByDbName(dbName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询当前线程上下文对应的库名
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
protected String getCurrentDbName() {
|
|
||||||
String dbName = DataSourceContext.getDataSourceType();
|
|
||||||
if (StringUtils.isBlank(dbName)) {
|
|
||||||
dbName = defaultDb;
|
|
||||||
}
|
|
||||||
return dbName;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
package com.cool.store.config.datasource;
|
|
||||||
|
|
||||||
import com.cool.store.constants.CommonConstants;
|
|
||||||
import com.cool.store.dto.DatasourceInfoDTO;
|
|
||||||
import com.cool.store.entity.EnterpriseConfigDO;
|
|
||||||
import com.cool.store.service.EnterpriseConfigService;
|
|
||||||
import com.cool.store.utils.DataSourceHelper;
|
|
||||||
import com.cool.store.utils.RedisUtilPool;
|
|
||||||
import com.cool.store.context.DataSourceContext;
|
|
||||||
import com.github.pagehelper.Page;
|
|
||||||
import com.github.pagehelper.PageHelper;
|
|
||||||
import com.zaxxer.hikari.HikariConfig;
|
|
||||||
import com.zaxxer.hikari.HikariDataSource;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
|
||||||
import java.text.MessageFormat;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName DynamicDataSourceServiceImpl
|
|
||||||
* @Description 用一句话描述什么
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Slf4j
|
|
||||||
public class DynamicDataSourceServiceImpl {
|
|
||||||
|
|
||||||
private static int defaultMaxPoolSize = 150;
|
|
||||||
|
|
||||||
private static String dbUrl = "jdbc:mysql://{0}:{1}/{2}?useSSL=false&useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true";
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisUtilPool redisUtilPool;
|
|
||||||
@Autowired
|
|
||||||
private MyHikariConfig myHikariConfig;
|
|
||||||
@Autowired
|
|
||||||
private EnterpriseConfigService enterpriseConfigService;
|
|
||||||
@Value("${default.database.name:coolcollege_intelligent_config}")
|
|
||||||
private String defaultDb;
|
|
||||||
/**
|
|
||||||
* 数据库实例和数据源的映射
|
|
||||||
*/
|
|
||||||
private ConcurrentHashMap<String, DataSource> resolvedDataSources = new ConcurrentHashMap();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dbName 和 serverUrl的映射
|
|
||||||
*/
|
|
||||||
private ConcurrentHashMap<String, String> dbNameUrlServerMap = new ConcurrentHashMap();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询所有的企业数据库实例节点配置信息
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public List<DatasourceInfoDTO> getDbNodes() {
|
|
||||||
List<EnterpriseConfigDO> configList = enterpriseConfigService.getDistinctDbServer();
|
|
||||||
return DatasourceInfoDTO.convertList(configList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据dbName查询dbServer
|
|
||||||
*
|
|
||||||
* @param dbName
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String getDbServerByDbName(String dbName) {
|
|
||||||
if(defaultDb.equals(dbName)){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
String dbServerUrl = dbNameUrlServerMap.get(dbName);
|
|
||||||
if(StringUtils.isBlank(dbServerUrl)){
|
|
||||||
Page<Object> localPage = PageHelper.getLocalPage();
|
|
||||||
if(Objects.nonNull(localPage)){
|
|
||||||
PageHelper.clearPage();
|
|
||||||
}
|
|
||||||
String currentDbName = DataSourceContext.getDataSourceType();
|
|
||||||
DataSourceHelper.reset();
|
|
||||||
EnterpriseConfigDO config = enterpriseConfigService.getDbInfoByDbName(dbName);
|
|
||||||
dbServerUrl = config.getDbServer();
|
|
||||||
if(StringUtils.isNotBlank(currentDbName)){
|
|
||||||
DataSourceContext.setDataSourceType(currentDbName);
|
|
||||||
}
|
|
||||||
if(Objects.nonNull(localPage)){
|
|
||||||
//上下文中的东西及时还回去
|
|
||||||
PageHelper.startPage(localPage.getPageNum(), localPage.getPageSize());
|
|
||||||
}
|
|
||||||
dbNameUrlServerMap.put(dbName, dbServerUrl);
|
|
||||||
}
|
|
||||||
return dbServerUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void createDataSource(DatasourceInfoDTO datasource) {
|
|
||||||
DataSource dataSource = buildDataSourceByConfig(datasource);
|
|
||||||
if (dataSource != null) {
|
|
||||||
this.resolvedDataSources.putIfAbsent(datasource.getDbServer(), dataSource);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, DataSource> getResolvedDataSources() {
|
|
||||||
return resolvedDataSources;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* build datasource
|
|
||||||
* @param dbServerUrl
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private DataSource buildDataSourceByConfig(DatasourceInfoDTO datasource) {
|
|
||||||
HikariConfig hikariConfig = new HikariConfig();
|
|
||||||
String url = MessageFormat.format(dbUrl, datasource.getDbServer(), String.valueOf(datasource.getDbPort()), datasource.getDbName());
|
|
||||||
hikariConfig.setDriverClassName(myHikariConfig.getDriverClassName());
|
|
||||||
hikariConfig.setMinimumIdle(myHikariConfig.getMinimumIdle());
|
|
||||||
hikariConfig.setMaximumPoolSize(myHikariConfig.getMaximumPoolSize());
|
|
||||||
hikariConfig.setMaxLifetime(myHikariConfig.getMaxLifetime());
|
|
||||||
hikariConfig.setConnectionTimeout(myHikariConfig.getConnectionTimeout());
|
|
||||||
hikariConfig.setIdleTimeout(myHikariConfig.getIdleTimeout());
|
|
||||||
hikariConfig.setJdbcUrl(url);
|
|
||||||
hikariConfig.setUsername(datasource.getDbUser());
|
|
||||||
hikariConfig.setPassword(datasource.getDbPwd());
|
|
||||||
hikariConfig.setMaximumPoolSize(defaultMaxPoolSize);
|
|
||||||
String poolName = "HikariCP_" + datasource.getDbServer();
|
|
||||||
hikariConfig.setPoolName(poolName);
|
|
||||||
HikariDataSource hikariDataSource = new HikariDataSource(hikariConfig);
|
|
||||||
log.info("{} dataSource is {}, maxPoolSize={}", poolName, hikariDataSource, hikariDataSource.getMaximumPoolSize());
|
|
||||||
return hikariDataSource;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package com.cool.store.config.datasource;
|
|
||||||
|
|
||||||
import com.zaxxer.hikari.HikariConfig;
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
@ConfigurationProperties("spring.datasource.hikari")
|
|
||||||
public class MyHikariConfig extends HikariConfig {
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.cool.store.controller;
|
package com.cool.store.controller;
|
||||||
|
|
||||||
import com.cool.store.entity.EnterpriseConfigDO;
|
|
||||||
|
import com.cool.store.entity.EnterpriseUserDO;
|
||||||
import com.cool.store.enums.RocketMqTagEnum;
|
import com.cool.store.enums.RocketMqTagEnum;
|
||||||
|
import com.cool.store.http.ISVHttpRequest;
|
||||||
import com.cool.store.mq.producer.SimpleMessageService;
|
import com.cool.store.mq.producer.SimpleMessageService;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.EnterpriseConfigService;
|
import com.cool.store.service.EnterpriseUserService;
|
||||||
import com.cool.store.utils.UUIDUtils;
|
import com.cool.store.utils.UUIDUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zhangchenbiao
|
* @author zhangchenbiao
|
||||||
@@ -27,6 +30,10 @@ public class TestController {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SimpleMessageService simpleMessageService;
|
private SimpleMessageService simpleMessageService;
|
||||||
|
@Resource
|
||||||
|
private EnterpriseUserService enterpriseUserService;
|
||||||
|
@Resource
|
||||||
|
private ISVHttpRequest isvHttpRequest;
|
||||||
|
|
||||||
@GetMapping("/sendMq")
|
@GetMapping("/sendMq")
|
||||||
public ResponseResult sendMq(){
|
public ResponseResult sendMq(){
|
||||||
@@ -36,4 +43,55 @@ public class TestController {
|
|||||||
return ResponseResult.success();
|
return ResponseResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("getUserInfo")
|
||||||
|
public ResponseResult getUserInfo(@RequestParam("userId")String userId){
|
||||||
|
EnterpriseUserDO enterpriseUser = enterpriseUserService.getUserInfoByUserId(userId);
|
||||||
|
return ResponseResult.success(enterpriseUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getUserIdByCode")
|
||||||
|
public ResponseResult getUserIdByCode(@RequestParam("paramStr")String paramStr){
|
||||||
|
return ResponseResult.success(isvHttpRequest.getUserIdByCode(paramStr));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getUserDetailByUserId")
|
||||||
|
public ResponseResult getUserDetailByUserId(@RequestParam("userId")String userId){
|
||||||
|
return ResponseResult.success(isvHttpRequest.getUserDetailByUserId(userId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getAdminUserList")
|
||||||
|
public ResponseResult getAdminUserList(){
|
||||||
|
return ResponseResult.success(isvHttpRequest.getAdminUserList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getAuthInfo")
|
||||||
|
public ResponseResult getAuthInfo(){
|
||||||
|
return ResponseResult.success(isvHttpRequest.getAuthInfo());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getDepartments")
|
||||||
|
public ResponseResult getDepartments(@RequestParam("parentId")String parentId){
|
||||||
|
return ResponseResult.success(isvHttpRequest.getDepartments(parentId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getAuthScope")
|
||||||
|
public ResponseResult getAuthScope(){
|
||||||
|
return ResponseResult.success(isvHttpRequest.getAuthScope());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getDepartmentUsers")
|
||||||
|
public ResponseResult getDepartmentUsers(@RequestParam("deptId")String deptId){
|
||||||
|
return ResponseResult.success(isvHttpRequest.getDepartmentUsers(deptId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getUserDetailByUserIds")
|
||||||
|
public ResponseResult getUserDetailByUserIds(@RequestParam("userIds") List<String> userIds){
|
||||||
|
return ResponseResult.success(isvHttpRequest.getUserDetailByUserIds(userIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getSubDepartments")
|
||||||
|
public ResponseResult getSubDepartments(@RequestParam("parentId")String parentId, @RequestParam("fetchChild")Boolean fetchChild){
|
||||||
|
return ResponseResult.success(isvHttpRequest.getSubDepartments(parentId, fetchChild));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ customize_sub_table_size=10
|
|||||||
mybatis.configuration.call-setters-on-nulls=true
|
mybatis.configuration.call-setters-on-nulls=true
|
||||||
mybatis.configuration.map-underscore-to-camel-case=true
|
mybatis.configuration.map-underscore-to-camel-case=true
|
||||||
|
|
||||||
isv.domain = https://abstore-isv.coolstore.cn
|
isv.domain = http://localhost:31100
|
||||||
|
|
||||||
#rocketmq \u914D\u7F6E
|
#rocketmq \u914D\u7F6E
|
||||||
rocketmq.accessKey=zK2oVEz4G1ts23d2
|
rocketmq.accessKey=zK2oVEz4G1ts23d2
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.cool.store.config;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.config.datasource.DynamicDataSourceServiceImpl;
|
import com.cool.store.config.datasource.DynamicDataSourceServiceImpl;
|
||||||
import com.cool.store.dto.DatasourceInfoDTO;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package com.cool.store.config.datasource;
|
package com.cool.store.config.datasource;
|
||||||
|
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.dto.DatasourceInfoDTO;
|
|
||||||
import com.cool.store.entity.EnterpriseConfigDO;
|
|
||||||
import com.cool.store.service.EnterpriseConfigService;
|
|
||||||
import com.cool.store.utils.RedisUtilPool;
|
import com.cool.store.utils.RedisUtilPool;
|
||||||
import com.cool.store.context.DataSourceContext;
|
import com.cool.store.context.DataSourceContext;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
|
|||||||
Reference in New Issue
Block a user