67e69cf8 康伟

kangwei :对外集团展示大厅,生态效益接口

1 个父辈 4204d028
......@@ -16,6 +16,7 @@ import java.net.UnknownHostException;
@SpringBootApplication
public class SkApplication {
public static void main(String[] args) throws UnknownHostException, SchedulerException {
ConfigurableApplicationContext application = SpringApplication.run(SkApplication.class, args);
Environment env = application.getEnvironment();
......
......@@ -70,4 +70,15 @@ public class JTDisplayScreenController {
result.setResult(waterTrendVOList);
return result;
}
//生态效益
@AutoLog(value = "生态效益")
@ApiOperation(value = "生态效益", notes = "生态效益")
@GetMapping("/ecologyBenefit")
private Result<EcologyBenefitVO> ecologyBenefit(String departId, String startTime, String endTime){
Result<EcologyBenefitVO> result = new Result<>();
EcologyBenefitVO data = displayScreenService.ecologyBenefit(departId ,startTime ,endTime);
result.setResult(data);
return result;
}
}
......
......@@ -49,4 +49,13 @@ public interface IJTDisplayScreenService {
* @return
*/
List<WaterQualityChartVO> queryWaterQualityChart(String departId, String startTime, String endTime);
/***
* 生态效益
* @param departId
* @param startTime
* @param endTime
* @return
*/
EcologyBenefitVO ecologyBenefit(String departId, String startTime, String endTime);
}
......
......@@ -3,6 +3,7 @@ package com.skua.modules.threedimensional.service.impl;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.common.vo.DateVO;
import com.skua.modules.guest.util.DateUtil;
import com.skua.modules.threedimensional.service.IJTDisplayScreenService;
......@@ -164,6 +165,29 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
return waterTrendList;
}
/***
* 生态效益
* @param departId
* @param startTime
* @param endTime
* @return
*/
public EcologyBenefitVO ecologyBenefit(String departId, String startTime, String endTime){
//CSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"JSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN", departId, startTime,endTime);
String sql = "select round(sum( aaa.JSCOD -aaa.CSCOD ),2) 'cod', round(sum( aaa.JSZL -aaa.CSZL ),2) 'tp', round(sum( aaa.JSZD -aaa.CSTN ),2) 'tn' from "+dataViewName2119 +" aaa";
List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(sql);
EcologyBenefitVO ecologyBenefitVO = new EcologyBenefitVO(0d,0d,0d);
if(mapList != null ){
for(Map<String,Object> map : mapList ){
ecologyBenefitVO.setCodValue( ConvertUtils.getDouble(map.get("cod"),0));
ecologyBenefitVO.setTpValue( ConvertUtils.getDouble(map.get("tp"),0));
ecologyBenefitVO.setTnValue( ConvertUtils.getDouble(map.get("tn"),0));
}
}
return ecologyBenefitVO;
}
//CSL
/***
* 水质水量图标数据
......
package com.skua.modules.threedimensional.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value="对外集团展示大屏-生态效益", description="对外集团展示大屏-生态效益")
public class EcologyBenefitVO {
@ApiModelProperty(value = "cod总值")
public Double codValue;
@ApiModelProperty(value = "总磷")
public Double tpValue;
@ApiModelProperty(value = "总氮")
public Double tnValue;
// @ApiModelProperty(value = "值")
// public String adValue;
public EcologyBenefitVO(){
}
public EcologyBenefitVO(Double codValue, Double tpValue, Double tnValue) {
this.codValue = codValue;
this.tpValue = tpValue;
this.tnValue = tnValue;
}
}
......@@ -9,6 +9,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
......@@ -21,7 +23,7 @@ import java.util.List;
@Service
public class OperationReportServiceImpl implements IOperationReportService {
@Autowired
@Resource
private OperationReportMapper operationReportMapper;
/***
* 处理月季度数据
......@@ -32,6 +34,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
public ProductDataVO handeReportMonthData(Integer year, Integer season){
ProductDataVO productDataVO = new ProductDataVO();//返回结果
int lastYear = year - 1;//去年
productDataVO.setLastYear(lastYear);
SeasonTimeVO seasonTimeVO = new SeasonTimeVO(year ,season );
SeasonTimeVO lastSeasonTimeVO = new SeasonTimeVO(lastYear ,season );
......@@ -117,15 +120,10 @@ public class OperationReportServiceImpl implements IOperationReportService {
}
}
}
/****************实际水量、统计数量、百分比、平均值***********/
setChargeWater(productDataVO, chargeWaterVolume , lastYearChargeWaterVolume ,targetWater,disparityDay);
/****************实际水量、统计数量、百分比、平均值***********/
setYsjslWater(productDataVO, ysjslWaterVolume , tqysjslWaterVolume ,disparityDay);
}
/***
......@@ -195,8 +193,6 @@ public class OperationReportServiceImpl implements IOperationReportService {
}
}
/***
* 执行查询sql语句返回一个结果
* @param sql
......@@ -208,9 +204,6 @@ public class OperationReportServiceImpl implements IOperationReportService {
String result = masterDB.queryForObject(sql, String.class);
return result;
}
/***
* 根据记录获取:季度开始时间
* @param year
......
......@@ -14,7 +14,7 @@ import java.util.List;
@ApiModel(value="生产运营--运营数据", description="生产运营--月度生产数据报表")
public class ProductDataVO {
@ApiModelProperty(value = "去年")
private String lastYear;
private Integer lastYear;
@ApiModelProperty(value = "季度开始时间")
private String startTime;
......
......@@ -323,7 +323,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
for(Map<String,Object> map : mapList ){
YH = ConvertUtils.getString(map.get("YH"));
}
return YH!=null ? Double.parseDouble(YH) : null;
return ConvertUtils.getDouble(YH,0);// YH!=null ? Double.parseDouble(YH) : null;
}
private Double getCSL(String departId ,String startTime ,String endTime ){
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!