kangwei: 隐患排查大屏接口
供应商结算, 水厂结算 药品不显示 权限问题
正在显示
9 个修改的文件
包含
162 行增加
和
7 行删除
... | @@ -5,6 +5,7 @@ import com.skua.core.aspect.annotation.AutoLog; | ... | @@ -5,6 +5,7 @@ import com.skua.core.aspect.annotation.AutoLog; |
5 | import com.skua.core.context.BaseContextHandler; | 5 | import com.skua.core.context.BaseContextHandler; |
6 | import com.skua.modules.emergency.service.IEmergencyRiskEventService; | 6 | import com.skua.modules.emergency.service.IEmergencyRiskEventService; |
7 | import com.skua.modules.emergency.vo.DangerDatabaseResult; | 7 | import com.skua.modules.emergency.vo.DangerDatabaseResult; |
8 | import com.skua.modules.emergency.vo.EventOverviewVO; | ||
8 | import com.skua.modules.emergency.vo.MapDatabaseResult; | 9 | import com.skua.modules.emergency.vo.MapDatabaseResult; |
9 | import com.skua.modules.emergency.vo.RiskDatabaseResult; | 10 | import com.skua.modules.emergency.vo.RiskDatabaseResult; |
10 | import com.skua.tool.util.DateUtils; | 11 | import com.skua.tool.util.DateUtils; |
... | @@ -27,6 +28,34 @@ public class EventMapController { | ... | @@ -27,6 +28,34 @@ public class EventMapController { |
27 | @Autowired | 28 | @Autowired |
28 | private IEmergencyRiskEventService emergencyRiskEventService; | 29 | private IEmergencyRiskEventService emergencyRiskEventService; |
29 | 30 | ||
31 | @AutoLog(value = "风险库统计(数字)") | ||
32 | @ApiOperation(value="风险库统计", notes="风险库统计") | ||
33 | @GetMapping(value = "/riskLibraryStatistics") | ||
34 | public Result<RiskDatabaseResult> riskLibraryStatistics(String departIds,String startDate, String endDate){ | ||
35 | Result<RiskDatabaseResult> result = new Result<>(); | ||
36 | if(StringUtils.isEmpty(departIds)){ | ||
37 | departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674 | ||
38 | } | ||
39 | RiskDatabaseResult eventOverview = emergencyRiskEventService.getRiskLibraryStatistics( departIds, startDate,endDate); | ||
40 | result.setSuccess(true); | ||
41 | result.setResult(eventOverview); | ||
42 | return result; | ||
43 | } | ||
44 | |||
45 | @AutoLog(value = "安全检查列表") | ||
46 | @ApiOperation(value="安全检查列表", notes="安全检查列表") | ||
47 | @GetMapping(value = "/riskLibraryStatisticsList") | ||
48 | public Result<List<RiskDatabaseResult>> getRiskLibraryStatisticsList(String departIds,String startDate, String endDate){ | ||
49 | Result<List<RiskDatabaseResult>> result = new Result<>(); | ||
50 | //String departIds = BaseContextHandler.getDeparts(); | ||
51 | if(StringUtils.isEmpty(departIds)){ | ||
52 | departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674 | ||
53 | } | ||
54 | List<RiskDatabaseResult> dataList = emergencyRiskEventService.getRiskLibraryStatisticsList( departIds, startDate,endDate); | ||
55 | result.setSuccess(true); | ||
56 | result.setResult(dataList); | ||
57 | return result; | ||
58 | } | ||
30 | /** | 59 | /** |
31 | * 安全隐患事件数量 | 60 | * 安全隐患事件数量 |
32 | */ | 61 | */ | ... | ... |
... | @@ -5,6 +5,7 @@ import com.skua.modules.emergency.dto.EmergencyRiskEventHandleDto; | ... | @@ -5,6 +5,7 @@ import com.skua.modules.emergency.dto.EmergencyRiskEventHandleDto; |
5 | import com.skua.modules.emergency.entity.EmergencyRiskEvent; | 5 | import com.skua.modules.emergency.entity.EmergencyRiskEvent; |
6 | import com.baomidou.mybatisplus.extension.service.IService; | 6 | import com.baomidou.mybatisplus.extension.service.IService; |
7 | import com.skua.modules.emergency.vo.DangerDatabaseResult; | 7 | import com.skua.modules.emergency.vo.DangerDatabaseResult; |
8 | import com.skua.modules.emergency.vo.EventOverviewVO; | ||
8 | import com.skua.modules.emergency.vo.MapDatabaseResult; | 9 | import com.skua.modules.emergency.vo.MapDatabaseResult; |
9 | import com.skua.modules.emergency.vo.RiskDatabaseResult; | 10 | import com.skua.modules.emergency.vo.RiskDatabaseResult; |
10 | 11 | ||
... | @@ -52,4 +53,22 @@ public interface IEmergencyRiskEventService extends IService<EmergencyRiskEvent> | ... | @@ -52,4 +53,22 @@ public interface IEmergencyRiskEventService extends IService<EmergencyRiskEvent> |
52 | * @return | 53 | * @return |
53 | */ | 54 | */ |
54 | List<MapDatabaseResult> getMapData(String departIds, String startDate,String endDate); | 55 | List<MapDatabaseResult> getMapData(String departIds, String startDate,String endDate); |
56 | |||
57 | /*** | ||
58 | * 风险库统计 | ||
59 | * @param departIds | ||
60 | * @param startDate | ||
61 | * @param endDate | ||
62 | * @return | ||
63 | */ | ||
64 | RiskDatabaseResult getRiskLibraryStatistics(String departIds, String startDate, String endDate); | ||
65 | |||
66 | /*** | ||
67 | * 风险库统计列表 | ||
68 | * @param departIds | ||
69 | * @param startDate | ||
70 | * @param endDate | ||
71 | * @return | ||
72 | */ | ||
73 | public List<RiskDatabaseResult> getRiskLibraryStatisticsList(String departIds, String startDate, String endDate); | ||
55 | } | 74 | } | ... | ... |
... | @@ -2,9 +2,11 @@ package com.skua.modules.emergency.service.impl; | ... | @@ -2,9 +2,11 @@ package com.skua.modules.emergency.service.impl; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
4 | import com.skua.core.context.BaseContextHandler; | 4 | import com.skua.core.context.BaseContextHandler; |
5 | import com.skua.core.context.SpringContextUtils; | ||
5 | import com.skua.core.exception.JeecgBootException; | 6 | import com.skua.core.exception.JeecgBootException; |
6 | import com.skua.core.util.ConvertUtils; | 7 | import com.skua.core.util.ConvertUtils; |
7 | import com.skua.core.util.DateUtils; | 8 | import com.skua.core.util.DateUtils; |
9 | import com.skua.modules.dataAnalysis.vo.SafeProgressVO; | ||
8 | import com.skua.modules.emergency.dto.EmergencyRiskEventAddDTO; | 10 | import com.skua.modules.emergency.dto.EmergencyRiskEventAddDTO; |
9 | import com.skua.modules.emergency.dto.EmergencyRiskEventHandleDto; | 11 | import com.skua.modules.emergency.dto.EmergencyRiskEventHandleDto; |
10 | import com.skua.modules.emergency.entity.EmergencyRiskEvent; | 12 | import com.skua.modules.emergency.entity.EmergencyRiskEvent; |
... | @@ -34,6 +36,8 @@ import com.skua.tool.util.UniqIdUtils; | ... | @@ -34,6 +36,8 @@ import com.skua.tool.util.UniqIdUtils; |
34 | import org.apache.commons.lang3.StringUtils; | 36 | import org.apache.commons.lang3.StringUtils; |
35 | import org.springframework.beans.BeanUtils; | 37 | import org.springframework.beans.BeanUtils; |
36 | import org.springframework.beans.factory.annotation.Autowired; | 38 | import org.springframework.beans.factory.annotation.Autowired; |
39 | import org.springframework.jdbc.core.BeanPropertyRowMapper; | ||
40 | import org.springframework.jdbc.core.JdbcTemplate; | ||
37 | import org.springframework.stereotype.Service; | 41 | import org.springframework.stereotype.Service; |
38 | 42 | ||
39 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 43 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
... | @@ -169,6 +173,55 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven | ... | @@ -169,6 +173,55 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven |
169 | return list; | 173 | return list; |
170 | } | 174 | } |
171 | 175 | ||
176 | /*** | ||
177 | * 风险库统计 | ||
178 | * @param departIds | ||
179 | * @param startDate | ||
180 | * @param endDate | ||
181 | * @return | ||
182 | */ | ||
183 | public RiskDatabaseResult getRiskLibraryStatistics(String departIds, String startDate, String endDate){ | ||
184 | String sql = " select sum(ifnull(aa.count,0)) 'aqyhCount',sum(ifnull(bb.count,0) )'yhpcCount', sum(ifnull(cc.count,0)) 'ycCount', sum(ifnull(dd.count,0)) 'xjCount'"; | ||
185 | sql += getRiskLibraryStatisticsSql(departIds, startDate, endDate); | ||
186 | |||
187 | List<RiskDatabaseResult> dataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<RiskDatabaseResult>(RiskDatabaseResult.class)); | ||
188 | if(dataList != null && !dataList.isEmpty()){ | ||
189 | return dataList.get(0); | ||
190 | } | ||
191 | return new RiskDatabaseResult(0,0,0,0,0); | ||
192 | } | ||
193 | public List<RiskDatabaseResult> getRiskLibraryStatisticsList(String departIds, String startDate, String endDate){ | ||
194 | String sql = " select d.id 'dpart_id',d.depart_name , ifnull(aa.count,0) 'aqyhCount',ifnull(bb.count,0) 'yhpcCount', ifnull(cc.count,0) 'ycCount', ifnull(dd.count,0) 'xjCount'"; | ||
195 | sql += getRiskLibraryStatisticsSql(departIds, startDate, endDate); | ||
196 | |||
197 | List<RiskDatabaseResult> dataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<RiskDatabaseResult>(RiskDatabaseResult.class)); | ||
198 | return dataList; | ||
199 | } | ||
200 | |||
201 | private JdbcTemplate getJdbcTemplate(){ | ||
202 | JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); | ||
203 | return jdbcTemplate; | ||
204 | } | ||
205 | private String getRiskLibraryStatisticsSql(String departIds, String startDate, String endDate){ | ||
206 | String sql = ""; | ||
207 | sql += " from sys_depart d "; | ||
208 | //安全你隐患 | ||
209 | sql += " left join ( select t.depart_id , count(1) 'count' from ajh_rectification_info t where t.rec_ord_report_date >='"+startDate+"' and t.rec_ord_report_date <='"+endDate+"' group by t.depart_id) aa on aa.depart_id = d.id"; | ||
210 | // 风险排查 | ||
211 | sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where report_date >= '"+startDate+" 00:00:00' and report_date <='"+endDate+" 23:59:59' group by depart_id ) bb on bb.depart_id = d.id "; | ||
212 | // 异常 | ||
213 | sql += " left join ( select t.depart_id , count(1) 'count' from problem_report_plan t where t.report_time >='"+startDate+"' and t.report_time <='"+endDate+"' group by t.depart_id) cc on cc.depart_id = d.id"; | ||
214 | //巡检 | ||
215 | sql += " left join ( select t.depart_id , count(1) 'count' from inspection_task t where t.task_start_time >='"+startDate+"' and t.task_end_time <='"+endDate+"' group by t.depart_id) dd on dd.depart_id = d.id"; | ||
216 | |||
217 | sql += " where d.depart_type =1 "; | ||
218 | if(org.apache.commons.lang.StringUtils.isNotEmpty(departIds)){ | ||
219 | sql += " and d.id in ("+ JSUtils.quoteEach(departIds,",") +")"; | ||
220 | } | ||
221 | return sql; | ||
222 | } | ||
223 | |||
224 | |||
172 | @Override | 225 | @Override |
173 | public List<MapDatabaseResult> getMapData(String departIds,String startDate,String endDate) { | 226 | public List<MapDatabaseResult> getMapData(String departIds,String startDate,String endDate) { |
174 | /* if(StringUtils.isEmpty(year)){ | 227 | /* if(StringUtils.isEmpty(year)){ | ... | ... |
1 | package com.skua.modules.emergency.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModelProperty; | ||
4 | import lombok.Data; | ||
5 | |||
6 | /** | ||
7 | * @auther kangwei | ||
8 | * @create 2025-03-05-13:39 | ||
9 | */ | ||
10 | @Data | ||
11 | public class EventOverviewVO { | ||
12 | /**厂站ID*/ | ||
13 | @ApiModelProperty(value = "厂站ID") | ||
14 | private String departId; | ||
15 | /**厂站名称*/ | ||
16 | @ApiModelProperty(value = "厂站名称") | ||
17 | private String departName; | ||
18 | /**安全隐患数*/ | ||
19 | @ApiModelProperty(value = "安全隐患数") | ||
20 | private Integer aqyhCount ; | ||
21 | |||
22 | /**风险排查数*/ | ||
23 | @ApiModelProperty(value = "风险排查数") | ||
24 | private Integer fxpcCount; | ||
25 | /**异常数*/ | ||
26 | @ApiModelProperty(value = "异常数") | ||
27 | private Integer ycCount; | ||
28 | |||
29 | @ApiModelProperty(value = "巡检数量") | ||
30 | private Integer xjCount; | ||
31 | } |
... | @@ -19,13 +19,29 @@ public class RiskDatabaseResult { | ... | @@ -19,13 +19,29 @@ public class RiskDatabaseResult { |
19 | /**风险库数量*/ | 19 | /**风险库数量*/ |
20 | @ApiModelProperty(value = "风险库数量") | 20 | @ApiModelProperty(value = "风险库数量") |
21 | private Integer fxkCount; | 21 | private Integer fxkCount; |
22 | |||
23 | /**安全隐患数*/ | ||
24 | @ApiModelProperty(value = "安全隐患数") | ||
25 | private Integer aqyhCount ; | ||
26 | |||
22 | /**隐患排查数量*/ | 27 | /**隐患排查数量*/ |
23 | @ApiModelProperty(value = "隐患排查数量") | 28 | @ApiModelProperty(value = "隐患排查数量") |
24 | private Integer yhpcCount; | 29 | private Integer yhpcCount; |
25 | /**隐患排查事件数量*/ | 30 | |
26 | @ApiModelProperty(value = "隐患排查事件数量") | 31 | |
27 | private Integer aqyhCount; | 32 | /**异常数*/ |
33 | @ApiModelProperty(value = "异常数") | ||
34 | private Integer ycCount; | ||
28 | 35 | ||
29 | @ApiModelProperty(value = "巡检数量") | 36 | @ApiModelProperty(value = "巡检数量") |
30 | private Integer xjCount; | 37 | private Integer xjCount; |
38 | |||
39 | |||
40 | public RiskDatabaseResult(Integer fxkCount, Integer aqyhCount, Integer yhpcCount, Integer ycCount, Integer xjCount) { | ||
41 | this.fxkCount = fxkCount; | ||
42 | this.aqyhCount = aqyhCount; | ||
43 | this.yhpcCount = yhpcCount; | ||
44 | this.ycCount = ycCount; | ||
45 | this.xjCount = xjCount; | ||
46 | } | ||
31 | } | 47 | } | ... | ... |
... | @@ -324,12 +324,15 @@ public class MaterialINController { | ... | @@ -324,12 +324,15 @@ public class MaterialINController { |
324 | @AutoLog(value = "erp--物料(药剂)入库-批量送审") | 324 | @AutoLog(value = "erp--物料(药剂)入库-批量送审") |
325 | @ApiOperation(value="erp--物料(药剂)入库-批量送审", notes="erp--物料(药剂)入库-批量送审") | 325 | @ApiOperation(value="erp--物料(药剂)入库-批量送审", notes="erp--物料(药剂)入库-批量送审") |
326 | @GetMapping(value = "/batchSendAudit") | 326 | @GetMapping(value = "/batchSendAudit") |
327 | public Result<MaterialIN> batchSendAudit(@RequestParam(name="ids",required=true) String ids) { | 327 | public Result<MaterialIN> batchSendAudit(@RequestParam(name="ids",required=true) String ids,String auditStatus) { |
328 | Result<MaterialIN> result = new Result<MaterialIN>(); | 328 | Result<MaterialIN> result = new Result<MaterialIN>(); |
329 | if(ids==null || "".equals(ids.trim())) { | 329 | if(ids==null || "".equals(ids.trim())) { |
330 | result.error500("参数不识别!"); | 330 | result.error500("参数不识别!"); |
331 | }else { | 331 | }else { |
332 | String auditStatus = "1"; | 332 | //String auditStatus = "1"; |
333 | if(StringUtils.isEmpty(auditStatus)){ | ||
334 | auditStatus = "1"; | ||
335 | } | ||
333 | this.materialINService.batchSendAudit(JSUtils.quoteEach(ids,","),auditStatus); | 336 | this.materialINService.batchSendAudit(JSUtils.quoteEach(ids,","),auditStatus); |
334 | result.success("批量送审成功!"); | 337 | result.success("批量送审成功!"); |
335 | } | 338 | } | ... | ... |
... | @@ -3,6 +3,7 @@ package com.skua.modules.erp.mapper; | ... | @@ -3,6 +3,7 @@ package com.skua.modules.erp.mapper; |
3 | import java.util.List; | 3 | import java.util.List; |
4 | 4 | ||
5 | import com.skua.modules.erp.vo.ErpSettlementItemVO; | 5 | import com.skua.modules.erp.vo.ErpSettlementItemVO; |
6 | import com.skua.tool.annotation.Anonymous; | ||
6 | import org.apache.ibatis.annotations.Param; | 7 | import org.apache.ibatis.annotations.Param; |
7 | import com.skua.modules.erp.entity.ErpSettlementItem; | 8 | import com.skua.modules.erp.entity.ErpSettlementItem; |
8 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 9 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
... | @@ -14,6 +15,8 @@ public interface ErpSettlementItemMapper extends BaseMapper<ErpSettlementItem> { | ... | @@ -14,6 +15,8 @@ public interface ErpSettlementItemMapper extends BaseMapper<ErpSettlementItem> { |
14 | 15 | ||
15 | void deleteBySettlementId(@Param("settlementId") String settlementId); | 16 | void deleteBySettlementId(@Param("settlementId") String settlementId); |
16 | 17 | ||
18 | @Anonymous | ||
17 | List<ErpSettlementItemVO> queryListBySupplier(@Param("settlementId") String settlementId); | 19 | List<ErpSettlementItemVO> queryListBySupplier(@Param("settlementId") String settlementId); |
20 | @Anonymous | ||
18 | List<ErpSettlementItemVO> queryListByWaterDepart(@Param("settlementId") String settlementId); | 21 | List<ErpSettlementItemVO> queryListByWaterDepart(@Param("settlementId") String settlementId); |
19 | } | 22 | } | ... | ... |
... | @@ -41,7 +41,7 @@ public interface MaterialINMapper extends BaseMapper<MaterialIN> { | ... | @@ -41,7 +41,7 @@ public interface MaterialINMapper extends BaseMapper<MaterialIN> { |
41 | * @param auditStatus | 41 | * @param auditStatus |
42 | * @return | 42 | * @return |
43 | */ | 43 | */ |
44 | public int batchSendAudit(@Param("id")String ids, @Param("auditStatus")String auditStatus); | 44 | public int batchSendAudit(@Param("ids")String ids, @Param("auditStatus")String auditStatus); |
45 | 45 | ||
46 | 46 | ||
47 | } | 47 | } | ... | ... |
... | @@ -151,7 +151,7 @@ public class WorkAnalysisController { | ... | @@ -151,7 +151,7 @@ public class WorkAnalysisController { |
151 | sql += " and d.id in ("+ JSUtils.quoteEach(departIds,",") +")"; | 151 | sql += " and d.id in ("+ JSUtils.quoteEach(departIds,",") +")"; |
152 | } | 152 | } |
153 | sql += " order by (ifnull(aaa.count,0) + ifnull(bbb.count,0) + ifnull(ccc.count,0) + ifnull(ddd.count,0) + ifnull(fff.count,0) ) asc "; | 153 | sql += " order by (ifnull(aaa.count,0) + ifnull(bbb.count,0) + ifnull(ccc.count,0) + ifnull(ddd.count,0) + ifnull(fff.count,0) ) asc "; |
154 | System.out.println("sql = "+sql); | 154 | //System.out.println("sql = "+sql); |
155 | List<SafeProgressVO> dataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<SafeProgressVO>(SafeProgressVO.class)); | 155 | List<SafeProgressVO> dataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<SafeProgressVO>(SafeProgressVO.class)); |
156 | result.setResult(dataList); | 156 | result.setResult(dataList); |
157 | result.setSuccess(true); | 157 | result.setSuccess(true); |
... | @@ -330,6 +330,7 @@ public class WorkAnalysisController { | ... | @@ -330,6 +330,7 @@ public class WorkAnalysisController { |
330 | sql += " left join ( select dep_id,count(user_id) 'count' from sys_user_depart where user_id in("+userIds+") group by dep_id )ddd on ddd.dep_id = d.id"; | 330 | sql += " left join ( select dep_id,count(user_id) 'count' from sys_user_depart where user_id in("+userIds+") group by dep_id )ddd on ddd.dep_id = d.id"; |
331 | //风险排查任务 | 331 | //风险排查任务 |
332 | sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where status = '2' and end_date >= '"+startTime+" 00:00:00' and end_date <='"+endTime+" 23:59:59' group by depart_id ) eee on eee.depart_id = d.id "; | 332 | sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where status = '2' and end_date >= '"+startTime+" 00:00:00' and end_date <='"+endTime+" 23:59:59' group by depart_id ) eee on eee.depart_id = d.id "; |
333 | sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where report_date >= '"+startTime+" 00:00:00' and report_date <='"+endTime+" 23:59:59' group by depart_id ) ggg on ggg.depart_id = d.id "; | ||
333 | sql += " left join( select sum( (DATEDIFF('"+endTime+"', '"+startTime+"') +1)*24/ dlm.frequency ) 'count' , dlm.depart_id from danger_level_manage dlm where dlm.frequency IS NOT NULL and frequency <> '' ) fff on fff.depart_id = d.id "; | 334 | sql += " left join( select sum( (DATEDIFF('"+endTime+"', '"+startTime+"') +1)*24/ dlm.frequency ) 'count' , dlm.depart_id from danger_level_manage dlm where dlm.frequency IS NOT NULL and frequency <> '' ) fff on fff.depart_id = d.id "; |
334 | 335 | ||
335 | return sql ; | 336 | return sql ; | ... | ... |
-
请 注册 或 登录 后发表评论