From 980f18fc2898ba07670dd1de4f8354f815d628fb Mon Sep 17 00:00:00 2001
From: shicf <shi_chongfu@163.com>
Date: 星期三, 01 十月 2025 10:43:09 +0800
Subject: [PATCH] Merge branch 'dev' of http://nonxin.cn:8090/r/product/product-server-administration/V2.0.0 into dev
---
src/main/java/com/product/administration/service/ConferenceManagerService.java | 246 +++++++++++++++++++++++++++++++++++++-----------
1 files changed, 188 insertions(+), 58 deletions(-)
diff --git a/src/main/java/com/product/administration/service/ConferenceManagerService.java b/src/main/java/com/product/administration/service/ConferenceManagerService.java
index 0847ef7..14a507e 100644
--- a/src/main/java/com/product/administration/service/ConferenceManagerService.java
+++ b/src/main/java/com/product/administration/service/ConferenceManagerService.java
@@ -4,7 +4,6 @@
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
-import com.google.errorprone.annotations.Var;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
@@ -19,25 +18,20 @@
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 com.product.util.UnifySQLFunction;
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;
@@ -225,22 +219,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,").append(UnifySQLFunction.dateFormat("y.start_time", "dd-MM-yyyy HH:mm")).append(" start_time_format,").append(UnifySQLFunction.dateFormat("y.end_time", "dd-MM-yyyy HH:mm")).append(" 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());
@@ -251,7 +255,7 @@
FieldSetEntity fieldSetEntity = dataTableEntity.getData().get(i);
//鍒濆鍖栦細璁鐨勪娇鐢ㄧ殑鐘舵��
- String filter=" meeting_room = '"+fieldSetEntity.getString("meeting_room")+"' and DATE_FORMAT(start_time,\"%Y-%m-%d\") ='"+meeting_date+"'";
+ 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);
@@ -263,40 +267,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;
@@ -306,17 +331,35 @@
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");
+ 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_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,b.record_man as record_man_uuid, ");
+ sb.append(" SELECT b.uuid,").append(UnifySQLFunction.dateFormat("b.start_time", "yyyy-MM-dd")).append(" 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(" DATE_FORMAT(b.start_time,\"%Y-%m-%d\") as meeting_date,");
- sb.append(" GROUP_CONCAT(b.dict_label SEPARATOR ',') AS meeting_resouces ");
+ sb.append(" CONCAT(").append(UnifySQLFunction.dateFormat("b.start_time", "HH:mm")).append(",'~',").append(UnifySQLFunction.dateFormat("b.end_time", "HH:mm")).append(") as time_quantum,");
+ sb.append(" ").append(UnifySQLFunction.dateFormat("b.start_time", "yyyy-MM-dd")).append(" as meeting_date,");
+ sb.append(" ").append(UnifySQLFunction.groupConcat("b.dict_label")).append(" 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 (");
@@ -326,11 +369,14 @@
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 ? ");
+ if(!StringUtils.isEmpty(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(" ) b ");
sb.append(" group by b.uuid,b.start_time,b.end_time,b.meeting_topic,b.record_man,b.record_master,b.status ");
DataTableEntity dataTableEntity = baseDao.listTable(sb.toString(), param.toArray());
@@ -338,8 +384,8 @@
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);
@@ -407,6 +453,7 @@
if(ObjectUtil.isNotEmpty(fse.getValue("uuid"))){
baseDao.update(fse);
}else {
+ fse.setValue("status","鏈紑濮�");
baseDao.add(fse);
}
hashMap.put("code","200");
@@ -509,7 +556,7 @@
String meeting_uuid = fse.getString("meeting_uuid");
//type=1灏辨槸绛惧埌鏁版嵁锛宼ype=2灏辨槸璁块棶鏁版嵁
- String type = fse.getString("type");
+ String type = fse.getString("type");
List<Object> params=new ArrayList<>();
params.add(meeting_uuid);
params.add(meeting_uuid);
@@ -576,7 +623,7 @@
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("宸茬鍒�")){
+ 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<>();
@@ -614,6 +661,89 @@
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);
+
+ }
+
/**
* 浼氳瀹や娇鐢ㄦ儏鍐�
@@ -647,8 +777,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 ");
--
Gitblit v1.9.2