Bläddra i källkod

Merge branch 'master' of git.taauav.net:gitadmin/taauav_lishui

master
dongyuangong 4 år sedan
förälder
incheckning
a709656547
15 ändrade filer med 115 tillägg och 48 borttagningar
  1. +3
    -2
      src/main/java/com/taauav/admin/constant/CommonConstant.java
  2. +2
    -1
      src/main/java/com/taauav/admin/mapper/TauvInspectFileMapper.xml
  3. +9
    -1
      src/main/java/com/taauav/admin/service/impl/LsAdminServiceImpl.java
  4. +3
    -0
      src/main/java/com/taauav/admin/service/impl/TauvInspectFileServiceImpl.java
  5. +18
    -15
      src/main/java/com/taauav/admin/validate/ExecuteTask.java
  6. +5
    -5
      src/main/java/com/taauav/front/controller/FrontBaseController.java
  7. +5
    -8
      src/main/java/com/taauav/front/controller/LSAdminController.java
  8. +1
    -1
      src/main/java/com/taauav/front/controller/LSReportController.java
  9. +3
    -5
      src/main/java/com/taauav/front/controller/LSUserController.java
  10. +1
    -2
      src/main/java/com/taauav/front/service/ILSReportService.java
  11. +9
    -6
      src/main/java/com/taauav/front/service/impl/LSReportServiceImpl.java
  12. +26
    -0
      src/main/java/com/taauav/front/utils/LoginUtils.java
  13. +26
    -0
      src/main/java/com/taauav/front/utils/ServletUtils.java
  14. +3
    -1
      src/main/java/com/taauav/front/vo/LSInspectFileDataVo.java
  15. +1
    -1
      src/main/resources/config/application-test.yml

+ 3
- 2
src/main/java/com/taauav/admin/constant/CommonConstant.java Visa fil

@@ -33,8 +33,9 @@ public class CommonConstant {
*/
public static Map<Integer, String> LSADMIN_LEVEL_LIST = new HashMap<Integer, String>() {
{
put(1, "河长等级1");
put(2, "河长等级2");
put(1, "区级");
put(2, "镇级");
put(3, "村级");
}
};


+ 2
- 1
src/main/java/com/taauav/admin/mapper/TauvInspectFileMapper.xml Visa fil

@@ -32,6 +32,7 @@
left join tauv_question_options as q on f.question_id = q.id
left join sys_city as c on d.driver_area = c.id
where f.mark = 1 and d.mark = 1 and q.mark = 1 and f.is_review = 1 and f.is_effective = 1 and f.status = 1
and d.status = 4
<if test="areaId != null and areaId > 0">
and d.driver_area = #{areaId}
</if>
@@ -50,7 +51,7 @@
left join tauv_driver as d on i.driver_id = d.id
left join ls_admin as a on d.driver_manager = a.id
where f.mark = 1 and d.mark = 1 and i.mark = 1 and f.is_review = 1 and f.is_effective = 1 and f.status = 1
and q.mark = 1
and q.mark = 1 and i.status = 4
<if test="param != null and param.cityId != null and param.cityId > 0">
and d.driver_area = #{param.cityId}
</if>

+ 9
- 1
src/main/java/com/taauav/admin/service/impl/LsAdminServiceImpl.java Visa fil

@@ -472,7 +472,15 @@ public class LsAdminServiceImpl extends BaseServiceImpl<LsAdminMapper, LsAdmin>
cityVo.setWaterQuality(0);
cityVo.setIsTrue(0);
cityVo.setDriverList(new ArrayList<>());
if (!cityList.contains(cityVo)) {
Boolean exist = false;
if (cityList != null && cityList.size() > 0) {
for (SysCityVo val : cityList) {
if (cityVo.getId().equals(val.getId())) {
exist = true;
}
}
}
if (!exist) {
cityList.add(cityVo);
}
}

+ 3
- 0
src/main/java/com/taauav/admin/service/impl/TauvInspectFileServiceImpl.java Visa fil

@@ -1111,6 +1111,9 @@ public class TauvInspectFileServiceImpl extends BaseServiceImpl<TauvInspectFileM
String path = inspectFile.getThumbImg().replace("_1", "_2");
inspectFileDataVo.setFilePath(uploadUrl + path);
}
if (inspectFile.getOriginalImg() != null && inspectFile.getOriginalImg() != "") {
inspectFileDataVo.setOriginImg(uploadUrl + inspectFile.getOriginalImg());
}

