许鹏程
2024-08-23 394d19ca078d342474a8803db3186452348ac113
src/main/java/com/product/administration/controller/ConferenceManagerController.java
@@ -11,7 +11,6 @@
import com.product.administration.service.ide.IConferenceManagerService;
import com.product.core.config.CoreConst;
import com.product.core.controller.support.AbstractBaseController;
import com.product.core.entity.DataTableEntity;
import com.product.core.entity.FieldSetEntity;
import com.product.core.entity.RequestParameterEntity;
import com.product.core.exception.BaseException;
@@ -19,9 +18,7 @@
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;
@@ -30,7 +27,6 @@
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;
@@ -518,19 +514,19 @@
     * @throws IOException
     * @throws WriterException
     */
    @GetMapping("/get_QrCode/{version}")
    @PostMapping("/get_QrCode/{version}")
    @ApiVersion(1)
    public void getQrCode(String uuid,HttpServletRequest request, HttpServletResponse response) throws IOException, WriterException {
    public void getQrCode(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");
@@ -549,9 +545,8 @@
                BitMatrix bitMatrix = conferenceManagerService.getQrCode(jsonData.toString());
                //以流的形式输出到前端
                MatrixToImageWriter.writeToStream(bitMatrix , "jpg" , stream);
           // }
        //}
           }
        }
    }
@@ -580,12 +575,18 @@
    }
    /**
     * 会议签到功能
     * @param request
     * @return
     * @throws ParseException
     */
    @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);
        Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
        if (bean != null) {
            RequestParameterEntity reqp = (RequestParameterEntity) bean;
            fse = reqp.getFormData();
@@ -593,11 +594,58 @@
        //判断参数是否为空
        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);
    }
    /**
     * 获取签到或者访问信息
     * @param request
     * @return
     */
    @PostMapping("/get_signOrVisit_info/{version}")
    @ApiVersion(1)
    public String getSignOrVisitInfo(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());
        }
        HashMap signInfo = conferenceManagerService.getSignOrVisitInfo(fse);
        return OK(signInfo);
    }
    /**
     * 发送消息
     * @param request
     * @return
     */
    @PostMapping("/sendMsg/{version}")
    @ApiVersion(1)
    public String sendMsg(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.sendMsg(fse);
        return OK();
    }
}