|
|
@@ -1,5 +1,6 @@
|
|
|
package com.lc.ibps.business.service.impl;
|
|
|
|
|
|
+import com.lc.ibps.base.core.constants.StringPool;
|
|
|
import com.lc.ibps.base.core.util.AppUtil;
|
|
|
import com.lc.ibps.base.core.util.Collections;
|
|
|
import com.lc.ibps.base.framework.table.ICommonDao;
|
|
|
@@ -24,13 +25,29 @@ public class FacilityEnvironmentServiceImpl implements FacilityEnvironmentServic
|
|
|
public List<Map<String, Object>> getDailySummary(String buMen) {
|
|
|
if(StringUtils.isEmpty(buMen)){
|
|
|
String userId = ContextUtil.getCurrentUserId();
|
|
|
- IPartyPositionService partyPositionService = AppUtil.getBean(IPartyPositionService.class);
|
|
|
- APIResult<List<PartyPositionPo>> result1 = partyPositionService.findByUserId(userId);
|
|
|
- if(result1.isFailed() || Collections.isEmpty(result1.getData())){
|
|
|
- throw new IllegalArgumentException("buMen not match!");
|
|
|
+ String sql = "SELECT pos.path_ as path " +
|
|
|
+ "FROM ibps_party_employee em,ibps_party_entity pos " +
|
|
|
+ "WHERE FIND_IN_SET(pos.id_,em.positions_) " +
|
|
|
+ "AND em.id_ IN " +
|
|
|
+ " (SELECT `ibps_party_user_role`.`USER_ID_` " +
|
|
|
+ " FROM `ibps_party_user_role` " +
|
|
|
+ " WHERE `ibps_party_user_role`.`USER_ID_`='%s' AND `ibps_party_user_role`.`ROLE_ID_` IN " +
|
|
|
+ " (SELECT `ibps_party_role`.`ID_` " +
|
|
|
+ " FROM `ibps_party_role` " +
|
|
|
+ " WHERE `ibps_party_role`.`ROLE_ALIAS_` = 'aqglxzfzr'))";
|
|
|
+ List<Map<String,Object>> objects =
|
|
|
+ (List<Map<String, Object>>) commonDao.query(String.format(sql,userId));
|
|
|
+ if(!Collections.isEmpty(objects)){
|
|
|
+ String path = objects.get(0).get("path").toString();
|
|
|
+ buMen = path.split(StringPool.BACK_SLASH+StringPool.DOT)[2];
|
|
|
+ }else{
|
|
|
+ IPartyPositionService partyPositionService = AppUtil.getBean(IPartyPositionService.class);
|
|
|
+ APIResult<List<PartyPositionPo>> result1 = partyPositionService.findByUserId(userId);
|
|
|
+ if (result1.isFailed() || Collections.isEmpty(result1.getData())) {
|
|
|
+ throw new IllegalArgumentException("buMen not match!");
|
|
|
+ }
|
|
|
+ buMen = result1.getData().stream().map(n -> n.getId()).collect(Collectors.joining(","));
|
|
|
}
|
|
|
- buMen = result1.getData().stream().map(n -> n.getId()).collect(Collectors.joining(","));
|
|
|
-
|
|
|
}
|
|
|
String sql = " SELECT parent_id_ as id_ FROM ibps_party_entity WHERE party_type_='position' AND depth_=3 AND FIND_IN_SET(id_,'%s')";
|
|
|
List<Map<String,Object>> object3 =
|