Commit fa7dd426 by 谢海旭

v5.7.0版本 飞行督导-小程序端:专项任务、学习中心

1 parent 5b11ae02
Showing 23 changed files with 898 additions and 5 deletions
package cn.com.glsx.dj.supervisor.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class CoursePageInfo implements Serializable {
@ApiModelProperty(notes = "课程id")
private String courseId;
@ApiModelProperty(notes = "课程标题")
private String title;
@ApiModelProperty(notes = "课程类型:10-视频,80-音频,20-混合,30-文档,40-H5,70-URL,120-图文")
private String courseFileType;
@ApiModelProperty(notes = "课程总时长(单位:分钟)")
private BigDecimal totalDuration;
@ApiModelProperty(notes = "课程状态:10-转换中, 20-转换失败, 30-未发布, 40-已发布, 50-已下架")
private String courseStatus;
@ApiModelProperty(notes = "分类名称")
private String categoryName;
@ApiModelProperty(notes = "分类id")
private Integer categoryId;
@ApiModelProperty(notes = "父级分类id")
private Integer parentId;
@ApiModelProperty(notes = "部门名称")
private String organizationName;
@ApiModelProperty(notes = "学习人数")
private Integer learnTotal;
@ApiModelProperty(notes = "课程总评分")
private BigDecimal totalStar;
@ApiModelProperty(notes = "创建人")
private String createdBy;
@ApiModelProperty(notes = "北森创建人用户id")
private Integer beisenCreatedBy;
@ApiModelProperty(notes = "创建时间")
private Date createdTime;
@ApiModelProperty(notes = "学习进度")
private BigDecimal progress;
@ApiModelProperty(notes = "学习状态:10 - 未学习,20 - 未完成,30 - 待考核,40 - 未通过,50 - 已完成,60 - 待签署")
private String learnStatus;
}
package cn.com.glsx.dj.supervisor.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 课程推送请求 DTO
*/
@Data
public class CoursePushDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 驻店手机号
*/
private String storeManagerPhone;
/**
* 驻店姓名
*/
private String storeManagerName;
/**
* 北森课程标识
*/
private String bcCourseId;
/**
* 北森课程名称
*/
private String bcCourseName;
}
package cn.com.glsx.dj.supervisor.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
public class CourseSearchDTO implements Serializable {
@ApiModelProperty(notes = "课程名称")
private String title;
@ApiModelProperty(notes = "课程分类id")
private Integer courseCategoryId;
@ApiModelProperty(notes = "排除未分类课程:1-排除")
private Integer excludeNullCategoryId;
@ApiModelProperty(notes = "课程id列表")
private List<String> courseIds;
@ApiModelProperty(notes = "课程类型:10-视频,80-音频,20-混合,30-文档,40-H5,70-URL,120-图文")
private String courseFileType;
@ApiModelProperty(notes = "课程状态:10-转换中, 20-转换失败, 30-未发布, 40-已发布, 50-已下架")
private String courseStatus;
/**
* 课程状态列表
*/
private List<String> statusList;
private List<Integer> userIdList;
@ApiModelProperty(notes = "部门id")
private Integer organizationV2Id;
private List<Integer> organizationIdList;
@ApiModelProperty(notes = "创建人")
private String createdBy;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(notes = "创建时间开始, 格式: yyyy-MM-dd HH:mm:ss")
private Date createTimeStart;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(notes = "创建时间结束, 格式: yyyy-MM-dd HH:mm:ss")
private Date createTimeEnd;
@ApiModelProperty(notes = "排序类型:0-学习人数,1-评分,2-创建时间", required = true)
private Integer sortType;
@ApiModelProperty(notes = "排序顺序:asc-升序,desc-降序", required = true)
private String sortOrder;
@ApiModelProperty(notes = "排序类型:0-学习人数升序,1-学习人数降序,2-评分升序,3-评分降序,4-创建时间升序,5-创建时间降序", required = true)
private Integer orderByType;
@ApiModelProperty(notes = "员工手机号")
private String staffPhone;
@ApiModelProperty(notes = "课程总评分")
private BigDecimal totalStar;
@ApiModelProperty(notes = "周期类型:0-总榜,1-日榜,2-周榜,3-月榜")
private Integer periodType;
@ApiModelProperty(notes = "修习标识:1-必修,2-选修")
private Integer planCourseType;
private Integer userId;
private Integer rankLimit;
@ApiModelProperty(notes = "业务类型(1.延保 2.轻改 3.权益)")
private Integer bizs;
}
package cn.com.glsx.dj.supervisor.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 学习中心-我的课程-推荐课程
* @author xiehx
* @version 1.0
* @since 2026/03/11 15:32
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class MyselfCourseRecommendDTO implements Serializable {
private static final long serialVersionUID = -4811308989776259758L;
/**
* 调用标识 0:内部调用
*/
private String invokeFlag;
/**
* 北森人员标识
*/
private Integer personId;
/**
* 手机号码
*/
@NotBlank(message = "手机号码不能为空")
private String phone;
/**
* 北森课程标识
*/
private String courseId;
/**
* 课程标题
*/
private String title;
/**
* 总时长(分钟)
*/
private BigDecimal totalDuration;
/**
* 总评分结果
*/
private BigDecimal totalStar;
/**
* 学习总人数
*/
private Integer learnTotal;
/**
* 课程文件类型 10:视频 80:音频 20:混合 30:文档 40:H5 70:URL 120:图文
*/
private String courseFileType;
/**
* 学习进度(百分比)
*/
private BigDecimal process;
}
package cn.com.glsx.dj.supervisor.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 人员课程推荐查询 DTO
*/
@Data
public class PersonCourseRecommendDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 人员手机号
*/
private String personPhone;
/**
* 人员姓名
*/
private String personName;
/**
* 北森课程标识
*/
private String bcCourseId;
/**
* 北森课程名称
*/
private String bcCourseName;
/**
* 推送来源(1-飞行督导)
*/
private Integer pushSource;
}
package cn.com.glsx.dj.supervisor.dto; package cn.com.glsx.dj.supervisor.dto;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskCourse;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskImage; import cn.com.glsx.dj.supervisor.model.SupervisorTaskImage;
import cn.com.glsx.dj.supervisor.model.SupervisorWeekTaskStaff; import cn.com.glsx.dj.supervisor.model.SupervisorWeekTaskStaff;
import cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemote; import cn.com.glsx.dj.supervisor.remote.SupervisorTaskInfoRemote;
...@@ -51,6 +52,9 @@ public class SupervisorTaskDTO implements Serializable { ...@@ -51,6 +52,9 @@ public class SupervisorTaskDTO implements Serializable {
@ApiModelProperty(notes = "驻店员工姓名") @ApiModelProperty(notes = "驻店员工姓名")
private String storeManagerName; private String storeManagerName;
@ApiModelProperty(notes = "任务描述")
private String taskDesc;
/** /**
* 督导记录(富文本内容) * 督导记录(富文本内容)
*/ */
...@@ -71,6 +75,12 @@ public class SupervisorTaskDTO implements Serializable { ...@@ -71,6 +75,12 @@ public class SupervisorTaskDTO implements Serializable {
private Integer audioReviewCompletedCount; private Integer audioReviewCompletedCount;
/** /**
* 创建时间
*/
@ApiModelProperty(notes = "创建时间")
private Date createTime;
/**
* 更新时间 * 更新时间
*/ */
@ApiModelProperty(notes = "更新时间") @ApiModelProperty(notes = "更新时间")
...@@ -91,4 +101,7 @@ public class SupervisorTaskDTO implements Serializable { ...@@ -91,4 +101,7 @@ public class SupervisorTaskDTO implements Serializable {
@ApiModelProperty(notes = "照片图片列表") @ApiModelProperty(notes = "照片图片列表")
private List<SupervisorTaskImage> taskImageList; private List<SupervisorTaskImage> taskImageList;
@ApiModelProperty(notes = "课程列表")
private List<SupervisorTaskCourse> taskCourseList;
} }
package cn.com.glsx.dj.supervisor.enums;
import org.springframework.util.StringUtils;
/**
* 课程状态:10-转换中, 20-转换失败, 30-未发布, 40-已发布, 50-已下架
*/
public enum BeisenCourseStatusEnum {
CONVERTING("10", "转换中"),
CONVERT_FAILED("20", "转换失败"),
UNRELEASED("30", "未发布"),
RELEASED("40", "已发布"),
SOLD_OUT("50", "已下架");
private final String code;
private final String desc;
BeisenCourseStatusEnum(String code, String desc) {
this.code = code;
this.desc = desc;
}
public String getCode() {
return code;
}
public String getDesc() {
return desc;
}
/**
* 根据状态码获取状态描述
* @param code 状态码
* @return 状态描述
*/
public static String getDescByCode(String code) {
if (StringUtils.isEmpty(code)) {
return null;
}
for (BeisenCourseStatusEnum e : values()) {
if (e.getCode().equals(code)) {
return e.getDesc();
}
}
return null;
}
}
...@@ -31,6 +31,12 @@ public class PersonCourseRecommendation implements Serializable { ...@@ -31,6 +31,12 @@ public class PersonCourseRecommendation implements Serializable {
private String personName; private String personName;
/** /**
* 北森人员id
*/
@Column(name = "beisen_userid")
private Integer beisenUserId;
/**
* 北森课程标识 * 北森课程标识
*/ */
@Column(name = "bc_course_id") @Column(name = "bc_course_id")
......
package cn.com.glsx.dj.supervisor.remote;
import cn.com.glsx.dj.supervisor.dto.MyselfCourseRecommendDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
@ApiService(value = "督导学习中心", owner = "xiehx")
public interface PersonCourseRecommendationRemote {
@ApiMethod("查询人员课程推荐分页接口")
@ApiParam(name = "pagination", notes = "分页查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("分页结果")
RpcResponse<RpcPagination<MyselfCourseRecommendDTO>> getPersonCourseRecommendPage(RpcPagination<MyselfCourseRecommendDTO> pagination);
}
package cn.com.glsx.dj.supervisor.remote;
import cn.com.glsx.dj.supervisor.dto.CoursePageInfo;
import cn.com.glsx.dj.supervisor.dto.CoursePushDTO;
import cn.com.glsx.dj.supervisor.dto.CourseSearchDTO;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.List;
@ApiService(value = "督导学习中心", owner = "xiehx")
public interface SupervisorLearningCenterRemote {
@ApiMethod("查询全部课程分页接口")
@ApiParam(name = "request", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("分页结果")
RpcResponse<RpcPagination<CoursePageInfo>> allCourse(RpcPagination<CourseSearchDTO> pagination);
@ApiMethod("批量推送课程给驻店人员")
@ApiParam(name = "coursePushList", notes = "课程推送列表", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("操作结果")
RpcResponse<Boolean> batchPushCourseToStoreManager(List<CoursePushDTO> coursePushList);
}
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>cn.com.glsx.merchants</groupId>
<artifactId>platform-merchants-api</artifactId>
<version>5.6.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-supervisor-api</artifactId> <artifactId>rpc-dj-supervisor-api</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
......
package cn.com.glsx.dj.supervisor.mapper; package cn.com.glsx.dj.supervisor.mapper;
import cn.com.glsx.dj.supervisor.dto.CoursePageInfo;
import cn.com.glsx.dj.supervisor.dto.CourseSearchDTO;
import cn.com.glsx.dj.supervisor.dto.MyselfCourseRecommendDTO;
import cn.com.glsx.dj.supervisor.model.PersonCourseRecommendation; import cn.com.glsx.dj.supervisor.model.PersonCourseRecommendation;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper; import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.List;
@Mapper @Mapper
public interface PersonCourseRecommendationMapper extends OreMapper<PersonCourseRecommendation> { public interface PersonCourseRecommendationMapper extends OreMapper<PersonCourseRecommendation> {
/**
* 分页查询北森全部已分类的正常状态的课程
*
* @param condition
* @return
*/
List<CoursePageInfo> allCourse(CourseSearchDTO condition);
List<MyselfCourseRecommendDTO> getPersonCourseRecommendPage(MyselfCourseRecommendDTO condition);
} }
package cn.com.glsx.dj.supervisor.remote;
import cn.com.glsx.dj.supervisor.dto.MyselfCourseRecommendDTO;
import cn.com.glsx.dj.supervisor.service.PersonCourseRecommendationService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2026/3/10
**/
@Slf4j
@DubboService(version = "1.0.0", retries = 0, timeout = 30000, validation = "true", protocol = "dubbo")
public class PersonCourseRecommendationRemoteImpl implements PersonCourseRecommendationRemote {
@Autowired
private PersonCourseRecommendationService personCourseRecommendationService;
@Override
public RpcResponse<RpcPagination<MyselfCourseRecommendDTO>> getPersonCourseRecommendPage(RpcPagination<MyselfCourseRecommendDTO> pagination) {
try {
Page<MyselfCourseRecommendDTO> pageRes = personCourseRecommendationService.getPersonCourseRecommendPage(pagination);
return RpcResponse.success(RpcPagination.copyPage(pageRes));
} catch (RpcServiceException e) {
log.info("getPersonCourseRecommendPage.exception!", e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.info("getPersonCourseRecommendPage.exception!", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
}
package cn.com.glsx.dj.supervisor.remote;
import cn.com.glsx.dj.supervisor.dto.CoursePageInfo;
import cn.com.glsx.dj.supervisor.dto.CoursePushDTO;
import cn.com.glsx.dj.supervisor.dto.CourseSearchDTO;
import cn.com.glsx.dj.supervisor.service.SupervisorLearningCenterService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2026/3/10
**/
@Slf4j
@DubboService(version = "1.0.0", retries = 0, timeout = 30000, validation = "true", protocol = "dubbo")
public class SupervisorLearningCenterRemoteImpl implements SupervisorLearningCenterRemote {
@Autowired
private SupervisorLearningCenterService supervisorLearningCenterService;
@Override
public RpcResponse<RpcPagination<CoursePageInfo>> allCourse(RpcPagination<CourseSearchDTO> pagination) {
try {
Page<CoursePageInfo> pageRes = supervisorLearningCenterService.allCourse(pagination);
return RpcResponse.success(RpcPagination.copyPage(pageRes));
} catch (RpcServiceException e) {
log.info("allCourse.exception!", e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.info("allCourse.exception!", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
@Override
public RpcResponse<Boolean> batchPushCourseToStoreManager(List<CoursePushDTO> coursePushList) {
try {
Boolean result = supervisorLearningCenterService.batchPushCourseToStoreManager(coursePushList);
return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.info("batchPushCourseToStoreManager.exception!", e);
return RpcResponse.error(e.getError(), e.getMessage());
} catch (Exception e) {
log.info("batchPushCourseToStoreManager.exception!", e);
return RpcResponse.error(DefaultErrorEnum.SERVICE_ERROR, e.getMessage());
}
}
}
package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.dto.MyselfCourseRecommendDTO;
import cn.com.glsx.dj.supervisor.mapper.PersonCourseRecommendationMapper;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2026/3/10
**/
@Service
@Slf4j
public class PersonCourseRecommendationService {
@Autowired
private PersonCourseRecommendationMapper personCourseRecommendationMapper;
/**
* 分页查询人员课程推荐数据
*
* @param pagination 分页参数
* @return 分页结果
*/
public Page<MyselfCourseRecommendDTO> getPersonCourseRecommendPage(RpcPagination<MyselfCourseRecommendDTO> pagination) {
Page<MyselfCourseRecommendDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize());
personCourseRecommendationMapper.getPersonCourseRecommendPage(pagination.getCondition());
log.info("分页查询人员课程推荐数据,pagination={}", pagination);
return page;
}
}
package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.dto.CoursePageInfo;
import cn.com.glsx.dj.supervisor.dto.CoursePushDTO;
import cn.com.glsx.dj.supervisor.dto.CourseSearchDTO;
import cn.com.glsx.dj.supervisor.enums.BeisenCourseStatusEnum;
import cn.com.glsx.dj.supervisor.enums.PushSourceEnum;
import cn.com.glsx.dj.supervisor.mapper.PersonCourseRecommendationMapper;
import cn.com.glsx.dj.supervisor.model.PersonCourseRecommendation;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.util.RpcAssert;
import cn.com.glsx.merchants.dto.beisen.BeiSenEmployeeListRequestDTO;
import cn.com.glsx.merchants.dto.beisen.BeiSenEmployeeListResonseDTO;
import cn.com.glsx.merchants.remote.MerchantStaffRemote;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2026/3/10
**/
@Service
@Slf4j
public class SupervisorLearningCenterService {
@Autowired
private PersonCourseRecommendationMapper personCourseRecommendationMapper;
@Autowired
private MerchantStaffRemote merchantStaffRemote;
public Page<CoursePageInfo> allCourse(RpcPagination<CourseSearchDTO> pagination) {
CourseSearchDTO condition= pagination.getCondition();
condition.setCourseStatus(BeisenCourseStatusEnum.RELEASED.getCode());
//分页查询
Page<CoursePageInfo> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize());
personCourseRecommendationMapper.allCourse(condition);
return page;
}
/**
* 批量推送课程给驻店人员
*
* @param coursePushList 课程推送列表
* @return 操作结果
*/
@Transactional
public Boolean batchPushCourseToStoreManager(List<CoursePushDTO> coursePushList) {
if (CollectionUtils.isEmpty(coursePushList)) {
log.warn("批量推送课程给驻店人员,参数为空");
return false;
}
List<String> phoneList = coursePushList.stream().map(CoursePushDTO::getStoreManagerPhone).distinct().collect(Collectors.toList());
List<BeiSenEmployeeListResonseDTO> employeeList = listEmployeeInfoByStaffPhone(phoneList);
Map<String, Integer> phoneUserIdMap = Collections.EMPTY_MAP;
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(employeeList)) {
//构建map
phoneUserIdMap = employeeList.stream().collect(Collectors.toMap(BeiSenEmployeeListResonseDTO::getMobilePhone, BeiSenEmployeeListResonseDTO::getUserID));
}
Date date = new Date();
List<PersonCourseRecommendation> recordList = new ArrayList<>();
// 遍历参数,转换为 PersonCourseRecommendation 对象
for (CoursePushDTO dto : coursePushList) {
PersonCourseRecommendation record = new PersonCourseRecommendation();
BeanUtils.copyProperties(dto, record);
record.setPersonPhone(dto.getStoreManagerPhone());
record.setPersonName(dto.getStoreManagerName());
record.setBeisenUserId(phoneUserIdMap.get(dto.getStoreManagerPhone()));
record.setPushSource(PushSourceEnum.SUPERVISOR.getCode());
record.setCreatedTime(date);
record.setDeletedFlag(BaseModel.DeletedFlagEnum.N.name());
recordList.add(record);
}
// 批量插入
int count = personCourseRecommendationMapper.insertList(recordList);
log.info("批量推送课程给驻店人员成功,记录数={}, coursePushList={}", count, coursePushList.size());
return count > 0;
}
public List<BeiSenEmployeeListResonseDTO> listEmployeeInfoByStaffPhone(List<String> phoneList) {
RpcAssert.assertNotEmpty(phoneList, DefaultErrorEnum.PARAMETER_NULL, "员工手机号不能为空");
RpcPagination<BeiSenEmployeeListRequestDTO> pagination = new RpcPagination<>();
BeiSenEmployeeListRequestDTO condition = new BeiSenEmployeeListRequestDTO();
pagination.setCondition(condition);
pagination.setPageNum(1);
pagination.setPageSize(phoneList.size());
condition.setMobilePhoneList(phoneList);
RpcResponse<RpcPagination<BeiSenEmployeeListResonseDTO>> rpcRes = merchantStaffRemote.getBeisenUserWithConditions(pagination);
RpcPagination<BeiSenEmployeeListResonseDTO> result = rpcRes.getResult();
if (result == null || org.apache.commons.collections4.CollectionUtils.isEmpty(result.getList())) {
return null;
}
return result.getList();
}
}
package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.mapper.SupervisorTaskCourseMapper;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskCourse;
import cn.com.glsx.framework.core.beans.BaseModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
@Service
@Slf4j
public class SupervisorTaskCourseService {
@Autowired
private SupervisorTaskCourseMapper supervisorTaskCourseMapper;
/**
* 根据任务ID查询带教任务课程列表
*
* @param taskId
* @return
*/
public List<SupervisorTaskCourse> selectByTaskId(Long taskId) {
Example example = new Example(SupervisorTaskCourse.class);
example.createCriteria().andEqualTo("taskId", taskId).andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name());
return supervisorTaskCourseMapper.selectByExample(example);
}
}
...@@ -7,6 +7,7 @@ import cn.com.glsx.dj.supervisor.enums.TaskStatusEnum; ...@@ -7,6 +7,7 @@ import cn.com.glsx.dj.supervisor.enums.TaskStatusEnum;
import cn.com.glsx.dj.supervisor.enums.TaskTypeEnum; import cn.com.glsx.dj.supervisor.enums.TaskTypeEnum;
import cn.com.glsx.dj.supervisor.mapper.SupervisorTaskInfoMapper; import cn.com.glsx.dj.supervisor.mapper.SupervisorTaskInfoMapper;
import cn.com.glsx.dj.supervisor.model.SupervisorAudioReviewInfo; import cn.com.glsx.dj.supervisor.model.SupervisorAudioReviewInfo;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskCourse;
import cn.com.glsx.dj.supervisor.model.SupervisorTaskInfo; import cn.com.glsx.dj.supervisor.model.SupervisorTaskInfo;
import cn.com.glsx.dj.supervisor.model.SupervisorWeekTaskStaff; import cn.com.glsx.dj.supervisor.model.SupervisorWeekTaskStaff;
import cn.com.glsx.framework.core.beans.BaseModel; import cn.com.glsx.framework.core.beans.BaseModel;
...@@ -57,8 +58,8 @@ public class SupervisorTaskInfoService { ...@@ -57,8 +58,8 @@ public class SupervisorTaskInfoService {
@Autowired @Autowired
private SupervisorAudioReviewInfoService supervisorAudioReviewInfoService; private SupervisorAudioReviewInfoService supervisorAudioReviewInfoService;
@Autowired
private SupervisorTaskCourseService supervisorTaskCourseService;
/** /**
* 生成日报信息 * 生成日报信息
...@@ -214,7 +215,10 @@ public class SupervisorTaskInfoService { ...@@ -214,7 +215,10 @@ public class SupervisorTaskInfoService {
List<SupervisorWeekTaskStaff> weekTaskStaffList = supervisorWeekTaskStaffService.selectByRelationId(id); List<SupervisorWeekTaskStaff> weekTaskStaffList = supervisorWeekTaskStaffService.selectByRelationId(id);
taskInfo.setWeekTaskStaffList(weekTaskStaffList); taskInfo.setWeekTaskStaffList(weekTaskStaffList);
} }
//TODO: 处理带教类型 if (TaskTypeEnum.TRAINING.getCode().equals(taskInfo.getTaskType())) {
List<SupervisorTaskCourse> taskCourseList = supervisorTaskCourseService.selectByTaskId(id);
taskInfo.setTaskCourseList(taskCourseList);
}
return taskInfo; return taskInfo;
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<id column="id" property="id" jdbcType="BIGINT" /> <id column="id" property="id" jdbcType="BIGINT" />
<result column="person_phone" property="personPhone" jdbcType="VARCHAR" /> <result column="person_phone" property="personPhone" jdbcType="VARCHAR" />
<result column="person_name" property="personName" jdbcType="VARCHAR" /> <result column="person_name" property="personName" jdbcType="VARCHAR" />
<result column="beisen_userid" property="beisenUserId" jdbcType="INTEGER" />
<result column="bc_course_id" property="bcCourseId" jdbcType="VARCHAR" /> <result column="bc_course_id" property="bcCourseId" jdbcType="VARCHAR" />
<result column="bc_course_name" property="bcCourseName" jdbcType="VARCHAR" /> <result column="bc_course_name" property="bcCourseName" jdbcType="VARCHAR" />
<result column="push_source" property="pushSource" jdbcType="INTEGER" /> <result column="push_source" property="pushSource" jdbcType="INTEGER" />
...@@ -17,11 +18,81 @@ ...@@ -17,11 +18,81 @@
<result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP" /> <result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" /> <result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap> </resultMap>
<resultMap id="CoursePageMap" type="cn.com.glsx.dj.supervisor.dto.CoursePageInfo">
<result column="id" property="courseId" jdbcType="VARCHAR" />
<result column="title" property="title" jdbcType="VARCHAR" />
<result column="course_file_type" property="courseFileType" jdbcType="VARCHAR" />
<result column="total_duration" property="totalDuration"/>
<result column="course_status" property="courseStatus" jdbcType="VARCHAR" />
<result column="categoryName" property="categoryName" jdbcType="VARCHAR" />
<result column="categoryId" property="categoryId" />
<result column="parentId" property="parentId"/>
<result column="organizationName" property="organizationName" jdbcType="VARCHAR" />
<result column="learn_total" property="learnTotal" />
<result column="total_star" property="totalStar" />
<result column="beisen_created_time" property="createdTime" />
</resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
id, person_phone, person_name, bc_course_id, bc_course_name, push_source, created_by, id, person_phone, person_name, beisen_userid, bc_course_id, bc_course_name, push_source, created_by,
created_time, updated_by, updated_time, deleted_flag created_time, updated_by, updated_time, deleted_flag
</sql> </sql>
<select id="allCourse" resultType="cn.com.glsx.dj.supervisor.dto.CoursePageInfo" resultMap="CoursePageMap">
select bc.id as courseId, bc.title, bc.course_file_type, bc.total_duration, bc.course_status,
bc.learn_total, round(bc.total_star,1) as total_star, bc.beisen_created_time
from dj_beisen_course bc
left join dj_car_life_learning_center_course_category_rel ccr on bc.id = ccr.course_id and ccr.deleted_flag = 'N'
<where>
bc.deleted_flag = 'N' and ccr.id is not null and ccr.category_id <![CDATA[<>]]> 1
<if test="courseCategoryId != null">
and (ccr.category_id = #{courseCategoryId} or ccr.parent_id = #{courseCategoryId})
</if>
<if test="title != null and title != ''">
and bc.title like concat('%', #{title}, '%')
</if>
<if test="courseFileType != null and courseFileType != ''">
and bc.course_file_type = #{courseFileType}
</if>
<if test="courseStatus != null and courseStatus != ''">
and bc.course_status = #{courseStatus}
</if>
<if test="totalStar != null">
and bc.total_star &gt;= #{totalStar}
</if>
</where>
<if test="sortType != null">
<choose>
<when test="sortType == 0">
order by bc.learn_total ${sortOrder}, bc.title asc
</when>
<when test="sortType == 1">
order by bc.total_star ${sortOrder}, bc.title asc
</when>
<otherwise>
order by bc.beisen_created_time ${sortOrder}, bc.title asc
</otherwise>
</choose>
</if>
</select>
<select id="getPersonCourseRecommendPage"
resultType="cn.com.glsx.dj.supervisor.dto.MyselfCourseRecommendDTO">
SELECT
ROUND(t2.process * 100, 0) AS process,
t2.process AS process,
t2.course_id AS courseId,
t1.title AS title,
t1.total_duration AS totalDuration,
t1.total_star AS totalStar,
t1.learn_total AS learnTotal,
t1.course_file_type AS courseFileType
FROM person_course_recommendation t
INNER JOIN dj_beisen_course t1 ON t.bc_course_id = t1.id AND t1.course_status = '40' AND t1.deleted_flag = 'N'
LEFT JOIN dj_beisen_course_staff t2 ON t.bc_course_id = t2.course_id AND t.beisen_userid = t2.user_id AND t2.deleted_flag = 'N'
WHERE t.person_phone = #{phone}
AND t.deleted_flag = 'N'
ORDER BY t.created_time DESC
</select>
</mapper> </mapper>
...@@ -39,8 +39,10 @@ ...@@ -39,8 +39,10 @@
<result column="on_duty_flag" property="onDutyFlag" /> <result column="on_duty_flag" property="onDutyFlag" />
<result column="merchant_id" property="merchantId" /> <result column="merchant_id" property="merchantId" />
<result column="merchant_name" property="merchantName"/> <result column="merchant_name" property="merchantName"/>
<result column="task_desc" property="taskDesc" />
<result column="task_context" property="taskContext" /> <result column="task_context" property="taskContext" />
<result column="store_manager_name" property="storeManagerName"/> <result column="store_manager_name" property="storeManagerName"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" /> <result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<collection property="taskImageList" ofType="cn.com.glsx.dj.supervisor.model.SupervisorTaskImage"> <collection property="taskImageList" ofType="cn.com.glsx.dj.supervisor.model.SupervisorTaskImage">
<result column="image_url" property="imageUrl" /> <result column="image_url" property="imageUrl" />
...@@ -63,7 +65,7 @@ ...@@ -63,7 +65,7 @@
</sql> </sql>
<select id="getTaskDetailById" resultMap="TaskDetailMap"> <select id="getTaskDetailById" resultMap="TaskDetailMap">
select sti.id, sti.task_type, sti.task_status, sti.on_duty_flag, sti.merchant_id, sti.merchant_name,sti.task_context,sti.updated_date, select sti.id, sti.task_type, sti.task_status, sti.on_duty_flag, sti.merchant_id, sti.merchant_name, sti.task_desc,sti.task_context,sti.create_time,sti.updated_date,
sti.image_url sti.image_url
from supervisor_task_info sti from supervisor_task_info sti
left join supervisor_task_image sti on sti.relation_id = sti.id and sti.deleted_flag = 'N' left join supervisor_task_image sti on sti.relation_id = sti.id and sti.deleted_flag = 'N'
......
package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.dto.MyselfCourseRecommendDTO;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2026/3/11
**/
public class PersonCourseRecommendationServiceTest extends BaseServiceTest {
@Autowired
private PersonCourseRecommendationService personCourseRecommendationService;
@Test
public void testGetPersonCourseRecommendPage() {
RpcPagination<MyselfCourseRecommendDTO> pagination = new RpcPagination<>();
pagination.setPageNum(1);
pagination.setPageSize(10);
MyselfCourseRecommendDTO condition = new MyselfCourseRecommendDTO();
condition.setPhone("13603070903");
pagination.setCondition(condition);
Page<MyselfCourseRecommendDTO> page = personCourseRecommendationService.getPersonCourseRecommendPage(pagination);
System.out.println(JSON.toJSONString(page));
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.dto.CoursePageInfo;
import cn.com.glsx.dj.supervisor.dto.CoursePushDTO;
import cn.com.glsx.dj.supervisor.dto.CourseSearchDTO;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2026/3/10
**/
public class SupervisorLearningCenterServiceTest extends BaseServiceTest {
@Autowired
private SupervisorLearningCenterService supervisorLearningCenterService;
@Test
public void testAllCourse() {
RpcPagination<CourseSearchDTO> pagination = new RpcPagination<>();
pagination.setCondition(new CourseSearchDTO());
pagination.setPageNum(1);
pagination.setPageSize(10);
Page<CoursePageInfo> pageInfos = supervisorLearningCenterService.allCourse(pagination);
System.out.println(JSON.toJSONString(pageInfos));
}
@Test
public void testBatchPushCourseToStoreManager() {
ArrayList<CoursePushDTO> coursePushDTOs = new ArrayList<>();
CoursePushDTO coursePushDTO = new CoursePushDTO();
coursePushDTO.setStoreManagerPhone("13603070903");
coursePushDTO.setStoreManagerName("谢海旭");
coursePushDTO.setBcCourseId("4d86438b-917a-4bc9-86e2-d2beb6ff26d2");
coursePushDTO.setBcCourseName("冒烟");
coursePushDTOs.add(coursePushDTO);
Boolean b = supervisorLearningCenterService.batchPushCourseToStoreManager(coursePushDTOs);
System.out.println(b);
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.supervisor.service;
import cn.com.glsx.dj.supervisor.dto.SupervisorTaskDTO;
import com.alibaba.fastjson.JSON;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2026/3/11
**/
public class SupervisorTaskInfoServiceTest extends BaseServiceTest {
@Autowired
private SupervisorTaskInfoService supervisorTaskInfoService;
@Test
public void testGetTaskDetailById() {
SupervisorTaskDTO detail = supervisorTaskInfoService.getTaskDetailById(1L);
System.out.println(JSON.toJSONString(detail));
}
}
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!