ZhcxPersistentController.java 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package com.rongwei.bsserver.controller;
  2. import com.rongwei.bscommon.sys.service.ZhcxPersistentManageService;
  3. import com.rongwei.bscommon.sys.service.ZhcxPersistentService;
  4. import com.rongwei.rwcommon.base.R;
  5. import com.rongwei.rwcommon.base.exception.CustomException;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.PostMapping;
  8. import org.springframework.web.bind.annotation.RequestBody;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RestController;
  11. import javax.servlet.http.HttpServletResponse;
  12. import java.util.Map;
  13. /**
  14. * @author zhuang
  15. */
  16. @RestController
  17. @RequestMapping("/zhcxPersistent")
  18. public class ZhcxPersistentController {
  19. @Autowired
  20. private ZhcxPersistentManageService zhcxPersistentManageService;
  21. @PostMapping("wordExport")
  22. public void wordExport(@RequestBody Map<String,Object> map, HttpServletResponse response){
  23. int i = zhcxPersistentManageService.wordExport(map,response);
  24. if(i == 0){
  25. throw new CustomException("导出失败");
  26. }else if(i == 1){
  27. throw new CustomException("当前周期暂无数据");
  28. }
  29. }
  30. }