| | |
| | | import com.product.core.transfer.Transactional; |
| | | import com.product.core.websocket.service.WebsocketMesssageServiceThread; |
| | | import com.product.module.sys.entity.SystemUser; |
| | | import com.product.oa.task.service.TaskDistributionService; |
| | | import com.product.util.BaseUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import java.text.Format; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.DayOfWeek; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | QueryFilterService queryFilterService; |
| | | @Autowired |
| | | PermissionService permissionService; |
| | | @Autowired |
| | | TaskDistributionService taskDistributionService; |
| | | |
| | | /** |
| | | * 会议室列表 |
| | | * 会议室配置列表 |
| | | * |
| | | * @param fse |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 会议室详情 |
| | | * 会议室配置详情 |
| | | * |
| | | * @param fse |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 保存会议室 |
| | | * 保存会配置议室 |
| | | * |
| | | * @param fse |
| | | * @return |
| | |
| | | if (nameVerification!=null) { |
| | | throw new BaseException(SystemCode.CONFERENCE_ROOM_SAVE_FIAL_DUPLICATE_NAME.getValue(), SystemCode.CONFERENCE_ROOM_SAVE_FIAL_DUPLICATE_NAME.getText()); |
| | | } |
| | | |
| | | BaseUtil.createCreatorAndCreationTime(SpringMVCContextHolder.getCurrentUser(), fse); |
| | | //重名验证 |
| | | |
| | | return baseDao.saveFieldSetEntity(fse); |
| | | } |
| | | |
| | | /** |
| | | * 删除会议室 |
| | | * 会议室配置删除 |
| | | * |
| | | * @param fse |
| | | * @return |
| | |
| | | public boolean delConferenceApply(FieldSetEntity fse) throws BaseException { |
| | | return baseDao.delete(fse.getTableName(), fse.getUUID().split(",")); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 会议看板信息 |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public List getKbData(FieldSetEntity fse) throws BaseException { |
| | | public DataTableEntity getKanBanData(FieldSetEntity fse) { |
| | | String queryStartDate = fse.getString("query_start_date"); |
| | | String queryEndDate = fse.getString("query_end_date"); |
| | | String meeting_resource = fse.getString("meeting_resource"); |
| | | StringBuilder sbSql = new StringBuilder(); |
| | | sbSql.append("SELECT \n"); |
| | | sbSql.append(" A.meeting_room AS meeting_room_uuid, \n"); |
| | | sbSql.append(" start_time, \n"); |
| | | sbSql.append(" end_time, \n"); |
| | | sbSql.append(" DATE(start_time) as start_date, \n"); |
| | | sbSql.append(" DATE(end_time) as end_date, \n"); |
| | | sbSql.append(" TIME(start_time) as start_time_part, \n"); |
| | | sbSql.append(" TIME(end_time) as end_time_part, \n"); |
| | | sbSql.append(" HOUR(start_time) as start_hour, \n"); |
| | | sbSql.append(" HOUR(end_time) as end_hour, \n"); |
| | | sbSql.append(" DATEDIFF(end_time, start_time) AS diff_day, \n"); |
| | | sbSql.append(" (SELECT room_name FROM product_oa_conference_room_config WHERE uuid = A.meeting_room) as meeting_room \n"); |
| | | sbSql.append("FROM product_oa_conference_apply A \n"); |
| | | sbSql.append("WHERE (end_time >= ? AND start_time <= ?)"); |
| | | sbSql.append("AND status != '已取消'"); |
| | | |
| | | List<Object>param=new ArrayList<>(); |
| | | String meeting_date= fse.getString("meeting_date"); |
| | | String meeting_date_end= fse.getString("meeting_date_end"); |
| | | String meeting_resource = fse.getString("meeting_resource"); |
| | | param.add(meeting_date); |
| | | param.add(meeting_date_end); |
| | | String replace_meeting_resource=""; |
| | | DataTableEntity dtRecord = baseDao.listTable(sbSql.toString(), new Object[] {queryStartDate, queryEndDate + " 23:59:59"}); |
| | | String replace_meeting_resource=""; |
| | | if(!StringUtils.isEmpty(meeting_resource)){ |
| | | |
| | | String[] split = meeting_resource.split(","); |
| | | for (int i = 0; i < split.length; i++) { |
| | | replace_meeting_resource += "CONCAT(',', enable_seal, ',') LIKE '%,"+split[i]+",%'"; |
| | | if(i!=split.length-1){ |
| | | replace_meeting_resource=replace_meeting_resource+"y.meeting_resource like '%"+split[i]+"%' and "; |
| | | }else { |
| | | replace_meeting_resource=replace_meeting_resource+"y.meeting_resource like '%"+split[i]+"%'"; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | StringBuilder bs=new StringBuilder(); |
| | | bs.append(" SELECT DISTINCT g.room_name,g.uuid as meet_room_uuid,DATE_FORMAT(y.start_time, \"%d-%m-%Y %H:%i\") start_time_format,DATE_FORMAT(y.end_time, \"%d-%m-%Y %H:%i\") end_time_format,y.* "); |
| | | bs.append(" FROM product_oa_conference_room_config g"); |
| | | bs.append(" left JOIN product_oa_conference_apply y "); |
| | | bs.append(" on y.meeting_room=g.uuid and y.start_time between ? and ? "); |
| | | if(!StringUtils.isEmpty(meeting_resource)){ |
| | | bs.append(" where ( "+replace_meeting_resource+" )"); |
| | | } |
| | | bs.append(" ORDER BY y.start_time"); |
| | | DataTableEntity dataTableEntity = baseDao.listTable(bs.toString(), param.toArray()); |
| | | List<String> list=new ArrayList(); |
| | | List<HashMap> listDate=new ArrayList<>(); |
| | | |
| | | for(int i=0;i<dataTableEntity.getRows();i++){ |
| | | FieldSetEntity fieldSetEntity = dataTableEntity.getData().get(i); |
| | | |
| | | //初始化会议室的使用的状态 |
| | | String filter=" meeting_room = '"+fieldSetEntity.getString("meeting_room")+"' and DATE_FORMAT(start_time,\"%Y-%m-%d\") ='"+meeting_date+"'"; |
| | | DataTableEntity product_oa_conference_apply = baseDao.listTable("product_oa_conference_apply", filter, new Object[]{}); |
| | | for (int i1 = 0; i1 < product_oa_conference_apply.getRows(); i1++) { |
| | | FieldSetEntity fieldSetEntity1 = product_oa_conference_apply.getFieldSetEntity(i1); |
| | | Date date = new Date(); |
| | | if(date.before(fieldSetEntity1.getDate("start_time"))){ |
| | | fieldSetEntity1.setValue("status","未开始"); |
| | | }else if(date.after(fieldSetEntity1.getDate("end_time"))){ |
| | | fieldSetEntity1.setValue("status","已结束"); |
| | | }else { |
| | | fieldSetEntity1.setValue("status","会议中"); |
| | | } |
| | | baseDao.executeUpdate("update product_oa_conference_apply set status='"+fieldSetEntity1.getString("status")+"' where uuid='"+fieldSetEntity1.getString("uuid")+"'"); |
| | | } |
| | | |
| | | if(ObjectUtil.isNotEmpty(fieldSetEntity.getString("uuid"))){ |
| | | //构造所需要的格式 |
| | | if(!list.contains(fieldSetEntity.getValue("room_name").toString())){ |
| | | HashMap<String,Object> hashMap=new HashMap<>(); |
| | | hashMap.put("room_name",fieldSetEntity.getValue("room_name").toString()); |
| | | hashMap.put("uuid",fieldSetEntity.getValue("meet_room_uuid").toString()); |
| | | Object getStartTime = null; |
| | | for (int j = 0; j < dataTableEntity.getRows(); j++) { |
| | | FieldSetEntity fieldSetEntity1 = dataTableEntity.getFieldSetEntity(j); |
| | | if(fieldSetEntity1.getString("room_name").equals(hashMap.get("room_name"))){ |
| | | getStartTime = fieldSetEntity1.getValue("start_time"); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm"); |
| | | String time = dateFormat.format(getStartTime); |
| | | hashMap.put("start_time",time); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | list.add(fieldSetEntity.getValue("room_name").toString()); |
| | | listDate.add(hashMap); |
| | | |
| | | } |
| | | fieldSetEntity.setValue("parent",fieldSetEntity.getValue("meet_room_uuid").toString()); |
| | | HashMap<String,Object> hashMap=new HashMap<>(); |
| | | for (int j = 0; j < fieldSetEntity.getValues().keySet().size(); j++) { |
| | | if(fieldSetEntity.getValues().keySet().toArray()[j].toString().equals("start_time") || fieldSetEntity.getValues().keySet().toArray()[j].toString().equals("end_time")){ |
| | | Object meeting_time = fieldSetEntity.getValue(fieldSetEntity.getValues().keySet().toArray()[j].toString()); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String time = dateFormat.format(meeting_time); |
| | | hashMap.put(fieldSetEntity.getValues().keySet().toArray()[j].toString(),time); |
| | | if(fieldSetEntity.getValues().keySet().toArray()[j].equals("start_time")){ |
| | | hashMap.put("start_date",time); |
| | | }else { |
| | | hashMap.put("end_date",time); |
| | | } |
| | | }else { |
| | | hashMap.put(fieldSetEntity.getValues().keySet().toArray()[j].toString(),fieldSetEntity.getValue(fieldSetEntity.getValues().keySet().toArray()[j].toString())); |
| | | } |
| | | |
| | | } |
| | | listDate.add(hashMap); |
| | | |
| | | }else { |
| | | if(!list.contains(fieldSetEntity.getValue("room_name").toString())){ |
| | | HashMap<String,Object> hashMap=new HashMap<>(); |
| | | hashMap.put("room_name",fieldSetEntity.getValue("room_name").toString()); |
| | | hashMap.put("uuid",fieldSetEntity.getValue("meet_room_uuid").toString()); |
| | | hashMap.put("start_time",""); |
| | | list.add(fieldSetEntity.getValue("room_name").toString()); |
| | | listDate.add(hashMap); |
| | | replace_meeting_resource += " and "; |
| | | } |
| | | } |
| | | |
| | | } |
| | | return listDate; |
| | | DataTableEntity dtRoom = baseDao.listTable(CmnConst.PRODUCT_OA_CONFERENCE_ROOM_CONFIG, replace_meeting_resource); |
| | | |
| | | // 初始化会议室记录 |
| | | Map<String, FieldSetEntity> roomRecord = new HashMap<>(); |
| | | for (int i = 0; i < dtRoom.getRows(); i++) { |
| | | FieldSetEntity fseRoom = dtRoom.getFieldSetEntity(i); |
| | | FieldSetEntity fseRoomMeeting = new FieldSetEntity(CmnConst.PRODUCT_OA_CONFERENCE_APPLY); |
| | | fseRoomMeeting.setValue("room_name", fseRoom.getString("room_name")); |
| | | fseRoomMeeting.setValue("room_uuid", fseRoom.getString("uuid")); |
| | | roomRecord.put(fseRoom.getString("room_name"), fseRoomMeeting); |
| | | } |
| | | |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | LocalDate queryStart = LocalDate.parse(queryStartDate, formatter); |
| | | LocalDate queryEnd = LocalDate.parse(queryEndDate, formatter); |
| | | |
| | | // 处理会议记录 |
| | | for (int i = 0; i < dtRecord.getRows(); i++) { |
| | | FieldSetEntity record = dtRecord.getFieldSetEntity(i); |
| | | String meetingRoom = record.getString("meeting_room"); |
| | | if (!roomRecord.containsKey(meetingRoom)) continue; |
| | | |
| | | FieldSetEntity roomMeeting = roomRecord.get(meetingRoom); |
| | | |
| | | String startDateStr = record.getString("start_date"); |
| | | String endDateStr = record.getString("end_date"); |
| | | String startTime = record.getString("start_time_part"); |
| | | String endTime = record.getString("end_time_part"); |
| | | int startHour = record.getInteger("start_hour"); |
| | | int endHour = record.getInteger("end_hour"); |
| | | int diffDay = record.getInteger("diff_day"); |
| | | |
| | | LocalDate startDate = LocalDate.parse(startDateStr, formatter); |
| | | LocalDate endDate = LocalDate.parse(endDateStr, formatter); |
| | | |
| | | if (diffDay > 0) { |
| | | // 跨天会议 - 处理每一天 |
| | | LocalDate currentDate = startDate.isBefore(queryStart) ? queryStart : startDate; |
| | | LocalDate lastDate = endDate.isAfter(queryEnd) ? queryEnd : endDate; |
| | | |
| | | while (!currentDate.isAfter(lastDate)) { |
| | | DayOfWeek dayOfWeek = currentDate.getDayOfWeek(); |
| | | boolean isFirstDay = currentDate.equals(startDate); |
| | | boolean isLastDay = currentDate.equals(endDate); |
| | | |
| | | if (isFirstDay) { |
| | | // 开始日 |
| | | if (startHour < 12) { |
| | | // 上午开始,拆分成上午段和下午全天 |
| | | addTimeSlot(roomMeeting, dayOfWeek + "_AM", startTime + "-12:00:00"); |
| | | addTimeSlot(roomMeeting, dayOfWeek + "_PM", "12:00:00-00:00:00"); |
| | | } else { |
| | | // 下午开始,只有下午段 |
| | | addTimeSlot(roomMeeting, dayOfWeek + "_PM", startTime + "-00:00:00"); |
| | | } |
| | | } else if (isLastDay) { |
| | | // 结束日 |
| | | // 上午全天 |
| | | addTimeSlot(roomMeeting, dayOfWeek + "_AM", "00:00:00-12:00:00"); |
| | | if (endHour >= 12) { |
| | | // 结束在下午,拆分成上午全天和下午段 |
| | | addTimeSlot(roomMeeting, dayOfWeek + "_PM", "12:00:00-" + endTime); |
| | | } |
| | | } else { |
| | | // 中间日 - 全天 |
| | | addTimeSlot(roomMeeting, dayOfWeek + "_AM", "00:00:00-12:00:00"); |
| | | addTimeSlot(roomMeeting, dayOfWeek + "_PM", "12:00:00-00:00:00"); |
| | | } |
| | | |
| | | currentDate = currentDate.plusDays(1); |
| | | } |
| | | } else { |
| | | // 单天会议 |
| | | LocalDate date = LocalDate.parse(startDateStr, formatter); |
| | | DayOfWeek dayOfWeek = date.getDayOfWeek(); |
| | | |
| | | if (startHour < 12 && endHour > 12) { |
| | | // 跨上下午的会议,拆分成上午段和下午段 |
| | | addTimeSlot(roomMeeting, dayOfWeek + "_AM", startTime + "-12:00:00"); |
| | | addTimeSlot(roomMeeting, dayOfWeek + "_PM", "12:00:00-" + endTime); |
| | | } else if (startHour < 12) { |
| | | // 纯上午会议 |
| | | addTimeSlot(roomMeeting, dayOfWeek + "_AM", startTime + "-" + endTime); |
| | | } else { |
| | | // 纯下午会议 |
| | | addTimeSlot(roomMeeting, dayOfWeek + "_PM", startTime + "-" + endTime); |
| | | } |
| | | } |
| | | } |
| | | |
| | | DataTableEntity dtKanBan = new DataTableEntity(); |
| | | for (FieldSetEntity fseKanban : roomRecord.values()) { |
| | | dtKanBan.addFieldSetEntity(fseKanban); |
| | | } |
| | | return dtKanBan; |
| | | } |
| | | |
| | | private void addTimeSlot(FieldSetEntity roomMeeting, String field, String timeSlot) { |
| | | String existing = roomMeeting.getString(field); |
| | | if (StringUtils.isEmpty(existing)) { |
| | | roomMeeting.setValue(field, timeSlot); |
| | | } else { |
| | | roomMeeting.setValue(field, existing + "," + timeSlot); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 会议看板-会议记录 |
| | | */ |
| | | @Override |
| | | public List getMeetingDetails(FieldSetEntity fse) throws BaseException { |
| | | public DataTableEntity getMeetingRecords(FieldSetEntity fse) throws BaseException { |
| | | String meeting_room = fse.getString("meeting_room"); |
| | | String meeting_date = fse.getString("meeting_date"); |
| | | String meeting_date_end = fse.getString("meeting_date_end"); |
| | | String meeting_start_date = fse.getString("meeting_start_date"); |
| | | String meeting_end_date = fse.getString("meeting_end_date"); |
| | | String meeting_resource = fse.getString("meeting_resource"); |
| | | String replace_meeting_resource=""; |
| | | if(!StringUtils.isEmpty(meeting_resource)){ |
| | |
| | | }else { |
| | | replace_meeting_resource=replace_meeting_resource+"T1.meeting_resource like '%"+split[i]+"%'"; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | if(!StringUtils.isEmpty(meeting_room)&&!StringUtils.isEmpty(meeting_date)&&!StringUtils.isEmpty(meeting_date_end)){ |
| | | if(!StringUtils.isEmpty(meeting_room)&&!StringUtils.isEmpty(meeting_start_date)&&!StringUtils.isEmpty(meeting_end_date)){ |
| | | List<Object>param=new ArrayList<>(); |
| | | param.add(meeting_room); |
| | | param.add(meeting_date); |
| | | param.add(meeting_date_end); |
| | | param.add(meeting_start_date); |
| | | param.add(meeting_end_date); |
| | | StringBuilder sb=new StringBuilder(); |
| | | sb.append(" SELECT b.uuid,DATE_FORMAT(b.start_time, \"%Y-%m-%d\") start_time,b.start_time start_time1,b.end_time,b.meeting_topic,b.status,b.record_man as record_man_uuid, "); |
| | | sb.append(" (select user_name from product_sys_users where user_id=b.record_man) as record_man,"); |
| | | sb.append(" (select user_name from product_sys_users where user_id=b.record_master) as record_master,"); |
| | | sb.append(" CONCAT(DATE_FORMAT(b.start_time,\"%H:%i\"),'~',DATE_FORMAT(b.end_time,\"%H:%i\")) as time_quantum,"); |
| | | sb.append(" DATE_FORMAT(b.start_time,\"%Y-%m-%d\") as meeting_date,"); |
| | | sb.append(" GROUP_CONCAT(b.dict_label SEPARATOR ',') AS meeting_resouces "); |
| | | sb.append(" FROM ("); |
| | | sb.append(" SELECT DISTINCT a.uuid,a.start_time,a.end_time,a.meeting_topic,a.record_man,a.record_master,a.status,t.dict_label "); |
| | | sb.append(" FROM ("); |
| | | sb.append(" SELECT T1.*, "); |
| | | sb.append(" SUBSTRING_INDEX( SUBSTRING_INDEX( T1.meeting_resource, ',', T2.digit + 1 ), ',',- 1 ) AS type "); |
| | | sb.append(" FROM product_oa_conference_apply T1 "); |
| | | sb.append(" LEFT JOIN ( SELECT 0 AS digit UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 ) T2"); |
| | | sb.append(" ON T2.digit < ( length( T1.meeting_resource )- length( REPLACE ( T1.meeting_resource, ',', '' ))+ 1 )"); |
| | | sb.append(" WHERE T1.meeting_room = ? "); |
| | | sb.append(" and T1.start_time between ? and ? "); |
| | | sb.append("\nSELECT "); |
| | | sb.append("\n b.uuid,b.meeting_topic,b.status,b.meeting_recorder as meeting_recorder_uuid,"); |
| | | sb.append("\n b.start_time,b.end_time,DATE_FORMAT(b.start_time,'%Y-%m-%d') as meeting_date,"); |
| | | sb.append("\n (select user_name from product_sys_users where user_id=b.meeting_recorder) as meeting_recorder,"); |
| | | sb.append("\n (select user_name from product_sys_users where user_id=b.meeting_master) as meeting_master,"); |
| | | sb.append("\n CONCAT(DATE_FORMAT(b.start_time,\"%H:%i\"),'~',DATE_FORMAT(b.end_time,\"%H:%i\")) as time_quantum,"); |
| | | sb.append("\n GROUP_CONCAT(b.dict_label SEPARATOR ',') AS meeting_resouces,"); |
| | | sb.append("\n C.uuid AS minute_uuid,C.flow_flag AS minute_flow_flag"); |
| | | sb.append("\nFROM ("); |
| | | sb.append("\n SELECT DISTINCT a.uuid,a.start_time,a.end_time,a.meeting_topic,a.meeting_recorder,a.meeting_master,a.status,t.dict_label "); |
| | | sb.append("\n FROM ("); |
| | | sb.append("\n SELECT T1.*, "); |
| | | sb.append("\n SUBSTRING_INDEX( SUBSTRING_INDEX( T1.meeting_resource, ',', T2.digit + 1 ), ',',- 1 ) AS type "); |
| | | sb.append("\n FROM product_oa_conference_apply T1 "); |
| | | sb.append("\n LEFT JOIN ("); |
| | | sb.append("\n SELECT 0 AS digit UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 "); |
| | | sb.append("\n ) T2"); |
| | | sb.append("\n ON T2.digit < ( length( T1.meeting_resource )- length( REPLACE ( T1.meeting_resource, ',', '' ))+ 1 )"); |
| | | sb.append("\n WHERE T1.meeting_room = ? "); |
| | | sb.append("\n AND T1.start_time between ? AND ? "); |
| | | if(!StringUtils.isEmpty(meeting_resource)){ |
| | | sb.append(" and ("+replace_meeting_resource+" )"); |
| | | sb.append(" AND ("+replace_meeting_resource+" )"); |
| | | } |
| | | sb.append(" ) a"); |
| | | sb.append(" LEFT JOIN product_sys_dict t ON a.type = t.dict_value "); |
| | | sb.append(" AND t.dict_name = '会议室资源'"); |
| | | sb.append(" )b "); |
| | | sb.append(" group by b.uuid,b.start_time,b.end_time,b.meeting_topic,b.record_man,b.record_master,b.status "); |
| | | sb.append("\n ) a"); |
| | | sb.append("\n LEFT JOIN product_sys_dict t ON a.type = t.dict_value AND t.dict_name = '会议室资源'"); |
| | | sb.append("\n)b "); |
| | | sb.append("\nLEFT JOIN product_oa_conference_minute C ON C.meeting_uuid = B.uuid"); |
| | | sb.append("\nGROUP BY b.uuid,b.start_time,b.end_time,b.meeting_topic,b.meeting_recorder,b.meeting_master,b.status,C.uuid,C.flow_flag "); |
| | | DataTableEntity dataTableEntity = baseDao.listTable(sb.toString(), param.toArray()); |
| | | |
| | | List dataList =new ArrayList(); |
| | | for (int i = 0; i < dataTableEntity.getRows(); i++) { |
| | | FieldSetEntity fieldSetEntity = dataTableEntity.getData().get(i); |
| | | Map<Object, Object> MapValues = fieldSetEntity.getValues(); |
| | | if(ObjectUtil.isNotEmpty(MapValues.get("start_time1")) || ObjectUtil.isNotEmpty( MapValues.get("end_time"))){ |
| | | Object start_time = MapValues.get("start_time1"); |
| | | Object end_time = MapValues.get("end_time"); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String start_time_date = dateFormat.format(start_time); |
| | | String end_time_date = dateFormat.format(end_time); |
| | | MapValues.put("start_time",start_time_date); |
| | | MapValues.put("end_time",end_time_date); |
| | | } |
| | | |
| | | Date date = new Date(); |
| | | //是否能够取消 |
| | | if(date.before(fieldSetEntity.getDate("start_time"))){ |
| | | MapValues.put("isCancel",true); |
| | | } |
| | | //是否执行开启功能 |
| | | if(date.before(fieldSetEntity.getDate("start_time")) && fieldSetEntity.getString("status").equals("已取消")){ |
| | | MapValues.put("isStart",true); |
| | | } |
| | | dataList.add(MapValues); |
| | | } |
| | | return dataList; |
| | | if (!BaseUtil.dataTableIsEmpty(dataTableEntity)) { |
| | | for (int i = 0; i < dataTableEntity.getRows(); i++) { |
| | | FieldSetEntity fieldSetEntity = dataTableEntity.getData().get(i); |
| | | String status = fieldSetEntity.getString("status"); |
| | | Date startTime = fieldSetEntity.getDate("start_time"); |
| | | Date endTime = fieldSetEntity.getDate("end_time"); |
| | | Date date = new Date(); |
| | | //是否能够取消/编辑/启用 |
| | | if(date.before(startTime)){ |
| | | if("已取消".equals(status)) { |
| | | fieldSetEntity.setValue("isRestart", true); |
| | | } else if ("已启用".equals(status) || BaseUtil.strIsNull(status)) { |
| | | fieldSetEntity.setValue("isCancel", true); |
| | | } |
| | | fieldSetEntity.setValue("isUpdate", true); |
| | | if (BaseUtil.strIsNull(status)) { |
| | | fieldSetEntity.setValue("status", "未开始"); |
| | | } |
| | | } else { |
| | | //是否能够录入会议纪要 |
| | | if(date.after(endTime)){ |
| | | if (BaseUtil.strIsNull(status)) { |
| | | fieldSetEntity.setValue("status", "已结束"); |
| | | } |
| | | fieldSetEntity.setValue("isFinish", true); |
| | | } else { |
| | | if (BaseUtil.strIsNull(status)) { |
| | | fieldSetEntity.setValue("status", "进行中"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return dataTableEntity; |
| | | }else { |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public HashMap saveOrUpdateMeetingInfo(FieldSetEntity fse) throws BaseException { |
| | | |
| | | Date start_time_date = fse.getDate("start_time"); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String format = dateFormat.format(start_time_date); |
| | | |
| | | |
| | | String filter=" DATE_FORMAT(start_time,\"%Y-%m-%d\") ='"+format.split(" ")[0]+"'"; |
| | | |
| | | DataTableEntity dataTableEntity = baseDao.listTable("product_oa_conference_apply",filter,new Object[]{}); |
| | | boolean flag=true; |
| | | for (int i = 0; i < dataTableEntity.getRows(); i++) { |
| | | FieldSetEntity fieldSetEntity = dataTableEntity.getData().get(i); |
| | | Date start_time = fse.getDate("start_time"); |
| | | Date end_time = fse.getDate("end_time"); |
| | | Date start_time1 =fieldSetEntity.getDate("start_time"); |
| | | Date end_time1 = fieldSetEntity.getDate("end_time"); |
| | | if(start_time1.before(start_time) && end_time1.after(start_time)){ |
| | | flag=false; |
| | | } |
| | | if(start_time1.before(end_time) && end_time1.after(end_time)){ |
| | | flag=false; |
| | | } |
| | | |
| | | if(start_time1.after(start_time) && end_time1.before(end_time)){ |
| | | flag=false; |
| | | } |
| | | |
| | | } |
| | | HashMap<String,Object> hashMap=new HashMap<>(); |
| | | BaseUtil.createCreatorAndCreationTime(SpringMVCContextHolder.getCurrentUser(), fse); |
| | | if(flag==false){ |
| | | hashMap.put("code","200"); |
| | | hashMap.put("msg","此时间段已被占用"); |
| | | hashMap.put("status","sucess"); |
| | | }else { |
| | | if(ObjectUtil.isNotEmpty(fse.getValue("uuid"))){ |
| | | baseDao.update(fse); |
| | | }else { |
| | | baseDao.add(fse); |
| | | } |
| | | hashMap.put("code","200"); |
| | | hashMap.put("msg","成功"); |
| | | hashMap.put("status","sucess"); |
| | | } |
| | | return hashMap; |
| | | } |
| | | // @Override |
| | | // @Transactional |
| | | // public void saveOrUpdateMeetingInfo(FieldSetEntity fse) throws BaseException { |
| | | // |
| | | // Date start_time_date = fse.getDate("start_time"); |
| | | // SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | // String format = dateFormat.format(start_time_date); |
| | | // |
| | | // |
| | | // String filter=" DATE_FORMAT(start_time,\"%Y-%m-%d\") ='"+format.split(" ")[0]+"'"; |
| | | // DataTableEntity dataTableEntity = baseDao.listTable("product_oa_conference_apply", filter, new Object[]{}); |
| | | // boolean flag=true; |
| | | // for (int i = 0; i < dataTableEntity.getRows(); i++) { |
| | | // FieldSetEntity fieldSetEntity = dataTableEntity.getData().get(i); |
| | | // Date start_time = fse.getDate("start_time"); |
| | | // Date end_time = fse.getDate("end_time"); |
| | | // Date start_time1 =fieldSetEntity.getDate("start_time"); |
| | | // Date end_time1 = fieldSetEntity.getDate("end_time"); |
| | | // if(start_time1.before(start_time) && end_time1.after(start_time)){ |
| | | // flag=false; |
| | | // } |
| | | // if(start_time1.before(end_time) && end_time1.after(end_time)){ |
| | | // flag=false; |
| | | // } |
| | | // |
| | | // if(start_time1.after(start_time) && end_time1.before(end_time)){ |
| | | // flag=false; |
| | | // } |
| | | // |
| | | // } |
| | | // HashMap<String,Object> hashMap=new HashMap<>(); |
| | | // BaseUtil.createCreatorAndCreationTime(fse); |
| | | // if(flag==false){ |
| | | // throw new BaseException("", "时间段被占用"); |
| | | // } |
| | | // baseDao.saveFieldSetEntity(fse); |
| | | // } |
| | | |
| | | @Override |
| | | public BitMatrix getQrCode(String content) throws BaseException, WriterException, IOException { |
| | |
| | | DataTableEntity product_oa_conference_apply = baseDao.listTable("product_oa_conference_apply", filter, new Object[]{}); |
| | | if(product_oa_conference_apply.getRows()!=0){ |
| | | FieldSetEntity fieldSetEntity = product_oa_conference_apply.getFieldSetEntity(0); |
| | | if(fieldSetEntity.getString("status").equals("已取消")){ |
| | | if("已取消".equals(fieldSetEntity.getString("status"))){ |
| | | fieldSetEntity.setValue("status","已启用"); |
| | | }else { |
| | | fieldSetEntity.setValue("status","已取消"); |
| | |
| | | |
| | | @Override |
| | | public String ConferenceSign(FieldSetEntity fse) throws BaseException, ParseException { |
| | | |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | if(!StringUtils.isEmpty(fse.getString("uuid"))&&!StringUtils.isEmpty(fse.getString("date"))){ |
| | | String uuid = fse.getString("uuid"); |
| | |
| | | return jsonObject.toString(); |
| | | } |
| | | |
| | | @Override |
| | | public HashMap getSignOrVisitInfo(FieldSetEntity fse) throws BaseException { |
| | | |
| | | String meeting_uuid = fse.getString("meeting_uuid"); |
| | | //type=1就是签到数据,type=2就是访问数据 |
| | | String type = fse.getString("type"); |
| | | List<Object> params=new ArrayList<>(); |
| | | params.add(meeting_uuid); |
| | | params.add(meeting_uuid); |
| | | |
| | | StringBuilder sb=new StringBuilder(); |
| | | sb.append(" SELECT c.* FROM ( "); |
| | | sb.append(" SELECT b.staff_id,b.uuid as meeting_uuid,f.show_name,l.uuid as dept_uuid,l.org_level_name,"); |
| | | /** |
| | | * 获取会议访问/签到信息 |
| | | */ |
| | | public DataTableEntity getMeetingSignOrVisit(FieldSetEntity fse) throws BaseException { |
| | | String meeting_uuid = fse.getString("meeting_uuid"); |
| | | String type = fse.getString("type"); |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("\nSELECT c.* FROM ( "); |
| | | sb.append("\n SELECT b.staff_id,b.uuid as meeting_uuid,f.show_name,l.uuid as dept_uuid,l.org_level_name,"); |
| | | if(type.equals("1")){ |
| | | sb.append(" n.sign_status"); |
| | | sb.append(" n.sign_status"); |
| | | }else { |
| | | sb.append(" n.visit_status"); |
| | | } |
| | | sb.append(" FROM (" ); |
| | | sb.append(" SELECT y.*, "); |
| | | sb.append(" SUBSTRING_INDEX( SUBSTRING_INDEX( participator, ',', n ), ',', - 1 ) AS staff_id"); |
| | | sb.append(" FROM product_oa_conference_apply y, "); |
| | | sb.append(" ( SELECT @rownum := @rownum + 1 AS n FROM ( SELECT @rownum := 0 ) r, product_oa_conference_apply ) x "); |
| | | sb.append(" WHERE 1 = 1 "); |
| | | sb.append(" AND n <= ( LENGTH( participator ) - LENGTH( REPLACE ( participator, ',', '' ) ) + 1 )"); |
| | | sb.append(" and y.uuid= ? "); |
| | | sb.append(" )b "); |
| | | sb.append(" LEFT JOIN product_sys_staffs f on b.staff_id=f.user_id "); |
| | | sb.append(" LEFT JOIN product_sys_org_levels l on f.dept_uuid=l.uuid "); |
| | | sb.append("\n FROM (" ); |
| | | sb.append("\n SELECT y.*, "); |
| | | sb.append("\n SUBSTRING_INDEX( SUBSTRING_INDEX( participator, ',', n ), ',', - 1 ) AS staff_id"); |
| | | sb.append("\n FROM product_oa_conference_apply y,(SELECT @rownum := @rownum + 1 AS n FROM ( SELECT @rownum := 0 ) r, product_oa_conference_apply ) x "); |
| | | sb.append("\n WHERE 1 = 1 AND n <= ( LENGTH( participator ) - LENGTH( REPLACE ( participator, ',', '' ) ) + 1 )"); |
| | | sb.append("\n and y.uuid= ? "); |
| | | sb.append("\n )b "); |
| | | sb.append("\n LEFT JOIN product_sys_staffs f on b.staff_id=f.user_id "); |
| | | sb.append("\n LEFT JOIN product_sys_org_levels l on f.dept_uuid=l.uuid "); |
| | | if(type.equals("1")){ |
| | | sb.append(" LEFT JOIN product_oa_conference_sign n "); |
| | | sb.append("\n LEFT JOIN product_oa_conference_sign n "); |
| | | }else { |
| | | sb.append(" LEFT JOIN product_oa_conference_visit n "); |
| | | sb.append("\n LEFT JOIN product_oa_conference_visit n "); |
| | | } |
| | | sb.append(" on b.staff_id=n.user_id and n.meeting_uuid=? "); |
| | | sb.append(" )c"); |
| | | |
| | | DataTableEntity dataTableEntity = baseDao.listTable(sb.toString(),params.toArray()); |
| | | List<HashMap> listDate=new ArrayList<>(); |
| | | List<HashMap> listDateSign=new ArrayList<>(); |
| | | List<HashMap> listDateNoSign=new ArrayList<>(); |
| | | |
| | | List<String> list=new ArrayList(); |
| | | |
| | | int sign_count=0; |
| | | int sign_all=0; |
| | | int sign_down=0; |
| | | HashMap<String,Object> hashMapResult=new HashMap<>(); |
| | | sb.append("\n ON b.staff_id=n.user_id and n.meeting_uuid=? "); |
| | | sb.append("\n)c"); |
| | | // 获取会议访问/签到信息 |
| | | DataTableEntity dataTableEntity = baseDao.listTable(sb.toString(), new Object[] {meeting_uuid, meeting_uuid}); |
| | | // 遍历会议访问/签到信息 |
| | | for (int i = 0; i < dataTableEntity.getRows(); i++) { |
| | | FieldSetEntity fieldSetEntity = dataTableEntity.getFieldSetEntity(i); |
| | | |
| | | if(!list.contains(fieldSetEntity.getString("org_level_name"))){ |
| | | HashMap<String,Object> hashMap=new HashMap<>(); |
| | | hashMap.put("dept_uuid",fieldSetEntity.getString("dept_uuid")); |
| | | hashMap.put("org_level_name",fieldSetEntity.getString("org_level_name")); |
| | | list.add(fieldSetEntity.getString("org_level_name")); |
| | | listDate.add(hashMap); |
| | | } |
| | | |
| | | fieldSetEntity.setValue("parent",fieldSetEntity.getString("dept_uuid")); |
| | | HashMap<String,Object> hashMap=new HashMap<>(); |
| | | for (int j = 0; j < fieldSetEntity.getValues().keySet().size(); j++) { |
| | | hashMap.put(fieldSetEntity.getValues().keySet().toArray()[j].toString(),fieldSetEntity.getValue(fieldSetEntity.getValues().keySet().toArray()[j].toString())); |
| | | |
| | | } |
| | | listDate.add(hashMap); |
| | | |
| | | FieldSetEntity fieldSetEntity = dataTableEntity.getFieldSetEntity(i); |
| | | } |
| | | sign_all=listDate.size(); |
| | | List<String> list1=new ArrayList(); |
| | | List<String> list2=new ArrayList(); |
| | | for (int j = 0; j < listDate.size(); j++) { |
| | | if((ObjectUtil.isNotEmpty(listDate.get(j).get("sign_status"))&&listDate.get(j).get("sign_status").equals("已签到")) || (ObjectUtil.isNotEmpty(listDate.get(j).get("visit_status"))&&listDate.get(j).get("visit_status").equals("已访问")) ){ |
| | | if(!list1.contains(listDate.get(j).get("org_level_name"))){ |
| | | list1.add(listDate.get(j).get("org_level_name").toString()); |
| | | HashMap<String,Object> hashMap=new HashMap<>(); |
| | | hashMap.put("dept_uuid",listDate.get(j).get("dept_uuid")); |
| | | hashMap.put("org_level_name",listDate.get(j).get("org_level_name")); |
| | | listDateSign.add(hashMap); |
| | | } |
| | | sign_count++; |
| | | //避免重复添加部门 |
| | | if(listDate.get(j).size()!=2){ |
| | | listDateSign.add(listDate.get(j)); |
| | | } |
| | | |
| | | }else { |
| | | if(!list2.contains(listDate.get(j).get("org_level_name"))){ |
| | | list2.add(listDate.get(j).get("org_level_name").toString()); |
| | | HashMap<String,Object> hashMap=new HashMap<>(); |
| | | hashMap.put("dept_uuid",listDate.get(j).get("dept_uuid")); |
| | | hashMap.put("org_level_name",listDate.get(j).get("org_level_name")); |
| | | listDateNoSign.add(hashMap); |
| | | } |
| | | //避免重复添加部门 |
| | | if(listDate.get(j).size()!=2){ |
| | | listDateNoSign.add(listDate.get(j)); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | sign_down=sign_all-sign_count; |
| | | hashMapResult.put("signOrvisit_down",sign_count); |
| | | hashMapResult.put("no_signOrvisit",sign_down); |
| | | hashMapResult.put("listDateNoSignOrVisit",listDateNoSign); |
| | | hashMapResult.put("listDateSignOrVisit",listDateSign); |
| | | return hashMapResult; |
| | | return dataTableEntity; |
| | | } |
| | | |
| | | @Override |
| | |
| | | String startTime = fse.getString("startTime"); |
| | | String endTime = fse.getString("endTime"); |
| | | StringBuilder sql = new StringBuilder(); |
| | | sql.append(" SELECT "); |
| | | sql.append(" a.uuid, "); |
| | | sql.append(" b.uuid apply_uuid, "); |
| | | sql.append(" a.room_name, "); |
| | | sql.append(" b.meeting_topic, "); |
| | | sql.append("\nSELECT "); |
| | | sql.append("\n a.uuid,b.uuid apply_uuid,a.room_name,b.meeting_topic, b.flow_flag, "); |
| | | if (com.product.admin.config.CmnConst.MOBILE_CLIENT_TYPE.equalsIgnoreCase(clientType)) { |
| | | //移动端 |
| | | sql.append(" date_format(b.start_time,'%Y-%m-%d %H:%i:%s') start_time, "); |
| | | sql.append(" date_format(b.end_time,'%Y-%m-%d %H:%i:%s') end_time, "); |
| | | } else { |
| | | |
| | | sql.append(" b.start_time, "); |
| | | sql.append(" b.end_time, "); |
| | | sql.append(" b.start_time, b.end_time, "); |
| | | } |
| | | sql.append(" b.flow_flag, "); |
| | | sql.append(" ( SELECT user_name FROM product_sys_users WHERE user_id = b.created_by ) proposer "); |
| | | sql.append(" FROM "); |
| | | sql.append(" product_oa_CONFERENCE_room_config a "); |
| | | sql.append(" LEFT JOIN ( SELECT flow_flag,meeting_room,uuid,meeting_topic,start_time,end_time,created_by FROM "); |
| | | sql.append(" product_oa_conference_apply b WHERE "); |
| | | sql.append("start_time>=? and start_time<=? or (end_time>=? and start_time<=?) "); |
| | | sql.append(" and start_time is not null and end_time is not null and flow_flag in (1,2) ) b "); |
| | | sql.append(" ON a.uuid = b.meeting_room "); |
| | | sql.append(" WHERE "); |
| | | sql.append(" a.`status` = 1 "); |
| | | sql.append(" AND org_level_uuid = ? "); |
| | | sql.append(" AND enabled_time <= now( ) "); |
| | | sql.append(" GROUP BY "); |
| | | sql.append(" a.uuid, "); |
| | | sql.append(" b.uuid, "); |
| | | sql.append(" a.room_name, "); |
| | | sql.append(" b.meeting_topic, "); |
| | | sql.append(" b.start_time, "); |
| | | sql.append(" b.end_time, "); |
| | | sql.append(" b.created_by,b.flow_flag "); |
| | | sql.append(" ORDER BY "); |
| | | sql.append(" b.start_time "); |
| | | sql.append("\n ( SELECT user_name FROM product_sys_users WHERE user_id = b.created_by ) proposer "); |
| | | sql.append("\nFROM product_oa_CONFERENCE_room_config a "); |
| | | sql.append("\nLEFT JOIN ("); |
| | | sql.append("\n SELECT flow_flag,meeting_room,uuid,meeting_topic,start_time,end_time,created_by "); |
| | | sql.append("\n FROM product_oa_conference_apply b "); |
| | | sql.append("\n WHERE start_time >= ? and start_time <= ? or (end_time >= ? and start_time <= ?) "); |
| | | sql.append("\n and start_time is not null and end_time is not null and flow_flag in (1,2) "); |
| | | sql.append("\n) b"); |
| | | sql.append("\nON a.uuid = b.meeting_room "); |
| | | //这个东西取消了 |
| | | // sql.append("\nWHERE a.`status` = 1 AND org_level_uuid = ? AND enabled_time <= now() "); |
| | | sql.append("\nWHERE a.`status` = 1 AND org_level_uuid = ? "); |
| | | sql.append("\nGROUP BY a.uuid, b.uuid,a.room_name,b.meeting_topic,b.start_time,b.end_time,b.created_by,b.flow_flag "); |
| | | sql.append("\nORDER BY b.start_time "); |
| | | DataTableEntity dt = baseDao.listTable(sql.toString(), new Object[]{startTime, endTime, startTime, endTime, org_level_uuid}); |
| | | dt.getMeta().addAliasTable(CmnConst.PRODUCT_OA_CONFERENCE_APPLY, "b"); |
| | | baseDao.loadPromptData(dt); |
| | |
| | | fieldSetEntity.setValue("meetint_type", fieldSetEntity.getString("meetint_type_save_value")); |
| | | } |
| | | |
| | | |
| | | //存储访问记录 |
| | | SystemUser currentUser = SpringMVCContextHolder.getCurrentUser(); |
| | | String fliter="meeting_uuid='"+fse.getUUID()+"' and user_id='"+currentUser.getUser_id()+"'"; |
| | |
| | | fieldSetEntity1.setValue("visit_date_new",new Date()); |
| | | baseDao.update(fieldSetEntity1); |
| | | }else { |
| | | FieldSetEntity fieldSetEntityVisit = new FieldSetEntity(); |
| | | fieldSetEntityVisit.setTableName("product_oa_conference_visit"); |
| | | fieldSetEntityVisit.setValue("visit_user",currentUser.getUser_name()); |
| | | fieldSetEntityVisit.setValue("user_id",currentUser.getUser_id()); |
| | | fieldSetEntityVisit.setValue("org_level_uuid","00000000-0000-0000-0000-000000000000"); |
| | | fieldSetEntityVisit.setValue("organization",currentUser.getDept_uuid()); |
| | | fieldSetEntityVisit.setValue("organization_name",currentUser.getCurrentDept().getString("org_level_name")); |
| | | fieldSetEntityVisit.setValue("visit_date_first",new Date()); |
| | | fieldSetEntityVisit.setValue("visit_date_new",new Date()); |
| | | fieldSetEntityVisit.setValue("visit_count",1); |
| | | fieldSetEntityVisit.setValue("visit_status","已访问"); |
| | | fieldSetEntityVisit.setValue("meeting_uuid",fse.getUUID()); |
| | | BaseUtil.createCreatorAndCreationTime(SpringMVCContextHolder.getCurrentUser(), fieldSetEntityVisit); |
| | | baseDao.add(fieldSetEntityVisit); |
| | | FieldSetEntity fieldSetEntityVisit = new FieldSetEntity(); |
| | | fieldSetEntityVisit.setTableName("product_oa_conference_visit"); |
| | | fieldSetEntityVisit.setValue("visit_user",currentUser.getUser_name()); |
| | | fieldSetEntityVisit.setValue("user_id",currentUser.getUser_id()); |
| | | fieldSetEntityVisit.setValue("org_level_uuid","00000000-0000-0000-0000-000000000000"); |
| | | fieldSetEntityVisit.setValue("organization",currentUser.getDept_uuid()); |
| | | fieldSetEntityVisit.setValue("organization_name",currentUser.getCurrentDept().getString("org_level_name")); |
| | | fieldSetEntityVisit.setValue("visit_date_first",new Date()); |
| | | fieldSetEntityVisit.setValue("visit_date_new",new Date()); |
| | | fieldSetEntityVisit.setValue("visit_count",1); |
| | | fieldSetEntityVisit.setValue("visit_status","已访问"); |
| | | fieldSetEntityVisit.setValue("meeting_uuid",fse.getUUID()); |
| | | BaseUtil.createCreatorAndCreationTime(SpringMVCContextHolder.getCurrentUser(), fieldSetEntityVisit); |
| | | baseDao.add(fieldSetEntityVisit); |
| | | } |
| | | |
| | | |
| | | return fieldSetEntity; |
| | | } |
| | | |
| | |
| | | baseDao.loadPromptData(dt); |
| | | return dt; |
| | | } |
| | | |
| | | /** |
| | | * 会议纪要列表 |
| | | * @param fse |
| | | * @return |
| | | */ |
| | | public DataTableEntity listMeetingMinute(FieldSetEntity fse) { |
| | | StringBuilder sbSql = new StringBuilder(); |
| | | sbSql.append("\nSELECT B.meeting_master,start_time,end_time, A.*"); |
| | | sbSql.append("\nFROM product_oa_conference_minute A"); |
| | | sbSql.append("\nLEFT JOIN product_oa_conference_apply B ON B.uuid = A.meeting_uuid"); |
| | | return baseDao.listTable(sbSql.toString(), new Object[] {}, fse.getInteger(CmnConst.PAGESIZE), fse.getInteger(CmnConst.CPAGE)); |
| | | } |
| | | |
| | | /** |
| | | * 会议纪要详情 |
| | | * @param fse |
| | | * @return |
| | | */ |
| | | public FieldSetEntity findMeetingMinute(FieldSetEntity fse) { |
| | | List<String> param = new ArrayList<>(); |
| | | String filter = null; |
| | | if (StringUtils.isEmpty(fse.getUUID())) { |
| | | filter = "B.uuid = ?"; |
| | | param.add(fse.getString("meeting_uuid")); |
| | | } else { |
| | | filter = "A.uuid = ?"; |
| | | param.add(fse.getUUID()); |
| | | } |
| | | StringBuilder sbSql = new StringBuilder(); |
| | | sbSql.append("\nSELECT "); |
| | | sbSql.append("\n B.uuid AS meeting_uuid,B.meeting_topic,B.meeting_master,B.meeting_recorder,B.participator,CONCAT(start_time,'-',end_time)AS meeting_time, "); |
| | | sbSql.append("\n A.uuid,A.meeting_minute,A.copy_user,A.flow_flag"); |
| | | sbSql.append("\nFROM product_oa_conference_minute A"); |
| | | sbSql.append("\nRIGHT JOIN product_oa_conference_apply B ON B.uuid = A.meeting_uuid"); |
| | | sbSql.append("\nWHERE ").append(filter); |
| | | FieldSetEntity fseMeetingMinute = baseDao.getFieldSetEntityBySQL(sbSql.toString(), param.toArray(), false); |
| | | baseDao.loadPromptData(fseMeetingMinute); |
| | | if(!StringUtils.isEmpty(fseMeetingMinute.getUUID())) { |
| | | DataTableEntity dtMeetingMinute = baseDao.listTable("product_oa_conference_minute_sub", "main_uuid = ?", new Object[] {fseMeetingMinute.getUUID()}); |
| | | fseMeetingMinute.addSubDataTable(dtMeetingMinute); |
| | | } |
| | | return fseMeetingMinute; |
| | | } |
| | | |
| | | /** |
| | | * 自动发起任务 |
| | | * @param fse |
| | | */ |
| | | public void autoMeetingtask(FieldSetEntity fse) { |
| | | DataTableEntity dtMeetingMinute = fse.getSubDataTable("product_oa_conference_minute_sub"); |
| | | if(!BaseUtil.dataTableIsEmpty(dtMeetingMinute)) { |
| | | for (int i = 0; i < dtMeetingMinute.getRows(); i++) { |
| | | FieldSetEntity fseMeetingMinute = dtMeetingMinute.getFieldSetEntity(i); |
| | | if ("1".equals(fseMeetingMinute.getString("item_task"))) { |
| | | FieldSetEntity fseOaTask = new FieldSetEntity("product_oa_task_distribution"); |
| | | fseOaTask.setValue("task_name", fseMeetingMinute.getString("item_name")); |
| | | fseOaTask.setValue("task_description", fseMeetingMinute.getString("item_detail")); |
| | | fseOaTask.setValue("task_persons", fseMeetingMinute.getString("item_user")); |
| | | fseOaTask.setValue("owner", fseMeetingMinute.getString("item_mananger")); |
| | | fseOaTask.setValue("task_start_time", fseMeetingMinute.getString("plan_finish_time")); |
| | | fseOaTask.setValue("task_finish_time", fseMeetingMinute.getString("plan_start_time")); |
| | | fseOaTask.setValue("task_source", 1); |
| | | fseOaTask.setValue("task_status", 1); |
| | | fseOaTask.setValue("task_complete_sche", 0); |
| | | fseOaTask.setValue("finish_type", 0); |
| | | fseOaTask.setValue("org_level_uuid", SpringMVCContextHolder.getCurrentUser().getOrg_level_uuid()); |
| | | baseDao.add(fseOaTask); |
| | | |
| | | // 发送任务消息 |
| | | taskDistributionService.sendTaskMessage(fseOaTask, fseMeetingMinute.getString("item_user"), "admin", 1, fseOaTask.getUUID()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void taskMeetingRminder() { |
| | | DataTableEntity dt = baseDao.listTable(CmnConst.PRODUCT_OA_CONFERENCE_APPLY, " flow_flag=2 and ( to_remind IS NULL OR to_remind = 0 ) AND reminder_time > 0 and reminder_time>=(( UNIX_TIMESTAMP(start_time ) - UNIX_TIMESTAMP( now( ) ) ) / 60) ", new Object[]{}); |
| | |
| | | Set<String> users = new HashSet<>(); |
| | | String created_user = dt.getString(i, CmnConst.CREATED_BY + "_save_value"); |
| | | //记录人 |
| | | users.add(dt.getString(i, "record_man")); |
| | | users.add(dt.getString(i, "meeting_recorder")); |
| | | //主持人 |
| | | users.add(dt.getString(i, "record_master")); |
| | | users.add(dt.getString(i, "meeting_master")); |
| | | //参加者 |
| | | String[] participators = dt.getString(i, "participator").split(","); |
| | | users.addAll(Arrays.asList(participators)); |