kangwei :对外集团展示大厅,生态效益接口
正在显示
8 个修改的文件
包含
82 行增加
和
13 行删除
... | @@ -16,6 +16,7 @@ import java.net.UnknownHostException; | ... | @@ -16,6 +16,7 @@ import java.net.UnknownHostException; |
16 | @SpringBootApplication | 16 | @SpringBootApplication |
17 | public class SkApplication { | 17 | public class SkApplication { |
18 | 18 | ||
19 | |||
19 | public static void main(String[] args) throws UnknownHostException, SchedulerException { | 20 | public static void main(String[] args) throws UnknownHostException, SchedulerException { |
20 | ConfigurableApplicationContext application = SpringApplication.run(SkApplication.class, args); | 21 | ConfigurableApplicationContext application = SpringApplication.run(SkApplication.class, args); |
21 | Environment env = application.getEnvironment(); | 22 | Environment env = application.getEnvironment(); | ... | ... |
... | @@ -70,4 +70,15 @@ public class JTDisplayScreenController { | ... | @@ -70,4 +70,15 @@ public class JTDisplayScreenController { |
70 | result.setResult(waterTrendVOList); | 70 | result.setResult(waterTrendVOList); |
71 | return result; | 71 | return result; |
72 | } | 72 | } |
73 | |||
74 | //生态效益 | ||
75 | @AutoLog(value = "生态效益") | ||
76 | @ApiOperation(value = "生态效益", notes = "生态效益") | ||
77 | @GetMapping("/ecologyBenefit") | ||
78 | private Result<EcologyBenefitVO> ecologyBenefit(String departId, String startTime, String endTime){ | ||
79 | Result<EcologyBenefitVO> result = new Result<>(); | ||
80 | EcologyBenefitVO data = displayScreenService.ecologyBenefit(departId ,startTime ,endTime); | ||
81 | result.setResult(data); | ||
82 | return result; | ||
83 | } | ||
73 | } | 84 | } | ... | ... |
... | @@ -49,4 +49,13 @@ public interface IJTDisplayScreenService { | ... | @@ -49,4 +49,13 @@ public interface IJTDisplayScreenService { |
49 | * @return | 49 | * @return |
50 | */ | 50 | */ |
51 | List<WaterQualityChartVO> queryWaterQualityChart(String departId, String startTime, String endTime); | 51 | List<WaterQualityChartVO> queryWaterQualityChart(String departId, String startTime, String endTime); |
52 | |||
53 | /*** | ||
54 | * 生态效益 | ||
55 | * @param departId | ||
56 | * @param startTime | ||
57 | * @param endTime | ||
58 | * @return | ||
59 | */ | ||
60 | EcologyBenefitVO ecologyBenefit(String departId, String startTime, String endTime); | ||
52 | } | 61 | } | ... | ... |
... | @@ -3,6 +3,7 @@ package com.skua.modules.threedimensional.service.impl; | ... | @@ -3,6 +3,7 @@ package com.skua.modules.threedimensional.service.impl; |
3 | import com.skua.common.report.ReportViewUtil; | 3 | import com.skua.common.report.ReportViewUtil; |
4 | import com.skua.core.context.SpringContextUtils; | 4 | import com.skua.core.context.SpringContextUtils; |
5 | 5 | ||
6 | import com.skua.core.util.ConvertUtils; | ||
6 | import com.skua.modules.common.vo.DateVO; | 7 | import com.skua.modules.common.vo.DateVO; |
7 | import com.skua.modules.guest.util.DateUtil; | 8 | import com.skua.modules.guest.util.DateUtil; |
8 | import com.skua.modules.threedimensional.service.IJTDisplayScreenService; | 9 | import com.skua.modules.threedimensional.service.IJTDisplayScreenService; |
... | @@ -164,6 +165,29 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService { | ... | @@ -164,6 +165,29 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService { |
164 | return waterTrendList; | 165 | return waterTrendList; |
165 | } | 166 | } |
166 | 167 | ||
168 | |||
169 | /*** | ||
170 | * 生态效益 | ||
171 | * @param departId | ||
172 | * @param startTime | ||
173 | * @param endTime | ||
174 | * @return | ||
175 | */ | ||
176 | public EcologyBenefitVO ecologyBenefit(String departId, String startTime, String endTime){ | ||
177 | //CSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD | ||
178 | String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"JSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN", departId, startTime,endTime); | ||
179 | 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"; | ||
180 | List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(sql); | ||
181 | EcologyBenefitVO ecologyBenefitVO = new EcologyBenefitVO(0d,0d,0d); | ||
182 | if(mapList != null ){ | ||
183 | for(Map<String,Object> map : mapList ){ | ||
184 | ecologyBenefitVO.setCodValue( ConvertUtils.getDouble(map.get("cod"),0)); | ||
185 | ecologyBenefitVO.setTpValue( ConvertUtils.getDouble(map.get("tp"),0)); | ||
186 | ecologyBenefitVO.setTnValue( ConvertUtils.getDouble(map.get("tn"),0)); | ||
187 | } | ||
188 | } | ||
189 | return ecologyBenefitVO; | ||
190 | } | ||
167 | //CSL | 191 | //CSL |
168 | /*** | 192 | /*** |
169 | * 水质水量图标数据 | 193 | * 水质水量图标数据 | ... | ... |
1 | package com.skua.modules.threedimensional.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModel; | ||
4 | import io.swagger.annotations.ApiModelProperty; | ||
5 | import lombok.Data; | ||
6 | |||
7 | @Data | ||
8 | @ApiModel(value="对外集团展示大屏-生态效益", description="对外集团展示大屏-生态效益") | ||
9 | public class EcologyBenefitVO { | ||
10 | |||
11 | @ApiModelProperty(value = "cod总值") | ||
12 | public Double codValue; | ||
13 | |||
14 | @ApiModelProperty(value = "总磷") | ||
15 | public Double tpValue; | ||
16 | |||
17 | @ApiModelProperty(value = "总氮") | ||
18 | public Double tnValue; | ||
19 | |||
20 | // @ApiModelProperty(value = "值") | ||
21 | // public String adValue; | ||
22 | public EcologyBenefitVO(){ | ||
23 | |||
24 | } | ||
25 | |||
26 | public EcologyBenefitVO(Double codValue, Double tpValue, Double tnValue) { | ||
27 | this.codValue = codValue; | ||
28 | this.tpValue = tpValue; | ||
29 | this.tnValue = tnValue; | ||
30 | } | ||
31 | } |
... | @@ -9,6 +9,8 @@ import org.apache.commons.lang3.StringUtils; | ... | @@ -9,6 +9,8 @@ import org.apache.commons.lang3.StringUtils; |
9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
10 | import org.springframework.jdbc.core.JdbcTemplate; | 10 | import org.springframework.jdbc.core.JdbcTemplate; |
11 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
12 | |||
13 | import javax.annotation.Resource; | ||
12 | import java.math.BigDecimal; | 14 | import java.math.BigDecimal; |
13 | import java.math.RoundingMode; | 15 | import java.math.RoundingMode; |
14 | import java.time.LocalDate; | 16 | import java.time.LocalDate; |
... | @@ -21,7 +23,7 @@ import java.util.List; | ... | @@ -21,7 +23,7 @@ import java.util.List; |
21 | @Service | 23 | @Service |
22 | public class OperationReportServiceImpl implements IOperationReportService { | 24 | public class OperationReportServiceImpl implements IOperationReportService { |
23 | 25 | ||
24 | @Autowired | 26 | @Resource |
25 | private OperationReportMapper operationReportMapper; | 27 | private OperationReportMapper operationReportMapper; |
26 | /*** | 28 | /*** |
27 | * 处理月季度数据 | 29 | * 处理月季度数据 |
... | @@ -32,6 +34,7 @@ public class OperationReportServiceImpl implements IOperationReportService { | ... | @@ -32,6 +34,7 @@ public class OperationReportServiceImpl implements IOperationReportService { |
32 | public ProductDataVO handeReportMonthData(Integer year, Integer season){ | 34 | public ProductDataVO handeReportMonthData(Integer year, Integer season){ |
33 | ProductDataVO productDataVO = new ProductDataVO();//返回结果 | 35 | ProductDataVO productDataVO = new ProductDataVO();//返回结果 |
34 | int lastYear = year - 1;//去年 | 36 | int lastYear = year - 1;//去年 |
37 | productDataVO.setLastYear(lastYear); | ||
35 | SeasonTimeVO seasonTimeVO = new SeasonTimeVO(year ,season ); | 38 | SeasonTimeVO seasonTimeVO = new SeasonTimeVO(year ,season ); |
36 | SeasonTimeVO lastSeasonTimeVO = new SeasonTimeVO(lastYear ,season ); | 39 | SeasonTimeVO lastSeasonTimeVO = new SeasonTimeVO(lastYear ,season ); |
37 | 40 | ||
... | @@ -117,15 +120,10 @@ public class OperationReportServiceImpl implements IOperationReportService { | ... | @@ -117,15 +120,10 @@ public class OperationReportServiceImpl implements IOperationReportService { |
117 | } | 120 | } |
118 | } | 121 | } |
119 | } | 122 | } |
120 | |||
121 | /****************实际水量、统计数量、百分比、平均值***********/ | 123 | /****************实际水量、统计数量、百分比、平均值***********/ |
122 | setChargeWater(productDataVO, chargeWaterVolume , lastYearChargeWaterVolume ,targetWater,disparityDay); | 124 | setChargeWater(productDataVO, chargeWaterVolume , lastYearChargeWaterVolume ,targetWater,disparityDay); |
123 | |||
124 | |||
125 | /****************实际水量、统计数量、百分比、平均值***********/ | 125 | /****************实际水量、统计数量、百分比、平均值***********/ |
126 | setYsjslWater(productDataVO, ysjslWaterVolume , tqysjslWaterVolume ,disparityDay); | 126 | setYsjslWater(productDataVO, ysjslWaterVolume , tqysjslWaterVolume ,disparityDay); |
127 | |||
128 | |||
129 | } | 127 | } |
130 | 128 | ||
131 | /*** | 129 | /*** |
... | @@ -195,8 +193,6 @@ public class OperationReportServiceImpl implements IOperationReportService { | ... | @@ -195,8 +193,6 @@ public class OperationReportServiceImpl implements IOperationReportService { |
195 | } | 193 | } |
196 | 194 | ||
197 | } | 195 | } |
198 | |||
199 | |||
200 | /*** | 196 | /*** |
201 | * 执行查询sql语句返回一个结果 | 197 | * 执行查询sql语句返回一个结果 |
202 | * @param sql | 198 | * @param sql |
... | @@ -208,9 +204,6 @@ public class OperationReportServiceImpl implements IOperationReportService { | ... | @@ -208,9 +204,6 @@ public class OperationReportServiceImpl implements IOperationReportService { |
208 | String result = masterDB.queryForObject(sql, String.class); | 204 | String result = masterDB.queryForObject(sql, String.class); |
209 | return result; | 205 | return result; |
210 | } | 206 | } |
211 | |||
212 | |||
213 | |||
214 | /*** | 207 | /*** |
215 | * 根据记录获取:季度开始时间 | 208 | * 根据记录获取:季度开始时间 |
216 | * @param year | 209 | * @param year | ... | ... |
... | @@ -14,7 +14,7 @@ import java.util.List; | ... | @@ -14,7 +14,7 @@ import java.util.List; |
14 | @ApiModel(value="生产运营--运营数据", description="生产运营--月度生产数据报表") | 14 | @ApiModel(value="生产运营--运营数据", description="生产运营--月度生产数据报表") |
15 | public class ProductDataVO { | 15 | public class ProductDataVO { |
16 | @ApiModelProperty(value = "去年") | 16 | @ApiModelProperty(value = "去年") |
17 | private String lastYear; | 17 | private Integer lastYear; |
18 | 18 | ||
19 | @ApiModelProperty(value = "季度开始时间") | 19 | @ApiModelProperty(value = "季度开始时间") |
20 | private String startTime; | 20 | private String startTime; | ... | ... |
... | @@ -323,7 +323,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly | ... | @@ -323,7 +323,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly |
323 | for(Map<String,Object> map : mapList ){ | 323 | for(Map<String,Object> map : mapList ){ |
324 | YH = ConvertUtils.getString(map.get("YH")); | 324 | YH = ConvertUtils.getString(map.get("YH")); |
325 | } | 325 | } |
326 | return YH!=null ? Double.parseDouble(YH) : null; | 326 | return ConvertUtils.getDouble(YH,0);// YH!=null ? Double.parseDouble(YH) : null; |
327 | } | 327 | } |
328 | 328 | ||
329 | private Double getCSL(String departId ,String startTime ,String endTime ){ | 329 | private Double getCSL(String departId ,String startTime ,String endTime ){ | ... | ... |
-
请 注册 或 登录 后发表评论