"...java/com/git@gitlab.ruzhoukj.com:wangcaixuan/rz-gb.git" did not exist on "db8f601025c9b8570578ec8b5233a38ade3f2a35"
Commit 452c13ee authored by zhuxiang's avatar zhuxiang
Browse files

增加绩效计算定时任务,每日八点执行

parent 1cdf589a
...@@ -67,7 +67,7 @@ public class ReportDataInfoController extends BaseController { ...@@ -67,7 +67,7 @@ public class ReportDataInfoController extends BaseController {
@GetMapping("/test") @GetMapping("/test")
public void test() { public void test() {
reportDataInfoService.test(); reportDataInfoService.countPerformance();
} }
} }
...@@ -18,7 +18,7 @@ import java.util.List; ...@@ -18,7 +18,7 @@ import java.util.List;
public interface ReportDataInfoService extends IService<ReportDataInfoEntity> { public interface ReportDataInfoService extends IService<ReportDataInfoEntity> {
List<ReportDataInfoVO> queryList(ReportDataInfoDTO reportDataInfoDTO); List<ReportDataInfoVO> queryList(ReportDataInfoDTO reportDataInfoDTO);
void test(); void countPerformance();
boolean saveOrUpdateReportData(ReportDataInfoDTO reportDataInfoDTO); boolean saveOrUpdateReportData(ReportDataInfoDTO reportDataInfoDTO);
} }
...@@ -2,6 +2,7 @@ package com.ruzhoukj.sms.service.impl; ...@@ -2,6 +2,7 @@ package com.ruzhoukj.sms.service.impl;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.platform.utils.StringUtils; import com.platform.utils.StringUtils;
import com.ruzhoukj.sms.dao.ReportDataInfoDao; import com.ruzhoukj.sms.dao.ReportDataInfoDao;
...@@ -40,8 +41,11 @@ public class ReportDataInfoServiceImpl extends ServiceImpl<ReportDataInfoDao, Re ...@@ -40,8 +41,11 @@ public class ReportDataInfoServiceImpl extends ServiceImpl<ReportDataInfoDao, Re
} }
@Override @Override
public void test() { public void countPerformance() {
ReportDataInfoEntity reportDataInfoEntity = getById("1894302342735548417"); //查看已填写完成,未计算的绩效
List<ReportDataInfoEntity> reportDataInfoEntityList = baseMapper.selectList(new LambdaQueryWrapper<ReportDataInfoEntity>()
.eq(ReportDataInfoEntity::getStatus, 3));
reportDataInfoEntityList.forEach(reportDataInfoEntity -> {
String content = reportDataInfoEntity.getAllContent(); String content = reportDataInfoEntity.getAllContent();
// 解析JSON字符串为JSONArray // 解析JSON字符串为JSONArray
JSONArray jsonArray = JSONArray.parseArray(content); JSONArray jsonArray = JSONArray.parseArray(content);
...@@ -77,6 +81,7 @@ public class ReportDataInfoServiceImpl extends ServiceImpl<ReportDataInfoDao, Re ...@@ -77,6 +81,7 @@ public class ReportDataInfoServiceImpl extends ServiceImpl<ReportDataInfoDao, Re
} else { } else {
System.out.println("No data available in the JSON array."); System.out.println("No data available in the JSON array.");
} }
});
} }
/** /**
......
package com.ruzhoukj.sms.task;
import com.ruzhoukj.sms.service.ReportDataInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component
@Slf4j
public class PerformanceTask {
@Resource
private ReportDataInfoService reportDataInfoService;
//每天八点查询一次绩效
@Scheduled(cron = "0 0 20 * * ?")
private void performanceTask() {
reportDataInfoService.countPerformance();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment