兴利计划-水量调度
parent
ed19e7e57d
commit
a4a2ff45a2
|
|
@ -58,8 +58,8 @@ public class WaterDispatchController extends AbstractCommonFileController {
|
|||
}
|
||||
|
||||
@Operation(summary = "反馈")
|
||||
@PostMapping("feedback")
|
||||
public R<WaterDispatch> feedback(@Validated(Update.class) @RequestBody WaterDispatch dto) {
|
||||
@PostMapping("/feedback")
|
||||
public R<WaterDispatch> feedback(@RequestBody WaterDispatch dto) {
|
||||
boolean flag = waterDispatchService.feedBack(dto);
|
||||
if(flag){
|
||||
fileService.saveFile(dto.getFiles(),getGroupId(),dto.getId().toString());
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ public class XlPlanController extends AbstractCommonFileController {
|
|||
|
||||
@Operation(summary = "列表")
|
||||
@GetMapping("/list")
|
||||
public R<List<XlPlan>> list(@RequestBody XlPlanPageSo pageSo) {
|
||||
public R<List<XlPlan>> list() {
|
||||
List<XlPlan> list = xlPlanService.lambdaQuery().list();
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
list.forEach(o -> o.setFiles(fileService.getFiles(getGroupId(),o.getId().toString())));
|
||||
|
|
|
|||
|
|
@ -107,8 +107,7 @@ public class WaterDispatch {
|
|||
*/
|
||||
@TableField("res_fb")
|
||||
@Schema(description = "执行结果反馈")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date resFb;
|
||||
private String resFb;
|
||||
|
||||
/**
|
||||
* 是否完成 0是 1否
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class WaterCountAnalysisService {
|
|||
private StZvarlBService stZvarlBService;//水位-库容
|
||||
|
||||
@Autowired
|
||||
private StRsvrRService stRsvrRService;
|
||||
private StRsvrRService stRsvrRService;//水库历史水位
|
||||
|
||||
|
||||
public List<WaterAnalysisVo> waterSupplyAnalysis(Serializable id) {
|
||||
|
|
@ -78,8 +78,9 @@ public class WaterCountAnalysisService {
|
|||
}
|
||||
|
||||
public List<WaterDispatch> waterDispatchAnalysis(Serializable year) {
|
||||
List<WaterDispatch> list = waterDispatchService.listByYear(year.toString());
|
||||
return list;
|
||||
return waterDispatchService.lambdaQuery().apply("EXTRACT(YEAR FROM dis_start) = {0}", year)
|
||||
.in(WaterDispatch::getExeStatus, 0, 2)
|
||||
.list();
|
||||
}
|
||||
|
||||
public List<WaterCapacityAnalysisVo> waterCapacityAnalysis(DateRangeSo dateRangeSo){
|
||||
|
|
|
|||
|
|
@ -2,16 +2,21 @@ 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.mapper.WaterDispatchMapper;
|
||||
import com.gunshi.project.hsz.model.WaterDispatch;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -19,6 +24,10 @@ import java.util.Objects;
|
|||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class WaterDispatchService extends ServiceImpl<WaterDispatchMapper, WaterDispatch> {
|
||||
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
public boolean saveData(WaterDispatch dto) {
|
||||
LambdaQueryWrapper<WaterDispatch> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(WaterDispatch::getName, dto.getName());
|
||||
|
|
@ -26,6 +35,12 @@ public class WaterDispatchService extends ServiceImpl<WaterDispatchMapper, Water
|
|||
if(Objects.nonNull(one)){
|
||||
throw new IllegalArgumentException("该调度已存在");
|
||||
}
|
||||
if(dto.getExePersonId() != null){
|
||||
SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(dto.getExePersonId()));
|
||||
if(sysUser != null){
|
||||
dto.setExePersonName(sysUser.getNickName());
|
||||
}
|
||||
}
|
||||
if(dto.getIsDistribute() == 0){//如果选择下发
|
||||
dto.setExeStatus(2);//状态改为下发中
|
||||
}else{
|
||||
|
|
@ -43,6 +58,7 @@ public class WaterDispatchService extends ServiceImpl<WaterDispatchMapper, Water
|
|||
if(dto.getIsCompelete() == 0){
|
||||
dto.setExeStatus(0);
|
||||
}
|
||||
dto.setFillTime(new Date());
|
||||
updateById(dto);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -52,6 +68,12 @@ public class WaterDispatchService extends ServiceImpl<WaterDispatchMapper, Water
|
|||
if(byId == null){
|
||||
throw new IllegalArgumentException("抱歉,该调度不存在");
|
||||
}
|
||||
if(dto.getExePersonId() != null){
|
||||
SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(dto.getExePersonId()));
|
||||
if(sysUser != null){
|
||||
dto.setExePersonName(sysUser.getNickName());
|
||||
}
|
||||
}
|
||||
updateById(dto);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -68,7 +90,4 @@ public class WaterDispatchService extends ServiceImpl<WaterDispatchMapper, Water
|
|||
return waterDispatchPage;
|
||||
}
|
||||
|
||||
public List<WaterDispatch> listByYear(String year) {
|
||||
return this.lambdaQuery().eq(WaterDispatch::getDisYear, year).in(WaterDispatch::getExeStatus,0,2).list();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue