企业开通相关逻辑整理
This commit is contained in:
@@ -71,5 +71,6 @@
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.coolstore:coolstore-base:1.5.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -70,6 +70,10 @@
|
||||
<groupId>com.coolstore</groupId>
|
||||
<artifactId>coolstore-base</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -24,6 +24,13 @@ public class CommonConstants {
|
||||
|
||||
public static final int THREE_DAY_SECONDS = 60*60*24*3;
|
||||
|
||||
/**
|
||||
* 企业开通锁存活时间
|
||||
*/
|
||||
public static final int ENTERPRISE_OPEN_LOCK_TIMES = 4 * 60 * 60 * 1000;
|
||||
|
||||
public static final int ONE_DAY_SECONDS = 24 * 60 * 60;
|
||||
|
||||
/**
|
||||
* 系统用户id
|
||||
*/
|
||||
@@ -34,6 +41,33 @@ public class CommonConstants {
|
||||
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 MaxReconsumeTimes = "2";
|
||||
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 Integer DEAL_RECORD_MAX_SIZE = 1000;
|
||||
|
||||
/**
|
||||
* 未分组区域id
|
||||
*/
|
||||
public static final Long UNGROUPED_DEPT_ID = -2L;
|
||||
|
||||
/**
|
||||
* 未分组区域名称
|
||||
*/
|
||||
public static final String UNGROUPED_DEPT_NAME = "默认分组";
|
||||
|
||||
/**
|
||||
* 拼接符 [
|
||||
*/
|
||||
public static final String SQUAREBRACKETSLEFT = "[";
|
||||
|
||||
/**
|
||||
* 拼接符 ]
|
||||
*/
|
||||
public static final String SQUAREBRACKETSRIGHT = "]";
|
||||
|
||||
|
||||
public static final int ZERO = 0;
|
||||
public static final int ONE = 1;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
public enum AIEnum {
|
||||
|
||||
AI_NAME("AI用户"),
|
||||
AI_USERID("a100000001"),
|
||||
AI_ID("a100000000"),
|
||||
AI_DEPARTMENT("[1]"),
|
||||
AI_ROLES("20000000"),
|
||||
AI_UUID("a100000002"),
|
||||
AI_MOBILE("AIAdminUser");
|
||||
|
||||
|
||||
|
||||
private void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
private String code;
|
||||
AIEnum(String code){
|
||||
this.code=code;
|
||||
}
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: EnterpriseStatusEnum
|
||||
* @Description:
|
||||
* @date 2021-09-17 15:53
|
||||
*/
|
||||
public enum EnterpriseStatusEnum {
|
||||
|
||||
/**
|
||||
* 状态-1 已删除 0初始 1正常 100冻结 88创建失败
|
||||
*/
|
||||
|
||||
DELETED(-1,"已删除"),
|
||||
INIT(0,"初始"),
|
||||
NORMAL(1,"正常"),
|
||||
FREEZE(100,"冻结"),
|
||||
CREATE_FAIL(88,"创建失败"),
|
||||
;
|
||||
|
||||
|
||||
private int code;
|
||||
private String message;
|
||||
|
||||
EnterpriseStatusEnum(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public static String getMessage(Integer code){
|
||||
if(Objects.isNull(code)){
|
||||
return "";
|
||||
}
|
||||
for (EnterpriseStatusEnum value : EnterpriseStatusEnum.values()) {
|
||||
if(code.equals(value.code)){
|
||||
return value.message;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,8 @@ public enum ErrorCodeEnum {
|
||||
GET_APP_SECRET_ERROR(1021020, "获取secret异常", null),
|
||||
WX_SERVICE_ERROR(1021021, "调用微信服务异常", null),
|
||||
SESSION_KEY_ERROR(1021022, "sessionKey过期", null),
|
||||
GET_WECHAT_USER_INFO_FAIL(1021023,"获取小程序用户信息失败", null)
|
||||
GET_WECHAT_USER_INFO_FAIL(1021023,"获取小程序用户信息失败", null),
|
||||
FEISHU_SERVICE_ERROR(1021024,"飞书服务调用异常", null),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @author Aaron
|
||||
* @Description 业务统一返回码
|
||||
* @date 2019/12/20
|
||||
*/
|
||||
public enum RegionTypeEnum {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
ROOT("root", "根节点"),
|
||||
|
||||
|
||||
PATH("path", "区域"),
|
||||
|
||||
|
||||
STORE("store", "门店");
|
||||
|
||||
|
||||
private String type;
|
||||
|
||||
|
||||
private String desc;
|
||||
|
||||
RegionTypeEnum(String type, String desc) {
|
||||
this.type = type;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.cool.store.utils;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: ListUtils
|
||||
* @Description: 集合处理
|
||||
* @date 2022-03-04 20:04
|
||||
*/
|
||||
public class ListOptUtils {
|
||||
|
||||
public static <T> List<T> getIntersection(List<T> listA, List<T> listB){
|
||||
if(CollectionUtils.isEmpty(listA) || CollectionUtils.isEmpty(listB)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return listA.stream().filter(item -> listB.contains(item)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* long集合转Stirng集合
|
||||
* @param listA
|
||||
* @return
|
||||
*/
|
||||
public static List<String> longListConvertStringList(List<Long> listA){
|
||||
List<String> result = Lists.newArrayList();
|
||||
if(CollectionUtils.isEmpty(listA)){
|
||||
return result;
|
||||
}
|
||||
for (Long temp:listA) {
|
||||
result.add(String.valueOf(temp));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -28,7 +28,6 @@
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
|
||||
@@ -94,6 +93,7 @@
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.coolstore:coolstore-base:1.5.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.20" level="project" />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.EnterpriseDO;
|
||||
import com.cool.store.mapper.EnterpriseMapper;
|
||||
import com.cool.store.model.entity.EnterpriseDO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.mapper.EnterpriseUserMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -41,4 +42,10 @@ public class EnterpriseUserDAO {
|
||||
enterpriseUserMapper.batchInsertOrUpdate(eid, result);
|
||||
}
|
||||
|
||||
public void batchUpdateDiffUserDiffRegionIds(String enterpriseId, List<EnterpriseUserDO> enterpriseUserList) {
|
||||
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(enterpriseUserList)){
|
||||
return;
|
||||
}
|
||||
enterpriseUserMapper.batchUpdateDiffUserDiffRegionIds(enterpriseId, enterpriseUserList);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.LoginRecordDO;
|
||||
import com.cool.store.mapper.LoginRecordMapper;
|
||||
import com.cool.store.model.entity.LoginRecordDO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import com.cool.store.enums.RegionTypeEnum;
|
||||
import com.cool.store.mapper.RegionMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:59
|
||||
@@ -9,4 +19,56 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class RegionDAO {
|
||||
|
||||
@Resource
|
||||
private RegionMapper regionMapper;
|
||||
|
||||
public List<Long> getRegionIdsBySynDingDeptIds(String eid, List<String> synDingDeptIds) {
|
||||
if (CollectionUtils.isEmpty(synDingDeptIds)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return regionMapper.selectRegionIdsBySynDingDeptIds(eid, synDingDeptIds);
|
||||
}
|
||||
|
||||
public List<RegionDO> getRegionByRegionIds(String eid, List<String> regionIds) {
|
||||
if(CollectionUtils.isEmpty(regionIds)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return regionMapper.getRegionByRegionIds(eid, regionIds);
|
||||
}
|
||||
|
||||
public RegionDO getUnclassifiedRegionDO(String enterpriseId) {
|
||||
//先查询是否存在未分组区域
|
||||
RegionDO unclassified = regionMapper.getUnclassifiedRegionDO(enterpriseId, CommonConstants.UNGROUPED_DEPT_NAME);
|
||||
if (Objects.isNull(unclassified)) {
|
||||
RegionDO regionDO = new RegionDO();
|
||||
regionDO.setId(CommonConstants.UNGROUPED_DEPT_ID);
|
||||
regionDO.setParentId(CommonConstants.ROOT_DEPT_ID_STR);
|
||||
regionDO.setName(CommonConstants.UNGROUPED_DEPT_NAME);
|
||||
regionDO.setRegionType(RegionTypeEnum.PATH.getType());
|
||||
regionDO.setCreateName(CommonConstants.SYSTEM_USER_ID);
|
||||
regionDO.setCreateTime(Calendar.getInstance().getTimeInMillis());
|
||||
regionDO.setRegionPath("/" + CommonConstants.ROOT_DEPT_ID_STR + "/");
|
||||
regionDO.setUnclassifiedFlag(CommonConstants.ONE);
|
||||
insertRoot(enterpriseId, regionDO);
|
||||
regionDO.setRegionId(regionDO.getId().toString());
|
||||
return regionDO;
|
||||
}
|
||||
return unclassified;
|
||||
}
|
||||
|
||||
public Long insertRoot(String eid, RegionDO regionDO) {
|
||||
return regionMapper.insertRoot(eid, regionDO);
|
||||
}
|
||||
|
||||
public void batchInsertRegions(List<RegionDO> regionDOList, String eid){
|
||||
regionMapper.batchInsertRegionsByDepartments(eid, regionDOList);
|
||||
}
|
||||
|
||||
|
||||
public Map<String,Long> getRegionSynDeptIdAndIdMapping(String eid, List<String> syncDeptIds){
|
||||
List<RegionDO> regionDOS = regionMapper.selectRegionBySynDingDeptIds(eid, syncDeptIds);
|
||||
return ListUtils.emptyIfNull(regionDOS)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(RegionDO::getSynDingDeptId, RegionDO::getId, (r, e) -> r));
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,16 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.enterprise.QueryDeptChildDTO;
|
||||
import com.cool.store.entity.SysDepartmentDO;
|
||||
import com.cool.store.mapper.SysDepartmentMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
@@ -9,4 +18,21 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class SysDepartmentDAO {
|
||||
|
||||
@Resource
|
||||
private SysDepartmentMapper sysDepartmentMapper;
|
||||
|
||||
public void batchInsertOrUpdate(String enterpriseId, List<SysDepartmentDO> deptList){
|
||||
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(deptList)){
|
||||
return;
|
||||
}
|
||||
sysDepartmentMapper.batchInsertOrUpdate(deptList, enterpriseId);
|
||||
}
|
||||
|
||||
public List<QueryDeptChildDTO> getDeptChildListByParentId(String eid, String parentId){
|
||||
if(StringUtils.isAnyBlank(eid, parentId)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return sysDepartmentMapper.getDeptChildListByParentId(eid, parentId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,16 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.UserRegionMappingDO;
|
||||
import com.cool.store.mapper.UserRegionMappingMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
@@ -9,4 +18,36 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class UserRegionMappingDAO {
|
||||
|
||||
@Resource
|
||||
private UserRegionMappingMapper userRegionMappingMapper;
|
||||
|
||||
|
||||
public void deletedByUserIds(String enterpriseId, List<String> userIds){
|
||||
if (CollectionUtils.isEmpty(userIds)) {
|
||||
return;
|
||||
}
|
||||
List<String> distinctData = userIds.stream()
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
userRegionMappingMapper.deletedByUserIds(enterpriseId, distinctData);
|
||||
}
|
||||
|
||||
public void batchInsertRegionMapping(String enterpriseId, List<UserRegionMappingDO> userRegionMappingDOS){
|
||||
if (CollectionUtils.isEmpty(userRegionMappingDOS)) {
|
||||
return;
|
||||
}
|
||||
List<UserRegionMappingDO> distinctData = userRegionMappingDOS.stream()
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
userRegionMappingMapper.batchInsertRegionMapping(enterpriseId, distinctData);
|
||||
}
|
||||
|
||||
|
||||
public List<UserRegionMappingDO> listUserRegionMappingByUserId(String enterpriseId, List<String> userIds){
|
||||
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(userIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return userRegionMappingMapper.listUserRegionMappingByUserId(enterpriseId, userIds);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.EnterpriseDO;
|
||||
import com.cool.store.entity.EnterpriseDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,4 +40,12 @@ public interface EnterpriseUserMapper {
|
||||
*/
|
||||
void batchInsertOrUpdate(@Param("enterpriseId") String enterpriseId, @Param("list") List<EnterpriseUserDO> users);
|
||||
|
||||
/**
|
||||
* 批量更新不同用户 不同的userRegionids
|
||||
* @param eid
|
||||
* @param enterpriseUserDOList
|
||||
* @return
|
||||
*/
|
||||
Boolean batchUpdateDiffUserDiffRegionIds(@Param("eid") String eid, @Param("list") List<EnterpriseUserDO> enterpriseUserDOList);
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.LoginRecordDO;
|
||||
import com.cool.store.entity.LoginRecordDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.cool.store.mapper;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:59
|
||||
@@ -22,4 +24,17 @@ public interface RegionMapper {
|
||||
* dateTime:2023-05-19 02:59
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") RegionDO record, @Param("enterpriseId") String enterpriseId);
|
||||
|
||||
List<Long> selectRegionIdsBySynDingDeptIds(@Param("eid") String eid, @Param("synDingDeptIds") List<String> synDingDeptIds);
|
||||
|
||||
List<RegionDO> getRegionByRegionIds(@Param("eid") String eid, @Param("regionIds") List<String> regionIds);
|
||||
|
||||
|
||||
RegionDO getUnclassifiedRegionDO(@Param("enterpriseId") String enterpriseId, @Param("name")String name);
|
||||
|
||||
Long insertRoot(@Param("eid") String eid, @Param("region") RegionDO regionDO);
|
||||
|
||||
Integer batchInsertRegionsByDepartments(@Param("eid") String eid, @Param("regions") List<RegionDO> regions);
|
||||
|
||||
List<RegionDO> selectRegionBySynDingDeptIds(@Param("eid") String eid, @Param("synDingDeptIds") List<String> synDingDeptIds);
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.enterprise.QueryDeptChildDTO;
|
||||
import com.cool.store.entity.SysDepartmentDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
@@ -22,4 +25,8 @@ public interface SysDepartmentMapper {
|
||||
* dateTime:2023-05-19 03:00
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") SysDepartmentDO record, @Param("enterpriseId") String enterpriseId);
|
||||
|
||||
void batchInsertOrUpdate(@Param("list") List<SysDepartmentDO> sysDepartmentDOList, @Param("eid") String eid);
|
||||
|
||||
List<QueryDeptChildDTO> getDeptChildListByParentId(@Param("eid") String eid, @Param("parentId") String parentId);
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.cool.store.mapper;
|
||||
import com.cool.store.entity.UserRegionMappingDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
@@ -22,4 +24,10 @@ public interface UserRegionMappingMapper {
|
||||
* dateTime:2023-05-19 03:00
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") UserRegionMappingDO record, @Param("enterpriseId") String enterpriseId);
|
||||
|
||||
void batchInsertRegionMapping(@Param("enterpriseId") String enterpriseId,@Param("userRegionMappingDOS") List<UserRegionMappingDO> userRegionMappingDOS);
|
||||
|
||||
void deletedByUserIds(@Param("enterpriseId") String enterpriseId,@Param("userIds") List<String> userIds);
|
||||
|
||||
List<UserRegionMappingDO> listUserRegionMappingByUserId(@Param("enterpriseId") String enterpriseId, @Param("userIds") List<String> userIds);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.model.entity.EnterpriseDO">
|
||||
<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"/>
|
||||
|
||||
@@ -467,4 +467,17 @@
|
||||
roles=values(roles),
|
||||
jobnumber=values(jobnumber)
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="batchUpdateDiffUserDiffRegionIds">
|
||||
update enterprise_user_${eid}
|
||||
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>
|
||||
</mapper>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.LoginRecordMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.LoginRecordDO">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.LoginRecordDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||
|
||||
@@ -202,4 +202,142 @@
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="selectRegionIdsBySynDingDeptIds" resultType="java.lang.Long">
|
||||
select
|
||||
id
|
||||
from region_${eid}
|
||||
where
|
||||
deleted = 0 and syn_ding_dept_id in
|
||||
<foreach collection="synDingDeptIds" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getRegionByRegionIds" resultMap="BaseResultMap">
|
||||
select
|
||||
id ,
|
||||
id as regionId,
|
||||
name ,
|
||||
parent_id as parentId,
|
||||
group_id as groupId,
|
||||
create_time as createTime,
|
||||
create_name as createName,
|
||||
syn_ding_dept_id as synDingDeptId,
|
||||
update_time as updateTime,
|
||||
update_name as updateName,
|
||||
region_path as regionPath,
|
||||
store_num as storeNum,
|
||||
store_id as storeId,
|
||||
region_type as regionType
|
||||
from region_${eid} where id in
|
||||
<foreach collection="regionIds" index="index" item="regionId"
|
||||
separator="," open="(" close=")">
|
||||
#{regionId, jdbcType=BIGINT}
|
||||
</foreach>
|
||||
and deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="getUnclassifiedRegionDO" resultMap="BaseResultMap">
|
||||
select
|
||||
id ,
|
||||
id as regionId,
|
||||
name as name ,
|
||||
parent_id as parentId,
|
||||
group_id as groupId,
|
||||
create_time as createTime,
|
||||
create_name as createName,
|
||||
update_time as updateTime,
|
||||
update_name as updateName,
|
||||
vds_group_corp_id as vdsGroupCorpId,
|
||||
syn_ding_dept_id as synDingDeptId,
|
||||
region_type as regionType,
|
||||
deleted as deleted,
|
||||
region_path as regionPath,
|
||||
store_num as storeNum,
|
||||
unclassified_flag as unclassifiedFlag
|
||||
from region_${enterpriseId}
|
||||
where deleted = 0 and unclassified_flag = 1
|
||||
and (name = #{name} or id = 1) limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertRoot">
|
||||
insert ignore into region_${eid}
|
||||
(
|
||||
id,
|
||||
region_id,
|
||||
name,
|
||||
parent_id,
|
||||
group_id,
|
||||
create_time,
|
||||
syn_ding_dept_id,
|
||||
create_name,
|
||||
region_type,
|
||||
region_path,
|
||||
store_num,
|
||||
unclassified_flag)
|
||||
values
|
||||
(
|
||||
#{region.id, jdbcType=BIGINT},
|
||||
#{region.regionId, jdbcType=VARCHAR},
|
||||
#{region.name, jdbcType=VARCHAR},
|
||||
#{region.parentId, jdbcType=VARCHAR},
|
||||
#{region.groupId, jdbcType=VARCHAR},
|
||||
#{region.createTime, jdbcType=BIGINT},
|
||||
#{region.synDingDeptId, jdbcType=VARCHAR},
|
||||
#{region.createName, jdbcType=VARCHAR},
|
||||
#{region.regionType, jdbcType=VARCHAR},
|
||||
#{region.regionPath},
|
||||
#{region.storeNum},
|
||||
#{region.unclassifiedFlag}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="batchInsertRegionsByDepartments">
|
||||
insert into region_${eid}
|
||||
(
|
||||
id,
|
||||
name,
|
||||
parent_id,
|
||||
group_id,
|
||||
create_time,
|
||||
syn_ding_dept_id,
|
||||
region_path,
|
||||
region_type,
|
||||
order_num,
|
||||
create_name,
|
||||
store_id
|
||||
)
|
||||
values
|
||||
<foreach collection="regions" item="region" separator=",">
|
||||
(
|
||||
#{region.id},
|
||||
#{region.name},
|
||||
#{region.parentId},
|
||||
#{region.groupId},
|
||||
#{region.createTime},
|
||||
#{region.synDingDeptId},
|
||||
#{region.regionPath},
|
||||
#{region.regionType},
|
||||
#{region.orderNum},
|
||||
#{region.createName},
|
||||
#{region.storeId}
|
||||
)
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE
|
||||
name=values(name), parent_id=values(parent_id), region_path=values(region_path),region_type=values(region_type),order_num=values(order_num)
|
||||
</insert>
|
||||
|
||||
<select id="selectRegionBySynDingDeptIds" resultMap="BaseResultMap">
|
||||
select
|
||||
id,
|
||||
syn_ding_dept_id
|
||||
from region_${eid}
|
||||
where deleted = 0 and syn_ding_dept_id in (
|
||||
<foreach collection="synDingDeptIds" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -197,4 +197,36 @@
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<insert id="batchInsertOrUpdate" parameterType="java.util.List">
|
||||
insert into sys_department_${eid}
|
||||
(
|
||||
id,
|
||||
name,
|
||||
parent_id,
|
||||
depart_order,
|
||||
auto_add_user
|
||||
) values
|
||||
<foreach collection="list" item="it" separator=",">
|
||||
(
|
||||
#{it.id, jdbcType=BIGINT},
|
||||
#{it.name, jdbcType=VARCHAR},
|
||||
#{it.parentId, jdbcType=BIGINT},
|
||||
#{it.departOrder, jdbcType=INTEGER},
|
||||
#{it.autoAddUser, jdbcType=BOOLEAN}
|
||||
)
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE name=values(name), parent_id=values(parent_id)
|
||||
</insert>
|
||||
|
||||
<select id="getDeptChildListByParentId"
|
||||
resultType="com.cool.store.dto.enterprise.QueryDeptChildDTO">
|
||||
select
|
||||
id,
|
||||
name,
|
||||
depart_order as departOrder,
|
||||
parent_id as parentId
|
||||
from sys_department_${eid}
|
||||
where parent_id = #{parentId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -80,4 +80,46 @@
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<delete id="deletedByUserIds">
|
||||
delete from user_region_mapping_${enterpriseId} where user_id in
|
||||
<foreach collection="userIds" open="(" close=")" separator="," item="userId">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertRegionMapping">
|
||||
insert into user_region_mapping_${enterpriseId}
|
||||
(
|
||||
region_id,
|
||||
user_id,
|
||||
create_time,
|
||||
update_time,
|
||||
create_id,
|
||||
update_id
|
||||
)
|
||||
values
|
||||
<foreach collection="userRegionMappingDOS" item="entity" separator=",">
|
||||
(
|
||||
#{entity.regionId},
|
||||
#{entity.userId},
|
||||
#{entity.createTime},
|
||||
#{entity.updateTime},
|
||||
#{entity.createId},
|
||||
#{entity.updateId}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="listUserRegionMappingByUserId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from user_region_mapping_${enterpriseId}
|
||||
<if test="userIds !=null and userIds.size >0">
|
||||
where user_id in
|
||||
<foreach collection="userIds" open="(" close=")" separator="," item="userId">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -72,6 +72,7 @@
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.coolstore:coolstore-base:1.5.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-starter:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.4" level="project" />
|
||||
@@ -87,7 +88,6 @@
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.cool.store.dto.enterprise;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
public class AgentInfoDTO {
|
||||
|
||||
@JSONField(name = "agentid")
|
||||
private Long agentId;
|
||||
|
||||
@JSONField(name = "appid")
|
||||
private Long appId;
|
||||
|
||||
@JSONField(name = "auth_mode")
|
||||
private Integer authMode;
|
||||
|
||||
public Long getAgentId() {
|
||||
return agentId;
|
||||
}
|
||||
|
||||
public void setAgentId(Long agentId) {
|
||||
this.agentId = agentId;
|
||||
}
|
||||
|
||||
public Long getAppId() {
|
||||
return appId;
|
||||
}
|
||||
|
||||
public void setAppId(Long appId) {
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
public Integer getAuthMode() {
|
||||
return authMode;
|
||||
}
|
||||
|
||||
public void setAuthMode(Integer authMode) {
|
||||
this.authMode = authMode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.cool.store.dto.enterprise;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业标识信息
|
||||
*/
|
||||
public class AuthAgentInfoDTO {
|
||||
|
||||
@JSONField(name = "agent")
|
||||
private List<AgentInfoDTO> agentInfos;
|
||||
|
||||
public List<AgentInfoDTO> getAgentInfos() {
|
||||
return agentInfos;
|
||||
}
|
||||
|
||||
public void setAgentInfos(List<AgentInfoDTO> agentInfos) {
|
||||
this.agentInfos = agentInfos;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.cool.store.dto.enterprise;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 授权企业信息
|
||||
* @author zhangchenbiao
|
||||
* @date 2022-01-18 04:40
|
||||
*/
|
||||
@Data
|
||||
public class AuthCorpInfoDTO {
|
||||
|
||||
@JSONField(name = "corp_logo_url")
|
||||
private String corpLogoUrl;
|
||||
|
||||
@JSONField(name = "corp_name")
|
||||
private String corpName;
|
||||
|
||||
@JSONField(name = "corpid")
|
||||
private String corpId;
|
||||
|
||||
private String industry;
|
||||
|
||||
@JSONField(name = "auth_channel")
|
||||
private String authChannel;
|
||||
|
||||
@JSONField(name = "auth_channel_type")
|
||||
private String authChannelType;
|
||||
|
||||
@JSONField(name = "is_authenticated")
|
||||
private boolean isAuthenticated;
|
||||
|
||||
@JSONField(name = "auth_level")
|
||||
private int authLevel;
|
||||
|
||||
@JSONField(name = "corp_province")
|
||||
private String corpProvince;
|
||||
@JSONField(name = "corp_city")
|
||||
private String corpCity;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.cool.store.dto.enterprise;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* 企业开通授权信息
|
||||
* @author zhangchenbiao
|
||||
* @date 2022-01-18 04:40
|
||||
*/
|
||||
public class AuthInfoDTO {
|
||||
|
||||
@JSONField(name = "auth_corp_info")
|
||||
private AuthCorpInfoDTO authCorpInfo;
|
||||
|
||||
@JSONField(name = "auth_user_info")
|
||||
private AuthUserInfoDTO authUserInfo;
|
||||
|
||||
@JSONField(name = "auth_info")
|
||||
private AuthAgentInfoDTO authAgentInfo;
|
||||
|
||||
public AuthCorpInfoDTO getAuthCorpInfo() {
|
||||
return authCorpInfo;
|
||||
}
|
||||
|
||||
public void setAuthCorpInfo(AuthCorpInfoDTO authCorpInfo) {
|
||||
this.authCorpInfo = authCorpInfo;
|
||||
}
|
||||
|
||||
public AuthUserInfoDTO getAuthUserInfo() {
|
||||
return authUserInfo;
|
||||
}
|
||||
|
||||
public void setAuthUserInfo(AuthUserInfoDTO authUserInfo) {
|
||||
this.authUserInfo = authUserInfo;
|
||||
}
|
||||
|
||||
public AuthAgentInfoDTO getAuthAgentInfo() {
|
||||
return authAgentInfo;
|
||||
}
|
||||
|
||||
public void setAuthAgentInfo(AuthAgentInfoDTO authAgentInfo) {
|
||||
this.authAgentInfo = authAgentInfo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.cool.store.dto.enterprise;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 钉钉通讯录授权范围
|
||||
* @author zhangchenbiao
|
||||
* @date 2022-01-18 04:40
|
||||
*/
|
||||
public class AuthScopeDTO {
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
private List<String> deptIdList;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private List<String> userIdList;
|
||||
|
||||
public List<String> getDeptIdList() {
|
||||
return deptIdList;
|
||||
}
|
||||
|
||||
public void setDeptIdList(List<String> deptIdList) {
|
||||
this.deptIdList = deptIdList;
|
||||
}
|
||||
|
||||
public List<String> getUserIdList() {
|
||||
return userIdList;
|
||||
}
|
||||
|
||||
public void setUserIdList(List<String> userIdList) {
|
||||
this.userIdList = userIdList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.cool.store.dto.enterprise;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* 授权用户信息
|
||||
* @author zhangchenbiao
|
||||
* @date 2022-01-18 04:40
|
||||
*/
|
||||
public class AuthUserInfoDTO {
|
||||
|
||||
@JSONField(name = "userId")
|
||||
private String userId;
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
}
|
||||
@@ -153,4 +153,44 @@ public class EnterpriseUserDTO implements Serializable {
|
||||
return enterpriseUserDO;
|
||||
}
|
||||
|
||||
|
||||
public static EnterpriseUserDO convertEnterpriseUserDTO2EnterpriseUserDO(EnterpriseUserDTO dto){
|
||||
if(dto == null){
|
||||
return null;
|
||||
}
|
||||
EnterpriseUserDO enterpriseUserDO = new EnterpriseUserDO();
|
||||
enterpriseUserDO.setName(dto.getName());
|
||||
enterpriseUserDO.setId(dto.getId());
|
||||
enterpriseUserDO.setUserId(dto.getUserId());
|
||||
enterpriseUserDO.setTel(dto.getTel());
|
||||
enterpriseUserDO.setWorkPlace(dto.getWorkPlace());
|
||||
enterpriseUserDO.setRemark(dto.getRemark());
|
||||
enterpriseUserDO.setMobile(dto.getMobile());
|
||||
enterpriseUserDO.setEmail(dto.getEmail());
|
||||
enterpriseUserDO.setOrgEmail(dto.getOrgEmail());
|
||||
enterpriseUserDO.setActive(dto.getActive());
|
||||
enterpriseUserDO.setOrderInDepts(dto.getOrderInDepts());
|
||||
enterpriseUserDO.setIsAdmin(dto.getIsAdmin());
|
||||
enterpriseUserDO.setIsBoss(dto.getIsBoss());
|
||||
enterpriseUserDO.setDingid(dto.getDingid());
|
||||
enterpriseUserDO.setUnionid(dto.getUnionid());
|
||||
enterpriseUserDO.setIsHide(dto.getIsHide());
|
||||
enterpriseUserDO.setPosition(dto.getPosition());
|
||||
enterpriseUserDO.setAvatar(dto.getAvatar());
|
||||
enterpriseUserDO.setExtattr(dto.getExtattr());
|
||||
enterpriseUserDO.setIsEnterprise(dto.getIsEnterprise());
|
||||
enterpriseUserDO.setRoles(dto.getRoles());
|
||||
enterpriseUserDO.setIsLeader(dto.getIsLeader());
|
||||
enterpriseUserDO.setCreateTime(dto.getCreateTime());
|
||||
enterpriseUserDO.setLanguage(dto.getLanguage());
|
||||
enterpriseUserDO.setIsLeaderInDepts(JSONObject.toJSONString(dto.getIsLeaderInDepts()));
|
||||
enterpriseUserDO.setJobnumber(dto.getJobnumber());
|
||||
enterpriseUserDO.setMonitoredDepartments(dto.getMonitoredDepartments());
|
||||
/*enterpriseUserDO.setAppType(dto.getAppType());
|
||||
enterpriseUserDO.setPassword(dto.getPassword());*/
|
||||
enterpriseUserDO.setThirdOaUniqueFlag(dto.getThirdOaUniqueFlag());
|
||||
return enterpriseUserDO;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.cool.store.dto.enterprise;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 邵凌志
|
||||
* @date 2020/12/9 16:29
|
||||
*/
|
||||
@Data
|
||||
public class QueryDeptChildDTO {
|
||||
|
||||
private String id;
|
||||
|
||||
private String parentId;
|
||||
|
||||
private String name;
|
||||
/**
|
||||
* 部门次序
|
||||
*/
|
||||
private Integer departOrder;
|
||||
|
||||
private String path;
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
package com.cool.store.dto.enterprise;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName SysDepartmentDO
|
||||
* @Description
|
||||
* @author 王春辉
|
||||
*/
|
||||
@Data
|
||||
public class SysDepartmentDTO {
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 父部门id,根部门为1
|
||||
*/
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 在父部门中的次序值
|
||||
*/
|
||||
private Integer departOrder;
|
||||
|
||||
/**
|
||||
* 是否同步创建一个关联此部门的企业群, true表示是, false表示不是
|
||||
*/
|
||||
private Boolean createDeptGroup;
|
||||
|
||||
/**
|
||||
* 当群已经创建后,是否有新人加入部门会自动加入该群, true表示是, false表示不是
|
||||
*/
|
||||
private Boolean autoAddUser;
|
||||
|
||||
/**
|
||||
* 是否隐藏部门, true表示隐藏, false表示显示
|
||||
*/
|
||||
private Boolean depHiding;
|
||||
|
||||
/**
|
||||
* 可以查看指定隐藏部门的其他部门列表,如果部门隐藏,则此值生效,取值为其他的部门id组成的的字符串,使用|符号进行分割
|
||||
*/
|
||||
private String deptPerimits;
|
||||
|
||||
/**
|
||||
* 可以查看指定隐藏部门的其他人员列表,如果部门隐藏,则此值生效,取值为其他的人员userid组成的的字符串,使用|符号进行分割
|
||||
*/
|
||||
private String userPerimits;
|
||||
|
||||
/**
|
||||
* 是否本部门的员工仅可见员工自己, 为true时,本部门员工默认只能看到员工自己
|
||||
*/
|
||||
private Boolean outerDept;
|
||||
|
||||
/**
|
||||
* 本部门的员工仅可见员工自己为true时,可以配置额外可见部门,值为部门id组成的的字符串,使用|符号进行分割
|
||||
*/
|
||||
private String outerPermitDepts;
|
||||
|
||||
/**
|
||||
* 本部门的员工仅可见员工自己为true时,可以配置额外可见人员,值为userid组成的的字符串,使用| 符号进行分割
|
||||
*/
|
||||
private String outerPermitUsers;
|
||||
|
||||
/**
|
||||
* 企业群群主
|
||||
*/
|
||||
private String orgDeptOwner;
|
||||
|
||||
/**
|
||||
* 部门的主管列表,取值为由主管的userid组成的字符串,不同的userid使用|符号进行分割
|
||||
*/
|
||||
private String deptManagerUseridList;
|
||||
|
||||
|
||||
/**
|
||||
* 该部门下所有的用户数,包括子部门
|
||||
*/
|
||||
private Integer userCount;
|
||||
|
||||
/**
|
||||
* 部门下所有未激活的用户数,包括子部门
|
||||
*/
|
||||
private Integer unactiveUserCount;
|
||||
|
||||
/**
|
||||
* 父级部门ids
|
||||
*/
|
||||
private String parentIds;
|
||||
|
||||
/**
|
||||
* 子部门ids
|
||||
*/
|
||||
private String subIds;
|
||||
|
||||
|
||||
public SysDepartmentDTO() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
*
|
||||
* @param nodeId 节点Id
|
||||
*/
|
||||
public SysDepartmentDTO(String nodeId) {
|
||||
this.id = nodeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
*
|
||||
* @param nodeId 节点Id
|
||||
* @param parentId 父节点Id
|
||||
*/
|
||||
|
||||
public SysDepartmentDTO(String nodeId, String parentId) {
|
||||
this.id = nodeId;
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置部门名称
|
||||
*
|
||||
* @param name 部门名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
this.name = name.replaceAll("[\\ud800\\udc00-\\udbff\\udfff\\ud800-\\udfff]", "");
|
||||
if (StringUtils.isBlank(this.name)) {
|
||||
this.name = "空";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取父部门id,根部门为1
|
||||
*
|
||||
* @return parent_id - 父部门id,根部门为1
|
||||
*/
|
||||
public String getParentId() {
|
||||
if (id.equals(CommonConstants.ROOT_DEPT_ID_STR)) {
|
||||
return null;
|
||||
}
|
||||
return parentId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SysDepartment{" +
|
||||
"id=" + id +
|
||||
", parentId=" + parentId + ",name='" + name + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
SysDepartmentDTO that = (SysDepartmentDTO) o;
|
||||
return Objects.equals(id, that.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,14 @@
|
||||
package com.cool.store.model.entity;
|
||||
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;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangchenbiao
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.cool.store.model.entity;
|
||||
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;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author zhangchenbiao
|
||||
@@ -6,6 +6,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -28,7 +29,7 @@ public class RegionDO implements Serializable {
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("父区域id")
|
||||
private Long parentId;
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty("阿里云分组id")
|
||||
private String groupId;
|
||||
@@ -74,4 +75,15 @@ public class RegionDO implements Serializable {
|
||||
|
||||
@ApiModelProperty("第三方唯一id")
|
||||
private String thirdDeptId;
|
||||
|
||||
public String getFullRegionPath() {
|
||||
if(id != null && id == 1L){
|
||||
return "/1/";
|
||||
}
|
||||
if (StringUtils.isNotBlank(regionPath)) {
|
||||
return regionPath + id + "/";
|
||||
} else {
|
||||
return "/" + id + "/";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName EnterpriseUserDO
|
||||
* @Description 用于封装EnterpriseUserDO和部门字段
|
||||
* @author 首亮
|
||||
*/
|
||||
@Data
|
||||
public class EnterpriseUserRequest {
|
||||
|
||||
private EnterpriseUserDO enterpriseUserDO;
|
||||
|
||||
private String department;
|
||||
|
||||
private String departments;
|
||||
|
||||
private List<String> departmentLists;
|
||||
|
||||
private List<String> leaderInDepts;
|
||||
}
|
||||
@@ -67,6 +67,7 @@
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.coolstore:coolstore-base:1.5.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />
|
||||
@@ -93,7 +94,6 @@
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.cool.store.consumer;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyun.openservices.ons.api.Action;
|
||||
import com.aliyun.openservices.ons.api.ConsumeContext;
|
||||
import com.aliyun.openservices.ons.api.Message;
|
||||
import com.aliyun.openservices.ons.api.MessageListener;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.enterprise.EnterpriseInitDTO;
|
||||
import com.cool.store.enums.EnterpriseStatusEnum;
|
||||
import com.cool.store.service.EnterpriseInitService;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.coolstore.base.enums.AppTypeEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 企业开通初始化
|
||||
*
|
||||
* @author chenyupeng
|
||||
* @since 2022/1/26
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class EnterpriseInitListener implements MessageListener {
|
||||
@Resource
|
||||
private EnterpriseInitService enterpriseInitService;
|
||||
@Autowired
|
||||
private RedisUtilPool redisUtilPool;
|
||||
|
||||
@Override
|
||||
public Action consume(Message message, ConsumeContext consumeContext) {
|
||||
if(message.getReconsumeTimes() + 1 >= Integer.parseInt(CommonConstants.MaxReconsumeTimes)){
|
||||
//超过最大消费次数
|
||||
return Action.CommitMessage;
|
||||
}
|
||||
String text = new String(message.getBody());
|
||||
if(StringUtils.isBlank(text)){
|
||||
return Action.CommitMessage;
|
||||
}
|
||||
String lockKey = "EnterpriseInitDataSync:" + message.getMsgID();
|
||||
EnterpriseInitDTO enterpriseInitDTO = JSONObject.parseObject(text, EnterpriseInitDTO.class);
|
||||
log.info("EnterpriseInitListener messageId:{},try times:{}, receive data :{}", message.getMsgID(), message.getReconsumeTimes(), JSONObject.toJSONString(enterpriseInitDTO));
|
||||
boolean lock = redisUtilPool.setNxExpire(lockKey, message.getMsgID(), CommonConstants.ENTERPRISE_OPEN_LOCK_TIMES);
|
||||
if (lock) {
|
||||
try {
|
||||
String appType = enterpriseInitDTO.getAppType();
|
||||
String enterpriseStatusKey = MessageFormat.format(CommonConstants.ENTERPRISE_OPEN_STATUS_KEY, enterpriseInitDTO.getCorpId(), enterpriseInitDTO.getAppType());
|
||||
enterpriseInitService.enterpriseInit(enterpriseInitDTO.getCorpId(), AppTypeEnum.getAppType(enterpriseInitDTO.getAppType()),
|
||||
enterpriseInitDTO.getEid(), enterpriseInitDTO.getDbName(), enterpriseInitDTO.getUserId());
|
||||
enterpriseInitService.sendOpenSucceededMsg(enterpriseInitDTO.getCorpId(), enterpriseInitDTO.getAppType(), Arrays.asList(enterpriseInitDTO.getUserId()));
|
||||
//更新企业开通缓存状态
|
||||
redisUtilPool.setString(enterpriseStatusKey, String.valueOf(EnterpriseStatusEnum.NORMAL.getCode()), CommonConstants.ONE_DAY_SECONDS);
|
||||
return Action.CommitMessage;
|
||||
} catch (Exception e) {
|
||||
log.error("has exception", e);
|
||||
} finally {
|
||||
redisUtilPool.delKey(lockKey);
|
||||
}
|
||||
}
|
||||
return Action.CommitMessage;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.cool.store.consumer;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.aliyun.openservices.ons.api.Action;
|
||||
import com.aliyun.openservices.ons.api.ConsumeContext;
|
||||
import com.aliyun.openservices.ons.api.Message;
|
||||
import com.aliyun.openservices.ons.api.MessageListener;
|
||||
import com.cool.store.dto.enterprise.EnterpriseOpenMsg;
|
||||
import com.cool.store.service.EnterpriseInitService;
|
||||
import com.coolstore.base.enums.RocketMqTagEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 执行企业端脚本消息监听
|
||||
* @author :xugangkun
|
||||
* @date :2022/2/11 15:32
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class EnterpriseScriptListener implements MessageListener {
|
||||
|
||||
@Resource
|
||||
private EnterpriseInitService enterpriseInitService;
|
||||
|
||||
@Override
|
||||
public Action consume(Message message, ConsumeContext consumeContext) {
|
||||
String text = new String(message.getBody());
|
||||
log.info("EnterpriseScriptListener messageId:{}, msg:{}", message.getMsgID(), text);
|
||||
if(StringUtils.isBlank(text)){
|
||||
return Action.CommitMessage;
|
||||
}
|
||||
switch (RocketMqTagEnum.getByTag(message.getTag())){
|
||||
case ENTERPRISE_OPEN_ENTERPRISE_RUN_SCRIPT:
|
||||
log.info("run Enterprise Script start");
|
||||
EnterpriseOpenMsg msg = null;
|
||||
try {
|
||||
msg = JSON.parseObject(text, EnterpriseOpenMsg.class);
|
||||
} catch (Exception e) {
|
||||
log.error("invalid auth msg={}", text);
|
||||
}
|
||||
enterpriseInitService.runEnterpriseScript(msg);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return Action.CommitMessage;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.cool.store.http;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dto.enterprise.AuthInfoDTO;
|
||||
import com.cool.store.dto.enterprise.AuthScopeDTO;
|
||||
import com.cool.store.dto.enterprise.EnterpriseUserDTO;
|
||||
import com.cool.store.dto.enterprise.SysDepartmentDTO;
|
||||
import com.cool.store.dto.login.UserIdInfoDTO;
|
||||
import com.cool.store.utils.RestTemplateUtil;
|
||||
import com.coolstore.base.dto.ResultDTO;
|
||||
@@ -10,6 +13,8 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -46,9 +51,13 @@ public class ISVHttpRequest {
|
||||
|
||||
public EnterpriseUserDTO getUserDetailByUserId(String corpId, String userId, String appType){
|
||||
String url = isvDomain + "/isv/user/getUserDetail";
|
||||
HashMap requestMap = new HashMap();
|
||||
requestMap.put("corpId", corpId);
|
||||
requestMap.put("userId", userId);
|
||||
requestMap.put("appType", appType);
|
||||
ResponseEntity<ResultDTO> responseEntity = null;
|
||||
try {
|
||||
responseEntity = RestTemplateUtil.loadGet(url, ResultDTO.class);
|
||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
||||
return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getBody().getData()), EnterpriseUserDTO.class);
|
||||
@@ -58,4 +67,115 @@ public class ISVHttpRequest {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<String> getAdminUserList(String corpId, String appType){
|
||||
String url = isvDomain + "/isv/corp/getAdminUserList";
|
||||
HashMap requestMap = new HashMap();
|
||||
requestMap.put("corpId", corpId);
|
||||
requestMap.put("appType", appType);
|
||||
ResponseEntity<ResultDTO> responseEntity = null;
|
||||
try {
|
||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
||||
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getBody().getData()), String.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("调用isv出错{}", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public AuthInfoDTO getAuthInfo(String corpId, String appType){
|
||||
String url = isvDomain + "/isv/corp/getAuthInfo";
|
||||
HashMap requestMap = new HashMap();
|
||||
requestMap.put("corpId", corpId);
|
||||
requestMap.put("appType", appType);
|
||||
ResponseEntity<ResultDTO> responseEntity = null;
|
||||
try {
|
||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
||||
return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getBody().getData()), AuthInfoDTO.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("调用isv出错{}", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<SysDepartmentDTO> getDepartments(String corpId, String appType, String parentId){
|
||||
String url = isvDomain + "/isv/corp/getDepartments";
|
||||
HashMap requestMap = new HashMap();
|
||||
requestMap.put("corpId", corpId);
|
||||
requestMap.put("appType", appType);
|
||||
requestMap.put("parentId", parentId);
|
||||
ResponseEntity<ResultDTO> responseEntity = null;
|
||||
try {
|
||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
||||
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getBody().getData()), SysDepartmentDTO.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("调用isv出错{}", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public AuthScopeDTO getAuthScope(String corpId, String appType){
|
||||
String url = isvDomain + "/isv/corp/getAuthScope";
|
||||
HashMap requestMap = new HashMap();
|
||||
requestMap.put("corpId", corpId);
|
||||
requestMap.put("appType", appType);
|
||||
ResponseEntity<ResultDTO> responseEntity = null;
|
||||
try {
|
||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
||||
return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getBody().getData()), AuthScopeDTO.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("调用isv出错{}", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDTO> getDepartmentUsers(String corpId, String appType, String deptId){
|
||||
String url = isvDomain + "/isv/corp/getDepartmentUsers";
|
||||
HashMap requestMap = new HashMap();
|
||||
requestMap.put("corpId", corpId);
|
||||
requestMap.put("appType", appType);
|
||||
requestMap.put("deptId", deptId);
|
||||
ResponseEntity<ResultDTO> responseEntity = null;
|
||||
try {
|
||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
||||
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getBody().getData()), EnterpriseUserDTO.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("调用isv出错{}", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDTO> getUserDetailByUserIds(String corpId, List<String> userIdList, String appType) {
|
||||
String url = isvDomain + "/isv/corp/getDepartmentUsers";
|
||||
HashMap requestMap = new HashMap();
|
||||
requestMap.put("corpId", corpId);
|
||||
requestMap.put("appType", appType);
|
||||
requestMap.put("userIds", userIdList);
|
||||
ResponseEntity<ResultDTO> responseEntity = null;
|
||||
try {
|
||||
responseEntity = RestTemplateUtil.get(url, ResultDTO.class, requestMap);
|
||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
||||
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getBody().getData()), EnterpriseUserDTO.class);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("调用isv出错{}", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,12 @@ import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.utils.RestTemplateUtil;
|
||||
import com.coolstore.base.dto.ResultDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.crypto.hash.Hash;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -25,9 +28,13 @@ public class WechatRest {
|
||||
|
||||
public CodeSessionDTO miniProgramJsCodeSession(String appId, String secret, String jsCode){
|
||||
String url = "https://api.weixin.qq.com/sns/jscode2session";
|
||||
Map requestMap = new HashMap<String, String>();
|
||||
requestMap.put("appId", appId);
|
||||
requestMap.put("secret", secret);
|
||||
requestMap.put("jsCode", jsCode);
|
||||
ResponseEntity<CodeSessionDTO> responseEntity = null;
|
||||
try {
|
||||
responseEntity = RestTemplateUtil.loadGet(url, CodeSessionDTO.class);
|
||||
responseEntity = RestTemplateUtil.get(url, CodeSessionDTO.class);
|
||||
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
|
||||
if(Objects.nonNull(responseEntity.getBody()) && responseEntity.getBody().isSuccess()){
|
||||
return responseEntity.getBody();
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.dto.enterprise.EnterpriseOpenMsg;
|
||||
import com.coolstore.base.enums.AppTypeEnum;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: EnterpriseInitService
|
||||
* @Description:
|
||||
* @date 2023-05-29 15:43
|
||||
*/
|
||||
public interface EnterpriseInitService {
|
||||
|
||||
void runEnterpriseScript(EnterpriseOpenMsg msg);
|
||||
|
||||
|
||||
void enterpriseInit(String cropId, AppTypeEnum appType, String eid, String dbName, String openUserId);
|
||||
|
||||
void sendOpenSucceededMsg(String corpId, String appType, List<String> userList);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: EnterpriseUserService
|
||||
* @Description: 用户service
|
||||
* @date 2023-05-29 19:58
|
||||
*/
|
||||
public interface EnterpriseUserService {
|
||||
|
||||
void updateUserRegionPathList(String enterpriseId, List<String> userIds);
|
||||
|
||||
}
|
||||
@@ -2,22 +2,32 @@ package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.EnterpriseUserRoleDAO;
|
||||
import com.cool.store.dao.SysRoleDAO;
|
||||
import com.cool.store.dto.enterprise.EnterpriseInitDTO;
|
||||
import com.cool.store.dto.enterprise.EnterpriseOpenMsg;
|
||||
import com.cool.store.dto.enterprise.EnterpriseUserDTO;
|
||||
import com.cool.store.dto.enterprise.EnterpriseUserRole;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.enterprise.*;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import com.cool.store.entity.SysDepartmentDO;
|
||||
import com.cool.store.entity.UserRegionMappingDO;
|
||||
import com.cool.store.enums.AIEnum;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.RegionTypeEnum;
|
||||
import com.cool.store.enums.RoleEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.http.ISVHttpRequest;
|
||||
import com.cool.store.mq.SimpleMessageService;
|
||||
import com.cool.store.request.EnterpriseUserRequest;
|
||||
import com.cool.store.service.EnterpriseInitService;
|
||||
import com.cool.store.service.EnterpriseUserService;
|
||||
import com.cool.store.utils.DataSourceHelper;
|
||||
import com.cool.store.utils.ListOptUtils;
|
||||
import com.cool.store.utils.ScriptUtil;
|
||||
import com.cool.store.utils.UUIDUtils;
|
||||
import com.coolstore.base.enums.AppTypeEnum;
|
||||
import com.coolstore.base.enums.RocketMqTagEnum;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.support.EncodedResource;
|
||||
@@ -25,6 +35,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -34,7 +45,7 @@ import java.util.*;
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class EnterpriseInitServiceImpl {
|
||||
public class EnterpriseInitServiceImpl implements EnterpriseInitService {
|
||||
|
||||
@Resource
|
||||
protected ScriptUtil scriptUtil;
|
||||
@@ -48,7 +59,16 @@ public class EnterpriseInitServiceImpl {
|
||||
private SimpleMessageService simpleMessageService;
|
||||
@Resource
|
||||
private ISVHttpRequest isvHttpRequest;
|
||||
@Resource
|
||||
private UserRegionMappingDAO userRegionMappingDAO;
|
||||
@Resource
|
||||
private RegionDAO regionDAO;
|
||||
@Resource
|
||||
private SysDepartmentDAO sysDepartmentDAO;
|
||||
@Resource
|
||||
private EnterpriseUserService enterpriseUserService;
|
||||
|
||||
@Override
|
||||
public void runEnterpriseScript(EnterpriseOpenMsg msg) {
|
||||
runEnterpriseScriptAndInitAuthUser(msg);
|
||||
//抛出开始数据同步消息
|
||||
@@ -62,6 +82,406 @@ public class EnterpriseInitServiceImpl {
|
||||
simpleMessageService.send(JSONObject.toJSONString(enterpriseInitDTO), RocketMqTagEnum.ENTERPRISE_OPEN_DATA_SYNC);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterpriseInit(String corpId, AppTypeEnum appTypeEnum, String eid, String dbName, String openUserId) {
|
||||
try {
|
||||
String appType = appTypeEnum.getValue();
|
||||
//优先处理ai用户 保证能够超登
|
||||
List<EnterpriseUserRequest> authUsers = new ArrayList<>();
|
||||
List<String> adminUserList = isvHttpRequest.getAdminUserList(corpId, appType);
|
||||
//添加ai用户
|
||||
authUsers.add(getAIUser());
|
||||
authUsers.addAll(getAdminList(adminUserList));
|
||||
DataSourceHelper.changeToSpecificDataSource(dbName);
|
||||
//获取开通授权信息
|
||||
AuthInfoDTO authInfo = isvHttpRequest.getAuthInfo(corpId, appType);
|
||||
//记录此次处理的用户的id,
|
||||
Set<String> handlerUserIds = new HashSet<>();
|
||||
//处理ai用户
|
||||
dealUsers(authUsers, eid, corpId, dbName, new HashMap<>(), null, authInfo, handlerUserIds);
|
||||
//初始化部门
|
||||
List<SysDepartmentDTO> sysDepartmentDTOS = initDept(corpId, eid, appType, dbName);
|
||||
if(CollectionUtils.isEmpty(sysDepartmentDTOS)){
|
||||
//构建跟部门
|
||||
SysDepartmentDTO root = new SysDepartmentDTO();
|
||||
root.setId(CommonConstants.ROOT_DEPT_ID_STR);
|
||||
root.setName(authInfo.getAuthCorpInfo().getCorpName());
|
||||
sysDepartmentDTOS.add(root);
|
||||
}
|
||||
//初始化根区域
|
||||
initRootRegion(sysDepartmentDTOS, eid, dbName);
|
||||
//初始化用户
|
||||
initUser(sysDepartmentDTOS,corpId,eid,appType,dbName, adminUserList, authInfo, handlerUserIds);
|
||||
} catch (Exception e) {
|
||||
log.error("enterpriseInit enterpriseInit error,corpId:{},appType:{}", corpId, appTypeEnum.getValue(), e);
|
||||
throw new ServiceException(ErrorCodeEnum.FEISHU_SERVICE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendOpenSucceededMsg(String corpId, String appType, List<String> userList) {
|
||||
if(CollectionUtils.isEmpty(userList)){
|
||||
return;
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("userList", userList);
|
||||
jsonObject.put("appType", appType);
|
||||
jsonObject.put("corpId", corpId);
|
||||
simpleMessageService.send(jsonObject.toJSONString(), RocketMqTagEnum.OPEN_SUCCEEDED_MSG_QUEUE);
|
||||
}
|
||||
|
||||
public void dealUsers(List<EnterpriseUserRequest> users, String eid, String corpId, String dbName,
|
||||
Map<String, String> deptIdMap, Long unclassifiedRegionId, AuthInfoDTO authInfo, Set<String> handlerUserIds) {
|
||||
|
||||
DataSourceHelper.changeToSpecificDataSource(dbName);
|
||||
try {
|
||||
insertUserRelatedInfo(users, eid, dbName, authInfo, handlerUserIds);
|
||||
//处理用户和区域的关系
|
||||
handlerUserRegionMapping(eid, users, unclassifiedRegionId);
|
||||
} catch (Exception e) {
|
||||
log.error("dealUsers insertUserRelatedInfo error, corpId={}", corpId, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void insertUserRelatedInfo(List<EnterpriseUserRequest> deptUsers, String eid, String dbName, AuthInfoDTO authInfo, Set<String> handlerUserIds) {
|
||||
|
||||
if (CollectionUtils.isEmpty(deptUsers)) {
|
||||
log.info("insertUserRelatedInfo deptUsers is empty,eid:{}",eid);
|
||||
return;
|
||||
}
|
||||
log.info("insertUserRelatedInfo-{}, deptUsersSize:{}",eid, deptUsers.size());
|
||||
DataSourceHelper.reset();
|
||||
//提取enterpriseUserDO
|
||||
List<EnterpriseUserDO> collect = ListUtils.emptyIfNull(deptUsers).stream()
|
||||
.map(EnterpriseUserRequest::getEnterpriseUserDO)
|
||||
.collect(Collectors.toList());
|
||||
DataSourceHelper.changeToSpecificDataSource(dbName);
|
||||
enterpriseUserDAO.batchInsertOrUpdate(eid, collect);
|
||||
// 同步用户与角色的关系
|
||||
Long masterRoleId = sysRoleDAO.getRoleIdByRoleEnum(eid, RoleEnum.MASTER.getRoleEnum());
|
||||
Long employeeRoleId = sysRoleDAO.getRoleIdByRoleEnum(eid, RoleEnum.EMPLOYEE.getRoleEnum());
|
||||
Long subMaster = sysRoleDAO.getRoleIdByRoleEnum(eid, RoleEnum.SUB_MASTER.getRoleEnum());
|
||||
Long shopOwner = sysRoleDAO.getRoleIdByRoleEnum(eid, RoleEnum.SHOPOWNER.getRoleEnum());
|
||||
List<EnterpriseUserRole> userRoles = new ArrayList<>();
|
||||
collect.forEach(f -> {
|
||||
if (Objects.nonNull(f)) {
|
||||
//记录此次操作的用户
|
||||
handlerUserIds.add(f.getUserId());
|
||||
if (Objects.nonNull(f.getIsAdmin()) && f.getIsAdmin()) {
|
||||
log.info("绑定管理员角色,{}", f.getUserId());
|
||||
userRoles.add(new EnterpriseUserRole(masterRoleId.toString(), f.getUserId()));
|
||||
//如果是开通人,再给子管理员权限
|
||||
if (authInfo.getAuthUserInfo()!=null){
|
||||
if (f.getUserId().equals(authInfo.getAuthUserInfo().getUserId())) {
|
||||
userRoles.add(new EnterpriseUserRole(subMaster.toString(), f.getUserId()));
|
||||
userRoles.add(new EnterpriseUserRole(shopOwner.toString(), f.getUserId()));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
userRoles.add(new EnterpriseUserRole(employeeRoleId.toString(), f.getUserId()));
|
||||
}
|
||||
}
|
||||
});
|
||||
if (CollectionUtils.isNotEmpty(userRoles)) {
|
||||
enterpriseUserRoleDAO.insertBatchUserRole(eid, userRoles);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理用户和区域的关系
|
||||
* @param eid
|
||||
* @param enterpriseUserRequests
|
||||
*/
|
||||
public void handlerUserRegionMapping(String eid, List<EnterpriseUserRequest> enterpriseUserRequests, Long unclassifiedRegionId) {
|
||||
//用户区域映射关系
|
||||
List<UserRegionMappingDO> userRegionMappings = new ArrayList<>();
|
||||
List<String> userIds = new ArrayList<>();
|
||||
List<Long> regionIds = new ArrayList<>();
|
||||
enterpriseUserRequests.forEach(user -> {
|
||||
if (Objects.isNull(user.getEnterpriseUserDO())) {
|
||||
return;
|
||||
}
|
||||
//移除不在授权范围内的部门
|
||||
List<String> deptIds = user.getDepartmentLists();
|
||||
if (CollectionUtils.isEmpty(deptIds)) {
|
||||
if (Objects.isNull(unclassifiedRegionId)) {
|
||||
return;
|
||||
}
|
||||
//如果所属的部门未在授权部门内,挂在未分组
|
||||
regionIds.add(unclassifiedRegionId);
|
||||
} else {
|
||||
//db查询区域表的数据,找到映射的区域
|
||||
List<Long> regionIdsBySynDingDeptIds = regionDAO.getRegionIdsBySynDingDeptIds(eid, deptIds.stream().map(a -> a).collect(Collectors.toList()));
|
||||
if (CollectionUtils.isNotEmpty(regionIdsBySynDingDeptIds)) {
|
||||
regionIds.addAll(regionIdsBySynDingDeptIds);
|
||||
} else {
|
||||
//未找到映射关系
|
||||
regionIds.add(unclassifiedRegionId);
|
||||
}
|
||||
}
|
||||
//构建用户和区域的关系
|
||||
ListUtils.emptyIfNull(regionIds)
|
||||
.stream()
|
||||
.forEach(item -> {
|
||||
userRegionMappings.add(buildUserRegionMappingDO(user.getEnterpriseUserDO().getUserId(), item));
|
||||
|
||||
});
|
||||
//清除用户区域的关系的regionIds用来存储下属映射的区域regionIds
|
||||
regionIds.clear();
|
||||
//构建我的下属
|
||||
//移除不在授权范围内的部门的主管部门
|
||||
List<String> leaderDeptIds = user.getLeaderInDepts();
|
||||
if (CollectionUtils.isNotEmpty(leaderDeptIds)) {
|
||||
List<Long> regionIdsBySynDingDeptIds = regionDAO.getRegionIdsBySynDingDeptIds(eid, leaderDeptIds.stream().map(a->a).collect(Collectors.toList()));
|
||||
if (CollectionUtils.isNotEmpty(regionIdsBySynDingDeptIds)) {
|
||||
regionIds.addAll(regionIdsBySynDingDeptIds);
|
||||
}
|
||||
}
|
||||
//用完即清除
|
||||
regionIds.clear();
|
||||
userIds.add(user.getEnterpriseUserDO().getUserId());
|
||||
//触发条件,满足一个,就开始进行处理落库
|
||||
if (userRegionMappings.size() > CommonConstants.DEAL_RECORD_MAX_SIZE) {
|
||||
//先删除 后新增
|
||||
//用户和区域的映射关系
|
||||
userRegionMappingDAO.deletedByUserIds(eid, userIds);
|
||||
userRegionMappingDAO.batchInsertRegionMapping(eid, userRegionMappings);
|
||||
//调用订正用户表字段user_region_ids
|
||||
enterpriseUserService.updateUserRegionPathList(eid, userIds);
|
||||
userRegionMappings.clear();
|
||||
userIds.clear();
|
||||
}
|
||||
});
|
||||
if (CollectionUtils.isNotEmpty(userRegionMappings)) {
|
||||
//先删除 后新增
|
||||
//用户和区域的映射关系
|
||||
userRegionMappingDAO.deletedByUserIds(eid, userIds);
|
||||
userRegionMappingDAO.batchInsertRegionMapping(eid, userRegionMappings);
|
||||
//调用订正用户表字段user_region_ids
|
||||
enterpriseUserService.updateUserRegionPathList(eid, userIds);
|
||||
}
|
||||
}
|
||||
|
||||
public UserRegionMappingDO buildUserRegionMappingDO(String userId, Long regionId) {
|
||||
UserRegionMappingDO userRegionMappingDO = new UserRegionMappingDO();
|
||||
userRegionMappingDO.setUserId(userId);
|
||||
userRegionMappingDO.setRegionId(String.valueOf(regionId));
|
||||
return userRegionMappingDO;
|
||||
}
|
||||
|
||||
public void initRootRegion(List<SysDepartmentDTO> sysDepartmentDTOS, String eid, String dbName) {
|
||||
|
||||
try {
|
||||
Optional<SysDepartmentDTO> first = sysDepartmentDTOS.stream()
|
||||
.filter(s -> Objects.equals(CommonConstants.ROOT_DEPT_ID_STR, s.getId())).findFirst();
|
||||
|
||||
if (first.isPresent()) {
|
||||
DataSourceHelper.changeToSpecificDataSource(dbName);
|
||||
SysDepartmentDTO sysDepartmentDTO = first.get();
|
||||
RegionDO regionDO = new RegionDO();
|
||||
regionDO.setId(1L);
|
||||
regionDO.setRegionType(RegionTypeEnum.ROOT.getType());
|
||||
regionDO.setName(sysDepartmentDTO.getName());
|
||||
regionDO.setCreateName(CommonConstants.SYSTEM_USER_ID);
|
||||
regionDO.setCreateTime(Calendar.getInstance().getTimeInMillis());
|
||||
regionDO.setSynDingDeptId(CommonConstants.ROOT_DEPT_ID_STR);
|
||||
regionDO.setUnclassifiedFlag(CommonConstants.ZERO);
|
||||
regionDO.setRegionPath(null);
|
||||
regionDO.setStoreNum(CommonConstants.ONE);
|
||||
regionDAO.insertRoot(eid, regionDO);
|
||||
//同步部门为区域节点
|
||||
initRegionByDepartment(eid, CommonConstants.ROOT_DEPT_ID_STR);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("enterpriseInit initRootRegion error,eid:{}", eid, e);
|
||||
throw new ServiceException(ErrorCodeEnum.FEISHU_SERVICE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
public void initRegionByDepartment(String eid, String deptId) {
|
||||
//首次获取 获取根部门下一级的所有数据
|
||||
List<QueryDeptChildDTO> queryDeptChildDTOS = sysDepartmentDAO.getDeptChildListByParentId(eid, deptId);
|
||||
if (CollectionUtils.isEmpty(queryDeptChildDTOS)) {
|
||||
return;
|
||||
}
|
||||
List<RegionDO> regionDOS = new ArrayList<>();
|
||||
List<String> syncDingDeptIds = new ArrayList<>();
|
||||
for (QueryDeptChildDTO deptChildDTO : queryDeptChildDTOS) {
|
||||
//设置上级区域的path,方便后续的追溯
|
||||
deptChildDTO.setPath("/" + deptId + "/");
|
||||
RegionDO regionDO = new RegionDO();
|
||||
regionDO.setParentId(String.valueOf(deptId));
|
||||
regionDO.setName(deptChildDTO.getName());
|
||||
regionDO.setCreateTime(System.currentTimeMillis());
|
||||
regionDO.setUpdateTime(System.currentTimeMillis());
|
||||
regionDO.setSynDingDeptId(String.valueOf(deptChildDTO.getId()));
|
||||
regionDO.setRegionType(RegionTypeEnum.PATH.getType());
|
||||
//次序值
|
||||
regionDO.setOrderNum(deptChildDTO.getDepartOrder());
|
||||
regionDO.setRegionPath("/" + CommonConstants.ROOT_DEPT_ID_STR + "/");
|
||||
regionDO.setDeleted(Boolean.FALSE);
|
||||
regionDOS.add(regionDO);
|
||||
syncDingDeptIds.add(String.valueOf(deptChildDTO.getId()));
|
||||
if (regionDOS.size() > CommonConstants.DEAL_RECORD_MAX_SIZE) {
|
||||
//批量插入或更新
|
||||
regionDAO.batchInsertRegions(regionDOS, eid);
|
||||
regionDOS.clear();
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(regionDOS)) {
|
||||
//批量插入或更新
|
||||
regionDAO.batchInsertRegions(regionDOS, eid);
|
||||
}
|
||||
//递归调用,接着获取下一层级的数据进行处理
|
||||
//获取region的id和部门id映射关系
|
||||
Map<String, Long> regionIdMap = regionDAO.getRegionSynDeptIdAndIdMapping(eid, syncDingDeptIds);
|
||||
handlerSubRegions(eid, queryDeptChildDTOS, regionIdMap);
|
||||
}
|
||||
|
||||
public void initUser(List<SysDepartmentDTO> sysDepartmentDTOS, String corpId, String eid, String appType, String dbName,
|
||||
List<String> adminList, AuthInfoDTO authInfo, Set<String> handlerUserIds) {
|
||||
try {
|
||||
//先查询是否存在未分组区域
|
||||
RegionDO unclassifiedRegionDO = regionDAO.getUnclassifiedRegionDO(eid);
|
||||
//获取通讯录授权范围
|
||||
AuthScopeDTO authScope = isvHttpRequest.getAuthScope(corpId, appType);
|
||||
List<EnterpriseUserDTO> enterpriseUserDTOS = null;
|
||||
if (CollectionUtils.isNotEmpty(authScope.getUserIdList())) {
|
||||
//通过授权范围获取授权用户
|
||||
enterpriseUserDTOS = isvHttpRequest.getUserDetailByUserIds(corpId, authScope.getUserIdList(), appType);
|
||||
}
|
||||
List<String> deptIdLists = ListUtils.emptyIfNull(sysDepartmentDTOS).stream().map(SysDepartmentDTO::getId).collect(Collectors.toList());
|
||||
//判断授权范围内是否有根节点,没有则移除
|
||||
if (CollectionUtils.isNotEmpty(authScope.getDeptIdList()) && !authScope.getDeptIdList().contains(CommonConstants.ROOT_DEPT_ID_STR)) {
|
||||
deptIdLists.remove(CommonConstants.ROOT_DEPT_ID_STR);
|
||||
sysDepartmentDTOS = ListUtils.emptyIfNull(sysDepartmentDTOS)
|
||||
.stream()
|
||||
.filter(a -> !a.getId().equals(CommonConstants.ROOT_DEPT_ID_STR))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
Map<String, String> deptIdMap = ListUtils.emptyIfNull(sysDepartmentDTOS).stream()
|
||||
.filter(d -> d.getParentId() != null)
|
||||
.collect(Collectors.toMap(SysDepartmentDTO::getId, SysDepartmentDTO::getParentId));
|
||||
List<EnterpriseUserRequest> authUsers = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(enterpriseUserDTOS)) {
|
||||
EnterpriseUserRequest tempRequest;
|
||||
EnterpriseUserDO tempDo;
|
||||
for (EnterpriseUserDTO enterpriseUserDTO : enterpriseUserDTOS) {
|
||||
tempDo = EnterpriseUserDTO.convertEnterpriseUserDTO2EnterpriseUserDO(enterpriseUserDTO);
|
||||
tempRequest = new EnterpriseUserRequest();
|
||||
tempRequest.setEnterpriseUserDO(tempDo);
|
||||
tempRequest.setDepartmentLists(ListOptUtils.getIntersection(enterpriseUserDTO.getDepartmentLists(), deptIdLists));
|
||||
tempRequest.setLeaderInDepts(ListOptUtils.getIntersection(enterpriseUserDTO.getIsLeaderInDepts(), deptIdLists));
|
||||
authUsers.add(tempRequest);
|
||||
}
|
||||
}
|
||||
dealUsers(authUsers,eid,corpId,dbName, deptIdMap, unclassifiedRegionDO.getId(), authInfo, handlerUserIds);
|
||||
List<EnterpriseUserRequest> deptUsers;
|
||||
if (CollectionUtils.isNotEmpty(sysDepartmentDTOS)) {
|
||||
|
||||
for (SysDepartmentDTO sysDepartmentDTO : sysDepartmentDTOS) {
|
||||
//通过授权部门获取授权用户
|
||||
List<EnterpriseUserDTO> departmentUsersQw = isvHttpRequest.getDepartmentUsers(corpId, sysDepartmentDTO.getId(), appType);
|
||||
deptUsers = ListUtils.emptyIfNull(departmentUsersQw).stream().map(e -> {
|
||||
EnterpriseUserRequest enterpriseUserRequest = new EnterpriseUserRequest();
|
||||
enterpriseUserRequest.setEnterpriseUserDO(EnterpriseUserDTO.convertEnterpriseUserDTO2EnterpriseUserDO(e));
|
||||
enterpriseUserRequest.setDepartmentLists(ListOptUtils.getIntersection(e.getDepartmentLists(), deptIdLists));
|
||||
enterpriseUserRequest.setLeaderInDepts(ListOptUtils.getIntersection(e.getIsLeaderInDepts(), deptIdLists));
|
||||
return enterpriseUserRequest;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isNotEmpty(deptUsers)) {
|
||||
log.info("enterpriseInit initUser deptUsersInfo, corpId={}, deptId={}, userSize={}", corpId, sysDepartmentDTO.getId(), deptUsers.size());
|
||||
dealUsers(deptUsers, eid, corpId, dbName, deptIdMap, unclassifiedRegionDO.getId(), authInfo, handlerUserIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("enterpriseInit initUser error,eid:{},appType:{}", eid, appType, e);
|
||||
throw new ServiceException(ErrorCodeEnum.FEISHU_SERVICE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
public void handlerSubRegions(String eid, List<QueryDeptChildDTO> depts, Map<String, Long> regionIdMap) {
|
||||
List<RegionDO> regionDOS = new ArrayList<>();
|
||||
//暂存一层级的数据
|
||||
List<QueryDeptChildDTO> results = new ArrayList<>();
|
||||
List<String> syncDingDeptIds = new ArrayList<>();
|
||||
for (QueryDeptChildDTO dept : depts) {
|
||||
//获取该层级的子节点处理
|
||||
List<QueryDeptChildDTO> childDTOS = sysDepartmentDAO.getDeptChildListByParentId(eid, String.valueOf(dept.getId()));
|
||||
for (QueryDeptChildDTO deptChildDTO : childDTOS) {
|
||||
//设置上级区域的path,方便后续的追溯
|
||||
deptChildDTO.setPath(dept.getPath() + regionIdMap.get(deptChildDTO.getParentId()) + "/");
|
||||
RegionDO regionDO = new RegionDO();
|
||||
regionDO.setParentId(String.valueOf(regionIdMap.get(deptChildDTO.getParentId())));
|
||||
regionDO.setCreateTime(System.currentTimeMillis());
|
||||
regionDO.setName(deptChildDTO.getName());
|
||||
regionDO.setSynDingDeptId(String.valueOf(deptChildDTO.getId()));
|
||||
regionDO.setUpdateTime(System.currentTimeMillis());
|
||||
regionDO.setOrderNum(deptChildDTO.getDepartOrder());
|
||||
regionDO.setRegionType(RegionTypeEnum.PATH.getType());
|
||||
//次序值
|
||||
regionDO.setRegionPath(dept.getPath() + regionIdMap.get(deptChildDTO.getParentId()) + "/");
|
||||
regionDO.setDeleted(Boolean.FALSE);
|
||||
regionDOS.add(regionDO);
|
||||
syncDingDeptIds.add(String.valueOf(deptChildDTO.getId()));
|
||||
}
|
||||
//暂存该层级的子节点数据
|
||||
if (CollectionUtils.isNotEmpty(childDTOS)) {
|
||||
results.addAll(childDTOS);
|
||||
}
|
||||
if (regionDOS.size() > CommonConstants.DEAL_RECORD_MAX_SIZE) {
|
||||
//批量插入或更新
|
||||
regionDAO.batchInsertRegions(regionDOS, eid);
|
||||
regionDOS.clear();
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(regionDOS)) {
|
||||
//批量插入或更新
|
||||
regionDAO.batchInsertRegions(regionDOS, eid);
|
||||
}
|
||||
//递归调用
|
||||
if (CollectionUtils.isNotEmpty(results)) {
|
||||
//一次用完即清理
|
||||
regionIdMap.clear();
|
||||
//添加这一层的region的id和部门id映射关系
|
||||
regionIdMap.putAll(regionDAO.getRegionSynDeptIdAndIdMapping(eid, syncDingDeptIds));
|
||||
handlerSubRegions(eid, results, regionIdMap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<SysDepartmentDTO> initDept(String corpId, String eid, String appType, String dbName) {
|
||||
List<SysDepartmentDTO> departments = null;
|
||||
try {
|
||||
//获取所有部门
|
||||
departments = isvHttpRequest.getDepartments(corpId, appType, null);
|
||||
if (CollectionUtils.isEmpty(departments)) {
|
||||
log.info("enterpriseInit initDept getDepartments is empty,corpId:{},appType:{}", corpId, appType);
|
||||
return departments;
|
||||
}
|
||||
List<SysDepartmentDO> sysDepartmentDOS = new ArrayList<>();
|
||||
for (SysDepartmentDTO department : departments) {
|
||||
sysDepartmentDOS.add(convertSysDepartmentDTO2SysDepartmentDO(department, appType));
|
||||
if(sysDepartmentDOS.size() > CommonConstants.DEAL_RECORD_MAX_SIZE){
|
||||
sysDepartmentDAO.batchInsertOrUpdate(eid, sysDepartmentDOS);
|
||||
sysDepartmentDOS.clear();
|
||||
}
|
||||
}
|
||||
|
||||
DataSourceHelper.changeToSpecificDataSource(dbName);
|
||||
if(CollectionUtils.isNotEmpty(sysDepartmentDOS)){
|
||||
sysDepartmentDAO.batchInsertOrUpdate(eid, sysDepartmentDOS);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("enterpriseInit initDept error,corpId:{},appType:{}", corpId, appType, e);
|
||||
throw new ServiceException(ErrorCodeEnum.FEISHU_SERVICE_ERROR);
|
||||
}
|
||||
return departments;
|
||||
}
|
||||
|
||||
public void runEnterpriseScriptAndInitAuthUser(EnterpriseOpenMsg msg) {
|
||||
DataSourceHelper.changeToSpecificDataSource(msg.getDbName());
|
||||
//执行脚本代码
|
||||
@@ -107,4 +527,74 @@ public class EnterpriseInitServiceImpl {
|
||||
enterpriseUserRoleDAO.insertBatchUserRole(eid, userRoles);
|
||||
}
|
||||
|
||||
|
||||
private List<EnterpriseUserRequest> getAdminList(List<String> adminList) {
|
||||
if(CollectionUtils.isEmpty(adminList)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<EnterpriseUserRequest> resultList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(adminList)){
|
||||
for (String userId : adminList) {
|
||||
EnterpriseUserRequest enterpriseUserRequest = new EnterpriseUserRequest();
|
||||
EnterpriseUserDO enterpriseUserDO = new EnterpriseUserDO();
|
||||
enterpriseUserDO.setId(userId);
|
||||
enterpriseUserDO.setName(userId);
|
||||
enterpriseUserDO.setUserId(userId);
|
||||
enterpriseUserDO.setUnionid(userId);
|
||||
enterpriseUserDO.setRoles(RoleEnum.MASTER.getId());
|
||||
enterpriseUserDO.setIsAdmin(Boolean.TRUE);
|
||||
enterpriseUserDO.setActive(Boolean.TRUE);
|
||||
enterpriseUserRequest.setEnterpriseUserDO(enterpriseUserDO);
|
||||
enterpriseUserRequest.setDepartment("[1]");
|
||||
enterpriseUserRequest.setDepartments("[1]");
|
||||
resultList.add(enterpriseUserRequest);
|
||||
}
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
private EnterpriseUserRequest getAIUser() {
|
||||
EnterpriseUserRequest enterpriseUserRequest = new EnterpriseUserRequest();
|
||||
EnterpriseUserDO enterpriseUserDO = new EnterpriseUserDO();
|
||||
enterpriseUserDO.setId(AIEnum.AI_ID.getCode());
|
||||
enterpriseUserDO.setName(AIEnum.AI_NAME.getCode());
|
||||
enterpriseUserDO.setUserId(AIEnum.AI_USERID.getCode());
|
||||
enterpriseUserDO.setMobile(AIEnum.AI_MOBILE.getCode());
|
||||
enterpriseUserDO.setRoles(AIEnum.AI_ROLES.getCode());
|
||||
enterpriseUserDO.setUnionid(AIEnum.AI_UUID.getCode());
|
||||
enterpriseUserDO.setIsAdmin(Boolean.TRUE);
|
||||
enterpriseUserDO.setActive(Boolean.TRUE);
|
||||
enterpriseUserRequest.setEnterpriseUserDO(enterpriseUserDO);
|
||||
enterpriseUserRequest.setDepartment(AIEnum.AI_DEPARTMENT.getCode());
|
||||
enterpriseUserRequest.setDepartments(AIEnum.AI_DEPARTMENT.getCode());
|
||||
return enterpriseUserRequest;
|
||||
}
|
||||
|
||||
public SysDepartmentDO convertSysDepartmentDTO2SysDepartmentDO(SysDepartmentDTO dto, String appType) {
|
||||
if (dto == null) {
|
||||
return null;
|
||||
}
|
||||
SysDepartmentDO sysDepartmentDO = new SysDepartmentDO();
|
||||
sysDepartmentDO.setName(dto.getName());
|
||||
sysDepartmentDO.setId(dto.getId());
|
||||
sysDepartmentDO.setParentId(dto.getParentId());
|
||||
sysDepartmentDO.setDepartOrder(dto.getDepartOrder());
|
||||
sysDepartmentDO.setCreateDeptGroup(dto.getCreateDeptGroup());
|
||||
sysDepartmentDO.setAutoAddUser(dto.getAutoAddUser());
|
||||
sysDepartmentDO.setDepHiding(dto.getDepHiding());
|
||||
sysDepartmentDO.setDeptPerimits(dto.getDeptPerimits());
|
||||
sysDepartmentDO.setUserPerimits(dto.getUserPerimits());
|
||||
sysDepartmentDO.setOuterDept(dto.getOuterDept());
|
||||
sysDepartmentDO.setOuterPermitDepts(dto.getOuterPermitDepts());
|
||||
sysDepartmentDO.setOuterPermitUsers(dto.getOuterPermitUsers());
|
||||
sysDepartmentDO.setOrgDeptOwner(dto.getOrgDeptOwner());
|
||||
sysDepartmentDO.setDeptManagerUseridList(dto.getDeptManagerUseridList());
|
||||
sysDepartmentDO.setUserCount(dto.getUserCount());
|
||||
sysDepartmentDO.setUnactiveUserCount(dto.getUnactiveUserCount());
|
||||
sysDepartmentDO.setParentIds(dto.getParentIds());
|
||||
sysDepartmentDO.setSubIds(dto.getSubIds());
|
||||
return sysDepartmentDO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.context.CurrentUser;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.RegionDAO;
|
||||
import com.cool.store.dao.UserRegionMappingDAO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import com.cool.store.entity.UserRegionMappingDO;
|
||||
import com.cool.store.service.EnterpriseUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: EnterpriseUserServiceImpl
|
||||
* @Description:
|
||||
* @date 2023-05-29 19:58
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class EnterpriseUserServiceImpl implements EnterpriseUserService {
|
||||
|
||||
@Resource
|
||||
private UserRegionMappingDAO userRegionMappingDAO;
|
||||
@Resource
|
||||
private RegionDAO regionDAO;
|
||||
@Resource
|
||||
private EnterpriseUserDAO enterpriseUserDAO;
|
||||
|
||||
@Override
|
||||
public void updateUserRegionPathList(String enterpriseId, List<String> userIds) {
|
||||
if (CollectionUtils.isEmpty(userIds)) {
|
||||
return;
|
||||
}
|
||||
//查询该人员的最新部门情况 同步到enterpriseUser 表usereginIds表中
|
||||
List<UserRegionMappingDO> userRegionMappingDOS = userRegionMappingDAO.listUserRegionMappingByUserId(enterpriseId, userIds);
|
||||
Map<String, List<UserRegionMappingDO>> userRegionMappingMap = ListUtils.emptyIfNull(userRegionMappingDOS)
|
||||
.stream()
|
||||
.collect(Collectors.groupingBy(UserRegionMappingDO::getUserId));
|
||||
List<String> regionIds = userRegionMappingDOS.stream()
|
||||
.map(UserRegionMappingDO::getRegionId).distinct().collect(Collectors.toList());
|
||||
List<RegionDO> regionDOS = regionDAO.getRegionByRegionIds(enterpriseId, regionIds);
|
||||
Map<String, RegionDO> regionMap = regionDOS.stream()
|
||||
.collect(Collectors.toMap(RegionDO::getRegionId, data -> data));
|
||||
|
||||
List<EnterpriseUserDO> enterpriseUserList= new ArrayList<>();
|
||||
for (String userId:userIds) {
|
||||
EnterpriseUserDO enterpriseUserDO = new EnterpriseUserDO();
|
||||
enterpriseUserDO.setUserId(userId);
|
||||
String regionPathString = "";
|
||||
List<RegionDO> regionDOList = new ArrayList<>();
|
||||
//如果没有对应部门 默认未null 正常情况下不会出现userRegionId不为null的情况
|
||||
enterpriseUserDO.setUserRegionIds(null);
|
||||
List<UserRegionMappingDO> userRegionMappingList = userRegionMappingMap.get(userId);
|
||||
|
||||
//异常情况下处理
|
||||
if (CollectionUtils.isEmpty(userRegionMappingList)){
|
||||
log.info("getUserRegionPathListStr exception 该人员没有任何部门");
|
||||
//查询未分组
|
||||
RegionDO unclassifiedRegionDO = regionDAO.getUnclassifiedRegionDO(enterpriseId);
|
||||
//将人添加到未分组中
|
||||
addUserRegionMappingDO(enterpriseId,userId,unclassifiedRegionDO.getRegionId(),new CurrentUser());
|
||||
regionDOList.add(unclassifiedRegionDO);
|
||||
}
|
||||
|
||||
ListUtils.emptyIfNull(userRegionMappingList)
|
||||
.stream()
|
||||
.forEach(userRegionMappingDO -> {
|
||||
RegionDO regionDO = regionMap.get(userRegionMappingDO.getRegionId());
|
||||
if (Objects.nonNull(regionDO)){
|
||||
regionDOList.add(regionDO);
|
||||
}
|
||||
});
|
||||
|
||||
regionPathString = regionDOList.stream()
|
||||
.map(e -> e.getFullRegionPath()).collect(Collectors.joining(CommonConstants.COMMA));
|
||||
if (StringUtils.isNotBlank(regionPathString)){
|
||||
enterpriseUserDO.setUserRegionIds(CommonConstants.SQUAREBRACKETSLEFT+ regionPathString+ CommonConstants.SQUAREBRACKETSRIGHT);
|
||||
}
|
||||
enterpriseUserList.add(enterpriseUserDO);
|
||||
}
|
||||
enterpriseUserDAO.batchUpdateDiffUserDiffRegionIds(enterpriseId, enterpriseUserList);
|
||||
}
|
||||
|
||||
private void addUserRegionMappingDO(String enterpriseId,String userId,String regionId,CurrentUser currentUser){
|
||||
UserRegionMappingDO userRegionMappingDO = new UserRegionMappingDO();
|
||||
userRegionMappingDO.setUserId(userId);
|
||||
userRegionMappingDO.setRegionId(regionId);
|
||||
userRegionMappingDO.setCreateId(currentUser.getUserId());
|
||||
userRegionMappingDO.setUpdateId(currentUser.getUserId());
|
||||
userRegionMappingDO.setCreateTime(System.currentTimeMillis());
|
||||
userRegionMappingDO.setUpdateTime(System.currentTimeMillis());
|
||||
//将用户添加到未分组
|
||||
userRegionMappingDAO.batchInsertRegionMapping(enterpriseId, Arrays.asList(userRegionMappingDO));
|
||||
}
|
||||
}
|
||||
@@ -8,17 +8,14 @@ import com.cool.store.context.DataSourceContext;
|
||||
import com.cool.store.dao.*;
|
||||
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.SysRoleDO;
|
||||
import com.cool.store.enums.AppTypeEnum;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.UserStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.model.entity.EnterpriseDO;
|
||||
import com.cool.store.service.LoginService;
|
||||
import com.cool.store.utils.DataSourceHelper;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.github.xiaoymin.knife4j.core.util.StrUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.crypto.RandomNumberGenerator;
|
||||
@@ -27,7 +24,6 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.coolstore:coolstore-base:1.5.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />
|
||||
@@ -58,7 +59,6 @@
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
|
||||
|
||||
@@ -2,7 +2,7 @@ spring.application.name=coolstore-partner-webb
|
||||
spring.profiles.active=@profileActive@
|
||||
|
||||
server.port=31000
|
||||
server.servlet.context-path=/partner
|
||||
server.servlet.context-path=/partner/pc
|
||||
|
||||
#logback
|
||||
logging.config=classpath:logback-spring.xml
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.coolstore:coolstore-base:1.5.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />
|
||||
@@ -58,7 +59,6 @@
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
|
||||
|
||||
@@ -2,7 +2,7 @@ spring.application.name=coolstore-partner-webc
|
||||
spring.profiles.active=@profileActive@
|
||||
|
||||
server.port=30900
|
||||
server.servlet.context-path=/partner
|
||||
server.servlet.context-path=/partner/mini/program
|
||||
|
||||
#logback
|
||||
logging.config=classpath:logback-spring.xml
|
||||
|
||||
Reference in New Issue
Block a user