fix
This commit is contained in:
parent
53fa8a059c
commit
2c79d3c37e
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.cxxm.controller.app;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
@ -86,6 +87,50 @@ public class AppTaskController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目名称列表
|
||||
*
|
||||
* @param pageDomain
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询项目名称列表")
|
||||
@GetMapping("/xmmc/list")
|
||||
public TableDataInfo xmmcList(TaskQuery taskQuery, PageDomain pageDomain) {
|
||||
// 参数设置
|
||||
if(taskQuery.getDeptId() == null){
|
||||
taskQuery.setDeptId(getDeptId());
|
||||
}
|
||||
if (getLoginUser().getUser().getRoles().get(0).getRoleName().equals("外业调查员")) {
|
||||
taskQuery.setToId(getUserId());
|
||||
}
|
||||
if (taskQuery.getZjxfqk() == null || taskQuery.getZjxfqk().equals("")) {
|
||||
taskQuery.setZjxfqk("1");
|
||||
}
|
||||
// 分发
|
||||
if (Objects.equals(taskQuery.getRwlx(), "1")) {
|
||||
taskQuery.setRwlx(null);
|
||||
ZftkTaskQuery zftkTaskQuery = new ZftkTaskQuery();
|
||||
BeanUtils.copyProperties(taskQuery, zftkTaskQuery);
|
||||
IPage<Map<String, Object>> page = taskService.getXmmcList2(zftkTaskQuery, pageDomain);
|
||||
return getDataTableByPage((Page<?>) page);
|
||||
} else if (Objects.equals(taskQuery.getRwlx(), "2")) {
|
||||
taskQuery.setRwlx(null);
|
||||
ZttbTaskQuery zttbTaskQuery = new ZttbTaskQuery();
|
||||
BeanUtils.copyProperties(taskQuery, zttbTaskQuery);
|
||||
IPage<Map<String, Object>> page = zttbTaskService.getXmmcList2(zttbTaskQuery, pageDomain);
|
||||
return getDataTableByPage((Page<?>) page);
|
||||
} else if (Objects.equals(taskQuery.getRwlx(), "0")) {
|
||||
taskQuery.setRwlx(null);
|
||||
ZtTaskQuery ztTaskQuery = new ZtTaskQuery();
|
||||
BeanUtils.copyProperties(taskQuery, ztTaskQuery);
|
||||
IPage<Map<String, Object>> page = ztTaskService.getXmmcList2(ztTaskQuery, pageDomain);
|
||||
return getDataTableByPage((Page<?>) page);
|
||||
}
|
||||
return getDataTableByPage(new Page<>());
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取任务详细信息
|
||||
*/
|
||||
@ -189,23 +234,24 @@ public class AppTaskController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation("查询年份列表")
|
||||
@GetMapping("/nian/list")
|
||||
public AjaxResult nianList(String rwlx) {
|
||||
public AjaxResult nianList(String rwlx,String xmmc) {
|
||||
if (rwlx.equals("1")) {
|
||||
List<Map<String, Object>> nianList = taskService.getNianList();
|
||||
List<Map<String, Object>> nianList = taskService.getNianList(xmmc);
|
||||
return success(this.handleNianRes(nianList));
|
||||
} else if (rwlx.equals("2")) {
|
||||
List<Map<String, Object>> nianList = zttbTaskService.getNianList();
|
||||
List<Map<String, Object>> nianList = zttbTaskService.getNianList(xmmc);
|
||||
return success(this.handleNianRes(nianList));
|
||||
} else if (rwlx.equals("0")) {
|
||||
List<Map<String, Object>> nianList = ztTaskService.getNianList();
|
||||
List<Map<String, Object>> nianList = ztTaskService.getNianList(xmmc);
|
||||
return success(this.handleNianRes(nianList));
|
||||
}
|
||||
return success();
|
||||
}
|
||||
|
||||
|
||||
private List handleNianRes(List<Map<String, Object>> nianList){
|
||||
List<Object> res = new ArrayList<>();
|
||||
for (Map nian : nianList) {
|
||||
|
@ -1,18 +1,19 @@
|
||||
package com.ruoyi.cxxm.controller.web;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.io.OutputStream;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||
import com.ruoyi.cxxm.domain.entity.TaskGis;
|
||||
import com.ruoyi.cxxm.domain.entity.zftk.*;
|
||||
import com.ruoyi.cxxm.domain.entity.zt.ZtTask;
|
||||
import com.ruoyi.cxxm.domain.entity.zt.ZtTaskQuery;
|
||||
@ -127,6 +128,70 @@ public class ZftkTaskController extends BaseController {
|
||||
this.handleExport(list, response);
|
||||
}
|
||||
|
||||
@ApiOperation("导出任务GeoJson")
|
||||
@Log(title = "导出任务GeoJson", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportGeoJson/{ids}")
|
||||
public void exportGeoJson(HttpServletResponse response, @PathVariable List<Long> ids){
|
||||
// 获取数据
|
||||
List<ZftkTask> list = taskService.lambdaQuery().in(ZftkTask::getId, ids).list();
|
||||
this.handleExportGeoJson(list, response);
|
||||
}
|
||||
|
||||
@ApiOperation("导出任务GeoJson")
|
||||
@Log(title = "导出任务GeoJson", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportGeoJsonByXmmcs/{xmmcs}")
|
||||
public void exportGeoJsonByXmmcs(HttpServletResponse response, @PathVariable List<String> xmmcs) {
|
||||
// 获取数据
|
||||
List<ZftkTask> list = taskService.lambdaQuery().in(ZftkTask::getXmmc, xmmcs).list();
|
||||
this.handleExportGeoJson(list, response);
|
||||
}
|
||||
|
||||
private void handleExportGeoJson(List<ZftkTask> list,HttpServletResponse response){
|
||||
// 组织数据
|
||||
Map<String, Object> resMap = new LinkedHashMap<>();
|
||||
resMap.put("type", "FeatureCollection");
|
||||
Map<String, Object> crsMap = new LinkedHashMap<>();
|
||||
crsMap.put("type", "name");
|
||||
Map<String, Object> propertiesMap = new LinkedHashMap<>();
|
||||
propertiesMap.put("name", "EPSG:4326");
|
||||
crsMap.put("properties", propertiesMap);
|
||||
resMap.put("crs", crsMap);
|
||||
ArrayList<Object> featuresList = new ArrayList<>();
|
||||
//TODO
|
||||
for (ZftkTask zftkTask : list) {
|
||||
TaskGis taskGis = taskService.selectTaskGisById(zftkTask.getId());
|
||||
Map map = JSON.parseObject(taskGis.getGis(), Map.class);
|
||||
Map<String, Object> featureMap = new LinkedHashMap<>();
|
||||
featureMap.put("type", "Feature");
|
||||
featureMap.put("id", zftkTask.getId());
|
||||
featureMap.put("geometry", map);
|
||||
Map propertiesTemp = JSON.parseObject(JSON.toJSONString(zftkTask), Map.class);
|
||||
Map<String, Object> propertiesMap2 = new LinkedHashMap<>();
|
||||
for (Object o : propertiesTemp.entrySet()) {
|
||||
Map.Entry<String,Object> entry = (Map.Entry) o;
|
||||
String upperCaseKey = entry.getKey().toUpperCase();
|
||||
if(upperCaseKey.equals("NIAN")) upperCaseKey="NF";
|
||||
if(upperCaseKey.equals("XIAN")) upperCaseKey="XMC";
|
||||
if(upperCaseKey.equals("CSMC")) upperCaseKey="CJDCQ";
|
||||
if(upperCaseKey.equals("TBBH")) upperCaseKey="JCBH";
|
||||
if(upperCaseKey.equals("TBMJ")) upperCaseKey="JCMJ";
|
||||
propertiesMap2.put(upperCaseKey, entry.getValue());
|
||||
}
|
||||
featureMap.put("properties", propertiesMap2);
|
||||
featuresList.add(featureMap);
|
||||
}
|
||||
resMap.put("features", featuresList);
|
||||
// 设置响应头
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
try(OutputStream outputStream = response.getOutputStream()){
|
||||
// 使用springboot的Jackson库进行序列化
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.writerWithDefaultPrettyPrinter().writeValue(outputStream , resMap);
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void handleExport(List<ZftkTask> list,HttpServletResponse response){
|
||||
ArrayList<ZftkTaskExport> zftkTaskExports = new ArrayList<>();
|
||||
|
@ -1,8 +1,10 @@
|
||||
package com.ruoyi.cxxm.controller.web;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
@ -12,7 +14,9 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.cxxm.domain.entity.TaskGis;
|
||||
import com.ruoyi.cxxm.domain.entity.zftk.ZftkTask;
|
||||
import com.ruoyi.cxxm.domain.entity.zt.*;
|
||||
import com.ruoyi.cxxm.domain.entity.zttb.ZttbTask;
|
||||
@ -26,10 +30,9 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -120,7 +123,73 @@ public class ZtTaskController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
private void handleExport(List<ZtTask> list,HttpServletResponse response){
|
||||
|
||||
@ApiOperation("导出任务GeoJson")
|
||||
@Log(title = "导出任务GeoJson", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportGeoJson/{ids}")
|
||||
public void exportGeoJson(HttpServletResponse response, @PathVariable List<Long> ids){
|
||||
// 获取数据
|
||||
List<ZtTask> list = taskService.lambdaQuery().in(ZtTask::getId, ids).list();
|
||||
this.handleExportGeoJson(list, response);
|
||||
}
|
||||
|
||||
@ApiOperation("导出任务GeoJson")
|
||||
@Log(title = "导出任务GeoJson", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportGeoJsonByXmmcs/{xmmcs}")
|
||||
public void exportGeoJsonByXmmcs(HttpServletResponse response, @PathVariable List<String> xmmcs) {
|
||||
// 获取数据
|
||||
List<ZtTask> list = taskService.lambdaQuery().in(ZtTask::getXmmc, xmmcs).list();
|
||||
this.handleExportGeoJson(list, response);
|
||||
}
|
||||
|
||||
private void handleExportGeoJson(List<ZtTask> list, HttpServletResponse response) {
|
||||
// 组织数据
|
||||
Map<String, Object> resMap = new LinkedHashMap<>();
|
||||
resMap.put("type", "FeatureCollection");
|
||||
Map<String, Object> crsMap = new LinkedHashMap<>();
|
||||
crsMap.put("type", "name");
|
||||
Map<String, Object> propertiesMap = new LinkedHashMap<>();
|
||||
propertiesMap.put("name", "EPSG:4326");
|
||||
crsMap.put("properties", propertiesMap);
|
||||
resMap.put("crs", crsMap);
|
||||
ArrayList<Object> featuresList = new ArrayList<>();
|
||||
//TODO
|
||||
for (ZtTask ztTask : list) {
|
||||
TaskGis taskGis = taskService.selectTaskGisById(ztTask.getId());
|
||||
Map map = JSON.parseObject(taskGis.getGis(), Map.class);
|
||||
Map<String, Object> featureMap = new LinkedHashMap<>();
|
||||
featureMap.put("type", "Feature");
|
||||
featureMap.put("id", ztTask.getId());
|
||||
featureMap.put("geometry", map);
|
||||
Map propertiesTemp = JSON.parseObject(JSON.toJSONString(ztTask), Map.class);
|
||||
Map<String, Object> propertiesMap2 = new LinkedHashMap<>();
|
||||
for (Object o : propertiesTemp.entrySet()) {
|
||||
Map.Entry<String,Object> entry = (Map.Entry) o;
|
||||
String upperCaseKey = entry.getKey().toUpperCase();
|
||||
if(upperCaseKey.equals("NIAN")) upperCaseKey="NF";
|
||||
if(upperCaseKey.equals("XIAN")) upperCaseKey="XMC";
|
||||
if(upperCaseKey.equals("CSMC")) upperCaseKey="CJDCQ";
|
||||
if(upperCaseKey.equals("TBBH")) upperCaseKey="JCBH";
|
||||
if(upperCaseKey.equals("TBMJ")) upperCaseKey="JCMJ";
|
||||
propertiesMap2.put(upperCaseKey, entry.getValue());
|
||||
}
|
||||
featureMap.put("properties", propertiesMap2);
|
||||
featuresList.add(featureMap);
|
||||
}
|
||||
resMap.put("features", featuresList);
|
||||
// 设置响应头
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
try(OutputStream outputStream = response.getOutputStream()){
|
||||
// 使用springboot的Jackson库进行序列化
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.writerWithDefaultPrettyPrinter().writeValue(outputStream , resMap);
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void handleExport(List<ZtTask> list, HttpServletResponse response) {
|
||||
ArrayList<ZtTaskExport> ztTaskExports = new ArrayList<>();
|
||||
for (ZtTask task : list) {
|
||||
ZtTaskExport ztTaskExport = new ZtTaskExport();
|
||||
@ -362,14 +431,14 @@ public class ZtTaskController extends BaseController {
|
||||
}
|
||||
|
||||
@GetMapping("/next")
|
||||
public AjaxResult getNextId(ZtTaskQuery task){
|
||||
public AjaxResult getNextId(ZtTaskQuery task) {
|
||||
Long nextId = this.taskService.getNextId(task);
|
||||
Object res = Objects.nonNull(nextId) ? taskService.getTaskDetail(nextId) : null;
|
||||
return AjaxResult.success(res);
|
||||
}
|
||||
|
||||
@GetMapping("/prev")
|
||||
public AjaxResult getPrevId(ZtTaskQuery task){
|
||||
public AjaxResult getPrevId(ZtTaskQuery task) {
|
||||
Long prevId = this.taskService.getPrevId(task);
|
||||
Object res = Objects.nonNull(prevId) ? taskService.getTaskDetail(prevId) : null;
|
||||
return AjaxResult.success(res);
|
||||
|
@ -1,20 +1,21 @@
|
||||
package com.ruoyi.cxxm.controller.web;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||
import com.ruoyi.cxxm.domain.entity.TaskGis;
|
||||
import com.ruoyi.cxxm.domain.entity.zftk.*;
|
||||
import com.ruoyi.cxxm.domain.entity.zt.ZtTask;
|
||||
import com.ruoyi.cxxm.domain.entity.zttb.*;
|
||||
@ -123,6 +124,72 @@ public class ZttbTaskController extends BaseController {
|
||||
this.handleExport(list, response);
|
||||
}
|
||||
|
||||
@ApiOperation("导出任务GeoJson")
|
||||
@Log(title = "导出任务GeoJson", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportGeoJsonByXmmcs/{xmmcs}")
|
||||
public void exportGeoJsonByXmmcs(HttpServletResponse response, @PathVariable List<String> xmmcs) {
|
||||
// 获取数据
|
||||
List<ZttbTask> list = taskService.lambdaQuery().in(ZttbTask::getXmmc, xmmcs).list();
|
||||
this.handleExportGeoJson(list, response);
|
||||
}
|
||||
|
||||
@ApiOperation("导出任务GeoJson")
|
||||
@Log(title = "导出任务GeoJson", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportGeoJson/{ids}")
|
||||
public void exportGeoJson(HttpServletResponse response, @PathVariable List<Long> ids){
|
||||
// 获取数据
|
||||
List<ZttbTask> list = taskService.lambdaQuery().in(ZttbTask::getId, ids).list();
|
||||
this.handleExportGeoJson(list, response);
|
||||
}
|
||||
|
||||
private void handleExportGeoJson(List<ZttbTask> list, HttpServletResponse response) {
|
||||
// 组织数据
|
||||
Map<String, Object> resMap = new LinkedHashMap<>();
|
||||
resMap.put("type", "FeatureCollection");
|
||||
Map<String, Object> crsMap = new LinkedHashMap<>();
|
||||
crsMap.put("type", "name");
|
||||
Map<String, Object> propertiesMap = new LinkedHashMap<>();
|
||||
propertiesMap.put("name", "EPSG:4326");
|
||||
crsMap.put("properties", propertiesMap);
|
||||
resMap.put("crs", crsMap);
|
||||
ArrayList<Object> featuresList = new ArrayList<>();
|
||||
//TODO
|
||||
for (ZttbTask zttbTask : list) {
|
||||
TaskGis taskGis = taskService.selectTaskGisById(zttbTask.getId());
|
||||
Map map = JSON.parseObject(taskGis.getGis(), Map.class);
|
||||
Map<String, Object> featureMap = new LinkedHashMap<>();
|
||||
featureMap.put("type", "Feature");
|
||||
featureMap.put("id", zttbTask.getId());
|
||||
featureMap.put("geometry", map);
|
||||
Map propertiesTemp = JSON.parseObject(JSON.toJSONString(zttbTask), Map.class);
|
||||
Map<String, Object> propertiesMap2 = new LinkedHashMap<>();
|
||||
for (Object o : propertiesTemp.entrySet()) {
|
||||
Map.Entry<String,Object> entry = (Map.Entry) o;
|
||||
String upperCaseKey = entry.getKey().toUpperCase();
|
||||
if(upperCaseKey.equals("NIAN")) upperCaseKey="NF";
|
||||
if(upperCaseKey.equals("XIAN")) upperCaseKey="XMC";
|
||||
if(upperCaseKey.equals("CSMC")) upperCaseKey="CJDCQ";
|
||||
if(upperCaseKey.equals("TBBH")) upperCaseKey="JCBH";
|
||||
if(upperCaseKey.equals("TBMJ")) upperCaseKey="JCMJ";
|
||||
propertiesMap2.put(upperCaseKey, entry.getValue());
|
||||
}
|
||||
featureMap.put("properties", propertiesMap2);
|
||||
featuresList.add(featureMap);
|
||||
}
|
||||
resMap.put("features", featuresList);
|
||||
// 设置响应头
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
try(OutputStream outputStream = response.getOutputStream()){
|
||||
// 使用springboot的Jackson库进行序列化
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.writerWithDefaultPrettyPrinter().writeValue(outputStream , resMap);
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void handleExport(List<ZttbTask> list, HttpServletResponse response) {
|
||||
ArrayList<ZttbTaskExport> zttbTaskExports = new ArrayList<>();
|
||||
for (ZttbTask task : list) {
|
||||
|
@ -92,7 +92,7 @@ public interface IZftkTaskService extends IService<ZftkTask> {
|
||||
|
||||
public Long getPrevId(ZftkTaskQuery task);
|
||||
|
||||
public List<Map<String, Object>> getNianList();
|
||||
public List<Map<String, Object>> getNianList(String xmmc);
|
||||
|
||||
public List<Map<String, Object>> getXzmcList(Long deptId);
|
||||
|
||||
|
@ -92,7 +92,7 @@ public interface IZtTaskService extends IService<ZtTask> {
|
||||
|
||||
public Long getPrevId(ZtTaskQuery task);
|
||||
|
||||
public List<Map<String, Object>> getNianList();
|
||||
public List<Map<String, Object>> getNianList(String xmmc);
|
||||
|
||||
public List<Map<String, Object>> getXzmcList(Long deptId);
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ public interface IZttbTaskService extends IService<ZttbTask> {
|
||||
|
||||
public Long getPrevId(ZttbTaskQuery task);
|
||||
|
||||
public List<Map<String, Object>> getNianList();
|
||||
public List<Map<String, Object>> getNianList(String xmmc);
|
||||
|
||||
public List<Map<String, Object>> getXzmcList(Long deptId);
|
||||
}
|
||||
|
@ -585,13 +585,14 @@ public class ZftkTaskServiceImpl extends ServiceImpl<ZftkTaskMapper, ZftkTask> i
|
||||
LambdaQueryWrapper<ZftkTask> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.select(ZftkTask::getId);
|
||||
queryWrapper.lt(ZftkTask::getId, task.getId()).eq(ZftkTask::getXmmc, task.getXmmc() != null ? task.getXmmc() : "").last("limit 1");
|
||||
queryWrapper.orderByDesc(ZftkTask::getId);
|
||||
ZftkTask one = this.getOne(queryWrapper);
|
||||
return Objects.nonNull(one) ? one.getId() : null;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getNianList(){
|
||||
public List<Map<String, Object>> getNianList(String xmmc){
|
||||
LambdaQueryWrapper<ZftkTask> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.select(ZftkTask::getNian).groupBy(ZftkTask::getNian);
|
||||
queryWrapper.select(ZftkTask::getNian).groupBy(ZftkTask::getNian).eq(Objects.nonNull(xmmc),ZftkTask::getXmmc,xmmc);
|
||||
return taskMapper.selectMaps(queryWrapper);
|
||||
}
|
||||
|
||||
|
@ -569,13 +569,14 @@ public class ZtTaskServiceImpl extends ServiceImpl<ZtTaskMapper, ZtTask> impleme
|
||||
LambdaQueryWrapper<ZtTask> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.select(ZtTask::getId);
|
||||
queryWrapper.lt(ZtTask::getId, task.getId()).eq(ZtTask::getXmmc, task.getXmmc() != null ? task.getXmmc() : "").last("limit 1");
|
||||
queryWrapper.orderByDesc(ZtTask::getId);
|
||||
ZtTask one = this.getOne(queryWrapper);
|
||||
return Objects.nonNull(one) ? one.getId() : null;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getNianList() {
|
||||
public List<Map<String, Object>> getNianList(String xmmc) {
|
||||
LambdaQueryWrapper<ZtTask> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.select(ZtTask::getNian).groupBy(ZtTask::getNian);
|
||||
queryWrapper.select(ZtTask::getNian).groupBy(ZtTask::getNian).eq(Objects.nonNull(xmmc),ZtTask::getXmmc,xmmc);
|
||||
return taskMapper.selectMaps(queryWrapper);
|
||||
}
|
||||
|
||||
|
@ -569,14 +569,15 @@ public class ZttbTaskServiceImpl extends ServiceImpl<ZttbTaskMapper, ZttbTask> i
|
||||
LambdaQueryWrapper<ZttbTask> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.select(ZttbTask::getId);
|
||||
queryWrapper.lt(ZttbTask::getId, task.getId()).eq(ZttbTask::getXmmc, task.getXmmc() != null ? task.getXmmc() : "").last("limit 1");
|
||||
queryWrapper.orderByDesc(ZttbTask::getId);
|
||||
ZttbTask one = this.getOne(queryWrapper);
|
||||
return Objects.nonNull(one) ? one.getId() : null;
|
||||
}
|
||||
|
||||
|
||||
public List<Map<String, Object>> getNianList(){
|
||||
public List<Map<String, Object>> getNianList(String xmmc){
|
||||
LambdaQueryWrapper<ZttbTask> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.select(ZttbTask::getNian).groupBy(ZttbTask::getNian);
|
||||
queryWrapper.select(ZttbTask::getNian).groupBy(ZttbTask::getNian).eq(Objects.nonNull(xmmc),ZttbTask::getXmmc,xmmc);
|
||||
return taskMapper.selectMaps(queryWrapper);
|
||||
}
|
||||
|
||||
|
1
pom.xml
1
pom.xml
@ -32,6 +32,7 @@
|
||||
<mybatis-plus.version>3.5.1</mybatis-plus.version>
|
||||
<lombok.version>1.18.32</lombok.version>
|
||||
<knife4j.version>3.0.3</knife4j.version>
|
||||
<geotools.version>24.7</geotools.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
|
@ -6,13 +6,11 @@ import java.util.Set;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.utils.PasswordValidator;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
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.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||
@ -25,12 +23,11 @@ import com.ruoyi.system.service.ISysMenuService;
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
public class SysLoginController
|
||||
{
|
||||
public class SysLoginController {
|
||||
@Autowired
|
||||
private SysLoginService loginService;
|
||||
|
||||
@ -48,29 +45,28 @@ public class SysLoginController
|
||||
|
||||
/**
|
||||
* 登录方法
|
||||
*
|
||||
*
|
||||
* @param loginBody 登录信息
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/login")
|
||||
public AjaxResult login(@RequestBody LoginBody loginBody)
|
||||
{
|
||||
public AjaxResult login(@RequestBody LoginBody loginBody) {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
// 生成令牌
|
||||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||
loginBody.getUuid());
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
ajax.put("weakPwd", PasswordValidator.isValidPassword(loginBody.getPassword(), loginBody.getUsername()) ? false : true);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*
|
||||
*
|
||||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping("getInfo")
|
||||
public AjaxResult getInfo()
|
||||
{
|
||||
public AjaxResult getInfo() {
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
// 角色集合
|
||||
Set<String> roles = permissionService.getRolePermission(user);
|
||||
@ -83,30 +79,35 @@ public class SysLoginController
|
||||
return ajax;
|
||||
}
|
||||
|
||||
@PostMapping("checkWeakPwd")
|
||||
public AjaxResult checkWeakPwd(@RequestBody LoginBody loginBody) {
|
||||
PasswordValidator.isValidPasswordApi(loginBody.getPassword());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取路由信息
|
||||
*
|
||||
*
|
||||
* @return 路由信息
|
||||
*/
|
||||
@GetMapping("getRouters")
|
||||
public AjaxResult getRouters()
|
||||
{
|
||||
public AjaxResult getRouters() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
||||
// 设置菜单不可见
|
||||
SysUser user = userService.selectUserById(userId);
|
||||
String taskLx = user.getTaskLx();
|
||||
if(!taskLx.isEmpty()){
|
||||
if (!taskLx.isEmpty()) {
|
||||
String[] taskLxList = taskLx.split(",");
|
||||
SysDictData sysDictData = new SysDictData();
|
||||
sysDictData.setDictType("task_lx");
|
||||
List<SysDictData> sysDictDataList = dictDataService.selectDictDataList(sysDictData);
|
||||
for (String item : taskLxList) {
|
||||
for (SysDictData dictData : sysDictDataList) {
|
||||
if (Objects.equals(item, dictData.getDictValue())){
|
||||
if (Objects.equals(item, dictData.getDictValue())) {
|
||||
for (SysMenu menu : menus) {
|
||||
System.out.println(dictData.getDictLabel()+"===="+menu.getMenuName());
|
||||
if (menu.getMenuName().equals(dictData.getDictLabel())){
|
||||
System.out.println(dictData.getDictLabel() + "====" + menu.getMenuName());
|
||||
if (menu.getMenuName().equals(dictData.getDictLabel())) {
|
||||
menu.setVisible("1");
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ spring:
|
||||
master:
|
||||
url: jdbc:mysql://ruoyi-mysql:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: 7ZH2jxM1
|
||||
password: xcr3k493
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
@ -42,13 +42,13 @@ spring:
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
enabled: false
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username: ruoyi
|
||||
login-password: 123456
|
||||
login-password: xcr3k493
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
|
@ -79,7 +79,7 @@ spring:
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
password: 7ZH2jxM1
|
||||
password: xcr3k493
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
|
@ -15,6 +15,7 @@
|
||||
common通用工具
|
||||
</description>
|
||||
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- Spring框架基本的核心工具 -->
|
||||
@ -156,6 +157,13 @@
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>3.2.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,130 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class PasswordValidator {
|
||||
|
||||
// 禁止使用的常见弱口令列表
|
||||
private static final String[] WEAK_PASSWORDS = {"123456@cxxm","123456", "password", "admin", "abc123", "qwerty"};
|
||||
|
||||
// 正则表达式模式
|
||||
private static final Pattern UPPERCASE_PATTERN = Pattern.compile("[A-Z]");
|
||||
private static final Pattern LOWERCASE_PATTERN = Pattern.compile("[a-z]");
|
||||
private static final Pattern DIGIT_PATTERN = Pattern.compile("[0-9]");
|
||||
private static final Pattern SPECIAL_CHAR_PATTERN = Pattern.compile("[!@#$%^&*()\\-_+=\\[\\]{}|;:,.<>/?]");
|
||||
|
||||
public static boolean isValidPasswordApi(String password){
|
||||
String userInfo =SecurityUtils.getUsername();
|
||||
// 检查是否为空或太短
|
||||
if (StringUtils.isEmpty(password) || password.length() < 8) {
|
||||
throw new RuntimeException("密码长度不能小于8位");
|
||||
}
|
||||
|
||||
// 检查是否包含用户信息
|
||||
if (StringUtils.isNotEmpty(userInfo) && password.toLowerCase().contains(userInfo.toLowerCase())) {
|
||||
throw new RuntimeException("密码不得包含用户信息");
|
||||
}
|
||||
|
||||
// 检查是否为常见弱口令
|
||||
for (String weakPassword : WEAK_PASSWORDS) {
|
||||
if (password.equals(weakPassword)) {
|
||||
throw new RuntimeException("密码不得包含常见弱口令");
|
||||
}
|
||||
}
|
||||
|
||||
// 检查是否包含重复字符或简单模式
|
||||
if (isSimplePattern(password)) {
|
||||
throw new RuntimeException("密码不得包含连续重复字符或简单模式");
|
||||
}
|
||||
|
||||
// 检查是否包含至少三种不同类型字符
|
||||
int charTypesCount = 0;
|
||||
if (UPPERCASE_PATTERN.matcher(password).find()) {
|
||||
charTypesCount++;
|
||||
}
|
||||
if (LOWERCASE_PATTERN.matcher(password).find()) {
|
||||
charTypesCount++;
|
||||
}
|
||||
if (DIGIT_PATTERN.matcher(password).find()) {
|
||||
charTypesCount++;
|
||||
}
|
||||
if (SPECIAL_CHAR_PATTERN.matcher(password).find()) {
|
||||
charTypesCount++;
|
||||
}
|
||||
if (charTypesCount < 3){
|
||||
throw new RuntimeException("密码必须包含至少三种不同类型字符");
|
||||
}
|
||||
return charTypesCount >= 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证密码强度
|
||||
*
|
||||
* @param password 待验证的密码
|
||||
* @param userInfo 用户信息,用于检查是否包含用户账号、姓名、工号、手机号、邮箱等
|
||||
* @return 如果密码强度足够则返回true,否则返回false
|
||||
*/
|
||||
public static boolean isValidPassword(String password, String userInfo){
|
||||
// 检查是否为空或太短
|
||||
if (StringUtils.isEmpty(password) || password.length() < 8) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查是否包含用户信息
|
||||
if (StringUtils.isNotEmpty(userInfo) && password.toLowerCase().contains(userInfo.toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查是否为常见弱口令
|
||||
for (String weakPassword : WEAK_PASSWORDS) {
|
||||
if (password.equals(weakPassword)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 检查是否包含重复字符或简单模式
|
||||
if (isSimplePattern(password)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查是否包含至少三种不同类型字符
|
||||
int charTypesCount = 0;
|
||||
if (UPPERCASE_PATTERN.matcher(password).find()) {
|
||||
charTypesCount++;
|
||||
}
|
||||
if (LOWERCASE_PATTERN.matcher(password).find()) {
|
||||
charTypesCount++;
|
||||
}
|
||||
if (DIGIT_PATTERN.matcher(password).find()) {
|
||||
charTypesCount++;
|
||||
}
|
||||
if (SPECIAL_CHAR_PATTERN.matcher(password).find()) {
|
||||
charTypesCount++;
|
||||
}
|
||||
return charTypesCount >= 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查密码是否包含重复字符或简单模式
|
||||
*
|
||||
* @param password 待检查的密码
|
||||
* @return 如果包含重复字符或简单模式则返回true,否则返回false
|
||||
*/
|
||||
private static boolean isSimplePattern(String password) {
|
||||
// 检查简单模式(这里仅作为示例,您可以根据需要扩展)
|
||||
if (password.matches("(.)\\1{2}") || password.matches("\\d+") || password.matches("[a-zA-Z]+")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// 测试密码校验
|
||||
String[] testPasswords = {"123456@cxxm", "abbbcd@@@", "StrongPasss1!", "A1b!2cD3", "123456", "password", "admin", "abc123", "qwerty"};
|
||||
String userInfo = "admin"; // 示例用户信息
|
||||
|
||||
for (String password : testPasswords) {
|
||||
System.out.println("Password: " + password + " is valid: " + isValidPassword(password, userInfo));
|
||||
}
|
||||
}
|
||||
}
|
@ -6,8 +6,15 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.file.Files;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
@Slf4j
|
||||
public class ResourceUtils {
|
||||
@ -30,4 +37,77 @@ public class ResourceUtils {
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 多文件下载
|
||||
*
|
||||
* @param files
|
||||
* @param zipFile
|
||||
* @param response
|
||||
*/
|
||||
public static void multiDownload(List<File> files,
|
||||
File zipFile,
|
||||
HttpServletResponse response) {
|
||||
|
||||
|
||||
response.reset();
|
||||
// 设置response的Header
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
//Content-Disposition的作用:告知浏览器以何种方式显示响应返回的文件,用浏览器打开还是以附件的形式下载到本地保存
|
||||
//attachment表示以附件方式下载 inline表示在线打开 "Content-Disposition: inline; filename=文件名.mp3"
|
||||
// filename表示文件的默认名称,因为网络传输只支持URL编码的相关支付,因此需要将文件名URL编码后进行传输,前端收到后需要反编码才能获取到真正的名称
|
||||
try {
|
||||
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(zipFile.getName(), "UTF-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 告知浏览器文件的大小
|
||||
|
||||
//设置响应格式,已文件流的方式返回给前端。
|
||||
response.setContentType("application/octet-stream");
|
||||
//生成压缩文件
|
||||
ZipMultiFile(files, zipFile);
|
||||
response.addHeader("Content-Length", String.valueOf(zipFile.length()));
|
||||
|
||||
try (ServletOutputStream sos = response.getOutputStream();
|
||||
BufferedInputStream bis = new BufferedInputStream(Files.newInputStream(zipFile.toPath()))) {
|
||||
byte[] buff = new byte[1024 * 10];
|
||||
int index;
|
||||
while ((index = bis.read(buff, 0, buff.length)) != -1) {
|
||||
sos.write(buff, 0, index);
|
||||
}
|
||||
sos.flush();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param files 需要压缩的文件列表
|
||||
* @param zipFile 压缩后的文件
|
||||
*/
|
||||
public static void ZipMultiFile(List<File> files, File zipFile) {
|
||||
try (ZipOutputStream zipOut = new ZipOutputStream(Files.newOutputStream(zipFile.toPath()))) {
|
||||
|
||||
for (File file : files) {
|
||||
try (FileInputStream fis = new FileInputStream(file);) {
|
||||
zipOut.putNextEntry(new ZipEntry(file.getName()));
|
||||
int temp;
|
||||
byte[] buf = new byte[1024];
|
||||
while ((temp = fis.read(buf)) != -1) {
|
||||
zipOut.write(buf, 0, temp);
|
||||
}
|
||||
zipOut.closeEntry();
|
||||
zipOut.flush();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -57,4 +57,4 @@ export function getCodeImg() {
|
||||
method: 'get',
|
||||
timeout: 20000
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,7 @@ export function delUser(userId) {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 用户密码重置
|
||||
export function resetUserPwd(userId, password) {
|
||||
const data = {
|
||||
@ -57,6 +58,17 @@ export function resetUserPwd(userId, password) {
|
||||
})
|
||||
}
|
||||
|
||||
export function checkWeakPwd(password) {
|
||||
const data = {
|
||||
password
|
||||
}
|
||||
return request({
|
||||
url: '/checkWeakPwd',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 用户状态修改
|
||||
export function changeUserStatus(userId, status) {
|
||||
const data = {
|
||||
|
@ -43,7 +43,7 @@ const user = {
|
||||
login(username, password, code, uuid).then(res => {
|
||||
setToken(res.token)
|
||||
commit('SET_TOKEN', res.token)
|
||||
resolve()
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
|
@ -55,6 +55,15 @@
|
||||
>{{ this.form.xzxfqk === '1' ? "改派" : "指派" }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleExportGeoJson"-->
|
||||
<!-- >导出矢量-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
@ -826,7 +835,13 @@ export default {
|
||||
} else {
|
||||
return "primary"
|
||||
}
|
||||
}
|
||||
},
|
||||
handleExportGeoJson() {
|
||||
const id = this.$route.query.id;
|
||||
this.download(`/cxxm/zftk/task/exportGeoJson/${id}`, {
|
||||
...this.queryParams
|
||||
},`执法踏勘_${this.form.xmmc}_${this.form.dkh}.json`)
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -112,6 +112,18 @@
|
||||
>导出全部
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="warning"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- v-if="showXmmcCheck"-->
|
||||
<!-- @click="handleExportGeoJsonByXmmcs"-->
|
||||
<!-- >导出矢量-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getTaskXmmcList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
@ -443,6 +455,16 @@ export default {
|
||||
...this.queryParams
|
||||
}, `执法踏勘_${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDate()}.xlsx`)
|
||||
},
|
||||
handleExportGeoJsonByXmmcs(row) {
|
||||
const xmmcs = row.xmmc || this.xmmcs;
|
||||
if (!xmmcs || xmmcs.indexOf('') !== -1) {
|
||||
this.$modal.msgError("存在项目类型为空的选项,无法按项目名类型导出");
|
||||
return;
|
||||
}
|
||||
this.download(`/cxxm/zftk/task/exportGeoJsonByXmmcs/${xmmcs}`, {
|
||||
...this.queryParams
|
||||
}, `执法踏勘_${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDate()}.json`)
|
||||
},
|
||||
handleExportAll() {
|
||||
this.download(`/cxxm/zftk/task/exportAll`, {
|
||||
...this.queryParams
|
||||
|
@ -55,6 +55,15 @@
|
||||
>{{ this.form.xzxfqk === '1' ? "改派" : "指派" }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleExportGeoJson"-->
|
||||
<!-- >导出矢量-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
@ -852,6 +861,12 @@ export default {
|
||||
return "primary"
|
||||
}
|
||||
},
|
||||
handleExportGeoJson() {
|
||||
const id = this.$route.query.id;
|
||||
this.download(`/cxxm/zt/task/exportGeoJson/${id}`, {
|
||||
...this.queryParams
|
||||
},`持续监管_${this.form.xmmc}_${this.form.tbbh}.json`)
|
||||
},
|
||||
}
|
||||
}
|
||||
;
|
||||
|
@ -112,6 +112,18 @@
|
||||
>导出全部
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="warning"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- v-if="showXmmcCheck"-->
|
||||
<!-- @click="handleExportGeoJsonByXmmcs"-->
|
||||
<!-- >导出矢量-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getTaskXmmcList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
@ -444,6 +456,16 @@ export default {
|
||||
...this.queryParams
|
||||
}, `持续监管_${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDate()}.xlsx`)
|
||||
},
|
||||
handleExportGeoJsonByXmmcs(row) {
|
||||
const xmmcs = row.xmmc || this.xmmcs;
|
||||
if (!xmmcs || xmmcs.indexOf('') !== -1) {
|
||||
this.$modal.msgError("存在项目类型为空的选项,无法按项目名类型导出");
|
||||
return;
|
||||
}
|
||||
this.download(`/cxxm/zt/task/exportGeoJsonByXmmcs/${xmmcs}`, {
|
||||
...this.queryParams
|
||||
}, `持续监管_${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDate()}.json`)
|
||||
},
|
||||
handleExportAll() {
|
||||
this.download(`/cxxm/zt/task/exportAll`, {
|
||||
...this.queryParams
|
||||
|
@ -54,6 +54,15 @@
|
||||
>{{ this.form.xzxfqk === '1' ? "改派" : "指派" }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleExportGeoJson"-->
|
||||
<!-- >导出矢量-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
@ -813,7 +822,13 @@ export default {
|
||||
} else {
|
||||
return "primary"
|
||||
}
|
||||
}
|
||||
},
|
||||
handleExportGeoJson() {
|
||||
const id = this.$route.query.id;
|
||||
this.download(`/cxxm/zttb/task/exportGeoJson/${id}`, {
|
||||
...this.queryParams
|
||||
},`自提图斑_${this.form.xmmc}_${this.form.tbbh}.json`)
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -112,6 +112,18 @@
|
||||
>导出全部
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="warning"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- v-if="showXmmcCheck"-->
|
||||
<!-- @click="handleExportGeoJsonByXmmcs"-->
|
||||
<!-- >导出矢量-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getTaskXmmcList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
@ -451,6 +463,16 @@ export default {
|
||||
...this.queryParams
|
||||
}, `自提图斑_${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDate()}.xlsx`)
|
||||
},
|
||||
handleExportGeoJsonByXmmcs(row) {
|
||||
const xmmcs = row.xmmc || this.xmmcs;
|
||||
if (!xmmcs || xmmcs.indexOf('') !== -1) {
|
||||
this.$modal.msgError("存在项目类型为空的选项,无法按项目名类型导出");
|
||||
return;
|
||||
}
|
||||
this.download(`/cxxm/zttb/task/exportGeoJsonByXmmcs/${xmmcs}`, {
|
||||
...this.queryParams
|
||||
}, `自提图斑_${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDate()}.json`)
|
||||
},
|
||||
handleExportAll() {
|
||||
this.download(`/cxxm/zttb/task/exportAll`, {
|
||||
...this.queryParams
|
||||
|
BIN
ruoyi-ui/src/views/getLastVersionApK.png
Normal file
BIN
ruoyi-ui/src/views/getLastVersionApK.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
@ -16,7 +16,7 @@
|
||||
</el-col>
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="部省监管" name="1" :lazy="true">
|
||||
<el-tab-pane label="持续监管" name="1" :lazy="true">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4" v-for="(value, key) in ztStatistics">
|
||||
<div style="text-align: center;margin: 5px;padding: 10px;border: 1px solid #1c6ec4">
|
||||
@ -240,6 +240,24 @@
|
||||
<!-- </el-card>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
|
||||
|
||||
<el-dialog title="系统迁移提示!!!" :visible.sync="newVersion" width="1000px" append-to-body>
|
||||
<div style="color: red"><h3>本系统已迁移到正式服务器,请勿在当前测试环境进行操作!!!</h3></div>
|
||||
<div style="color: red"><h3>请按照下面操作切换至正式版本!!!</h3></div>
|
||||
<div><h3>1、点击下面链接跳转到正式服务器。</h3></div>
|
||||
<div><a style="margin-top: 50px;text-decoration: underline;color: #13ce66;font-size: larger;"
|
||||
href="http://1.95.66.168">http://1.95.66.168</a></div>
|
||||
<div><h3>2、下载正式版本app。</h3></div>
|
||||
<div>
|
||||
<img src="./getLastVersionApK.png" width="300" height="300"/>
|
||||
<a style="margin-top: 50px;text-decoration: underline;color: #13ce66;font-size: larger;"
|
||||
href="http://1.95.66.168/prod-api/cxxm/api/version/getLastVersionApK">http://1.95.66.168/prod-api/cxxm/api/version/getLastVersionApK</a>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="newVersion = false">我已知晓</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -251,6 +269,7 @@ export default {
|
||||
name: "Index",
|
||||
data() {
|
||||
return {
|
||||
newVersion: false,
|
||||
zftkStatistics: {
|
||||
"图斑总数": 0,
|
||||
"已巡查图斑": 0,
|
||||
|
@ -140,8 +140,12 @@ export default {
|
||||
Cookies.remove("password");
|
||||
Cookies.remove('rememberMe');
|
||||
}
|
||||
this.$store.dispatch("Login", this.loginForm).then(() => {
|
||||
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
||||
this.$store.dispatch("Login", this.loginForm).then((res) => {
|
||||
if (res.weakPwd){
|
||||
this.$router.push({ path: "/resetPwd" }).catch(()=>{});
|
||||
}else{
|
||||
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
if (this.captchaEnabled) {
|
||||
|
@ -414,7 +414,7 @@ import {
|
||||
updateUser,
|
||||
resetUserPwd,
|
||||
changeUserStatus,
|
||||
deptTreeSelect
|
||||
deptTreeSelect, checkWeakPwd
|
||||
} from "@/api/system/user";
|
||||
import {getToken} from "@/utils/auth";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
@ -426,6 +426,15 @@ export default {
|
||||
dicts: ['sys_normal_disable', 'sys_user_sex', 'task_lx'],
|
||||
components: {Treeselect},
|
||||
data() {
|
||||
const validatePassword = (rule, value, callback) => {
|
||||
checkWeakPwd(value).then(response => {
|
||||
if (response.code === 200) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error(response.message));
|
||||
}
|
||||
})
|
||||
};
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
@ -512,8 +521,8 @@ export default {
|
||||
],
|
||||
password: [
|
||||
{required: true, message: "用户密码不能为空", trigger: "blur"},
|
||||
{min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur'},
|
||||
{pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur"}
|
||||
{min: 8, max: 20, message: '用户密码长度必须介于 8 和 20 之间', trigger: 'blur'},
|
||||
{validator: validatePassword, trigger: "blur"},
|
||||
],
|
||||
email: [
|
||||
{
|
||||
@ -657,10 +666,10 @@ export default {
|
||||
const userId = row.userId || this.ids;
|
||||
getUser(userId).then(response => {
|
||||
console.log(response.data.taskLx)
|
||||
if (response.data.taskLx==='') {
|
||||
if (response.data.taskLx === '') {
|
||||
response.data.taskLx = [];
|
||||
} else {
|
||||
response.data.taskLx= response.data.taskLx.split(",");
|
||||
response.data.taskLx = response.data.taskLx.split(",");
|
||||
}
|
||||
this.form = response.data;
|
||||
this.postOptions = response.posts;
|
||||
|
@ -1,5 +1,25 @@
|
||||
<template>
|
||||
<el-form ref="form" :model="user" :rules="rules" label-width="80px">
|
||||
<div>
|
||||
<h3>密码组成要求:</h3>
|
||||
<ul style="color: green">
|
||||
<li>最小长度:不少于 8 个字符。</li>
|
||||
<li>字符种类:(密码必须包含以下至少三种不同类型字符)
|
||||
<ul>
|
||||
<li>大写英文字母(A-Z)</li>
|
||||
<li>小写英文字母(a-z)</li>
|
||||
<li>数字(0-9)</li>
|
||||
<li>特殊符号(如:!@#$%^&*()-_=+[]{}|;:,.<>/?)</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>禁止使用的内容:</h3>
|
||||
<ul style="color: red">
|
||||
<li>禁止使用与用户账号、姓名、工号、手机号、邮箱等明显相关的信息作为密码。</li>
|
||||
<li>禁止使用常见弱口令,如:“123456”、“password”、“admin”、“abc123”、“qwerty” 等。</li>
|
||||
<li>不允许使用重复字符或简单模式(如:“aaaaaa”、“111111”、“abcabc” 等)。</li>
|
||||
</ul>
|
||||
</div>
|
||||
<el-form-item label="旧密码" prop="oldPassword">
|
||||
<el-input v-model="user.oldPassword" placeholder="请输入旧密码" type="password" show-password/>
|
||||
</el-form-item>
|
||||
@ -17,7 +37,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateUserPwd } from "@/api/system/user";
|
||||
import {updateUserPwd, checkWeakPwd} from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -28,6 +48,15 @@ export default {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
const validatePassword = (rule, value, callback) => {
|
||||
checkWeakPwd(value).then(response => {
|
||||
if (response.code === 200) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error(response.message));
|
||||
}
|
||||
})
|
||||
};
|
||||
return {
|
||||
user: {
|
||||
oldPassword: undefined,
|
||||
@ -37,16 +66,16 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
oldPassword: [
|
||||
{ required: true, message: "旧密码不能为空", trigger: "blur" }
|
||||
{required: true, message: "旧密码不能为空", trigger: "blur"}
|
||||
],
|
||||
newPassword: [
|
||||
{ required: true, message: "新密码不能为空", trigger: "blur" },
|
||||
{ min: 6, max: 20, message: "长度在 6 到 20 个字符", trigger: "blur" },
|
||||
{ pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }
|
||||
{required: true, message: "新密码不能为空", trigger: "blur"},
|
||||
{min: 8, max: 20, message: "长度在 8 到 20 个字符", trigger: "blur"},
|
||||
{validator: validatePassword, trigger: "blur"},
|
||||
],
|
||||
confirmPassword: [
|
||||
{ required: true, message: "确认密码不能为空", trigger: "blur" },
|
||||
{ required: true, validator: equalToPassword, trigger: "blur" }
|
||||
{required: true, message: "确认密码不能为空", trigger: "blur"},
|
||||
{required: true, validator: equalToPassword, trigger: "blur"},
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -57,6 +86,7 @@ export default {
|
||||
if (valid) {
|
||||
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.$tab.closePage();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
26
ruoyi-ui/src/views/system/user/resetPwd.vue
Normal file
26
ruoyi-ui/src/views/system/user/resetPwd.vue
Normal file
@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<h1 style="color: red">当前密码强度较弱,请修改密码!!!</h1>
|
||||
</div>
|
||||
<div>
|
||||
<resetPwd/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import resetPwd from "./profile/resetPwd";
|
||||
|
||||
export default {
|
||||
name: "Profile",
|
||||
components: {resetPwd},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user