From 1614f88b7feb3be9451a6698875715365f09ae83 Mon Sep 17 00:00:00 2001
From: 杜洪波 <1074825718@qq.com>
Date: 星期四, 16 十月 2025 17:08:51 +0800
Subject: [PATCH] 会议任务
---
src/main/java/com/product/administration/service/ConferenceManagerService.java | 832 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 829 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/product/administration/service/ConferenceManagerService.java b/src/main/java/com/product/administration/service/ConferenceManagerService.java
index 93d99d9..2317880 100644
--- a/src/main/java/com/product/administration/service/ConferenceManagerService.java
+++ b/src/main/java/com/product/administration/service/ConferenceManagerService.java
@@ -1,6 +1,15 @@
package com.product.administration.service;
+import cn.hutool.core.date.DateUnit;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.EncodeHintType;
+import com.google.zxing.MultiFormatWriter;
+import com.google.zxing.WriterException;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import com.product.administration.config.CmnConst;
import com.product.administration.config.SystemCode;
import com.product.administration.service.ide.IConferenceManagerService;
@@ -17,13 +26,20 @@
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.io.IOException;
import java.text.DecimalFormat;
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.*;
/**
@@ -42,6 +58,8 @@
QueryFilterService queryFilterService;
@Autowired
PermissionService permissionService;
+ @Autowired
+ TaskDistributionService taskDistributionService;
/**
* 浼氳瀹ゅ垪琛�
@@ -199,6 +217,709 @@
public boolean delConferenceApply(FieldSetEntity fse) throws BaseException {
return baseDao.delete(fse.getTableName(), fse.getUUID().split(","));
}
+
+ /**
+ * 浼氳鐪嬫澘鍛ㄤ俊鎭�
+ */
+ @Override
+ @Transactional
+ 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 <= ?)");
+
+ 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 += " and ";
+ }
+ }
+ }
+ 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
+// @Transactional
+// public List getkbData(FieldSetEntity fse) throws BaseException {
+// 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="";
+// if(!StringUtils.isEmpty(meeting_resource)){
+//
+// String[] split = meeting_resource.split(",");
+// for (int i = 0; i < split.length; 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 start_time between '"+meeting_date+"' and '"+meeting_date_end+"'";
+// 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);
+// }
+// }
+//
+// }
+// return listDate;
+// }
+
+ @Override
+ public List getMeetingDetails(FieldSetEntity fse) throws BaseException {
+ String meeting_room = fse.getString("meeting_room");
+ 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)){
+
+ String[] split = meeting_resource.split(",");
+ for (int i = 0; i < split.length; i++) {
+ if(i!=split.length-1){
+ replace_meeting_resource=replace_meeting_resource+"T1.meeting_resource like '%"+split[i]+"%' and ";
+ }else {
+ replace_meeting_resource=replace_meeting_resource+"T1.meeting_resource like '%"+split[i]+"%'";
+ }
+ }
+ }
+ 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_start_date);
+ param.add(meeting_end_date);
+ StringBuilder sb=new StringBuilder();
+ sb.append("\nSELECT 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.meeting_recorder as meeting_recorder_uuid, ");
+ 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 DATE_FORMAT(b.start_time,\"%Y-%m-%d\") as meeting_date,");
+ sb.append("\n GROUP_CONCAT(b.dict_label SEPARATOR ',') AS meeting_resouces ");
+ 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("\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("\ngroup by b.uuid,b.start_time,b.end_time,b.meeting_topic,b.meeting_recorder,b.meeting_master,b.status ");
+ 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;
+ }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 {
+ fse.setValue("status","鏈紑濮�");
+ baseDao.add(fse);
+ }
+ hashMap.put("code","200");
+ hashMap.put("msg","鎴愬姛");
+ hashMap.put("status","sucess");
+ }
+ return hashMap;
+ }
+
+ @Override
+ public BitMatrix getQrCode(String content) throws BaseException, WriterException, IOException {
+
+ //浜岀淮鐮佺殑瀹介珮
+ int width = 200;
+ int height = 200;
+
+ //鍏朵粬鍙傛暟锛屽瀛楃闆嗙紪鐮�
+ Map<EncodeHintType, Object> hints = new HashMap<EncodeHintType, Object>();
+ hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
+ //瀹归敊绾у埆涓篐
+ hints.put(EncodeHintType.ERROR_CORRECTION , ErrorCorrectionLevel.H);
+ //鐧借竟鐨勫搴︼紝鍙彇0~4
+ hints.put(EncodeHintType.MARGIN , 0);
+
+ BitMatrix bitMatrix = null;
+ try {
+
+ bitMatrix = new MultiFormatWriter().encode(content,
+ BarcodeFormat.QR_CODE, width, height, hints);
+
+ } catch (WriterException e) {
+ e.printStackTrace();
+ }
+
+ return bitMatrix;
+ }
+
+ @Override
+ public void CancelAndStart(FieldSetEntity fse) throws BaseException {
+
+ String uuid = fse.getString("uuid");
+ String filter=" uuid='"+uuid+"'";
+ 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("宸插彇娑�")){
+ fieldSetEntity.setValue("status","宸插惎鐢�");
+ }else {
+ fieldSetEntity.setValue("status","宸插彇娑�");
+ }
+ baseDao.update(fieldSetEntity);
+ }
+
+ }
+
+ @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");
+ String date = fse.getString("date");
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Date parseDate = dateFormat.parse(date);
+ long between = DateUtil.between(parseDate, new Date(), DateUnit.SECOND);
+
+ if(between>20){
+ jsonObject.put("code","200");
+ jsonObject.put("msg","浜岀淮鐮佸凡澶辨晥");
+ jsonObject.put("status","fail");
+
+ }else {
+
+ SystemUser currentUser = SpringMVCContextHolder.getCurrentUser();
+ FieldSetEntity fieldSetEntity = new FieldSetEntity();
+ fieldSetEntity.setTableName("product_oa_conference_sign");
+ fieldSetEntity.setValue("sign_user",currentUser.getUser_name());
+ fieldSetEntity.setValue("user_id",currentUser.getUser_id());
+ fieldSetEntity.setValue("org_level_uuid","00000000-0000-0000-0000-000000000000");
+ fieldSetEntity.setValue("organization",currentUser.getDept_uuid());
+ fieldSetEntity.setValue("organization_name",currentUser.getCurrentDept().getString("org_level_name"));
+ fieldSetEntity.setValue("sign_date",new Date());
+ fieldSetEntity.setValue("sign_status","宸茬鍒�");
+ fieldSetEntity.setValue("meeting_uuid",uuid);
+
+ BaseUtil.createCreatorAndCreationTime(SpringMVCContextHolder.getCurrentUser(), fse);
+ baseDao.add(fieldSetEntity);
+ jsonObject.put("code","200");
+ jsonObject.put("msg","绛惧埌鎴愬姛");
+ jsonObject.put("status","sucess");
+ }
+ }
+
+ return jsonObject.toString();
+ }
+
+ /**
+ * 鑾峰彇浼氳璁块棶/绛惧埌淇℃伅
+ */
+ 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");
+ }else {
+ sb.append(" n.visit_status");
+ }
+ 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("\n LEFT JOIN product_oa_conference_sign n ");
+ }else {
+ sb.append("\n LEFT JOIN product_oa_conference_visit n ");
+ }
+ 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);
+ }
+ return dataTableEntity;
+ }
+
+// @Override
+// public HashMap getSignOrVisitInfo(FieldSetEntity fse) throws BaseException {
+//
+// String meeting_uuid = fse.getString("meeting_uuid");
+// //type=1灏辨槸绛惧埌鏁版嵁锛宼ype=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("\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");
+// }else {
+// sb.append(" n.visit_status");
+// }
+// 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("\n LEFT JOIN product_oa_conference_sign n ");
+// }else {
+// sb.append("\n LEFT JOIN product_oa_conference_visit n ");
+// }
+// sb.append("\n ON b.staff_id=n.user_id and n.meeting_uuid=? ");
+// sb.append("\n)c");
+// // 鑾峰彇浼氳璁块棶/绛惧埌淇℃伅
+// DataTableEntity dataTableEntity = baseDao.listTable(sb.toString(), params.toArray());
+//
+// // 閮ㄩ棬淇℃伅瀛樺偍
+// List<HashMap<String, Object>> listDate = new ArrayList<>();
+// List<HashMap> listDateSign = new ArrayList<>();
+// List<HashMap> listDateNoSign = new ArrayList<>();
+// // 鐩稿叧浜哄憳鎵�灞為儴闂�
+// List<String> listDeptName = new ArrayList<>();
+//
+// HashMap<String,Object> hashMapResult=new HashMap<>();
+//
+// // 閬嶅巻浼氳璁块棶/绛惧埌淇℃伅
+// for (int i = 0; i < dataTableEntity.getRows(); i++) {
+// FieldSetEntity fieldSetEntity = dataTableEntity.getFieldSetEntity(i);
+// // 鏂伴儴闂ㄤ汉鍛�
+// if(!listDeptName.contains(fieldSetEntity.getString(CmnConst.ORG_LEVEL_NAME))){
+// HashMap<String,Object> hashMap = new HashMap<>();
+// hashMap.put(CmnConst.DEPT_UUID, fieldSetEntity.getString(CmnConst.DEPT_UUID));
+// hashMap.put(CmnConst.ORG_LEVEL_NAME, fieldSetEntity.getString(CmnConst.ORG_LEVEL_NAME));
+// listDeptName.add(fieldSetEntity.getString(CmnConst.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);
+//
+// }
+// int sign_all = listDate.size();
+// int sign_count=0;
+// List<String> list1=new ArrayList<>();
+// List<String> list2=new ArrayList<>();
+// for (int j = 0; j < listDate.size(); j++) {
+// HashMap<String, Object> mapdata = listDate.get(j);
+// if((ObjectUtil.isNotEmpty(mapdata.get("sign_status")) && mapdata.get("sign_status").equals("宸茬鍒�"))
+// || (ObjectUtil.isNotEmpty(mapdata.get("visit_status")) && mapdata.get("visit_status").equals("宸茶闂�")) ){
+// if(!list1.contains(mapdata.get("org_level_name"))){
+// list1.add(mapdata.get("org_level_name").toString());
+// HashMap<String,Object> hashMap=new HashMap<>();
+// hashMap.put("dept_uuid", mapdata.get("dept_uuid"));
+// hashMap.put("org_level_name", mapdata.get("org_level_name"));
+// listDateSign.add(hashMap);
+// }
+// sign_count++;
+// //閬垮厤閲嶅娣诲姞閮ㄩ棬
+// if(mapdata.size()!=2){
+// listDateSign.add(mapdata);
+// }
+//
+// }else {
+// if(!list2.contains(mapdata.get("org_level_name"))){
+// list2.add(mapdata.get("org_level_name").toString());
+// HashMap<String,Object> hashMap=new HashMap<>();
+// hashMap.put("dept_uuid", mapdata.get("dept_uuid"));
+// hashMap.put("org_level_name", mapdata.get("org_level_name"));
+// listDateNoSign.add(hashMap);
+// }
+// //閬垮厤閲嶅娣诲姞閮ㄩ棬
+// if(mapdata.size()!=2){
+// listDateNoSign.add(mapdata);
+// }
+// }
+// }
+// int 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;
+// }
+
+ @Override
+ public void sendMsg(FieldSetEntity fse) throws BaseException {
+
+ String meeting_uuid= fse.getString("meeting_uuid");
+ String type = fse.getString("type");
+ String user_ids = fse.getString("user_ids");
+
+ FieldSetEntity product_oa_conference_apply = baseDao.getFieldSetEntity("product_oa_conference_apply", meeting_uuid, false);
+
+
+ //姝ゆ柟寮忔槸鏍规嵁鍚庡彴鑷姩缁熻鏈闂汉鍛�
+ /* 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,");
+ if(type.equals("1")){
+ 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 ");
+ if(type.equals("1")){
+ sb.append(" LEFT JOIN product_oa_conference_sign n ");
+ }else {
+ sb.append(" LEFT JOIN product_oa_conference_visit n ");
+ }
+ sb.append(" on b.staff_id=n.user_id and n.meeting_uuid=? ");
+ sb.append(" )c");
+ if(type.equals("1")){
+ sb.append(" where c.sign_status is NULL");
+ }else {
+ sb.append(" where c.visit_status is NULL");
+ }
+
+ DataTableEntity dataTableEntity = baseDao.listTable(sb.toString(), params.toArray());
+ String user_ids = "";
+ for (int i = 0; i < dataTableEntity.getRows(); i++) {
+ FieldSetEntity fieldSetEntity = dataTableEntity.getFieldSetEntity(i);
+ if((i+1)==dataTableEntity.getRows()){
+ user_ids=user_ids+fieldSetEntity.getString("staff_id");
+ }else {
+ user_ids=user_ids+fieldSetEntity.getString("staff_id")+",";
+ }
+
+ }*/
+ String content="";
+ if(type.equals("1")){
+ content="浼氳灏嗗紑濮嬬鍒�,"+product_oa_conference_apply.getString("meeting_topic")+"-"+product_oa_conference_apply.getString("start_time")+",璇锋寜鏃剁鍒�";
+ }else {
+ content="鎮ㄦ湁鍦轰細璁渶瑕佸弬涓�,"+product_oa_conference_apply.getString("meeting_topic")+"-"+product_oa_conference_apply.getString("start_time")+",璇锋煡鐪嬩細璁鎯�";
+ }
+ SystemUser currentUser = SpringMVCContextHolder.getCurrentUser();
+ int user_id = currentUser.getUser_id();
+ String send_user=user_id+"";
+ //String reminder_mode = product_oa_conference_apply.getString("reminder_mode");
+ /* //鐭俊
+ if(reminder_mode.equals("0")){
+ }
+ //閭欢
+ if(reminder_mode.equals("1")){
+
+ }
+ //绯荤粺娑堟伅
+ if(reminder_mode.equals("2")){
+
+ }*/
+ WebsocketMesssageServiceThread.getInstance().appendMessage(user_ids, content, "浼氳鎻愰啋", 1,"1", "", "", send_user, 1, 0, 0);
+
+ }
/**
@@ -233,8 +954,8 @@
sql.append(" b.end_time, ");
}
sql.append(" b.flow_flag, ");
- sql.append(" FROM ");
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 ");
@@ -439,6 +1160,35 @@
fieldSetEntity.setValue(CmnConst.CREATED_BY, fieldSetEntity.getString(CmnConst.CREATED_BY + "_save_value"));
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()+"'";
+ DataTableEntity product_oa_conference_visit = baseDao.listTable("product_oa_conference_visit", fliter);
+
+ if(product_oa_conference_visit.getRows()!=0){
+ FieldSetEntity fieldSetEntity1 = product_oa_conference_visit.getFieldSetEntity(0);
+ Integer visit_count = fieldSetEntity1.getInteger("visit_count");
+ visit_count++;
+ fieldSetEntity1.setValue("visit_count",visit_count);
+ 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);
+ }
return fieldSetEntity;
}
@@ -490,6 +1240,82 @@
baseDao.loadPromptData(dt);
return dt;
}
+
+ /**
+ * 浼氳绾鍒楄〃
+ * @param fse
+ * @return
+ */
+ public DataTableEntity listMeetingMinute(FieldSetEntity fse) {
+ StringBuilder sbSql = new StringBuilder();
+ sbSql.append("\nSELECT B.meeting_topic, 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("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[]{});
@@ -500,9 +1326,9 @@
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));
--
Gitblit v1.9.2