1 白蚁-日志-bug修改

2 水量调度新增年度完成次数统计接口
master
yangzhe123 2025-09-08 15:43:17 +08:00
parent b22aad5ae8
commit db2ca61f83
7 changed files with 62 additions and 12 deletions

View File

@ -3,6 +3,7 @@ package com.gunshi.project.hsz.controller;
import com.gunshi.core.GunShiCoreProperties; import com.gunshi.core.GunShiCoreProperties;
import com.gunshi.core.result.R; import com.gunshi.core.result.R;
import com.gunshi.core.session.entity.SessionUser; import com.gunshi.core.session.entity.SessionUser;
import com.gunshi.core.session.service.BaseSessionService;
import com.gunshi.file.model.FileDescriptor; import com.gunshi.file.model.FileDescriptor;
import com.gunshi.file.service.IFileService; import com.gunshi.file.service.IFileService;
import com.gunshi.file.service.LoginFileService; import com.gunshi.file.service.LoginFileService;
@ -76,8 +77,8 @@ public abstract class AbstractCommonFileController implements ICommonFileControl
@Autowired @Autowired
private GunShiCoreProperties properties; private GunShiCoreProperties properties;
// @Autowired @Autowired
// private BaseSessionService sessionService; private BaseSessionService sessionService;
@Override @Override
public IFileService getService() { public IFileService getService() {
@ -86,11 +87,16 @@ public abstract class AbstractCommonFileController implements ICommonFileControl
@Override @Override
public SessionUser checkLogin(HttpServletRequest request) { public SessionUser checkLogin(HttpServletRequest request) {
// String token = sessionService.getToken(request); String token = sessionService.getToken(request);
// return sessionService.getSessionUser(token); SessionUser sessionUser = null;
SessionUser user = new SessionUser(); if(token != null){
user.setUserId(1L); sessionUser = sessionService.getSessionUser(token);
return user; }
if(sessionUser == null){
sessionUser = new SessionUser();
sessionUser.setUserId(1L);
}
return sessionUser;
} }
@Override @Override

View File

@ -36,7 +36,7 @@ public class RiverWaterController {
@Autowired @Autowired
private RiverWaterService riverWaterService; private RiverWaterService riverWaterService;
@Get(path = "/list", summary = "河道水情列表") @Get(path = "/get", summary = "河道水情上下游")
public R<List<AttRvBaseVo>> list(@RequestParam("stcd") String stcd) { public R<List<AttRvBaseVo>> list(@RequestParam("stcd") String stcd) {
return R.ok(riverWaterService.list(stcd)); return R.ok(riverWaterService.list(stcd));
} }

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gunshi.core.result.R; import com.gunshi.core.result.R;
import com.gunshi.project.hsz.entity.so.WaterDispatchPageSo; import com.gunshi.project.hsz.entity.so.WaterDispatchPageSo;
import com.gunshi.project.hsz.entity.so.XlPlanPageSo; import com.gunshi.project.hsz.entity.so.XlPlanPageSo;
import com.gunshi.project.hsz.entity.vo.WdCountVo;
import com.gunshi.project.hsz.model.IaCDanad; import com.gunshi.project.hsz.model.IaCDanad;
import com.gunshi.project.hsz.model.WaterDispatch; import com.gunshi.project.hsz.model.WaterDispatch;
import com.gunshi.project.hsz.model.XlPlan; import com.gunshi.project.hsz.model.XlPlan;
@ -21,6 +22,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects; import java.util.Objects;
@Tag(name = "水量调度") @Tag(name = "水量调度")
@ -103,6 +105,13 @@ public class WaterDispatchController extends AbstractCommonFileController {
return R.ok(res); return R.ok(res);
} }
@Operation(summary = "统计当年完成调度次数")
@GetMapping("/count")
public R<WdCountVo> getCount(){
WdCountVo vo = waterDispatchService.getCount();
return R.ok(vo);
}
@Override @Override
public String getGroupId() { public String getGroupId() {
return "waterDispatch"; return "waterDispatch";

View File

@ -0,0 +1,15 @@
package com.gunshi.project.hsz.entity.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "水量调度年度完成次数返回Vo")
public class WdCountVo {
@Schema(description = "年份")
private String year;
@Schema(description = "完成数量")
private Integer count;
}

View File

@ -15,7 +15,7 @@ public interface ByLogDetailMapper extends BaseMapper<ByLogDetail> {
@Select(""" @Select("""
<script> <script>
select t1.id,t1.by_log_id,t1.pre_place_detail_id as ppdi,t1.pre_person,t1.pre_method,t1.pre_effect,t1.pre_person_name select t1.id,t1.by_log_id,t1.pre_place_detail_id as ppdi,t1.pre_person,t1.pre_method,t1.pre_effect,t1.pre_person_name,
t2.detail_name as ppdn,t3.id as ppi,t3.pre_name as ppn t2.detail_name as ppdn,t3.id as ppi,t3.pre_name as ppn
from by_log_detail t1 from by_log_detail t1
join pre_place_detail t2 join pre_place_detail t2
@ -31,7 +31,7 @@ public interface ByLogDetailMapper extends BaseMapper<ByLogDetail> {
List<ByLogDetail> selectDetail(@Param("logId") Long id,@Param("dto") ByLogPageSo pageSo); List<ByLogDetail> selectDetail(@Param("logId") Long id,@Param("dto") ByLogPageSo pageSo);
@Select(""" @Select("""
select t1.id,t1.by_log_id,t1.pre_place_detail_id as ppdi,t1.pre_person,t1.pre_method,t1.pre_effect,t1.pre_person_name select t1.id,t1.by_log_id,t1.pre_place_detail_id as ppdi,t1.pre_person,t1.pre_method,t1.pre_effect,t1.pre_person_name,
t2.detail_name as ppdn,t3.id as ppi,t3.pre_name as ppn t2.detail_name as ppdn,t3.id as ppi,t3.pre_name as ppn
from by_log_detail t1 from by_log_detail t1
join pre_place_detail t2 join pre_place_detail t2

View File

@ -3,7 +3,19 @@ package com.gunshi.project.hsz.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gunshi.project.hsz.model.WaterDispatch; import com.gunshi.project.hsz.model.WaterDispatch;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper @Mapper
public interface WaterDispatchMapper extends BaseMapper<WaterDispatch> { public interface WaterDispatchMapper extends BaseMapper<WaterDispatch> {
@Select("""
SELECT COUNT(*)
FROM water_dispatch
WHERE EXTRACT(YEAR FROM dis_start) = #{year}
AND exe_status = 0
""")
int countCompeleteByYear(@Param("year") int currYear);
} }

View File

@ -2,11 +2,11 @@ package com.gunshi.project.hsz.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gunshi.project.hsz.entity.so.WaterDispatchPageSo; import com.gunshi.project.hsz.entity.so.WaterDispatchPageSo;
import com.gunshi.project.hsz.entity.vo.WdCountVo;
import com.gunshi.project.hsz.mapper.WaterDispatchMapper; import com.gunshi.project.hsz.mapper.WaterDispatchMapper;
import com.gunshi.project.hsz.model.WaterDispatch; import com.gunshi.project.hsz.model.WaterDispatch;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
@ -16,8 +16,8 @@ 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.time.Year;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Objects; import java.util.Objects;
@Service @Service
@ -90,4 +90,12 @@ public class WaterDispatchService extends ServiceImpl<WaterDispatchMapper, Water
return waterDispatchPage; return waterDispatchPage;
} }
public WdCountVo getCount() {
int currYear = Year.now().getValue();
int count = baseMapper.countCompeleteByYear(currYear);
WdCountVo vo = new WdCountVo();
vo.setYear(String.valueOf(currYear));
vo.setCount(count);
return vo;
}
} }