|
@@ -12,6 +12,7 @@ import com.liang.common.exception.CustomException;
|
12
|
12
|
import com.liang.entity.*;
|
13
|
13
|
import com.liang.service.*;
|
14
|
14
|
import io.swagger.annotations.ApiOperation;
|
|
15
|
+import jdk.nashorn.internal.runtime.linker.LinkerCallSite;
|
15
|
16
|
import org.springframework.data.domain.Page;
|
16
|
17
|
import org.springframework.data.domain.PageRequest;
|
17
|
18
|
import org.springframework.http.ResponseEntity;
|
|
@@ -20,6 +21,7 @@ import org.springframework.ui.Model;
|
20
|
21
|
import org.springframework.web.bind.annotation.*;
|
21
|
22
|
|
22
|
23
|
import javax.annotation.Resource;
|
|
24
|
+import java.io.IOException;
|
23
|
25
|
import java.text.DateFormat;
|
24
|
26
|
import java.text.SimpleDateFormat;
|
25
|
27
|
import java.util.*;
|
|
@@ -116,6 +118,44 @@ public class StaBudgetapprovalController extends BaseController {
|
116
|
118
|
return "stabudgetapproval/list_apply";
|
117
|
119
|
}
|
118
|
120
|
|
|
121
|
+ @ResponseBody
|
|
122
|
+ @RequestMapping(value = "/exportExcel/{fromdata}", method = RequestMethod.POST)
|
|
123
|
+ public BaseResult exportExcel(@PathVariable String fromdata)throws Exception{
|
|
124
|
+ SysUserInfo userInfo = getSysUserInfo();
|
|
125
|
+ List<String> postName = sysUserInfoService.getPostNameByUserId(userInfo.getUserId());
|
|
126
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
127
|
+ StaBudgetapproval formData = objectMapper.readValue(fromdata, StaBudgetapproval.class);
|
|
128
|
+ String post = "";
|
|
129
|
+ if (postName.size() > 0) {
|
|
130
|
+ for (int i = 0; i < postName.size(); i++) {
|
|
131
|
+ if ("科研专责".equals(postName.get(i))) {
|
|
132
|
+ post = "过";
|
|
133
|
+ }
|
|
134
|
+ }
|
|
135
|
+ }
|
|
136
|
+
|
|
137
|
+ Map<String, Object> paraMap = new HashMap<>();
|
|
138
|
+ paraMap.put("sqmc", formData.getSqmc());
|
|
139
|
+ paraMap.put("sqr", formData.getSqr());
|
|
140
|
+ paraMap.put("fylb", formData.getFylb());
|
|
141
|
+ paraMap.put("erpbh", formData.getErpbh());
|
|
142
|
+ paraMap.put("spzt", formData.getSpzt());
|
|
143
|
+ paraMap.put("bh", formData.getBh());
|
|
144
|
+ paraMap.put("xmlx", formData.getXmlx());
|
|
145
|
+ paraMap.put("ssbmmc",formData.getSsbmmc());
|
|
146
|
+ paraMap.put("dkyfzr",formData.getDkyfzr());
|
|
147
|
+ paraMap.put("nf",formData.getNf());
|
|
148
|
+
|
|
149
|
+ if (!userInfo.getAccount().equals("admin")) {
|
|
150
|
+ if (!"过".equals(post)) {
|
|
151
|
+ paraMap.put("userId", userInfo.getUserId().toString());
|
|
152
|
+ }
|
|
153
|
+ }
|
|
154
|
+ List<StaBudgetapproval> list = staBudgetapprovalService.getFysqList(paraMap);
|
|
155
|
+
|
|
156
|
+ return BaseResult.success("导出完成!",list);
|
|
157
|
+ }
|
|
158
|
+
|
119
|
159
|
/**
|
120
|
160
|
* 费用申请列
|
121
|
161
|
*
|
|
@@ -1421,9 +1461,12 @@ public class StaBudgetapprovalController extends BaseController {
|
1421
|
1461
|
*/
|
1422
|
1462
|
@ResponseBody
|
1423
|
1463
|
@PostMapping("/unassociated/{fromdata}")
|
1424
|
|
- public BaseResult unassociated(@PathVariable String fromdata) {
|
|
1464
|
+ public BaseResult unassociated(@PathVariable String fromdata,
|
|
1465
|
+ @RequestParam("page") Integer pageNum,
|
|
1466
|
+ @RequestParam("limit") Integer pageSize) {
|
1425
|
1467
|
|
1426
|
1468
|
try {
|
|
1469
|
+ PageHelper.startPage(pageNum,pageSize);
|
1427
|
1470
|
ObjectMapper objectMapper = new ObjectMapper();
|
1428
|
1471
|
FormData formData = objectMapper.readValue(fromdata, FormData.class);
|
1429
|
1472
|
Map<String, String> map = new HashMap<>();
|