|
|
@@ -3,6 +3,7 @@ package com.goafanti.common.controller;
|
|
|
import com.goafanti.admin.service.AdminService;
|
|
|
import com.goafanti.admin.service.AttachmentService;
|
|
|
import com.goafanti.common.bo.Error;
|
|
|
+import com.goafanti.common.bo.OutPoverty;
|
|
|
import com.goafanti.common.bo.OutUser;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
@@ -15,6 +16,7 @@ import com.goafanti.common.service.PovertyService;
|
|
|
import com.goafanti.common.utils.*;
|
|
|
import com.goafanti.common.utils.excel.FileUtils;
|
|
|
import com.goafanti.common.utils.excel.NewExcelUtil;
|
|
|
+import com.goafanti.core.mybatis.JDBCIdGenerator;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.core.websocket.SystemWebSocketHandler;
|
|
|
import com.goafanti.expenseAccount.service.ExpenseAccountService;
|
|
|
@@ -95,6 +97,9 @@ public class PublicController extends CertifyApiController {
|
|
|
@Value(value = "${patentTemplate}")
|
|
|
private String patentTemplate = null;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private JDBCIdGenerator jdbcIdGenerator;
|
|
|
+
|
|
|
@Resource(name = "passwordUtil")
|
|
|
private PasswordUtil passwordUtil;
|
|
|
|
|
|
@@ -787,7 +792,56 @@ public class PublicController extends CertifyApiController {
|
|
|
res.getError().add(buildError("格式不正确","格式不正确"));
|
|
|
return res;
|
|
|
}
|
|
|
- res.data(povertyService.selectPoverty(file));
|
|
|
+ String id = jdbcIdGenerator.generateId().toString();
|
|
|
+ res.data(povertyService.selectPoverty(file,id));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询贫困信息
|
|
|
+ * @param id 贫困信息编号
|
|
|
+ * @param type 0=所有 ,1=只看有效数据
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("/selectPovertyById/export")
|
|
|
+ public Result selectPovertyByIdExport(String id,Integer type) {
|
|
|
+ Map<String,Object> o = povertyService.selectPoverty(null, id);
|
|
|
+ if (type==null)type=0;
|
|
|
+ List<OutPoverty> resList=new ArrayList<>();
|
|
|
+ if (type==1){
|
|
|
+ List<OutPoverty> list = (List<OutPoverty>) o.get("list");
|
|
|
+ for (OutPoverty outPoverty : list) {
|
|
|
+ if (com.goafanti.common.utils.StringUtils.isNotEmpty(outPoverty.getId())){
|
|
|
+ resList.add(outPoverty);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }else {
|
|
|
+ resList = (List<OutPoverty>) o.get("list");
|
|
|
+ }
|
|
|
+ NewExcelUtil<OutPoverty> newExcelUtil=new NewExcelUtil<>(OutPoverty.class);
|
|
|
+ return newExcelUtil.exportExcel(resList,"广西贫困信息表",uploadPath);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @RequestMapping("/selectPovertyById")
|
|
|
+ public Result selectPovertyById(String id,Integer type) {
|
|
|
+ Result res=new Result();
|
|
|
+ Map<String,Object> o = povertyService.selectPoverty(null, id);
|
|
|
+ if (type==null)type=0;
|
|
|
+ if (type==1){
|
|
|
+ List<OutPoverty> list = (List<OutPoverty>) o.get("list");
|
|
|
+ List<OutPoverty> resList=new ArrayList<>();
|
|
|
+ for (OutPoverty outPoverty : list) {
|
|
|
+ if (com.goafanti.common.utils.StringUtils.isNotEmpty(outPoverty.getId())){
|
|
|
+ resList.add(outPoverty);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ o.remove("list");
|
|
|
+ o.put("list",resList);
|
|
|
+ }
|
|
|
+ res.data(o);
|
|
|
return res;
|
|
|
}
|
|
|
|