|
|
@@ -2,6 +2,7 @@ package com.core136.controller.hr;
|
|
|
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.read.listener.PageReadListener;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.core136.bean.account.UserInfo;
|
|
|
import com.core136.bean.hr.*;
|
|
|
import com.core136.common.enums.MessageCode;
|
|
|
@@ -20,6 +21,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
import tk.mybatis.mapper.entity.Example;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.PrintWriter;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -2554,14 +2557,21 @@ public class ApiSetHrController {
|
|
|
* @return 消息结构
|
|
|
*/
|
|
|
@PostMapping(value = "/importHrDeclareTaxRecord")
|
|
|
- public RetDataBean importHrDeclareTaxRecord(MultipartFile file) {
|
|
|
+ public void importHrDeclareTaxRecord(HttpServletResponse response, MultipartFile file) {
|
|
|
+ PrintWriter out = null;
|
|
|
try {
|
|
|
UserInfo userInfo = userInfoService.getRedisUser();
|
|
|
- RetDataBean rRetDataBean =hrDeclareTaxService.importHrDeclareTaxRecord(userInfo, file);
|
|
|
- return rRetDataBean;
|
|
|
+ RetDataBean retDataBean = hrDeclareTaxService.importHrDeclareTaxRecord(userInfo, file);
|
|
|
+ String s = JSON.toJSONString(retDataBean);
|
|
|
+ response.setContentType("text/html; charset=utf-8");
|
|
|
+ out = response.getWriter().append(s);
|
|
|
+ out.close();
|
|
|
} catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- return RetDataTools.Error(e.getMessage());
|
|
|
+ logger.error(e.getMessage());
|
|
|
+ } finally {
|
|
|
+ if (out != null) {
|
|
|
+ out.close();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
/**
|