Browse Source

数据看板

dzx 2 months ago
parent
commit
72599efa44

+ 23 - 10
src/main/java/com/xjrsoft/module/databoard/controller/DataboardController.java

@@ -16,6 +16,8 @@ import com.xjrsoft.module.databoard.dto.StatisticsDetailDto;
 import com.xjrsoft.module.databoard.dto.StatisticsDto;
 import com.xjrsoft.module.databoard.vo.CourseStatisticsVo;
 import com.xjrsoft.module.databoard.vo.HealthStatisticsVo;
+import com.xjrsoft.module.databoard.vo.ItemCountAmountVo;
+import com.xjrsoft.module.databoard.vo.ItemCountVo;
 import com.xjrsoft.module.databoard.vo.MeetingStatisticsVo;
 import com.xjrsoft.module.databoard.vo.PersonStatisticsVo;
 import com.xjrsoft.module.databoard.vo.ProcessStatisticsVo;
@@ -364,7 +366,7 @@ public class DataboardController {
     }
 
     @GetMapping(value = "/reimbursement-statistics")
-    @ApiOperation(value="会议统计")
+    @ApiOperation(value="差旅费报销申请")
     @SaCheckPermission("databoard:detail")
     public RT<ReimbursementStatisticsVo> reimbursementStatistics(@Valid StatisticsDetailDto dto){
         LocalDateTime startTime = null;
@@ -390,8 +392,6 @@ public class DataboardController {
         int completeCount = 0;
         int uncompleteCount = 0;
 
-        int cityIn = 0;
-        int cityOut = 0;
         for (Map<String, Object> objectMap : list) {
             Object statusObj = objectMap.get("status");
             if(statusObj == null){
@@ -399,18 +399,31 @@ public class DataboardController {
             }else{
                 completeCount ++;
             }
+        }
+        result.setCompleteCount(completeCount);
+        result.setUncompleteCount(uncompleteCount);
 
+        sql = "select city_in,sum(total_amount) as total_amount from billing_reimbursement where status = 1";
+        if(startTime != null && endTime != null){
+            sql += " and aply_time between '" + startTime.format(formatter) + "' and '" + endTime.format(formatter) + "'";
+        }
+        sql += " group by city_in ";
+        list = SqlRunnerAdapter.db().selectList(sql);
+        List<ItemCountAmountVo> amountList = new ArrayList<>();
+        for (Map<String, Object> objectMap : list) {
             Object cityInObj = objectMap.get("city_in");
+            String item = "";
             if(cityInObj != null && Integer.parseInt(cityInObj.toString()) == 1){
-
+                item = "市外";
+            }else if(cityInObj != null && Integer.parseInt(cityInObj.toString()) == 0){
+                item = "室内";
             }
+            ItemCountAmountVo amountVo = new ItemCountAmountVo();
+            amountVo.setItem(item);
+            amountVo.setAmount(Double.parseDouble(objectMap.get("total_amount").toString()));
+            amountList.add(amountVo);
         }
-        result.setCompleteCount(completeCount);
-        result.setUncompleteCount(uncompleteCount);
-
-
-
-
+        result.setAmountList(amountList);
         return RT.ok(result);
     }
 

+ 1 - 1
src/main/java/com/xjrsoft/module/databoard/vo/ReimbursementStatisticsVo.java

@@ -25,6 +25,6 @@ public class ReimbursementStatisticsVo {
     private Integer uncompleteCount;
 
     @ApiModelProperty("申请")
-    private List<ItemCountVo> amountList;
+    private List<ItemCountAmountVo> amountList;
 
 }

+ 0 - 1
src/main/java/com/xjrsoft/module/material/service/impl/MaterialTaskServiceImpl.java

@@ -6,7 +6,6 @@ import cn.hutool.extra.spring.SpringUtil;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.github.yulichang.base.MPJBaseServiceImpl;

+ 3 - 0
src/main/java/com/xjrsoft/module/oa/service/impl/NewsServiceImpl.java

@@ -138,6 +138,9 @@ public class NewsServiceImpl extends MPJBaseServiceImpl<NewsMapper, News> implem
                 .leftJoin(BaseGrade.class, BaseGrade::getId, BaseClass::getGradeId);
         List<BaseGrade> gradeList = baseClassMapper.selectJoinList(BaseGrade.class, queryGrade);
         gradeList.forEach((node) -> {
+            if(node == null){
+                return;
+            }
             treeVoList.add(new NewsGradeClassTreeVo() {{
                 setId(node.getId());
                 setName(node.getName());