parent
b22aad5ae8
commit
db2ca61f83
|
|
@ -3,6 +3,7 @@ package com.gunshi.project.hsz.controller;
|
|||
import com.gunshi.core.GunShiCoreProperties;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.core.session.entity.SessionUser;
|
||||
import com.gunshi.core.session.service.BaseSessionService;
|
||||
import com.gunshi.file.model.FileDescriptor;
|
||||
import com.gunshi.file.service.IFileService;
|
||||
import com.gunshi.file.service.LoginFileService;
|
||||
|
|
@ -76,8 +77,8 @@ public abstract class AbstractCommonFileController implements ICommonFileControl
|
|||
@Autowired
|
||||
private GunShiCoreProperties properties;
|
||||
|
||||
// @Autowired
|
||||
// private BaseSessionService sessionService;
|
||||
@Autowired
|
||||
private BaseSessionService sessionService;
|
||||
|
||||
@Override
|
||||
public IFileService getService() {
|
||||
|
|
@ -86,11 +87,16 @@ public abstract class AbstractCommonFileController implements ICommonFileControl
|
|||
|
||||
@Override
|
||||
public SessionUser checkLogin(HttpServletRequest request) {
|
||||
// String token = sessionService.getToken(request);
|
||||
// return sessionService.getSessionUser(token);
|
||||
SessionUser user = new SessionUser();
|
||||
user.setUserId(1L);
|
||||
return user;
|
||||
String token = sessionService.getToken(request);
|
||||
SessionUser sessionUser = null;
|
||||
if(token != null){
|
||||
sessionUser = sessionService.getSessionUser(token);
|
||||
}
|
||||
if(sessionUser == null){
|
||||
sessionUser = new SessionUser();
|
||||
sessionUser.setUserId(1L);
|
||||
}
|
||||
return sessionUser;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class RiverWaterController {
|
|||
@Autowired
|
||||
private RiverWaterService riverWaterService;
|
||||
|
||||
@Get(path = "/list", summary = "河道水情列表")
|
||||
@Get(path = "/get", summary = "河道水情上下游")
|
||||
public R<List<AttRvBaseVo>> list(@RequestParam("stcd") String stcd) {
|
||||
return R.ok(riverWaterService.list(stcd));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.WaterDispatchPageSo;
|
||||
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.WaterDispatch;
|
||||
import com.gunshi.project.hsz.model.XlPlan;
|
||||
|
|
@ -21,6 +22,7 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
|
||||
@Tag(name = "水量调度")
|
||||
|
|
@ -103,6 +105,13 @@ public class WaterDispatchController extends AbstractCommonFileController {
|
|||
return R.ok(res);
|
||||
}
|
||||
|
||||
@Operation(summary = "统计当年完成调度次数")
|
||||
@GetMapping("/count")
|
||||
public R<WdCountVo> getCount(){
|
||||
WdCountVo vo = waterDispatchService.getCount();
|
||||
return R.ok(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "waterDispatch";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ public interface ByLogDetailMapper extends BaseMapper<ByLogDetail> {
|
|||
|
||||
@Select("""
|
||||
<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
|
||||
from by_log_detail t1
|
||||
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);
|
||||
|
||||
@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
|
||||
from by_log_detail t1
|
||||
join pre_place_detail t2
|
||||
|
|
|
|||
|
|
@ -3,7 +3,19 @@ package com.gunshi.project.hsz.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.hsz.model.WaterDispatch;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
@Mapper
|
||||
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);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ package com.gunshi.project.hsz.service;
|
|||
|
||||
|
||||
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.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
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.model.WaterDispatch;
|
||||
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.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.Year;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
|
|
@ -90,4 +90,12 @@ public class WaterDispatchService extends ServiceImpl<WaterDispatchMapper, Water
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue