From 82271cc1140d5a56b103544d1a02142289fd84a0 Mon Sep 17 00:00:00 2001
From: 18756 <1875631620@qq.com>
Date: 星期五, 16 八月 2024 14:59:02 +0800
Subject: [PATCH] 会议室看板8.16
---
src/main/java/com/product/administration/service/ide/IConferenceManagerService.java | 5 ++
src/main/java/com/product/administration/controller/ConferenceManagerController.java | 23 +++++++++++
src/main/java/com/product/administration/service/ConferenceManagerService.java | 52 +++++++++++++++++++++++++-
3 files changed, 78 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/product/administration/controller/ConferenceManagerController.java b/src/main/java/com/product/administration/controller/ConferenceManagerController.java
index c39458f..a0ffdbf 100644
--- a/src/main/java/com/product/administration/controller/ConferenceManagerController.java
+++ b/src/main/java/com/product/administration/controller/ConferenceManagerController.java
@@ -21,6 +21,7 @@
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
+import java.util.List;
/**
* @Author cheng
@@ -419,4 +420,26 @@
}
}
+ @PostMapping("/get_kb_Data/{version}")
+ @ApiVersion(1)
+ public String getkbData(HttpServletRequest request){
+
+ //鑾峰彇鍙傛暟
+ FieldSetEntity fse = null;
+ Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
+ if (bean != null) {
+ RequestParameterEntity reqp = (RequestParameterEntity) bean;
+ fse = reqp.getFormData();
+ }
+ //鍒ゆ柇鍙傛暟鏄惁涓虹┖
+ if (bean == null || fse == null) {
+ return this.error(com.product.admin.config.SystemCode.SYSTEM_FORM_NODATA.getValue(), com.product.admin.config.SystemCode.SYSTEM_FORM_NODATA.getText());
+ }
+ List kbData = conferenceManagerService.getKbData(fse);
+
+ return OK(kbData);
+
+ }
+
+
}
diff --git a/src/main/java/com/product/administration/service/ConferenceManagerService.java b/src/main/java/com/product/administration/service/ConferenceManagerService.java
index 758e224..fc520c9 100644
--- a/src/main/java/com/product/administration/service/ConferenceManagerService.java
+++ b/src/main/java/com/product/administration/service/ConferenceManagerService.java
@@ -122,10 +122,10 @@
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);
}
@@ -200,6 +200,54 @@
return baseDao.delete(fse.getTableName(), fse.getUUID().split(","));
}
+ @Override
+ public List getKbData(FieldSetEntity fse) throws BaseException {
+
+ List<Object>param=new ArrayList<>();
+ String meeting_date = fse.getValue("meeting_date").toString();
+ String meeting_resource = fse.getValue("meeting_resource").toString();
+ param.add(meeting_date);
+ param.add(meeting_resource);
+ 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(start_time,\"%Y-%m-%d\")=?");
+ bs.append(" and meeting_resource in ( ? )");
+ 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);
+ 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());
+ 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);
+ }else {
+ hashMap.put(fieldSetEntity.getValues().keySet().toArray()[j].toString(),fieldSetEntity.getValue(fieldSetEntity.getValues().keySet().toArray()[j].toString()));
+ }
+
+ }
+ listDate.add(hashMap);
+
+ }
+ return listDate;
+ }
+
/**
* 浼氳瀹や娇鐢ㄦ儏鍐�
diff --git a/src/main/java/com/product/administration/service/ide/IConferenceManagerService.java b/src/main/java/com/product/administration/service/ide/IConferenceManagerService.java
index 5e81d26..3c9fdf0 100644
--- a/src/main/java/com/product/administration/service/ide/IConferenceManagerService.java
+++ b/src/main/java/com/product/administration/service/ide/IConferenceManagerService.java
@@ -1,7 +1,10 @@
package com.product.administration.service.ide;
+import com.product.core.entity.DataTableEntity;
import com.product.core.entity.FieldSetEntity;
import com.product.core.exception.BaseException;
+
+import java.util.List;
/**
* 浼氳瀹ょ鐞�
@@ -29,4 +32,6 @@
boolean delConferenceApply(FieldSetEntity fse)throws BaseException;
+ List getKbData(FieldSetEntity fse)throws BaseException;
+
}
--
Gitblit v1.9.2