|
@@ -0,0 +1,636 @@
|
|
|
+package com.fuzamei.service;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.LinkedHashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Isolation;
|
|
|
+import org.springframework.transaction.annotation.Propagation;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import com.fuzamei.dao.BusinessDeclareDao;
|
|
|
+import com.fuzamei.entity.BusinessCheck;
|
|
|
+import com.fuzamei.entity.BusinessDeclare;
|
|
|
+import com.fuzamei.utils.PageDTO;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class BusinessDeclareService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private BusinessDeclareDao businessDeclareDao;
|
|
|
+
|
|
|
+ private static final int ROW_NUM = 10;
|
|
|
+
|
|
|
+
|
|
|
+ *
|
|
|
+ * @Title: insertInformationIntoTableByBranchBank
|
|
|
+ * @Description: TODO(对从controller层传进来的数据先进行校验,然后再通过dao层往数据库进行录入)
|
|
|
+ * @param @param map 设定文件
|
|
|
+ * @return void 返回类型
|
|
|
+ * @author ylx
|
|
|
+ * @date 2017年12月19日 下午1:43:33
|
|
|
+ * @throws
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor=Exception.class)
|
|
|
+ public void insertInformationIntoTableByBranchBank(Map<String, Object> map) {
|
|
|
+ Integer businessId=null;
|
|
|
+ String bank="";
|
|
|
+ String businessName="";
|
|
|
+ Integer busineeApprovalId=null;
|
|
|
+ String busineeApprovalName="";
|
|
|
+ String urlOfBusineeApproval="";
|
|
|
+ Integer responsibleInvestigationId=null;
|
|
|
+ String responsibleInvestigationName="";
|
|
|
+ String urlOfResponsibleInvestigation="";
|
|
|
+ Integer productApprovalId=null;
|
|
|
+ String productApprovalName="";
|
|
|
+ String urlOfProductApproval="";
|
|
|
+ Integer basicDataId=null;
|
|
|
+ String basicDataName="";
|
|
|
+ String urlOfBasicData="";
|
|
|
+ if (map.get("businessId") != null) {
|
|
|
+ try {
|
|
|
+ businessId = (Integer) map.get("businessId");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("businessId类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("业务申报的id号为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("bank")) && map.get("bank") != null) {
|
|
|
+ try {
|
|
|
+ bank = (String) map.get("bank");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("bank类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("银行名称为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("businessName")) && map.get("businessName") != null) {
|
|
|
+ try {
|
|
|
+ businessName = (String) map.get("businessName");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("businessName类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("业务名称为空");
|
|
|
+ }
|
|
|
+ if (map.get("busineeApprovalId") != null) {
|
|
|
+ try {
|
|
|
+ busineeApprovalId = (Integer) map.get("busineeApprovalId");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("busineeApprovalId类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("业务核准表的id号为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("busineeApprovalName")) && map.get("busineeApprovalName") != null) {
|
|
|
+ try {
|
|
|
+ busineeApprovalName = (String) map.get("busineeApprovalName");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("busineeApprovalName类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("业务员核准表的文件名为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("urlOfBusineeApproval")) && map.get("urlOfBusineeApproval") != null) {
|
|
|
+ try {
|
|
|
+ urlOfBusineeApproval = (String) map.get("urlOfBusineeApproval");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("urlOfBusineeApproval类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("业务核准表的url地址");
|
|
|
+ }
|
|
|
+ if (map.get("responsibleInvestigationId") != null) {
|
|
|
+ try {
|
|
|
+ responsibleInvestigationId = (Integer) map.get("responsibleInvestigationId");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("responsibleInvestigationId类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("尽职调查表id号为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("responsibleInvestigationName")) && map.get("responsibleInvestigationName") != null) {
|
|
|
+ try {
|
|
|
+ responsibleInvestigationName = (String) map.get("responsibleInvestigationName");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("responsibleInvestigationName类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("尽职调查表的文件名为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("urlOfResponsibleInvestigation")) && map.get("urlOfResponsibleInvestigation") != null) {
|
|
|
+ try {
|
|
|
+ urlOfResponsibleInvestigation = (String) map.get("urlOfResponsibleInvestigation");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("urlOfResponsibleInvestigation类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("尽职调查表的url为空");
|
|
|
+ }
|
|
|
+ if (map.get("productApprovalId") != null) {
|
|
|
+ try {
|
|
|
+ productApprovalId = (Integer) map.get("productApprovalId");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("productApprovalId类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("产品核准表的id号为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("productApprovalName")) && map.get("productApprovalName") != null) {
|
|
|
+ try {
|
|
|
+ productApprovalName = (String) map.get("productApprovalName");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("productApprovalName类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("产品核准表的文件名为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("urlOfProductApproval")) && map.get("urlOfProductApproval") != null) {
|
|
|
+ try {
|
|
|
+ urlOfProductApproval = (String) map.get("urlOfProductApproval");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("urlOfProductApproval类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("产品核准表的url为空");
|
|
|
+ }
|
|
|
+ if (map.get("basicDataId") != null) {
|
|
|
+ try {
|
|
|
+ basicDataId = (Integer) map.get("basicDataId");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("basicDataId类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("基础性资料的id号为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("basicDataName")) && map.get("basicDataName") != null) {
|
|
|
+ try {
|
|
|
+ basicDataName = (String) map.get("basicDataName");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("basicDataName类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("基础性资料的文件名为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("urlOfBasicData")) && map.get("urlOfBasicData") != null) {
|
|
|
+ try {
|
|
|
+ urlOfBasicData = (String) map.get("urlOfBasicData");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("urlOfBasicData类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("基础性资料的url为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> mapToDaoForBusinessDeclare = new LinkedHashMap<String,Object>();
|
|
|
+ mapToDaoForBusinessDeclare.put("businessId", businessId);
|
|
|
+ mapToDaoForBusinessDeclare.put("bank", bank);
|
|
|
+ mapToDaoForBusinessDeclare.put("businessName", businessName);
|
|
|
+ mapToDaoForBusinessDeclare.put("busineeApprovalId", busineeApprovalId);
|
|
|
+ mapToDaoForBusinessDeclare.put("responsibleInvestigationId", responsibleInvestigationId);
|
|
|
+ mapToDaoForBusinessDeclare.put("productApprovalId", productApprovalId);
|
|
|
+ mapToDaoForBusinessDeclare.put("basicDataId", basicDataId);
|
|
|
+ mapToDaoForBusinessDeclare.put("declareTime", System.currentTimeMillis());
|
|
|
+ mapToDaoForBusinessDeclare.put("statusId",1);
|
|
|
+ mapToDaoForBusinessDeclare.put("hash", "to be calaulated from file on server");
|
|
|
+ businessDeclareDao.insertBusinessDeclareInformationToDaoByBranchBank(mapToDaoForBusinessDeclare);
|
|
|
+
|
|
|
+ Map<String, Object> mapToDaoForAttachmentOfBusineeApproval = new LinkedHashMap<String,Object>();
|
|
|
+ mapToDaoForAttachmentOfBusineeApproval.put("attachmentId", responsibleInvestigationId);
|
|
|
+ mapToDaoForAttachmentOfBusineeApproval.put("attachmentName", responsibleInvestigationName);
|
|
|
+ mapToDaoForAttachmentOfBusineeApproval.put("url", urlOfResponsibleInvestigation);
|
|
|
+ mapToDaoForAttachmentOfBusineeApproval.put("userId", 300000001);
|
|
|
+ mapToDaoForAttachmentOfBusineeApproval.put("createTime", mapToDaoForBusinessDeclare.get("declareTime"));
|
|
|
+ businessDeclareDao.insertAttachmentInformationToDaoByBranchBank(mapToDaoForAttachmentOfBusineeApproval);
|
|
|
+
|
|
|
+ Map<String, Object> mapToDaoForAttachmentOfResponsibleInvestigation = new LinkedHashMap<String,Object>();
|
|
|
+ mapToDaoForAttachmentOfResponsibleInvestigation.put("attachmentId", busineeApprovalId);
|
|
|
+ mapToDaoForAttachmentOfResponsibleInvestigation.put("attachmentName", busineeApprovalName);
|
|
|
+ mapToDaoForAttachmentOfResponsibleInvestigation.put("url", urlOfBusineeApproval);
|
|
|
+ mapToDaoForAttachmentOfResponsibleInvestigation.put("userId", 300000001);
|
|
|
+ mapToDaoForAttachmentOfResponsibleInvestigation.put("createTime", mapToDaoForBusinessDeclare.get("declareTime"));
|
|
|
+ businessDeclareDao.insertAttachmentInformationToDaoByBranchBank(mapToDaoForAttachmentOfResponsibleInvestigation);
|
|
|
+
|
|
|
+ Map<String, Object> mapToDaoForAttachmentOfProductApproval = new LinkedHashMap<String,Object>();
|
|
|
+ mapToDaoForAttachmentOfProductApproval.put("attachmentId", productApprovalId);
|
|
|
+ mapToDaoForAttachmentOfProductApproval.put("attachmentName", productApprovalName);
|
|
|
+ mapToDaoForAttachmentOfProductApproval.put("url", urlOfProductApproval);
|
|
|
+ mapToDaoForAttachmentOfProductApproval.put("userId", 300000001);
|
|
|
+ mapToDaoForAttachmentOfProductApproval.put("createTime", mapToDaoForBusinessDeclare.get("declareTime"));
|
|
|
+ businessDeclareDao.insertAttachmentInformationToDaoByBranchBank(mapToDaoForAttachmentOfProductApproval);
|
|
|
+
|
|
|
+ Map<String, Object> mapToDaoForAttachmentOfBasicData = new LinkedHashMap<String,Object>();
|
|
|
+ mapToDaoForAttachmentOfBasicData.put("attachmentId", basicDataId);
|
|
|
+ mapToDaoForAttachmentOfBasicData.put("attachmentName", basicDataName);
|
|
|
+ mapToDaoForAttachmentOfBasicData.put("url", urlOfBasicData);
|
|
|
+ mapToDaoForAttachmentOfBasicData.put("userId", 300000001);
|
|
|
+ mapToDaoForAttachmentOfBasicData.put("createTime", mapToDaoForBusinessDeclare.get("declareTime"));
|
|
|
+ businessDeclareDao.insertAttachmentInformationToDaoByBranchBank(mapToDaoForAttachmentOfBasicData);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> mapToOperationHistory = new LinkedHashMap<String,Object>();
|
|
|
+ mapToOperationHistory.put("operatorTypeId", 1001);
|
|
|
+ mapToOperationHistory.put("operatorAccount", 300000001);
|
|
|
+ mapToOperationHistory.put("operatorRole", "经办支行");
|
|
|
+ mapToOperationHistory.put("operatorPerson", "张三");
|
|
|
+ mapToOperationHistory.put("operatorTime", mapToDaoForBusinessDeclare.get("declareTime"));
|
|
|
+ mapToOperationHistory.put("hash", "to be calculated from operation");
|
|
|
+ businessDeclareDao.insertOperationHistoryInformationToDaoByBranchBank(mapToOperationHistory);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ *
|
|
|
+ * @Title: queryBusinessDeclareInformation
|
|
|
+ * @Description: TODO(从客户端传过来的数据,进行校验,再将数据传递给Dao层进行查询)
|
|
|
+ * @param @param map
|
|
|
+ * @param @return 设定文件
|
|
|
+ * @return PageDTO 返回类型
|
|
|
+ * @author ylx
|
|
|
+ * @date 2017年12月19日 下午4:05:22
|
|
|
+ * @throws
|
|
|
+ */
|
|
|
+ public PageDTO queryBusinessDeclareInformation(Map<String, Object> map) {
|
|
|
+ int page = 1;
|
|
|
+ String businessName = "";
|
|
|
+ long startTime = 0;
|
|
|
+ long endTime=Long.MAX_VALUE;
|
|
|
+ if (!"".equals(map.get("page")) && map.get("page") != null) {
|
|
|
+ try {
|
|
|
+ page = Integer.parseInt((String) map.get("page"));
|
|
|
+ if (page < 1) {
|
|
|
+ page = 1;
|
|
|
+ }
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ page = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("businessName")) && map.get("businessName") != null) {
|
|
|
+ businessName = (String) map.get("businessName");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("startTime")) && map.get("startTime") != null) {
|
|
|
+ try {
|
|
|
+ startTime = Long.parseLong((String) map.get("startTime"));
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ startTime = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("endTime")) && map.get("endTime") != null) {
|
|
|
+ try {
|
|
|
+ endTime = Long.parseLong((String) map.get("endTime"));
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ endTime = Long.MAX_VALUE;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ PageDTO pageDTO = new PageDTO();
|
|
|
+ Map<String, Object> mapToDao = new LinkedHashMap<String, Object>();
|
|
|
+ mapToDao.put("startPage", (page - 1) * ROW_NUM);
|
|
|
+ mapToDao.put("businessName", businessName);
|
|
|
+ if (startTime <= endTime) {
|
|
|
+ mapToDao.put("startTime", startTime);
|
|
|
+ mapToDao.put("endTime", endTime);
|
|
|
+ } else {
|
|
|
+ mapToDao.put("startTime", startTime);
|
|
|
+ mapToDao.put("endTime", Long.MAX_VALUE);
|
|
|
+ }
|
|
|
+ mapToDao.put("rowNum", ROW_NUM);
|
|
|
+ List<BusinessDeclare> informationList=businessDeclareDao.queryBusinessDeclareInformation(mapToDao);
|
|
|
+ int count=businessDeclareDao.findAddInfromations();
|
|
|
+ pageDTO.setRows(informationList);
|
|
|
+ pageDTO.setTotal(count);
|
|
|
+ return pageDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ *
|
|
|
+ * @Title: queryBusinessCheckInformation
|
|
|
+ * @Description: TODO(根据controller层传过来的业务id号去数据库的业务审核总表中进行数据查询)
|
|
|
+ * @param @param map
|
|
|
+ * @param @return 设定文件
|
|
|
+ * @return PageDTO 返回类型
|
|
|
+ * @author ylx
|
|
|
+ * @date 2017年12月19日 下午7:51:16
|
|
|
+ * @throws
|
|
|
+ */
|
|
|
+ public List<BusinessCheck> queryBusinessCheckInformation(Map<String, Object> map) {
|
|
|
+ Integer check_business_id=null;
|
|
|
+ if (map.get("businessId") != null) {
|
|
|
+ try {
|
|
|
+ check_business_id = (Integer) map.get("businessId");
|
|
|
+ } catch (Exception e) {
|
|
|
+ check_business_id=null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> mapToDao =new LinkedHashMap<String, Object>();
|
|
|
+ mapToDao.put("businessId", check_business_id);
|
|
|
+ List<BusinessCheck> businessCheckList = businessDeclareDao.queryBusinessCheckInformation(mapToDao);
|
|
|
+
|
|
|
+ return businessCheckList;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ *
|
|
|
+ * @Title: businessDeclareCheckedBy
|
|
|
+ * @Description: TODO(将controller传过来的审核信息传入service层进行校验,然后将审核意见插入到数据库,同时将业务审核表中的审核结果的状态也顺便被更新一份)
|
|
|
+ * 此外,还要在操作记录表中插入一条数据
|
|
|
+ * @param @param map 设定文件
|
|
|
+ * 数据包含organizationName:二级分行或省分行
|
|
|
+ * checkPerson:审核人员
|
|
|
+ * checkResult:结果放入check_result字段
|
|
|
+ * checkOpinion:审核意见
|
|
|
+ * businessId:
|
|
|
+ * @return void 返回类型
|
|
|
+ * @author ylx
|
|
|
+ * @date 2017年12月19日 下午8:58:55
|
|
|
+ * @throws
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor=Exception.class)
|
|
|
+ public void businessDeclareCheckedBy(Map<String, Object> map) {
|
|
|
+ String organizationName="";
|
|
|
+ String checkPerson="";
|
|
|
+ Integer checkResult=null;
|
|
|
+ String checkOpinion="";
|
|
|
+ Integer businessId=null;
|
|
|
+ Integer statusId=null;
|
|
|
+
|
|
|
+ Integer operatorTypeId=null;
|
|
|
+
|
|
|
+ if (!"".equals(map.get("organizationName")) && map.get("organizationName") != null) {
|
|
|
+ try {
|
|
|
+ organizationName = (String) map.get("organizationName");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("organizationName类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("审核部门不能为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("checkPerson")) && map.get("checkPerson") != null) {
|
|
|
+ try {
|
|
|
+ checkPerson = (String) map.get("checkPerson");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("checkPerson类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("审人不能为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("checkResult")) && map.get("checkResult") != null) {
|
|
|
+ String result=null;
|
|
|
+ try {
|
|
|
+ result = (String) map.get("checkResult");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("checkResult类型转换异常");
|
|
|
+ }
|
|
|
+ if("agree".equals(result)){
|
|
|
+ checkResult=5;
|
|
|
+ if("二级分行".equals(organizationName)){
|
|
|
+ statusId=3;
|
|
|
+ operatorTypeId=1002;
|
|
|
+ }else if("省分行业务部门".equals(organizationName)){
|
|
|
+ statusId=5;
|
|
|
+ operatorTypeId=1013;
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("审核部门参数非法");
|
|
|
+ }
|
|
|
+ }else if("disagree".equals(result)){
|
|
|
+ checkResult=6;
|
|
|
+ if("二级分行".equals(organizationName)){
|
|
|
+ statusId=2;
|
|
|
+ operatorTypeId=1012;
|
|
|
+ }else if("省分行业务部门".equals(organizationName)){
|
|
|
+ statusId=4;
|
|
|
+ operatorTypeId=1003;
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("审核部门参数非法");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("审核结果参数非法");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("审核人不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!"".equals(map.get("checkOpinion")) && map.get("checkOpinion") != null) {
|
|
|
+ try {
|
|
|
+ checkOpinion = (String) map.get("checkOpinion");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("checkOpinion类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("审核意见不能为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("businessId")) && map.get("businessId") != null) {
|
|
|
+ try {
|
|
|
+ businessId = Integer.parseInt((String) map.get("businessId"));
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("businessId解析异常或类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("businessId不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> mapToDaoOfBusinessCheck=new LinkedHashMap<String, Object>();
|
|
|
+ mapToDaoOfBusinessCheck.put("organizationName", organizationName);
|
|
|
+ mapToDaoOfBusinessCheck.put("checkPerson", checkPerson);
|
|
|
+ mapToDaoOfBusinessCheck.put("checkResult", checkResult);
|
|
|
+ mapToDaoOfBusinessCheck.put("checkOpinion", checkOpinion);
|
|
|
+ mapToDaoOfBusinessCheck.put("businessId", businessId);
|
|
|
+ mapToDaoOfBusinessCheck.put("checkTime", System.currentTimeMillis());
|
|
|
+
|
|
|
+ businessDeclareDao.businessDeclareCheckedBy(mapToDaoOfBusinessCheck);
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> mapToDaoOfBusinessDeclare=new LinkedHashMap<String, Object>();
|
|
|
+ mapToDaoOfBusinessDeclare.put("businessId", businessId);
|
|
|
+ mapToDaoOfBusinessDeclare.put("statusId", statusId);
|
|
|
+
|
|
|
+ businessDeclareDao.updateBusinessDeclareStatus(mapToDaoOfBusinessDeclare);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> mapToOperationHistory = new LinkedHashMap<String,Object>();
|
|
|
+ mapToOperationHistory.put("operatorTypeId", operatorTypeId);
|
|
|
+ mapToOperationHistory.put("operatorRole", organizationName);
|
|
|
+ mapToOperationHistory.put("operatorAccount", 300000001);
|
|
|
+ mapToOperationHistory.put("operatorPerson", "张三");
|
|
|
+ mapToOperationHistory.put("operatorTime", mapToDaoOfBusinessCheck.get("checkTime"));
|
|
|
+ mapToOperationHistory.put("hash", "to be calculated from operation");
|
|
|
+ businessDeclareDao.insertOperationHistoryInformationToDaoByBranchBank(mapToOperationHistory);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ *
|
|
|
+ * @Title: uploadContractByProvincialBranchBank
|
|
|
+ * @Description: TODO(由省分行业务部门上传的合同,将这个合同信息分别插入【合同提交记录表】、【合同状态跟踪表】、【附件表】)
|
|
|
+ * 修改意见定义为“初始版本合同”
|
|
|
+ * 上传部门为“省分行业务部门”
|
|
|
+ *
|
|
|
+ * @param @param map 设定文件
|
|
|
+ * @return void 返回类型
|
|
|
+ * @author ylx
|
|
|
+ * @date 2017年12月20日 下午3:09:19
|
|
|
+ * @throws
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor=Exception.class)
|
|
|
+ public void uploadContractByProvincialBranchBank(Map<String, Object> map) {
|
|
|
+ Integer businessId=null;
|
|
|
+ Integer contractId=null;
|
|
|
+ String contractName="";
|
|
|
+ String contractParty="";
|
|
|
+ String uploadDepartment="";
|
|
|
+ String uploadPerson="";
|
|
|
+ String url="";
|
|
|
+ String hash="";
|
|
|
+ Integer userId=null;
|
|
|
+ if (!"".equals(map.get("businessId")) && map.get("businessId") != null) {
|
|
|
+ try {
|
|
|
+ businessId = Integer.parseInt((String) map.get("businessId"));
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("业务id解析异常或类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("业务id不能为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("contractId")) && map.get("contractId") != null) {
|
|
|
+ try {
|
|
|
+ contractId = Integer.parseInt((String) map.get("contractId"));
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("合同id解析异常或类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("合同id不能为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("contractName")) && map.get("contractName") != null) {
|
|
|
+ try {
|
|
|
+ contractName = (String) map.get("contractName");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("contractName类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("合同名不能为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("contractParty")) && map.get("contractParty") != null) {
|
|
|
+ try {
|
|
|
+ contractParty = (String) map.get("contractParty");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("contractParty类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("签约双方的名不能为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("uploadDepartment")) && map.get("uploadDepartment") != null) {
|
|
|
+ try {
|
|
|
+ uploadDepartment = (String) map.get("uploadDepartment");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("uploadDepartment类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("上传部门名不能为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("uploadPerson")) && map.get("uploadPerson") != null) {
|
|
|
+ try {
|
|
|
+ uploadPerson = (String) map.get("uploadPerson");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("uploadPerson类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("上传人不能为空");
|
|
|
+ }
|
|
|
+ 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("hash")) && map.get("hash") != null) {
|
|
|
+ try {
|
|
|
+ hash = (String) map.get("hash");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("hash类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("合同的hash值不能为空");
|
|
|
+ }
|
|
|
+ if (!"".equals(map.get("userId")) && map.get("userId") != null) {
|
|
|
+ try {
|
|
|
+ userId = Integer.parseInt((String) map.get("userId"));
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException("上传人id解析异常或类型转换异常");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("上传人id不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> mapToContractRecord=new LinkedHashMap<String, Object>();
|
|
|
+ mapToContractRecord.put("businessId", businessId);
|
|
|
+ mapToContractRecord.put("contractId", contractId);
|
|
|
+ mapToContractRecord.put("contractName", contractName);
|
|
|
+ mapToContractRecord.put("version", "v1.0");
|
|
|
+ mapToContractRecord.put("contractParty", contractParty);
|
|
|
+ mapToContractRecord.put("uploadDepartment", uploadDepartment);
|
|
|
+ mapToContractRecord.put("uploadPerson", uploadPerson);
|
|
|
+ mapToContractRecord.put("modifyOpinion", "初始版本合同");
|
|
|
+ mapToContractRecord.put("comfirmDepartment", "管理人");
|
|
|
+ mapToContractRecord.put("commitTime", System.currentTimeMillis());
|
|
|
+ mapToContractRecord.put("hash", hash);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> mapToContractStatusTracking=new LinkedHashMap<String, Object>();
|
|
|
+ mapToContractStatusTracking.put("businessId", businessId);
|
|
|
+ mapToContractStatusTracking.put("contractName", contractName);
|
|
|
+ mapToContractStatusTracking.put("contractParty", contractParty);
|
|
|
+ mapToContractStatusTracking.put("updateTime", mapToContractRecord.get("commitTime"));
|
|
|
+ mapToContractStatusTracking.put("statusId", 7);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> mapToAttachment=new LinkedHashMap<String, Object>();
|
|
|
+ mapToAttachment.put("attachmentId", contractId);
|
|
|
+ mapToAttachment.put("attachmentName", contractName);
|
|
|
+ mapToAttachment.put("url", url);
|
|
|
+ mapToAttachment.put("userId", userId);
|
|
|
+ mapToAttachment.put("createTime", mapToContractRecord.get("commitTime"));
|
|
|
+
|
|
|
+ businessDeclareDao.insertContractInformationToContractRecord(mapToContractRecord);
|
|
|
+ businessDeclareDao.insertContractInformationToContractStatusTracking(mapToContractStatusTracking);
|
|
|
+ businessDeclareDao.insertContractInformationToAttachment(mapToAttachment);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> mapToOperationHistory = new LinkedHashMap<String,Object>();
|
|
|
+ mapToOperationHistory.put("operatorTypeId", 1004);
|
|
|
+ mapToOperationHistory.put("operatorRole", "省分行业务部门");
|
|
|
+ mapToOperationHistory.put("operatorAccount", 300000001);
|
|
|
+ mapToOperationHistory.put("operatorPerson", "张三");
|
|
|
+ mapToOperationHistory.put("operatorTime", mapToContractRecord.get("commitTime"));
|
|
|
+ mapToOperationHistory.put("hash", "to be calculated from operation");
|
|
|
+ businessDeclareDao.insertOperationHistoryInformationToDaoByBranchBank(mapToOperationHistory);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|