package com.rongwei.bsserver.controller; import com.rongwei.bscommon.sys.service.ZhcxPersistentManageService; import com.rongwei.bscommon.sys.service.ZhcxPersistentService; import com.rongwei.rwcommon.base.R; import com.rongwei.rwcommon.base.exception.CustomException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletResponse; import java.util.Map; /** * @author zhuang */ @RestController @RequestMapping("/zhcxPersistent") public class ZhcxPersistentController { @Autowired private ZhcxPersistentManageService zhcxPersistentManageService; @PostMapping("wordExport") public void wordExport(@RequestBody Map map, HttpServletResponse response){ int i = zhcxPersistentManageService.wordExport(map,response); if(i == 0){ throw new CustomException("导出失败"); }else if(i == 1){ throw new CustomException("当前周期暂无数据"); } } }