供水量列表接口增加返回属性
parent
fea40fa886
commit
3d4d591d89
|
|
@ -23,6 +23,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -134,10 +135,11 @@ public class StWaterRController {
|
|||
@Operation(summary = "生态流量监控-列表")
|
||||
@PostMapping("/ecologyFlowList")
|
||||
public R<List<StWaterR>> ecologyFlowList(@RequestBody @Validated StWaterR stWaterR) {
|
||||
List<StWaterR> list = new ArrayList<>();
|
||||
// 查询生态(放水管流量站QQ)
|
||||
StStbprpB stStbprpB = stStbprpBService.getOne(new QueryWrapper<StStbprpB>().eq("sttp", "QQ").last(" limit 1"));
|
||||
if(ObjectUtils.isEmpty(stStbprpB) || StringUtils.isEmpty(stStbprpB.getStcd())){
|
||||
return R.ok(new ArrayList<>());
|
||||
return R.ok(list);
|
||||
}
|
||||
QueryWrapper<StWaterR> wrapper = new QueryWrapper<StWaterR>()
|
||||
.eq("stcd", stStbprpB.getStcd())
|
||||
|
|
@ -146,7 +148,16 @@ public class StWaterRController {
|
|||
if(StringUtils.isNotBlank(stWaterR.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(stWaterR.getIsAsc()) ? false : stWaterR.getIsAsc(), stWaterR.getOrderField());
|
||||
}
|
||||
return R.ok(service.list(wrapper));
|
||||
list = service.list(wrapper);
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
ResMonthEcoFlow monthFlow = resMonthEcoFlowService.getOne(new QueryWrapper<ResMonthEcoFlow>().eq("month", Integer.valueOf(DateUtil.getYM().substring(4))));
|
||||
BigDecimal value = monthFlow.getValue();
|
||||
list.stream().forEach(w -> {
|
||||
w.setApprovalV(value);
|
||||
w.setIsStandard(w.getQ().compareTo(value) >= 0 ? "0" : "1");
|
||||
});
|
||||
}
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "生态流量监控-分页")
|
||||
|
|
|
|||
|
|
@ -59,6 +59,20 @@ public class StWaterR extends GenericPageParams implements Serializable {
|
|||
// @Size(max = 0,message = "流量最大长度要小于 0")
|
||||
private BigDecimal q;
|
||||
|
||||
/**
|
||||
* 核定流量
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description="核定流量")
|
||||
private BigDecimal approvalV;
|
||||
|
||||
/**
|
||||
* 是否达标
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description="是否达标(0是;1否)")
|
||||
private String isStandard;
|
||||
|
||||
/**
|
||||
* 水量
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue