|
@@ -1,5 +1,6 @@
|
|
|
package com.galaxis.manatee.controller;
|
|
|
|
|
|
+import com.galaxis.manatee.service.LogCheckService;
|
|
|
import com.galaxis.manatee.service.LogUpdateService;
|
|
|
import com.galaxis.manatee.task.WorkHourStatistics;
|
|
|
import lombok.Data;
|
|
@@ -17,24 +18,26 @@ public class TestController {
|
|
|
|
|
|
private final LogUpdateService logUpdateService;
|
|
|
private final WorkHourStatistics workHourStatistics;
|
|
|
+ private final LogCheckService logCheckService;
|
|
|
|
|
|
- public TestController(LogUpdateService logUpdateService, WorkHourStatistics workHourStatistics) {
|
|
|
+ public TestController(LogUpdateService logUpdateService, WorkHourStatistics workHourStatistics, LogCheckService logCheckService) {
|
|
|
this.logUpdateService = logUpdateService;
|
|
|
this.workHourStatistics = workHourStatistics;
|
|
|
+ this.logCheckService = logCheckService;
|
|
|
}
|
|
|
|
|
|
@GetMapping("/test/helloGet")
|
|
|
- public String testGet(){
|
|
|
+ public String testGet() {
|
|
|
return "hello";
|
|
|
}
|
|
|
|
|
|
@PostMapping("/test/helloPost")
|
|
|
- public String testPost(@RequestBody PostObject postObject){
|
|
|
+ public String testPost(@RequestBody PostObject postObject) {
|
|
|
return "hello";
|
|
|
}
|
|
|
|
|
|
@Data
|
|
|
- class PostObject{
|
|
|
+ class PostObject {
|
|
|
private String a;
|
|
|
private String b;
|
|
|
}
|
|
@@ -43,19 +46,19 @@ public class TestController {
|
|
|
* 标准化所有工时
|
|
|
*/
|
|
|
@GetMapping("/test/api/standardAllWorkHour")
|
|
|
- public void standardAllWorkHour(){
|
|
|
+ public void standardAllWorkHour() {
|
|
|
workHourStatistics.updateHour();
|
|
|
}
|
|
|
|
|
|
- public void standardSelfWorkHourByUserId(@RequestParam("userId")String userId){
|
|
|
+ public void standardSelfWorkHourByUserId(@RequestParam("userId") String userId) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public void standardWeekMemberHourByUserId(@RequestParam("userId")String userId){
|
|
|
+ public void standardWeekMemberHourByUserId(@RequestParam("userId") String userId) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- public void standardSelfCostByUserId(@RequestParam("userId")String userId){
|
|
|
+ public void standardSelfCostByUserId(@RequestParam("userId") String userId) {
|
|
|
|
|
|
}
|
|
|
|
|
@@ -63,7 +66,7 @@ public class TestController {
|
|
|
* 更新所有每天工时
|
|
|
*/
|
|
|
@GetMapping("/test/api/updateAllChuanyunSelfWorkHour")
|
|
|
- public void updateAllChuanyunSelfWorkHour(){
|
|
|
+ public void updateAllChuanyunSelfWorkHour() {
|
|
|
logUpdateService.updateAllChuanyunSelfWorkHour();
|
|
|
}
|
|
|
|
|
@@ -71,7 +74,7 @@ public class TestController {
|
|
|
* 更新所有每周工时
|
|
|
*/
|
|
|
@GetMapping("/test/api/updateAllChuanyunWeekMemberHour")
|
|
|
- public void updateAllChuanyunWeekMemberHour(){
|
|
|
+ public void updateAllChuanyunWeekMemberHour() {
|
|
|
logUpdateService.updateAllChuanyunWeekMemberHour();
|
|
|
}
|
|
|
|
|
@@ -79,37 +82,57 @@ public class TestController {
|
|
|
* 更新所有每月工时
|
|
|
*/
|
|
|
@GetMapping("/test/api/updateAllChuanyunSelfCost")
|
|
|
- public void updateAllChuanyunSelfCost(){
|
|
|
+ public void updateAllChuanyunSelfCost() {
|
|
|
logUpdateService.updateAllChuanyunSelfCost();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据用户Id更新每天工时方法
|
|
|
- * @param userId 用户Id
|
|
|
+ *
|
|
|
+ * @param userId 用户Id
|
|
|
*/
|
|
|
@GetMapping("/test/api/updateChuanyunSelfWorkHourListByUserId")
|
|
|
- public void updateChuanyunSelfWorkHourListByUserId(@RequestParam("userId")String userId) {
|
|
|
+ public void updateChuanyunSelfWorkHourListByUserId(@RequestParam("userId") String userId) {
|
|
|
logUpdateService.updateChuanyunSelfWorkHourListByUserId(userId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
- * @param userId 用户Id
|
|
|
+ * @param userId 用户Id
|
|
|
*/
|
|
|
@GetMapping("/test/api/updateChuanyunWeekMemberHourListByUserId")
|
|
|
- public void updateChuanyunWeekMemberHourListByUserId(@RequestParam("userId")String userId) {
|
|
|
+ public void updateChuanyunWeekMemberHourListByUserId(@RequestParam("userId") String userId) {
|
|
|
logUpdateService.updateChuanyunWeekMemberHourListByUserId(userId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
- * @param userId 用户Id
|
|
|
+ * @param userId 用户Id
|
|
|
*/
|
|
|
@GetMapping("/test/api/updateChuanyunSelfCostListByUserId")
|
|
|
- public void updateChuanyunSelfCostListByUserId(@RequestParam("userId")String userId) {
|
|
|
+ public void updateChuanyunSelfCostListByUserId(@RequestParam("userId") String userId) {
|
|
|
logUpdateService.updateChuanyunSelfCostListByUserId(userId);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据用户Id核查工时信息
|
|
|
+ *
|
|
|
+ * @param userId 用户Id
|
|
|
+ */
|
|
|
+ @GetMapping("/test/api/checkWorkHourByUserId")
|
|
|
+ public void checkWorkHourByUserId(@RequestParam("userId") String userId) {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ try {
|
|
|
+ //核对原始数据和标准化每日工时
|
|
|
+ logCheckService.checkDayWorkHour(userId);
|
|
|
+ logCheckService.checkWeekWorkHour(userId);
|
|
|
+ logCheckService.checkMonthWorkHour(userId);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(userId);
|
|
|
+ log.error(e.getMessage());
|
|
|
+ }
|
|
|
+ log.info("修改" + userId + "工时信息耗时" + (System.currentTimeMillis() - start));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|