|
|
@@ -1470,6 +1470,14 @@ public class BpmInitiatedProvider extends GenericProvider implements IBpmInitiat
|
|
|
(List<Map<String, Object>>) commonDao.query(" SELECT entity.parent_id_ as id_ FROM ibps_party_entity entity, ibps_party_employee em " +
|
|
|
" WHERE entity.party_type_='position' AND entity.depth_=3 AND em.id_=#{p0} AND FIND_IN_SET(entity.id_,em.positions_)" , new String[]{currentUserId});
|
|
|
|
|
|
+ // 获取当前用户主部门
|
|
|
+ String mainPosition = "";
|
|
|
+ String sql3 = "select p.id_ from IBPS_PARTY_POSITION p INNER JOIN ibps_party_rel r on p.id_=r.MAIN_PID_ " +
|
|
|
+ "where r.sub_pid_='%s' and r.BIZ_='mainPost' ORDER BY p.CREATE_TIME_ DESC";
|
|
|
+ Map<String, Object> data = commonDao.queryOne(String.format(sql3,currentUserId));
|
|
|
+ if (BeanUtils.isNotEmpty(data)){
|
|
|
+ mainPosition = data.get("id_").toString();
|
|
|
+ }
|
|
|
try {
|
|
|
// final Infobox infobox = new Infobox();
|
|
|
// myCompleted(multiTaskType, name, executor, workerWrappers, list, infobox);
|
|
|
@@ -1519,18 +1527,22 @@ public class BpmInitiatedProvider extends GenericProvider implements IBpmInitiat
|
|
|
infobox2.setAlias("myDevices");
|
|
|
infobox2.setDataText("-1");
|
|
|
infobox2.setAccessToken(ContextUtil.getCurrentAccessToken());
|
|
|
- if(Collections.isEmpty(object3)) {
|
|
|
- List<Map<String, Object>> object4 =
|
|
|
- (List<Map<String, Object>>) commonDao.query("SELECT COUNT(1) AS total FROM t_mjsbwhbyjlby v,ibps_party_employee u " +
|
|
|
- " WHERE FIND_IN_SET(v.bian_zhi_bu_men_, u.positions_) AND u.id_=#{p0} " +
|
|
|
- " AND DATE(v.create_time_)=CURDATE() AND shi_fou_guo_shen_='待处理'", new String[]{currentUserId});
|
|
|
- infobox2.setDataText(object4.get(0).get("total").toString());
|
|
|
+ String sql;
|
|
|
+ if (BeanUtils.isNotEmpty(mainPosition)){
|
|
|
+ sql = "SELECT COUNT(1) AS total FROM t_mjsbwhbyjlby v,ibps_party_employee u " +
|
|
|
+ " WHERE FIND_IN_SET(v.bian_zhi_bu_men_, '%s') AND u.id_='%s' " +
|
|
|
+ " AND DATE(v.create_time_)=CURDATE() AND shi_fou_guo_shen_='待处理'";
|
|
|
+ sql = String.format(sql,mainPosition,currentUserId);
|
|
|
+ }else if(Collections.isEmpty(object3)) {
|
|
|
+ sql = "SELECT COUNT(1) AS total FROM t_mjsbwhbyjlby v,ibps_party_employee u " +
|
|
|
+ " WHERE FIND_IN_SET(v.bian_zhi_bu_men_, u.positions_) AND u.id_='%s' " +
|
|
|
+ " AND DATE(v.create_time_)=CURDATE() AND shi_fou_guo_shen_='待处理'";
|
|
|
+ sql = String.format(sql,currentUserId);
|
|
|
}else{
|
|
|
- List<Map<String, Object>> object4 =
|
|
|
- (List<Map<String, Object>>) commonDao.query("SELECT COUNT(1) AS total FROM t_mjsbwhbyjlby " +
|
|
|
- " WHERE di_dian_=#{p0} AND DATE(create_time_)=CURDATE() AND shi_fou_guo_shen_='待处理'", new String[]{(String)object3.get(0).get("id_")});
|
|
|
- infobox2.setDataText(object4.get(0).get("total").toString());
|
|
|
+ sql ="SELECT COUNT(1) AS total FROM t_mjsbwhbyjlby WHERE di_dian_='%s' AND DATE(create_time_)=CURDATE() AND shi_fou_guo_shen_='待处理'";
|
|
|
+ sql = String.format(sql,object3.get(0).get("id_"));
|
|
|
}
|
|
|
+ infobox2.setDataText(commonDao.queryOne(sql).get("total").toString());
|
|
|
list.add(infobox2);
|
|
|
} catch (Exception e) {
|
|
|
logger.error(e.getMessage(), e);
|
|
|
@@ -1548,19 +1560,20 @@ public class BpmInitiatedProvider extends GenericProvider implements IBpmInitiat
|
|
|
infobox2.setAlias("myFacility");
|
|
|
infobox2.setDataText("-1");
|
|
|
infobox2.setAccessToken(ContextUtil.getCurrentAccessToken());
|
|
|
- if(Collections.isEmpty(object3)) {
|
|
|
- List<Map<String, Object>> object4 =
|
|
|
- (List<Map<String, Object>>) commonDao.query("SELECT COUNT(1) AS total" +
|
|
|
- " FROM v_facs_summary_daily facs, ibps_party_employee emp" +
|
|
|
- " WHERE shi_fou_guo_shen_='待处理' and FIND_IN_SET(bian_zhi_bu_men_,emp.positions_) AND emp.id_=#{p0}", new String[]{currentUserId});
|
|
|
- infobox2.setDataText(object4.get(0).get("total").toString());
|
|
|
+ String sql;
|
|
|
+ if (BeanUtils.isNotEmpty(mainPosition)){
|
|
|
+ sql = "SELECT COUNT(1) AS total FROM v_facs_summary_daily facs, ibps_party_employee emp " +
|
|
|
+ "WHERE shi_fou_guo_shen_='待处理' and FIND_IN_SET(bian_zhi_bu_men_,'%s') AND emp.id_='%s'";
|
|
|
+ sql = String.format(sql,mainPosition,currentUserId);
|
|
|
+ }else if(Collections.isEmpty(object3)) {
|
|
|
+ sql = "SELECT COUNT(1) AS total FROM v_facs_summary_daily facs, ibps_party_employee emp " +
|
|
|
+ "WHERE shi_fou_guo_shen_='待处理' and FIND_IN_SET(bian_zhi_bu_men_,emp.positions_) AND emp.id_='%s'";
|
|
|
+ sql = String.format(sql,currentUserId);
|
|
|
}else{
|
|
|
- List<Map<String, Object>> object4 =
|
|
|
- (List<Map<String, Object>>) commonDao.query("SELECT COUNT(1) AS total" +
|
|
|
- " FROM v_facs_summary_daily " +
|
|
|
- " WHERE shi_fou_guo_shen_='待处理' and di_dian_=#{p0}", new String[]{(String)object3.get(0).get("id_")});
|
|
|
- infobox2.setDataText(object4.get(0).get("total").toString());
|
|
|
+ sql = "SELECT COUNT(1) AS total FROM v_facs_summary_daily WHERE shi_fou_guo_shen_='待处理' and di_dian_='%s'";
|
|
|
+ sql = String.format(sql,object3.get(0).get("id_"));
|
|
|
}
|
|
|
+ infobox2.setDataText(commonDao.queryOne(sql).get("total").toString());
|
|
|
list.add(infobox2);
|
|
|
} catch (Exception e) {
|
|
|
logger.error(e.getMessage(), e);
|