|
@@ -213,9 +213,9 @@ public class ErpCreditController extends BaseController {
|
|
@RequiresPermissions("sg:financial:erpCredit:export")
|
|
@RequiresPermissions("sg:financial:erpCredit:export")
|
|
@RequestMapping(value = "exportList")
|
|
@RequestMapping(value = "exportList")
|
|
public Result exportFileList(ErpCredit erpCredit,HttpServletRequest request, HttpServletResponse response){
|
|
public Result exportFileList(ErpCredit erpCredit,HttpServletRequest request, HttpServletResponse response){
|
|
- HttpSession session = request.getSession();
|
|
|
|
- String attribute = (String) session.getAttribute("erpStatus");
|
|
|
|
- erpCredit.setStatus(attribute);
|
|
|
|
|
|
+// HttpSession session = request.getSession();
|
|
|
|
+// String attribute = (String) session.getAttribute("erpStatus");
|
|
|
|
+// erpCredit.setStatus(attribute);
|
|
Result j = new Result();
|
|
Result j = new Result();
|
|
try {
|
|
try {
|
|
String fileName = "送审决算信息"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
|
|
String fileName = "送审决算信息"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
|
|
@@ -250,6 +250,14 @@ public class ErpCreditController extends BaseController {
|
|
}
|
|
}
|
|
return j;
|
|
return j;
|
|
}
|
|
}
|
|
|
|
+ @RequestMapping(value = "clearFileAllSession")
|
|
|
|
+ public void clearFileAllFtp(HttpServletRequest request, HttpServletResponse response){
|
|
|
|
+ HttpSession session = request.getSession();
|
|
|
|
+ Object erpCreditsList = session.getAttribute("erpCreditsList");
|
|
|
|
+ if (null!=erpCreditsList&&erpCreditsList!=""){
|
|
|
|
+ session.removeAttribute("erpCreditsList");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 导出excel文件
|
|
* 导出excel文件
|
|
@@ -259,17 +267,20 @@ public class ErpCreditController extends BaseController {
|
|
@RequestMapping(value = "export")
|
|
@RequestMapping(value = "export")
|
|
public Result exportFile(HttpServletRequest request, HttpServletResponse response){
|
|
public Result exportFile(HttpServletRequest request, HttpServletResponse response){
|
|
Result j = new Result();
|
|
Result j = new Result();
|
|
|
|
+ HttpSession session = request.getSession();
|
|
try {
|
|
try {
|
|
- String allFtpErpList = erpCreditService.getAllFtpErpList(request);
|
|
|
|
- HttpSession session = request.getSession();
|
|
|
|
- String attribute = (String) session.getAttribute("erpStatus");
|
|
|
|
- erpCreditService.getExport(allFtpErpList,response,attribute);
|
|
|
|
|
|
+ List<ErpCredit> erpCreditsList = (List<ErpCredit>)session.getAttribute("erpCreditsList");
|
|
|
|
+ erpCreditService.getExport(erpCreditsList,response);
|
|
j.setSuccess(true);
|
|
j.setSuccess(true);
|
|
j.setMsg("导出成功!");
|
|
j.setMsg("导出成功!");
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
j.setSuccess(false);
|
|
j.setSuccess(false);
|
|
j.setMsg("导出失败!失败信息:"+e.getMessage());
|
|
j.setMsg("导出失败!失败信息:"+e.getMessage());
|
|
}
|
|
}
|
|
|
|
+ Object erpCreditsList = session.getAttribute("erpCreditsList");
|
|
|
|
+ if (null!=erpCreditsList&&erpCreditsList!=""){
|
|
|
|
+ session.removeAttribute("erpCreditsList");
|
|
|
|
+ }
|
|
return j;
|
|
return j;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -285,7 +296,7 @@ public class ErpCreditController extends BaseController {
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@RequiresPermissions("sg:financial:erpCredit:import")
|
|
@RequiresPermissions("sg:financial:erpCredit:import")
|
|
@RequestMapping(value = "import")
|
|
@RequestMapping(value = "import")
|
|
- public Result importFile(@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request,Model model) {
|
|
|
|
|
|
+ public Result importFile (@RequestParam("file")MultipartFile file, HttpServletResponse response, HttpServletRequest request,Model model){
|
|
Result j = new Result();
|
|
Result j = new Result();
|
|
String str = "";
|
|
String str = "";
|
|
try {
|
|
try {
|
|
@@ -302,6 +313,7 @@ public class ErpCreditController extends BaseController {
|
|
List<ErpAccount> erpAccounts = ErpInfo.getErpAccount(importUtil);//获取表格数据
|
|
List<ErpAccount> erpAccounts = ErpInfo.getErpAccount(importUtil);//获取表格数据
|
|
List<ErpCredit> erpCredits = ErpInfo.getAllErpCreditList(erpAccounts);//获取单条数据
|
|
List<ErpCredit> erpCredits = ErpInfo.getAllErpCreditList(erpAccounts);//获取单条数据
|
|
|
|
|
|
|
|
+
|
|
//需求基本信息验证
|
|
//需求基本信息验证
|
|
List<Project> projects = projectService.findList(new Project());
|
|
List<Project> projects = projectService.findList(new Project());
|
|
String projectJudge = ValidationUtils.getProjectJudge(erpCredits, projects);
|
|
String projectJudge = ValidationUtils.getProjectJudge(erpCredits, projects);
|
|
@@ -362,7 +374,7 @@ public class ErpCreditController extends BaseController {
|
|
List<Expense> expenseList = CostAccountUnits.getQCExpense(erpCredits,expenses);//库存信息区分2020年前和年后
|
|
List<Expense> expenseList = CostAccountUnits.getQCExpense(erpCredits,expenses);//库存信息区分2020年前和年后
|
|
//得到验证数据
|
|
//得到验证数据
|
|
Map<String, List<ErpCredit>> judgeEnterAccount = CostAccountUnits.getJudgeEnterAccount(erpCredits, expenseList, informationList, maintainDatas);
|
|
Map<String, List<ErpCredit>> judgeEnterAccount = CostAccountUnits.getJudgeEnterAccount(erpCredits, expenseList, informationList, maintainDatas);
|
|
-// //若应付金额(不含税价)<实付金额(不含税价),需要导出差异情况,同时费用入账核实存在问题。
|
|
|
|
|
|
+ //若应付金额(不含税价)<实付金额(不含税价),需要导出差异情况,同时费用入账核实存在问题。
|
|
List<ErpCredit> listThree = judgeEnterAccount.get("judgeEnterAccountThree");
|
|
List<ErpCredit> listThree = judgeEnterAccount.get("judgeEnterAccountThree");
|
|
String judgeThree = ValidationUtils.getJudgeThree(listThree);
|
|
String judgeThree = ValidationUtils.getJudgeThree(listThree);
|
|
if (!"".equals(listThree)){
|
|
if (!"".equals(listThree)){
|
|
@@ -372,27 +384,21 @@ public class ErpCreditController extends BaseController {
|
|
j.setMsg("导入失败:费用入账存在差异信息,正在导出差异信息");
|
|
j.setMsg("导入失败:费用入账存在差异信息,正在导出差异信息");
|
|
return j;
|
|
return j;
|
|
}
|
|
}
|
|
- Object allErpPath = request.getSession().getAttribute("AllErpPath");
|
|
|
|
- if (allErpPath != null && allErpPath != "") {
|
|
|
|
- RandomUtil.delete(allErpPath.toString());
|
|
|
|
- request.getSession().removeAttribute("AllErpPath");
|
|
|
|
- }
|
|
|
|
- String allListErpCredit = ValidationUtils.getAllListErpCredit(erpCredits);
|
|
|
|
- erpCreditService.getAllFtpList(request,allListErpCredit);
|
|
|
|
- String random = ErpInfo.getStatus();//保存session
|
|
|
|
- request.getSession().setAttribute("erpStatus",random);;
|
|
|
|
- for (ErpCredit erpCredit : erpCredits){
|
|
|
|
- try{
|
|
|
|
- erpCreditService.save(erpCredit,random);
|
|
|
|
- successNum++;
|
|
|
|
- }catch (Exception ex) {
|
|
|
|
- failureNum++;
|
|
|
|
|
|
+ request.getSession().setAttribute("erpCreditsList",erpCredits);
|
|
|
|
+ String random = ErpInfo.getStatus();
|
|
|
|
+ erpCreditService.deleteAll();//清空原来表数据
|
|
|
|
+ for (int i = 0; i < erpCredits.size()/1000+1; i++) {
|
|
|
|
+ int end=(i+1)*1000;
|
|
|
|
+ if (end>erpCredits.size()){
|
|
|
|
+ end=erpCredits.size();
|
|
}
|
|
}
|
|
|
|
+ List<ErpCredit> erpCredits1 = erpCredits.subList(i * 1000, end);
|
|
|
|
+ erpCreditService.saveList(erpCredits1,random);
|
|
}
|
|
}
|
|
- //若应付金额(不含税价)>实付金额(不含税价),需要进入人工判断,若人工判断通过,则费用入账核实无问题,若人工判断不通过则费用入账核实存在问题
|
|
|
|
|
|
+// 若应付金额(不含税价)>实付金额(不含税价),需要进入人工判断,若人工判断通过,则费用入账核实无问题,若人工判断不通过则费用入账核实存在问题
|
|
List<ErpCredit> listTwo = judgeEnterAccount.get("judgeEnterAccountTwo");
|
|
List<ErpCredit> listTwo = judgeEnterAccount.get("judgeEnterAccountTwo");
|
|
String judgeTwo = ValidationUtils.getJudgeTwo(listTwo);
|
|
String judgeTwo = ValidationUtils.getJudgeTwo(listTwo);
|
|
- if (!"".equals(judgeTwo)){
|
|
|
|
|
|
+ if ("".equals(judgeTwo)){
|
|
erpCreditService.getFtpList(request,judgeTwo);
|
|
erpCreditService.getFtpList(request,judgeTwo);
|
|
j.setSuccess(false);
|
|
j.setSuccess(false);
|
|
j.setFlag(false);
|
|
j.setFlag(false);
|
|
@@ -407,9 +413,9 @@ public class ErpCreditController extends BaseController {
|
|
return j;
|
|
return j;
|
|
}
|
|
}
|
|
if (failureNum>0){
|
|
if (failureNum>0){
|
|
- failureMsg.insert(0, ",失败 "+failureNum+" 条送审决算记录。");
|
|
|
|
|
|
+ failureMsg.insert(0, ",失败 "+erpCredits.size()+" 条送审决算记录。");
|
|
}
|
|
}
|
|
- j.setMsg( "已成功导入 "+successNum+" 条送审决算记录"+failureMsg);
|
|
|
|
|
|
+ j.setMsg( "已成功导入 "+erpCredits.size()+" 条送审决算记录"+failureMsg);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
j.setSuccess(false);
|
|
j.setSuccess(false);
|
|
j.setMsg("导入送审决算失败!失败信息:"+e.getMessage());
|
|
j.setMsg("导入送审决算失败!失败信息:"+e.getMessage());
|