last version

This commit is contained in:
2024-04-16 09:13:33 +08:00
parent 90744d2a4c
commit c47f75d166
62 changed files with 3043 additions and 1327 deletions
+104 -105
View File
@@ -1,106 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>ruoyi-admin</artifactId>
<description>
web服务入口
</description>
<dependencies>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>cxxm</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.5.15</version>
<configuration>
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.8.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>ruoyi-admin</artifactId>
<description>
web服务入口
</description>
<dependencies>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-quartz</artifactId>
</dependency>
<!-- 代码生成-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-generator</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>cxxm</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.5.15</version>
<configuration>
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
</project>
@@ -1,37 +0,0 @@
package com.ruoyi.web.controller.cxxm;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.domain.entity.SysDictType;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.cxxm.domain.TaskCheckAudit;
import com.ruoyi.cxxm.domain.vo.AppTypeVo;
import com.ruoyi.cxxm.mapper.AppTypeMapper;
import com.ruoyi.system.service.ISysDictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
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;
@RestController
@RequestMapping("/cxxm/app/type")
public class AppTypeController extends BaseController {
@Autowired
private AppTypeMapper appTypeMapper;
@GetMapping("/list")
public TableDataInfo list()
{
LambdaQueryWrapper<AppTypeVo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AppTypeVo::getDictType,"task_lx");
List<AppTypeVo> appTypeVos = appTypeMapper.selectList(queryWrapper);
return getDataTable(appTypeVos);
}
}
@@ -1,53 +0,0 @@
package com.ruoyi.web.controller.cxxm;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.CxxmUser;
import com.ruoyi.system.domain.CxxmUserXJ;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import static com.ruoyi.common.core.domain.AjaxResult.success;
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
@RestController
@RequestMapping("/cxxm/user")
public class CxxmUserController {
@Autowired
private ISysUserService userService;
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('system:user:import')")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
ExcelUtil<CxxmUser> util = new ExcelUtil<CxxmUser>(CxxmUser.class);
List<CxxmUser> userList = util.importExcel(file.getInputStream());
String operName = getUsername();
String message = userService.importCxxmUser(userList, updateSupport, operName);
return success(message);
}
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
ExcelUtil<CxxmUser> util = new ExcelUtil<CxxmUser>(CxxmUser.class);
util.importTemplateExcel(response, "用户数据");
}
@PostMapping("/importTemplateXJ")
public void importTemplateXJ(HttpServletResponse response) {
ExcelUtil<CxxmUserXJ> util = new ExcelUtil<CxxmUserXJ>(CxxmUserXJ.class);
util.importTemplateExcel(response, "用户数据");
}
}
@@ -1,114 +0,0 @@
package com.ruoyi.web.controller.cxxm;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.cxxm.domain.TaskCheckAudit;
import com.ruoyi.cxxm.service.ITaskCheckAuditService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 任务巡查审核Controller
*
* @author ruoyi
* @date 2024-03-28
*/
@RestController
@RequestMapping("/cxxm/taskCheckAudit")
public class TaskCheckAuditController extends BaseController
{
@Autowired
private ITaskCheckAuditService taskCheckAuditService;
/**
* 查询任务巡查审核列表
*/
@PreAuthorize("@ss.hasPermi('cxxm:taskCheckAudit:list')")
@GetMapping("/list")
public TableDataInfo list(TaskCheckAudit taskCheckAudit, PageDomain pageDomain)
{
startPage();
List<TaskCheckAudit> list = taskCheckAuditService.list(new QueryWrapper<>(taskCheckAudit));
return getDataTable(list);
}
/**
* 导出任务巡查审核列表
*/
@PreAuthorize("@ss.hasPermi('cxxm:taskCheckAudit:export')")
@Log(title = "任务巡查审核", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TaskCheckAudit taskCheckAudit)
{
List<TaskCheckAudit> list = taskCheckAuditService.list(new QueryWrapper<>(taskCheckAudit));
ExcelUtil<TaskCheckAudit> util = new ExcelUtil<TaskCheckAudit>(TaskCheckAudit.class);
util.exportExcel(response, list, "任务巡查审核数据");
}
/**
* 获取任务巡查审核详细信息
*/
@PreAuthorize("@ss.hasPermi('cxxm:taskCheckAudit:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(taskCheckAuditService.getById(id));
}
/**
* 新增任务巡查审核
*/
@PreAuthorize("@ss.hasPermi('cxxm:taskCheckAudit:add')")
@Log(title = "任务巡查审核", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TaskCheckAudit taskCheckAudit)
{
taskCheckAudit.setShsj(DateUtils.getNowDate());
taskCheckAudit.setShryId(SecurityUtils.getUserId());
return toAjax(taskCheckAuditService.saveOrUpdate(taskCheckAudit));
}
/**
* 修改任务巡查审核
*/
@PreAuthorize("@ss.hasPermi('cxxm:taskCheckAudit:edit')")
@Log(title = "任务巡查审核", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TaskCheckAudit taskCheckAudit)
{
taskCheckAudit.setShsj(DateUtils.getNowDate());
taskCheckAudit.setShryId(SecurityUtils.getUserId());
return toAjax(taskCheckAuditService.saveOrUpdate(taskCheckAudit));
}
/**
* 删除任务巡查审核
*/
@PreAuthorize("@ss.hasPermi('cxxm:taskCheckAudit:remove')")
@Log(title = "任务巡查审核", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids)
{
return toAjax(taskCheckAuditService.removeByIds(ids));
}
}
@@ -1,178 +0,0 @@
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;
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.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;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
/**
* 任务巡查记录Controller
*
* @author ruoyi
* @date 2024-03-28
*/
@RestController
@RequestMapping("/cxxm/taskCheck")
public class TaskCheckController extends BaseController {
@Autowired
private ITaskCheckService taskCheckService;
@Autowired
private ITaskService taskService;
@Autowired
private ITaskCheckImageService taskCheckImageService;
@Autowired
private ITaskCheckVideoService taskCheckVideoService;
@Autowired
private ITbxxService tbxxService;
@Autowired
private ITaskCheckAuditService taskCheckAuditService;
/**
* 查询任务巡查记录列表
*/
@PreAuthorize("@ss.hasPermi('cxxm:taskCheck:list')")
@GetMapping("/list")
public TableDataInfo list(TaskCheck taskCheck, PageDomain pageDomain) {
startPage();
List<TaskCheck> list = taskCheckService.list(new QueryWrapper<>(taskCheck));
return getDataTable(list);
}
/**
* 导出任务巡查记录列表
*/
@PreAuthorize("@ss.hasPermi('cxxm:taskCheck:export')")
@Log(title = "任务巡查记录导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TaskCheck taskCheck) {
List<TaskCheck> list = taskCheckService.list(new QueryWrapper<>(taskCheck));
ExcelUtil<TaskCheck> util = new ExcelUtil<TaskCheck>(TaskCheck.class);
util.exportExcel(response, list, "任务巡查记录数据");
}
/**
* 根据taskId获取任务巡查记录详细信息
*/
@PreAuthorize("@ss.hasPermi('cxxm:taskCheck:query')")
@GetMapping(value = "/{taskId}")
public AjaxResult getInfoByTaskId(@PathVariable("taskId") Long taskId) {
TaskCheckSubmitVo taskCheckSubmitVo = taskCheckService.getTaskCheckSubmitVo(taskId);
return AjaxResult.success(taskCheckSubmitVo);
}
/**
* 新增任务巡查记录
*/
@PreAuthorize("@ss.hasPermi('cxxm:taskCheck:add')")
@Log(title = "任务巡查记录填报", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(MultipartHttpServletRequest request, List<MultipartFile> files) throws IOException {
String taskCheckSubmitStr = request.getParameter("taskCheckSubmit");
TaskCheckSubmit taskCheckSubmit = JSONObject.parseObject(taskCheckSubmitStr, TaskCheckSubmit.class);
taskCheckService.saveTaskCheckSubmitAndFiles(taskCheckSubmit, files);
return AjaxResult.success();
}
/**
* 修改任务巡查记录
*/
@PreAuthorize("@ss.hasPermi('cxxm:taskCheck:edit')")
@Log(title = "任务巡查记录修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(MultipartHttpServletRequest request, List<MultipartFile> files) throws IOException {
String taskCheckSubmitStr = request.getParameter("taskCheckSubmit");
TaskCheckSubmit taskCheckSubmit = JSONObject.parseObject(taskCheckSubmitStr, TaskCheckSubmit.class);
taskCheckService.saveTaskCheckSubmitAndFiles(taskCheckSubmit, files);
return AjaxResult.success();
}
/**
* 删除任务巡查记录
*/
@PreAuthorize("@ss.hasPermi('cxxm:taskCheck:remove')")
@Log(title = "任务巡查记录删除", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(taskCheckService.removeByIds(ids));
}
/**
* 上报任务巡查记录
*/
@PreAuthorize("@ss.hasPermi('cxxm:taskCheck:edit')")
@Log(title = "任务巡查记录上报", businessType = BusinessType.UPDATE)
@PutMapping("/report/{tcId}")
public AjaxResult report(@PathVariable Long tcId) {
return toAjax(taskCheckService.reportTaskCheckInfo(tcId));
}
/**
* 取消上报任务巡查记录
*/
@PreAuthorize("@ss.hasPermi('cxxm:taskCheck:edit')")
@Log(title = "任务巡查记录上报", businessType = BusinessType.UPDATE)
@PutMapping("/cancelReport/{tcId}")
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);
}
}
@@ -1,329 +0,0 @@
package com.ruoyi.web.controller.cxxm;
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;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.cxxm.domain.Task;
import com.ruoyi.cxxm.service.ITaskService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/**
* 任务Controller
*
* @author ruoyi
* @date 2024-03-28
*/
@RestController
@RequestMapping("/cxxm/task")
public class TaskController extends BaseController {
@Autowired
private ITaskService taskService;
@Autowired
private ITbxxService tbxxService;
@Autowired
private DeptMapper deptMapper;
/**
* 查询任务列表
*/
@PreAuthorize("@ss.hasPermi('cxxm:task:list')")
@GetMapping("/list")
public TableDataInfo list(TaskQuery task, PageDomain pageDomain) {
startPage();
LambdaQueryWrapper<Task> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(Objects.nonNull(task.getTbbh()), Task::getTbbh, task.getTbbh());
queryWrapper.eq(Objects.nonNull(task.getXfqk()), Task::getXfqk, task.getXfqk());
queryWrapper.eq(Objects.nonNull(task.getRwlx()), Task::getRwlx, task.getRwlx());
queryWrapper.in(Objects.nonNull(task.getDeptId()), Task::getDeptId, deptMapper.getAllAncestorsByDeptId(task.getDeptId()));
List<String> drsjQuery = task.getDrsjQuery();
if (drsjQuery != null && drsjQuery.size() == 2) {
queryWrapper.apply(StringUtils.format("DATE_FORMAT(drsj, '%Y-%m') between '{}' and '{}'",
drsjQuery.get(0), drsjQuery.get(1)));
}
queryWrapper.orderByAsc(Task::getXfqk);
queryWrapper.orderByDesc(Task::getXfsj);
queryWrapper.orderByDesc(Task::getDrsj);
List<Task> list = taskService.list(queryWrapper);
return getDataTable(list);
}
/**
* 导出任务列表
*/
@PreAuthorize("@ss.hasPermi('cxxm:task:export')")
@Log(title = "任务", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Task task) {
List<Task> list = taskService.list(new QueryWrapper<>(task));
ExcelUtil<Task> util = new ExcelUtil<Task>(Task.class);
util.exportExcel(response, list, "任务数据");
}
/**
* 获取任务详细信息
*/
@PreAuthorize("@ss.hasPermi('cxxm:task:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
Task task = taskService.getById(id);
Tbxx tbxx = tbxxService.selectTbxxByTbbh(task.getTbbh());
TaskDetailVo taskDetailVo = new TaskDetailVo();
BeanUtils.copyProperties(task, taskDetailVo);
taskDetailVo.setTbxx(tbxx);
return AjaxResult.success(taskDetailVo);
}
/**
* 新增任务
*/
@PreAuthorize("@ss.hasPermi('cxxm:task:add')")
@Log(title = "任务", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Task task) {
return toAjax(taskService.save(task));
}
/**
* 修改任务
*/
@PreAuthorize("@ss.hasPermi('cxxm:task:edit')")
@Log(title = "任务", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Task task) {
return toAjax(taskService.updateById(task));
}
/**
* 删除任务
*/
@PreAuthorize("@ss.hasPermi('cxxm:task:remove')")
@Log(title = "任务", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable List<Long> ids) {
return toAjax(taskService.removeTaskAndTbxxByTaskIds(ids));
}
/**
* 导入任务
*
* @param file
* @param rwlx
* @return
* @throws Exception
*/
@Log(title = "导入任务", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('cxxm:task:import')")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, String rwlx) throws Exception {
try (InputStream inputStream = file.getInputStream()) {
// 读取数据
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
StringBuilder content = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
content.append(line);
}
// 解析数据
Map map = JSONObject.parseObject(content.toString(), Map.class);
Object features = map.get("features");
List importData = JSONObject.parseObject(features.toString(), List.class);
List<String> failTbbhList = new ArrayList<>();
for (Object data : importData) {
Map item = JSONObject.parseObject(data.toString(), Map.class);
Tbxx tbxx = new Tbxx();
// 图斑空间数据
Object geometry = item.get("geometry");
tbxx.setGis(geometry.toString());
// 图斑信息
Object properties = item.get("properties");
Map tbxxMap = JSONObject.parseObject(properties.toString(), Map.class);
tbxx.setTbbh(tbxxMap.get("KCTBBH") != null ? tbxxMap.get("KCTBBH").toString() : "");
tbxx.setKsmc(tbxxMap.get("KMMC") != null ? tbxxMap.get("KMMC").toString() : "");
tbxx.setXkzbh(tbxxMap.get("KMXKZ") != null ? tbxxMap.get("KMXKZ").toString() : "");
tbxx.setKqjb(tbxxMap.get("KQJB") != null ? tbxxMap.get("KQJB").toString() : "");
tbxx.setSheng(tbxxMap.get("SHENG") != null ? tbxxMap.get("SHENG").toString() : "");
tbxx.setShi(tbxxMap.get("SHI") != null ? tbxxMap.get("SHI").toString() : "");
tbxx.setXian(tbxxMap.get("XIAN") != null ? tbxxMap.get("XIAN").toString() : "");
tbxx.setXdm(tbxxMap.get("XDM") != null ? tbxxMap.get("XDM").toString() : "");
tbxx.setXxdz(tbxxMap.get("KMDZ") != null ? tbxxMap.get("KMDZ").toString() : "");
tbxx.setJjlx(tbxxMap.get("KMJJLX") != null ? tbxxMap.get("KMJJLX").toString() : "");
tbxx.setKzlx(tbxxMap.get("KMLX") != null ? tbxxMap.get("KMLX").toString() : "");
tbxx.setKcqtkz(tbxxMap.get("KMQTKZ") != null ? tbxxMap.get("KMQTKZ").toString() : "");
tbxx.setKcfs(tbxxMap.get("KMKCFS") != null ? tbxxMap.get("KMKCFS").toString() : "");
tbxx.setKczt(tbxxMap.get("KMKCZT") != null ? tbxxMap.get("KMKCZT").toString() : "");
tbxx.setZdmj(tbxxMap.get("KMZDMJ") != null ? tbxxMap.get("KMZDMJ").toString() : "");
tbxx.setWfmj(tbxxMap.get("KMWFMJ") != null ? tbxxMap.get("KMWFMJ").toString() : "");
tbxx.setX(tbxxMap.get("KMX") != null ? tbxxMap.get("KMX").toString() : "");
tbxx.setY(tbxxMap.get("KMY") != null ? tbxxMap.get("KMY").toString() : "");
tbxx.setCzwt(tbxxMap.get("KMCZWT") != null ? tbxxMap.get("KMCZWT").toString() : "");
tbxx.setSqtbbh(tbxxMap.get("SQTBBH") != null ? tbxxMap.get("SQTBBH").toString() : "");
tbxx.setBxftbbh(tbxxMap.get("BFTBBH") != null ? tbxxMap.get("BFTBBH").toString() : "");
tbxx.setBqsjsj(tbxxMap.get("BQSJSJ") != null ? tbxxMap.get("BQSJSJ").toString() : "");
tbxx.setSqsjsj(tbxxMap.get("SQSJSJ") != null ? tbxxMap.get("SQSJSJ").toString() : "");
tbxx.setLsks(tbxxMap.get("LKBH") != null ? tbxxMap.get("LKBH").toString() : "");
tbxx.setZdkqmc(tbxxMap.get("ZDKQMC") != null ? tbxxMap.get("ZDKQMC").toString() : "");
tbxx.setZrbhqmc(tbxxMap.get("BHQMC") != null ? tbxxMap.get("BHQMC").toString() : "");
tbxx.setGyhpmc(tbxxMap.get("GYHPMC") != null ? tbxxMap.get("GYHPMC").toString() : "");
tbxx.setGyhp03(tbxxMap.get("GYHP03") != null ? tbxxMap.get("GYHP03").toString() : "");
tbxx.setGyhp10(tbxxMap.get("GYHP10") != null ? tbxxMap.get("GYHP10").toString() : "");
tbxx.setCjgzmc(tbxxMap.get("CJGZMC") != null ? tbxxMap.get("CJGZMC").toString() : "");
tbxx.setCjgz03(tbxxMap.get("CJGZ03") != null ? tbxxMap.get("CJGZ03").toString() : "");
tbxx.setCjgzl10(tbxxMap.get("CJGZ10") != null ? tbxxMap.get("CJGZ10").toString() : "");
tbxx.setFjmsmc(tbxxMap.get("FJMSMC") != null ? tbxxMap.get("FJMSMC").toString() : "");
tbxx.setGjgymc(tbxxMap.get("GJGYMC") != null ? tbxxMap.get("GJGYMC").toString() : "");
tbxx.setYsydmc(tbxxMap.get("YSYDMC") != null ? tbxxMap.get("YSYDMC").toString() : "");
tbxx.setBz(tbxxMap.get("KFBZ") != null ? tbxxMap.get("KFBZ").toString() : "");
tbxx.setXsly(tbxxMap.get("XSLY") != null ? tbxxMap.get("XSLY").toString() : "");
// 导入图斑信息
// 判断图斑数据是否已经存在
LambdaQueryWrapper<Tbxx> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Tbxx::getTbbh, tbxx.getTbbh());
if (tbxxService.count(queryWrapper) == 0) {
taskService.importTaskByTbxx(tbxx, rwlx);
} else {
failTbbhList.add(tbxx.getTbbh());
}
}
// 统计导入结果
int total = importData.size();
int fail = failTbbhList.size();
int success = total - fail;
Map<String, Object> res = new HashMap<String, Object>();
res.put("total", total);
res.put("successCount", success);
res.put("failCount", fail);
res.put("failTbbhList", failTbbhList);
return success(res);
} catch (IOException e) {
// 处理异常
throw new IOException("文件上传失败");
}
}
/**
* 下发任务
*
* @param ids
* @return
*/
@ApiOperation("下发任务")
@PreAuthorize("@ss.hasPermi('cxxm:task:distribute')")
@Log(title = "任务", businessType = BusinessType.UPDATE)
@PutMapping("/distribute/{ids}")
public AjaxResult distribute(@PathVariable Long[] ids) {
List<Task> taskList = new ArrayList<>();
for (Long id : ids) {
Task task = new Task();
task.setId(id);
task.setXfqk(XFQK.YXF.getValue());
task.setXfsj(DateUtils.getNowDate());
taskList.add(task);
}
return toAjax(taskService.updateBatchById(taskList));
}
/**
* 查询任务巡查情况列表
*/
@PreAuthorize("@ss.hasPermi('cxxm:task:list')")
@GetMapping("/distributed/list")
public TableDataInfo distributedList(TaskQuery task, PageDomain pageDomain) {
startPage();
LambdaQueryWrapper<Task> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(Objects.nonNull(task.getTbbh()), Task::getTbbh, task.getTbbh());
queryWrapper.eq(Task::getXfqk, XFQK.YXF.getValue());
queryWrapper.eq(Objects.nonNull(task.getRwlx()), Task::getRwlx, task.getRwlx());
queryWrapper.in(Objects.nonNull(task.getDeptId()), Task::getDeptId, deptMapper.getAllAncestorsByDeptId(task.getDeptId()));
List<String> drsjQuery = task.getDrsjQuery();
if (drsjQuery != null && drsjQuery.size() == 2) {
queryWrapper.apply(StringUtils.format("DATE_FORMAT(drsj, '%Y-%m') between '{}' and '{}'",
drsjQuery.get(0), drsjQuery.get(1)));
}
queryWrapper.orderByAsc(Task::getXfqk);
queryWrapper.orderByDesc(Task::getXfsj);
queryWrapper.orderByDesc(Task::getDrsj);
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);
// }
}
@@ -1,38 +0,0 @@
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);
}
}
@@ -57,9 +57,9 @@ spring:
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
max-file-size: 256MB
# 设置总上传的文件大小
max-request-size: 20MB
max-request-size: 512MB
# 服务模块
devtools:
restart: