|
@@ -12,6 +12,7 @@ import com.jeeplus.modules.act.service.ActProcessService;
|
|
|
import com.jeeplus.modules.act.service.ActTaskService;
|
|
|
import com.jeeplus.modules.sg.audit.information.entity.Information;
|
|
|
import com.jeeplus.modules.sg.audit.information.entity.OutInformation;
|
|
|
+import com.jeeplus.modules.sg.financial.erpcredit.util.ExportUtil;
|
|
|
import com.jeeplus.modules.sg.managementcenter.activiti.entity.FindTask;
|
|
|
import com.jeeplus.modules.sg.managementcenter.activiti.service.ConstructionService;
|
|
|
import com.jeeplus.modules.sg.managementcenter.activiti.utils.MyActiviUtils;
|
|
@@ -37,7 +38,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.net.URLDecoder;
|
|
|
import java.util.*;
|
|
|
|
|
|
@Controller
|
|
@@ -495,10 +498,18 @@ public class PickIngController extends BaseController {
|
|
|
return j;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 成本
|
|
|
+ * */
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "exportErpData")
|
|
|
- public AjaxJson exportErpData(String id, HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ public AjaxJson exportErpData(String id,String projectId, HttpServletRequest request, HttpServletResponse response) {
|
|
|
AjaxJson j = new AjaxJson();
|
|
|
+ try {
|
|
|
+ projectId = URLDecoder.decode(projectId,"UTF-8");
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
List<String> beforeId = new ArrayList<>();
|
|
|
if (id != null && !"".equals(id)) {
|
|
|
String[] split = id.split(",");
|
|
@@ -508,50 +519,77 @@ public class PickIngController extends BaseController {
|
|
|
} else {
|
|
|
beforeId = showListService.selectAllId();
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
//获取选择的id查询出属于什么项目
|
|
|
List<Acquisition> erpType = pickIngService.findErpType(beforeId);
|
|
|
- //资本项目列表
|
|
|
- List<Acquisition> zbList = new ArrayList<>();
|
|
|
//成本项目列表
|
|
|
List<Acquisition> cbList = new ArrayList<>();
|
|
|
//循环数据,根据类型分组
|
|
|
for (Acquisition acquisition:erpType) {
|
|
|
- String itemType = acquisition.getItemType();
|
|
|
- if ("资本项目".equals(itemType)) {
|
|
|
- zbList.add(acquisition);
|
|
|
- }
|
|
|
- if ("成本项目".equals(itemType)) {
|
|
|
+ String itemType = acquisition.getProType();
|
|
|
+ if ("配网成本".equals(itemType)) {
|
|
|
cbList.add(acquisition);
|
|
|
}
|
|
|
}
|
|
|
- //根据不同类型导出不同的文件
|
|
|
- if (zbList.size()>0) {
|
|
|
+ if (cbList.size()>0) {
|
|
|
try {
|
|
|
- String fileName = "导出资本ERP" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
|
|
- List<CapitalExport> capitalExports = pickIngService.zbList(zbList);
|
|
|
- new ExportExcel("导出资本ERP", CapitalExport.class).setDataList(capitalExports).write(response, fileName).dispose();
|
|
|
+ String fileName = "导出成本ERP" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
|
|
+ List<CapitalExport> capitalExports = pickIngService.cbList(cbList,projectId);
|
|
|
+ new ExportExcel("导出成本ERP", CapitalExport.class).setDataList(capitalExports).write(response, fileName).dispose();
|
|
|
j.setSuccess(true);
|
|
|
j.setMsg("导出成功!");
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
+ }
|
|
|
+ //需改导出状态及导出时间
|
|
|
+ return j;
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 资本
|
|
|
+ * */
|
|
|
+ @ResponseBody
|
|
|
+ @RequestMapping(value = "exportZb")
|
|
|
+ public AjaxJson exportZb(String id,String projectId, HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ AjaxJson j = new AjaxJson();
|
|
|
+ try {
|
|
|
+ projectId = URLDecoder.decode(projectId,"UTF-8");
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
- if (cbList.size()>0) {
|
|
|
+ boolean flag = false;
|
|
|
+ List<String> beforeId = new ArrayList<>();
|
|
|
+ if (id != null && !"".equals(id)) {
|
|
|
+ String[] split = id.split(",");
|
|
|
+ for (String a : split) {
|
|
|
+ beforeId.add(a);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ beforeId = showListService.selectAllId();
|
|
|
+ }
|
|
|
+ //获取选择的id查询出属于什么项目
|
|
|
+ List<Acquisition> erpType = pickIngService.findErpType(beforeId);
|
|
|
+ //资本项目列表
|
|
|
+ List<Acquisition> zbList = new ArrayList<>();
|
|
|
+ //循环数据,根据类型分组
|
|
|
+ for (Acquisition acquisition:erpType) {
|
|
|
+ String itemType = acquisition.getProType();
|
|
|
+ if ("配网资本".equals(itemType)) {
|
|
|
+ zbList.add(acquisition);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //根据不同类型导出不同的文件
|
|
|
+ if (zbList.size()>0) {
|
|
|
try {
|
|
|
- String fileName = "导出成本ERP" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
|
|
- List<CapitalExport> capitalExports = pickIngService.cbList(zbList);
|
|
|
- new ExportExcel("导出成本ERP", CapitalExport.class).setDataList(capitalExports).write(response, fileName).dispose();
|
|
|
+ String fileName = "导出资本ERP" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
|
|
+ List<CapitalExport> capitalExports = pickIngService.zbList(zbList,projectId);
|
|
|
+ new ExportExcel("导出资本ERP", CapitalExport.class).setDataList(capitalExports).write(response, fileName).dispose();
|
|
|
j.setSuccess(true);
|
|
|
j.setMsg("导出成功!");
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
//需改导出状态及导出时间
|
|
|
return j;
|
|
|
}
|