18756
2024-08-16 82271cc1140d5a56b103544d1a02142289fd84a0
会议室看板8.16
已修改3个文件
80 ■■■■■ 文件已修改
src/main/java/com/product/administration/controller/ConferenceManagerController.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/product/administration/service/ConferenceManagerService.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/product/administration/service/ide/IConferenceManagerService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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);
    }
}
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;
    }
    /**
     * 会议室使用情况
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;
}