安环及报表问题修改
正在显示
9 个修改的文件
包含
41 行增加
和
25 行删除
... | @@ -8,6 +8,7 @@ import com.skua.core.api.vo.Result; | ... | @@ -8,6 +8,7 @@ import com.skua.core.api.vo.Result; |
8 | import com.skua.core.aspect.annotation.AutoLog; | 8 | import com.skua.core.aspect.annotation.AutoLog; |
9 | import com.skua.core.context.BaseContextHandler; | 9 | import com.skua.core.context.BaseContextHandler; |
10 | import com.skua.core.query.QueryGenerator; | 10 | import com.skua.core.query.QueryGenerator; |
11 | import com.skua.core.util.ConvertUtils; | ||
11 | import com.skua.modules.ajh.dto.AjhRectificationInfoAnalyseQueryDto; | 12 | import com.skua.modules.ajh.dto.AjhRectificationInfoAnalyseQueryDto; |
12 | import com.skua.modules.ajh.dto.AjhRectificationInfoMendDto; | 13 | import com.skua.modules.ajh.dto.AjhRectificationInfoMendDto; |
13 | import com.skua.modules.ajh.entity.AjhRectificationInfo; | 14 | import com.skua.modules.ajh.entity.AjhRectificationInfo; |
... | @@ -72,6 +73,7 @@ public class AjhRectificationInfoController { | ... | @@ -72,6 +73,7 @@ public class AjhRectificationInfoController { |
72 | ajhRectificationInfo.setDepartId(BaseContextHandler.getDeparts()); | 73 | ajhRectificationInfo.setDepartId(BaseContextHandler.getDeparts()); |
73 | } | 74 | } |
74 | QueryWrapper<AjhRectificationInfo> queryWrapper = QueryGenerator.initQueryWrapper(ajhRectificationInfo, req.getParameterMap()); | 75 | QueryWrapper<AjhRectificationInfo> queryWrapper = QueryGenerator.initQueryWrapper(ajhRectificationInfo, req.getParameterMap()); |
76 | queryWrapper.eq(ConvertUtils.isNotEmpty(ajhRectificationInfo.getDangerId()),"danger_id",ajhRectificationInfo.getDangerId()); | ||
75 | queryWrapper.orderByDesc("rec_ord_level");//重大风险排前面 | 77 | queryWrapper.orderByDesc("rec_ord_level");//重大风险排前面 |
76 | Page<AjhRectificationInfo> page = new Page<AjhRectificationInfo>(pageNo, pageSize); | 78 | Page<AjhRectificationInfo> page = new Page<AjhRectificationInfo>(pageNo, pageSize); |
77 | IPage<AjhRectificationInfo> pageList = ajhRectificationInfoService.page(page, queryWrapper); | 79 | IPage<AjhRectificationInfo> pageList = ajhRectificationInfoService.page(page, queryWrapper); | ... | ... |
... | @@ -55,6 +55,7 @@ public class AjhRectificationInfo extends FlowEntity { | ... | @@ -55,6 +55,7 @@ public class AjhRectificationInfo extends FlowEntity { |
55 | /**风险库关联ID*/ | 55 | /**风险库关联ID*/ |
56 | @Excel(name = "风险库关联ID", width = 15) | 56 | @Excel(name = "风险库关联ID", width = 15) |
57 | @ApiModelProperty(value = "风险库关联ID") | 57 | @ApiModelProperty(value = "风险库关联ID") |
58 | @Dict(dicCode = "id",dictTable="danger_level_manage",dicText="danger_name") | ||
58 | private String dangerId; | 59 | private String dangerId; |
59 | /**验收人*/ | 60 | /**验收人*/ |
60 | @Excel(name = "验收人", width = 15) | 61 | @Excel(name = "验收人", width = 15) | ... | ... |
... | @@ -91,7 +91,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -91,7 +91,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
91 | String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, dataTime); | 91 | String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, dataTime); |
92 | String dataViewName3a24tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbYear); | 92 | String dataViewName3a24tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbYear); |
93 | 93 | ||
94 | String field4411 = "yslwcbl,ysjsldyqntqyy,qntqsfsl,ysfsl,sfsldbbhl,sldyyqyy,dhgyqntqyy,yyf,yhgyqntqyy,dhcmbzyy,yhcyqyy"; | 94 | String field4411 = "yslwcbl,ysjsldyqntqyy,qntqsfsl,ysfsl,sfsldbbhl,sldyyqyy,dhgyqntqyy,yyf,yhgyqntqyy,dhcmbzyy,yhcyqyy,df,sbwhf"; |
95 | String dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,field4411, departId, dataTime); | 95 | String dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,field4411, departId, dataTime); |
96 | String dataViewName4411tb = ReportViewUtil.buildViewLike(ReportConstant.view4411,"qntqsfsl", departId, tbYear); | 96 | String dataViewName4411tb = ReportViewUtil.buildViewLike(ReportConstant.view4411,"qntqsfsl", departId, tbYear); |
97 | //主库数据源 | 97 | //主库数据源 |
... | @@ -118,7 +118,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -118,7 +118,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
118 | " v6.yhgyqntqyy, " + | 118 | " v6.yhgyqntqyy, " + |
119 | " rtc.target_power as bndhmb, " + | 119 | " rtc.target_power as bndhmb, " + |
120 | " round(y.dlhj_year/sum(v1.CSL),2) as bnsjdh, " + | 120 | " round(y.dlhj_year/sum(v1.CSL),2) as bnsjdh, " + |
121 | " v6.dhcmbzyy, " + | 121 | " v6.dhcmbzyy,v6.df,v6.sbwhf, " + |
122 | " rtc.target_drug as bnyhmb, " + | 122 | " rtc.target_drug as bnyhmb, " + |
123 | " round(y.yjhl_year/sum(v1.CSL),2) as bnsjyh, " + | 123 | " round(y.yjhl_year/sum(v1.CSL),2) as bnsjyh, " + |
124 | " v6.yhcyqyy " + | 124 | " v6.yhcyqyy " + |
... | @@ -153,7 +153,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -153,7 +153,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
153 | " ) v5 on v5.month_tb = right(left(v1.time,7),2) " + | 153 | " ) v5 on v5.month_tb = right(left(v1.time,7),2) " + |
154 | " left join ( " + | 154 | " left join ( " + |
155 | " select v4411.time,v4411.yslwcbl,v4411.ysjsldyqntqyy,v4411.qntqsfsl,v4411.ysfsl,v4411.sfsldbbhl,v4411.sldyyqyy," + | 155 | " select v4411.time,v4411.yslwcbl,v4411.ysjsldyqntqyy,v4411.qntqsfsl,v4411.ysfsl,v4411.sfsldbbhl,v4411.sldyyqyy," + |
156 | " v4411.dhgyqntqyy,v4411.yyf,v4411.yhgyqntqyy,v4411.dhcmbzyy,v4411.yhcyqyy " + | 156 | " v4411.dhgyqntqyy,v4411.yyf,v4411.yhgyqntqyy,v4411.dhcmbzyy,v4411.yhcyqyy,v4411.df,v4411.sbwhf " + |
157 | " from "+dataViewName4411+" v4411 " + | 157 | " from "+dataViewName4411+" v4411 " + |
158 | " where v4411.depart_id = '"+departId+"' and v4411.time like CONCAT('"+dataTime+"','%')) v6 on right(left(v6.time,7),2)=right(left(v1.time,7),2) " + | 158 | " where v4411.depart_id = '"+departId+"' and v4411.time like CONCAT('"+dataTime+"','%')) v6 on right(left(v6.time,7),2)=right(left(v1.time,7),2) " + |
159 | " left join ( " + | 159 | " left join ( " + | ... | ... |
... | @@ -59,7 +59,7 @@ public class ReportDataController { | ... | @@ -59,7 +59,7 @@ public class ReportDataController { |
59 | } | 59 | } |
60 | //同步修改生产运营月报 | 60 | //同步修改生产运营月报 |
61 | if(dataList.size() > 0){ | 61 | if(dataList.size() > 0){ |
62 | reportDataService.syncUpdateScybData(dataList.get(0).get("departId"),dataList.get(0).get("time")); | 62 | reportDataService.syncUpdateScybData(dataList.get(0).get("departId"),dataList.get(0).get("time"),ReportConstant.view4411); |
63 | } | 63 | } |
64 | return Result.ok("报表批量添加成功"); | 64 | return Result.ok("报表批量添加成功"); |
65 | } | 65 | } | ... | ... |
... | @@ -11,5 +11,5 @@ public interface IReportDataService { | ... | @@ -11,5 +11,5 @@ public interface IReportDataService { |
11 | void insertOrUpdateReportData(String departId, String time, Map<String, String> data, String reportId); | 11 | void insertOrUpdateReportData(String departId, String time, Map<String, String> data, String reportId); |
12 | 12 | ||
13 | @Async | 13 | @Async |
14 | void syncUpdateScybData(String departId,String time); | 14 | void syncUpdateScybData(String departId,String time,String reportId); |
15 | } | 15 | } | ... | ... |
... | @@ -94,7 +94,7 @@ public class ReportDataServiceImpl implements IReportDataService { | ... | @@ -94,7 +94,7 @@ public class ReportDataServiceImpl implements IReportDataService { |
94 | } | 94 | } |
95 | 95 | ||
96 | @Override | 96 | @Override |
97 | public void syncUpdateScybData(String departId,String dataTime) { | 97 | public void syncUpdateScybData(String departId,String dataTime,String reportId) { |
98 | String year = dataTime.split("-")[0]; | 98 | String year = dataTime.split("-")[0]; |
99 | List<Map<String, Object>> valueList = fCustomReportDatasetService.getDataFromHY(year, departId); | 99 | List<Map<String, Object>> valueList = fCustomReportDatasetService.getDataFromHY(year, departId); |
100 | List<Map<String, String>> list = new ArrayList<>(); | 100 | List<Map<String, String>> list = new ArrayList<>(); |
... | @@ -109,7 +109,6 @@ public class ReportDataServiceImpl implements IReportDataService { | ... | @@ -109,7 +109,6 @@ public class ReportDataServiceImpl implements IReportDataService { |
109 | list.add(newMap); | 109 | list.add(newMap); |
110 | } | 110 | } |
111 | for (Map<String, String> data : list) { | 111 | for (Map<String, String> data : list) { |
112 | String reportId = ConvertUtils.getString(data.get("reportId")); | ||
113 | String time = ConvertUtils.getString(data.get("time")); | 112 | String time = ConvertUtils.getString(data.get("time")); |
114 | insertOrUpdateReportData(departId, time, data, reportId); | 113 | insertOrUpdateReportData(departId, time, data, reportId); |
115 | } | 114 | } | ... | ... |
... | @@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletRequest; | ... | @@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletRequest; |
13 | import javax.servlet.http.HttpServletResponse; | 13 | import javax.servlet.http.HttpServletResponse; |
14 | 14 | ||
15 | import com.alibaba.fastjson.JSONObject; | 15 | import com.alibaba.fastjson.JSONObject; |
16 | import com.skua.core.util.ConvertUtils; | ||
16 | import com.skua.modules.common.service.ICommonSqlService; | 17 | import com.skua.modules.common.service.ICommonSqlService; |
17 | import com.skua.modules.system.service.ISysAreaService; | 18 | import com.skua.modules.system.service.ISysAreaService; |
18 | import com.skua.modules.system.service.ISysDictService; | 19 | import com.skua.modules.system.service.ISysDictService; |
... | @@ -481,6 +482,19 @@ public class SysFactoryInfoController { | ... | @@ -481,6 +482,19 @@ public class SysFactoryInfoController { |
481 | @GetMapping(value = "/queryByDepartId") | 482 | @GetMapping(value = "/queryByDepartId") |
482 | public Result queryByDepartId(@RequestParam(name = "departId", required = true) String departId) { | 483 | public Result queryByDepartId(@RequestParam(name = "departId", required = true) String departId) { |
483 | Result result = new Result(); | 484 | Result result = new Result(); |
485 | SysFactoryInfoVO sysFactoryInfo = sysFactoryInfoService.getByDepartId(departId); | ||
486 | JSONObject jsonObject = sysDictService.translateTDictValue(sysFactoryInfo); | ||
487 | if (sysFactoryInfo == null) { | ||
488 | departId = getDepart(BaseContextHandler.getRealDepartId()); | ||
489 | sysFactoryInfo = sysFactoryInfoService.getByDepartId(departId); | ||
490 | jsonObject = sysDictService.translateTDictValue(sysFactoryInfo); | ||
491 | } | ||
492 | result.setResult(jsonObject); | ||
493 | result.setSuccess(true); | ||
494 | return result; | ||
495 | } | ||
496 | |||
497 | private String getDepart(String departId) { | ||
484 | String departs = iCommonSqlService.getChildFactorys(departId); | 498 | String departs = iCommonSqlService.getChildFactorys(departId); |
485 | if(StringUtils.isNotEmpty(departs)){ | 499 | if(StringUtils.isNotEmpty(departs)){ |
486 | String[] departArray = departs.split(","); | 500 | String[] departArray = departs.split(","); |
... | @@ -488,17 +502,10 @@ public class SysFactoryInfoController { | ... | @@ -488,17 +502,10 @@ public class SysFactoryInfoController { |
488 | departId = departs.split(",")[0]; | 502 | departId = departs.split(",")[0]; |
489 | } | 503 | } |
490 | } | 504 | } |
491 | SysFactoryInfoVO sysFactoryInfo = sysFactoryInfoService.getByDepartId(departId); | 505 | return departId; |
492 | JSONObject jsonObject = sysDictService.translateTDictValue(sysFactoryInfo); | ||
493 | if (sysFactoryInfo == null) { | ||
494 | result.error500("未找到对应实体"); | ||
495 | } else { | ||
496 | result.setResult(jsonObject); | ||
497 | result.setSuccess(true); | ||
498 | } | ||
499 | return result; | ||
500 | } | 506 | } |
501 | 507 | ||
508 | |||
502 | @AutoLog(value = "查询污水厂设计规模") | 509 | @AutoLog(value = "查询污水厂设计规模") |
503 | @ApiOperation(value = "查询污水厂设计规模", notes = "查询污水厂设计规模") | 510 | @ApiOperation(value = "查询污水厂设计规模", notes = "查询污水厂设计规模") |
504 | @GetMapping(value = "/queryFactoryDesignScale") | 511 | @GetMapping(value = "/queryFactoryDesignScale") | ... | ... |
... | @@ -255,6 +255,9 @@ | ... | @@ -255,6 +255,9 @@ |
255 | '${item}' | 255 | '${item}' |
256 | </foreach> | 256 | </foreach> |
257 | ) | 257 | ) |
258 | ORDER BY | ||
259 | depart_type, | ||
260 | depart_order | ||
258 | </select> | 261 | </select> |
259 | <select id="queryDeptAndUserTreeList" parameterType="java.lang.String" resultType="com.skua.modules.system.vo.SysDeptUserVO"> | 262 | <select id="queryDeptAndUserTreeList" parameterType="java.lang.String" resultType="com.skua.modules.system.vo.SysDeptUserVO"> |
260 | SELECT | 263 | SELECT |
... | @@ -356,6 +359,9 @@ | ... | @@ -356,6 +359,9 @@ |
356 | '${item}' | 359 | '${item}' |
357 | </foreach> | 360 | </foreach> |
358 | )) | 361 | )) |
362 | ORDER BY | ||
363 | depart_type, | ||
364 | depart_order | ||
359 | </select> | 365 | </select> |
360 | 366 | ||
361 | <select id="queryDepartsByIds" resultType="com.skua.modules.system.entity.SysDepart"> | 367 | <select id="queryDepartsByIds" resultType="com.skua.modules.system.entity.SysDepart"> |
... | @@ -368,5 +374,8 @@ | ... | @@ -368,5 +374,8 @@ |
368 | <foreach item="item" index="index" collection="ids.split(',')" open="(" separator="," close=")"> | 374 | <foreach item="item" index="index" collection="ids.split(',')" open="(" separator="," close=")"> |
369 | '${item}' | 375 | '${item}' |
370 | </foreach> | 376 | </foreach> |
377 | ORDER BY | ||
378 | depart_type, | ||
379 | depart_order | ||
371 | </select> | 380 | </select> |
372 | </mapper> | 381 | </mapper> | ... | ... |
... | @@ -73,13 +73,13 @@ public class SysFactoryInfoServiceImpl extends ServiceImpl<SysFactoryInfoMapper, | ... | @@ -73,13 +73,13 @@ public class SysFactoryInfoServiceImpl extends ServiceImpl<SysFactoryInfoMapper, |
73 | @Override | 73 | @Override |
74 | public SysFactoryInfoVO getByDepartId(String departId) { | 74 | public SysFactoryInfoVO getByDepartId(String departId) { |
75 | SysFactoryInfoVO sysFactoryInfo = new SysFactoryInfoVO(); | 75 | SysFactoryInfoVO sysFactoryInfo = new SysFactoryInfoVO(); |
76 | String departs = commonSqlMapper.getChildFactorys(departId); | 76 | // String departs = commonSqlMapper.getChildFactorys(departId); |
77 | if(StringUtils.isNotEmpty(departs)){ | 77 | // if(StringUtils.isNotEmpty(departs)){ |
78 | String[] departArray = departs.split(","); | 78 | // String[] departArray = departs.split(","); |
79 | if(departArray.length>1){ | 79 | // if(departArray.length>1){ |
80 | departId = departs.split(",")[0]; | 80 | // departId = departs.split(",")[0]; |
81 | } | 81 | // } |
82 | } | 82 | // } |
83 | //获取厂站基本信息 | 83 | //获取厂站基本信息 |
84 | sysFactoryInfo = sysFactoryInfoMapper.getByDepartId(departId); | 84 | sysFactoryInfo = sysFactoryInfoMapper.getByDepartId(departId); |
85 | SysDepart sysDepart = sysDepartService.getById(departId); | 85 | SysDepart sysDepart = sysDepartService.getById(departId); |
... | @@ -87,8 +87,6 @@ public class SysFactoryInfoServiceImpl extends ServiceImpl<SysFactoryInfoMapper, | ... | @@ -87,8 +87,6 @@ public class SysFactoryInfoServiceImpl extends ServiceImpl<SysFactoryInfoMapper, |
87 | List<SysDepart> departList = sysDepartService.list(new QueryWrapper<SysDepart>().eq("depart_type", 1).eq("del_flag", 1)); | 87 | List<SysDepart> departList = sysDepartService.list(new QueryWrapper<SysDepart>().eq("depart_type", 1).eq("del_flag", 1)); |
88 | QueryWrapper<SysDepart> sysDepartQueryWrapper = new QueryWrapper<>(); | 88 | QueryWrapper<SysDepart> sysDepartQueryWrapper = new QueryWrapper<>(); |
89 | sysDepartQueryWrapper.eq("depart_type", 1).eq("del_flag", 1); | 89 | sysDepartQueryWrapper.eq("depart_type", 1).eq("del_flag", 1); |
90 | //List<Map<String, Object>> departList = sysDepartService.queryFactoryDevice(sysDepartQueryWrapper); | ||
91 | //List<String> departIds = departList.stream().filter(depart-> ObjectUtil.isNotEmpty(depart.get("deviceId"))).map(depart -> String.valueOf(depart.get("departId"))).collect(Collectors.toList()); | ||
92 | List<String> departIds = departList.stream().map(depart -> depart.getId()).collect(Collectors.toList()); | 90 | List<String> departIds = departList.stream().map(depart -> depart.getId()).collect(Collectors.toList()); |
93 | List<SysFactoryInfo> sysFactoryInfos = this.list(new QueryWrapper<SysFactoryInfo>().in("depart_id", departIds)); | 91 | List<SysFactoryInfo> sysFactoryInfos = this.list(new QueryWrapper<SysFactoryInfo>().in("depart_id", departIds)); |
94 | double ProScaleSum = sysFactoryInfos.stream().filter(info -> StringUtils.isNotBlank(info.getProScale())).mapToDouble(info -> | 92 | double ProScaleSum = sysFactoryInfos.stream().filter(info -> StringUtils.isNotBlank(info.getProScale())).mapToDouble(info -> | ... | ... |
-
请 注册 或 登录 后发表评论