|
@@ -9,7 +9,9 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
+import com.fuzamei.constant.OperationTypeId;
|
|
|
import com.fuzamei.constant.Role;
|
|
|
+import com.fuzamei.constant.StatusId;
|
|
|
import com.fuzamei.dao.CapitalTransferDao;
|
|
|
import com.fuzamei.entity.BusinessCheck;
|
|
|
import com.fuzamei.entity.BusinessDeclare;
|
|
@@ -117,30 +119,34 @@ public class CapitalTransferService {
|
|
|
|
|
|
}
|
|
|
/**
|
|
|
- * 资金划转审核记录的查询,当用户点击查看按钮后,不仅显示了资金划转的信息,还显示了资金划转审核记录的信息,这里资金划转的信息直接从前端获取,审核记录根据前端提供的id号>fund_id来进行查询
|
|
|
+ * 资金划转审核记录的查询,当用户点击查看按钮后,不仅显示了资金划转的信息,还显示了资金划转审核记录的信息,这里资金划转的信息直接从前端获取,审核记录根据前端提供的id号>fund_id来进行查询
|
|
|
*/
|
|
|
public List<CapitalTransferCheck> queryCapitalTransferCheckInformation(Map<String, Object> map) {
|
|
|
UserDetail userDetail = (UserDetail) map.get("userDetail");
|
|
|
- List<String> roleList = userDetail.getRole_name();
|
|
|
+ List<String> roleList = userDetail.getRole_name();//角色名称
|
|
|
Integer fund_id = (Integer) map.get("fund_id");
|
|
|
- Integer statusId = capitalTransferDao.getStatusIdByCapitalId(fund_id);
|
|
|
- //
|
|
|
- if(roleList.contains(Role.BUSINESS_TRAN_POS_OF_PBBTBC)){//业务岗
|
|
|
+ Integer statusId = capitalTransferDao.getStatusIdByCapitalId(fund_id);//根据资金id 查询状态id值
|
|
|
+ if(roleList.contains(Role.BUSINESS_TRAN_POS_OF_PBBTBC)){//指令业务岗
|
|
|
+ if(statusId==12) {//如果管理人发起划转资金后 状态不是(待指令业务岗审核 ) 直接返回空
|
|
|
+ return null;
|
|
|
+ }
|
|
|
return capitalTransferDao.selectCapitalTransferRecord(map);
|
|
|
}
|
|
|
- if(roleList.contains(Role.BUSINESS_CHECK_POS_OF_PBBTBC)){//核算岗
|
|
|
- if(statusId==12||statusId==13){//如果状态是指令业务岗不通过或者是在待审核时 直接返回空
|
|
|
+ if(roleList.contains(Role.BUSINESS_CHECK_POS_OF_PBBTBC)){//如果是 省分行托管分中心(核算业务岗)
|
|
|
+ if(statusId==12||statusId==13){//对于核算主管岗 如果状态是指令业务岗不通过或者是在待审核时 直接返回空
|
|
|
return null;
|
|
|
}
|
|
|
return capitalTransferDao.selectCapitalTransferRecord(map);
|
|
|
}
|
|
|
- if(roleList.contains(Role.BUSINESS_CHIEF_POS_OF_PBBTBC)) {//主管岗
|
|
|
- if(statusId==12||statusId==13 ||statusId==14||statusId==15){//如果状态是指令业务岗不通过或者是在待审核时 在或者核算岗是在待审核或者审核不通过时 直接返回空
|
|
|
+ else if(roleList.contains(Role.BUSINESS_CHIEF_POS_OF_PBBTBC)) {//省分行托管分中心(核算主管岗)
|
|
|
+ if(statusId==12||statusId==13 ||statusId==14||statusId==15){//如果状态是指令业务岗不通过或者是在业务岗待审核时 再或者核算岗是在待审核或者核算岗审核不通过时 直接返回空
|
|
|
return null;
|
|
|
}
|
|
|
return capitalTransferDao.selectCapitalTransferRecord(map);
|
|
|
+ }else {
|
|
|
+ return capitalTransferDao.selectCapitalTransferRecord(map);//所有人都能查看
|
|
|
}
|
|
|
- throw new RuntimeException("无权操作");
|
|
|
+ //throw new RuntimeException("无权操作");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -149,7 +155,7 @@ public class CapitalTransferService {
|
|
|
* @param map
|
|
|
* @return
|
|
|
*/
|
|
|
- public Map<String, Object> selectChaKanZiJinHuaZhuan(Map<String, Object> map){
|
|
|
+/* public Map<String, Object> selectChaKanZiJinHuaZhuan(Map<String, Object> map){
|
|
|
int fund_id=0;
|
|
|
if (!"".equals(map.get("fund_id")) && map.get("fund_id") != null) {
|
|
|
fund_id = Integer.parseInt((String)map.get("fund_id"));
|
|
@@ -163,80 +169,125 @@ public class CapitalTransferService {
|
|
|
map1.put("CapitalTransferCheck", lis);
|
|
|
return map1;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////____
|
|
|
+ */
|
|
|
/**
|
|
|
- * 管理人发起划款 资金
|
|
|
+ * 审核划转资金
|
|
|
+ * 审批流程审批意见
|
|
|
+ * 将审核意见插入到审核表
|
|
|
* @param map
|
|
|
- * @return
|
|
|
*/
|
|
|
- @Transactional
|
|
|
- public Map<String, Object> insertCapitalTransfer(Map<String, Object> map){
|
|
|
- String custodian="";//管理人
|
|
|
- String fund_name="";//基金名称
|
|
|
- Double sum_of_money=null;//划款金额
|
|
|
- Integer basis_of_payment=null;//划款依据
|
|
|
- //账户余额
|
|
|
- //划款账户
|
|
|
+ @Transactional(rollbackFor=Exception.class)
|
|
|
+ public void insertCheckTransfer(Map<String, Object> map) {
|
|
|
+ long currentTime = System.currentTimeMillis();//获取系统时间
|
|
|
+ UserDetail userDetail = (UserDetail) map.get("userDetail");//userDetail从controller层获取到
|
|
|
+ List<String> roleList = userDetail.getRole_name();////在get角色名称
|
|
|
+ String check_department=userDetail.getOrganization_name(); //机构名称——————————————————>//审核部门 审核部门的名称
|
|
|
+ String check_person=userDetail.getPerson_name(); //审核人
|
|
|
+ Integer check_result=(Integer) map.get("check_result"); //审核结果(5表示同意,6表示不同意)
|
|
|
+ String check_opinion=(String) map.get("check_opinion"); //审核意见
|
|
|
+ Integer fund_id=(Integer) map.get("fund_id"); //资金划转的id号,要根据这个更新资金划转表的状态的
|
|
|
+ Integer statusId=capitalTransferDao.getStatusIdByCapitalId(fund_id); //根据业务id号获取当前的状态id值
|
|
|
+ Integer operatorTypeId=null; //操作类型id号------>放到操作记录表中去的
|
|
|
|
|
|
- if (!"".equals(map.get("custodian")) && map.get("custodian") != null) {
|
|
|
- custodian = (String)map.get("custodian");
|
|
|
+ if(roleList.contains(Role.ADMIN)) {//角色是(管理人)发起划款资金
|
|
|
+ if(check_result==StatusId.AGREE) {//审核结果等于状态也是通过的话
|
|
|
+ statusId=StatusId.INSTRUCT_BUSINESS_ACCOUNTING;//发起后状态 设置为(待指令业务岗审核)
|
|
|
+ operatorTypeId=OperationTypeId.ADMIN_LAUNCHING;//管理人发起后任务类型必须是1027 为 发起(10)
|
|
|
+ }else if(check_result==StatusId.REJECTED) {//如果审核结果不通过
|
|
|
+ statusId=StatusId.INSTRUCT_BUSINESS_ACCOUNTING_NO;//显示>为指令业务岗审核不通过
|
|
|
+ operatorTypeId=OperationTypeId.CHECK_BUSINESS_ACCOUNTING_REJECT_MAIN;//指令业务岗拒绝
|
|
|
+ }else {
|
|
|
+ throw new RuntimeException("审核结果参数非法123");
|
|
|
+ }
|
|
|
}
|
|
|
- if (!"".equals(map.get("fund_name")) && map.get("fund_name") != null) {
|
|
|
- fund_name = (String)map.get("fund_name");
|
|
|
+ else if(roleList.contains(Role.BUSINESS_TRAN_POS_OF_PBBTBC) && statusId==StatusId.INSTRUCT_BUSINESS_ACCOUNTING){//省分行托管中心/状态待指令业务岗审核
|
|
|
+ if(check_result==StatusId.AGREE) {//如果审核结果通过
|
|
|
+ statusId=StatusId.CHECK_BUSINESS_ACCOUNTING; //通过后 状态显示为待核算业务岗审核
|
|
|
+ operatorTypeId=OperationTypeId.CHECK_BUSINESS_ACCOUNTING_PASS;//操作类型为指令业务岗通过
|
|
|
+ }else if(check_result==StatusId.REJECTED) {//如果审核结果不通过
|
|
|
+ statusId=StatusId.INSTRUCT_BUSINESS_ACCOUNTING_NO;//显示>为指令业务岗审核不通过
|
|
|
+ operatorTypeId=OperationTypeId.CHECK_BUSINESS_ACCOUNTING_REJECT_MAIN;//指令业务岗拒绝
|
|
|
+ }else {
|
|
|
+ throw new RuntimeException("审核结果参数非法1");
|
|
|
+ }
|
|
|
}
|
|
|
- if (!"".equals(map.get("sum_of_money")) && map.get("sum_of_money") != null) {
|
|
|
- sum_of_money = (Double)map.get("sum_of_money");
|
|
|
+ else if(roleList.contains(Role.BUSINESS_CHECK_POS_OF_PBBTBC)&&statusId==StatusId.CHECK_BUSINESS_ACCOUNTING){ //如果是待核算业务岗操作,且当前状态id必须是14
|
|
|
+ if(check_result==StatusId.AGREE){//审核结果时通过
|
|
|
+ statusId=StatusId.CHARGE_BUSINESS_ACCOUNTING; //如果通过 状态显示为待核算主管岗审核
|
|
|
+ operatorTypeId=OperationTypeId.CHECK_BUSINESS_ACCOUNTING_PASS; //操作类型核算业务岗通过
|
|
|
+ }else if(check_result==StatusId.REJECTED){//不通过
|
|
|
+ statusId=StatusId.CHECK_BUSINESS_ACCOUNTING_NO; //显示核算业务岗不通过
|
|
|
+ operatorTypeId=OperationTypeId.CHECK_BUSINESS_ACCOUNTING_REJECT;//核算业务岗拒绝
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("审核结果参数非法2");
|
|
|
+ }
|
|
|
+ }else if(roleList.contains(Role.BUSINESS_CHIEF_POS_OF_PBBTBC)&&statusId==StatusId.CHARGE_BUSINESS_ACCOUNTING){//如果是待核算主管岗,且当前状态id必须是16
|
|
|
+
|
|
|
+ if(check_result==StatusId.AGREE){//如果审核结果通过
|
|
|
+ statusId=StatusId.AGREE;
|
|
|
+ operatorTypeId=OperationTypeId.CHARGE_BUSINESS_ACCOUNTING_YES;//核算主管岗通过
|
|
|
+ }else if(check_result==StatusId.REJECTED){//如果审核结果不通过
|
|
|
+ statusId=StatusId.CHARGE_BUSINESS_ACCOUNTING_NO;//核算主管岗审核不通过
|
|
|
+ operatorTypeId=OperationTypeId.CAPITAL_TRANSFER_REEXAMINE_REJECTED_NO;// //(划转资金)核算主管岗终审拒绝
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("审核结果参数非法3");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("无权操作222");
|
|
|
}
|
|
|
- Map<String, Object> mapToDao = new LinkedHashMap<String, Object>();
|
|
|
-
|
|
|
+ //将审核已将数据封装到map中
|
|
|
+ Map<String, Object> mapToDaoOfBusinessCheck=new LinkedHashMap<String, Object>();
|
|
|
+ mapToDaoOfBusinessCheck.put("check_department", check_department);
|
|
|
+ mapToDaoOfBusinessCheck.put("check_person", check_person);
|
|
|
+ mapToDaoOfBusinessCheck.put("check_result", check_result);
|
|
|
+ mapToDaoOfBusinessCheck.put("check_opinion", check_opinion);
|
|
|
+ mapToDaoOfBusinessCheck.put("fund_id", fund_id);
|
|
|
+ mapToDaoOfBusinessCheck.put("check_time", currentTime);
|
|
|
+ mapToDaoOfBusinessCheck.put("relation", StatusId.CHECKING); //这里必定写死,11在状态表中对应的是审核状态
|
|
|
+ //将封装到map的审核意见数据传入dao层中将结果导入【资金划转审核记录表】中-------->insert操作
|
|
|
+ capitalTransferDao.insertCheckTransfer(mapToDaoOfBusinessCheck);
|
|
|
|
|
|
+ //将审核的结果封装到map中
|
|
|
+ Map<String, Object> mapToDaoOfBusinessDeclare=new LinkedHashMap<String, Object>();
|
|
|
+ mapToDaoOfBusinessDeclare.put("fund_id", fund_id);
|
|
|
+ mapToDaoOfBusinessDeclare.put("statusId", statusId);
|
|
|
+ //将审核结果更新到【资金划转】这个fund_id的【资金划转结果字段】中去-------->update操作
|
|
|
+ capitalTransferDao.updateCapitaltransferStatus(mapToDaoOfBusinessDeclare);
|
|
|
|
|
|
+ //还要将审核的这个操作信息插入到操作记录表中
|
|
|
+ Map<String, Object> mapToOperationHistory = new LinkedHashMap<String,Object>();
|
|
|
+ mapToOperationHistory.put("operator_type_id", operatorTypeId); //operatorTypeId根据前面的判断决定
|
|
|
+ mapToOperationHistory.put("operator_role", check_department); //创建这个操作的角色根据前面的organizationName决定
|
|
|
+ mapToOperationHistory.put("operator_account", userDetail.getAccount()); //操作账号写活
|
|
|
+ mapToOperationHistory.put("operator_person", userDetail.getPerson_name()); //操作人先写活
|
|
|
+ mapToOperationHistory.put("operator_time", currentTime); //操作时间为当前操作时间
|
|
|
+ mapToOperationHistory.put("hash", "5555555555555555555"); //如何计算操作的hash值????写死的这里
|
|
|
+ capitalTransferDao.insertOperationHistory(mapToOperationHistory);//将操作记录信息插入到操作记录表中
|
|
|
|
|
|
|
|
|
- return null;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ ///////////////////////////////////////以下////////////////////////////////////////////////////////////////////____
|
|
|
/**
|
|
|
- * 将审核意见插入到审核表 暂没做
|
|
|
+ * 管理人发起划款 资金
|
|
|
* @param map
|
|
|
+ * @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public void insertCheckTransfer(Map<String, Object> map) {
|
|
|
- String check_department=""; //审核部门
|
|
|
- String check_person=""; //审核人
|
|
|
- Integer check_result=null; //审核结果
|
|
|
- String check_opinion=""; //审核意见
|
|
|
- Integer fund_id=null; //划转资金的id号,要根据这个更新划转资金审核的状态的
|
|
|
- Integer status_id=null; //划转资金表的状态id号,这个要根据check_result审核结果来判断状态哦
|
|
|
-
|
|
|
- Integer operatorTypeId=null; //把操作类型id号-*放到操作记录表中去的
|
|
|
-
|
|
|
- if (!"".equals(map.get("check_department")) && map.get("check_department") != null) {
|
|
|
- check_department = (String)map.get("check_department");
|
|
|
- }
|
|
|
- if (!"".equals(map.get("check_person")) && map.get("check_person") != null) {
|
|
|
- check_person = (String)map.get("check_person");
|
|
|
- }
|
|
|
- if (!"".equals(map.get("check_result")) && map.get("check_result") != null) {
|
|
|
- check_result = Integer.parseInt((String)map.get("check_result"));
|
|
|
- }
|
|
|
- //判断
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if (!"".equals(map.get("check_opinion")) && map.get("check_opinion") != null) {
|
|
|
- check_opinion = (String)map.get("check_opinion");
|
|
|
- }
|
|
|
- if (!"".equals(map.get("fund_id")) && map.get("fund_id") != null) {
|
|
|
- fund_id = Integer.parseInt((String)map.get("fund_id"));
|
|
|
- }
|
|
|
- if (!"".equals(map.get("status_id")) && map.get("status_id") != null) {
|
|
|
- status_id = Integer.parseInt((String)map.get("status_id"));
|
|
|
- }
|
|
|
+ public Map<String, Object> insertCapitalTransfer(Map<String, Object> map){
|
|
|
+ String custodian="";//管理人
|
|
|
+ String fund_name="";//基金名称
|
|
|
+ Double sum_of_money=null;//划款金额
|
|
|
+ Integer basis_of_payment=null;//划款依据
|
|
|
+ //账户余额
|
|
|
+ //划款账户
|
|
|
+
|
|
|
|
|
|
|
|
|
+ return null;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|