TauvInspectDriver inspectDriver = inspectDriverMapper.selectById(inspectFile.getInspectDriverId());
if (inspectDriver != null) {

+ 18
- 15
src/main/java/com/taauav/admin/validate/ExecuteTask.java Visa fil

@@ -27,31 +27,34 @@ public class ExecuteTask {
@JsonFormat(pattern = "yyyy-MM-dd")
private Date executionTime;

@Length(min = 1, max = 20, message = "天气为1-20个字符")
@NotBlank(message = "天气不能为空")
/**
* 天气
*/
private String weather;

@Length(min = 1, max = 20, message = "风向为1-20个字符")
@NotBlank(message = "风向不能为空")
/**
* 风向
*/
private String wind;

@Length(min = 1, max = 20, message = "温度为1-20个字符")
@NotBlank(message = "温度不能为空")
/**
* 温度
*/
private String temperature;

@Length(min = 1, max = 20, message = "飞行速度为1-20个字符")
@DecimalMin(value = "0", message = "飞行速度只能输入合理的数字")
@NotBlank(message = "飞行速度不能为空")
/**
* 飞行速度
*/
private String flightSpeed;

@Length(min = 1, max = 20, message = "飞行高度为1-20个字符")
@DecimalMin(value = "0", message = "飞行高度只能输入合理的数字")
@NotBlank(message = "飞行高度不能为空")
/**
* 飞行高度
*/
private String flightHeight;

@Length(min = 1, max = 20, message = "飞行时间为1-20个字符")
@DecimalMin(value = "0", message = "飞行时间只能输入合理的数字")
@NotBlank(message = "飞行时间不能为空")
/**
* 飞行时间
*/
private String flightTime;

@Length(max = 200, message = "备注不能超过200个字符")

+ 5
- 5
src/main/java/com/taauav/front/controller/FrontBaseController.java Visa fil

@@ -13,10 +13,10 @@ import javax.servlet.http.HttpServletRequest;
*/
public class FrontBaseController {

/**
* 登录用户ID
*/
public Integer userId;
// /**
// * 登录用户ID
// */
// public Integer userId;

/**
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
@@ -26,7 +26,7 @@ public class FrontBaseController {
System.out.println("初始化基类");
String token = request.getHeader("token");
Claims data = JwtUtil.parseJWT(token);
this.userId = Integer.valueOf(data.get("id").toString());
// this.userId = Integer.valueOf(data.get("id").toString());
}

}

+ 5
- 8
src/main/java/com/taauav/front/controller/LSAdminController.java Visa fil

@@ -1,14 +1,10 @@
package com.taauav.front.controller;

import com.taauav.admin.entity.SysCity;
import com.taauav.admin.entity.TauvInspectFile;
import com.taauav.admin.service.ILsAdminService;
import com.taauav.admin.service.ILsAuthGroupService;
import com.taauav.admin.service.ILsCityService;
import com.taauav.admin.service.ITauvInspectFileService;
import com.taauav.common.bean.Response;
import com.taauav.common.util.StringUtils;
import com.taauav.front.dto.LsInspectFileDTO;
import com.taauav.front.utils.LoginUtils;
import com.taauav.front.vo.LSAdminVo;
import com.taauav.front.vo.LSVillageVo;
import com.taauav.front.vo.SysCityVo;
@@ -17,7 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@@ -44,7 +39,8 @@ public class LSAdminController extends FrontBaseController {
* @return
*/
@GetMapping("/info")
public Response info(@RequestParam("userId") Integer userId, @RequestParam Map<String, String> map) {
public Response info(@RequestParam Map<String, String> map) {
Integer userId = LoginUtils.getAdminId();
LSAdminVo info = lsAdminService.getAdminInfo(userId);

//数据权限处理
@@ -62,7 +58,8 @@ public class LSAdminController extends FrontBaseController {
* @return
*/
@GetMapping("/village")
public Response getVillageData(@RequestParam("userId")Integer userId, @RequestParam("townId") BigInteger townId, @RequestParam Map<String, String> map) {
public Response getVillageData(@RequestParam("townId") BigInteger townId, @RequestParam Map<String, String> map) {
Integer userId = LoginUtils.getAdminId();
LSVillageVo village = lsAdminService.getVillageList(userId, townId, map);
return response.success(village);
}

+ 1
- 1
src/main/java/com/taauav/front/controller/LSReportController.java Visa fil

@@ -30,7 +30,7 @@ public class LSReportController extends FrontBaseController {
*/
@PostMapping("/index")
public Response index(@RequestBody(required = false) LSReportQuery query) {
return reportService.getList(query, this.userId);
return reportService.getList(query);
}

/**

+ 3
- 5
src/main/java/com/taauav/front/controller/LSUserController.java Visa fil

@@ -7,6 +7,7 @@ import com.taauav.common.util.FunctionUtils;
import com.taauav.common.util.JwtUtil;
import com.taauav.common.util.StringUtils;
import com.taauav.front.dto.UpdatePwdDto;
import com.taauav.front.utils.LoginUtils;
import io.jsonwebtoken.Claims;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -30,10 +31,7 @@ public class LSUserController extends FrontBaseController {
*/
@PostMapping("/info")
public Response info(HttpServletRequest request) {
String token = request.getHeader("token");
Claims data = JwtUtil.parseJWT(token);
Integer userId = Integer.valueOf(data.get("id").toString());
LsAdmin adminInfo = adminService.getById(userId);
LsAdmin adminInfo = adminService.getById(LoginUtils.getAdminId());
return response.success(adminInfo);
}

@@ -46,7 +44,7 @@ public class LSUserController extends FrontBaseController {
@PostMapping("/editPassword")
public Response editPassword(@RequestBody UpdatePwdDto updatePwdDto) {
// 获取个人信息
LsAdmin adminInfo = adminService.getById(this.userId);
LsAdmin adminInfo = adminService.getById(LoginUtils.getAdminId());
if (adminInfo == null) {
return response.failure("用户信息不存在");
}

+ 1
- 2
src/main/java/com/taauav/front/service/ILSReportService.java Visa fil

@@ -19,10 +19,9 @@ public interface ILSReportService extends IBaseService<TauvReport> {
* 获取报告列表
*
* @param query 查询条件
* @param userId 用户ID
* @return
*/
Response getList(LSReportQuery query, Integer userId);
Response getList(LSReportQuery query);

/**
* 获取报告详情

+ 9
- 6
src/main/java/com/taauav/front/service/impl/LSReportServiceImpl.java Visa fil

@@ -15,6 +15,7 @@ import com.taauav.common.util.StringUtils;
import com.taauav.front.mapper.LSReportMapper;
import com.taauav.front.query.LSReportQuery;
import com.taauav.front.service.ILSReportService;
import com.taauav.front.utils.LoginUtils;
import com.taauav.front.vo.LSReportInfoVo;
import com.taauav.front.vo.LSReportListVo;
import com.taauav.front.vo.LSReportQuestionFileListVo;
@@ -78,12 +79,11 @@ public class LSReportServiceImpl extends BaseServiceImpl<LSReportMapper, TauvRep
/**
* 获取报告列表
*
* @param query 查询条件
* @param userId 用户ID
* @param query 查询条件
* @return
*/
@Override
public Response getList(LSReportQuery query, Integer userId) {
public Response getList(LSReportQuery query) {
// 查询条件
QueryWrapper<TauvReport> queryWrapper = new QueryWrapper<>();
// 报告编号
@@ -105,6 +105,8 @@ public class LSReportServiceImpl extends BaseServiceImpl<LSReportMapper, TauvRep
Date endTime = DateUtil.parse(inspectEndTime + " 23:59:59", "yyyy-MM-dd HH:mm:ss");
queryWrapper.le("inspect_time", endTime);
}
// 只取审核通过的报告
queryWrapper.eq("status", 3);
// 区划ID
if (query.getDriverArea() != null) {
// 获取所有自己区划ID
@@ -118,15 +120,16 @@ public class LSReportServiceImpl extends BaseServiceImpl<LSReportMapper, TauvRep
}
queryWrapper.in("driver_area", driverAreaList);
}
queryWrapper.eq("status", 3);
queryWrapper.eq("mark", 1);

// 数据权限
if (userId != 1) {
if (LoginUtils.getAdminId() != 1) {
List<BigInteger> driverAreaList = new ArrayList<>();
// 获取当前登录人员信息
LsAdmin lsAdmin = lsAdminMapper.selectById(userId);
LsAdmin lsAdmin = lsAdminMapper.selectById(LoginUtils.getAdminId());
// 遍历数据权限
Map<Integer, String> map = adminService.getAdminAuthData(userId);
Map<Integer, String> map = adminService.getAdminAuthData(LoginUtils.getAdminId());
for (Map.Entry<Integer, String> entry : map.entrySet()) {
if (entry.getKey() == 1) {
// 查看本人负责的河湖

+ 26
- 0
src/main/java/com/taauav/front/utils/LoginUtils.java Visa fil

@@ -0,0 +1,26 @@
package com.taauav.front.utils;

import com.taauav.common.util.JwtUtil;
import com.taauav.common.util.StringUtils;
import io.jsonwebtoken.Claims;

/**
* 封路信息工具类
*/
public class LoginUtils {

/**
* 获取登录用户ID
*
* @return
*/
public static Integer getAdminId() {
String token = ServletUtils.getRequest().getHeader("token");
Claims data = JwtUtil.parseJWT(token);
if (!StringUtils.isEmpty(data.get("id").toString())) {
return Integer.valueOf(data.get("id").toString());
}
return 0;
}

}

+ 26
- 0
src/main/java/com/taauav/front/utils/ServletUtils.java Visa fil

@@ -0,0 +1,26 @@
package com.taauav.front.utils;

import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

/**
* Servlet工具类
*/
public class ServletUtils {

/**
* 获取request
*/
public static HttpServletRequest getRequest() {
return getRequestAttributes().getRequest();
}

public static ServletRequestAttributes getRequestAttributes() {
RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
return (ServletRequestAttributes) attributes;
}

}

+ 3
- 1
src/main/java/com/taauav/front/vo/LSInspectFileDataVo.java Visa fil

@@ -1,5 +1,6 @@
package com.taauav.front.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;
@@ -22,6 +23,7 @@ public class LSInspectFileDataVo {

private String driverAreaName;

@JsonFormat(pattern = "yyyy-MM-dd")
private Date executionTime;

private String categoryText;
@@ -32,5 +34,5 @@ public class LSInspectFileDataVo {

private String filePath;

private String originImg;
}

+ 1
- 1
src/main/resources/config/application-test.yml Visa fil

@@ -1,6 +1,6 @@
server:
port: 8010
UPLOAD_URL: http://upload.yunhenggongchang.com/
UPLOAD_URL: http://imageslishui.yunhengwang.com/
AVATAR_URL: /data/webroot/taauav/public/uploads/
IMAGE_URL: http://imageslishui.yunhengwang.com/
servlet:

Laddar…
Avbryt
Spara