|
@@ -92,6 +92,54 @@ public class ValuationAccountingService {
|
|
|
mapToOperationHistory.put("hash", "来自前端token计算"); //如何计算操作的hash值?(按照上传的项目文件的hash值算)=====>>待定TODO
|
|
|
projectFileDao.insertOperationHistoryInformationToDao(mapToOperationHistory); //将操作记录信息插入到操作记录表中
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @Title: updateInformationByAdmin
|
|
|
+ * @Description: TODO(以管理员的身份进行估值核算文件重新上传的操作)
|
|
|
+ * @param @param mapToService 设定文件
|
|
|
+ * @return void 返回类型
|
|
|
+ * @author ylx
|
|
|
+ * @date 2017年12月29日 上午10:08:47
|
|
|
+ * @throws
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor=Exception.class)
|
|
|
+ public void updateInformationByAdmin(Map<String, Object> map) {
|
|
|
+ long currentTime=System.currentTimeMillis(); //获取当前时间
|
|
|
+ UserDetail userDetail = (UserDetail) map.get("userDetail"); //获取用户详细信息
|
|
|
+ Map<String, Object> mapToDaoForValuationAccounting = new LinkedHashMap<String,Object>();
|
|
|
+ mapToDaoForValuationAccounting.put("fundId", map.get("fundId"));
|
|
|
+ //管理员估值报表这个时候重新上传文件只需要把总表中的对账结果和更新时间改一下就可以了,附件id不用换
|
|
|
+ mapToDaoForValuationAccounting.put("updateTime", currentTime); //上传文件的更新时间为当前时间
|
|
|
+ mapToDaoForValuationAccounting.put("battleResult", map.get("battleResult")); //总表中需要改变的对账结果
|
|
|
+ valuationAccountingDao.updateInformationByAdmin(mapToDaoForValuationAccounting); //将以上的数据更新到之前估值核算表
|
|
|
+
|
|
|
+
|
|
|
+ //将附件信息封装到mapToDaoForAttachment并传入数据库中
|
|
|
+ Map<String, Object> mapToDaoForAttachment = new LinkedHashMap<String,Object>();
|
|
|
+ mapToDaoForAttachment.put("attachmentId", map.get("attachmentId")); //直接从前面的map中获取
|
|
|
+ mapToDaoForAttachment.put("url", map.get("url")); //下载文件需要用到的url地址需要录入到附件表中
|
|
|
+ mapToDaoForAttachment.put("attachmentName", map.get("attachmentName")); //附件名称要重新修改
|
|
|
+ mapToDaoForAttachment.put("userId", userDetail.getUser_id()); //用户id写活了,这个用户id也要改下♥
|
|
|
+ mapToDaoForAttachment.put("addTime", currentTime); //这里添加的文件重新上传的时间,和项目文档更新时间一样
|
|
|
+ valuationAccountingDao.updateAttachmentInformationByAdmin(mapToDaoForAttachment); //将以上的数据更新到附件表
|
|
|
+
|
|
|
+ //此外,还要将上传估值核算表的这个操作信息插入到操作记录表中【】
|
|
|
+ Map<String, Object> mapToOperationHistory = new LinkedHashMap<String,Object>();
|
|
|
+ mapToOperationHistory.put("operatorTypeId", OperationTypeId.UPLOAD_VALUATION_CHECK); //操作类型为【上传估值核算表】---1010
|
|
|
+ mapToOperationHistory.put("operatorAccount", userDetail.getAccount()); //操作账号写活了♥
|
|
|
+ mapToOperationHistory.put("operatorRole", Role.ADMIN); //创建这个操作的角色只能是---管理人
|
|
|
+ mapToOperationHistory.put("operatorPerson", userDetail.getPerson_name()); //操作人写活了♥
|
|
|
+ mapToOperationHistory.put("operatorTime", currentTime); //操作时间为当前操作时间
|
|
|
+ mapToOperationHistory.put("hash", "to be calculated from operation"); //如何计算操作的hash值????======================================>>待定TODO
|
|
|
+ valuationAccountingDao.insertOperationHistoryInformationToDao(mapToOperationHistory);//将操作记录信息插入到操作记录表中
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
*
|
|
@@ -105,95 +153,56 @@ public class ValuationAccountingService {
|
|
|
*/
|
|
|
@Transactional(rollbackFor=Exception.class)
|
|
|
public void updateInformationByBank(Map<String, Object> map) {
|
|
|
- String fundId=""; //基金id号
|
|
|
- String fundName=""; //基金名称
|
|
|
- String assets=""; //托管资产名称
|
|
|
- String url=""; //url路径名称
|
|
|
- String attachmentName=""; //附件名称
|
|
|
- if (!"".equals(map.get("fundId")) && map.get("fundId") != null) { // 等于空就直接取空值
|
|
|
- try {
|
|
|
- fundId = (String) map.get("fundId");
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException("fundId类型转换异常");
|
|
|
- }
|
|
|
- }else{
|
|
|
- throw new RuntimeException("项目id号为空");
|
|
|
- }
|
|
|
- if (!"".equals(map.get("fundName")) && map.get("fundName") != null) { // 等于空就直接取空值
|
|
|
- try {
|
|
|
- fundName = (String) map.get("fundName");
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException("fundName类型转换异常");
|
|
|
- }
|
|
|
- }else{
|
|
|
- throw new RuntimeException("项目名称为空");
|
|
|
- }
|
|
|
- if (!"".equals(map.get("assets")) && map.get("assets") != null) { // 等于空就直接取空值
|
|
|
- try {
|
|
|
- assets = (String) map.get("assets");
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException("assets类型转换异常");
|
|
|
- }
|
|
|
- }else{
|
|
|
- throw new RuntimeException("url路径名称为空");
|
|
|
- }
|
|
|
- if (!"".equals(map.get("url")) && map.get("url") != null) { // 等于空就直接取空值
|
|
|
- try {
|
|
|
- url = (String) map.get("url");
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException("url类型转换异常");
|
|
|
- }
|
|
|
- }else{
|
|
|
- throw new RuntimeException("url路径名称为空");
|
|
|
- }
|
|
|
- if (!"".equals(map.get("attachmentName")) && map.get("attachmentName") != null) { // 等于空就直接取空值
|
|
|
- try {
|
|
|
- attachmentName = (String) map.get("attachmentName");
|
|
|
- } catch (Exception e) {
|
|
|
- throw new RuntimeException("attachmentName类型转换异常");
|
|
|
- }
|
|
|
- }else{
|
|
|
- throw new RuntimeException("附件名称为空");
|
|
|
- }
|
|
|
+ long currentTime=System.currentTimeMillis();
|
|
|
+ UserDetail userDetail = (UserDetail) map.get("userDetail"); //获取用户详细信息
|
|
|
+ Integer attachmentId = (Integer) map.get("attachmentId");
|
|
|
+ String battleResult = (String) map.get("battleResult"); //获取比对结果
|
|
|
|
|
|
+ //更新估值核算表中的信息
|
|
|
Map<String, Object> mapToDaoForValuationAccounting = new LinkedHashMap<String,Object>();
|
|
|
- mapToDaoForValuationAccounting.put("fundId", fundId);
|
|
|
- mapToDaoForValuationAccounting.put("fundName", fundName);
|
|
|
- mapToDaoForValuationAccounting.put("assets", assets);
|
|
|
- /*
|
|
|
- * TODO
|
|
|
- * 这里有一段代码是需要对管理岗和银行的上传估值报表进行比较,来确定battleResult的结果是---->>估值一致 or 估值不一致????????
|
|
|
- */
|
|
|
- //这是一段伪代码,到时候要删除的
|
|
|
- if((int)(Math.random()*3)>1){
|
|
|
- mapToDaoForValuationAccounting.put("battleResult", "估值一致");
|
|
|
- }else{
|
|
|
- mapToDaoForValuationAccounting.put("battleResult", "估值不一致");
|
|
|
- }
|
|
|
- //管理员估值报表的id,而银行估值报表的id这个时候是没有添加的,也就是表中插入数据的时候,银行估值报表的id先空着
|
|
|
- mapToDaoForValuationAccounting.put("attachmentId", (Integer)(int)(Math.random()*1000000)); //附件id不能用随机数,这里到时候要改的(这个是银行估值报表的id)。。。。。。。。。TODO
|
|
|
- mapToDaoForValuationAccounting.put("updateTime", System.currentTimeMillis()); //上传文件的更新时间为当前时间
|
|
|
+ mapToDaoForValuationAccounting.put("fundId", map.get("fundId"));
|
|
|
+ mapToDaoForValuationAccounting.put("attachmentId", attachmentId); //附件id已经写活♥===========>>id号生成机制到时候再改TODO
|
|
|
+ mapToDaoForValuationAccounting.put("updateTime", currentTime); //上传文件的更新时间为当前时间
|
|
|
+ mapToDaoForValuationAccounting.put("battleResult", battleResult); //总表中需要改变的对账结果
|
|
|
valuationAccountingDao.updateInformationByBank(mapToDaoForValuationAccounting); //将以上的数据更新到之前估值核算表
|
|
|
|
|
|
|
|
|
- //将附件信息封装到mapToDaoForAttachment并传入数据库中
|
|
|
- Map<String, Object> mapToDaoForAttachment = new LinkedHashMap<String,Object>();
|
|
|
- mapToDaoForAttachment.put("attachmentId", mapToDaoForValuationAccounting.get("attachmentId")); //直接从前面的map中获取
|
|
|
- mapToDaoForAttachment.put("url", url); //下载文件需要用到的url地址需要录入到附件表中
|
|
|
- mapToDaoForAttachment.put("attachmentName", attachmentName); //附件名称需要录入
|
|
|
- //用户id到时候再确定,先写死
|
|
|
- mapToDaoForAttachment.put("userId", 2000000001); //用户id(这里先写死)。。。。。。。。。。TODO
|
|
|
- mapToDaoForAttachment.put("addTime", (Long)mapToDaoForValuationAccounting.get("updateTime")); //这里添加的文件上传时间,和项目文档更新时间一样
|
|
|
+ //待对账银行是插入一个新数据
|
|
|
+ if(BattleResult.TO_BE_MATCHED.equals(battleResult)){
|
|
|
+ //将附件信息封装到mapToDaoForAttachment并传入数据库中
|
|
|
+ Map<String, Object> mapToDaoForAttachment = new LinkedHashMap<String,Object>();
|
|
|
+ mapToDaoForAttachment.put("attachmentId", attachmentId);
|
|
|
+ mapToDaoForAttachment.put("url", map.get("url")); //下载文件需要用到的url地址需要录入到附件表中
|
|
|
+ mapToDaoForAttachment.put("attachmentName", map.get("attachmentName")); //附件名称需要录入
|
|
|
+ //用户id已经写活♥
|
|
|
+ mapToDaoForAttachment.put("userId", userDetail.getUser_id()); //用户id写活了♥
|
|
|
+ mapToDaoForAttachment.put("addTime", currentTime); //这里添加的文件上传时间,和项目文档更新时间一样
|
|
|
+ valuationAccountingDao.insertInformationToAttachment(mapToDaoForAttachment); //将以上的数据插入到附件表中
|
|
|
+ }
|
|
|
+
|
|
|
+ //不一致说明银行要修改附件中的信息
|
|
|
+ if(BattleResult.INCONSISTENT.equals(battleResult)){
|
|
|
+ //将附件信息封装到mapToDaoForAttachment并传入数据库中
|
|
|
+ Map<String, Object> mapToDaoForAttachment = new LinkedHashMap<String,Object>();
|
|
|
+ mapToDaoForAttachment.put("attachmentId", attachmentId);
|
|
|
+ mapToDaoForAttachment.put("url", map.get("url")); //下载文件需要用到的url地址需要录入到附件表中
|
|
|
+ mapToDaoForAttachment.put("attachmentName", map.get("attachmentName")); //附件名称需要录入
|
|
|
+ //用户id已经写活♥
|
|
|
+ mapToDaoForAttachment.put("userId", userDetail.getUser_id()); //用户id写活了♥
|
|
|
+ mapToDaoForAttachment.put("addTime", currentTime); //这里添加的文件上传时间,和项目文档更新时间一样
|
|
|
+ valuationAccountingDao.updateAttachmentInformationByBank(mapToDaoForAttachment); //将以上的数据插入到附件表中
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
//此外,还要将业务申报的这个操作信息插入到操作记录表中【】
|
|
|
Map<String, Object> mapToOperationHistory = new LinkedHashMap<String,Object>();
|
|
|
- mapToOperationHistory.put("operatorTypeId", 1010); //操作类型为【上传估值核算表】---1010
|
|
|
- mapToOperationHistory.put("operatorAccount", 300000001); //操作账号先定死
|
|
|
- mapToOperationHistory.put("operatorRole", "省分行托管分中心估值核算岗"); //创建这个操作的角色只能是---省分行托管分中心估值核算岗
|
|
|
- mapToOperationHistory.put("operatorPerson", "张三"); //操作人先写死
|
|
|
- mapToOperationHistory.put("operatorTime", mapToDaoForValuationAccounting.get("updateTime")); //操作时间为当前操作时间
|
|
|
- mapToOperationHistory.put("hash", "to be calculated from operation"); //如何计算操作的hash值????
|
|
|
+ mapToOperationHistory.put("operatorTypeId", OperationTypeId.UPLOAD_VALUATION_CHECK); //操作类型为【上传估值核算表】---1010
|
|
|
+ mapToOperationHistory.put("operatorAccount", userDetail.getAccount()); //操作账号写活了♥
|
|
|
+ mapToOperationHistory.put("operatorRole", Role.ACCOUNTING_POS_OF_TBC); //创建这个操作的角色只能是---省分行托管分中心估值核算岗
|
|
|
+ mapToOperationHistory.put("operatorPerson", userDetail.getPerson_name()); //操作人写活了♥
|
|
|
+ mapToOperationHistory.put("operatorTime", currentTime); //操作时间为当前操作时间
|
|
|
+ mapToOperationHistory.put("hash", "to be calculated from operation"); //如何计算操作的hash值????=========================>>TODO
|
|
|
valuationAccountingDao.insertOperationHistoryInformationToDao(mapToOperationHistory);//将操作记录信息插入到操作记录表中
|
|
|
}
|
|
|
|
|
@@ -276,6 +285,8 @@ public class ValuationAccountingService {
|
|
|
}
|
|
|
return valuationAccount;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|