统计
20
cxxm/src/main/java/com/ruoyi/cxxm/domain/enums/ZGQK.java
Normal file
@ -0,0 +1,20 @@
|
||||
package com.ruoyi.cxxm.domain.enums;
|
||||
|
||||
public enum ZGQK {
|
||||
// 未整改
|
||||
WZG("1"),
|
||||
// 未整改到位
|
||||
WZGDW("2"),
|
||||
// 已整改
|
||||
YZG("3");
|
||||
|
||||
private final String value;
|
||||
|
||||
ZGQK(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.ruoyi.cxxm.domain.query;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class StatisticsQuery {
|
||||
// 部门id
|
||||
private Long deptId;
|
||||
// 导入时间区间
|
||||
private List<String> drsjQuery;
|
||||
// 导入时间
|
||||
private String lineDateQuery;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.ruoyi.cxxm.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HistogramDataItem {
|
||||
private String deptName;
|
||||
// 已下发数量
|
||||
private Integer yxf;
|
||||
// 未下发数量
|
||||
private Integer wxf;
|
||||
// 已巡查数量
|
||||
private Integer yxc;
|
||||
// 未巡查数量
|
||||
private Integer wxc;
|
||||
// 州级巡查
|
||||
private Integer zjxc;
|
||||
// 县级巡查
|
||||
private Integer xjxc;
|
||||
// 已整改数量
|
||||
private Integer yzg;
|
||||
// 未整改到位数量
|
||||
private Integer wzgdw;
|
||||
// 未整改数量
|
||||
private Integer wzg;
|
||||
// 审核通过
|
||||
private Integer shtg;
|
||||
// 审核不通过
|
||||
private Integer shbtg;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.ruoyi.cxxm.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LineDateItem {
|
||||
private String date;
|
||||
|
||||
private String deptName;
|
||||
|
||||
private Integer num;
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.ruoyi.cxxm.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class StatisticsVo {
|
||||
// 图斑数量
|
||||
private Integer total;
|
||||
// 矿产数量
|
||||
private Integer kc;
|
||||
// 土地数量
|
||||
private Integer td;
|
||||
// 已下发数量
|
||||
private Integer yxf;
|
||||
// 未下发数量
|
||||
private Integer wxf;
|
||||
// 已巡查数量
|
||||
private Integer yxc;
|
||||
// 未巡查数量
|
||||
private Integer wxc;
|
||||
// 州级巡查
|
||||
private Integer zjxc;
|
||||
// 县级巡查
|
||||
private Integer xjxc;
|
||||
// 已整改数量
|
||||
private Integer yzg;
|
||||
// 未整改到位数量
|
||||
private Integer wzgdw;
|
||||
// 未整改数量
|
||||
private Integer wzg;
|
||||
// 审核通过
|
||||
private Integer shtg;
|
||||
// 审核不通过
|
||||
private Integer shbtg;
|
||||
// 直方图数据
|
||||
private List<HistogramDataItem> histogramData;
|
||||
// 折线图数据
|
||||
private List<Object> lineData;
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.ruoyi.cxxm.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
import org.apache.bcel.generic.NEW;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TaskCheckStatistics {
|
||||
// 需巡查次数
|
||||
private int xxccs;
|
||||
// 已巡查次数
|
||||
private int yxccs;
|
||||
// 州级巡查次数
|
||||
private int zjxccs;
|
||||
// 县级巡查次数
|
||||
private int xjxccs;
|
||||
// 未整改次数
|
||||
private int wzgcs;
|
||||
// 未整改到位次数
|
||||
private int wzgdwcs;
|
||||
// 已整改次数
|
||||
private int yzgcs;
|
||||
// 审核通过次数
|
||||
private int shtgcs;
|
||||
// 审核不通过次数
|
||||
private int shbtgcs;
|
||||
// 州级平均巡查频率
|
||||
private int zjxcpl;
|
||||
@JsonIgnore
|
||||
private List<Date> zjxcsjList = new ArrayList<>();
|
||||
// 州级平均巡查频率
|
||||
private int xjxcpl;
|
||||
@JsonIgnore
|
||||
private List<Date> xjxcsjList = new ArrayList<>();
|
||||
}
|
@ -15,6 +15,8 @@ public class TaskCheckSubmitVo extends TaskCheckSubmit {
|
||||
private List<TaskCheckLog> taskCheckLogs;
|
||||
// 图斑信息
|
||||
private Tbxx tbxx;
|
||||
// 图斑巡查数据统计
|
||||
private TaskCheckStatistics taskCheckStatistics;
|
||||
}
|
||||
|
||||
|
||||
|
@ -9,6 +9,5 @@ public class TaskDetailVo extends Task {
|
||||
|
||||
// 图斑信息
|
||||
private Tbxx tbxx;
|
||||
// // 巡查提交信息
|
||||
// private TaskCheckSubmit taskCheckSubmit;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
package com.ruoyi.cxxm.mapper;
|
||||
|
||||
import com.ruoyi.cxxm.domain.query.StatisticsQuery;
|
||||
import com.ruoyi.cxxm.domain.vo.HistogramDataItem;
|
||||
import com.ruoyi.cxxm.domain.vo.LineDateItem;
|
||||
import com.ruoyi.cxxm.domain.vo.StatisticsVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StatisticsMapper {
|
||||
StatisticsVo taskXccsStatistics(StatisticsQuery statisticsQuery);
|
||||
|
||||
StatisticsVo taskZgAndShStatistics(StatisticsQuery statisticsQuery);
|
||||
|
||||
List<HistogramDataItem> histogramXccsStatistics(StatisticsQuery statisticsQuery);
|
||||
|
||||
List<HistogramDataItem> histogramZgAndShStatistics(StatisticsQuery statisticsQuery);
|
||||
|
||||
List<LineDateItem> lineStatistics(StatisticsQuery statisticsQuery);
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.ruoyi.cxxm.service;
|
||||
|
||||
import com.ruoyi.cxxm.domain.query.StatisticsQuery;
|
||||
import com.ruoyi.cxxm.domain.vo.HistogramDataItem;
|
||||
import com.ruoyi.cxxm.domain.vo.LineDateItem;
|
||||
import com.ruoyi.cxxm.domain.vo.StatisticsVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IStatisticsService {
|
||||
StatisticsVo taskStatistics(StatisticsQuery statisticsQuery);
|
||||
|
||||
List<HistogramDataItem> histogramStatistics(StatisticsQuery statisticsQuery);
|
||||
|
||||
List<Object> lineStatistics(StatisticsQuery statisticsQuery);
|
||||
|
||||
}
|
@ -2,9 +2,11 @@ package com.ruoyi.cxxm.service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.cxxm.domain.TaskCheck;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.cxxm.domain.dto.TaskCheckSubmit;
|
||||
import com.ruoyi.cxxm.domain.vo.TaskCheckSubmitVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
@ -13,10 +15,10 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
* @author ruoyi
|
||||
* @date 2024-03-28
|
||||
*/
|
||||
public interface ITaskCheckService extends IService<TaskCheck>
|
||||
{
|
||||
public interface ITaskCheckService extends IService<TaskCheck> {
|
||||
/**
|
||||
* 保存任务提交记录和文件
|
||||
*
|
||||
* @param taskCheckSubmit
|
||||
* @param files
|
||||
* @return
|
||||
@ -24,8 +26,17 @@ public interface ITaskCheckService extends IService<TaskCheck>
|
||||
*/
|
||||
public boolean saveTaskCheckSubmitAndFiles(TaskCheckSubmit taskCheckSubmit, List<MultipartFile> files) throws IOException;
|
||||
|
||||
/**
|
||||
* 根据taskId获取填报详情
|
||||
*
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
public TaskCheckSubmitVo getTaskCheckSubmitVo(long taskId);
|
||||
|
||||
/**
|
||||
* 上报填报记录
|
||||
*
|
||||
* @param tcId
|
||||
* @return
|
||||
*/
|
||||
@ -33,6 +44,7 @@ public interface ITaskCheckService extends IService<TaskCheck>
|
||||
|
||||
/**
|
||||
* 取消上报填报记录
|
||||
*
|
||||
* @param tcId
|
||||
* @return
|
||||
*/
|
||||
|
@ -0,0 +1,94 @@
|
||||
package com.ruoyi.cxxm.service.impl;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||
import com.ruoyi.cxxm.domain.query.StatisticsQuery;
|
||||
import com.ruoyi.cxxm.domain.vo.HistogramDataItem;
|
||||
import com.ruoyi.cxxm.domain.vo.LineDateItem;
|
||||
import com.ruoyi.cxxm.domain.vo.StatisticsVo;
|
||||
import com.ruoyi.cxxm.mapper.StatisticsMapper;
|
||||
import com.ruoyi.cxxm.service.IStatisticsService;
|
||||
import com.ruoyi.system.mapper.SysDeptMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
|
||||
import static com.ruoyi.common.utils.bean.BeanUtils.getNullPropertyNames;
|
||||
|
||||
@Service
|
||||
public class IStatisticsServiceImpl implements IStatisticsService {
|
||||
@Autowired
|
||||
private StatisticsMapper statisticsMapper;
|
||||
@Autowired
|
||||
private SysDeptMapper deptMapper;
|
||||
|
||||
@Override
|
||||
public StatisticsVo taskStatistics(StatisticsQuery statisticsQuery) {
|
||||
StatisticsVo statisticsVo = statisticsMapper.taskXccsStatistics(statisticsQuery);
|
||||
StatisticsVo zgAndShVo = statisticsMapper.taskZgAndShStatistics(statisticsQuery);
|
||||
String[] nullPropertyNames = getNullPropertyNames(zgAndShVo);
|
||||
BeanUtils.copyProperties(zgAndShVo, statisticsVo, nullPropertyNames);
|
||||
return statisticsVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HistogramDataItem> histogramStatistics(StatisticsQuery statisticsQuery) {
|
||||
List<HistogramDataItem> histogramData = statisticsMapper.histogramXccsStatistics(statisticsQuery);
|
||||
List<HistogramDataItem> zgAndSItems = statisticsMapper.histogramZgAndShStatistics(statisticsQuery);
|
||||
|
||||
for (HistogramDataItem item : histogramData) {
|
||||
for (HistogramDataItem zgAndSItem : zgAndSItems) {
|
||||
if (Objects.equals(zgAndSItem.getDeptName(), item.getDeptName())) {
|
||||
String[] nullPropertyNames = getNullPropertyNames(zgAndSItem);
|
||||
BeanUtils.copyProperties(zgAndSItem, item, nullPropertyNames);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return histogramData;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Object> lineStatistics(StatisticsQuery statisticsQuery) {
|
||||
List<LocalDate> datesInMonths = null;
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
||||
if (statisticsQuery.getLineDateQuery() == null) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int year = calendar.get(Calendar.YEAR);
|
||||
int month = calendar.get(Calendar.MONTH) + 1;
|
||||
datesInMonths = DateUtils.generateDatesInMonth(year, month);
|
||||
statisticsQuery.setLineDateQuery(sdf.format(calendar.getTime()));
|
||||
} else {
|
||||
String lineDateQuery = statisticsQuery.getLineDateQuery();
|
||||
String[] yearAndMonth = lineDateQuery.split("-");
|
||||
datesInMonths = DateUtils.generateDatesInMonth(Integer.parseInt(yearAndMonth[0]), Integer.parseInt(yearAndMonth[1]));
|
||||
}
|
||||
List<LineDateItem> lineDateItems = statisticsMapper.lineStatistics(statisticsQuery);
|
||||
ArrayList<Object> lineData = new ArrayList<>();
|
||||
String[] deptNames = {};
|
||||
if (deptMapper.selectNormalChildrenDeptById(statisticsQuery.getDeptId()) > 0) {
|
||||
deptNames = new String[]{"楚雄市", "禄丰市", "大姚县", "姚安县", "武定县", "双柏县", "牟定县", "南华县", "永仁县", "元谋县"};
|
||||
}else{
|
||||
deptNames = new String[]{deptMapper.selectDeptById(statisticsQuery.getDeptId()).getDeptName()};
|
||||
}
|
||||
for (LocalDate datesInMonth : datesInMonths) {
|
||||
Map<String, Object> lineDataItemMap = new HashMap<>();
|
||||
lineDataItemMap.put("日期", datesInMonth.toString());
|
||||
for (String deptName : deptNames) {
|
||||
lineDataItemMap.put(deptName, 0);
|
||||
for (LineDateItem item : lineDateItems) {
|
||||
if (datesInMonth.toString().equals(item.getDate()) && deptName.equals(item.getDeptName())) {
|
||||
lineDataItemMap.put(deptName, item.getNum());
|
||||
}
|
||||
}
|
||||
}
|
||||
lineData.add(lineDataItemMap);
|
||||
}
|
||||
return lineData;
|
||||
}
|
||||
}
|
@ -3,35 +3,33 @@ package com.ruoyi.cxxm.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.cxxm.domain.Task;
|
||||
import com.ruoyi.cxxm.domain.TaskCheckImage;
|
||||
import com.ruoyi.cxxm.domain.TaskCheckVideo;
|
||||
import com.ruoyi.cxxm.domain.*;
|
||||
import com.ruoyi.cxxm.domain.dto.TaskCheckSubmit;
|
||||
import com.ruoyi.cxxm.domain.enums.RoleName;
|
||||
import com.ruoyi.cxxm.domain.enums.SFSB;
|
||||
import com.ruoyi.cxxm.domain.enums.XCJB;
|
||||
import com.ruoyi.cxxm.domain.enums.*;
|
||||
import com.ruoyi.cxxm.domain.vo.TaskCheckLog;
|
||||
import com.ruoyi.cxxm.domain.vo.TaskCheckStatistics;
|
||||
import com.ruoyi.cxxm.domain.vo.TaskCheckSubmitVo;
|
||||
import com.ruoyi.cxxm.mapper.TaskCheckMapper;
|
||||
import com.ruoyi.cxxm.domain.TaskCheck;
|
||||
import com.ruoyi.cxxm.mapper.TaskMapper;
|
||||
import com.ruoyi.cxxm.service.ITaskCheckImageService;
|
||||
import com.ruoyi.cxxm.service.ITaskCheckService;
|
||||
import com.ruoyi.cxxm.service.ITaskCheckVideoService;
|
||||
import com.ruoyi.cxxm.service.ITaskService;
|
||||
import com.ruoyi.cxxm.service.*;
|
||||
import lombok.Data;
|
||||
import org.apache.bcel.generic.NEW;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
@ -53,6 +51,10 @@ public class TaskCheckServiceImpl extends ServiceImpl<TaskCheckMapper, TaskCheck
|
||||
private ITaskCheckVideoService taskCheckVideoService;
|
||||
@Autowired
|
||||
private TaskMapper taskMapper;
|
||||
@Autowired
|
||||
private ITbxxService tbxxService;
|
||||
@Autowired
|
||||
private ITaskCheckAuditService taskCheckAuditService;
|
||||
|
||||
/**
|
||||
* 保存任务提交记录和文件
|
||||
@ -132,6 +134,142 @@ public class TaskCheckServiceImpl extends ServiceImpl<TaskCheckMapper, TaskCheck
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据taskId获取填报详情信息
|
||||
*
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public TaskCheckSubmitVo getTaskCheckSubmitVo(long taskId) {
|
||||
TaskCheckStatistics taskCheckStatistics = new TaskCheckStatistics();
|
||||
TaskCheckSubmitVo taskCheckSubmitVo = new TaskCheckSubmitVo();
|
||||
// 最后一条填报内容
|
||||
LambdaQueryWrapper<TaskCheck> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TaskCheck::getTaskId, taskId);
|
||||
queryWrapper.eq(TaskCheck::getSfsb, SFSB.YSB.getValue());
|
||||
queryWrapper.orderByDesc(TaskCheck::getId);
|
||||
queryWrapper.last("limit 1");
|
||||
TaskCheck taskCheck = taskCheckService.getOne(queryWrapper);
|
||||
if (taskCheck == null) {
|
||||
return null;
|
||||
}
|
||||
BeanUtils.copyProperties(taskCheck, taskCheckSubmitVo);
|
||||
// 图片
|
||||
LambdaQueryWrapper<TaskCheckImage> tcImagesQueryWrapper = new LambdaQueryWrapper<>();
|
||||
tcImagesQueryWrapper.eq(TaskCheckImage::getTcId, taskCheck.getId());
|
||||
List<TaskCheckImage> taskCheckImages = taskCheckImageService.list(tcImagesQueryWrapper);
|
||||
taskCheckSubmitVo.setTaskCheckImages(taskCheckImages);
|
||||
// 视频
|
||||
LambdaQueryWrapper<TaskCheckVideo> tcVideosQueryWrapper = new LambdaQueryWrapper<>();
|
||||
tcVideosQueryWrapper.eq(TaskCheckVideo::getTcId, taskCheck.getId());
|
||||
List<TaskCheckVideo> taskCheckVideos = taskCheckVideoService.list(tcVideosQueryWrapper);
|
||||
taskCheckSubmitVo.setTaskCheckVideos(taskCheckVideos);
|
||||
// 图斑信息
|
||||
Task task = taskService.getById(taskCheck.getTaskId());
|
||||
Tbxx tbxx = tbxxService.selectTbxxByTbbh(task.getTbbh());
|
||||
taskCheckSubmitVo.setTbxx(tbxx);
|
||||
|
||||
// 填报记录列表
|
||||
LambdaQueryWrapper<TaskCheck> tcLogQueryWrapper = new LambdaQueryWrapper<>();
|
||||
tcLogQueryWrapper.eq(TaskCheck::getTaskId, taskId);
|
||||
tcLogQueryWrapper.orderByDesc(TaskCheck::getId);
|
||||
List<TaskCheck> tcList = taskCheckService.list(tcLogQueryWrapper);
|
||||
List<TaskCheckLog> tcLogList = new ArrayList<>();
|
||||
for (TaskCheck item : tcList) {
|
||||
// 跳过未上报,且非本人巡查的记录
|
||||
if (Objects.equals(item.getSfsb(), SFSB.WSB.getValue()) && !Objects.equals(item.getXcryId(), SecurityUtils.getUserId())) {
|
||||
continue;
|
||||
}
|
||||
TaskCheckLog taskCheckLog = new TaskCheckLog();
|
||||
BeanUtils.copyProperties(item, taskCheckLog);
|
||||
taskCheckLog.setTcId(item.getId());
|
||||
// 填报记录图片
|
||||
LambdaQueryWrapper<TaskCheckImage> tcLogImagesQueryWrapper = new LambdaQueryWrapper<>();
|
||||
tcLogImagesQueryWrapper.eq(TaskCheckImage::getTcId, item.getId());
|
||||
List<TaskCheckImage> tcLogImages = taskCheckImageService.list(tcLogImagesQueryWrapper);
|
||||
taskCheckLog.setTaskCheckImages(tcLogImages);
|
||||
// 填报记录视频
|
||||
LambdaQueryWrapper<TaskCheckVideo> tcLogVideosQueryWrapper = new LambdaQueryWrapper<>();
|
||||
tcLogVideosQueryWrapper.eq(TaskCheckVideo::getTcId, item.getId());
|
||||
List<TaskCheckVideo> tcLogVideos = taskCheckVideoService.list(tcLogVideosQueryWrapper);
|
||||
taskCheckLog.setTaskCheckVideos(tcLogVideos);
|
||||
// 填报记录审核
|
||||
LambdaQueryWrapper<TaskCheckAudit> tcAuditQueryWrapper = new LambdaQueryWrapper<>();
|
||||
tcAuditQueryWrapper.eq(TaskCheckAudit::getTcId, item.getId());
|
||||
TaskCheckAudit taskCheckAudit = taskCheckAuditService.getOne(tcAuditQueryWrapper);
|
||||
taskCheckLog.setTaskCheckAudit(taskCheckAudit);
|
||||
// 统计填报数据
|
||||
taskCheckStatistics = getTaskCheckStatistics(task, item, taskCheckAudit, taskCheckStatistics);
|
||||
tcLogList.add(taskCheckLog);
|
||||
}
|
||||
// 巡查间隔统计
|
||||
setTaskCheckStatisticsForXcpl(taskCheckStatistics);
|
||||
taskCheckSubmitVo.setTaskCheckStatistics(taskCheckStatistics);
|
||||
taskCheckSubmitVo.setTaskCheckLogs(tcLogList);
|
||||
return taskCheckSubmitVo;
|
||||
}
|
||||
|
||||
private void setTaskCheckStatisticsForXcpl(TaskCheckStatistics taskCheckStatistics) {
|
||||
List<Date> xjxcsjList = taskCheckStatistics.getXjxcsjList();
|
||||
List<Date> zjxcsjList = taskCheckStatistics.getZjxcsjList();
|
||||
// 县级
|
||||
if (xjxcsjList.size() >= 2) {
|
||||
Collections.sort(xjxcsjList);
|
||||
taskCheckStatistics.setXjxcpl(averageIntervalInDays(xjxcsjList));
|
||||
}
|
||||
// 州级
|
||||
if (zjxcsjList.size() >= 2) {
|
||||
Collections.sort(zjxcsjList);
|
||||
taskCheckStatistics.setZjxcpl(averageIntervalInDays(zjxcsjList));
|
||||
}
|
||||
}
|
||||
|
||||
private int averageIntervalInDays(List<Date> dateList) {
|
||||
long totalIntervalInMillis = 0;
|
||||
for (int i = 1; i < dateList.size(); i++) {
|
||||
Date current = dateList.get(i);
|
||||
Date previous = dateList.get(i - 1);
|
||||
long intervalInMillis = current.getTime() - previous.getTime();
|
||||
totalIntervalInMillis += Math.abs(intervalInMillis);
|
||||
}
|
||||
// 将总毫秒数转换为天数
|
||||
double totalIntervalInDays = (double) totalIntervalInMillis / (1000 * 60 * 60 * 24);
|
||||
// 计算平均间隔天数
|
||||
double averageIntervalInDays = totalIntervalInDays / (dateList.size() - 1);
|
||||
return (int) averageIntervalInDays;
|
||||
}
|
||||
|
||||
public TaskCheckStatistics getTaskCheckStatistics(Task task, TaskCheck taskCheck, TaskCheckAudit taskCheckAudit, TaskCheckStatistics taskCheckStatistics) {
|
||||
// 巡查次数统计
|
||||
BeanUtils.copyProperties(task, taskCheckStatistics);
|
||||
// 填报数据整改情况统计
|
||||
if (Objects.equals(taskCheck.getZgqk(), ZGQK.WZG.getValue())) {
|
||||
taskCheckStatistics.setWzgcs(taskCheckStatistics.getWzgcs() + 1);
|
||||
} else if (Objects.equals(taskCheck.getZgqk(), ZGQK.WZGDW.getValue())) {
|
||||
taskCheckStatistics.setWzgdwcs(taskCheckStatistics.getWzgdwcs() + 1);
|
||||
} else if (Objects.equals(taskCheck.getZgqk(), ZGQK.YZG.getValue())) {
|
||||
taskCheckStatistics.setYzgcs(taskCheckStatistics.getYzgcs() + 1);
|
||||
}
|
||||
//填报数据审核情况统计
|
||||
if (Objects.nonNull(taskCheckAudit)) {
|
||||
if (Objects.equals(taskCheckAudit.getShjg(), SHJG.TRUE.getValue())) {
|
||||
taskCheckStatistics.setShtgcs(taskCheckStatistics.getShtgcs() + 1);
|
||||
} else if (Objects.equals(taskCheckAudit.getShjg(), SHJG.FALSE.getValue())) {
|
||||
taskCheckStatistics.setShbtgcs(taskCheckStatistics.getShbtgcs() + 1);
|
||||
}
|
||||
}
|
||||
// 巡查日期间隔记录
|
||||
if (Objects.equals(taskCheck.getXcjb(), XCJB.XJ.getValue())) {
|
||||
List<Date> xjxcsjList = taskCheckStatistics.getXjxcsjList();
|
||||
xjxcsjList.add(taskCheck.getXcsj());
|
||||
} else if (Objects.equals(taskCheck.getXcjb(), XCJB.ZJ.getValue())) {
|
||||
List<Date> zjxcsjList = taskCheckStatistics.getZjxcsjList();
|
||||
zjxcsjList.add(taskCheck.getXcsj());
|
||||
}
|
||||
return taskCheckStatistics;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 上报填报记录
|
||||
@ -159,24 +297,17 @@ public class TaskCheckServiceImpl extends ServiceImpl<TaskCheckMapper, TaskCheck
|
||||
queryWrapper.orderByDesc(TaskCheck::getXcsj);
|
||||
queryWrapper.last("limit 1");
|
||||
TaskCheck lastTaskCheck = taskCheckService.getOne(queryWrapper);
|
||||
if (Objects.nonNull(lastTaskCheck) && taskCheck.getXcsj().compareTo(lastTaskCheck.getXcsj()) >= 0) {
|
||||
if (Objects.nonNull(lastTaskCheck)) {
|
||||
task.setTcId(tcId);
|
||||
task.setXcsj(lastTaskCheck.getXcsj());
|
||||
task.setXcryId(SecurityUtils.getUserId());
|
||||
// 修改任务表巡查次数
|
||||
task.setYxccs(task.getYxccs() + 1); // 已巡查次数+1
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
List<SysRole> roles = user.getRoles();
|
||||
for (SysRole role : roles) {
|
||||
if (((Objects.equals(role.getRoleName(), RoleName.XJGLY.getValue()))
|
||||
|| Objects.equals(role.getRoleName(), RoleName.XJDCY.getValue()))
|
||||
) {
|
||||
task.setZjxccs(task.getZjxccs() + 1); // 州级巡查次数+1
|
||||
}
|
||||
if ((Objects.equals(role.getRoleName(), RoleName.ZJGLY.getValue()))
|
||||
|| Objects.equals(role.getRoleName(), RoleName.ZJDCY.getValue())) {
|
||||
task.setZjxccs(task.getZjxccs() + 1); // 县级巡查次数+1
|
||||
}
|
||||
if (Objects.equals(taskCheck.getXcjb(), XCJB.ZJ.getValue())) {
|
||||
task.setZjxccs(task.getZjxccs() + 1); // 州级巡查次数+1
|
||||
}
|
||||
if (Objects.equals(taskCheck.getXcjb(), XCJB.XJ.getValue())) {
|
||||
task.setZjxccs(task.getZjxccs() + 1); // 县级巡查次数+1
|
||||
}
|
||||
taskService.saveOrUpdate(task);
|
||||
}
|
||||
@ -211,18 +342,11 @@ public class TaskCheckServiceImpl extends ServiceImpl<TaskCheckMapper, TaskCheck
|
||||
TaskCheck lastTaskCheck = taskCheckService.getOne(queryWrapper);
|
||||
// 修改任务表巡查次数
|
||||
task.setYxccs(task.getYxccs() - 1); // 已巡查次数-1
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
List<SysRole> roles = user.getRoles();
|
||||
for (SysRole role : roles) {
|
||||
if (((Objects.equals(role.getRoleName(), RoleName.XJGLY.getValue()))
|
||||
|| Objects.equals(role.getRoleName(), RoleName.XJDCY.getValue()))
|
||||
) {
|
||||
task.setZjxccs(task.getZjxccs() - 1); // 州级巡查次数-1
|
||||
}
|
||||
if ((Objects.equals(role.getRoleName(), RoleName.ZJGLY.getValue()))
|
||||
|| Objects.equals(role.getRoleName(), RoleName.ZJDCY.getValue())) {
|
||||
task.setZjxccs(task.getZjxccs() - 1); // 县级巡查次数-1
|
||||
}
|
||||
if (Objects.equals(taskCheck.getXcjb(), XCJB.ZJ.getValue())) {
|
||||
task.setZjxccs(task.getZjxccs() - 1); // 州级巡查次数-1
|
||||
}
|
||||
if (Objects.equals(taskCheck.getXcjb(), XCJB.XJ.getValue())) {
|
||||
task.setZjxccs(task.getZjxccs() - 1); // 县级巡查次数-1
|
||||
}
|
||||
if (Objects.nonNull(lastTaskCheck)) {
|
||||
task.setTcId(lastTaskCheck.getId());
|
||||
|
99
cxxm/src/main/resources/mapper/cxxm/StatisticsMapper.xml
Normal file
@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.cxxm.mapper.StatisticsMapper">
|
||||
|
||||
<select id="taskXccsStatistics" resultType="com.ruoyi.cxxm.domain.vo.StatisticsVo">
|
||||
select count(id) as total,
|
||||
ifnull(sum(if(rwlx = '1', 1, 0)), 0) as kc,
|
||||
ifnull(sum(if(rwlx = '2', 1, 0)), 0) as td,
|
||||
ifnull(sum(if(xfqk = '0', 1, 0)), 0) as wxf,
|
||||
ifnull(sum(if(xfqk = '1', 1, 0)), 0) as yxf,
|
||||
ifnull(sum(if(tc_id is null and xfqk = '1', 1, 0)), 0) as wxc,
|
||||
ifnull(sum(yxccs), 0) as yxc,
|
||||
ifnull(sum(zjxccs), 0) as zjxc,
|
||||
ifnull(sum(xjxccs), 0) as xjxc
|
||||
from task
|
||||
<where>
|
||||
<if test="deptId != null and deptId != ''">
|
||||
and dept_id IN (SELECT dept_id FROM sys_dept WHERE dept_id = #{deptId} or find_in_set(#{deptId},
|
||||
ancestors))
|
||||
</if>
|
||||
<if test="drsjQuery != null and drsjQuery.size()==2">
|
||||
and DATE_FORMAT(drsj, '%Y-%m') between #{drsjQuery[0]} and #{drsjQuery[1]}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="taskZgAndShStatistics" resultType="com.ruoyi.cxxm.domain.vo.StatisticsVo">
|
||||
select ifnull(sum(if(tc.zgqk = '1', 1, 0)), 0) as wzg,
|
||||
ifnull(sum(if(tc.zgqk = '2', 1, 0)), 0) as wzgdw,
|
||||
ifnull(sum(if(tc.zgqk = '3', 1, 0)), 0) as yzg,
|
||||
ifnull(sum(if(tca.shjg = '1', 1, 0)), 0) as shtg,
|
||||
ifnull(sum(if(tca.shjg = '2', 1, 0)), 0) as shbtg
|
||||
from task_check as tc
|
||||
left join task_check_audit as tca on tc.id = tca.tc_id
|
||||
where tc.sfsb = '1'
|
||||
<if test="deptId != null and deptId != ''">
|
||||
and tc.task_id in (select id from task where dept_id IN (SELECT dept_id FROM sys_dept WHERE dept_id = #{deptId} or find_in_set(#{deptId},ancestors)))
|
||||
</if>
|
||||
<if test="drsjQuery != null and drsjQuery.size()==2">
|
||||
and tc.task_id in (select id from task where DATE_FORMAT(drsj, '%Y-%m') between #{drsjQuery[0]} and #{drsjQuery[1]})
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="histogramXccsStatistics" resultType="com.ruoyi.cxxm.domain.vo.HistogramDataItem">
|
||||
select d.dept_name,
|
||||
count(t.id) as total,
|
||||
ifnull(sum(if(t.xfqk = '0', 1, 0)), 0) as wxf,
|
||||
ifnull(sum(if(t.xfqk = '1', 1, 0)), 0) as yxf,
|
||||
ifnull(sum(if(t.tc_id is null and t.xfqk = '1', 1, 0)), 0) as wxc,
|
||||
ifnull(sum(if(tc_id is not null and t.xfqk = '1', 1, 0)), 0) as yxc,
|
||||
ifnull(sum(yxccs), 0) as xccs,
|
||||
ifnull(sum(zjxccs), 0) as zjxc,
|
||||
ifnull(sum(xjxccs), 0) as xjxc
|
||||
from sys_dept as d
|
||||
left join task as t on d.dept_id = t.dept_id
|
||||
where d.dept_name not in ("执法管理系统", "楚雄彝族自治州")
|
||||
<if test="deptId != null and deptId != ''">
|
||||
and d.dept_id IN (SELECT dept_id FROM sys_dept WHERE dept_id = #{deptId} or find_in_set(#{deptId},ancestors))
|
||||
</if>
|
||||
<if test="drsjQuery != null and drsjQuery.size()==2">
|
||||
and DATE_FORMAT(t.drsj, '%Y-%m') between #{drsjQuery[0]} and #{drsjQuery[1]}
|
||||
</if>
|
||||
group by d.dept_name
|
||||
</select>
|
||||
|
||||
<select id="histogramZgAndShStatistics" resultType="com.ruoyi.cxxm.domain.vo.HistogramDataItem">
|
||||
select d.dept_name as deptName,
|
||||
ifnull(sum(if(tc.zgqk = '1' and tc.sfsb = '1', 1, 0)), 0) as wzg,
|
||||
ifnull(sum(if(tc.zgqk = '2' and tc.sfsb = '1', 1, 0)), 0) as wzgdw,
|
||||
ifnull(sum(if(tc.zgqk = '3' and tc.sfsb = '1', 1, 0)), 0) as yzg,
|
||||
ifnull(sum(if(tca.id is not null and tca.shjg = '1', 1, 0)), 0) as shtg,
|
||||
ifnull(sum(if(tca.id is not null and tca.shjg = '2', 1, 0)), 0) as shbtg
|
||||
from sys_dept as d
|
||||
left join task_check as tc on d.dept_id = tc.dept_id
|
||||
left join task_check_audit as tca on tc.id = tca.tc_id
|
||||
where d.dept_name not in ("执法管理系统", "楚雄彝族自治州") and tc.sfsb = '1'
|
||||
<if test="deptId != null and deptId != ''">
|
||||
and d.dept_id IN (SELECT dept_id FROM sys_dept WHERE dept_id = #{deptId} or find_in_set(#{deptId},ancestors))
|
||||
</if>
|
||||
<if test="drsjQuery != null and drsjQuery.size()==2">
|
||||
and tc.task_id in (select id from task where DATE_FORMAT(drsj, '%Y-%m') between #{drsjQuery[0]} and #{drsjQuery[1]})
|
||||
</if>
|
||||
group by d.dept_name
|
||||
</select>
|
||||
|
||||
<select id="lineStatistics" resultType="com.ruoyi.cxxm.domain.vo.LineDateItem">
|
||||
select DATE_FORMAT(tc.xcsj, '%Y-%m-%d') as date,
|
||||
d.dept_name as deptName,
|
||||
sum(if(tc.sfsb = '1', 1, 0)) as num
|
||||
from sys_dept as d
|
||||
left join task_check as tc on d.dept_id = tc.dept_id
|
||||
where d.del_flag = 0
|
||||
and d.dept_name not in ("执法管理系统", "楚雄彝族自治州")
|
||||
and DATE_FORMAT(tc.xcsj, '%Y-%m') = #{lineDateQuery}
|
||||
group by DATE_FORMAT(tc.xcsj, '%Y-%m-%d'), d.dept_name;
|
||||
</select>
|
||||
</mapper>
|
6
pom.xml
@ -190,6 +190,12 @@
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.deepoove</groupId>
|
||||
<artifactId>poi-tl</artifactId>
|
||||
<version>1.10.5</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
@ -1,7 +1,13 @@
|
||||
package com.ruoyi.web.controller.cxxm;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.Period;
|
||||
import java.time.ZoneId;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -11,13 +17,20 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||
import com.ruoyi.cxxm.domain.*;
|
||||
import com.ruoyi.cxxm.domain.enums.SFSB;
|
||||
import com.ruoyi.cxxm.domain.dto.TaskCheckSubmit;
|
||||
import com.ruoyi.cxxm.domain.enums.SHJG;
|
||||
import com.ruoyi.cxxm.domain.enums.XFQK;
|
||||
import com.ruoyi.cxxm.domain.enums.ZGQK;
|
||||
import com.ruoyi.cxxm.domain.query.TaskQuery;
|
||||
import com.ruoyi.cxxm.domain.vo.TaskCheckLog;
|
||||
import com.ruoyi.cxxm.domain.vo.TaskCheckStatistics;
|
||||
import com.ruoyi.cxxm.domain.vo.TaskCheckSubmitVo;
|
||||
import com.ruoyi.cxxm.service.*;
|
||||
import net.bytebuddy.asm.Advice;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -88,64 +101,7 @@ public class TaskCheckController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('cxxm:taskCheck:query')")
|
||||
@GetMapping(value = "/{taskId}")
|
||||
public AjaxResult getInfoByTaskId(@PathVariable("taskId") Long taskId) {
|
||||
TaskCheckSubmitVo taskCheckSubmitVo = new TaskCheckSubmitVo();
|
||||
// 最后一条填报内容
|
||||
LambdaQueryWrapper<TaskCheck> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TaskCheck::getTaskId, taskId);
|
||||
queryWrapper.eq(TaskCheck::getSfsb, SFSB.YSB.getValue());
|
||||
queryWrapper.orderByDesc(TaskCheck::getId);
|
||||
queryWrapper.last("limit 1");
|
||||
TaskCheck taskCheck = taskCheckService.getOne(queryWrapper);
|
||||
if (taskCheck == null) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
BeanUtils.copyProperties(taskCheck, taskCheckSubmitVo);
|
||||
// 图片
|
||||
LambdaQueryWrapper<TaskCheckImage> tcImagesQueryWrapper = new LambdaQueryWrapper<>();
|
||||
tcImagesQueryWrapper.eq(TaskCheckImage::getTcId, taskCheck.getId());
|
||||
List<TaskCheckImage> taskCheckImages = taskCheckImageService.list(tcImagesQueryWrapper);
|
||||
taskCheckSubmitVo.setTaskCheckImages(taskCheckImages);
|
||||
// 视频
|
||||
LambdaQueryWrapper<TaskCheckVideo> tcVideosQueryWrapper = new LambdaQueryWrapper<>();
|
||||
tcVideosQueryWrapper.eq(TaskCheckVideo::getTcId, taskCheck.getId());
|
||||
List<TaskCheckVideo> taskCheckVideos = taskCheckVideoService.list(tcVideosQueryWrapper);
|
||||
taskCheckSubmitVo.setTaskCheckVideos(taskCheckVideos);
|
||||
// 图斑信息
|
||||
Task task = taskService.getById(taskCheck.getTaskId());
|
||||
Tbxx tbxx = tbxxService.selectTbxxByTbbh(task.getTbbh());
|
||||
taskCheckSubmitVo.setTbxx(tbxx);
|
||||
// 填报记录列表
|
||||
LambdaQueryWrapper<TaskCheck> tcLogQueryWrapper = new LambdaQueryWrapper<>();
|
||||
tcLogQueryWrapper.eq(TaskCheck::getTaskId, taskId);
|
||||
tcLogQueryWrapper.orderByDesc(TaskCheck::getId);
|
||||
List<TaskCheck> tcList = taskCheckService.list(tcLogQueryWrapper);
|
||||
List<TaskCheckLog> tcLogList = new ArrayList<>();
|
||||
for (TaskCheck item : tcList) {
|
||||
// 跳过未上报,且非本人巡查的记录
|
||||
if (Objects.equals(item.getSfsb(), SFSB.WSB.getValue()) && !Objects.equals(item.getXcryId(), SecurityUtils.getUserId())) {
|
||||
continue;
|
||||
}
|
||||
TaskCheckLog taskCheckLog = new TaskCheckLog();
|
||||
BeanUtils.copyProperties(item, taskCheckLog);
|
||||
taskCheckLog.setTcId(item.getId());
|
||||
// 填报记录图片
|
||||
LambdaQueryWrapper<TaskCheckImage> tcLogImagesQueryWrapper = new LambdaQueryWrapper<>();
|
||||
tcLogImagesQueryWrapper.eq(TaskCheckImage::getTcId, item.getId());
|
||||
List<TaskCheckImage> tcLogImages = taskCheckImageService.list(tcLogImagesQueryWrapper);
|
||||
taskCheckLog.setTaskCheckImages(tcLogImages);
|
||||
// 填报记录视频
|
||||
LambdaQueryWrapper<TaskCheckVideo> tcLogVideosQueryWrapper = new LambdaQueryWrapper<>();
|
||||
tcLogVideosQueryWrapper.eq(TaskCheckVideo::getTcId, item.getId());
|
||||
List<TaskCheckVideo> tcLogVideos = taskCheckVideoService.list(tcLogVideosQueryWrapper);
|
||||
taskCheckLog.setTaskCheckVideos(tcLogVideos);
|
||||
// 填报记录审核
|
||||
LambdaQueryWrapper<TaskCheckAudit> tcAuditQueryWrapper = new LambdaQueryWrapper<>();
|
||||
tcAuditQueryWrapper.eq(TaskCheckAudit::getTcId, item.getId());
|
||||
TaskCheckAudit taskCheckAudit = taskCheckAuditService.getOne(tcAuditQueryWrapper);
|
||||
taskCheckLog.setTaskCheckAudit(taskCheckAudit);
|
||||
tcLogList.add(taskCheckLog);
|
||||
}
|
||||
taskCheckSubmitVo.setTaskCheckLogs(tcLogList);
|
||||
TaskCheckSubmitVo taskCheckSubmitVo = taskCheckService.getTaskCheckSubmitVo(taskId);
|
||||
return AjaxResult.success(taskCheckSubmitVo);
|
||||
}
|
||||
|
||||
@ -204,5 +160,19 @@ public class TaskCheckController extends BaseController {
|
||||
public AjaxResult cancelReport(@PathVariable Long tcId) {
|
||||
return toAjax(taskCheckService.cancelReportTaskCheckInfo(tcId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询本人填报记录表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('cxxm:taskCheck:list')")
|
||||
@GetMapping("/submitted/list")
|
||||
public TableDataInfo submittedList(TaskCheck taskCheck, PageDomain pageDomain) {
|
||||
startPage();
|
||||
LambdaQueryWrapper<TaskCheck> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TaskCheck::getXcryId,SecurityUtils.getUserId());
|
||||
queryWrapper.eq(TaskCheck::getXcsj,taskCheck.getXcsj());
|
||||
List<TaskCheck> list = taskCheckService.list(queryWrapper);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,19 +4,24 @@ import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.*;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
|
||||
import com.ruoyi.common.core.text.StrFormatter;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||
import com.ruoyi.cxxm.domain.Tbxx;
|
||||
import com.ruoyi.cxxm.domain.enums.XFQK;
|
||||
import com.ruoyi.cxxm.domain.query.TaskQuery;
|
||||
import com.ruoyi.cxxm.domain.vo.TaskCheckSubmitVo;
|
||||
import com.ruoyi.cxxm.domain.vo.TaskDetailVo;
|
||||
import com.ruoyi.cxxm.mapper.DeptMapper;
|
||||
import com.ruoyi.cxxm.service.ITbxxService;
|
||||
@ -280,5 +285,45 @@ public class TaskController extends BaseController {
|
||||
List<Task> list = taskService.list(queryWrapper);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
// @PreAuthorize("@ss.hasPermi('cxxm:taskCheck:query')")
|
||||
// @Log(title = "任务巡查记录", businessType = BusinessType.EXPORT)
|
||||
// @PostMapping("/exportWord/{taskId}")
|
||||
// public void exportWordByTaskId(HttpServletResponse response, @PathVariable("taskId") Long taskId) throws UnknownHostException {
|
||||
// TaskCheckSubmitVo taskCheckSubmitVo = taskCheckSubmitService.selectTaskCheckSubmitByTaskId(taskId);
|
||||
// String jsonString = JSON.toJSONString(taskCheckSubmitVo);
|
||||
// Map taskCheckSubmitMap = JSONObject.parseObject(jsonString, Map.class);
|
||||
// String zgqk =(String) taskCheckSubmitMap.get("zgqk");
|
||||
// switch (zgqk) {
|
||||
// case "0":
|
||||
// taskCheckSubmitMap.put("zgqk","☑无 □未整改 □未整改到位 □已整改");
|
||||
// break;
|
||||
// case "1":
|
||||
// taskCheckSubmitMap.put("zgqk","□无 ☑未整改 □未整改到位 □已整改");
|
||||
// break;
|
||||
// case "2":
|
||||
// taskCheckSubmitMap.put("zgqk","□无 □未整改 ☑未整改到位 □已整改");
|
||||
// break;
|
||||
// case "3":
|
||||
// taskCheckSubmitMap.put("zgqk","□无 □未整改 □未整改到位 ☑未整改");
|
||||
// break;
|
||||
// }
|
||||
// Object taskCheckImages = taskCheckSubmitMap.get("taskCheckImages");
|
||||
// List taskCheckImagelist = JSONObject.parseObject(JSON.toJSONString(taskCheckImages), List.class);
|
||||
// ArrayList<Object> newTaskCheckImages = new ArrayList<>();
|
||||
// for (Object item : taskCheckImagelist) {
|
||||
// Map itemMap = JSONObject.parseObject(JSON.toJSONString(item), Map.class);
|
||||
// String cclj = (String) itemMap.get("cclj");
|
||||
// String ip = InetAddress.getLocalHost().getHostAddress();
|
||||
// String port = environment.getProperty("server.port");
|
||||
// String full_cclj = StrFormatter.format("http://{}:{}{}", ip, port, cclj);
|
||||
// itemMap.put("cclj", Pictures.ofUrl(full_cclj).size(200, 200).create());
|
||||
// newTaskCheckImages.add(itemMap);
|
||||
// }
|
||||
// taskCheckSubmitMap.put("taskCheckImages",newTaskCheckImages);
|
||||
// List<String> nameList = new ArrayList<>();
|
||||
// nameList.add("taskCheckImages");
|
||||
// PoiTlWordUtils.poiTlWord(taskCheckSubmitMap, nameList, "template/taskCheckExport.doc", "taskCheck", response);
|
||||
// }
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,38 @@
|
||||
package com.ruoyi.web.controller.cxxm;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.cxxm.domain.query.StatisticsQuery;
|
||||
import com.ruoyi.cxxm.domain.vo.HistogramDataItem;
|
||||
import com.ruoyi.cxxm.domain.vo.StatisticsVo;
|
||||
import com.ruoyi.cxxm.service.IStatisticsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/cxxm/task/statistics")
|
||||
public class TaskStatisticsController {
|
||||
@Autowired
|
||||
private IStatisticsService statisticsService;
|
||||
|
||||
/**
|
||||
* 获取统计数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('cxxm:task:statistics')")
|
||||
@GetMapping()
|
||||
public AjaxResult getStatistics(StatisticsQuery statisticsQuery) {
|
||||
StatisticsVo statisticsVo = statisticsService.taskStatistics(statisticsQuery);
|
||||
List<HistogramDataItem> histogramData = statisticsService.histogramStatistics(statisticsQuery);
|
||||
List<Object> lineData = statisticsService.lineStatistics(statisticsQuery);
|
||||
statisticsVo.setHistogramData(histogramData);
|
||||
statisticsVo.setLineData(lineData);
|
||||
return success(statisticsVo);
|
||||
}
|
||||
}
|
@ -125,16 +125,20 @@
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--mybatis-plus工具-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!-- word工具 -->
|
||||
<dependency>
|
||||
<groupId>com.deepoove</groupId>
|
||||
<artifactId>poi-tl</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
@ -8,16 +8,18 @@ import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
|
||||
/**
|
||||
* 时间工具类
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
{
|
||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
public static String YYYY = "yyyy";
|
||||
|
||||
public static String YYYY_MM = "yyyy-MM";
|
||||
@ -29,63 +31,52 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
private static String[] parsePatterns = {
|
||||
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
|
||||
|
||||
/**
|
||||
* 获取当前Date型日期
|
||||
*
|
||||
*
|
||||
* @return Date() 当前日期
|
||||
*/
|
||||
public static Date getNowDate()
|
||||
{
|
||||
public static Date getNowDate() {
|
||||
return new Date();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前日期, 默认格式为yyyy-MM-dd
|
||||
*
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String getDate()
|
||||
{
|
||||
public static String getDate() {
|
||||
return dateTimeNow(YYYY_MM_DD);
|
||||
}
|
||||
|
||||
public static final String getTime()
|
||||
{
|
||||
public static final String getTime() {
|
||||
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
|
||||
}
|
||||
|
||||
public static final String dateTimeNow()
|
||||
{
|
||||
public static final String dateTimeNow() {
|
||||
return dateTimeNow(YYYYMMDDHHMMSS);
|
||||
}
|
||||
|
||||
public static final String dateTimeNow(final String format)
|
||||
{
|
||||
public static final String dateTimeNow(final String format) {
|
||||
return parseDateToStr(format, new Date());
|
||||
}
|
||||
|
||||
public static final String dateTime(final Date date)
|
||||
{
|
||||
public static final String dateTime(final Date date) {
|
||||
return parseDateToStr(YYYY_MM_DD, date);
|
||||
}
|
||||
|
||||
public static final String parseDateToStr(final String format, final Date date)
|
||||
{
|
||||
public static final String parseDateToStr(final String format, final Date date) {
|
||||
return new SimpleDateFormat(format).format(date);
|
||||
}
|
||||
|
||||
public static final Date dateTime(final String format, final String ts)
|
||||
{
|
||||
try
|
||||
{
|
||||
public static final Date dateTime(final String format, final String ts) {
|
||||
try {
|
||||
return new SimpleDateFormat(format).parse(ts);
|
||||
}
|
||||
catch (ParseException e)
|
||||
{
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@ -93,8 +84,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
/**
|
||||
* 日期路径 即年/月/日 如2018/08/08
|
||||
*/
|
||||
public static final String datePath()
|
||||
{
|
||||
public static final String datePath() {
|
||||
Date now = new Date();
|
||||
return DateFormatUtils.format(now, "yyyy/MM/dd");
|
||||
}
|
||||
@ -102,8 +92,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
/**
|
||||
* 日期路径 即年/月/日 如20180808
|
||||
*/
|
||||
public static final String dateTime()
|
||||
{
|
||||
public static final String dateTime() {
|
||||
Date now = new Date();
|
||||
return DateFormatUtils.format(now, "yyyyMMdd");
|
||||
}
|
||||
@ -111,18 +100,13 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
/**
|
||||
* 日期型字符串转化为日期 格式
|
||||
*/
|
||||
public static Date parseDate(Object str)
|
||||
{
|
||||
if (str == null)
|
||||
{
|
||||
public static Date parseDate(Object str) {
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
try
|
||||
{
|
||||
try {
|
||||
return parseDate(str.toString(), parsePatterns);
|
||||
}
|
||||
catch (ParseException e)
|
||||
{
|
||||
} catch (ParseException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -130,8 +114,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
/**
|
||||
* 获取服务器启动时间
|
||||
*/
|
||||
public static Date getServerStartDate()
|
||||
{
|
||||
public static Date getServerStartDate() {
|
||||
long time = ManagementFactory.getRuntimeMXBean().getStartTime();
|
||||
return new Date(time);
|
||||
}
|
||||
@ -139,20 +122,18 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
/**
|
||||
* 计算相差天数
|
||||
*/
|
||||
public static int differentDaysByMillisecond(Date date1, Date date2)
|
||||
{
|
||||
public static int differentDaysByMillisecond(Date date1, Date date2) {
|
||||
return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算时间差
|
||||
*
|
||||
* @param endDate 最后时间
|
||||
* @param endDate 最后时间
|
||||
* @param startTime 开始时间
|
||||
* @return 时间差(天/小时/分钟)
|
||||
*/
|
||||
public static String timeDistance(Date endDate, Date startTime)
|
||||
{
|
||||
public static String timeDistance(Date endDate, Date startTime) {
|
||||
long nd = 1000 * 24 * 60 * 60;
|
||||
long nh = 1000 * 60 * 60;
|
||||
long nm = 1000 * 60;
|
||||
@ -173,8 +154,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
/**
|
||||
* 增加 LocalDateTime ==> Date
|
||||
*/
|
||||
public static Date toDate(LocalDateTime temporalAccessor)
|
||||
{
|
||||
public static Date toDate(LocalDateTime temporalAccessor) {
|
||||
ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault());
|
||||
return Date.from(zdt.toInstant());
|
||||
}
|
||||
@ -182,10 +162,28 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
/**
|
||||
* 增加 LocalDate ==> Date
|
||||
*/
|
||||
public static Date toDate(LocalDate temporalAccessor)
|
||||
{
|
||||
public static Date toDate(LocalDate temporalAccessor) {
|
||||
LocalDateTime localDateTime = LocalDateTime.of(temporalAccessor, LocalTime.of(0, 0, 0));
|
||||
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
|
||||
return Date.from(zdt.toInstant());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某个月所有的日期序列
|
||||
*
|
||||
* @param year
|
||||
* @param month
|
||||
* @return
|
||||
*/
|
||||
public static List<LocalDate> generateDatesInMonth(int year, int month) {
|
||||
List<LocalDate> dates = new ArrayList<>();
|
||||
LocalDate firstDayOfMonth = LocalDate.of(year, month, 1);
|
||||
LocalDate lastDayOfMonth = firstDayOfMonth.plusMonths(1).minusDays(1);
|
||||
|
||||
for (LocalDate date = firstDayOfMonth; !date.isAfter(lastDayOfMonth); date = date.plusDays(1)) {
|
||||
dates.add(date);
|
||||
}
|
||||
|
||||
return dates;
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,14 @@
|
||||
package com.ruoyi.common.utils.bean;
|
||||
|
||||
|
||||
import org.springframework.beans.BeanWrapper;
|
||||
import org.springframework.beans.BeanWrapperImpl;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@ -107,4 +113,17 @@ public class BeanUtils extends org.springframework.beans.BeanUtils
|
||||
{
|
||||
return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX));
|
||||
}
|
||||
|
||||
public static String[] getNullPropertyNames (Object source) {
|
||||
final BeanWrapper src = new BeanWrapperImpl(source);
|
||||
java.beans.PropertyDescriptor[] pds = src.getPropertyDescriptors();
|
||||
|
||||
Set<String> emptyNames = new HashSet<String>();
|
||||
for(java.beans.PropertyDescriptor pd : pds) {
|
||||
Object srcValue = src.getPropertyValue(pd.getName());
|
||||
if (srcValue == null) emptyNames.add(pd.getName());
|
||||
}
|
||||
String[] result = new String[emptyNames.size()];
|
||||
return emptyNames.toArray(result);
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public class FileUploadUtils
|
||||
/**
|
||||
* 默认大小 50M
|
||||
*/
|
||||
public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024;
|
||||
public static final long DEFAULT_MAX_SIZE = 256 * 1024 * 1024;
|
||||
|
||||
/**
|
||||
* 默认的文件名最大长度 100
|
||||
|
@ -0,0 +1,157 @@
|
||||
package com.ruoyi.common.utils.poi;
|
||||
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.config.ConfigureBuilder;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import com.deepoove.poi.util.PoitlIOUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class PoiTlWordUtils {
|
||||
|
||||
/**
|
||||
* 根据文件模版生成文件保存至本地
|
||||
*
|
||||
* @param map 数据集合
|
||||
* @param nameList 循环添加的数据
|
||||
* @param path 模版路径 我放到了 项目的 resources/file 下面了
|
||||
* @param filePath 生成文件保存到本地的路径及文件名称
|
||||
*/
|
||||
public static void poiTlWord(Map<String, Object> map, List<String> nameList, String path, String filePath) {
|
||||
XWPFTemplate template;
|
||||
try {
|
||||
//处理文件
|
||||
template = common(path, map, nameList);
|
||||
//写出文件且关闭流
|
||||
template.writeAndClose(Files.newOutputStream(Paths.get(filePath)));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据word模版生成word文档并通过流的方式下载 get请求
|
||||
*
|
||||
* @param map 数据集合
|
||||
* @param nameList 循环表格名称
|
||||
* @param path 模版文件路径
|
||||
* @param fileName 生成的文件名称
|
||||
* @param response response
|
||||
*/
|
||||
public static void poiTlWord(Map<String, Object> map, List<String> nameList, String path, String fileName, HttpServletResponse response) {
|
||||
OutputStream out = null;
|
||||
BufferedOutputStream bos = null;
|
||||
XWPFTemplate template;
|
||||
String filePoiName;
|
||||
try {
|
||||
//处理文件
|
||||
template = common(path, map, nameList);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
filePoiName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + filePoiName + ".docx");
|
||||
out = response.getOutputStream();
|
||||
bos = new BufferedOutputStream(out);
|
||||
template.write(bos);
|
||||
bos.flush();
|
||||
out.flush();
|
||||
PoitlIOUtils.closeQuietlyMulti(template, bos, out);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
try {
|
||||
if (bos != null) {
|
||||
bos.close();
|
||||
}
|
||||
if (out != null) {
|
||||
out.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据word模版生成文件 返回InputStream
|
||||
*
|
||||
* @param map 数据
|
||||
* @param nameList 循环数据名称集合
|
||||
* @param path 模版文件位置
|
||||
* @return InputStream
|
||||
*/
|
||||
public static InputStream poiTlWord(Map<String, Object> map, List<String> nameList, String path) {
|
||||
ByteArrayOutputStream bos = null;
|
||||
XWPFTemplate template = null;
|
||||
try {
|
||||
//处理文件
|
||||
template = common(path, map, nameList);
|
||||
bos = new ByteArrayOutputStream();
|
||||
template.write(bos);
|
||||
return new ByteArrayInputStream(bos.toByteArray());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
try {
|
||||
if (bos != null) {
|
||||
bos.close();
|
||||
}
|
||||
if (template != null) {
|
||||
template.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 公共处理模版数据
|
||||
*
|
||||
* @param path 模版文件位置
|
||||
* @param map 数据
|
||||
* @param nameList 数据名字集合
|
||||
* @return 文档
|
||||
*/
|
||||
private static XWPFTemplate common(String path, Map<String, Object> map, List<String> nameList) {
|
||||
//获取模版文件的文件流
|
||||
ClassPathResource classPathResource = new ClassPathResource(path);
|
||||
XWPFTemplate template;
|
||||
InputStream ins = null;
|
||||
try {
|
||||
ins = classPathResource.getInputStream();
|
||||
if (CollectionUtils.isNotEmpty(nameList)) {
|
||||
//如果有循环添加的数据表格的话 则绑定
|
||||
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
||||
ConfigureBuilder builder = Configure.builder();
|
||||
nameList.forEach(l -> builder.bind(l, policy));
|
||||
Configure config = builder.build();
|
||||
template = XWPFTemplate.compile(ins, config).render(map);
|
||||
} else {
|
||||
template = XWPFTemplate.compile(ins).render(map);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
try {
|
||||
if (ins != null) {
|
||||
ins.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return template;
|
||||
}
|
||||
|
||||
}
|
BIN
ruoyi-common/src/main/resources/template/taskCheckExport.doc
Normal file
@ -52,6 +52,7 @@
|
||||
"quill": "1.3.7",
|
||||
"screenfull": "5.0.2",
|
||||
"sortablejs": "1.10.2",
|
||||
"v-charts": "^1.19.0",
|
||||
"v-echarts": "^1.0.2",
|
||||
"vue": "2.6.12",
|
||||
"vue-count-to": "1.0.13",
|
||||
|
10
ruoyi-ui/src/api/cxxm/statistics.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取统计数据
|
||||
export function getStatistics(query) {
|
||||
return request({
|
||||
url: '/cxxm/task/statistics',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
1
ruoyi-ui/src/assets/icons/svg/assign.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1710763729216" class="icon" viewBox="0 0 1228 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14605" xmlns:xlink="http://www.w3.org/1999/xlink" width="239.84375" height="200"><path d="M671.37984 36.897561c53.860569 53.792304 38.296298 135.026876 20.615832 174.483668l-2.594045 4.915033-3.14016 4.505447-27.783589 34.473494h420.849692c53.24619 2.867103 149.430653 36.726218 149.430652 144.720413 0 89.426293-70.175747 131.545394-142.740747 135.026876l-9.89833 0.273057h-136.66522c8.737836 27.16921 6.826435 55.976763 3.413218 80.347135-5.256355 37.954976-25.394337 66.967323-56.045028 83.487295 7.236021 25.257808 6.689906 55.021063-1.843138 86.422662-24.711693 82.599858-76.865653 97.276693-107.994194 98.232393-1.57008 11.263617-4.778504 23.278142-10.239652 35.770517-23.346406 48.262892-65.465508 73.998551-118.916491 73.998551h-0.068264l-10.444445-0.341322a228.139443 228.139443 0 0 1-77.411768-19.660131l-1.638344-0.819173-355.725505-114.274514-160.899063-4.573711a42.870009 42.870009 0 0 1-41.095136-36.043575L0 811.015241V390.506872c0-20.342775 14.335513-37.613654 33.654322-41.846044l6.621642-0.955701 138.440093-8.191721c37.886712-46.761077 105.468414-92.83951 133.456796-110.861298l5.324619-3.413217L449.247659 65.909908C503.449549-6.313769 610.692836-23.789442 671.448104 36.829297z m-149.498917 75.568631l-5.324619 6.485113-137.416128 166.223682a42.25563 42.25563 0 0 1-10.580974 9.215686c-26.07698 16.110386-65.738565 43.893974-95.570084 70.653598L273.057383 791.082053l317.224414 102.396518c5.119826 2.04793 25.940451 11.809732 48.809007 13.925927l8.601308 0.409586c20.957154 0 32.903415-7.031228 41.231665-24.302107a48.467685 48.467685 0 0 0 0.068264-37.06754 43.484388 43.484388 0 0 1 10.580974-50.58388 42.665216 42.665216 0 0 1 50.925201-4.437183c2.730574 1.706609 13.311547 6.689906 23.073349 6.689906 4.505447 0 18.158316 0 29.012347-36.180103 6.143791-22.322441 3.481482-38.364562-0.682643-45.054468-1.365287-2.116195-2.730574-3.413217-6.553377-4.095861a43.006538 43.006538 0 0 1-34.268702-49.764708 43.211331 43.211331 0 0 1 49.491651-34.610023c0.682643 0.068264 4.437182 0.546115 9.693537 0.546115 34.268702 0 36.453161-15.837328 37.818447-25.257808 3.549746-25.667394 2.252723-41.709515-4.095861-49.013801-5.119826-5.870734-24.711693-19.387074-96.867106-19.387074a42.870009 42.870009 0 0 1-6.348584-85.330432l6.348584-0.409586h317.565736c26.55483 0 68.400874-6.485113 68.400874-49.559915 0-48.467685-48.672478-57.34205-63.895427-58.843866l-2.594045-0.273057-507.750203 0.136528a42.801745 42.801745 0 0 1-37.340598-64.031956l3.959333-5.734205 79.869284-99.051565c4.641976-13.175019 16.383443-53.655776-4.573711-74.749459-23.619464-23.551199-63.007991-13.857662-88.880178 15.018156zM136.528691 682.678272a68.264346 68.264346 0 1 0 0 136.528691 68.264346 68.264346 0 0 0 0-136.528691z" p-id="14606"></path></svg>
|
After Width: | Height: | Size: 2.9 KiB |
1
ruoyi-ui/src/assets/icons/svg/check.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1710764467521" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25628" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M373.493 197.816h187.133a40.726 40.726 0 0 0 40.651-40.651v-1.516a40.726 40.726 0 0 0-40.651-40.651H373.493a40.726 40.726 0 0 0-40.651 40.651v1.516a40.638 40.638 0 0 0 40.651 40.651z" p-id="25629"></path><path d="M457.686 707.676H295.77v-51.675h175.282C503.297 574.01 582.946 515.86 676.374 515.86A219.721 219.721 0 0 1 769.11 536.528v-323a56.987 56.987 0 0 0-57.049-57.05h-73.72v0.827a77.718 77.718 0 0 1-77.719 77.72H373.49a77.717 77.717 0 0 1-77.719-77.72v-0.827h-73.724a56.987 56.987 0 0 0-57.049 57.05v566.08A56.987 56.987 0 0 0 222.047 836.66h257.824a218.609 218.609 0 0 1-24.253-100.18 221.314 221.314 0 0 1 2.068-28.804zM295.77 370.48h342.433v51.675H295.77z m0 142.761h179.967v51.675H295.77z" p-id="25630"></path><path d="M805.354 841.891a165.752 165.752 0 0 0 37.62-105.416c0-91.774-74.689-166.6-166.6-166.6s-166.6 74.686-166.6 166.6 74.826 166.6 166.6 166.6a165.117 165.117 0 0 0 102.111-35c1.1-0.828 2.067-1.928 3.169-2.756l84.334 84.334 23.564-23.564z m-47.264-0.137a131.861 131.861 0 0 1-81.717 27.974c-73.447 0-133.252-59.806-133.252-133.253S602.93 603.222 676.373 603.222 809.63 663.029 809.63 736.475a132.771 132.771 0 0 1-51.541 105.279z" p-id="25631"></path></svg>
|
After Width: | Height: | Size: 1.5 KiB |
1
ruoyi-ui/src/assets/icons/svg/distribute.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1710764542093" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="29176" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M928.7 689.2c-13.6-11.2-33.8-9.3-45 4.4l-49.1 59.6V547.5c0-17.7-14.3-32-32-32s-32 14.3-32 32v205.1l-48.6-59c-11.3-13.7-31.4-15.6-45-4.4-13.6 11.2-15.6 31.4-4.4 45l105.5 128.2c6.1 7.4 15.1 11.7 24.7 11.7s18.6-4.3 24.7-11.7L933 734.2c11.3-13.6 9.4-33.8-4.3-45z" p-id="29177"></path><path d="M626.6 809.3H148.1V683.7H345c14 37.5 50 64.6 91.9 64.6 42.9 0 78.6-26.8 92.3-64.6h97.3c17.7 0 32-14.3 32-32s-14.3-32-32-32h-96.1C517.7 580 480.8 551 436.9 551c-43.8 0-80.6 29-93.4 68.7H148.1V484.2h365.3c15.8 33.7 50.1 57 89 57 39.3 0 73.7-23.7 89.1-57h160.3c17.7 0 32-14.3 32-32 0-1.1-0.2-2.1-0.3-3.2 0.1-1.1 0.3-2.1 0.3-3.2V243.1c0-17.7-14.3-32-32-32H428.3c-14.8-35.9-50-61.2-90.6-61.2-40.6 0-75.8 25.2-90.7 61H115.9c-17.8 0-32.2 14.4-32.2 32.2v598.4c0 17.8 14.4 32.2 32.2 32.2h510.7c17.8 0 32.2-14.4 32.2-32.2s-14.4-32.2-32.2-32.2zM436.9 615c18.7 0 33.9 14.8 34.8 33.3-0.1 0.9-0.2 1.8-0.2 2.7-0.4 18.4-15.9 33.4-34.6 33.4-18.5 0-33.9-15-34.4-33.4 0-0.9-0.1-1.7-0.2-2.6 0.9-18.6 16.1-33.4 34.6-33.4z m165.6-137.9c-17.2 0-31.9-12.6-34.5-31.3-0.2-1.1-0.2-2.2-0.2-3.3 0-19.2 15.6-34.8 34.8-34.8 19.1 0 34.6 15.6 34.6 34.8 0 1.1 0 2.2-0.5 5.2-2.5 16.8-17.2 29.4-34.2 29.4zM372.3 247.5c0 0.3 0 0.6 0.1 0.9-0.1-0.5-0.1-0.8-0.1-0.9z m-34.6-33.6c17.9 0 32.9 13.9 34.2 31.6 0.1 1 0.2 2 0.4 2.9 0 19.2-15.5 34.8-34.6 34.8-18.7 0-34-14.9-34.7-34.3 0.3-1.5 0.4-3.1 0.5-4.6 2-17.1 16.7-30.4 34.2-30.4z m-94.5 61.5c11.8 41.3 49.5 71.9 94.6 71.9 45.1 0 82.8-30.6 94.4-72.1h387.7v145.1H698.3c-10.2-43.7-49.1-76.4-95.8-76.4-46.7 0-85.8 32.7-96 76.4H148.1V275.4h95.1z" p-id="29178"></path></svg>
|
After Width: | Height: | Size: 1.9 KiB |
1
ruoyi-ui/src/assets/icons/svg/import.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1710764358263" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="22684" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M601.152 708.288 400 568 344 568l0 112-224 0 0 112 224 0 0 112L400 904l201.152-140.288C624 749.504 624 722.496 601.152 708.288L601.152 708.288zM891.264 331.2 638.656 76.864C630.528 68.608 619.456 64 607.936 64L232 64C196.032 64 176 83.712 176 120L176 512 288 512 288 176l280 0 0 168c0 24.192 32 56 56 56l168 0 0.768 448L624 848 624 960l224 0c35.968 0 56-19.712 56-56L904 362.176C904 350.528 899.392 339.392 891.264 331.2L891.264 331.2z" p-id="22685"></path></svg>
|
After Width: | Height: | Size: 797 B |
1
ruoyi-ui/src/assets/icons/svg/statistics.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1710763841307" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16763" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M691.2 928.2V543.1c0-32.7 26.5-59.3 59.2-59.3h118.5c32.7 0 59.3 26.5 59.3 59.2V928.2h-237z m192.6-385.1c0-8.2-6.6-14.8-14.8-14.8H750.5c-8.2 0-14.8 6.6-14.9 14.7v340.8h148.2V543.1zM395 157.8c-0.1-32.6 26.3-59.2 58.9-59.3h118.8c32.6 0 59.1 26.5 59.1 59.1v770.6H395V157.8z m44.4 725.9h148V157.9c0-8.1-6.5-14.7-14.7-14.8H454.1c-8.1 0.1-14.7 6.7-14.7 14.8v725.8zM98.6 394.9c0-32.7 26.5-59.2 59.2-59.3h118.5c32.7-0.1 59.3 26.4 59.3 59.1v533.5h-237V394.9z m44.5 488.8h148.2V394.9c0-8.2-6.7-14.8-14.8-14.8H158c-8.2 0-14.8 6.6-14.9 14.7v488.9z" p-id="16764"></path></svg>
|
After Width: | Height: | Size: 896 B |
Before Width: | Height: | Size: 509 KiB After Width: | Height: | Size: 2.5 MiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 235 KiB |
@ -38,6 +38,8 @@ import VueMeta from 'vue-meta'
|
||||
// 字典数据组件
|
||||
import DictData from '@/components/DictData'
|
||||
|
||||
import VCharts from 'v-charts'
|
||||
|
||||
// 全局方法挂载
|
||||
Vue.prototype.getDicts = getDicts
|
||||
Vue.prototype.getConfigKey = getConfigKey
|
||||
@ -61,6 +63,7 @@ Vue.component('ImagePreview', ImagePreview)
|
||||
Vue.use(directive)
|
||||
Vue.use(plugins)
|
||||
Vue.use(VueMeta)
|
||||
Vue.use(VCharts)
|
||||
DictData.install()
|
||||
|
||||
/**
|
||||
|
@ -6,38 +6,38 @@
|
||||
<el-card>
|
||||
<el-descriptions class="margin-top" :column="5" direction="vertical">
|
||||
<el-descriptions-item label="需巡查次数">
|
||||
<el-tag type="info" effect="dark">5次</el-tag>
|
||||
<el-tag type="info" effect="dark">{{form.taskCheckStatistics.xxccs}}次</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="已巡查次数">
|
||||
<el-tag type="success" effect="dark">4次</el-tag>
|
||||
<el-tag type="success" effect="dark">{{form.taskCheckStatistics.yxccs}}次</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="州巡查次数">
|
||||
<el-tag type="warning" effect="dark">1次</el-tag>
|
||||
<el-tag type="warning" effect="dark">{{form.taskCheckStatistics.zjxccs}}次</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="县巡查次数">
|
||||
<el-tag type="info" effect="dark">3次</el-tag>
|
||||
<el-tag type="info" effect="dark">{{form.taskCheckStatistics.xjxccs}}次</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="平均巡查频率">
|
||||
<el-tag type="primary" effect="dark">25天/次</el-tag>
|
||||
<el-descriptions-item label="县巡查频率">
|
||||
<el-tag type="primary" effect="dark">{{ form.taskCheckStatistics.xjxcpl }}天/次</el-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-descriptions class="margin-top" :column="5" direction="vertical">
|
||||
<el-descriptions-item label="未整改">
|
||||
<el-tag type="danger" effect="dark">5次</el-tag>
|
||||
<el-tag type="danger" effect="dark">{{form.taskCheckStatistics.wzgcs}}次</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="未整改到位">
|
||||
<el-tag type="warning" effect="dark">4次</el-tag>
|
||||
<el-tag type="warning" effect="dark">{{form.taskCheckStatistics.wzgdwcs}}次</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="已整改">
|
||||
<el-tag type="success" effect="dark">1次</el-tag>
|
||||
<el-tag type="success" effect="dark">{{form.taskCheckStatistics.yzgcs}}次</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核不通过">
|
||||
<el-tag type="danger" effect="dark">1次</el-tag>
|
||||
<el-tag type="danger" effect="dark">{{form.taskCheckStatistics.shbtgcs}}次</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核通过">
|
||||
<el-tag type="success" effect="dark">1次</el-tag>
|
||||
<el-tag type="success" effect="dark">{{form.taskCheckStatistics.shtgcs}}次</el-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
@ -161,7 +161,7 @@
|
||||
size="medium"
|
||||
plain
|
||||
type="success"
|
||||
@click="handleCheck"
|
||||
@click="handleCheckAdd"
|
||||
v-hasPermi="['cxxm:taskCheckAudit:add']"
|
||||
>审核
|
||||
</el-button>
|
||||
@ -170,7 +170,7 @@
|
||||
size="medium"
|
||||
plain
|
||||
type="info"
|
||||
@click="handleCheck"
|
||||
@click="handleCheckEdit"
|
||||
v-hasPermi="['cxxm:taskCheckAudit:edit']"
|
||||
>修改审核结果
|
||||
</el-button>
|
||||
@ -291,10 +291,14 @@ export default {
|
||||
});
|
||||
},
|
||||
// 审核按钮
|
||||
handleCheck() {
|
||||
handleCheckAdd() {
|
||||
this.title = "提交审核结果";
|
||||
this.open = true;
|
||||
},
|
||||
handleCheckEdit() {
|
||||
this.title = "修改审核结果";
|
||||
this.open = true;
|
||||
},
|
||||
// 提交审核
|
||||
submitAuditForm() {
|
||||
this.auditForm.tcId = this.recordForm.tcId
|
||||
@ -304,7 +308,7 @@ export default {
|
||||
}
|
||||
if (this.auditForm.id == null) {
|
||||
auditTaskCheck(this.auditForm).then(response => {
|
||||
this.$modal.msgSuccess("审核成功");
|
||||
this.$modal.msgSuccess("提交成功");
|
||||
this.open = false;
|
||||
this.getTaskCheckDetail();
|
||||
});
|
||||
|