|
@@ -5,11 +5,12 @@ import com.gis.common.constant.ConfigConstant;
|
|
|
import com.gis.common.util.ExcelUtils;
|
|
|
import com.gis.common.util.Result;
|
|
|
import com.gis.domain.dto.DeptDto;
|
|
|
-import com.gis.domain.dto.EffortDto;
|
|
|
import com.gis.domain.dto.PageDto;
|
|
|
+import com.gis.domain.dto.WorkPageDto;
|
|
|
import com.gis.domain.entity.TaskesTimateEntity;
|
|
|
-import com.gis.domain.vo.DeptEffortVo;
|
|
|
-import com.gis.domain.vo.EffortVo;
|
|
|
+import com.gis.domain.vo.FinanceMonthVo;
|
|
|
+import com.gis.domain.vo.MonthVo;
|
|
|
+import com.gis.domain.vo.DetailVo;
|
|
|
import com.gis.mapper.TaskesTimateMapper;
|
|
|
import com.gis.mapper.ZtBaseMapper;
|
|
|
import com.gis.service.TaskesTimateService;
|
|
@@ -19,8 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.*;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-import java.util.stream.Stream;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -43,24 +42,24 @@ public class TaskesTimateServiceImpl extends ZtBaseServiceImpl<TaskesTimateEntit
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Result<EffortVo> search(PageDto param) {
|
|
|
+ public Result<DetailVo> search(PageDto param) {
|
|
|
startPage(param);
|
|
|
return Result.success(new PageInfo<>(this.findAll()));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result<EffortVo> allProjectEffortByMonthExcel(String date) {
|
|
|
+ public Result<FinanceMonthVo> allProjectEffortByMonthExcel(String date) {
|
|
|
|
|
|
long start = System.currentTimeMillis();
|
|
|
- List<EffortVo> effortVos = entityMapper.allProjectEffortByMonth(date);
|
|
|
+ List<FinanceMonthVo> effortVos = entityMapper.allProjectEffortByMonth(date);
|
|
|
long end = System.currentTimeMillis();
|
|
|
log.info("sql耗时: {}s", (end-start)/1000);
|
|
|
String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmss");
|
|
|
String savePath = configConstant.serverBasePath + time + ".xlsx";
|
|
|
HashMap<String, String> rowTitle = new HashMap<>();
|
|
|
|
|
|
- rowTitle.put("date", "日期");
|
|
|
- rowTitle.put("project", "项目id");
|
|
|
+ rowTitle.put("slack", "工号");
|
|
|
+// rowTitle.put("project", "项目id");
|
|
|
rowTitle.put("code", "项目号");
|
|
|
rowTitle.put("projectName", "项目名称");
|
|
|
rowTitle.put("account", "账号");
|
|
@@ -78,42 +77,19 @@ public class TaskesTimateServiceImpl extends ZtBaseServiceImpl<TaskesTimateEntit
|
|
|
}
|
|
|
|
|
|
|
|
|
-// @Override
|
|
|
-// public Result<EffortVo> sumEffortByMonthExcel(String projectId, String date) {
|
|
|
-// long start = System.currentTimeMillis();
|
|
|
-// List<EffortVo> effortVos = entityMapper.sumEffortByMonth(projectId, date);
|
|
|
-// long end = System.currentTimeMillis();
|
|
|
-// log.info("sql耗时: {}s", (end-start)/1000);
|
|
|
-// String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmss");
|
|
|
-// String savePath = configConstant.serverBasePath + time + ".xlsx";
|
|
|
-// HashMap<String, String> rowTitle = new HashMap<>();
|
|
|
-//
|
|
|
-// rowTitle.put("date", "日期");
|
|
|
-// rowTitle.put("project", "项目id");
|
|
|
-// rowTitle.put("code", "项目号");
|
|
|
-// rowTitle.put("projectName", "项目名称");
|
|
|
-// rowTitle.put("account", "账号");
|
|
|
-// rowTitle.put("realname", "姓名");
|
|
|
-// rowTitle.put("consumed", "消耗时间(单位:天)");
|
|
|
-// ExcelUtils.createExcel(effortVos, savePath, rowTitle);
|
|
|
-//
|
|
|
-// HashMap<String, Object> result = new HashMap<>();
|
|
|
-// result.put("size", effortVos.size());
|
|
|
-// result.put("path", savePath);
|
|
|
-//
|
|
|
-// return Result.success(result);
|
|
|
-// }
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
- public Result<EffortVo> effortByMonthExcel(DeptDto param) {
|
|
|
+ public Result<DetailVo> excelByDetail(DeptDto param) {
|
|
|
long start = System.currentTimeMillis();
|
|
|
- List<EffortVo> effortVos = entityMapper.effortByMonth(param);
|
|
|
+ List<DetailVo> effortVos = entityMapper.effortByMonth(param);
|
|
|
|
|
|
long end = System.currentTimeMillis();
|
|
|
String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmss");
|
|
|
String savePath = configConstant.serverBasePath + time + ".xlsx";
|
|
|
HashMap<String, String> rowTitle = new HashMap<>();
|
|
|
|
|
|
+ rowTitle.put("slack", "工号");
|
|
|
rowTitle.put("date", "日期");
|
|
|
rowTitle.put("task", "任务号");
|
|
|
rowTitle.put("project", "项目id");
|
|
@@ -138,9 +114,9 @@ public class TaskesTimateServiceImpl extends ZtBaseServiceImpl<TaskesTimateEntit
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result<DeptEffortVo> deptEffortByMonthExcel(DeptDto param) {
|
|
|
+ public Result<MonthVo> excelByMonth(DeptDto param) {
|
|
|
long start = System.currentTimeMillis();
|
|
|
- List<DeptEffortVo> effortVos = entityMapper.deptEffortByMonth(param.getDeptId(), param.getDate());
|
|
|
+ List<MonthVo> effortVos = entityMapper.deptEffortByMonth(param.getDeptId(), param.getDate());
|
|
|
|
|
|
|
|
|
String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmss");
|
|
@@ -167,5 +143,25 @@ public class TaskesTimateServiceImpl extends ZtBaseServiceImpl<TaskesTimateEntit
|
|
|
return Result.success(result);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Result workByMonth(String account, String date) {
|
|
|
+ List<MonthVo> effortVos = entityMapper.workByMonth(account, date);
|
|
|
+ return Result.success(effortVos);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Result workByMonth(WorkPageDto param) {
|
|
|
+ startPage(param);
|
|
|
+ List<MonthVo> effortVos = entityMapper.deptEffortByMonth(param.getDeptId(), param.getDate());
|
|
|
+ return Result.success(new PageInfo<>(effortVos));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Result<DetailVo> workByMonthDetail(WorkPageDto param) {
|
|
|
+ startPage(param);
|
|
|
+ List<DetailVo> effortVos = entityMapper.workByMonthDetail(param);
|
|
|
+ return Result.success(new PageInfo<>(effortVos));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|