按实际完成时间统计绩效
This commit is contained in:
+12
-18
@@ -14,15 +14,15 @@ import org.apache.commons.collections.CollectionUtils
|
||||
class ProjectExport {
|
||||
|
||||
static final String time = "2021年4月1日-2021年4月30日";
|
||||
static final String startTime = "2021-04-01 00:00:00"
|
||||
static final String monthEndTime = "2021-04-30 23:59:59"
|
||||
static final String endTime = "2021-05-15 23:59:59"
|
||||
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()
|
||||
}
|
||||
|
||||
public static void export() {
|
||||
static void export() {
|
||||
List<List<Integer>> mergeData = new ArrayList<>()
|
||||
def sort = ["建行项目", "基础建设", "非农行项目", "农行项目"];
|
||||
def result = []
|
||||
@@ -48,9 +48,9 @@ class ProjectExport {
|
||||
List<Task> tasks = ApiUtil.listTaskByProject(project.getId(), startTime, endTime, limitStart, 50)
|
||||
List<Task> tempTasks = tasks;
|
||||
|
||||
while (tasks != null && tempTasks != null && tasks.size() == 50) {
|
||||
tempTasks = ApiUtil.listTaskByProject(project.getId(), startTime, endTime, limitStart, 50)
|
||||
while (tasks != null && tempTasks != null && tempTasks.size() == 50) {
|
||||
limitStart += 50
|
||||
tempTasks = ApiUtil.listTaskByProject(project.getId(), startTime, endTime, limitStart, 50)
|
||||
if (CollectionUtils.isNotEmpty(tempTasks)) {
|
||||
tasks.addAll(tempTasks)
|
||||
}
|
||||
@@ -59,22 +59,16 @@ class ProjectExport {
|
||||
if (CollectionUtils.isNotEmpty(tasks)) {
|
||||
for (Task task: tasks) {
|
||||
// 获取计划时间在当月的任务
|
||||
if ((org.apache.commons.lang3.StringUtils.isNotBlank(task.getPlanBeginTime()) && monthEndTime > task.getPlanBeginTime())
|
||||
|| (org.apache.commons.lang3.StringUtils.isBlank(task.getPlanBeginTime()) && task.getCreateDate() < monthEndTime)
|
||||
) {
|
||||
TaskDetail taskDetail = ApiUtil.getTaskDetail(task.getId())
|
||||
if (taskDetail == null) {
|
||||
print("当前任务taskDetail为空:" + task)
|
||||
continue;
|
||||
}
|
||||
// 先取绩效,不存在则取工时
|
||||
TaskDetail taskDetail = ApiUtil.getTaskDetail(task.getId())
|
||||
if (taskDetail == null) {
|
||||
print("当前任务taskDetail为空:" + task)
|
||||
continue;
|
||||
}
|
||||
if (taskDetail.getRealityEndDate() != null && taskDetail.getRealityEndDate() > monthStartTime && taskDetail.getRealityEndDate() < endTime)
|
||||
if (taskDetail.getFlowConten() != null) {
|
||||
totalTime += Double.valueOf(taskDetail.getFlowConten())
|
||||
} else {
|
||||
totalTime += Double.valueOf(taskDetail.getWorkTime())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ret[3] = com.fangjia.script.common.DataHandleUtils.getDoubleRound(2, totalTime)
|
||||
result << ret
|
||||
|
||||
+10
-9
@@ -14,9 +14,9 @@ import org.apache.commons.collections.CollectionUtils
|
||||
public class ScoreExport {
|
||||
|
||||
static final String time = "2021年4月1日-2021年4月30日";
|
||||
static final String startTime = "2021-04-01 00:00:00"
|
||||
static final String monthEndTime = "2021-04-30 23:59:59"
|
||||
static final String endTime = "2021-05-15 23:59:59"
|
||||
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()
|
||||
@@ -49,9 +49,9 @@ public class ScoreExport {
|
||||
List<Task> tasks = ApiUtil.listTaskByProject(project.getId(), startTime, endTime, limitStart, 50)
|
||||
List<Task> tempTasks = tasks;
|
||||
|
||||
while (tasks != null && tempTasks != null && tasks.size() == 50) {
|
||||
tempTasks = ApiUtil.listTaskByProject(project.getId(), startTime, endTime, limitStart, 50)
|
||||
while (tasks != null && tempTasks != null && tempTasks.size() == 50) {
|
||||
limitStart += 50
|
||||
tempTasks = ApiUtil.listTaskByProject(project.getId(), startTime, endTime, limitStart, 50)
|
||||
if (CollectionUtils.isNotEmpty(tempTasks)) {
|
||||
tasks.addAll(tempTasks)
|
||||
}
|
||||
@@ -59,10 +59,11 @@ public class ScoreExport {
|
||||
if (CollectionUtils.isNotEmpty(tasks)) {
|
||||
for (Task task: tasks) {
|
||||
// 获取计划时间在当月的任务
|
||||
if ((org.apache.commons.lang3.StringUtils.isNotBlank(task.getPlanBeginTime()) && monthEndTime > task.getPlanBeginTime())
|
||||
|| (org.apache.commons.lang3.StringUtils.isBlank(task.getPlanBeginTime()) && task.getCreateDate() < monthEndTime)
|
||||
) {
|
||||
TaskDetail taskDetail = ApiUtil.getTaskDetail(task.getId())
|
||||
TaskDetail taskDetail = ApiUtil.getTaskDetail(task.getId())
|
||||
if (taskDetail == null) {
|
||||
continue;
|
||||
}
|
||||
if (taskDetail.getRealityEndDate() != null && taskDetail.getRealityEndDate() > monthStartTime && taskDetail.getRealityEndDate() < endTime) {
|
||||
boolean find = false
|
||||
if (taskDetail.getResponse().getName() == '穆良书' && taskDetail.getName() == "模型级联算法方案设计") {
|
||||
println('穆良书')
|
||||
|
||||
+11
-12
@@ -15,9 +15,9 @@ import org.apache.commons.collections.CollectionUtils
|
||||
class TaskExport {
|
||||
|
||||
static final String time = "2021年4月1日-2021年4月30日";
|
||||
static final String startTime = "2021-04-01 00:00:00"
|
||||
static final String monthEndTime = "2021-04-30 23:59:59"
|
||||
static final String endTime = "2021-05-15 23:59:59"
|
||||
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()
|
||||
@@ -39,15 +39,14 @@ class TaskExport {
|
||||
}
|
||||
for (Task task: tasks) {
|
||||
// 获取计划时间在当月的任务
|
||||
if ((org.apache.commons.lang3.StringUtils.isNotBlank(task.getPlanBeginTime()) && monthEndTime > task.getPlanBeginTime())
|
||||
|| (org.apache.commons.lang3.StringUtils.isBlank(task.getPlanBeginTime()) && task.getCreateDate() < monthEndTime)
|
||||
) {
|
||||
TaskDetail taskDetail = ApiUtil.getTaskDetail(task.getId())
|
||||
if (taskDetail == null) {
|
||||
print("当前任务taskDetail为空:" + task)
|
||||
continue;
|
||||
}
|
||||
|
||||
TaskDetail taskDetail = ApiUtil.getTaskDetail(task.getId())
|
||||
if (taskDetail == null) {
|
||||
continue;
|
||||
}
|
||||
if ("穆良书" == task.getResponse().getName() && task.getId() == "e3f81b0381b44696b06fb6242a44902f") {
|
||||
print("穆良书")
|
||||
}
|
||||
if (taskDetail.getRealityEndDate() != null && taskDetail.getRealityEndDate() > monthStartTime && taskDetail.getRealityEndDate() < endTime) {
|
||||
TaskPersonDTO dto = new TaskPersonDTO()
|
||||
dto.name = task.response.name
|
||||
dto.project = ""
|
||||
|
||||
@@ -18,6 +18,7 @@ import javax.crypto.spec.SecretKeySpec;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.http.client.HttpClient;
|
||||
@@ -270,13 +271,13 @@ public class ApiUtil {
|
||||
/**
|
||||
* 获取人员任务列表
|
||||
*/
|
||||
public static List<Task> listTaskByPerson(String startTime, String endTime, int limitStart, int limitNum) {
|
||||
public static List<Task> listTaskByPerson(String userid, String startTime, String endTime, int limitStart, int limitNum) {
|
||||
List<Task> tasks = null;
|
||||
try {
|
||||
JSONObject body = new JSONObject();
|
||||
body.put("limitStart", limitStart);
|
||||
body.put("limitNum", limitNum);
|
||||
//body.put("userid", "");
|
||||
body.put("userid", userid);
|
||||
body.put("type", "");
|
||||
body.put("timezone", "");
|
||||
body.put("createtimeStart", startTime);
|
||||
@@ -303,6 +304,12 @@ public class ApiUtil {
|
||||
return tasks;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取人员任务列表
|
||||
*/
|
||||
public static List<Task> listTaskByPerson(String startTime, String endTime, int limitStart, int limitNum) {
|
||||
return listTaskByPerson(null, startTime, endTime, limitStart, limitNum);
|
||||
}
|
||||
/**
|
||||
* 获取任务详情
|
||||
*
|
||||
@@ -335,10 +342,26 @@ public class ApiUtil {
|
||||
|
||||
public static void main(String[] args) {
|
||||
//List<Project> projects = ApiUtil.listProject();
|
||||
System.out.println(ApiUtil.listTaskByProject("e7caf92da7be4c529c8733cbb196173e", "2021-04-01", "2021-05-15", 0, 50));
|
||||
ApiUtil.listProjectLabel("e7caf92da7be4c529c8733cbb196173e");
|
||||
//System.out.println(ApiUtil.getTaskDetail("d08c7c2c852048aebc8aa59d48cfbd21"));
|
||||
//System.out.println(ApiUtil.listTaskByProject("e7caf92da7be4c529c8733cbb196173e", "2021-04-01", "2021-05-15", 0, 50));
|
||||
//ApiUtil.listProjectLabel("e7caf92da7be4c529c8733cbb196173e");
|
||||
System.out.println(ApiUtil.getTaskDetail("e3f81b0381b44696b06fb6242a44902f"));
|
||||
//System.out.println(ApiUtil.getTaskDetail("d08c7c2c852048aebc8aa59d48cfbd21"));
|
||||
//System.out.println(ApiUtil.listTaskByPerson("2021-04-01 00:00:00", "2021-04-30 23:59:59"));
|
||||
// int limitStart = 0;
|
||||
// List<Task> tasks = ApiUtil.listTaskByPerson("055551305431136413","2021-03-01 00:00:00", "2021-04-30 23:59:59", limitStart, 50);
|
||||
// List<Task> tempTasks = tasks;
|
||||
//
|
||||
// while (tasks != null && tempTasks != null && tempTasks.size() == 50) {
|
||||
// limitStart += 50;
|
||||
// tempTasks = ApiUtil.listTaskByPerson("055551305431136413","2021-03-01 00:00:00", "2021-04-30 23:59:59", limitStart, 50);
|
||||
// if (CollectionUtils.isNotEmpty(tempTasks)) {
|
||||
// tasks.addAll(tempTasks);
|
||||
// }
|
||||
// }
|
||||
// for (Task task : tasks) {
|
||||
// if ("穆良书".equals(task.getResponse().getName())) {
|
||||
// System.out.println(task);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user