|
@@ -31,6 +31,7 @@ import com.fuzamei.entity.ValuationAccount;
|
|
import com.fuzamei.service.AttachmentService;
|
|
import com.fuzamei.service.AttachmentService;
|
|
import com.fuzamei.service.UserAuthoricationService;
|
|
import com.fuzamei.service.UserAuthoricationService;
|
|
import com.fuzamei.service.ValuationAccountingService;
|
|
import com.fuzamei.service.ValuationAccountingService;
|
|
|
|
+import com.fuzamei.utils.Area;
|
|
import com.fuzamei.utils.ExcelUtil;
|
|
import com.fuzamei.utils.ExcelUtil;
|
|
import com.fuzamei.utils.JSONUtil;
|
|
import com.fuzamei.utils.JSONUtil;
|
|
import com.fuzamei.utils.PageDTO;
|
|
import com.fuzamei.utils.PageDTO;
|
|
@@ -58,7 +59,6 @@ public class ValuationAccountingAction {
|
|
|
|
|
|
private static final int ROW_NUM = 10; // 分页每页显示数据的数量
|
|
private static final int ROW_NUM = 10; // 分页每页显示数据的数量
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
* @Title: queryOperationHistoryInformation
|
|
* @Title: queryOperationHistoryInformation
|
|
* @Description: TODO(估值核算的查询结果,包括所有的查询条件也包括进去了)
|
|
* @Description: TODO(估值核算的查询结果,包括所有的查询条件也包括进去了)
|
|
* 前端传过来的json格式为:
|
|
* 前端传过来的json格式为:
|
|
@@ -73,7 +73,6 @@ public class ValuationAccountingAction {
|
|
* @return Map<String,Object> 返回类型
|
|
* @return Map<String,Object> 返回类型
|
|
* @author ylx
|
|
* @author ylx
|
|
* @date 2017年12月18日 下午3:17:30
|
|
* @date 2017年12月18日 下午3:17:30
|
|
- * @throws
|
|
|
|
*/
|
|
*/
|
|
@RequestMapping(value="/queryValuationAccountingInformation",method=RequestMethod.POST)
|
|
@RequestMapping(value="/queryValuationAccountingInformation",method=RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@@ -110,9 +109,7 @@ public class ValuationAccountingAction {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
* @Title: queryOperationHistoryInformation
|
|
* @Title: queryOperationHistoryInformation
|
|
* @Description: TODO(查看估值核算基金的下载信息的小弹框)
|
|
* @Description: TODO(查看估值核算基金的下载信息的小弹框)
|
|
* @param @param data
|
|
* @param @param data
|
|
@@ -125,7 +122,6 @@ public class ValuationAccountingAction {
|
|
* @return Map<String,Object> 返回类型
|
|
* @return Map<String,Object> 返回类型
|
|
* @author ylx
|
|
* @author ylx
|
|
* @date 2017年12月28日 下午1:48:43
|
|
* @date 2017年12月28日 下午1:48:43
|
|
- * @throws
|
|
|
|
*/
|
|
*/
|
|
@RequestMapping(value="/checkoutDownloadInformation",method=RequestMethod.POST)
|
|
@RequestMapping(value="/checkoutDownloadInformation",method=RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@@ -146,7 +142,6 @@ public class ValuationAccountingAction {
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
* @Title: checkoutDownloadInformation
|
|
* @Title: checkoutDownloadInformation
|
|
* @Description: TODO(管理人首次上传估值报表弹出的界面需要显示的ID号)
|
|
* @Description: TODO(管理人首次上传估值报表弹出的界面需要显示的ID号)
|
|
* 前端传过来的json数据格式
|
|
* 前端传过来的json数据格式
|
|
@@ -157,7 +152,6 @@ public class ValuationAccountingAction {
|
|
* @return Map<String,Object> 返回类型
|
|
* @return Map<String,Object> 返回类型
|
|
* @author ylx
|
|
* @author ylx
|
|
* @date 2017年12月28日 下午3:39:18
|
|
* @date 2017年12月28日 下午3:39:18
|
|
- * @throws
|
|
|
|
*/
|
|
*/
|
|
@RequestMapping(value="/fistUploadFundDataByAdmin",method=RequestMethod.POST)
|
|
@RequestMapping(value="/fistUploadFundDataByAdmin",method=RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@@ -174,10 +168,7 @@ public class ValuationAccountingAction {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
* @Title: download
|
|
* @Title: download
|
|
* @Description: TODO(估值核算界面,下载功能实现)
|
|
* @Description: TODO(估值核算界面,下载功能实现)
|
|
* 前端通过get或post发来请求
|
|
* 前端通过get或post发来请求
|
|
@@ -188,7 +179,6 @@ public class ValuationAccountingAction {
|
|
* @return Map<String,Object> 返回类型
|
|
* @return Map<String,Object> 返回类型
|
|
* @author ylx
|
|
* @author ylx
|
|
* @date 2017年12月18日 下午5:26:46
|
|
* @date 2017年12月18日 下午5:26:46
|
|
- * @throws
|
|
|
|
*/
|
|
*/
|
|
@RequestMapping(value="/downloadValuationPOI")
|
|
@RequestMapping(value="/downloadValuationPOI")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@@ -225,7 +215,6 @@ public class ValuationAccountingAction {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
* @Title: upload
|
|
* @Title: upload
|
|
* @Description: TODO(实现管理员估值核算的报表文件上传功能---------->>暂时按照一次上传一个文件进行实现)
|
|
* @Description: TODO(实现管理员估值核算的报表文件上传功能---------->>暂时按照一次上传一个文件进行实现)
|
|
*
|
|
*
|
|
@@ -245,7 +234,6 @@ public class ValuationAccountingAction {
|
|
* @return Map<String,Object> 返回类型
|
|
* @return Map<String,Object> 返回类型
|
|
* @author ylx
|
|
* @author ylx
|
|
* @date 2017年12月18日 下午5:29:38
|
|
* @date 2017年12月18日 下午5:29:38
|
|
- * @throws
|
|
|
|
*/
|
|
*/
|
|
@RequestMapping(value="/uploadValuationPOIByAdminForTheFirstTime",method=RequestMethod.POST)
|
|
@RequestMapping(value="/uploadValuationPOIByAdminForTheFirstTime",method=RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@@ -303,7 +291,6 @@ public class ValuationAccountingAction {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
* @Title: upload
|
|
* @Title: upload
|
|
* @Description: TODO(实现银行估值核算的报表文件上传功能---------->>暂时按照一次上传一个文件进行实现)
|
|
* @Description: TODO(实现银行估值核算的报表文件上传功能---------->>暂时按照一次上传一个文件进行实现)
|
|
*
|
|
*
|
|
@@ -317,7 +304,6 @@ public class ValuationAccountingAction {
|
|
* @return Map<String,Object> 返回类型
|
|
* @return Map<String,Object> 返回类型
|
|
* @author ylx
|
|
* @author ylx
|
|
* @date 2017年12月18日 下午8:17:47
|
|
* @date 2017年12月18日 下午8:17:47
|
|
- * @throws
|
|
|
|
*/
|
|
*/
|
|
@RequestMapping(value="/uploadValuationPOIByBankOrByAdmin",method=RequestMethod.POST)
|
|
@RequestMapping(value="/uploadValuationPOIByBankOrByAdmin",method=RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@@ -379,10 +365,19 @@ public class ValuationAccountingAction {
|
|
// oldFile.delete();
|
|
// oldFile.delete();
|
|
file.transferTo(tempFile);
|
|
file.transferTo(tempFile);
|
|
|
|
|
|
- boolean matchResult = ExcelUtil.matchExcel(tempFile, bankFile);
|
|
|
|
-
|
|
|
|
- //比对完之后暂时先这个文件删除
|
|
|
|
- tempFile.delete();
|
|
|
|
|
|
+ boolean matchResult;
|
|
|
|
+ try {
|
|
|
|
+ matchResult = ExcelUtil.matchExcel(tempFile,
|
|
|
|
+ bankFile,
|
|
|
|
+ new Area(4, 5, 2, 4, Area.NUMERIC),
|
|
|
|
+ new Area(7, 8, 2, 4, Area.NUMERIC),
|
|
|
|
+ new Area(9, 9, 3, 3, Area.NUMERIC));
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new RuntimeException(e.getMessage());
|
|
|
|
+ }finally{
|
|
|
|
+ //对比完要暂时删除文件
|
|
|
|
+ tempFile.delete();
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
//获取比对结果
|
|
//获取比对结果
|
|
@@ -391,14 +386,13 @@ public class ValuationAccountingAction {
|
|
mapToService.put("userDetail", userDetail); //将用户的全部信息传入service层
|
|
mapToService.put("userDetail", userDetail); //将用户的全部信息传入service层
|
|
mapToService.put("fundId", fundId);
|
|
mapToService.put("fundId", fundId);
|
|
mapToService.put("url", urlOfCustodianNewFile); //将文件下载路径url通过map传到service层进行校验
|
|
mapToService.put("url", urlOfCustodianNewFile); //将文件下载路径url通过map传到service层进行校验
|
|
- mapToService.put("attachmentName", filename); //将文件以附件名的形式通过map传递到service层中进行校验
|
|
|
|
|
|
+ mapToService.put("attachmentName", filename); //将文件以附件名的形式通过map传递到service层中进行校验
|
|
mapToService.put("battleResult", result); //将文件比对结果封装进去
|
|
mapToService.put("battleResult", result); //将文件比对结果封装进去
|
|
mapToService.put("attachmentId", valuationAccount.getAttachment_id_of_custodian()); //获取之前上传的附件id号在附件表中修改
|
|
mapToService.put("attachmentId", valuationAccount.getAttachment_id_of_custodian()); //获取之前上传的附件id号在附件表中修改
|
|
valuationAccountingService.updateInformationByAdmin(mapToService);
|
|
valuationAccountingService.updateInformationByAdmin(mapToService);
|
|
|
|
|
|
//文件的覆盖放到最后操作(重要!!!)
|
|
//文件的覆盖放到最后操作(重要!!!)
|
|
oldFile.delete();
|
|
oldFile.delete();
|
|
-// file.transferTo(newFile);
|
|
|
|
String custodianNewFilePath = custodianOldFilePath.substring(0, custodianOldFilePath.lastIndexOf("/")+1)+filename;
|
|
String custodianNewFilePath = custodianOldFilePath.substring(0, custodianOldFilePath.lastIndexOf("/")+1)+filename;
|
|
File newFile=new File(custodianNewFilePath);
|
|
File newFile=new File(custodianNewFilePath);
|
|
file.transferTo(newFile);
|
|
file.transferTo(newFile);
|
|
@@ -422,7 +416,7 @@ public class ValuationAccountingAction {
|
|
String relativePath = RelativePathUtil.formatPath("/"+userId,"");
|
|
String relativePath = RelativePathUtil.formatPath("/"+userId,"");
|
|
|
|
|
|
//银行上传文件的新路径
|
|
//银行上传文件的新路径
|
|
- String bankNewFilePath = path + relativePath + filename; //=========================>>新上传的文件路径怎么确定到时候再说TODO
|
|
|
|
|
|
+ String bankNewFilePath = path + relativePath + filename;//=========================>>新上传的文件路径怎么确定到时候再说TODO
|
|
File dir=new File(path + relativePath);
|
|
File dir=new File(path + relativePath);
|
|
if(!dir.exists()){
|
|
if(!dir.exists()){
|
|
dir.mkdirs();
|
|
dir.mkdirs();
|
|
@@ -434,13 +428,23 @@ public class ValuationAccountingAction {
|
|
* 如过不是excel文件类型,导入也会报错,然后就把这个新上传的文件删了
|
|
* 如过不是excel文件类型,导入也会报错,然后就把这个新上传的文件删了
|
|
* 这里对两份文件进行估值报价的比对得出比对的结果是一致还是不一致
|
|
* 这里对两份文件进行估值报价的比对得出比对的结果是一致还是不一致
|
|
*/
|
|
*/
|
|
- boolean matchResult = ExcelUtil.matchExcel(newFile, oldFile);
|
|
|
|
- newFile.delete();
|
|
|
|
|
|
+ boolean matchResult;
|
|
|
|
+ try {
|
|
|
|
+ matchResult = ExcelUtil.matchExcel(newFile,
|
|
|
|
+ oldFile,
|
|
|
|
+ new Area(4, 5, 2, 4, Area.NUMERIC),
|
|
|
|
+ new Area(7, 8, 2, 4, Area.NUMERIC),
|
|
|
|
+ new Area(9, 9, 3, 3, Area.NUMERIC));
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new RuntimeException(e.getMessage());
|
|
|
|
+ }finally{
|
|
|
|
+ newFile.delete();
|
|
|
|
+ }
|
|
|
|
|
|
//获取比对结果
|
|
//获取比对结果
|
|
String result = matchResult?BattleResult.CONSISTENT:BattleResult.INCONSISTENT;
|
|
String result = matchResult?BattleResult.CONSISTENT:BattleResult.INCONSISTENT;
|
|
|
|
|
|
- Integer attachmentId = attachmentService.generateAtachmentId(); //生成一个不重复的附件Id号==================>>生成id号的机制待定TODO
|
|
|
|
|
|
+ Integer attachmentId = attachmentService.generateAtachmentId();//生成一个不重复的附件Id号==================>>生成id号的机制待定TODO
|
|
|
|
|
|
Map<String, Object> mapToService =new LinkedHashMap<String, Object>();
|
|
Map<String, Object> mapToService =new LinkedHashMap<String, Object>();
|
|
mapToService.put("valuationAccount", valuationAccount); //将valuationAccount对象传过去,对其中的对账结果进行判断
|
|
mapToService.put("valuationAccount", valuationAccount); //将valuationAccount对象传过去,对其中的对账结果进行判断
|
|
@@ -487,8 +491,18 @@ public class ValuationAccountingAction {
|
|
* 如过不是excel文件类型,导入也会报错,然后就把这个新上传的文件删了(这里旧文件不能先删了)
|
|
* 如过不是excel文件类型,导入也会报错,然后就把这个新上传的文件删了(这里旧文件不能先删了)
|
|
* 这里对两份文件进行估值报价的比对得出比对的结果是一致还是不一致
|
|
* 这里对两份文件进行估值报价的比对得出比对的结果是一致还是不一致
|
|
*/
|
|
*/
|
|
- boolean matchResult = ExcelUtil.matchExcel(tempBankFile, oldCustodianFile);
|
|
|
|
- tempBankFile.delete();
|
|
|
|
|
|
+ boolean matchResult;
|
|
|
|
+ try {
|
|
|
|
+ matchResult = ExcelUtil.matchExcel(tempBankFile,
|
|
|
|
+ oldCustodianFile,
|
|
|
|
+ new Area(4, 5, 2, 4, Area.NUMERIC),
|
|
|
|
+ new Area(7, 8, 2, 4, Area.NUMERIC),
|
|
|
|
+ new Area(9, 9, 3, 3, Area.NUMERIC));
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new RuntimeException(e.getMessage());
|
|
|
|
+ }finally{
|
|
|
|
+ tempBankFile.delete();
|
|
|
|
+ }
|
|
|
|
|
|
//获取比对结果
|
|
//获取比对结果
|
|
String result = matchResult?BattleResult.CONSISTENT:BattleResult.INCONSISTENT;
|
|
String result = matchResult?BattleResult.CONSISTENT:BattleResult.INCONSISTENT;
|