Przeglądaj źródła

财务详情消耗时间单位改为天

wuweihao 4 lat temu
rodzic
commit
a39da7d1fe

+ 7 - 0
gis_mapper/src/main/java/com/gis/mapper/TaskesTimateMapper.java

@@ -76,4 +76,11 @@ public interface TaskesTimateMapper extends ZtBaseMapper<TaskesTimateEntity, Lon
 
     @SelectProvider(type = TaskesTimateProvider.class, method = "dayDetail")
     List<DetailVo> workByDayDetail(PersonalPageDateDto param);
+
+    @Select("select a.task, a.date, a.account, ROUND(a.consumed/8,2) as consumed, b.project,c.name as projectName,c.code,d.realname as realname, d.slack, " +
+            " e.id as deptId, e.name as deptName " +
+            " from zt_taskestimate a left join zt_task b on b.id = a.task left join zt_project c on c.id=b.project " +
+            " left join zt_user d  on d.account = a.account left join zt_dept e on d.dept = e.id " +
+            " where b.deleted = '0' AND DATE_FORMAT( date, '%Y%m' ) = DATE_FORMAT(#{date} , '%Y%m' ) order by a.account asc")
+    List<DetailVo> excelDetailByDay(DeptDto param);
 }

+ 2 - 0
gis_service/src/main/java/com/gis/service/TaskesTimateService.java

@@ -35,4 +35,6 @@ public interface TaskesTimateService extends IBaseService<TaskesTimateEntity, Lo
     Result<DetailVo> workByMonthDetail(WorkPageDto param);
 
     Result<DetailVo> workByDayDetail(PersonalPageDateDto param);
+
+    Result<DetailVo> excelDetailByDay(DeptDto param);
 }

+ 35 - 1
gis_service/src/main/java/com/gis/service/impl/TaskesTimateServiceImpl.java

@@ -65,7 +65,7 @@ public class TaskesTimateServiceImpl extends ZtBaseServiceImpl<TaskesTimateEntit
         rowTitle.put("projectName", "项目名称");
         rowTitle.put("account", "账号");
         rowTitle.put("realname", "姓名");
-        rowTitle.put("consumed", "消耗时间(单位:天)");
+        rowTitle.put("consumed", "消耗时间(天)");
         ExcelUtils.createExcel(effortVos, savePath, rowTitle);
 
         String domain = configConstant.serverDomain + time + ".xlsx";
@@ -171,5 +171,39 @@ public class TaskesTimateServiceImpl extends ZtBaseServiceImpl<TaskesTimateEntit
         return Result.success(new PageInfo<>(effortVos));
     }
 
+    @Override
+    public Result<DetailVo> excelDetailByDay(DeptDto param) {
+        long start = System.currentTimeMillis();
+        List<DetailVo> effortVos = entityMapper.excelDetailByDay(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");
+        rowTitle.put("code", "项目号");
+        rowTitle.put("projectName", "项目名称");
+        rowTitle.put("account", "账号");
+        rowTitle.put("realname", "姓名");
+        rowTitle.put("consumed", "消耗时间(天)");
+        rowTitle.put("deptId", "部门Id");
+        rowTitle.put("deptName", "部门名称");
+        ExcelUtils.createExcel(effortVos, savePath, rowTitle);
+
+        log.info("sql耗时: {}s", (end-start)/1000);
+
+        String domain = configConstant.serverDomain + time + ".xlsx";
+
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("size", effortVos.size());
+        result.put("path", domain);
+
+        return  Result.success(result);
+    }
+
 
 }

+ 2 - 1
gis_web/src/main/java/com/gis/web/controller/FinanceController.java

@@ -41,7 +41,8 @@ public class FinanceController extends BaseController {
     public Result<DetailVo> excelByDetail(@PathVariable String date) {
         DeptDto param = new DeptDto();
         param.setDate(date);
-        return taskesTimateService.excelByDetail(param);
+//        return taskesTimateService.excelByDetail(param);
+        return taskesTimateService.excelDetailByDay(param);
     }
 
     @ApiOperation("月总计(date:当月日期:yyyy-MM-dd)")