18756
2024-08-19 e2b452e71090b5f561055f345ccd257e5f757764
会议室功能8.19
已修改3个文件
72 ■■■■■ 文件已修改
src/main/java/com/product/administration/controller/ConferenceManagerController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/product/administration/service/ConferenceManagerService.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/product/administration/service/ide/IConferenceManagerService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/product/administration/controller/ConferenceManagerController.java
@@ -447,7 +447,7 @@
    public String getMeetingDetails(HttpServletRequest request){
        //获取参数
        FieldSetEntity fse = null;
        /*Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
        Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
        if (bean != null) {
            RequestParameterEntity reqp = (RequestParameterEntity) bean;
            fse = reqp.getFormData();
@@ -455,8 +455,8 @@
        //判断参数是否为空
        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());
        }*/
        DataTableEntity meetingDetails = conferenceManagerService.getMeetingDetails(fse);
        }
        List meetingDetails = conferenceManagerService.getMeetingDetails(fse);
        return  OK(meetingDetails);
    }
src/main/java/com/product/administration/service/ConferenceManagerService.java
@@ -201,6 +201,7 @@
    }
    @Override
    @Transactional
    public List getKbData(FieldSetEntity fse) throws BaseException {
        List<Object>param=new ArrayList<>();
@@ -226,9 +227,27 @@
        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.getData().get(i);
                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.update(product_oa_conference_apply);
            //构造所需要的格式
            if(!list.contains(fieldSetEntity.getValue("room_name").toString())){
                HashMap<String,Object> hashMap=new HashMap<>();
                hashMap.put("room_name",fieldSetEntity.getValue("room_name").toString());
@@ -249,6 +268,11 @@
                    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()));
                }
@@ -261,13 +285,13 @@
    }
    @Override
    public DataTableEntity getMeetingDetails(FieldSetEntity fse) throws BaseException {
        //String uuid = fse.getString("uuid");
        String uuid="96f161b4-6360-40ba-8dc1-72bb39d56be4";
        /*if(!StringUtils.isEmpty(uuid)){*/
    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)){
            List<Object>param=new ArrayList<>();
            param.add(uuid);
            param.add(meeting_room);
            param.add(meeting_date);
            StringBuilder sb=new StringBuilder();
            sb.append(" SELECT b.uuid,b.start_time,b.end_time,b.record_man,b.record_master,b.status, ");
            sb.append(" CONCAT(DATE_FORMAT(b.start_time,\"%H-%i-%S\"),'~',DATE_FORMAT(b.end_time,\"%H-%i-%S\"))  as time_quantum,");
@@ -281,7 +305,8 @@
            sb.append(" FROM product_oa_conference_apply T1 ");
            sb.append(" 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.uuid = ? ");
            sb.append(" WHERE t1.meeting_room = ? ");
            sb.append(" and DATE_FORMAT(t1.start_time,\"%Y-%m-%d\")=? ");
            sb.append(" ) a");
            sb.append(" LEFT JOIN product_sys_dict t ON a.type = t.dict_value ");
            sb.append(" AND t.dict_name = '会议室资源'");
@@ -289,25 +314,16 @@
            sb.append(" group by b.uuid,b.start_time,b.end_time,b.record_man,b.record_master,b.status ");
            DataTableEntity dataTableEntity = baseDao.listTable(sb.toString(), param.toArray());
          List dataList =new ArrayList();
            for (int i = 0; i < dataTableEntity.getRows(); i++) {
                Date date = new Date();
                String uuid1 = dataTableEntity.getData().get(0).getString("uuid");
                String filter="uuid = '"+uuid1+"'";
                DataTableEntity product_oa_conference_apply = baseDao.listTable("product_oa_conference_apply", filter, new Object[]{});
                if(date.before(dataTableEntity.getData().get(0).getDate("start_time"))){
                    product_oa_conference_apply.getData().get(0).setValue("status","未开始");
                }else if(date.after(dataTableEntity.getData().get(0).getDate("end_time"))){
                    product_oa_conference_apply.getData().get(0).setValue("status","已取消");
                FieldSetEntity fieldSetEntity = dataTableEntity.getData().get(i);
                Map<Object, Object> values = fieldSetEntity.getValues();
                dataList.add(values);
            }
            return  dataList;
                }else {
                    product_oa_conference_apply.getData().get(0).setValue("status","会议中");
                }
                baseDao.update(product_oa_conference_apply);
            }
            return  dataTableEntity;
       /* }else {
            return null;
        }*/
        }
    }
src/main/java/com/product/administration/service/ide/IConferenceManagerService.java
@@ -34,7 +34,7 @@
    List getKbData(FieldSetEntity fse)throws  BaseException;
    DataTableEntity  getMeetingDetails(FieldSetEntity fse)throws  BaseException;
   List getMeetingDetails(FieldSetEntity fse)throws  BaseException;
}