kangwei: 大屏接口,
结算详情中权限问题
正在显示
11 个修改的文件
包含
191 行增加
和
39 行删除
... | @@ -5,7 +5,7 @@ import com.skua.core.aspect.annotation.AutoLog; | ... | @@ -5,7 +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.DangerEventOverviewVO; |
9 | import com.skua.modules.emergency.vo.MapDatabaseResult; | 9 | import com.skua.modules.emergency.vo.MapDatabaseResult; |
10 | import com.skua.modules.emergency.vo.RiskDatabaseResult; | 10 | import com.skua.modules.emergency.vo.RiskDatabaseResult; |
11 | import com.skua.tool.util.DateUtils; | 11 | import com.skua.tool.util.DateUtils; |
... | @@ -30,6 +30,34 @@ public class EventMapController { | ... | @@ -30,6 +30,34 @@ public class EventMapController { |
30 | 30 | ||
31 | @AutoLog(value = "风险库统计(数字)") | 31 | @AutoLog(value = "风险库统计(数字)") |
32 | @ApiOperation(value="风险库统计", notes="风险库统计") | 32 | @ApiOperation(value="风险库统计", notes="风险库统计") |
33 | @GetMapping(value = "/dangerEventStatistics") | ||
34 | public Result<DangerEventOverviewVO> dangerEventStatistics(String departIds, String startDate, String endDate){ | ||
35 | Result<DangerEventOverviewVO> result = new Result<>(); | ||
36 | if(StringUtils.isEmpty(departIds)){ | ||
37 | departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674 | ||
38 | } | ||
39 | DangerEventOverviewVO eventOverview = emergencyRiskEventService.getDangerEventStatistics( departIds, startDate,endDate); | ||
40 | result.setSuccess(true); | ||
41 | result.setResult(eventOverview); | ||
42 | return result; | ||
43 | } | ||
44 | @AutoLog(value = "安全检查列表") | ||
45 | @ApiOperation(value="安全检查列表", notes="安全检查列表") | ||
46 | @GetMapping(value = "/dangerEventStatisticsList") | ||
47 | public Result<List<DangerEventOverviewVO>> dangerEventStatisticsList(String departIds,String startDate, String endDate){ | ||
48 | Result<List<DangerEventOverviewVO>> result = new Result<>(); | ||
49 | //String departIds = BaseContextHandler.getDeparts(); | ||
50 | if(StringUtils.isEmpty(departIds)){ | ||
51 | departIds = BaseContextHandler.getDeparts();//1818214519948836864,1711662624459804674 | ||
52 | } | ||
53 | List<DangerEventOverviewVO> dataList = emergencyRiskEventService.getDangerEventStatisticsList( departIds, startDate,endDate); | ||
54 | result.setSuccess(true); | ||
55 | result.setResult(dataList); | ||
56 | return result; | ||
57 | } | ||
58 | |||
59 | @AutoLog(value = "风险库统计(数字)") | ||
60 | @ApiOperation(value="风险库统计", notes="风险库统计") | ||
33 | @GetMapping(value = "/riskLibraryStatistics") | 61 | @GetMapping(value = "/riskLibraryStatistics") |
34 | public Result<RiskDatabaseResult> riskLibraryStatistics(String departIds,String startDate, String endDate){ | 62 | public Result<RiskDatabaseResult> riskLibraryStatistics(String departIds,String startDate, String endDate){ |
35 | Result<RiskDatabaseResult> result = new Result<>(); | 63 | Result<RiskDatabaseResult> result = new Result<>(); | ... | ... |
... | @@ -5,7 +5,7 @@ import com.skua.modules.emergency.dto.EmergencyRiskEventHandleDto; | ... | @@ -5,7 +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.DangerEventOverviewVO; |
9 | import com.skua.modules.emergency.vo.MapDatabaseResult; | 9 | import com.skua.modules.emergency.vo.MapDatabaseResult; |
10 | import com.skua.modules.emergency.vo.RiskDatabaseResult; | 10 | import com.skua.modules.emergency.vo.RiskDatabaseResult; |
11 | 11 | ||
... | @@ -71,4 +71,22 @@ public interface IEmergencyRiskEventService extends IService<EmergencyRiskEvent> | ... | @@ -71,4 +71,22 @@ public interface IEmergencyRiskEventService extends IService<EmergencyRiskEvent> |
71 | * @return | 71 | * @return |
72 | */ | 72 | */ |
73 | public List<RiskDatabaseResult> getRiskLibraryStatisticsList(String departIds, String startDate, String endDate); | 73 | public List<RiskDatabaseResult> getRiskLibraryStatisticsList(String departIds, String startDate, String endDate); |
74 | |||
75 | /*** | ||
76 | * 隐患事件统计(数字) | ||
77 | * @param departIds | ||
78 | * @param startDate | ||
79 | * @param endDate | ||
80 | * @return | ||
81 | */ | ||
82 | DangerEventOverviewVO getDangerEventStatistics(String departIds, String startDate, String endDate); | ||
83 | |||
84 | /** | ||
85 | * 隐患事件统计(列表) | ||
86 | * @param departIds | ||
87 | * @param startDate | ||
88 | * @param endDate | ||
89 | * @return | ||
90 | */ | ||
91 | List<DangerEventOverviewVO> getDangerEventStatisticsList(String departIds, String startDate, String endDate); | ||
74 | } | 92 | } | ... | ... |
... | @@ -6,7 +6,6 @@ import com.skua.core.context.SpringContextUtils; | ... | @@ -6,7 +6,6 @@ import com.skua.core.context.SpringContextUtils; |
6 | import com.skua.core.exception.JeecgBootException; | 6 | import com.skua.core.exception.JeecgBootException; |
7 | import com.skua.core.util.ConvertUtils; | 7 | import com.skua.core.util.ConvertUtils; |
8 | import com.skua.core.util.DateUtils; | 8 | import com.skua.core.util.DateUtils; |
9 | import com.skua.modules.dataAnalysis.vo.SafeProgressVO; | ||
10 | import com.skua.modules.emergency.dto.EmergencyRiskEventAddDTO; | 9 | import com.skua.modules.emergency.dto.EmergencyRiskEventAddDTO; |
11 | import com.skua.modules.emergency.dto.EmergencyRiskEventHandleDto; | 10 | import com.skua.modules.emergency.dto.EmergencyRiskEventHandleDto; |
12 | import com.skua.modules.emergency.entity.EmergencyRiskEvent; | 11 | import com.skua.modules.emergency.entity.EmergencyRiskEvent; |
... | @@ -14,6 +13,7 @@ import com.skua.modules.emergency.enums.DicEmergencyRiskEventHandleResultEnums; | ... | @@ -14,6 +13,7 @@ import com.skua.modules.emergency.enums.DicEmergencyRiskEventHandleResultEnums; |
14 | import com.skua.modules.emergency.mapper.EmergencyRiskEventMapper; | 13 | import com.skua.modules.emergency.mapper.EmergencyRiskEventMapper; |
15 | import com.skua.modules.emergency.service.IEmergencyRiskEventService; | 14 | import com.skua.modules.emergency.service.IEmergencyRiskEventService; |
16 | import com.skua.modules.emergency.vo.DangerDatabaseResult; | 15 | import com.skua.modules.emergency.vo.DangerDatabaseResult; |
16 | import com.skua.modules.emergency.vo.DangerEventOverviewVO; | ||
17 | import com.skua.modules.emergency.vo.MapDatabaseResult; | 17 | import com.skua.modules.emergency.vo.MapDatabaseResult; |
18 | import com.skua.modules.emergency.vo.RiskDatabaseResult; | 18 | import com.skua.modules.emergency.vo.RiskDatabaseResult; |
19 | import com.skua.modules.flow.business.service.FlowBusinessService; | 19 | import com.skua.modules.flow.business.service.FlowBusinessService; |
... | @@ -193,11 +193,68 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven | ... | @@ -193,11 +193,68 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven |
193 | public List<RiskDatabaseResult> getRiskLibraryStatisticsList(String departIds, String startDate, String endDate){ | 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'"; | 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); | 195 | sql += getRiskLibraryStatisticsSql(departIds, startDate, endDate); |
196 | |||
197 | List<RiskDatabaseResult> dataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<RiskDatabaseResult>(RiskDatabaseResult.class)); | 196 | List<RiskDatabaseResult> dataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<RiskDatabaseResult>(RiskDatabaseResult.class)); |
198 | return dataList; | 197 | return dataList; |
199 | } | 198 | } |
200 | 199 | ||
200 | /*** | ||
201 | * 隐患事件统计(数字) | ||
202 | * @param departIds | ||
203 | * @param startDate | ||
204 | * @param endDate | ||
205 | * @return | ||
206 | */ | ||
207 | public DangerEventOverviewVO getDangerEventStatistics(String departIds, String startDate, String endDate){ | ||
208 | String sql = " select sum(ifnull(aa.count,0)) 'yhNoHandleNum', sum(ifnull(bb.count,0)) 'yhHandleNum', sum(ifnull(cc.count,0)) 'fxpcNoHandleNum', sum(ifnull(dd.count,0)) 'fxpcHandleNum',sum(ifnull(ee.count,0)) 'fxqyNum', sum(ifnull(ff.count,0)) 'fxdNum', sum(ifnull(gg.count,0)) 'jcxNum'"; | ||
209 | sql += getDangerEventStatisticsSql(departIds, startDate, endDate); | ||
210 | |||
211 | List<DangerEventOverviewVO> dataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<DangerEventOverviewVO>(DangerEventOverviewVO.class)); | ||
212 | if(dataList != null && !dataList.isEmpty()){ | ||
213 | return dataList.get(0); | ||
214 | } | ||
215 | return new DangerEventOverviewVO(0,0,0,0,0,0,0); | ||
216 | } | ||
217 | |||
218 | /** | ||
219 | * 隐患事件统计(列表) | ||
220 | * @param departIds | ||
221 | * @param startDate | ||
222 | * @param endDate | ||
223 | * @return | ||
224 | */ | ||
225 | public List<DangerEventOverviewVO> getDangerEventStatisticsList(String departIds, String startDate, String endDate){ | ||
226 | String sql = " select d.id 'dpart_id',d.depart_name , ifnull(aa.count,0) 'yhNoHandleNum',ifnull(bb.count,0) 'yhHandleNum', ifnull(cc.count,0) 'fxpcNoHandleNum', ifnull(dd.count,0) 'fxpcHandleNum',ifnull(ee.count,0) 'fxqyNum', ifnull(ff.count,0) 'fxdNum', ifnull(gg.count,0) 'jcxNum'"; | ||
227 | sql += getDangerEventStatisticsSql(departIds, startDate, endDate); | ||
228 | List<DangerEventOverviewVO> dataList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<DangerEventOverviewVO>(DangerEventOverviewVO.class)); | ||
229 | return dataList; | ||
230 | } | ||
231 | |||
232 | private String getDangerEventStatisticsSql(String departIds, String startDate, String endDate){ | ||
233 | String sql = ""; | ||
234 | sql += " from sys_depart d "; | ||
235 | //隐患处理中 | ||
236 | sql += " left join ( select t.depart_id , count(1) 'count' from ajh_rectification_info t where t.handle_result = 1 and 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"; | ||
237 | // 隐患已处理 | ||
238 | sql += " left join ( select t.depart_id , count(1) 'count' from ajh_rectification_info t where t.handle_result = 3 and t.rec_ord_report_date >='"+startDate+"' and t.rec_ord_report_date <='"+endDate+"' group by t.depart_id) bb on bb.depart_id = d.id "; | ||
239 | |||
240 | //风险排查处理中 | ||
241 | sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where status<2 and report_date >= '"+startDate+" 00:00:00' and report_date <='"+endDate+" 23:59:59' group by depart_id ) cc on cc.depart_id = d.id"; | ||
242 | //风险排查:已经处理 | ||
243 | sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where status=2 and report_date >= '"+startDate+" 00:00:00' and report_date <='"+endDate+" 23:59:59' group by depart_id ) dd on dd.depart_id = d.id"; | ||
244 | //风险区域数量 | ||
245 | sql += " left join ( select depart_id ,count(id) 'count' from danger_level_manage group by depart_id ) ee on ee.depart_id = d.id"; | ||
246 | //风险点数量 | ||
247 | sql += " left join ( select dlm.depart_id,count(dii.id) 'count' from danger_inspect_info dii left join danger_level_manage dlm on dii.danger_id = dlm.id group by dlm.depart_id ) ff on ff.depart_id = d.id"; | ||
248 | //隐患排查检查项 | ||
249 | sql += " left join ( select dlm.depart_id,count(dii.id) 'count' from danger_inspect_item dii left join danger_level_manage dlm on dii.danger_id = dlm.id group by dlm.depart_id ) gg on gg.depart_id = d.id"; | ||
250 | |||
251 | sql += " where d.depart_type =1 "; | ||
252 | if(org.apache.commons.lang.StringUtils.isNotEmpty(departIds)){ | ||
253 | sql += " and d.id in ("+ JSUtils.quoteEach(departIds,",") +")"; | ||
254 | } | ||
255 | return sql; | ||
256 | } | ||
257 | |||
201 | private JdbcTemplate getJdbcTemplate(){ | 258 | private JdbcTemplate getJdbcTemplate(){ |
202 | JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); | 259 | JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); |
203 | return jdbcTemplate; | 260 | return jdbcTemplate; | ... | ... |
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 DangerEventOverviewVO { | ||
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 yhNoHandleNum ; | ||
21 | /**隐患已处理数*/ | ||
22 | @ApiModelProperty(value = "隐患已处理数") | ||
23 | private Integer yhHandleNum; | ||
24 | |||
25 | @ApiModelProperty(value = "'风险排查处理中'") | ||
26 | private Integer fxpcNoHandleNum; | ||
27 | @ApiModelProperty(value = "'风险排查:已经处理'") | ||
28 | private Integer fxpcHandleNum; | ||
29 | /**异常数*/ | ||
30 | @ApiModelProperty(value = "'风险区域数量'") | ||
31 | private Integer fxqyNum; | ||
32 | |||
33 | @ApiModelProperty(value = "'风险点数量'") | ||
34 | private Integer fxdNum; | ||
35 | |||
36 | @ApiModelProperty(value = "''隐患排查检查项''") | ||
37 | private Integer jcxNum; | ||
38 | |||
39 | public DangerEventOverviewVO() { | ||
40 | } | ||
41 | |||
42 | public DangerEventOverviewVO(Integer yhNoHandleNum, Integer yhHandleNum, Integer fxpcNoHandleNum, Integer fxpcHandleNum, Integer fxqyNum, Integer fxdNum, Integer jcxNum) { | ||
43 | this.yhNoHandleNum = yhNoHandleNum; | ||
44 | this.yhHandleNum = yhHandleNum; | ||
45 | this.fxpcNoHandleNum = fxpcNoHandleNum; | ||
46 | this.fxpcHandleNum = fxpcHandleNum; | ||
47 | this.fxqyNum = fxqyNum; | ||
48 | this.fxdNum = fxdNum; | ||
49 | this.jcxNum = jcxNum; | ||
50 | } | ||
51 | } |
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 | } |
... | @@ -37,6 +37,9 @@ public class RiskDatabaseResult { | ... | @@ -37,6 +37,9 @@ public class RiskDatabaseResult { |
37 | private Integer xjCount; | 37 | private Integer xjCount; |
38 | 38 | ||
39 | 39 | ||
40 | public RiskDatabaseResult(){ | ||
41 | } | ||
42 | |||
40 | public RiskDatabaseResult(Integer fxkCount, Integer aqyhCount, Integer yhpcCount, Integer ycCount, Integer xjCount) { | 43 | public RiskDatabaseResult(Integer fxkCount, Integer aqyhCount, Integer yhpcCount, Integer ycCount, Integer xjCount) { |
41 | this.fxkCount = fxkCount; | 44 | this.fxkCount = fxkCount; |
42 | this.aqyhCount = aqyhCount; | 45 | this.aqyhCount = aqyhCount; | ... | ... |
... | @@ -10,8 +10,8 @@ | ... | @@ -10,8 +10,8 @@ |
10 | select d.depart_name, sm.supp_name supplierName,pc.project_name, pc.contract_name,pc.contract_code, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign, | 10 | select d.depart_name, sm.supp_name supplierName,pc.project_name, pc.contract_name,pc.contract_code, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign, |
11 | pm.good_brand , pm.good_origin,pm.tax_amount,pm.unit_price, | 11 | pm.good_brand , pm.good_origin,pm.tax_amount,pm.unit_price, |
12 | ss.sparepart_code,ss.sparepart_name, ss.specification,ss.measuring_unit, | 12 | ss.sparepart_code,ss.sparepart_name, ss.specification,ss.measuring_unit, |
13 | si.id,si.settlement_id,si.depart_id,si.material_in_id,si.purchase_contract_id,si.distribut_contract_id,si.sparepart_id,si.material_num,si.arrive_time, | 13 | si.id,si.settlement_id,si.depart_id,si.material_in_id,si.purchase_contract_id,si.distribut_contract_id,si.sparepart_id,si.material_num,si.arrive_time,si.good_code, |
14 | (pm.unit_price * si.material_num)'total_price',round(pm.unit_price * si.material_num *100 /(100+ ifnull(pm.tax_amount,0)) ,2) total_price_tax | 14 | round(pm.unit_price * si.material_num,2)'total_price',round(pm.unit_price * si.material_num *100 /(100+ ifnull(pm.tax_amount,0)) ,2) total_price_tax |
15 | from erp_settlement_item si | 15 | from erp_settlement_item si |
16 | left join sys_depart d on d.id = si.depart_id | 16 | left join sys_depart d on d.id = si.depart_id |
17 | left join erp_purchase_material pm on (pm.contract_id =si.purchase_contract_id and pm.good_code = si.good_code ) | 17 | left join erp_purchase_material pm on (pm.contract_id =si.purchase_contract_id and pm.good_code = si.good_code ) |
... | @@ -26,8 +26,8 @@ | ... | @@ -26,8 +26,8 @@ |
26 | select d.depart_name, dc.contract_name ,dc.project_name,dc.contract_code, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign, | 26 | select d.depart_name, dc.contract_name ,dc.project_name,dc.contract_code, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign, |
27 | dm.tax_amount,dm.distribut_price 'unit_price', | 27 | dm.tax_amount,dm.distribut_price 'unit_price', |
28 | ss.sparepart_code,ss.sparepart_name, ss.specification,ss.measuring_unit, | 28 | ss.sparepart_code,ss.sparepart_name, ss.specification,ss.measuring_unit, |
29 | si.id,si.settlement_id,si.depart_id,si.material_in_id,si.distribut_contract_id,si.purchase_contract_id,si.sparepart_id,si.material_num,si.arrive_time, | 29 | si.id,si.settlement_id,si.depart_id,si.material_in_id,si.distribut_contract_id,si.purchase_contract_id,si.sparepart_id,si.material_num,si.arrive_time,si.good_code, |
30 | (dm.distribut_price * si.material_num)'total_price',round(dm.distribut_price * si.material_num *100 /(100+ ifnull(dm.tax_amount,0)) ,2) total_price_tax | 30 | round(dm.distribut_price * si.material_num,2)'total_price',round(dm.distribut_price * si.material_num *100 /(100+ ifnull(dm.tax_amount,0)) ,2) total_price_tax |
31 | from erp_settlement_item si | 31 | from erp_settlement_item si |
32 | left join sys_depart d on d.id = si.depart_id | 32 | left join sys_depart d on d.id = si.depart_id |
33 | 33 | ... | ... |
... | @@ -139,6 +139,9 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> { | ... | @@ -139,6 +139,9 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> { |
139 | String getDepartTreeByParentDepartId(@Param("parentDepartId")String parentDepartId); | 139 | String getDepartTreeByParentDepartId(@Param("parentDepartId")String parentDepartId); |
140 | 140 | ||
141 | String getChildDepartId(@Param("departIds") String departIds); | 141 | String getChildDepartId(@Param("departIds") String departIds); |
142 | /** 根据部门父id查询子集部门的集合(级联)*/ | ||
143 | String getChildDepartIdByParentId(@Param("departIds") String departIds ,@Param("parentId") String parentId,@Param("departType") String departType); | ||
144 | |||
142 | 145 | ||
143 | List<SysDeptUserVO> queryDeptAndUserTreeList(@Param("departId") String departId); | 146 | List<SysDeptUserVO> queryDeptAndUserTreeList(@Param("departId") String departId); |
144 | 147 | ... | ... |
... | @@ -259,6 +259,23 @@ | ... | @@ -259,6 +259,23 @@ |
259 | depart_type, | 259 | depart_type, |
260 | depart_order | 260 | depart_order |
261 | </select> | 261 | </select> |
262 | <select id="getChildDepartIdByParentId" resultType="java.lang.String"> | ||
263 | SELECT | ||
264 | GROUP_CONCAT( id SEPARATOR ',' ) AS depart_ids | ||
265 | FROM | ||
266 | sys_depart | ||
267 | WHERE 1=1 | ||
268 | <if test="departType != null and departType !=''"> and depart_type=#{departType}</if> | ||
269 | and (parent_id = #{parentId} OR parent_id IN (SELECT id FROM sys_depart WHERE parent_id = #{parentId})) | ||
270 | <if test="departIds != null and departIds !=''"> | ||
271 | and id in | ||
272 | <foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")"> | ||
273 | '${item}' | ||
274 | </foreach> | ||
275 | </if> | ||
276 | |||
277 | |||
278 | </select> | ||
262 | <select id="queryDeptAndUserTreeList" parameterType="java.lang.String" resultType="com.skua.modules.system.vo.SysDeptUserVO"> | 279 | <select id="queryDeptAndUserTreeList" parameterType="java.lang.String" resultType="com.skua.modules.system.vo.SysDeptUserVO"> |
263 | SELECT | 280 | SELECT |
264 | * | 281 | * | ... | ... |
... | @@ -177,6 +177,8 @@ public interface ISysDepartService extends IService<SysDepart>{ | ... | @@ -177,6 +177,8 @@ public interface ISysDepartService extends IService<SysDepart>{ |
177 | List<DepartTree> getJimuDepartTree(DepartTree departTree); | 177 | List<DepartTree> getJimuDepartTree(DepartTree departTree); |
178 | 178 | ||
179 | String getChildDepartId(String departIds); | 179 | String getChildDepartId(String departIds); |
180 | /** 根据部门父id查询子集部门的集合(级联)*/ | ||
181 | String getChildDepartId(String departIds, String parentId, String departType); | ||
180 | 182 | ||
181 | List<SysDeptUserVO> queryDeptAndUserTreeList(String departId,String userType); | 183 | List<SysDeptUserVO> queryDeptAndUserTreeList(String departId,String userType); |
182 | 184 | ... | ... |
... | @@ -545,6 +545,10 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart | ... | @@ -545,6 +545,10 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart |
545 | public String getChildDepartId(String departIds) { | 545 | public String getChildDepartId(String departIds) { |
546 | return sysDepartMapper.getChildDepartId(departIds); | 546 | return sysDepartMapper.getChildDepartId(departIds); |
547 | } | 547 | } |
548 | /** 根据部门父id查询子集部门的集合(级联)*/ | ||
549 | public String getChildDepartId(String departIds, String parentId, String departType){ | ||
550 | return sysDepartMapper.getChildDepartIdByParentId(departIds,parentId, departType); | ||
551 | } | ||
548 | 552 | ||
549 | @Override | 553 | @Override |
550 | public List<SysDeptUserVO> queryDeptAndUserTreeList(String departId, String userType) { | 554 | public List<SysDeptUserVO> queryDeptAndUserTreeList(String departId, String userType) { | ... | ... |
-
请 注册 或 登录 后发表评论