parent
e55130b543
commit
13ae539964
|
|
@ -60,4 +60,11 @@ public class DocCategoryController {
|
||||||
String[] strings = docCategoryService.checkPermission(docCategoryId, userId);
|
String[] strings = docCategoryService.checkPermission(docCategoryId, userId);
|
||||||
return R.ok(strings);
|
return R.ok(strings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据用户id获取有新增权限的资料类别")
|
||||||
|
@GetMapping("/getAddPermissionTree/{userId}")
|
||||||
|
public R<DocCategory> getAddPermissionTree(@PathVariable("userId") Long userId){
|
||||||
|
DocCategory docCategory = docCategoryService.getAddPermissionTree(userId);
|
||||||
|
return R.ok(docCategory);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.gunshi.project.ss.controller;
|
||||||
|
|
||||||
|
|
||||||
import com.gunshi.core.result.R;
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.ss.entity.vo.ScreenRealFlowVo;
|
||||||
|
import com.gunshi.project.ss.entity.vo.ScreenRealPptnVo;
|
||||||
import com.gunshi.project.ss.entity.vo.ScreenRsvrVo;
|
import com.gunshi.project.ss.entity.vo.ScreenRsvrVo;
|
||||||
import com.gunshi.project.ss.service.ScreenMoniotrService;
|
import com.gunshi.project.ss.service.ScreenMoniotrService;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
|
@ -27,4 +29,19 @@ public class ScreenMoniotrController {
|
||||||
List<ScreenRsvrVo> res = screenMoniotrService.getScreenRsvr();
|
List<ScreenRsvrVo> res = screenMoniotrService.getScreenRsvr();
|
||||||
return R.ok(res);
|
return R.ok(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//实时雨晴
|
||||||
|
@GetMapping("/rain")
|
||||||
|
public R<List<ScreenRealPptnVo>> getRealPptn(){
|
||||||
|
List<ScreenRealPptnVo> res = screenMoniotrService.gerRealPptn();
|
||||||
|
return R.ok(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
//出入库流量
|
||||||
|
@GetMapping("/flow")
|
||||||
|
public R<List<ScreenRealFlowVo>> getRealFlow(){
|
||||||
|
List<ScreenRealFlowVo> res = screenMoniotrService.getRealFlow();
|
||||||
|
return R.ok(res);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.gunshi.project.ss.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.ss.entity.vo.ScreenPatrolVo;
|
||||||
|
import com.gunshi.project.ss.service.ScreenPatrolService;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/screen/patrol")
|
||||||
|
@Tag(name = "大屏-库区巡查")
|
||||||
|
public class ScreenPatrolController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ScreenPatrolService screenPatrolService;
|
||||||
|
|
||||||
|
@GetMapping("/get/{year}")
|
||||||
|
public R<ScreenPatrolVo> get(@PathVariable("year") Long year) {
|
||||||
|
ScreenPatrolVo res = screenPatrolService.get(year);
|
||||||
|
return R.ok(res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -35,6 +35,12 @@ public class ScreenResponsibilityController {
|
||||||
return R.ok(vo);
|
return R.ok(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getFxPerson")
|
||||||
|
public R<List<ResPerson>> getFxPerson(){
|
||||||
|
List<ResPerson> vo = screenResponsibilityService.getFxPerson();
|
||||||
|
return R.ok(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/getTraining")
|
@GetMapping("/getTraining")
|
||||||
public R<ScreenPositionTrainingVo> getTraining(){
|
public R<ScreenPositionTrainingVo> getTraining(){
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.gunshi.project.ss.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.ss.entity.vo.ScreenSecurityHidden;
|
||||||
|
import com.gunshi.project.ss.service.ScreenSecurityHiddenService;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/screen/hidden")
|
||||||
|
@Tag(name = "大屏-安全隐患")
|
||||||
|
public class ScreenSecurityHiddenController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ScreenSecurityHiddenService screenSecurityHiddenService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/get/{year}")
|
||||||
|
public R<ScreenSecurityHidden> get(@PathVariable("year") Long year){
|
||||||
|
ScreenSecurityHidden res = screenSecurityHiddenService.get(year);
|
||||||
|
return R.ok(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.gunshi.project.ss.controller;
|
package com.gunshi.project.ss.controller;
|
||||||
|
|
||||||
import com.gunshi.core.result.R;
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.ss.entity.vo.ScreenSecurityCheckVo;
|
||||||
import com.gunshi.project.ss.entity.vo.WholeCycleVo;
|
import com.gunshi.project.ss.entity.vo.WholeCycleVo;
|
||||||
import com.gunshi.project.ss.service.*;
|
import com.gunshi.project.ss.service.*;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
@ -28,4 +29,11 @@ public class WholeCycleController {
|
||||||
return R.ok(res);
|
return R.ok(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(description = "大屏-安全鉴定")
|
||||||
|
@GetMapping("/security")
|
||||||
|
public R<ScreenSecurityCheckVo> getSecurity(){
|
||||||
|
ScreenSecurityCheckVo res = wholeCycleService.getSecurity();
|
||||||
|
return R.ok(res);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.gunshi.project.ss.entity.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ScreenPatrolVo {
|
||||||
|
|
||||||
|
//年度巡查次数
|
||||||
|
private Long yearCount;
|
||||||
|
|
||||||
|
|
||||||
|
//无人机巡查
|
||||||
|
private Long droneCount;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.gunshi.project.ss.entity.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ScreenRealFlowVo {
|
||||||
|
|
||||||
|
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
private BigDecimal q;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private LocalDateTime tm;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.gunshi.project.ss.entity.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.gunshi.project.ss.common.util.LocalDateTimeConverter;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ScreenRealPptnVo {
|
||||||
|
|
||||||
|
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
//实时雨量
|
||||||
|
private BigDecimal drp;
|
||||||
|
|
||||||
|
//实时雨量时间
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private LocalDateTime tm;
|
||||||
|
|
||||||
|
//今日雨量
|
||||||
|
private BigDecimal todayDrp;
|
||||||
|
|
||||||
|
//昨日雨量
|
||||||
|
private BigDecimal yesterdayDrp;
|
||||||
|
|
||||||
|
//24h雨量
|
||||||
|
private BigDecimal drp24;
|
||||||
|
|
||||||
|
//48h雨量
|
||||||
|
private BigDecimal drp48;
|
||||||
|
|
||||||
|
//72h雨量
|
||||||
|
private BigDecimal drp72;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
package com.gunshi.project.ss.entity.vo;
|
package com.gunshi.project.ss.entity.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class ScreenRsvrVo {
|
public class ScreenRsvrVo {
|
||||||
|
|
@ -37,4 +39,6 @@ public class ScreenRsvrVo {
|
||||||
// 0 不变 1上升 2下降
|
// 0 不变 1上升 2下降
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private LocalDateTime tm;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.gunshi.project.ss.entity.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.gunshi.core.dateformat.DateFormatString;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ScreenSecurityCheckVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大坝安全评定类别(一类坝 二类坝 三类坝)
|
||||||
|
*/
|
||||||
|
@Schema(description="大坝安全评定类别(一类坝 二类坝 三类坝)")
|
||||||
|
private String identifyType;
|
||||||
|
|
||||||
|
@Schema(description="鉴定日期")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY, timezone = "GMT+8")
|
||||||
|
private Date identifyDate;
|
||||||
|
|
||||||
|
@Schema(description = "下次鉴定时间")
|
||||||
|
@JsonFormat(pattern = "yyyy")
|
||||||
|
private LocalDate nextVerifyDate;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.gunshi.project.ss.entity.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ScreenSecurityHidden {
|
||||||
|
|
||||||
|
|
||||||
|
//隐患总数
|
||||||
|
private Long totalCount;
|
||||||
|
|
||||||
|
//已整改
|
||||||
|
private Long finishCount;
|
||||||
|
|
||||||
|
//未整改
|
||||||
|
private Long noFinishCount;
|
||||||
|
|
||||||
|
//整改率
|
||||||
|
private BigDecimal finishPercent;
|
||||||
|
|
||||||
|
//月份柱状图
|
||||||
|
private Map<Integer,Long> months;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -50,6 +50,39 @@ public interface InspectTaskMapper extends BaseMapper<InspectTask> {
|
||||||
""")
|
""")
|
||||||
Page<InspectTask> pageQuery(Page<InspectTask> page,@Param("obj") InspectTaskPageSo pageSo);
|
Page<InspectTask> pageQuery(Page<InspectTask> page,@Param("obj") InspectTaskPageSo pageSo);
|
||||||
|
|
||||||
|
|
||||||
|
@Select("""
|
||||||
|
<script>
|
||||||
|
with m1 as (
|
||||||
|
select t.* from public.inspect_task t
|
||||||
|
<where>
|
||||||
|
<if test="obj.createUserId != null ">
|
||||||
|
t.create_user_id = #{obj.createUserId}
|
||||||
|
</if>
|
||||||
|
<if test="obj.status != null ">
|
||||||
|
and t.status = #{obj.status}
|
||||||
|
</if>
|
||||||
|
<if test="obj.taskType != null ">
|
||||||
|
and t.task_type = #{obj.taskType}
|
||||||
|
</if>
|
||||||
|
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null">
|
||||||
|
and t.create_time <![CDATA[>=]]> #{obj.dateTimeRangeSo.start}
|
||||||
|
</if>
|
||||||
|
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.end != null">
|
||||||
|
and t.create_time <![CDATA[<=]]> #{obj.dateTimeRangeSo.end}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
),
|
||||||
|
m2 as (select task_id,count(is_normal) as problemNum from inspect_task_detail where is_normal = 0 GROUP BY task_id),
|
||||||
|
m3 as (select task_id,count(is_handle) as handleNum from inspect_task_detail where is_handle = 0 GROUP BY task_id)
|
||||||
|
select m1.*,m2.problemNum,m3.handleNum from m1
|
||||||
|
left join m2 on m1.id = m2.task_id
|
||||||
|
left join m3 on m1.id = m3.task_id
|
||||||
|
order by m1.create_time desc
|
||||||
|
</script>
|
||||||
|
""")
|
||||||
|
List<InspectTask> listQuery(@Param("obj") InspectTaskPageSo pageSo);
|
||||||
|
|
||||||
@Select("""
|
@Select("""
|
||||||
select count(is_handle) as handleNum from inspect_task_detail where is_handle = 0
|
select count(is_handle) as handleNum from inspect_task_detail where is_handle = 0
|
||||||
AND task_id = #{taskId}
|
AND task_id = #{taskId}
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,7 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Comparator;
|
import java.util.*;
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Queue;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -67,7 +64,7 @@ public class DocCategoryService extends ServiceImpl<DocCategoryMapper, DocCatego
|
||||||
//判断赋予的权限
|
//判断赋予的权限
|
||||||
if(pop.getLevel() != null && pop.getLevel() == 3){
|
if(pop.getLevel() != null && pop.getLevel() == 3){
|
||||||
//只有最后一层才有权限
|
//只有最后一层才有权限
|
||||||
List<DocPermissionConfig> permissions = docPermissionConfigService.getPermissionByDocId(pop.getId());
|
List<DocPermissionConfig> permissions = docPermissionConfigService.getPermissionByDocId(pop.getId());
|
||||||
pop.setPermissions(permissions);
|
pop.setPermissions(permissions);
|
||||||
}
|
}
|
||||||
childrens.forEach(item -> {docCategoryDeque.add(item);});
|
childrens.forEach(item -> {docCategoryDeque.add(item);});
|
||||||
|
|
@ -77,6 +74,8 @@ public class DocCategoryService extends ServiceImpl<DocCategoryMapper, DocCatego
|
||||||
return docCategory;
|
return docCategory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public UserRoleVo getAllUserAndRole() {
|
public UserRoleVo getAllUserAndRole() {
|
||||||
return docPermissionConfigService.getAllUserAndRole();
|
return docPermissionConfigService.getAllUserAndRole();
|
||||||
}
|
}
|
||||||
|
|
@ -172,4 +171,42 @@ public class DocCategoryService extends ServiceImpl<DocCategoryMapper, DocCatego
|
||||||
List<DocCategory> res = this.baseMapper.findCategoryPathRecursive(docCategoryId);
|
List<DocCategory> res = this.baseMapper.findCategoryPathRecursive(docCategoryId);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DocCategory getAddPermissionTree(Long userId) {
|
||||||
|
LambdaQueryWrapper<DocCategory> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(DocCategory::getParentId,0);
|
||||||
|
queryWrapper.last("limit 1");
|
||||||
|
DocCategory docCategory = docCategoryMapper.selectOne(queryWrapper);
|
||||||
|
List<DocCategory> allList = docCategoryMapper.selectList(null);
|
||||||
|
buildTreeWithUserId(docCategory,allList,userId);
|
||||||
|
return docCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
private DocCategory buildTreeWithUserId(DocCategory docCategory,List<DocCategory> allList,Long userId) {
|
||||||
|
Queue<DocCategory> docCategoryDeque = new LinkedList<>();
|
||||||
|
if(docCategory != null){
|
||||||
|
docCategoryDeque.add(docCategory);
|
||||||
|
}
|
||||||
|
while(!docCategoryDeque.isEmpty()){
|
||||||
|
int size = docCategoryDeque.size();
|
||||||
|
while(size > 0){
|
||||||
|
DocCategory pop = docCategoryDeque.remove();
|
||||||
|
List<DocCategory> childrens = allList.stream().filter(o -> {
|
||||||
|
return o.getParentId().equals(pop.getId());
|
||||||
|
}).sorted(Comparator.comparing(DocCategory::getSortOrder)) // 升序排列
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
pop.setChildren(childrens);
|
||||||
|
//判断赋予的权限
|
||||||
|
if(pop.getLevel() != null && pop.getLevel() == 3){
|
||||||
|
//只有最后一层才有权限
|
||||||
|
List<DocPermissionConfig> permissions = docPermissionConfigService.getPermissionByDocIdAndUserId(pop.getId(),userId);
|
||||||
|
//TODO 目前level==3就是最后一层,也就是叶子节点
|
||||||
|
pop.setPermissions(permissions);
|
||||||
|
}
|
||||||
|
childrens.forEach(item -> {docCategoryDeque.add(item);});
|
||||||
|
size--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return docCategory;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import com.ruoyi.system.mapper.SysDeptMapper;
|
||||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||||
import com.ruoyi.system.mapper.SysUserMapper;
|
import com.ruoyi.system.mapper.SysUserMapper;
|
||||||
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -226,4 +227,54 @@ public class DocPermissionConfigService extends ServiceImpl<DocPermissionConfigM
|
||||||
queryWrapper.eq(DocPermissionConfig::getCategoryId,docCatrgoryId);
|
queryWrapper.eq(DocPermissionConfig::getCategoryId,docCatrgoryId);
|
||||||
this.baseMapper.delete(queryWrapper);
|
this.baseMapper.delete(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<DocPermissionConfig> getPermissionByDocIdAndUserId(Long docId, Long userId) {
|
||||||
|
SysUser sysUser = sysUserMapper.selectUserById(userId);
|
||||||
|
if(sysUser == null){
|
||||||
|
throw new IllegalArgumentException("对不起,该用户不存在");
|
||||||
|
}
|
||||||
|
//获取用户角色
|
||||||
|
List<SysRole> roles = sysUser.getRoles();
|
||||||
|
SysRole sysRole = roles.get(0);
|
||||||
|
LambdaQueryWrapper<DocPermissionConfig> queryUserWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryUserWrapper.eq(DocPermissionConfig::getTargetType,2)
|
||||||
|
.eq(DocPermissionConfig::getTargerId,userId)
|
||||||
|
.eq(DocPermissionConfig::getCategoryId,docId)
|
||||||
|
.last("limit 1");
|
||||||
|
DocPermissionConfig docPermissionConfig = this.baseMapper.selectOne(queryUserWrapper);
|
||||||
|
if(docPermissionConfig != null){
|
||||||
|
//如果用户能查到
|
||||||
|
String permissionCode = docPermissionConfig.getPermissionCode();
|
||||||
|
if(StringUtils.isNotEmpty(permissionCode)){
|
||||||
|
String[] split = permissionCode.split(",");
|
||||||
|
List<String> permissionList = Arrays.asList(split);
|
||||||
|
if(!permissionList.contains("add")){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
docPermissionConfig.setPermissions(permissionList);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//如果用户查不到,就说明没有配置过权限,或者说配置的是角色(一个叶子节点分类不可能同时配置 用户和角色 2种情况的权限)
|
||||||
|
LambdaQueryWrapper<DocPermissionConfig> queryRoleWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryRoleWrapper.eq(DocPermissionConfig::getTargetType,1)
|
||||||
|
.eq(DocPermissionConfig::getTargerId,sysRole.getRoleId())
|
||||||
|
.eq(DocPermissionConfig::getCategoryId,docId)
|
||||||
|
.last("limit 1");
|
||||||
|
docPermissionConfig = this.baseMapper.selectOne(queryRoleWrapper);
|
||||||
|
if(docPermissionConfig != null){
|
||||||
|
String permissionCode = docPermissionConfig.getPermissionCode();
|
||||||
|
if(StringUtils.isNotEmpty(permissionCode)){
|
||||||
|
String[] split = permissionCode.split(",");
|
||||||
|
List<String> permissionList = Arrays.asList(split);
|
||||||
|
if(!permissionList.contains("add")){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
docPermissionConfig.setPermissions(permissionList);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Arrays.asList(docPermissionConfig);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.gunshi.project.ss.service;
|
package com.gunshi.project.ss.service;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.gunshi.project.ss.common.util.LocalDateTimeConverter;
|
||||||
import com.gunshi.project.ss.entity.so.StPptnSo;
|
import com.gunshi.project.ss.entity.so.StPptnSo;
|
||||||
import com.gunshi.project.ss.entity.so.WeatherSo;
|
import com.gunshi.project.ss.entity.so.WeatherSo;
|
||||||
import com.gunshi.project.ss.entity.vo.*;
|
import com.gunshi.project.ss.entity.vo.*;
|
||||||
|
|
@ -436,7 +437,7 @@ public class RainBasinDivisionService {
|
||||||
* @param time 当前时间
|
* @param time 当前时间
|
||||||
* @return 今日降雨量
|
* @return 今日降雨量
|
||||||
*/
|
*/
|
||||||
private BigDecimal queryTodayDrpByStcdAndTime(String stcd, Date time) {
|
public BigDecimal queryTodayDrpByStcdAndTime(String stcd, Date time) {
|
||||||
LocalDateTime now = LocalDateTime.ofInstant(time.toInstant(), ZoneId.systemDefault());
|
LocalDateTime now = LocalDateTime.ofInstant(time.toInstant(), ZoneId.systemDefault());
|
||||||
LocalDateTime startTime;
|
LocalDateTime startTime;
|
||||||
LocalDateTime endTime;
|
LocalDateTime endTime;
|
||||||
|
|
@ -688,4 +689,21 @@ public class RainBasinDivisionService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public BigDecimal queryLast24HoursDrpByStcdAndTime(String stcd, Date date) {
|
||||||
|
LocalDateTime end = LocalDateTimeConverter.fromDate(date);
|
||||||
|
LocalDateTime start = end.minusDays(1);
|
||||||
|
return stPptnRMapper.queryStPptnTimeQuantumByStcdAndTime(stcd,LocalDateTimeConverter.toDate(start),LocalDateTimeConverter.toDate(end));
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal queryLast48HoursDrpByStcdAndTime(String stcd, Date date) {
|
||||||
|
LocalDateTime end = LocalDateTimeConverter.fromDate(date);
|
||||||
|
LocalDateTime start = end.minusDays(2);
|
||||||
|
return stPptnRMapper.queryStPptnTimeQuantumByStcdAndTime(stcd,LocalDateTimeConverter.toDate(start),LocalDateTimeConverter.toDate(end));
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal queryLast72HoursDrpByStcdAndTime(String stcd, Date date) {
|
||||||
|
LocalDateTime end = LocalDateTimeConverter.fromDate(date);
|
||||||
|
LocalDateTime start = end.minusDays(3);
|
||||||
|
return stPptnRMapper.queryStPptnTimeQuantumByStcdAndTime(stcd,LocalDateTimeConverter.toDate(start),LocalDateTimeConverter.toDate(end));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,25 @@
|
||||||
package com.gunshi.project.ss.service;
|
package com.gunshi.project.ss.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.gunshi.project.ss.common.mapper.StPptnRRealMapper;
|
||||||
|
import com.gunshi.project.ss.common.model.StFlowR;
|
||||||
|
import com.gunshi.project.ss.common.model.StPptnRReal;
|
||||||
import com.gunshi.project.ss.common.model.StRsvrR;
|
import com.gunshi.project.ss.common.model.StRsvrR;
|
||||||
import com.gunshi.project.ss.common.model.StStbprpB;
|
import com.gunshi.project.ss.common.model.StStbprpB;
|
||||||
|
import com.gunshi.project.ss.common.util.LocalDateTimeConverter;
|
||||||
import com.gunshi.project.ss.entity.vo.AttResBaseVo;
|
import com.gunshi.project.ss.entity.vo.AttResBaseVo;
|
||||||
|
import com.gunshi.project.ss.entity.vo.ScreenRealFlowVo;
|
||||||
|
import com.gunshi.project.ss.entity.vo.ScreenRealPptnVo;
|
||||||
import com.gunshi.project.ss.entity.vo.ScreenRsvrVo;
|
import com.gunshi.project.ss.entity.vo.ScreenRsvrVo;
|
||||||
|
import com.gunshi.project.ss.mapper.RealRainMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -66,6 +75,7 @@ public class ScreenMoniotrService {
|
||||||
if(one == null){
|
if(one == null){
|
||||||
entity.setStatus(0);
|
entity.setStatus(0);
|
||||||
}else{
|
}else{
|
||||||
|
entity.setTm(LocalDateTimeConverter.fromDate(one.getTm()));
|
||||||
//如果过去时刻水位高于当前水位 ->表示下降
|
//如果过去时刻水位高于当前水位 ->表示下降
|
||||||
String lastRz = one.getRz();
|
String lastRz = one.getRz();
|
||||||
BigDecimal decimalRz = new BigDecimal(lastRz);
|
BigDecimal decimalRz = new BigDecimal(lastRz);
|
||||||
|
|
@ -82,4 +92,66 @@ public class ScreenMoniotrService {
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RealRainMapper realRainMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RainBasinDivisionService rainBasinDivisionService;
|
||||||
|
|
||||||
|
public List<ScreenRealPptnVo> gerRealPptn() {
|
||||||
|
List<StStbprpB> pptnStations = stStbprpBService.getPptnStations();
|
||||||
|
List<ScreenRealPptnVo> res = new ArrayList<>();
|
||||||
|
for (StStbprpB pptnStation : pptnStations) {
|
||||||
|
ScreenRealPptnVo vo = new ScreenRealPptnVo();
|
||||||
|
vo.setStcd(pptnStation.getStcd());
|
||||||
|
vo.setStnm(pptnStation.getStnm());
|
||||||
|
StPptnRReal stPptnRReal = realRainMapper.queryPptnByStcd(vo.getStcd());
|
||||||
|
if(stPptnRReal != null){
|
||||||
|
Date tm = stPptnRReal.getTm();
|
||||||
|
LocalDateTime nowTime = LocalDateTime.now();
|
||||||
|
LocalDateTime latestTime = LocalDateTime.ofInstant(tm.toInstant(), ZoneId.systemDefault());
|
||||||
|
boolean isToday = latestTime.toLocalDate().equals(nowTime.toLocalDate());
|
||||||
|
if(isToday){
|
||||||
|
Date date = new Date();
|
||||||
|
//今日雨量
|
||||||
|
BigDecimal todayDrp = rainBasinDivisionService.queryTodayDrpByStcdAndTime(vo.getStcd(), date);
|
||||||
|
vo.setTodayDrp(todayDrp);
|
||||||
|
//昨日雨量
|
||||||
|
BigDecimal yesterdayDrp = rainBasinDivisionService.queryYesterdayDrpByStcdAndTime(vo.getStcd(), date);
|
||||||
|
vo.setYesterdayDrp(yesterdayDrp);
|
||||||
|
//24h雨量
|
||||||
|
BigDecimal drp24 = rainBasinDivisionService.queryLast24HoursDrpByStcdAndTime(vo.getStcd(),date);
|
||||||
|
vo.setDrp24(drp24);
|
||||||
|
//48h雨量
|
||||||
|
BigDecimal drp48 = rainBasinDivisionService.queryLast48HoursDrpByStcdAndTime(vo.getStcd(),date);
|
||||||
|
vo.setDrp48(drp48);
|
||||||
|
//72h雨量
|
||||||
|
BigDecimal drp72 = rainBasinDivisionService.queryLast72HoursDrpByStcdAndTime(vo.getStcd(),date);
|
||||||
|
vo.setDrp72(drp72);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res.add(vo);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StFlowRService stFlowRService;
|
||||||
|
public List<ScreenRealFlowVo> getRealFlow() {
|
||||||
|
List<ScreenRealFlowVo> res = new ArrayList<>();
|
||||||
|
List<StStbprpB> flowStations = stStbprpBService.getFlowStations();
|
||||||
|
for (StStbprpB flowStation : flowStations) {
|
||||||
|
ScreenRealFlowVo vo = new ScreenRealFlowVo();
|
||||||
|
vo.setStcd(flowStation.getStcd());
|
||||||
|
vo.setStnm(flowStation.getStnm());
|
||||||
|
StFlowR newDataByStcd = stFlowRService.getNewDataByStcd(flowStation.getStcd());
|
||||||
|
if(newDataByStcd != null){
|
||||||
|
vo.setQ(newDataByStcd.getQ());
|
||||||
|
vo.setTm(newDataByStcd.getTm());
|
||||||
|
}
|
||||||
|
res.add(vo);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.gunshi.project.ss.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.gunshi.db.dto.DateTimeRangeSo;
|
||||||
|
import com.gunshi.project.ss.common.model.InspectTask;
|
||||||
|
import com.gunshi.project.ss.entity.so.InspectTaskPageSo;
|
||||||
|
import com.gunshi.project.ss.entity.vo.ScreenPatrolVo;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class ScreenPatrolService {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InspectTaskService service;
|
||||||
|
|
||||||
|
|
||||||
|
public void fillPageSoData(InspectTaskPageSo pageSo,Long year){
|
||||||
|
pageSo.setStatus(2);//已完成
|
||||||
|
DateTimeRangeSo dateTimeRangeSo = new DateTimeRangeSo();
|
||||||
|
|
||||||
|
// 使用LocalDate设置开始和结束日期
|
||||||
|
LocalDate startDate = LocalDate.of(year.intValue(), 1, 1); // 当年1月1日
|
||||||
|
LocalDate endDate = LocalDate.of(year.intValue(), 12, 31); // 当年12月31日
|
||||||
|
|
||||||
|
dateTimeRangeSo.setStart(Date.from(startDate.atStartOfDay(ZoneId.systemDefault()).toInstant()));
|
||||||
|
dateTimeRangeSo.setEnd(Date.from(endDate.atTime(LocalTime.MAX).atZone(ZoneId.systemDefault()).toInstant()));
|
||||||
|
|
||||||
|
pageSo.setDateTimeRangeSo(dateTimeRangeSo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ScreenPatrolVo get(Long year) {
|
||||||
|
ScreenPatrolVo res = new ScreenPatrolVo();
|
||||||
|
InspectTaskPageSo pageSo = new InspectTaskPageSo();
|
||||||
|
fillPageSoData(pageSo,year);
|
||||||
|
List<InspectTask> inspectTasks = service.getBaseMapper().listQuery(pageSo);
|
||||||
|
res.setYearCount(Long.valueOf(inspectTasks.size()));
|
||||||
|
|
||||||
|
//TODO 无人机次数,需要把无人机的需求完成,才能做
|
||||||
|
res.setDroneCount(0l);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -62,4 +62,11 @@ public class ScreenResponsibilityService {
|
||||||
.list();
|
.list();
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ResPerson> getFxPerson() {
|
||||||
|
List<ResPerson> list = resPersonService.lambdaQuery().in(ResPerson::getType, Arrays.asList(0, 3, 4))
|
||||||
|
.orderByDesc(ResPerson::getCreateTime)
|
||||||
|
.list();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.gunshi.project.ss.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.gunshi.project.ss.common.util.LocalDateTimeConverter;
|
||||||
|
import com.gunshi.project.ss.entity.vo.ScreenSecurityHidden;
|
||||||
|
import com.gunshi.project.ss.model.SafetyHazardInvest;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class ScreenSecurityHiddenService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SafetyHazardInvestService safetyHazardInvestService;
|
||||||
|
|
||||||
|
public ScreenSecurityHidden get(Long year) {
|
||||||
|
Map<Integer,Long> months = new LinkedHashMap<>();
|
||||||
|
for (int month = 1; month <= 12; month++) {
|
||||||
|
months.put(month, 0L);
|
||||||
|
}
|
||||||
|
ScreenSecurityHidden vo = new ScreenSecurityHidden();
|
||||||
|
// 使用LocalDate设置开始和结束日期
|
||||||
|
LocalDateTime startDate = LocalDateTime.of(year.intValue(), 1, 1,0,0 ); // 当年1月1日
|
||||||
|
LocalDateTime endDate = LocalDateTime.of(year.intValue(), 12, 31,23,59,59); // 当年12月31日
|
||||||
|
List<SafetyHazardInvest> list = safetyHazardInvestService.lambdaQuery()
|
||||||
|
.ge(SafetyHazardInvest::getHazardDate, LocalDateTimeConverter.toDate(startDate))
|
||||||
|
.le(SafetyHazardInvest::getHazardDate, LocalDateTimeConverter.toDate(endDate))
|
||||||
|
.orderByAsc(SafetyHazardInvest::getHazardDate)
|
||||||
|
.list();
|
||||||
|
if(list.isEmpty()){
|
||||||
|
vo.setFinishPercent(new BigDecimal("0.00"));
|
||||||
|
vo.setMonths(months);
|
||||||
|
vo.setTotalCount(0l);
|
||||||
|
vo.setFinishCount(0l);
|
||||||
|
vo.setNoFinishCount(0l);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
vo.setTotalCount(Long.valueOf(list.size()));
|
||||||
|
List<SafetyHazardInvest> isFinish = list.stream().filter(o -> o.getRecityFinishDate() != null).collect(Collectors.toList());
|
||||||
|
vo.setFinishCount(Long.valueOf(isFinish.size()));
|
||||||
|
vo.setNoFinishCount(vo.getTotalCount() - vo.getFinishCount());
|
||||||
|
vo.setFinishPercent(new BigDecimal(isFinish.size()).divide(new BigDecimal(list.size()), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")));
|
||||||
|
list.forEach(item -> {
|
||||||
|
if (item.getHazardDate() != null) {
|
||||||
|
Calendar cal = Calendar.getInstance();
|
||||||
|
cal.setTime(item.getHazardDate());
|
||||||
|
int month = cal.get(Calendar.MONTH) + 1; // Calendar月份从0开始
|
||||||
|
|
||||||
|
months.put(month, months.get(month) + 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
vo.setMonths(months);
|
||||||
|
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
package com.gunshi.project.ss.service;
|
package com.gunshi.project.ss.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.gunshi.project.ss.entity.vo.ScreenSecurityCheckVo;
|
||||||
import com.gunshi.project.ss.entity.vo.WholeCycleVo;
|
import com.gunshi.project.ss.entity.vo.WholeCycleVo;
|
||||||
import com.gunshi.project.ss.model.*;
|
import com.gunshi.project.ss.model.*;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -98,4 +101,32 @@ public class WholeCycleService {
|
||||||
res.setEmergencyFileIds(emergencyFileIds);
|
res.setEmergencyFileIds(emergencyFileIds);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SafetyIdentifyService service;//鉴定时间
|
||||||
|
|
||||||
|
public ScreenSecurityCheckVo getSecurity() {
|
||||||
|
ScreenSecurityCheckVo res = new ScreenSecurityCheckVo();
|
||||||
|
SafetyIdentify one = safetyIdentifyService.lambdaQuery().orderByDesc(SafetyIdentify::getIdentifyDate).last("limit 1").one();
|
||||||
|
//安全鉴定
|
||||||
|
if(one == null || one.getIdentifyType() == null){
|
||||||
|
res.setIdentifyType("无");
|
||||||
|
}else{
|
||||||
|
if(one.getIdentifyType() == 1){
|
||||||
|
res.setIdentifyType("一类坝");
|
||||||
|
}else if(one.getIdentifyType() == 2){
|
||||||
|
res.setIdentifyType("二类坝");
|
||||||
|
}else if(one.getIdentifyType() == 3){
|
||||||
|
res.setIdentifyType("三类坝");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SafetyIdentify safetyIdentify = service.lambdaQuery().orderByDesc(SafetyIdentify::getIdentifyDate)
|
||||||
|
.last("limit 1").one();
|
||||||
|
if(safetyIdentify != null){
|
||||||
|
res.setIdentifyDate(safetyIdentify.getIdentifyDate());
|
||||||
|
res.setNextVerifyDate(safetyIdentify.getNextVerifyDate());
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue