| | |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.zxing.BarcodeFormat; |
| | | import com.google.zxing.EncodeHintType; |
| | | import com.google.zxing.MultiFormatWriter; |
| | | import com.google.zxing.WriterException; |
| | | import com.google.zxing.common.BitMatrix; |
| | | import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; |
| | | import com.product.administration.config.CmnConst; |
| | | import com.product.administration.config.SystemCode; |
| | | import com.product.administration.service.ide.IConferenceManagerService; |
| | |
| | | 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.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; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | param.add(meeting_room); |
| | | param.add(meeting_date); |
| | | StringBuilder sb=new StringBuilder(); |
| | | sb.append(" SELECT b.uuid,b.start_time,b.end_time,b.meeting_topic,b.status, "); |
| | | 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 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(" SELECT T1.*, "); |
| | | sb.append(" SUBSTRING_INDEX( SUBSTRING_INDEX( T1.meeting_resource, ',', T2.digit + 1 ), ',',- 1 ) AS type "); |
| | | 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(" 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(" 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 = '会议室资源'"); |
| | |
| | | String end_time_date = dateFormat.format(end_time); |
| | | MapValues.put("start_time",start_time_date); |
| | | MapValues.put("end_time",end_time_date); |
| | | } |
| | | |
| | | Date date = new Date(); |
| | | //是否能够取消 |
| | | if(date.before(fieldSetEntity.getDate("start_time"))){ |
| | | MapValues.put("isCancel",true); |
| | | } |
| | | //是否执行开启功能 |
| | | if(date.before(fieldSetEntity.getDate("start_time")) && fieldSetEntity.getString("status").equals("已取消")){ |
| | | MapValues.put("isStart",true); |
| | | } |
| | | dataList.add(MapValues); |
| | | } |
| | |
| | | return hashMap; |
| | | } |
| | | |
| | | @Override |
| | | public BitMatrix getQrCode(String content) throws BaseException, WriterException, IOException { |
| | | |
| | | //二维码的宽高 |
| | | int width = 200; |
| | | int height = 200; |
| | | |
| | | //其他参数,如字符集编码 |
| | | Map<EncodeHintType, Object> hints = new HashMap<EncodeHintType, Object>(); |
| | | hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); |
| | | //容错级别为H |
| | | hints.put(EncodeHintType.ERROR_CORRECTION , ErrorCorrectionLevel.H); |
| | | //白边的宽度,可取0~4 |
| | | hints.put(EncodeHintType.MARGIN , 0); |
| | | |
| | | BitMatrix bitMatrix = null; |
| | | try { |
| | | |
| | | bitMatrix = new MultiFormatWriter().encode(content, |
| | | BarcodeFormat.QR_CODE, width, height, hints); |
| | | |
| | | } catch (WriterException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return bitMatrix; |
| | | } |
| | | |
| | | @Override |
| | | public void CancelAndStart(FieldSetEntity fse) throws BaseException { |
| | | |
| | | String uuid = fse.getString("uuid"); |
| | | String filter=" uuid='"+uuid+"'"; |
| | | DataTableEntity product_oa_conference_apply = baseDao.listTable("product_oa_conference_apply", filter, new Object[]{}); |
| | | if(product_oa_conference_apply.getRows()!=0){ |
| | | FieldSetEntity fieldSetEntity = product_oa_conference_apply.getFieldSetEntity(0); |
| | | if(fieldSetEntity.getString("status").equals("已取消")){ |
| | | fieldSetEntity.setValue("status","已启用"); |
| | | }else { |
| | | fieldSetEntity.setValue("status","已取消"); |
| | | } |
| | | baseDao.update(fieldSetEntity); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 会议室使用情况 |
| | |
| | | sql.append(" b.end_time, "); |
| | | } |
| | | sql.append(" b.flow_flag, "); |
| | | sql.append(" ( SELECT user_name FROM product_sys_users WHERE user_id = b.created_by ) proposer "); |
| | | sql.append(" FROM "); |
| | | sql.append(" ( SELECT user_name FROM product_sys_users WHERE user_id = b.created_by ) proposer "); |
| | | 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 "); |