Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner

This commit is contained in:
苏竹红
2023-06-14 19:40:01 +08:00
66 changed files with 1421 additions and 242 deletions

View File

@@ -105,5 +105,9 @@
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.48.Final" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
<orderEntry type="library" name="Maven: com.github.tencentyun:tls-sig-api-v2:2.0" level="project" />
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
</component>
</module>

View File

@@ -0,0 +1,35 @@
package com.cool.store.enums;
/**
* @Author: young.yu
* @Date: 2023-06-13 20:22
* @Description: 面试状态枚举
*/
public enum InteviewStatusEnum {
WAIT_APPOINTMENT(0, "待预约"),
WAIT_APPOINTMENT_TIME_CONFIRM(1, "面试时间待审核"),
WAIT_INTERVIEW(2, "待面试"),
INTERVIEWING(3, "已开始"),
WAIT_AUDIT(4, "待审核"),
AUDITING(5, "审批中"),
AUDIT_PASS(6, "审批通过"),
REFUSE(7, "拒绝");
private Integer code;
private String message;
InteviewStatusEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
}

View File

@@ -27,91 +27,10 @@ public enum RocketMqGroupEnum {
* 服务A中某个Listener的groupId为GroupA 监听topicA 过滤的消息tagA
* 服务B中某个Listener的groupId为GroupA 监听topicA 过滤的消息tagB
*/
/**
* 区域门店数量计算队列
* 事件消息监听
*/
CAL_REGION_STORE_NUM("cal_region_store_num", "coolcollege-intelligent", new ArrayList<>(Arrays.asList(RocketMqTagEnum.CAL_REGION_STORE_NUM,RocketMqTagEnum.REGION_STORE_NUM_UPDATE))),
/**
* 企业开通
*/
ENTERPRISE_OPEN("enterprise_open", "coolcollege-intelligent-config", new ArrayList<>(Arrays.asList(RocketMqTagEnum.ENTERPRISE_OPEN))),
/**
* 企业开通平台库脚本
*/
ENTERPRISE_OPEN_CONFIG_RUN_SCRIPT("enterprise_open_config_run_script", "coolcollege-intelligent-config", new ArrayList<>(Arrays.asList(RocketMqTagEnum.ENTERPRISE_OPEN_CONFIG_RUN_SCRIPT))),
/**
* 企业开通企业库脚本
*/
ENTERPRISE_OPEN_ENTERPRISE_RUN_SCRIPT("enterprise_open_enterprise_run_script", "coolcollege-intelligent", new ArrayList<>(Arrays.asList(RocketMqTagEnum.ENTERPRISE_OPEN_ENTERPRISE_RUN_SCRIPT))),
/**
* 企业开通数据同步
*/
ENTERPRISE_OPEN_DATA_SYNC("enterprise_open_data_sync", "coolcollege-intelligent", new ArrayList<>(Arrays.asList(RocketMqTagEnum.ENTERPRISE_OPEN_DATA_SYNC))),
/**
* 企业购买事件
*/
PAY_MARKET_BUY("pay_market_buy","coolcollege-intelligent", new ArrayList<>(Arrays.asList(RocketMqTagEnum.PAY_MARKET_BUY))),
/**
* 钉钉消息监听
*/
DING_MSG_DEAL("ding_msg_deal","coolcollege-intelligent", new ArrayList<>(Arrays.asList(RocketMqTagEnum.DING_STORE_ADDRESS_BOOK, RocketMqTagEnum.DING_SINGLE_USER_SYNC))),
/**
* 授权队列
*/
AUTH_QUEUE("auth_queue","coolcollege-intelligent", new ArrayList<>(Arrays.asList(RocketMqTagEnum.AUTH_QUEUE))),
/**
* 企微消息监听
*/
QW_MSG_DEAL("qw_msg_deal","coolcollege-intelligent", new ArrayList<>(Arrays.asList(RocketMqTagEnum.QW_CHANGE_ORDER_QUEUE,RocketMqTagEnum.QW_OPEN_ORDER_CHANGE_QUEUE))),
/**
* 钉钉同步
*/
DING_SYNC_ALL_DATA_QUEUE("ding_sync_all_data_queue","coolcollege-intelligent", new ArrayList<>(Arrays.asList(RocketMqTagEnum.DING_SYNC_ALL_DATA_QUEUE))),
STORE_DING_QUEUE("store_ding_queue","coolcollege-intelligent-isv", new ArrayList<>(Arrays.asList(RocketMqTagEnum.STORE_DING_QUEUE))),
/**
* 待办任务名称
*/
STORE_BACK_LOG("store_back_log","coolcollege-intelligent-isv", new ArrayList<>(Arrays.asList(RocketMqTagEnum.STORE_BACK_LOG,RocketMqTagEnum.STORE_BACK_LOG_UPDATE))),
/**
* 待办消息结束队列
*/
UPCOMING_FINISH("upcoming_finish","coolcollege-intelligent-isv", new ArrayList<>(Arrays.asList(RocketMqTagEnum.UPCOMING_FINISH))),
/**
* 发送开通成功消息
*/
OPEN_SUCCEEDED_MSG_QUEUE("open_succeeded_msg_queue","coolcollege-intelligent-isv", new ArrayList<>(Arrays.asList(RocketMqTagEnum.OPEN_SUCCEEDED_MSG_QUEUE))),
/**
* 发送成员授权模式下模板消息
*/
QW_MEMBER_TEMPLE_MSG_QUEUE("qw_member_temple_msg_queue","coolcollege-intelligent-isv", new ArrayList<>(Arrays.asList(RocketMqTagEnum.QW_MEMBER_TEMPLE_MSG_QUEUE))),
/**
* app推送队列
*/
APP_PUSH_QUEUE("app_push_queue","coolcollege-intelligent-isv", new ArrayList<>(Arrays.asList(RocketMqTagEnum.APP_PUSH_QUEUE))),
/**
* 解除应用
*/
REMOVE_APPLICATION("remove_application","coolcollege-intelligent-config", new ArrayList<>(Arrays.asList(RocketMqTagEnum.REMOVE_APPLICATION))),
/**
* 全量企微用户同步
*/
QW_SYNC_FULL_USER("qw_sync_full_user_msg_queue", "coolcollege-intelligent", new ArrayList(Arrays.asList(RocketMqTagEnum.QW_SYNC_FULL_USER))),
SHOP_STORE_GROUP_SYNC("shop_store_group_sync","coolcollege-intelligent", new ArrayList<>(Arrays.asList(RocketMqTagEnum.SHOP_STORE_GROUP_SYNC))),
/**
* test
*/
TEST("test", "coolcollege-intelligent-config", new ArrayList<>(Arrays.asList(RocketMqTagEnum.TEST))),
FEI_SHU_EVENT_LISTENER("fei_shu_event_listener", new ArrayList<>(Arrays.asList(RocketMqTagEnum.USER_EVENT, RocketMqTagEnum.AUTH_SCOPE_CHANGE))),
;
@@ -119,12 +38,9 @@ public enum RocketMqGroupEnum {
private final List<RocketMqTagEnum> tagList;
private final String listener;
RocketMqGroupEnum(String group,String listener,List<RocketMqTagEnum> tagList) {
RocketMqGroupEnum(String group,List<RocketMqTagEnum> tagList) {
this.group = group;
this.listener = listener;
this.tagList = tagList;
}

View File

@@ -11,43 +11,8 @@ import com.cool.store.utils.CommonContextUtil;
*/
public enum RocketMqTagEnum {
TEST("test","测试"),
EXPORT_IMPORT_MESSAGE("export_import_message","导入导出消息"),
CAL_REGION_STORE_NUM("cal_region_store_num","计算门店区域数量"),
REGION_STORE_NUM_UPDATE("region_store_num_update","计算门店区域数量"),
ENTERPRISE_OPEN("enterprise_open","企业开通"),
ENTERPRISE_OPEN_CONFIG_RUN_SCRIPT("enterprise_open_config_run_script","企业开通平台库脚本执行"),
ENTERPRISE_OPEN_ENTERPRISE_RUN_SCRIPT("enterprise_open_enterprise_run_script","企业开通企业库脚本执行"),
ENTERPRISE_OPEN_DATA_SYNC("enterprise_open_data_sync","企业开通数据同步"),
AUTH_QUEUE("auth_queue","授权队列"),
DING_STORE_ADDRESS_BOOK("ding_store_address_book","钉钉通讯录变更事件"),
PAY_MARKET_BUY("pay_market_buy","企业购买队列"),
QW_OPEN_ORDER_CHANGE_QUEUE("qw_openorder_change_queue","企业微信付费监听"),
QW_CHANGE_ORDER_QUEUE("qw_change_order_queue","企业微信改单事件,因涉及到两个订单,和普通的订单事件分开"),
DING_SYNC_ALL_DATA_QUEUE("ding_sync_all_data_queue","钉钉全量同步"),
DING_SYNC_ALL_DATA_QUEUE_BAILI("ding_sync_all_data_queue_baili","百丽全量同步"),
DING_SYNC_ALL_DATA_OA_QUEUE("ding_sync_all_data_oa_queue","第三方同步"),
THIRD_OA_SYNC_SINGLE_QUEUE("third_oa_sync_single_queue","第三方单个用户同步"),
STORE_DING_QUEUE("store_ding_queue", "微应用钉钉消息发送"),
STORE_BACK_LOG("store_back_log", "待办任务名称"),
STORE_BACK_LOG_UPDATE("store_back_log_update", "更新待办任务名称"),
UPCOMING_FINISH("upcoming_finish", "待办消息结束队列"),
OPEN_SUCCEEDED_MSG_QUEUE("open_succeeded_msg_queue", "发送开通成功消息"),
QW_MEMBER_TEMPLE_MSG_QUEUE("qw_member_temple_msg_queue", "发送成员授权模式下模板消息"),
APP_PUSH_QUEUE("app_push_queue", "app推送队列"),
REMOVE_APPLICATION("remove_application", "解除应用"),
COLLEGE_SYNC_USER_DELAY("college_sync_user_delay", "同步人与延迟推送"),
COOL_STORE_DATA_CHANGE("cool_store_data_change", "门店端的部门,人员,职位,发生变化后的推送消息队列"),
QW_SYNC_FULL_USER("qw_sync_full_user_msg_queue", "企微全量用户同步"),
PERSON_SUB_TASK_DATA_QUEUE("person_sub_task_data_queue","按人子任务消息监听"),
IMOU_DEVICE_CALLBACK("imou_device_callback","乐橙设备回调事件"),
PERMANENT_CODE_UPDATE("permanent_code_update", "授权码变更"),
SHOP_STORE_GROUP_SYNC("shop_store_group_sync","门店通门店分组同步"),
DING_SINGLE_USER_SYNC("ding_single_user_sync","钉钉用户信息拉取"),
AUTH_SCOPE_CHANGE("auth_scope_change","授权范围变更"),
USER_EVENT("user_event","钉钉通讯录变更事件"),
;

View File

@@ -0,0 +1,92 @@
package com.cool.store.exception;
import com.cool.store.enums.ErrorCodeEnum;
import lombok.Data;
import java.text.MessageFormat;
/**
* @Description 业务异常类返回
* @author Aaron
* @date 2019/12/20
*/
@Data
public class ApiException extends Exception{
private static final long serialVersionUID = -5068776742356414959L;
/**
* 返回码
*/
private Integer errorCode;
/**
* 返回信息
*/
private String errorMessage;
private Object data;
/**
* 构造函数
* @param errorCode
* @param errorMessage
*/
@Deprecated
public ApiException(Integer errorCode, String errorMessage) {
super(errorMessage);
this.errorCode = errorCode;
this.errorMessage = errorMessage;
}
/**
* 构造函数
* @param errorCode
* @param errorMessage
*/
@Deprecated
public ApiException(Integer errorCode, String errorMessage, Object data) {
super(errorMessage);
this.errorCode = errorCode;
this.errorMessage = errorMessage;
this.data = data;
}
/**
* 构造函数
* @param errorMessage
*/
public ApiException(String errorMessage) {
super(errorMessage);
this.errorMessage = errorMessage;
}
/**
* 构造函数
* @param errorCode
* @param errorMessage
* @param cause
*/
@Deprecated
public ApiException(Integer errorCode, String errorMessage, Throwable cause) {
super(errorMessage, cause);
this.errorCode = errorCode;
this.errorMessage = errorMessage;
}
public ApiException(ErrorCodeEnum responseEnum) {
super(responseEnum.getMessage());
this.errorCode = responseEnum.getCode();
this.errorMessage = responseEnum.getMessage();
}
public ApiException(ErrorCodeEnum responseEnum, Object... objects) {
super(responseEnum.getMessage());
String message = MessageFormat.format(responseEnum.getMessage(), objects);
this.errorCode = responseEnum.getCode();
this.errorMessage = message;
}
}

View File

@@ -127,6 +127,10 @@
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.48.Final" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
<orderEntry type="library" name="Maven: com.github.tencentyun:tls-sig-api-v2:2.0" level="project" />
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" 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" />

View File

@@ -1,5 +1,6 @@
package com.cool.store.dao;
import com.cool.store.constants.CommonConstants;
import com.cool.store.entity.EnterpriseUserDO;
import com.cool.store.mapper.EnterpriseUserMapper;
import com.google.common.collect.Lists;
@@ -52,4 +53,11 @@ public class EnterpriseUserDAO {
}
enterpriseUserMapper.deleteUser(excludeUserIds);
}
public Integer deleteUserByUserId(String userId){
if(StringUtils.isBlank(userId)){
return CommonConstants.ZERO;
}
return enterpriseUserMapper.deleteUserByUserId(userId);
}
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.dao;
import com.cool.store.constants.CommonConstants;
import com.cool.store.entity.EnterpriseUserRoleDO;
import com.cool.store.entity.SysRoleDO;
import com.cool.store.enums.DataSourceEnum;
@@ -43,4 +44,11 @@ public class EnterpriseUserRoleDAO {
return enterpriseUserRoleMapper.deleteUserInRole(userId, dataSourceEnum.getCode(), excludeRoleId);
}
public Integer deleteUserRole(String userId){
if(StringUtils.isBlank(userId)){
return CommonConstants.ZERO;
}
return enterpriseUserRoleMapper.deleteUserRole(userId);
}
}

View File

@@ -4,11 +4,15 @@ import com.cool.store.constants.CommonConstants;
import com.cool.store.entity.RegionDO;
import com.cool.store.mapper.RegionMapper;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author zhangchenbiao
@@ -49,4 +53,12 @@ public class RegionDAO {
return regionMapper.getRegionBaseInfoList();
}
public Map<String, String> getRegionMap(List<String> regionIds){
if(CollectionUtils.isEmpty(regionIds)){
return Maps.newHashMap();
}
List<RegionDO> regionList = regionMapper.getRegionNameByRegionIds(regionIds);
return ListUtils.emptyIfNull(regionList).stream().collect(Collectors.toMap(RegionDO::getRegionId, RegionDO::getName));
}
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.dao;
import com.cool.store.constants.CommonConstants;
import com.cool.store.entity.UserRegionMappingDO;
import com.cool.store.enums.DataSourceEnum;
import com.cool.store.mapper.UserRegionMappingMapper;
@@ -51,4 +52,11 @@ public class UserRegionMappingDAO {
return userRegionMappingMapper.deleteRegionUserByExcludeUserIds(excludeUserIds);
}
public Integer deleteUserRegionByUserId(String userId){
if(StringUtils.isBlank(userId)){
return CommonConstants.ZERO;
}
return userRegionMappingMapper.deleteUserRegionByUserId(userId);
}
}

View File

@@ -45,4 +45,11 @@ public interface EnterpriseUserMapper {
* @return
*/
int deleteUser(@Param("excludeUserIds") List<String> excludeUserIds);
/**
* 删除用户
* @param userId
* @return
*/
Integer deleteUserByUserId(@Param("userId") String userId);
}

View File

@@ -26,13 +26,27 @@ public interface EnterpriseUserRoleMapper {
int updateByPrimaryKeySelective(EnterpriseUserRoleDO record);
/**
* 删除用户角色
* 删除角色下的用户
* @param roleId
* @param type
* @param userIds
* @param excludeUserIds
* @return
*/
int deleteRoleInUser(@Param("roleId") String roleId, @Param("type") Integer type, @Param("excludeUserIds") List<String> excludeUserIds);
/**
* 删除用户下的角色
* @param userId
* @param type
* @param excludeRoleId
* @return
*/
int deleteUserInRole(@Param("userId") String userId, @Param("type") Integer type, @Param("excludeRoleId") String excludeRoleId);
/**
* 删除用户所有角色
* @param userId
* @return
*/
Integer deleteUserRole(@Param("userId") String userId);
}

View File

@@ -3,6 +3,8 @@ package com.cool.store.mapper;
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
import com.cool.store.request.GetInterviewListReq;
import com.cool.store.vo.interview.InterviewVO;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
@@ -50,7 +52,6 @@ public interface HyPartnerInterviewPlanMapper {
@Param("currentDate") String currentDate,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
/**
* 查询面试列表
* @param userId
@@ -70,4 +71,20 @@ public interface HyPartnerInterviewPlanMapper {
PageInfo<PartnerInterviewInfoDTO> getPartnerInterviewInfoList(@Param("userId") String userId,
@Param("workflowStage") String workflowStage ,
@Param("workflowStatus") String workflowStatus);
/**
* 查询面试列表
*
* @param request
* @return
*/
List<InterviewVO> getInterviewList(@Param("record") GetInterviewListReq request);
/**
* 查询面试详情
*
* @param interviewId
* @return
*/
InterviewVO getInterviewInfo(String interviewId);
}

View File

@@ -39,6 +39,13 @@ public interface RegionMapper {
*/
List<RegionDO> getRegionByRegionIds(@Param("regionIds")List<String> regionIds);
/**
* 根据区域id获取名称
* @param regionIds
* @return
*/
List<RegionDO> getRegionNameByRegionIds(@Param("regionIds")List<String> regionIds);
/**
* 获取区域基本信息
* @return

View File

@@ -47,4 +47,11 @@ public interface UserRegionMappingMapper {
* @return
*/
Integer deleteRegionUserByExcludeUserIds(@Param("excludeUserIds") List<String> excludeUserIds);
/**
* 删除用户所在的区域
* @param userId
* @return
*/
Integer deleteUserRegionByUserId(@Param("userId") String userId);
}

View File

@@ -257,4 +257,8 @@
<update id="deleteUser">
update enterprise_user set deleted = 1 where user_id not in <foreach collection="excludeUserIds" open="(" close=")" separator="," item="userId">#{userId}</foreach>
</update>
<update id="deleteUserByUserId">
update enterprise_user set deleted = 1 where user_id = #{userId}
</update>
</mapper>

View File

@@ -91,4 +91,8 @@
<update id="deleteUserInRole">
update enterprise_user_role set deleted = 1 where role_id != #{excludeRoleId} and user_id = #{userId} and type = #{type}
</update>
<update id="deleteUserRole">
update enterprise_user_role set deleted = 1 where user_id = #{userId}
</update>
</mapper>

View File

@@ -237,4 +237,65 @@
</if>
</where>
</select>
<select id="getInterviewList" resultType="com.cool.store.vo.interview.InterviewVO">
select hpip.id as interviewId,
hpui.username as partnerName,
hpui.mobile as partnerMobile,
hpip.room_id as roomId,
hpip.start_time as startTime,
hpui.username as interviewerName,
hpui.mobile as interviewerMobile,
hpip.room_status as roomStatus,
hpip.end_time as endTime
from hy_partner_interview_plan hpip
left join hy_partner_line_info hpll on hpip.partner_line_id = hpll.id
left join hy_partner_user_info hpui on hpui.partner_id = hpip.partner_id
<where>
<if test="record.partnerName !=null and partnerName!=''">
hpui.username like concat('%',#{record.partnerName},'%')
</if>
<if test="record.partnerMobile !=null and partnerMobile!=''">
hpui.mobile like concat('%',#{record.partnerMobile},'%')
</if>
<if test="record.roomId !=null and roomId!=''">
hpip.room_id = #{record.roomId}
</if>
<if test="record.interviewerName !=null and interviewerName!=''">
hpui.username like concat('%',#{record.interviewerName},'%')
</if>
<if test="record.interviewerMobile !=null and interviewerMobile!=''">
hpui.mobile like concat('%',#{record.interviewerMobile},'%')
</if>
<if test="record.roomStatus !=null and roomStatus!=''">
hpip.room_status = #{record.roomStatus}
</if>
<if test="record.startTime !=null and startTime!=''">
hpip.start_time &lt;= #{record.startTime}
</if>
<if test="record.endTime !=null and endTime!=''">
hpip.end_time &gt;= #{record.endTime}
</if>
</where>
</select>
<select id="getInterviewInfo" resultType="com.cool.store.vo.interview.InterviewVO">
select hpip.id as interviewId,
hpui.username as partnerName,
hpui.mobile as partnerMobile,
hpip.room_id as roomId,
hpip.start_time as startTime,
hpui.username as interviewerName,
hpui.mobile as interviewerMobile,
hpip.room_status as roomStatus,
hpip.end_time as endTime,
hpip.partner_id as partnerId,
hpip.interviewer as interviewerId,
hpi.status as status
from hy_partner_interview_plan hpip
left join hy_partner_line_info hpll on hpip.partner_line_id = hpll.id
left join hy_partner_user_info hpui on hpui.partner_id = hpip.partner_id
left join hy_partner_interview hpi on hpip.id = hpi.interview_plan_id
where hpip.id = #{interviewId}
</select>
</mapper>

View File

@@ -169,6 +169,16 @@
</select>
<select id="getRegionNameByRegionIds" resultMap="BaseResultMap">
select
region_id, name
from
region
where
deleted = 0 and region_id in <foreach collection="regionIds" item="regionId" separator="," open="(" close=")">#{regionId}</foreach>
</select>
<select id="getRegionBaseInfoList" resultMap="BaseResultMap">
select
region_id, name, parent_id

View File

@@ -119,4 +119,8 @@
update user_region_mapping set deleted = 1 where user_id not in <foreach collection="excludeUserIds" open="(" close=")" separator="," item="userId">#{userId}</foreach>
</update>
<update id="deleteUserRegionByUserId">
update user_region_mapping set deleted = 1 where user_id = #{userId}
</update>
</mapper>

View File

@@ -106,6 +106,10 @@
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.48.Final" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
<orderEntry type="library" name="Maven: com.github.tencentyun:tls-sig-api-v2:2.0" level="project" />
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" 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" />

View File

@@ -0,0 +1,33 @@
package com.cool.store.dto.calendar;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author zhangchenbiao
* @FileName: CreateCalendarEventDTO
* @Description: 创建用户日程到用户主日历
* @date 2023-06-13 14:09
*/
@Data
public class CreateCalendarEventDTO {
@ApiModelProperty("发起人")
private String userId;
@ApiModelProperty("日程标题")
private String summary;
@ApiModelProperty("开始时间")
private Long startTime;
@ApiModelProperty("截止时间")
private Long endTime;
@ApiModelProperty("参与者")
private List<String> joinUserIds;
}

View File

@@ -0,0 +1,24 @@
package com.cool.store.dto.calendar;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: DeleteCalendarEventDTO
* @Description:
* @date 2023-06-13 15:02
*/
@Data
public class DeleteCalendarEventDTO {
@ApiModelProperty("发起人id")
private String userId;
@ApiModelProperty("日历id")
private String calendarId;
@ApiModelProperty("事件id")
private String eventId;
}

View File

@@ -0,0 +1,39 @@
package com.cool.store.dto.calendar;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author zhangchenbiao
* @FileName: CreateCalendarEventDTO
* @Description: 创建用户日程到用户主日历
* @date 2023-06-13 14:09
*/
@Data
public class UpdateCalendarEventDTO {
@ApiModelProperty("发起人id")
private String userId;
@ApiModelProperty("日历id")
private String calendarId;
@ApiModelProperty("事件id")
private String eventId;
@ApiModelProperty("日程标题")
private String summary;
@ApiModelProperty("开始时间")
private Long startTime;
@ApiModelProperty("截止时间")
private Long endTime;
@ApiModelProperty("参与者")
private List<String> joinUserIds;
}

View File

@@ -0,0 +1,37 @@
package com.cool.store.dto.calendar;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: UserCalendarsEventVO
* @Description:
* @date 2023-06-13 11:18
*/
@Data
public class UserCalendarsEventDTO {
@ApiModelProperty("日历id")
private String calendarId;
@ApiModelProperty("日程id")
private String eventId;
@ApiModelProperty("日程标题")
private String summary;
@ApiModelProperty("开始时间")
private Long startTime;
@ApiModelProperty("截止时间")
private Long endTime;
public UserCalendarsEventDTO(String calendarId, String eventId, String summary, Long startTime, Long endTime) {
this.calendarId = calendarId;
this.eventId = eventId;
this.summary = summary;
this.startTime = startTime;
this.endTime = endTime;
}
}

View File

@@ -0,0 +1,22 @@
package com.cool.store.dto.calendar;
import lombok.Data;
/**
* @author zhangchenbiao
* @FileName: UserFreeBusyList
* @Description:
* @date 2023-06-13 10:06
*/
@Data
public class UserFreeBusyInfoDTO {
private Long startTime;
private Long endTime;
public UserFreeBusyInfoDTO(long startTime, long endTime) {
this.startTime = startTime;
this.endTime = endTime;
}
}

View File

@@ -0,0 +1,20 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: young.yu
* @Date: 2023-06-09 15:41
* @Description:
*/
@Data
@ApiModel
public class EntrustOthersReq {
@ApiModelProperty("会议编号")
private String interviewId;
@ApiModelProperty("新面试官编号")
private String newInterviewerId;
}

View File

@@ -0,0 +1,17 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: young.yu
* @Date: 2023-06-12 17:43
* @Description:
*/
@Data
@ApiModel
public class FinishInterviewReq {
@ApiModelProperty("会议编号")
private String interviewId;
}

View File

@@ -0,0 +1,32 @@
package com.cool.store.request;
import com.cool.store.common.PageBasicInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: young.yu
* @Date: 2023-06-06 15:50
* @Description:
*/
@Data
@ApiModel
public class GetInterviewListReq extends PageBasicInfo {
@ApiModelProperty("加盟商姓名")
private String partnerName;
@ApiModelProperty("加盟商手机号")
private String partnerMobile;
@ApiModelProperty("房间号")
private String roomId;
@ApiModelProperty("面试官姓名")
private String interviewerName;
@ApiModelProperty("面试官手机号")
private String interviewerMobile;
@ApiModelProperty("房间状态:0待开放;1已开放; 2已关闭")
private Integer roomStatus;
@ApiModelProperty("开始时间")
private String startTime;
@ApiModelProperty("结束时间")
private String endTime;
}

View File

@@ -0,0 +1,21 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: young.yu
* @Date: 2023-06-12 17:43
* @Description:
*/
@Data
@ApiModel
public class ModifyInterviewTimeReq {
@ApiModelProperty("会议编号")
private String interviewId;
@ApiModelProperty("新预约开始时间")
private String newStartBookingTime;
@ApiModelProperty("新预约结束时间")
private String newEndBookingTime;
}

View File

@@ -0,0 +1,17 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: young.yu
* @Date: 2023-06-09 15:41
* @Description:
*/
@Data
@ApiModel
public class QueryByInterviewIdReq {
@ApiModelProperty("会议编号")
private String interviewId;
}

View File

@@ -0,0 +1,25 @@
package com.cool.store.response.error;
/**
* @author zhangchenbiao
* @FileName: ErrorResponse
* @Description:
* @date 2023-06-13 19:43
*/
public class ErrorResponse {
private Integer code;
private String message;
public ErrorResponse(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
}

View File

@@ -0,0 +1,145 @@
package com.cool.store.vo.interview;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @Author: young.yu
* @Date: 2023-06-08 16:26
* @Description:
*/
@ApiModel(description = "面试信息")
public class InterviewVO {
@ApiModelProperty(value = "会议id", required = true)
private String interviewId;
@ApiModelProperty(value = "加盟商用户编号")
private String partnerId;
@ApiModelProperty(value = "被面试人姓名", required = true)
private String partnerName;
@ApiModelProperty(value = "被面试人手机号", required = true)
private String partnerMobile;
@ApiModelProperty(value = "房间号", required = true)
private String roomId;
@ApiModelProperty(value = "会议计划开始时间", required = true, example = "2023-06-03 10:00")
private String startTime;
@ApiModelProperty(value = "面试官人员编号")
private String interviewerId;
@ApiModelProperty(value = "面试官姓名", required = true)
private String interviewerName;
@ApiModelProperty(value = "面试官手机号", required = true)
private String interviewerMobile;
@ApiModelProperty(value = "房间状态(0待开放;1已开放;2已关闭)", required = true)
private String roomStatus;
@ApiModelProperty(value = "会议结束时间", required = true, example = "2023-06-03 12:00")
private String endTime;
@ApiModelProperty(value = "预约状态 0 待预约;1待面试;2已开始;3待审核;4审批中;5审批通过;6拒绝", required = true)
private Integer status;
public String getPartnerId() {
return partnerId;
}
public void setPartnerId(String partnerId) {
this.partnerId = partnerId;
}
public String getInterviewerId() {
return interviewerId;
}
public void setInterviewerId(String interviewerId) {
this.interviewerId = interviewerId;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getInterviewId() {
return interviewId;
}
public void setInterviewId(String interviewId) {
this.interviewId = interviewId;
}
public String getPartnerName() {
return partnerName;
}
public void setPartnerName(String partnerName) {
this.partnerName = partnerName;
}
public String getPartnerMobile() {
return partnerMobile;
}
public void setPartnerMobile(String partnerMobile) {
this.partnerMobile = partnerMobile;
}
public String getRoomId() {
return roomId;
}
public void setRoomId(String roomId) {
this.roomId = roomId;
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getInterviewerName() {
return interviewerName;
}
public void setInterviewerName(String interviewerName) {
this.interviewerName = interviewerName;
}
public String getInterviewerMobile() {
return interviewerMobile;
}
public void setInterviewerMobile(String interviewerMobile) {
this.interviewerMobile = interviewerMobile;
}
public String getRoomStatus() {
return roomStatus;
}
public void setRoomStatus(String roomStatus) {
this.roomStatus = roomStatus;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
}

View File

@@ -30,13 +30,17 @@ public class OssUploadConfigVO {
@ApiModelProperty("上传策略Policy失效时间")
private String expire;
public OssUploadConfigVO(String accessKeyId, String policy, String signature, String dir, String host, String expire) {
@ApiModelProperty("cdn地址")
private String cdnUrl;
public OssUploadConfigVO(String accessKeyId, String policy, String signature, String dir, String host, String expire, String cdnUrl) {
this.accessKeyId = accessKeyId;
this.policy = policy;
this.signature = signature;
this.dir = dir;
this.host = host;
this.expire = expire;
this.cdnUrl = cdnUrl;
}
}

View File

@@ -77,6 +77,10 @@
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.48.Final" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
<orderEntry type="library" name="Maven: com.github.tencentyun:tls-sig-api-v2:2.0" level="project" />
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" 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" />
@@ -111,7 +115,6 @@
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.8.3" level="project" />
<orderEntry type="library" name="Maven: com.aliyun:tea-openapi:0.0.19" level="project" />
<orderEntry type="library" name="Maven: com.aliyun:tea-util:0.2.12" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
<orderEntry type="library" name="Maven: com.aliyun:credentials-java:0.2.4" level="project" />
<orderEntry type="library" name="Maven: org.ini4j:ini4j:0.5.4" level="project" />
<orderEntry type="library" name="Maven: org.jacoco:org.jacoco.agent:runtime:0.8.3" level="project" />
@@ -134,5 +137,9 @@
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.xuxueli:xxl-job-core:2.3.0" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-all:4.1.48.Final" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.groovy:groovy:2.5.10" level="project" />
</component>
</module>

View File

@@ -55,6 +55,10 @@
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -1,30 +0,0 @@
package com.cool.store.context;
import com.alibaba.fastjson.JSON;
import org.apache.commons.lang3.StringUtils;
/**
*
*/
public class CurrentUserContext {
private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>();
public static CurrentUser getUser() {
String userStr = contextHolder.get();
if (StringUtils.isNotBlank(userStr)) {
return JSON.parseObject(userStr, CurrentUser.class);
}
return new CurrentUser();
}
public static void setUser(String user) {
contextHolder.set(user);
}
public static void removeUser(){
contextHolder.remove();
}
}

View File

@@ -0,0 +1,54 @@
package com.cool.store.context;
import com.alibaba.fastjson.JSON;
import com.cool.store.entity.SysRoleDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ServiceException;
import org.apache.commons.lang3.SerializationException;
import org.apache.commons.lang3.StringUtils;
import java.util.Optional;
/**
* 当前登录用户信息
*/
public class CurrentUserHolder {
private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>();
public static LoginUserInfo getUser() {
String userStr = contextHolder.get();
if (StringUtils.isNotBlank(userStr)) {
return JSON.parseObject(userStr, LoginUserInfo.class);
}
return new LoginUserInfo();
}
public static void setUser(String user) {
contextHolder.set(user);
}
public static void removeUser(){
contextHolder.remove();
}
/**
* 仅登录态可获取
* @return
*/
public static String getUserId(){
LoginUserInfo user = getUser();
return Optional.ofNullable(user).map(o->o.getUserId()).orElseThrow(()->new ServiceException(ErrorCodeEnum.ACCESS_TOKEN_INVALID));
}
/**
* 仅登录态可获取
* @return
*/
public static String getRoleId(){
LoginUserInfo user = getUser();
return Optional.ofNullable(user).map(LoginUserInfo::getSysRole).map(SysRoleDO::getRoleId).orElse(null);
}
}

View File

@@ -4,7 +4,7 @@ import com.cool.store.entity.SysRoleDO;
import lombok.Data;
@Data
public class CurrentUser {
public class LoginUserInfo {
private String userId;
@@ -29,5 +29,5 @@ public class CurrentUser {
*/
private String avatar;
private SysRoleDO sysRoleDO;
private SysRoleDO sysRole;
}

View File

@@ -0,0 +1,39 @@
package com.cool.store.handler;
import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException;
import com.cool.store.response.error.ErrorResponse;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
/**
* @author zhangchenbiao
* @FileName: CustomExceptionHandler
* @Description: 自定义异常处理
* @date 2023-06-13 19:42
*/
@RestControllerAdvice
public class CustomExceptionHandler {
@ExceptionHandler(value = ServiceException.class)
public ResponseEntity<ErrorResponse> handleCustomException(ServiceException e) {
ErrorResponse errorResponse = new ErrorResponse(e.getErrorCode(), e.getMessage());
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
}
@ExceptionHandler(value = ApiException.class)
public ResponseEntity<ErrorResponse> handleCustomException(ApiException e) {
ErrorResponse errorResponse = new ErrorResponse(e.getErrorCode(), e.getMessage());
return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST);
}
@ExceptionHandler(value = Exception.class)
public ResponseEntity<ErrorResponse> handleException(Exception e) {
ErrorResponse errorResponse = new ErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR.value(), e.getMessage());
return new ResponseEntity<>(errorResponse, HttpStatus.INTERNAL_SERVER_ERROR);
}
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.http;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dto.calendar.*;
import com.cool.store.dto.enterprise.AuthInfoDTO;
import com.cool.store.dto.enterprise.AuthScopeDTO;
import com.cool.store.dto.enterprise.EnterpriseUserDTO;
@@ -8,6 +9,8 @@ import com.cool.store.dto.enterprise.SysDepartmentDTO;
import com.cool.store.dto.login.UserIdInfoDTO;
import com.cool.store.dto.response.ResultDTO;
import com.cool.store.entity.EnterpriseUserDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.mq.util.HttpRestTemplateService;
import com.cool.store.request.EnterpriseUserRequest;
import com.cool.store.utils.RestTemplateUtil;
@@ -40,7 +43,7 @@ public class ISVHttpRequest {
private HttpRestTemplateService httpRestTemplateService;
public UserIdInfoDTO getUserIdByCode(String paramStr){
String url = isvDomain + "/isv/user/getUserIdByCode?" + paramStr;
String url = isvDomain + "/user/getUserIdByCode?" + paramStr;
ResponseEntity<ResultDTO> responseEntity = null;
try {
responseEntity = RestTemplateUtil.loadGet(url, ResultDTO.class);
@@ -55,7 +58,7 @@ public class ISVHttpRequest {
}
public EnterpriseUserDTO getUserDetailByUserId(String userId){
String url = isvDomain + "/isv/user/getUserDetail";
String url = isvDomain + "/user/getUserDetail";
HashMap requestMap = new HashMap();
requestMap.put("userId", userId);
ResultDTO responseEntity = null;
@@ -72,7 +75,7 @@ public class ISVHttpRequest {
}
public List<String> getAdminUserList(){
String url = isvDomain + "/isv/corp/getAdminUserList";
String url = isvDomain + "/corp/getAdminUserList";
HashMap requestMap = new HashMap();
ResultDTO responseEntity = null;
try {
@@ -88,7 +91,7 @@ public class ISVHttpRequest {
}
public AuthInfoDTO getAuthInfo(){
String url = isvDomain + "/isv/corp/getAuthInfo";
String url = isvDomain + "/corp/getAuthInfo";
HashMap requestMap = new HashMap();
ResultDTO responseEntity = null;
try {
@@ -104,7 +107,7 @@ public class ISVHttpRequest {
}
public List<SysDepartmentDTO> getDepartments(String parentId){
String url = isvDomain + "/isv/corp/getDepartments";
String url = isvDomain + "/corp/getDepartments";
HashMap requestMap = new HashMap();
requestMap.put("parentId", parentId);
ResultDTO responseEntity = null;
@@ -121,7 +124,7 @@ public class ISVHttpRequest {
}
public AuthScopeDTO getAuthScope(){
String url = isvDomain + "/isv/corp/getAuthScope";
String url = isvDomain + "/corp/getAuthScope";
HashMap requestMap = new HashMap();
ResultDTO responseEntity = null;
try {
@@ -137,7 +140,7 @@ public class ISVHttpRequest {
}
public List<EnterpriseUserDTO> getDepartmentUsers(String deptId){
String url = isvDomain + "/isv/corp/getDepartmentUsers";
String url = isvDomain + "/corp/getDepartmentUsers";
HashMap requestMap = new HashMap();
requestMap.put("deptId", deptId);
ResultDTO responseEntity = null;
@@ -154,7 +157,7 @@ public class ISVHttpRequest {
}
public List<EnterpriseUserDTO> getUserDetailByUserIds(List<String> userIdList) {
String url = isvDomain + "/isv/corp/getDepartmentUsers";
String url = isvDomain + "/corp/getDepartmentUsers";
HashMap requestMap = new HashMap();
requestMap.put("userIds", userIdList);
ResultDTO responseEntity = null;
@@ -171,7 +174,7 @@ public class ISVHttpRequest {
}
public List<SysDepartmentDTO> getSubDepartments(String parentId, Boolean fetchChild) {
String url = isvDomain + "/isv/corp/getSubDepartments";
String url = isvDomain + "/corp/getSubDepartments";
HashMap requestMap = new HashMap();
requestMap.put("parentId", parentId);
requestMap.put("fetchChild", fetchChild);
@@ -188,28 +191,96 @@ public class ISVHttpRequest {
return null;
}
public List<EnterpriseUserRequest> getDeptUsers(String deptId) {
List<EnterpriseUserDTO> departmentUsers = getDepartmentUsers(deptId);
if (CollectionUtils.isEmpty(departmentUsers)){
return Lists.newArrayList();
}
List<EnterpriseUserRequest> userList = Lists.newArrayList();
for (EnterpriseUserDTO enterpriseUserDTO:departmentUsers) {
EnterpriseUserDO enterpriseUser = new EnterpriseUserDO();
enterpriseUser.setCreateTime(new Date());
enterpriseUser.setIsAdmin(false);
enterpriseUser.setRemark(enterpriseUserDTO.getRemark());
enterpriseUser.setUserId(enterpriseUserDTO.getUserId());
if (enterpriseUserDTO.getIsLeaderInDepts() != null) {
//enterpriseUser.setIsLeaderInDepts(JSONObject.toJSONString(enterpriseUserDTO.getIsLeaderInDepts()));
/**
* 获取用户忙闲信息
* @param userId
* @param startTime 开始时间 毫秒时间戳
* @param endTime 截止时间 毫秒时间戳
* @return
*/
public List<UserFreeBusyInfoDTO> getFreeBusyList(String userId, long startTime, long endTime) throws ApiException{
String url = isvDomain + "/user/getFreeBusyList";
HashMap requestMap = new HashMap();
requestMap.put("userId", userId);
requestMap.put("startTime", startTime);
requestMap.put("endTime", endTime);
ResultDTO responseEntity = null;
try {
responseEntity = httpRestTemplateService.getForObject(url, ResultDTO.class, requestMap);
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
if(Objects.nonNull(responseEntity.getData()) && responseEntity.isSuccess()){
return JSONObject.parseArray(JSONObject.toJSONString(responseEntity.getData()), UserFreeBusyInfoDTO.class);
}
EnterpriseUserRequest enterpriseUserRequest = new EnterpriseUserRequest();
//enterpriseUserRequest.setEnterpriseUserDO(enterpriseUser);
if (CollectionUtils.isNotEmpty(enterpriseUserDTO.getDepartmentLists())) {
enterpriseUserRequest.setDepartment(JSONObject.toJSONString(enterpriseUserDTO.getDepartmentLists()));
}
userList.add(enterpriseUserRequest);
} catch (Exception e) {
log.info("调用isv出错{}", e);
throw new ApiException(e.getMessage());
}
return userList;
return null;
}
/**
* 创建飞书日程
* @param param
* @return
* @throws ApiException
*/
public UserCalendarsEventDTO createUserCalendarEvent(CreateCalendarEventDTO param) throws ApiException{
String url = isvDomain + "/user/createUserCalendarEvent";
ResultDTO responseEntity = null;
try {
responseEntity = httpRestTemplateService.postForObject(url, param, ResultDTO.class);
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
if(Objects.nonNull(responseEntity.getData()) && responseEntity.isSuccess()){
return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getData()), UserCalendarsEventDTO.class);
}
} catch (Exception e) {
log.info("调用isv出错{}", e);
throw new ApiException(e.getMessage());
}
return null;
}
/**
* 更新飞书日程
* @param param
* @return
* @throws ApiException
*/
public UserCalendarsEventDTO updateUserCalendarEvent(UpdateCalendarEventDTO param) throws ApiException{
String url = isvDomain + "/user/updateUserCalendarEvent";
ResultDTO responseEntity = null;
try {
responseEntity = httpRestTemplateService.postForObject(url, param, ResultDTO.class);
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
if(Objects.nonNull(responseEntity.getData()) && responseEntity.isSuccess()){
return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getData()), UserCalendarsEventDTO.class);
}
} catch (Exception e) {
log.info("调用isv出错{}", e);
throw new ApiException(e.getMessage());
}
return null;
}
/**
* 取消飞书日程
* @param param
* @return
* @throws ApiException
*/
public UserCalendarsEventDTO deleteUserCalendarEvent(DeleteCalendarEventDTO param) throws ApiException {
String url = isvDomain + "/user/deleteUserCalendarEvent";
ResultDTO responseEntity = null;
try {
responseEntity = httpRestTemplateService.postForObject(url, param, ResultDTO.class);
log.info("url:{}, response:{}", url, JSONObject.toJSONString(responseEntity));
if(Objects.nonNull(responseEntity.getData()) && responseEntity.isSuccess()){
return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getData()), UserCalendarsEventDTO.class);
}
} catch (Exception e) {
log.info("调用isv出错{}", e);
throw new ApiException(e.getMessage());
}
return null;
}
}

View File

@@ -0,0 +1,32 @@
package com.cool.store.job;
import com.cool.store.service.EnterpriseSyncService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author zhangchenbiao
* @FileName: JobHandler
* @Description:
* @date 2023-06-14 16:07
*/
@Slf4j
@Service
public class JobHandler {
@Resource
private EnterpriseSyncService enterpriseSyncService;
@XxlJob("syncOrganization")
public void syncOrganization(){
log.info("组织架构定时同步开始");
enterpriseSyncService.syncAll();
log.info("组织架构同步结束");
XxlJobHelper.handleSuccess();
}
}

View File

@@ -8,7 +8,7 @@ import com.aliyun.openservices.ons.api.bean.Subscription;
import com.cool.store.constants.CommonConstants;
import com.cool.store.enums.RocketMqGroupEnum;
import com.cool.store.mq.RocketMqConfig;
import com.cool.store.mq.consumer.listener.UserEventDealListener;
import com.cool.store.mq.consumer.listener.FeiShuEventListener;
import com.google.common.collect.Maps;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -29,7 +29,7 @@ public class ConsumerClient {
@Resource
private RocketMqConfig rocketMqConfig;
@Resource
private UserEventDealListener userEventDealListener;
private FeiShuEventListener feiShuEventListener;
/**
* 获取通用配置
@@ -66,17 +66,17 @@ public class ConsumerClient {
}
/**
* 测试test
* 用户事件监听
* @return
*/
@Bean(initMethod = "start", destroyMethod = "shutdown")
public ConsumerBean test() {
RocketMqGroupEnum groupEnum = RocketMqGroupEnum.DING_MSG_DEAL;
RocketMqGroupEnum groupEnum = RocketMqGroupEnum.FEI_SHU_EVENT_LISTENER;
ConsumerBean consumerBean = new ConsumerBean();
//配置文件
Properties properties = getCommonProperties(groupEnum);
consumerBean.setProperties(properties);
Map<Subscription, MessageListener> commonSubscriptionTable = getCommonSubscriptionTable(groupEnum, userEventDealListener);
Map<Subscription, MessageListener> commonSubscriptionTable = getCommonSubscriptionTable(groupEnum, feiShuEventListener);
//订阅多个topic如上面设置
consumerBean.setSubscriptionTable(commonSubscriptionTable);
return consumerBean;

View File

@@ -7,6 +7,7 @@ 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.buser.UserEventDTO;
import com.cool.store.enums.RocketMqTagEnum;
import com.cool.store.service.EnterpriseSyncService;
import com.cool.store.utils.RedisUtilPool;
import lombok.extern.slf4j.Slf4j;
@@ -22,7 +23,7 @@ import org.springframework.stereotype.Service;
*/
@Slf4j
@Service
public class UserEventDealListener implements MessageListener {
public class FeiShuEventListener implements MessageListener {
@Autowired
private RedisUtilPool redisUtilPool;
@@ -37,13 +38,20 @@ public class UserEventDealListener implements MessageListener {
return Action.CommitMessage;
}
log.info("重试消费次数 messageId{}try times{}", message.getMsgID(), message.getReconsumeTimes());
String lockKey = "DingMsgDealListener:" + message.getMsgID();
boolean lock = redisUtilPool.setNxExpire(lockKey, message.getMsgID(), CommonConstants.NORMAL_LOCK_TIMES);
if(lock){
try {
UserEventDTO reqBody = JSONObject.parseObject(text, UserEventDTO.class);
enterpriseSyncService.userUpdateEvent(reqBody);
RocketMqTagEnum tag = RocketMqTagEnum.getByTag(message.getTag());
switch (tag){
case USER_EVENT:
UserEventDTO reqBody = JSONObject.parseObject(text, UserEventDTO.class);
enterpriseSyncService.userUpdateEvent(reqBody);
break;
case AUTH_SCOPE_CHANGE:
enterpriseSyncService.syncAll();
}
}catch (Exception e){
log.error("DingMsgDealListener consume dealAddressBookChange error",e);
return Action.ReconsumeLater;

View File

@@ -0,0 +1,42 @@
package com.cool.store.service;
import com.cool.store.request.EntrustOthersReq;
import com.cool.store.request.FinishInterviewReq;
import com.cool.store.request.GetInterviewListReq;
import com.cool.store.request.ModifyInterviewTimeReq;
import com.cool.store.vo.interview.InterviewVO;
import java.util.List;
/**
* @Author: young.yu
* @Date: 2023-06-06 15:01
* @Description :面试service
*/
public interface InterviewService {
List<InterviewVO> getInterviewList(GetInterviewListReq request);
/**
* 根据面试会议id查询面试信息
* @param interviewId
* @return
*/
InterviewVO getInterviewInfo(String interviewId);
/**
* 委托他人
* @param request
*/
void entrustOthers(EntrustOthersReq request);
/**
* 修改面试时间
* @param request
*/
void modifyInterviewTime(ModifyInterviewTimeReq request);
/**
* 结束面试
* @param request
*/
void finishInterview(FinishInterviewReq request);
}

View File

@@ -12,5 +12,11 @@ import java.util.List;
*/
public interface MenuService {
List<MenuTreeVO> getUserMenus(String userId);
/**
* 获取用户某个角色的菜单
* @param userId
* @param roleId
* @return
*/
List<MenuTreeVO> getUserMenus(String userId, String roleId);
}

View File

@@ -3,6 +3,7 @@ package com.cool.store.service.impl;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.*;
import com.cool.store.dto.buser.UserEventDTO;
import com.cool.store.dto.calendar.DeleteCalendarEventDTO;
import com.cool.store.dto.enterprise.*;
import com.cool.store.entity.*;
import com.cool.store.enums.DataSourceEnum;
@@ -195,6 +196,9 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
break;
case USER_DELETED:
//人员职位删除状态,角色职位删除状态,人员从部门去除
userRegionMappingDAO.deleteUserRegionByUserId(param.getUserId());
enterpriseUserRoleDAO.deleteUserRole(param.getUserId());
enterpriseUserDAO.deleteUserByUserId(param.getUserId());
break;
default:
return;

View File

@@ -0,0 +1,102 @@
package com.cool.store.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import com.cool.store.entity.HyPartnerInterviewDO;
import com.cool.store.entity.HyPartnerInterviewPlanDO;
import com.cool.store.mapper.HyPartnerInterviewMapper;
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
import com.cool.store.request.EntrustOthersReq;
import com.cool.store.request.FinishInterviewReq;
import com.cool.store.request.GetInterviewListReq;
import com.cool.store.request.ModifyInterviewTimeReq;
import com.cool.store.service.InterviewService;
import com.cool.store.vo.interview.InterviewVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* @Author: young.yu
* @Date: 2023-06-06 15:19
* @Description:
*/
@Slf4j
@Service
public class InterviewServiceImpl implements InterviewService {
@Autowired
private HyPartnerInterviewPlanMapper hyPartnerInterviewPlanMapper;
@Autowired
private HyPartnerInterviewMapper hyPartnerInterviewMapper;
@Override
public List<InterviewVO> getInterviewList(GetInterviewListReq request) {
List<InterviewVO> interviewList = hyPartnerInterviewPlanMapper.getInterviewList(request);
return interviewList;
}
@Override
public InterviewVO getInterviewInfo(String interviewId) {
return hyPartnerInterviewPlanMapper.getInterviewInfo(interviewId);
}
@Override
public void entrustOthers(EntrustOthersReq request) {
//TODO 1.原面试官日程删除
//TODO 2.新面试官日程新增
//TODO 3.面试信息变更
HyPartnerInterviewPlanDO record = new HyPartnerInterviewPlanDO();
record.setId(Long.valueOf(request.getInterviewId()));
record.setInterviewer(request.getInterviewId());
record.setUpdateTime(new Date());
hyPartnerInterviewPlanMapper.updateByPrimaryKeySelective(record);
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
hyPartnerInterviewDO.setInterviewPlanId(Long.valueOf(request.getInterviewId()));
hyPartnerInterviewDO.setInterviewer(request.getNewInterviewerId());
hyPartnerInterviewDO.setUpdateTime(new Date());
hyPartnerInterviewMapper.updateByPrimaryKeySelective(hyPartnerInterviewDO);
}
@Override
public void modifyInterviewTime(ModifyInterviewTimeReq request) {
//TODO 修改面试时间
HyPartnerInterviewPlanDO record = new HyPartnerInterviewPlanDO();
record.setId(Long.valueOf(request.getInterviewId()));
record.setStartTime(Convert.toDate(request.getNewStartBookingTime()));
record.setUpdateTime(new Date());
hyPartnerInterviewPlanMapper.updateByPrimaryKeySelective(record);
}
@Override
public void finishInterview(FinishInterviewReq request) {
//更新面试计划信息
HyPartnerInterviewPlanDO record = new HyPartnerInterviewPlanDO();
record.setId(Long.valueOf(request.getInterviewId()));
record.setRoomStatus(0);
record.setUpdateTime(new Date());
hyPartnerInterviewPlanMapper.updateByPrimaryKeySelective(record);
//更新面试信息
HyPartnerInterviewDO hyPartnerInterviewDO = new HyPartnerInterviewDO();
hyPartnerInterviewDO.setInterviewPlanId(Long.valueOf(request.getInterviewId()));
hyPartnerInterviewDO.setStatus(3);
hyPartnerInterviewDO.setUpdateTime(new Date());
hyPartnerInterviewMapper.updateByPrimaryKeySelective(hyPartnerInterviewDO);
}
}

View File

@@ -1,9 +1,8 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.context.CurrentUser;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.context.DataSourceContext;
import com.cool.store.dao.*;
import com.cool.store.dto.login.RefreshUser;
@@ -51,7 +50,7 @@ public class LoginServiceImpl implements LoginService {
if (StringUtils.isEmpty(userId)) {
throw new ServiceException(ErrorCodeEnum.USER_NOT_EXIST);
}
CurrentUser currentUser = new CurrentUser();
LoginUserInfo currentUser = new LoginUserInfo();
RefreshUser refreshUser = new RefreshUser();
// 查企业用户
EnterpriseUserDO enterpriseUser = enterpriseUserDAO.getUserInfoById(userId);
@@ -76,7 +75,7 @@ public class LoginServiceImpl implements LoginService {
enterpriseUser.setFaceUrl(finalAvatar);
currentUser.setUserId(enterpriseUser.getUserId());
currentUser.setIsAdmin(enterpriseUser.getIsAdmin());
currentUser.setSysRoleDO(sysRole);
currentUser.setSysRole(sysRole);
currentUser.setCorpId(corpId);
currentUser.setAvatar(enterpriseUser.getAvatar());
//生成令牌

View File

@@ -24,8 +24,9 @@ public class MenuServiceImpl implements MenuService {
private SysMenuDAO sysMenuDAO;
@Override
public List<MenuTreeVO> getUserMenus(String userId) {
public List<MenuTreeVO> getUserMenus(String userId, String roleId) {
List<SysMenuDO> menuList= sysMenuDAO.selectMenuAll(null, PlatFormTypeEnum.PC.getCode());
//根据角色获取菜单
return MenuTreeVO.dealMenuTree(CommonConstants.ZERO_LONG, menuList);
}
}

View File

@@ -47,6 +47,10 @@
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.48.Final" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
<orderEntry type="library" name="Maven: com.github.tencentyun:tls-sig-api-v2:2.0" level="project" />
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" 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" />
@@ -98,6 +102,10 @@
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.xuxueli:xxl-job-core:2.3.0" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-all:4.1.48.Final" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.groovy:groovy:2.5.10" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.2.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.6.RELEASE" level="project" />
@@ -138,7 +146,6 @@
<orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.1" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-core:4.5.10" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
<orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />

View File

@@ -3,9 +3,9 @@ package com.cool.store.config;
import com.alibaba.fastjson.JSON;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.response.ResponseResult;
import com.cool.store.context.CurrentUserContext;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.context.CurrentUser;
import com.cool.store.context.LoginUserInfo;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -72,14 +72,14 @@ public class TokenValidateFilter implements Filter {
String uri = reqs.getRequestURI();
String method = reqs.getMethod();
String userStr = "";
CurrentUser currentUser = null;
LoginUserInfo currentUser = null;
boolean isInWhiteList = excludePath(uri);
String accessToken = reqs.getHeader("accessToken");
String key = "access_token:" + accessToken;
if(StringUtils.isNotBlank(accessToken)){
userStr = redisUtilPool.getString(key);
if(StringUtils.isNotBlank(userStr)){
currentUser = JSON.parseObject(userStr, CurrentUser.class);
currentUser = JSON.parseObject(userStr, LoginUserInfo.class);
}
}
log.info("url:{}", uri);
@@ -105,10 +105,10 @@ public class TokenValidateFilter implements Filter {
return;
}
try {
CurrentUserContext.setUser(userStr);
CurrentUserHolder.setUser(userStr);
filterChain.doFilter(servletRequest, servletResponse);
} finally {
CurrentUserContext.removeUser();
CurrentUserHolder.removeUser();
}
}

View File

@@ -0,0 +1,59 @@
package com.cool.store.config;
import com.alibaba.fastjson.JSONObject;
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
/**
* @author zhangchenbiao
* @FileName: XxlJobConfig
* @Description: xxljob 配置信息
* @date 2021-11-12 15:26
*/
@Configuration
@ComponentScan(basePackages = "com.cool.store.job")
public class XxlJobConfig {
private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
@Value("${xxl.job.admin.addresses}")
private String adminAddresses;
@Value("${xxl.job.executor.appname}")
private String appName;
@Value("${xxl.job.executor.ip}")
private String ip;
@Value("${xxl.job.executor.port}")
private int port;
@Value("${xxl.job.accessToken}")
private String accessToken;
@Value("${xxl.job.executor.logpath}")
private String logPath;
@Value("${xxl.job.executor.logretentiondays}")
private int logRetentionDays;
@Bean
public XxlJobSpringExecutor xxlJobExecutor() {
logger.info(">>>>>>>>>>> xxl-job config init.");
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
xxlJobSpringExecutor.setAppname(appName);
xxlJobSpringExecutor.setIp(ip);
xxlJobSpringExecutor.setPort(port);
xxlJobSpringExecutor.setAccessToken(accessToken);
xxlJobSpringExecutor.setLogPath(logPath);
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
return xxlJobSpringExecutor;
}
}

View File

@@ -0,0 +1,70 @@
package com.cool.store.controller;
import com.cool.store.request.*;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.InterviewService;
import com.cool.store.vo.interview.InterviewVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Author: young.yu
* @Date: 2023-06-06 15:22
* @Description:
*/
@RestController
@RequestMapping("/interview")
@Api(tags = "面试信息")
public class InterviewController {
@Autowired
private InterviewService interviewService;
@PostMapping("/list")
@ApiOperation("获取面试信息列表")
public ResponseResult<PageInfo<InterviewVO>> getInterviewList(@RequestBody GetInterviewListReq request) {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
List<InterviewVO> interviewList = interviewService.getInterviewList(request);
return ResponseResult.success(new PageInfo<>(interviewList));
}
@PostMapping("/queryByInterviewId")
@ApiOperation("根据面试会议id查询面试信息")
public ResponseResult<InterviewVO> queryByInterviewId(@RequestBody QueryByInterviewIdReq request) {
InterviewVO interviewVO = interviewService.getInterviewInfo(request.getInterviewId());
return ResponseResult.success(interviewVO);
}
@PostMapping("/entrustOthers")
@ApiOperation("委托他人")
public ResponseResult entrustOthers(@RequestBody EntrustOthersReq request) {
interviewService.entrustOthers(request);
return ResponseResult.success();
}
@PostMapping("/modifyInterviewTime")
@ApiOperation("修改面试时间")
public ResponseResult modifyInterviewTime(@RequestBody ModifyInterviewTimeReq request) {
interviewService.modifyInterviewTime(request);
return ResponseResult.success();
}
@PostMapping("/finish")
@ApiOperation("修改面试时间")
public ResponseResult finishInterview(@RequestBody FinishInterviewReq request) {
interviewService.finishInterview(request);
return ResponseResult.success();
}
}

View File

@@ -1,7 +1,7 @@
package com.cool.store.controller;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.context.CurrentUserContext;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.dto.login.FeiShuLoginDTO;
import com.cool.store.dto.login.UserIdInfoDTO;
import com.cool.store.enums.ErrorCodeEnum;
@@ -59,7 +59,7 @@ public class LoginController {
@GetMapping("/getUserInfoByToken")
public ResponseResult getUserInfoByToken(){
return ResponseResult.success(CurrentUserContext.getUser());
return ResponseResult.success(CurrentUserHolder.getUser());
}
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.controller;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.MenuService;
import org.springframework.web.bind.annotation.GetMapping;
@@ -21,7 +22,7 @@ public class MenuController {
@GetMapping("/menu/getUserMenus")
public ResponseResult getUserMenus(){
return ResponseResult.success(menuService.getUserMenus(null));
return ResponseResult.success(menuService.getUserMenus(CurrentUserHolder.getUserId(), CurrentUserHolder.getRoleId()));
}
}

View File

@@ -40,6 +40,8 @@ public class OssClientController {
private String bucket;
@Value("${corp.id:null}")
private String corpId;
@Value("${cdn.url:null}")
private String cdnUrl;
@GetMapping("/getUploadFileConfig")
public ResponseResult getUploadFileConfig(){
@@ -60,7 +62,7 @@ public class OssClientController {
byte[] binaryData = postPolicy.getBytes("utf-8");
String encodedPolicy = BinaryUtil.toBase64String(binaryData);
String signature = client.calculatePostSignature(postPolicy);
OssUploadConfigVO result = new OssUploadConfigVO(accessKeyId, encodedPolicy, signature, dir, host, String.valueOf(expireEndTime / 1000));
OssUploadConfigVO result = new OssUploadConfigVO(accessKeyId, encodedPolicy, signature, dir, host, String.valueOf(expireEndTime / 1000), cdnUrl);
return ResponseResult.success(result);
}catch (Exception e){
log.info("exception", e);

View File

@@ -1,10 +1,16 @@
package com.cool.store.controller;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dto.calendar.CreateCalendarEventDTO;
import com.cool.store.dto.calendar.DeleteCalendarEventDTO;
import com.cool.store.dto.calendar.UpdateCalendarEventDTO;
import com.cool.store.dto.calendar.UserCalendarsEventDTO;
import com.cool.store.dto.response.ResultDTO;
import com.cool.store.entity.HyOpenAreaInfoDO;
import com.cool.store.entity.EnterpriseUserDO;
import com.cool.store.enums.RocketMqTagEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.mapper.HyOpenAreaInfoMapper;
import com.cool.store.http.ISVHttpRequest;
import com.cool.store.mq.producer.SimpleMessageService;
@@ -32,8 +38,6 @@ import java.util.List;
@RequestMapping("test/")
public class TestController {
@Resource
private SimpleMessageService simpleMessageService;
@Resource
private EnterpriseUserService enterpriseUserService;
@Resource
@@ -43,15 +47,6 @@ public class TestController {
@Resource
private EnterpriseSyncService enterpriseSyncService;
@GetMapping("/sendMq")
public ResponseResult sendMq(){
String msg = UUIDUtils.get8UUID();
log.info("msg:{}", msg);
simpleMessageService.send(msg, RocketMqTagEnum.TEST);
return ResponseResult.success();
}
@PostMapping("/post")
public ResponseResult<Boolean> get(@RequestBody List<TestRequest> testRequestList){
log.info(JSONObject.toJSONString(testRequestList));
@@ -166,4 +161,29 @@ public class TestController {
return ResponseResult.success();
}
@GetMapping("/user/getFreeBusyList")
public ResultDTO<List<UserCalendarsEventDTO>> getFreeBusyList(@RequestParam("userId") String userId, @RequestParam("startTime") long startTime,
@RequestParam("endTime") long endTime) throws ApiException {
log.info("getUserCalendarsEvents : corpId:{}, appType:{}, userId:{}, startTime:{}, endTime:{}", userId, startTime, endTime);
return ResultDTO.successResult(isvHttpRequest.getFreeBusyList(userId, startTime, endTime));
}
@PostMapping("/user/createUserCalendarEvent")
public ResultDTO<UserCalendarsEventDTO> createUserCalendarEvent(@RequestBody CreateCalendarEventDTO param) throws ApiException {
log.info("createUserCalendarEvent , param:{}", JSONObject.toJSONString(param));
return ResultDTO.successResult(isvHttpRequest.createUserCalendarEvent(param));
}
@PostMapping("/user/updateUserCalendarEvent")
public ResultDTO<UserCalendarsEventDTO> updateUserCalendarEvent(@RequestBody UpdateCalendarEventDTO param) throws ApiException {
log.info("updateUserCalendarEvent , param:{}", JSONObject.toJSONString(param));
return ResultDTO.successResult(isvHttpRequest.updateUserCalendarEvent(param));
}
@PostMapping("/user/deleteUserCalendarEvent")
public ResultDTO<UserCalendarsEventDTO> deleteUserCalendarEvent(@RequestBody DeleteCalendarEventDTO param) throws ApiException {
log.info("createUserCalendarEvent , param:{}", JSONObject.toJSONString(param));
return ResultDTO.successResult(isvHttpRequest.deleteUserCalendarEvent(param));
}
}

View File

@@ -33,22 +33,34 @@ mybatis.mapper-locations=classpath*:mapper/**/*Mapper.xml
mybatis.configuration.call-setters-on-nulls=true
mybatis.configuration.map-underscore-to-camel-case=true
isv.domain = https://abstore-isv.coolstore.cn
isv.domain = https://abstore-isv.coolstore.cn/isv
#rocketmq \u914D\u7F6E
rocketmq.accessKey=LTAI5t5ouXZuFgxJMbQea3b2
rocketmq.secretKey=yuomDstRjSdihtN5zo8viDbWu8Z0ig
rocketmq.nameSrvAdder=http://MQ_INST_1947409023213164_BX3sLZnA.cn-hangzhou.mq-internal.aliyuncs.com:8080
rocketmq.accessKey=zK2oVEz4G1ts23d2
rocketmq.secretKey=0UstLCS0mh2ASgBh
rocketmq.nameSrvAdder=http://rmq-cn-9lb38l1rx04.cn-hangzhou.rmq.aliyuncs.com:8080
rocketmq.topic=simple_message
rocketmq.orderTopic=order_message
#oss配置
oss.accessKeyId=LTAI5tRSXy2MrqaaBJ6gReur
oss.accessKeySecret=FFsl8d9batprJ0vXr0k4Y8ada40Wm2
oss.endpoint=oss-cn-hangzhou.aliyuncs.com
oss.bucket=cool-store-hsay
#企业corpId
corp.id = 171cddee76471740
#cdn地址
cdn.url=https://testhsaypic.coolstore.cn
#TRTC
trtc.sdkAppId=1400811820
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
#xxljob配置
xxl.job.admin.addresses = http://10.7.53.224:10001/xxl-job-admin
xxl.job.executor.appname = ${spring.application.name}
xxl.job.executor.ip =
xxl.job.executor.port = 31001
xxl.job.executor.logpath = logs/xxl-job/jobhandler
xxl.job.executor.logretentiondays = 3
xxl.job.accessToken =

View File

@@ -51,4 +51,13 @@ corp.id = 171cddee76471740
#TRTC
trtc.sdkAppId=1400811820
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
#xxljob配置
xxl.job.admin.addresses = https://djob.coolstore.cn/xxl-job-admin
xxl.job.executor.appname = ${spring.application.name}
xxl.job.executor.ip =
xxl.job.executor.port = 31001
xxl.job.executor.logpath = logs/xxl-job/jobhandler
xxl.job.executor.logretentiondays = 3
xxl.job.accessToken =

View File

@@ -49,8 +49,20 @@ oss.accessKeyId=LTAI5tRSXy2MrqaaBJ6gReur
oss.accessKeySecret=FFsl8d9batprJ0vXr0k4Y8ada40Wm2
oss.endpoint=oss-cn-hangzhou.aliyuncs.com
oss.bucket=vec-coolstore
#企业corpId
corp.id = 171cddee76471740
#cdn地址
cdn.url=https://testhsaypic.coolstore.cn
#TRTC
trtc.sdkAppId=1400811820
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
xxl.job.admin.addresses =
xxl.job.executor.appname = ${spring.application.name}
xxl.job.executor.ip =
xxl.job.executor.port = 30201
xxl.job.executor.logpath = logs/xxl-job/jobhandler
xxl.job.executor.logretentiondays = 30
xxl.job.accessToken =

View File

@@ -47,6 +47,10 @@
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.48.Final" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
<orderEntry type="library" name="Maven: com.github.tencentyun:tls-sig-api-v2:2.0" level="project" />
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" 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" />
@@ -96,6 +100,10 @@
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.xuxueli:xxl-job-core:2.3.0" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-all:4.1.48.Final" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.groovy:groovy:2.5.10" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.2.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.10.3" level="project" />
@@ -138,7 +146,6 @@
<orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.1" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-core:4.5.10" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
<orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />

View File

@@ -37,6 +37,8 @@ public class OssClientController {
private String bucket;
@Value("${corp.id:null}")
private String corpId;
@Value("${cdn.url:null}")
private String cdnUrl;
@GetMapping("/getUploadFileConfig")
public ResponseResult getUploadFileConfig(){
@@ -57,7 +59,7 @@ public class OssClientController {
byte[] binaryData = postPolicy.getBytes("utf-8");
String encodedPolicy = BinaryUtil.toBase64String(binaryData);
String signature = client.calculatePostSignature(postPolicy);
OssUploadConfigVO result = new OssUploadConfigVO(accessKeyId, encodedPolicy, signature, dir, host, String.valueOf(expireEndTime / 1000));
OssUploadConfigVO result = new OssUploadConfigVO(accessKeyId, encodedPolicy, signature, dir, host, String.valueOf(expireEndTime / 1000), cdnUrl);
return ResponseResult.success(result);
}catch (Exception e){
log.info("exception", e);

View File

@@ -36,18 +36,21 @@ mybatis.configuration.map-underscore-to-camel-case=true
isv.domain = https://abstore-isv.coolstore.cn
#rocketmq \u914D\u7F6E
rocketmq.accessKey=LTAI5t5ouXZuFgxJMbQea3b2
rocketmq.secretKey=yuomDstRjSdihtN5zo8viDbWu8Z0ig
rocketmq.nameSrvAdder=http://MQ_INST_1947409023213164_BX3sLZnA.cn-hangzhou.mq-internal.aliyuncs.com:8080
rocketmq.accessKey=zK2oVEz4G1ts23d2
rocketmq.secretKey=0UstLCS0mh2ASgBh
rocketmq.nameSrvAdder=http://rmq-cn-9lb38l1rx04.cn-hangzhou.rmq.aliyuncs.com:8080
rocketmq.topic=simple_message
rocketmq.orderTopic=order_message
#oss配置
oss.accessKeyId=LTAI5tRSXy2MrqaaBJ6gReur
oss.accessKeySecret=FFsl8d9batprJ0vXr0k4Y8ada40Wm2
oss.endpoint=oss-cn-hangzhou.aliyuncs.com
oss.bucket=cool-store-hsay
#企业corpId
corp.id = 171cddee76471740
#cdn地址
cdn.url=https://testhsaypic.coolstore.cn
#TRTC
trtc.sdkAppId=1400811820

View File

@@ -50,7 +50,11 @@ oss.accessKeyId=LTAI5tKSnAbkEbmT6CeBwNN3
oss.accessKeySecret=PbXOzUFwAvZ2K5zIawwa7NAJE2pFXS
oss.endpoint=oss-cn-shanghai.aliyuncs.com
oss.bucket=vec-coolstore
#企业corpId
corp.id = 171cddee76471740
#cdn地址
cdn.url=https://testhsaypic.coolstore.cn
#TRTC
trtc.sdkAppId=1400811820

View File

@@ -171,6 +171,11 @@
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
</dependencyManagement>