| | |
| | | @Transactional |
| | | @Override |
| | | public boolean saveConferenceRoom(FieldSetEntity fse) throws BaseException { |
| | | //重名验证对象 |
| | | FieldSetEntity nameVerification = null; |
| | | if (StringUtils.isEmpty(fse.getUUID())) { |
| | | fse.setValue(CmnConst.ORG_LEVEL_UUID, SpringMVCContextHolder.getCurrentUser().getOrg_level_uuid()); |
| | | } |
| | | nameVerification = baseDao.getFieldSetEntityByFilter(CmnConst.PRODUCT_OA_CONFERENCE_ROOM_CONFIG, "room_name=?", new Object[] {fse.getString("room_name")}, false); |
| | | }else { |
| | | nameVerification = baseDao.getFieldSetEntityByFilter(CmnConst.PRODUCT_OA_CONFERENCE_ROOM_CONFIG, "room_name=? and uuid!=?", new Object[] {fse.getString("room_name"), fse.getUUID()}, false); |
| | | } |
| | | 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); |
| | | } |
| | | |
| | |
| | | @Override |
| | | @Transactional |
| | | public String saveConferenceApply(FieldSetEntity fse) throws BaseException { |
| | | if ("0".equals(fse.getString("type"))){ |
| | | baseDao.saveFieldSetEntity(fse); |
| | | return fse.getUUID(); |
| | | } |
| | | if (StringUtils.isEmpty(fse.getUUID())) { |
| | | fse.setValue(CmnConst.ORG_LEVEL_UUID, SpringMVCContextHolder.getCurrentUser().getOrg_level_uuid()); |
| | | fse.setValue("flow_flag", 0); |
| | |
| | | @Transactional |
| | | public boolean delConferenceApply(FieldSetEntity fse) throws BaseException { |
| | | 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(y.start_time,\"%Y-%m-%d\")=?"); |
| | | bs.append(" and LOCATE(?, g.enable_seal)"); |
| | | 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; |
| | | } |
| | | |
| | | |
| | |
| | | sql.append(" b.meeting_topic, "); |
| | | sql.append(" b.start_time, "); |
| | | sql.append(" b.end_time, "); |
| | | sql.append(" b.created_by "); |
| | | sql.append(" b.created_by,b.flow_flag "); |
| | | sql.append(" ORDER BY "); |
| | | sql.append(" a.id,b.start_time "); |
| | | sql.append(" b.start_time "); |
| | | DataTableEntity dt = baseDao.listTable(sql.toString(), new Object[]{startTime, endTime, startTime, endTime, org_level_uuid}); |
| | | dt.getMeta().addAliasTable(CmnConst.PRODUCT_OA_CONFERENCE_APPLY, "b"); |
| | | baseDao.loadPromptData(dt); |