| | |
| | | import com.product.core.entity.FieldSetEntity; |
| | | import com.product.core.service.support.AbstractBaseService; |
| | | import com.product.core.spring.context.SpringMVCContextHolder; |
| | | import com.product.module.sys.entity.SystemUser; |
| | | import com.product.module.sys.service.UserService; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | DataTableEntity dte = baseDao.listTable(sql.toString(),ps.toArray(),Integer.MAX_VALUE, 1); |
| | | return dte; |
| | | } |
| | | /** |
| | | * 统计分类型消息,会议、任务、最新消息、历史消息 |
| | | * @param fse |
| | | * @return |
| | | */ |
| | | public DataTableEntity getTypeMessage() { |
| | | |
| | | ArrayList<Object> ps= new ArrayList<Object>(); |
| | | SystemUser user=SpringMVCContextHolder.getCurrentUser(); |
| | | ps.add(user.getUser_id()); |
| | | StringBuilder sql = new StringBuilder(); |
| | | sql.append(" select read_type message_type, count(*) num from product_sys_message m inner join product_sys_message_user u on u.message_uuid=m.uuid \r\n" |
| | | + "and u.user_id=? ").append(" group by read_type "); |
| | | ///我的会议 |
| | | sql.append( " union all select 2 as message_type,count(*) num from product_oa_conference_apply where ( CONCAT(',',meeting_master,',') like '%,") |
| | | .append(user.getUser_id()).append(",%' ") |
| | | .append(" or CONCAT(',',meeting_recorder,',') like '%,") |
| | | .append(user.getUser_id()).append(",%'") |
| | | .append(" or CONCAT(',',participator,',') like '%,") |
| | | .append(user.getUser_id()).append(",%'") |
| | | .append(" ) and (start_time>now() or (start_time<now() and now()<end_time))" |
| | | ); |
| | | ///未结束的任务 |
| | | sql.append( " union all select 3 as message_type,count(*) num from product_oa_task_distribution where task_status=1 and finish_type=0 "); |
| | | sql.append( " and ( CONCAT(',',task_persons,',') like '%,").append(user.getUser_id()).append(",%' "); |
| | | DataTableEntity dt=baseDao.listTable("product_sys_org_levels", "org_level_leader_uuid=?", new String[] {user.getUuid()}); |
| | | |
| | | if(!DataTableEntity.isEmpty(dt)) { |
| | | for(int i=0;i<dt.getRows();i++) { |
| | | sql.append(" or CONCAT(',',task_org,',') like '%,").append(dt.getString(i, "uuid")).append(",%' "); |
| | | } |
| | | } |
| | | sql.append(" )"); |
| | | |
| | | DataTableEntity dte = baseDao.listTable(sql.toString(),ps.toArray()); |
| | | return dte; |
| | | } |
| | | |
| | | } |