From da4c365dfdfa5d3be030617dfdb0e0310130496c Mon Sep 17 00:00:00 2001
From: 18756 <1875631620@qq.com>
Date: 星期二, 03 九月 2024 10:48:38 +0800
Subject: [PATCH] 会议室功能优化9.3

---
 src/main/java/com/product/administration/service/ConferenceManagerService.java |  428 +++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 376 insertions(+), 52 deletions(-)

diff --git a/src/main/java/com/product/administration/service/ConferenceManagerService.java b/src/main/java/com/product/administration/service/ConferenceManagerService.java
index ff02277..2328374 100644
--- a/src/main/java/com/product/administration/service/ConferenceManagerService.java
+++ b/src/main/java/com/product/administration/service/ConferenceManagerService.java
@@ -1,5 +1,7 @@
 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;
@@ -16,28 +18,23 @@
 import com.product.core.dao.BaseDao;
 import com.product.core.entity.DataTableEntity;
 import com.product.core.entity.FieldSetEntity;
-import com.product.core.entity.RequestParameterEntity;
 import com.product.core.exception.BaseException;
 import com.product.core.permission.PermissionService;
 import com.product.core.service.support.AbstractBaseService;
 import com.product.core.service.support.QueryFilterService;
 import com.product.core.spring.context.SpringMVCContextHolder;
 import com.product.core.transfer.Transactional;
-import com.product.core.util.QuickResponUtil;
 import com.product.core.websocket.service.WebsocketMesssageServiceThread;
 import com.product.module.sys.entity.SystemUser;
 import com.product.util.BaseUtil;
-import org.apache.poi.hssf.usermodel.HSSFCellStyle;
-import org.omg.CORBA.OBJ_ADAPTER;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import javax.imageio.ImageIO;
-import java.awt.image.BufferedImage;
-import java.io.File;
+
 import java.io.IOException;
 import java.text.DecimalFormat;
 import java.text.Format;
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -221,22 +218,32 @@
 
         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 replace_meeting_resource = meeting_resource.replace(",", "%");
-            meeting_resource="%"+replace_meeting_resource+"%";
-            param.add(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 y.*, g.room_name,g.uuid as meet_room_uuid ");
-        bs.append(" FROM product_oa_conference_apply y");
-        bs.append(" left JOIN product_oa_conference_room_config g ");
-        bs.append(" on y.meeting_room=g.uuid ");
-        bs.append(" where DATE_FORMAT(y.start_time,\"%Y-%m-%d\")=?");
+        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(" and  y.meeting_resource like ? ");
+            bs.append(" where ( "+replace_meeting_resource+" )");
         }
         bs.append(" ORDER BY y.start_time");
         DataTableEntity dataTableEntity = baseDao.listTable(bs.toString(), param.toArray());
@@ -259,40 +266,61 @@
                 }else {
                     fieldSetEntity1.setValue("status","浼氳涓�");
                 }
-               baseDao.executeUpdate("update product_oa_conference_apply set status='"+fieldSetEntity1.getString("status")+"' where uuid='"+fieldSetEntity1.getString("uuid")+"'");
+                baseDao.executeUpdate("update product_oa_conference_apply set status='"+fieldSetEntity1.getString("status")+"' where uuid='"+fieldSetEntity1.getString("uuid")+"'");
             }
-            //鏋勯�犳墍闇�瑕佺殑鏍煎紡
-            if(!list.contains(fieldSetEntity.getValue("room_name").toString())){
+
+            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<>();
-                hashMap.put("room_name",fieldSetEntity.getValue("room_name").toString());
-                hashMap.put("uuid",fieldSetEntity.getValue("meet_room_uuid").toString());
-                Object getStartTime = dataTableEntity.getData().get(0).getValue("start_time");
-                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-                String time = dateFormat.format(getStartTime);
-                hashMap.put("start_time",time);
-                list.add(fieldSetEntity.getValue("room_name").toString());
+                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);
 
-            }
-            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()));
+            }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);
                 }
-
             }
-            listDate.add(hashMap);
 
         }
         return  listDate;
@@ -302,15 +330,17 @@
     public List getMeetingDetails(FieldSetEntity fse) throws BaseException {
         String meeting_room = fse.getString("meeting_room");
         String meeting_date = fse.getString("meeting_date");
-        if(!StringUtils.isEmpty(meeting_room)&&!StringUtils.isEmpty(meeting_date)){
+        String meeting_date_end = fse.getString("meeting_date_end");
+        if(!StringUtils.isEmpty(meeting_room)&&!StringUtils.isEmpty(meeting_date)&&!StringUtils.isEmpty(meeting_date_end)){
             List<Object>param=new ArrayList<>();
             param.add(meeting_room);
             param.add(meeting_date);
+            param.add(meeting_date_end);
             StringBuilder sb=new StringBuilder();
-            sb.append(" SELECT b.uuid,b.start_time,b.end_time,b.meeting_topic,b.status, ");
+            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-%S\"),'~',DATE_FORMAT(b.end_time,\"%H-%i-%S\"))  as time_quantum,");
+            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 (");
@@ -322,7 +352,7 @@
             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 DATE_FORMAT(T1.start_time,\"%Y-%m-%d\")=? ");
+            sb.append(" and T1.start_time between ? and ? ");
             sb.append(" ) a");
             sb.append(" LEFT JOIN product_sys_dict t ON a.type = t.dict_value ");
             sb.append(" AND t.dict_name = '浼氳瀹よ祫婧�'");
@@ -334,14 +364,24 @@
             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_time")) || ObjectUtil.isNotEmpty( MapValues.get("end_time"))){
-                    Object start_time = MapValues.get("start_time");
+                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);
             }
@@ -419,10 +459,10 @@
 
         BitMatrix bitMatrix = null;
         try {
-            //鐢熸垚鐭╅樀锛屽洜涓烘垜鐨勪笟鍔″満鏅紶鏉ョ殑鏄紪鐮佷箣鍚庣殑URL锛屾墍浠ュ厛瑙g爜
+
             bitMatrix = new MultiFormatWriter().encode(content,
                     BarcodeFormat.QR_CODE, width, height, hints);
-            
+
         } catch (WriterException e) {
             e.printStackTrace();
         }
@@ -430,6 +470,258 @@
         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();
+    }
+
+    @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(" 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");
+
+        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<>();
+        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);
+
+        }
+        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;
+    }
+
+    @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);
+
+    }
 
 
     /**
@@ -670,6 +962,38 @@
             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;
     }
 

--
Gitblit v1.9.2