| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- package cn.com.goldenwater.dcproj.controller.meeting;
- import cn.com.goldenwater.dcproj.model.AttMeetingInfo;
- import cn.com.goldenwater.dcproj.model.GwComFile;
- import cn.com.goldenwater.dcproj.param.AttMeetingInfoParam;
- import cn.com.goldenwater.dcproj.service.AttMeetingInfoService;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.service.GwComFileService;
- import cn.com.goldenwater.dcproj.utils.QRCodeUtil;
- import cn.com.goldenwater.id.util.UuidUtil;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.apache.commons.lang3.StringUtils;
- import com.github.pagehelper.PageInfo;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RestController;
- import java.util.List;
- /**
- * @author lune
- * @date 2019-7-9
- */
- @Api(value = "ATT 培训会议信息管理管理", tags = "ATT 培训会议信息管理管理")
- @RestController
- @RequestMapping("/att/meeting/info")
- public class AttMeetingInfoController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private AttMeetingInfoService attMeetingInfoService;
- @Value("${web.upload-path}")
- public String fileDir;
- @Autowired
- private GwComFileService gwComFileService;
- @Value("${work.url}")
- private String workUrl;
- @ApiOperation(value = "添加/修改培训会议信息管理可用于提交附件信息")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<AttMeetingInfo> insert(@ApiParam(name = "attMeetingInfo", value = "AttMeetingInfo", required = true) @RequestBody AttMeetingInfo attMeetingInfo) {
- if (StringUtils.isBlank(attMeetingInfo.getId())) {
- String uuid = UuidUtil.uuid(); // 生成uuid
- attMeetingInfo.setId(uuid);
- attMeetingInfoService.insertData(attMeetingInfo);
- } else {
- attMeetingInfoService.updateData(attMeetingInfo);
- }
- return buildSuccessResponse(attMeetingInfo);
- }
- @ApiOperation(value = "会议信息二维码", notes = "参数字段说明:{\n\r" +
- " \"meetingId\":\"会议ID\",\n\r" +
- " \"hostPath\":\"服务器路径(如:http://192.168.1.107:8101)\",\n\r" +
- " };\n\r" +
- "返回结构说明:{\n\r" +
- " \"success\":\"是否成功(true为成功,false为失败)\",\n\r" +
- " \"code\":\"错误代码\",\n\r" +
- " \"message\":\"描述信息\",\n\r" +
- " \"throwable\":\"异常信息\",\n\r" +
- " \"data(数据信息)\":\"二维码路径\",\n\r" +
- " }")
- @RequestMapping(value = "/getQRCode", method = RequestMethod.POST)
- public BaseResponse getQRCode(String meetingId, String hostPath) throws Exception {
- QRCodeUtil.encode(workUrl+"/sldc/work.html?meetingId=" + meetingId, fileDir + "QRCode\\logo\\logo.jpg", fileDir + "QRCode", meetingId, true);
- return buildSuccessResponse(hostPath + "/upload/QRCode/" + meetingId + ".jpg");
- }
- @ApiOperation(value = "根据ID删除培训会议信息管理")
- @RequestMapping(value = "/del/{id}", method = RequestMethod.GET)
- public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- int ret = attMeetingInfoService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据ID获取培训会议信息管理(单表)包含附件信息")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<AttMeetingInfo> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- AttMeetingInfo attMeetingInfo = attMeetingInfoService.get(id);
- if (attMeetingInfo != null) {
- List<GwComFile> comFileList = gwComFileService.findFileByBiz(id);
- attMeetingInfo.setComFileList(comFileList);
- }
- return buildSuccessResponse(attMeetingInfo);
- }
- @ApiOperation(value = "获取培训会议信息管理(列表所有)")
- @RequestMapping(value = "/list", method = RequestMethod.POST)
- public BaseResponse<List<AttMeetingInfo>> list(@ApiParam(name = "attMeetingInfoParam", value = "attMeetingInfoParam", required = true) @RequestBody AttMeetingInfoParam attMeetingInfoParam) {
- List<AttMeetingInfo> attMeetingInfoList = attMeetingInfoService.findList(attMeetingInfoParam);
- return buildSuccessResponse(attMeetingInfoList);
- }
- @ApiOperation(value = "获取培训会议信息管理(列表--分页)")
- @RequestMapping(value = "/page", method = RequestMethod.POST)
- public BaseResponse<PageInfo<AttMeetingInfo>> page(@ApiParam(name = "attMeetingInfoParam", value = "attMeetingInfoParam", required = true) @RequestBody AttMeetingInfoParam attMeetingInfoParam) {
- PageInfo<AttMeetingInfo> attMeetingInfoList = attMeetingInfoService.findPageInfo(attMeetingInfoParam);
- return buildSuccessResponse(attMeetingInfoList);
- }
- }
|