fix:载体维修修改

pg_adapter
wangxy 8 months ago
parent 200bb7fe96
commit e64d45013d

@ -3,8 +3,12 @@ package com.ruoyi.web.controller.system.count;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.system.domain.TdPropertyInfo;
import com.ruoyi.system.domain.check.TdCheckReport;
import com.ruoyi.system.domain.count.CheckResultCountDTO; import com.ruoyi.system.domain.count.CheckResultCountDTO;
import com.ruoyi.system.domain.count.CheckTypeCountDTO; import com.ruoyi.system.domain.count.CheckTypeCountDTO;
import com.ruoyi.system.service.ISysDictDataService;
import com.ruoyi.system.service.ITdNotifyService; import com.ruoyi.system.service.ITdNotifyService;
import com.ruoyi.system.service.check.TdCheckReportService; import com.ruoyi.system.service.check.TdCheckReportService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -20,6 +24,7 @@ import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -107,6 +112,39 @@ public class TdChecknumController extends BaseController{
return AjaxResult.success(datas); return AjaxResult.success(datas);
} }
@Autowired
private ISysDictDataService dictDataService;
/**
*
*
* @return
*/
@PostMapping("/countType")
@ResponseBody
public AjaxResult countType() {
SysDictData sysDictData = new SysDictData();
sysDictData.setDictType("sys_check_type");
List<SysDictData> smType = dictDataService.selectDictDataList(sysDictData);
List<String> list = smType.stream().map(SysDictData::getDictLabel).collect(Collectors.toList());
List<Long> yAxisData = new ArrayList<>();
smType.forEach(xAxis -> {
AtomicReference<Long> yAxis = new AtomicReference<>(0L);
Integer count = checkReportService.lambdaQuery()
.eq(TdCheckReport::getCheckType, xAxis.getDictValue())
.count();
if(Objects.isNull(count)){
count = 0;
}
yAxis.set(Long.valueOf(count));
yAxisData.add(yAxis.get());
});
JSONObject obj = new JSONObject();
obj.put("xAxisData", list.toArray());
obj.put("yAxisData", yAxisData);
return AjaxResult.success(obj);
}

Loading…
Cancel
Save