优化绩效时间导出
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
package com.fangjia.script.temp.shenjian.dingding
|
||||
|
||||
import com.fangjia.script.util.DateUtils
|
||||
|
||||
|
||||
/**
|
||||
* ¶¤¶¤½Ó¿Úµ÷Óù¤¾ßÀà
|
||||
*
|
||||
* @author shenjian
|
||||
* @since 2021/5/8
|
||||
*/
|
||||
class DingTalkUtils {
|
||||
|
||||
static main(String[] args) {
|
||||
Date now = DateUtils.parseFromTightByPattern("2021-04-01", "yyyy-MM-dd") ;
|
||||
|
||||
String startTime = DateUtils.addMonth(now, -1) + " 00:00:00"
|
||||
String monthStartTime = DateUtils.formatDateByPattern(now, "yyyy-MM-dd HH:mm:ss")
|
||||
String endTime = DateUtils.formatDateByPattern(DateUtils.getLastDayOfMonth(now), "yyyy-MM-dd") + " 23:59:59"
|
||||
ScoreExport.export(startTime, monthStartTime, endTime)
|
||||
ProjectExport.export(monthStartTime, monthStartTime, endTime)
|
||||
TaskExport.export(endTime, monthStartTime, endTime)
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -1,3 +1,5 @@
|
||||
package com.fangjia.script.temp.shenjian.dingding
|
||||
|
||||
import com.fangjia.script.statistics.ApiUtil
|
||||
import com.fangjia.script.statistics.Project
|
||||
import com.fangjia.script.statistics.ProjectLabel
|
||||
@@ -18,13 +20,11 @@ class ProjectExport {
|
||||
static final String monthStartTime = "2021-04-01 00:00:00"
|
||||
static final String endTime = "2021-04-30 23:59:59"
|
||||
|
||||
static void main(String[] args) {
|
||||
export()
|
||||
static main(args) {
|
||||
export(startTime, monthStartTime, endTime)
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void export() {
|
||||
static export(def startTime, def monthStartTime, def endTime) {
|
||||
List<List<Integer>> mergeData = new ArrayList<>()
|
||||
def sort = ["建行项目", "基础建设", "非农行项目", "农行项目"];
|
||||
def result = []
|
||||
+5
-3
@@ -1,3 +1,5 @@
|
||||
package com.fangjia.script.temp.shenjian.dingding
|
||||
|
||||
import com.fangjia.script.statistics.ApiUtil
|
||||
import com.fangjia.script.statistics.Project
|
||||
import com.fangjia.script.statistics.ProjectLabel
|
||||
@@ -18,11 +20,11 @@ public class ScoreExport {
|
||||
static final String monthStartTime = "2021-04-01 00:00:00"
|
||||
static final String endTime = "2021-04-30 23:59:59"
|
||||
|
||||
static void main(String[] args) {
|
||||
export()
|
||||
static main(args) {
|
||||
export(startTime, monthStartTime, endTime)
|
||||
}
|
||||
|
||||
static void export() {
|
||||
static void export(def startTime, def monthStartTime, def endTime) {
|
||||
List<List<Integer>> mergeData = new ArrayList<>()
|
||||
def sortedResult = []
|
||||
sortedResult << ['项目类别', '工时', '所属项目', '项目经理']
|
||||
+12
-8
@@ -1,3 +1,5 @@
|
||||
package com.fangjia.script.temp.shenjian.dingding
|
||||
|
||||
import com.fangjia.script.statistics.ApiUtil
|
||||
import com.fangjia.script.statistics.Project
|
||||
import com.fangjia.script.statistics.ProjectLabel
|
||||
@@ -12,30 +14,32 @@ import org.apache.commons.collections.CollectionUtils
|
||||
* @author shenjian
|
||||
* @since 2021/5/10
|
||||
*/
|
||||
class TaskExport {
|
||||
public class TaskExport {
|
||||
|
||||
static final String time = "2021年4月1日-2021年4月30日";
|
||||
static final String startTime = "2021-03-01 00:00:00"
|
||||
static final String monthStartTime = "2021-04-01 00:00:00"
|
||||
static final String endTime = "2021-04-30 23:59:59"
|
||||
|
||||
static void main(String[] args) {
|
||||
export()
|
||||
static main(args) {
|
||||
export(startTime, monthStartTime, endTime)
|
||||
}
|
||||
|
||||
static void export() {
|
||||
static void export(def startTime, def monthStartTime, def endTime) {
|
||||
List<List<Integer>> mergeData = new ArrayList<>()
|
||||
List<TaskPersonDTO> list = new ArrayList<>()
|
||||
def result = []
|
||||
result << ['姓名', '所属项目', '参与任务', '任务绩效值', '投入时间(天)']
|
||||
int limitStart = 0
|
||||
List<Task> tasks = new ArrayList<>()
|
||||
List<Task> tasks = ApiUtil.listTaskByPerson(startTime, endTime, limitStart, 50)
|
||||
List<Task> tempTasks = tasks;
|
||||
|
||||
while (tempTasks.isEmpty() || tempTasks.size() == 50) {
|
||||
tempTasks = ApiUtil.listTaskByPerson(startTime, endTime, limitStart, 50)
|
||||
while (tasks != null && tempTasks != null && tempTasks.size() == 50) {
|
||||
limitStart += 50
|
||||
tasks.addAll(tempTasks)
|
||||
tempTasks = ApiUtil.listTaskByPerson(startTime, endTime, limitStart, 50)
|
||||
if (CollectionUtils.isNotEmpty(tempTasks)) {
|
||||
tasks.addAll(tempTasks)
|
||||
}
|
||||
}
|
||||
for (Task task: tasks) {
|
||||
// 获取计划时间在当月的任务
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
|
||||
/**
|
||||
* 钉钉接口调用工具类
|
||||
*
|
||||
* @author shenjian
|
||||
* @since 2021/5/8
|
||||
*/
|
||||
class DingTalkUtils {
|
||||
|
||||
static void main(String[] args) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user