57 lines
1.9 KiB
Java
57 lines
1.9 KiB
Java
|
|
package com.gunshi.project.ss.service;
|
||
|
|
|
||
|
|
|
||
|
|
import com.gunshi.project.ss.common.model.StStbprpB;
|
||
|
|
import com.gunshi.project.ss.entity.vo.AttResBaseVo;
|
||
|
|
import com.gunshi.project.ss.entity.vo.ScreenRsvrVo;
|
||
|
|
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.math.BigDecimal;
|
||
|
|
import java.util.ArrayList;
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
@Service
|
||
|
|
@Slf4j
|
||
|
|
public class ScreenMoniotrService {
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private StStbprpBService stStbprpBService;
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private AttResBaseService attResBaseService;
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private ReservoirWaterService reservoirWaterService;
|
||
|
|
|
||
|
|
public List<ScreenRsvrVo> getScreenRsvr() {
|
||
|
|
//查询所有的水库水情站点
|
||
|
|
List<ScreenRsvrVo> res = new ArrayList<>();
|
||
|
|
List<AttResBaseVo> attResBaseVos = reservoirWaterService.listV2();
|
||
|
|
for (AttResBaseVo rsvrStation : attResBaseVos) {
|
||
|
|
ScreenRsvrVo entity = new ScreenRsvrVo();
|
||
|
|
entity.setStcd(rsvrStation.getStcd());
|
||
|
|
entity.setStnm(rsvrStation.getStnm());
|
||
|
|
entity.setLgtd(rsvrStation.getLgtd());
|
||
|
|
entity.setLttd(rsvrStation.getLttd());
|
||
|
|
BigDecimal rz = rsvrStation.getRz();
|
||
|
|
entity.setRz(rz);
|
||
|
|
BigDecimal nowCap = rsvrStation.getNowCap();
|
||
|
|
BigDecimal deadCap = rsvrStation.getDeadCap();
|
||
|
|
entity.setNowCap(rsvrStation.getNowCap());
|
||
|
|
if(nowCap != null && deadCap != null){
|
||
|
|
entity.setEffectiveCap(nowCap.subtract(deadCap));
|
||
|
|
}
|
||
|
|
BigDecimal flLowLimLev = rsvrStation.getFlLowLimLev();
|
||
|
|
entity.setFlLowLimLev(rsvrStation.getFlLowLimLev());
|
||
|
|
if(rz != null && flLowLimLev != null){
|
||
|
|
entity.setGapFlLowLimLev(rz.subtract(flLowLimLev));
|
||
|
|
}
|
||
|
|
res.add(entity);
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
}
|