|
@@ -43,8 +43,6 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@Service
|
|
|
public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkTask> implements IHyWorkTaskService {
|
|
|
- @Autowired
|
|
|
- private HyWorkTaskMapper qwWorkTaskMapper;
|
|
|
@Autowired
|
|
|
private FsCourseWatchLogMapper fsCourseWatchLogMapper;
|
|
|
@Autowired
|
|
@@ -57,6 +55,9 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
private ICompanyCacheService companyCacheService;
|
|
|
@Autowired
|
|
|
private ICompanyUserCacheService companyUserCacheService;
|
|
|
+ @Autowired
|
|
|
+ private HyWorkTaskMapper hyWorkTaskMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询企微任务看板
|
|
|
*
|
|
@@ -64,9 +65,9 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
* @return 企微任务看板
|
|
|
*/
|
|
|
@Override
|
|
|
- public QwWorkTask selectQwWorkTaskById(Long id)
|
|
|
+ public QwWorkTask selectHyWorkTaskById(Long id)
|
|
|
{
|
|
|
- return baseMapper.selectQwWorkTaskById(id);
|
|
|
+ return baseMapper.selectHyWorkTaskById(id);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -76,9 +77,9 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
* @return 企微任务看板
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<QwWorkTask> selectQwWorkTaskList(QwWorkTask qwWorkTask)
|
|
|
+ public List<QwWorkTask> selectHyWorkTaskList(QwWorkTask qwWorkTask)
|
|
|
{
|
|
|
- return baseMapper.selectQwWorkTaskList(qwWorkTask);
|
|
|
+ return baseMapper.selectHyWorkTaskList(qwWorkTask);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -88,10 +89,10 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int insertQwWorkTask(QwWorkTask qwWorkTask)
|
|
|
+ public int insertHyWorkTask(QwWorkTask qwWorkTask)
|
|
|
{
|
|
|
qwWorkTask.setCreateTime(DateUtils.getNowDate());
|
|
|
- return baseMapper.insertQwWorkTask(qwWorkTask);
|
|
|
+ return baseMapper.insertHyWorkTask(qwWorkTask);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -101,10 +102,10 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int updateQwWorkTask(QwWorkTask qwWorkTask)
|
|
|
+ public int updateHyWorkTask(QwWorkTask qwWorkTask)
|
|
|
{
|
|
|
qwWorkTask.setUpdateTime(DateUtils.getNowDate());
|
|
|
- return baseMapper.updateQwWorkTask(qwWorkTask);
|
|
|
+ return baseMapper.updateHyWorkTask(qwWorkTask);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -114,9 +115,9 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int deleteQwWorkTaskByIds(Long[] ids)
|
|
|
+ public int deleteHyWorkTaskByIds(Long[] ids)
|
|
|
{
|
|
|
- return baseMapper.deleteQwWorkTaskByIds(ids);
|
|
|
+ return baseMapper.deleteHyWorkTaskByIds(ids);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -126,13 +127,13 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int deleteQwWorkTaskById(Long id)
|
|
|
+ public int deleteHyWorkTaskById(Long id)
|
|
|
{
|
|
|
- return baseMapper.deleteQwWorkTaskById(id);
|
|
|
+ return baseMapper.deleteHyWorkTaskById(id);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void addQwWorkByFirstCourse() {
|
|
|
+ public void addHyWorkByFirstCourse() {
|
|
|
List<FsQwCourseWatchLogVO> fsQwCourseWatchLogVOS = fsCourseWatchLogMapper.selectFsCourseWatchLogByVideoId();
|
|
|
ArrayList<QwWorkTask> qwWorkTasks = new ArrayList<>();
|
|
|
for (FsQwCourseWatchLogVO vo : fsQwCourseWatchLogVOS) {
|
|
@@ -149,11 +150,11 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
qwWorkTasks.add(qwWorkTask);
|
|
|
}
|
|
|
if (!qwWorkTasks.isEmpty()) {
|
|
|
- qwWorkTaskMapper.insertQwWorkTaskBatch(qwWorkTasks);
|
|
|
+ hyWorkTaskMapper.insertQwWorkTaskBatch(qwWorkTasks);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- Integer getQwWorkCourseScore(Integer type, Integer day,Integer leve){
|
|
|
+ Integer getHyWorkCourseScore(Integer type, Integer day,Integer leve){
|
|
|
|
|
|
switch (day){
|
|
|
case 1:
|
|
@@ -173,15 +174,12 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
|
|
|
|
|
|
}
|
|
|
- @Autowired
|
|
|
- FsCourseWatchLogMapper courseWatchLogMapper;
|
|
|
|
|
|
- //
|
|
|
@Override
|
|
|
- public void addQwWorkByCourse() {
|
|
|
+ public void addHyWorkByCourse() {
|
|
|
List<QwSop> qwSops = qwSopMapper.selectQwSopByIsRating();
|
|
|
LocalDate today = LocalDate.now();
|
|
|
- List<Long> extIds = qwWorkTaskMapper.selectQwWorkTaskByType();
|
|
|
+ List<Long> extIds = hyWorkTaskMapper.selectHyWorkTaskByType();
|
|
|
Set<Long> extIdSet = new HashSet<>(extIds);
|
|
|
for (QwSop qwSop : qwSops) {
|
|
|
if (qwSop.getCourseDay()==null){
|
|
@@ -193,7 +191,7 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- List<FsCourseWatchLogTaskVO> fsCourseWatchLogs = courseWatchLogMapper.selectFsCourseWatchLogByDaySopId3(qwSop.getId());
|
|
|
+ List<FsCourseWatchLogTaskVO> fsCourseWatchLogs = fsCourseWatchLogMapper.selectFsCourseWatchLogByDaySopId3(qwSop.getId());
|
|
|
if (fsCourseWatchLogs==null || fsCourseWatchLogs.isEmpty()) {
|
|
|
continue;
|
|
|
}
|
|
@@ -212,7 +210,7 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
LocalDate createDate = LocalDate.parse(createTime.substring(0, 10), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
// 计算两个日期之间的天数差
|
|
|
Integer day = (Math.toIntExact(ChronoUnit.DAYS.between(createDate, today))) + 1 - courseDay;
|
|
|
- Integer score = getQwWorkCourseScore(fsCourseWatchLog.getLogType(), day,fsCourseWatchLog.getLevel());
|
|
|
+ Integer score = getHyWorkCourseScore(fsCourseWatchLog.getLogType(), day,fsCourseWatchLog.getLevel());
|
|
|
if (score==0){
|
|
|
continue;
|
|
|
}
|
|
@@ -230,7 +228,7 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
qwWorkTasks.add(qwWorkTask);
|
|
|
}
|
|
|
if (!qwWorkTasks.isEmpty()){
|
|
|
- qwWorkTaskMapper.insertQwWorkTaskBatch(qwWorkTasks);
|
|
|
+ hyWorkTaskMapper.insertQwWorkTaskBatch(qwWorkTasks);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -239,7 +237,7 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public void addQwWorkByConversionDay() {
|
|
|
+ public void addHyWorkByConversionDay() {
|
|
|
List<QwSop> qwSops = qwSopMapper.selectQwSopByIsRatingNotNull();
|
|
|
Map<Integer, Integer> minMap = new HashMap<>();
|
|
|
minMap.put(1, 10);
|
|
@@ -253,19 +251,14 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
Integer min= qwSop.getMinConversionDay();
|
|
|
Integer max = qwSop.getMaxConversionDay();
|
|
|
LocalDate today = LocalDate.now();
|
|
|
- addQwWorkTask(today, min, qwSop, "用户小转",minMap);
|
|
|
- addQwWorkTask(today, max, qwSop, "用户大转",MaxMap);
|
|
|
+ addHyWorkTask(today, min, qwSop, "用户小转",minMap);
|
|
|
+ addHyWorkTask(today, max, qwSop, "用户大转",MaxMap);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<QwWorkTaskListVO> selectQwWorkTaskListVO(QwWorkTaskListParam qwWorkTask) {
|
|
|
- return qwWorkTaskMapper.selectQwWorkTaskListVO(qwWorkTask);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<QwWorkTaskListVO> selectQwWorkTaskListVONew(QwWorkTaskListParam qwWorkTask) {
|
|
|
- List<QwWorkTaskListVO> list = qwWorkTaskMapper.selectQwWorkTaskListVONew(qwWorkTask);
|
|
|
+ public List<QwWorkTaskListVO> selectHyWorkTaskListVONew(QwWorkTaskListParam qwWorkTask) {
|
|
|
+ List<QwWorkTaskListVO> list = hyWorkTaskMapper.selectHyWorkTaskListVONew(qwWorkTask);
|
|
|
for (QwWorkTaskListVO item : list) {
|
|
|
if(ObjectUtils.isNotNull(item.getCompanyId())){
|
|
|
Company company = companyCacheService.selectCompanyById(item.getCompanyId());
|
|
@@ -296,14 +289,14 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Long selectQwWorkTaskListVONewCount(QwWorkTaskListParam qwWorkTask) {
|
|
|
- return qwWorkTaskMapper.selectQwWorkTaskListVONewCount(qwWorkTask);
|
|
|
+ public Long selectHyWorkTaskListVONewCount(QwWorkTaskListParam qwWorkTask) {
|
|
|
+ return hyWorkTaskMapper.selectHyWorkTaskListVONewCount(qwWorkTask);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void addQwWorkByCourse4() {
|
|
|
+ public void addHyWorkByCourse4() {
|
|
|
List<QwSop> qwSops = qwSopMapper.selectQwSopByIsRating();
|
|
|
- List<Long> extIds = qwWorkTaskMapper.selectQwWorkTaskByType();
|
|
|
+ List<Long> extIds = hyWorkTaskMapper.selectHyWorkTaskByType();
|
|
|
Set<Long> extIdSet = new HashSet<>(extIds);
|
|
|
LocalDate today = LocalDate.now();
|
|
|
for (QwSop qwSop : qwSops) {
|
|
@@ -315,7 +308,7 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
if (qwSopLogs==null || qwSopLogs.isEmpty()) {
|
|
|
continue;
|
|
|
}
|
|
|
- List<FsCourseWatchLogTaskVO> fsCourseWatchLogs = courseWatchLogMapper.selectFsCourseWatchLogByDaySopId4(qwSop.getId());
|
|
|
+ List<FsCourseWatchLogTaskVO> fsCourseWatchLogs = fsCourseWatchLogMapper.selectFsCourseWatchLogByDaySopId4(qwSop.getId());
|
|
|
if (fsCourseWatchLogs==null || fsCourseWatchLogs.isEmpty()) {
|
|
|
continue;
|
|
|
}
|
|
@@ -336,7 +329,7 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
if (day>7){
|
|
|
continue;
|
|
|
}
|
|
|
- Integer score = getQwWorkCourseScore(fsCourseWatchLog.getLogType(), day,fsCourseWatchLog.getLevel());
|
|
|
+ Integer score = getHyWorkCourseScore(fsCourseWatchLog.getLogType(), day,fsCourseWatchLog.getLevel());
|
|
|
if (score==0){
|
|
|
continue;
|
|
|
}
|
|
@@ -354,17 +347,17 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
qwWorkTasks.add(qwWorkTask);
|
|
|
}
|
|
|
if (!qwWorkTasks.isEmpty()){
|
|
|
- qwWorkTaskMapper.insertQwWorkTaskBatch(qwWorkTasks);
|
|
|
+ hyWorkTaskMapper.insertQwWorkTaskBatch(qwWorkTasks);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void delQwWorkTaskByOver() {
|
|
|
+ public void delHyWorkTaskByOver() {
|
|
|
List<Long> longs = fsCourseWatchLogMapper.selectFsCourseWatchLogByFinish();
|
|
|
|
|
|
- List<QwWorkTask> qwWorkTasks = qwWorkTaskMapper.selectQwWorkTaskByTypeStatus();
|
|
|
+ List<QwWorkTask> qwWorkTasks = hyWorkTaskMapper.selectHyWorkTaskByTypeStatus();
|
|
|
|
|
|
Set<Long> targetIds = new HashSet<>(longs);
|
|
|
|
|
@@ -375,14 +368,14 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
if (overIds.isEmpty()){
|
|
|
return;
|
|
|
}
|
|
|
- qwWorkTaskMapper.updateQwWorkTaskStatus(overIds);
|
|
|
+ hyWorkTaskMapper.updateHyWorkTaskStatus(overIds);
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void addQwWorkByCourseLastTime() {
|
|
|
+ public void addHyWorkByCourseLastTime() {
|
|
|
List<QwSop> qwSops = qwSopMapper.selectQwSopByIsRating();
|
|
|
- List<Long> extIds = qwWorkTaskMapper.selectQwWorkTaskByType();
|
|
|
+ List<Long> extIds = hyWorkTaskMapper.selectHyWorkTaskByType();
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("HHmm"); // 24小时制,如 1100
|
|
|
String timeStr = sdf.format(new Date());
|
|
|
int lastTime = Integer.parseInt(timeStr);
|
|
@@ -398,7 +391,7 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- List<FsCourseWatchLogTaskVO> fsCourseWatchLogs = courseWatchLogMapper.selectFsCourseWatchLogByDaySopId3LastTime(qwSop.getId(),lastTime);
|
|
|
+ List<FsCourseWatchLogTaskVO> fsCourseWatchLogs = fsCourseWatchLogMapper.selectFsCourseWatchLogByDaySopId3LastTime(qwSop.getId(),lastTime);
|
|
|
if (fsCourseWatchLogs==null || fsCourseWatchLogs.isEmpty()) {
|
|
|
continue;
|
|
|
}
|
|
@@ -421,7 +414,7 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
if (day<=7){
|
|
|
continue;
|
|
|
}
|
|
|
- Integer score = getQwWorkCourseScore(fsCourseWatchLog.getLogType(), day,fsCourseWatchLog.getLevel());
|
|
|
+ Integer score = getHyWorkCourseScore(fsCourseWatchLog.getLogType(), day,fsCourseWatchLog.getLevel());
|
|
|
if (score==0){
|
|
|
continue;
|
|
|
}
|
|
@@ -441,7 +434,7 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
}
|
|
|
if (!qwWorkTasks.isEmpty()){
|
|
|
|
|
|
- qwWorkTaskMapper.insertQwWorkTaskBatch(qwWorkTasks);
|
|
|
+ hyWorkTaskMapper.insertQwWorkTaskBatch(qwWorkTasks);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -453,8 +446,8 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
* @return list
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<QwWorkTask> selectQwWorkTaskListByMap(Map<String, Object> params) {
|
|
|
- return qwWorkTaskMapper.selectQwWorkTaskListByMap(params);
|
|
|
+ public List<QwWorkTask> selectHyWorkTaskListByMap(Map<String, Object> params) {
|
|
|
+ return hyWorkTaskMapper.selectHyWorkTaskListByMap(params);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -477,7 +470,7 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
* @version 1.0
|
|
|
* @since yyyy-MM-dd // 建议替换为实际的编写或修改日期
|
|
|
*/
|
|
|
- private void addQwWorkTask(LocalDate today, Integer day, QwSop qwSop, String title,Map<Integer, Integer> map) {
|
|
|
+ private void addHyWorkTask(LocalDate today, Integer day, QwSop qwSop, String title,Map<Integer, Integer> map) {
|
|
|
if (day>7){
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
String minDay = today.minusDays(day).format(formatter);
|
|
@@ -493,13 +486,13 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
System.out.println(qwExternalContact.getId()+"ok");
|
|
|
|
|
|
|
|
|
- insertQwWorkTask(qwSopLog.getId(),qwExternalContact,3,title,map.getOrDefault(qwExternalContact.getLevel(), 0));
|
|
|
+ insertHyWorkTask(qwSopLog.getId(),qwExternalContact,3,title,map.getOrDefault(qwExternalContact.getLevel(), 0));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- private void insertQwWorkTask(String sopId,QwExternalContact qwExternalContact, Integer type, String title, Integer score) {
|
|
|
+ private void insertHyWorkTask(String sopId,QwExternalContact qwExternalContact, Integer type, String title, Integer score) {
|
|
|
QwWorkTask qwWorkTask = new QwWorkTask();
|
|
|
qwWorkTask.setCreateTime(DateUtils.getNowDate());
|
|
|
qwWorkTask.setExtId(qwExternalContact.getId());
|
|
@@ -511,7 +504,7 @@ public class HyWorkTaskServiceImpl extends ServiceImpl<HyWorkTaskMapper, QwWorkT
|
|
|
qwWorkTask.setStatus(0);
|
|
|
qwWorkTask.setTitle(title);
|
|
|
qwWorkTask.setScore(score);
|
|
|
- baseMapper.insertQwWorkTask(qwWorkTask);
|
|
|
+ baseMapper.insertHyWorkTask(qwWorkTask);
|
|
|
}
|
|
|
|
|
|
|