| | |
| | | import com.product.module.sys.config.SystemErrorCode; |
| | | import com.product.module.sys.version.ApiVersion; |
| | | import com.product.util.BaseUtil; |
| | | import org.omg.CORBA.DATA_CONVERSION; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 会议预约看板功能 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @PostMapping("/get_kb_Data/{version}") |
| | | @ApiVersion(1) |
| | | public String getkbData(HttpServletRequest request){ |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取会议预约详情 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @PostMapping("/get_Meeting_Details/{version}") |
| | | @ApiVersion(1) |
| | | public String getMeetingDetails(HttpServletRequest request){ |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 会议室预约保存更新功能 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | |
| | | @PostMapping("/save_or_update_meeting_info/{version}") |
| | | @ApiVersion(1) |
| | |
| | | * @throws IOException |
| | | * @throws WriterException |
| | | */ |
| | | @PostMapping("/get_QrCode/{version}") |
| | | @GetMapping("/get_QrCode/{version}") |
| | | @ApiVersion(1) |
| | | public void getQrCode(HttpServletRequest request, HttpServletResponse response) throws IOException, WriterException { |
| | | public void getQrCode(String uuid,HttpServletRequest request, HttpServletResponse response) throws IOException, WriterException { |
| | | |
| | | //获取参数 |
| | | 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(); |
| | | |
| | | if(fse!=null || !StringUtils.isEmpty(fse.getString("uuid"))){ |
| | | String uuid = fse.getString("uuid"); |
| | | if(fse!=null && !StringUtils.isEmpty(fse.getString("uuid"))){*/ |
| | | // String uuid = fse.getString("uuid"); |
| | | // 设置响应流信息 |
| | | response.setContentType("image/jpg"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | |
| | | response.setDateHeader("Expires", 0); |
| | | |
| | | OutputStream stream = response.getOutputStream(); |
| | | //后端跳转地址 |
| | | // String content = ("http://www.baidu.com"); |
| | | |
| | | JSONObject jsonData = new JSONObject(); |
| | | jsonData.put("uuid",uuid); |
| | | jsonData.put("date",new Date()); |
| | | //jsonData.put("url",content); |
| | | Date date = new Date(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String formatDate = dateFormat.format(date); |
| | | jsonData.put("date",formatDate); |
| | | //获取一个二维码图片 |
| | | BitMatrix bitMatrix = conferenceManagerService.getQrCode(jsonData.toString()); |
| | | //以流的形式输出到前端 |
| | | MatrixToImageWriter.writeToStream(bitMatrix , "jpg" , stream); |
| | | |
| | | } |
| | | } |
| | | // } |
| | | //} |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 预约会议取消开启功能 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @PostMapping("/cancel_and_start/{version}") |
| | | @ApiVersion(1) |
| | | public String CancelAndStart(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()); |
| | | } |
| | | conferenceManagerService.CancelAndStart(fse); |
| | | return OK(); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/conference_sign/{version}") |
| | | @ApiVersion(1) |
| | | public String ConferenceSign(HttpServletRequest request) throws ParseException { |
| | | //获取参数 |
| | | 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()); |
| | | }*/ |
| | | String s = conferenceManagerService.ConferenceSign(fse); |
| | | return OK(s); |
| | | } |
| | | |
| | | |
| | | |
| | | } |