|
@@ -98,8 +98,6 @@ public class CreditHandleController extends BaseController {
|
|
|
//查询当前操作员
|
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
|
SysUser use = userInfo.getSysUser();
|
|
|
- //获取企业
|
|
|
- String companyId = use.getCompanyId();
|
|
|
//获取融信编号
|
|
|
String zfiId = CommonUtil.objToString(map.get("zfiId"));
|
|
|
//获取融信类型
|
|
@@ -108,17 +106,30 @@ public class CreditHandleController extends BaseController {
|
|
|
String flag = CommonUtil.objToString(map.get("flag"));
|
|
|
//产品
|
|
|
String zfpId = CommonUtil.objToString(map.get("zfpId"));
|
|
|
- ZcFinanceInf financeInf = new ZcFinanceInf();
|
|
|
- //编号
|
|
|
- financeInf.setZfiId(zfiId);
|
|
|
- //供应商申请
|
|
|
- if("0".equals(zfiCreateType)){
|
|
|
+ //供应商申请并且通过
|
|
|
+ if("0".equals(zfiCreateType) && "00".equals(flag)){
|
|
|
//获取授信额度
|
|
|
//供应商企业授信额度
|
|
|
String zfiCoreQuotaId = CommonUtil.objToString(map.get("zfiCoreQuotaId"));
|
|
|
if(CommonUtil.isEmpty(zfiCoreQuotaId)){
|
|
|
throw new Exception("请选择授信额度");
|
|
|
}
|
|
|
+ //获取签发金额
|
|
|
+ String zfiAmount = CommonUtil.objToString(map.get("zfiAmount"));
|
|
|
+ //获取可用金额
|
|
|
+ String availableAmt = CommonUtil.objToString(map.get("availableAmt"));
|
|
|
+ //获取融资最小金额
|
|
|
+ String zfpMinimumAmount = CommonUtil.objToString(map.get("zfpMinimumAmount"));
|
|
|
+ if(CommonUtil.compare(zfiAmount,availableAmt) == 1){
|
|
|
+ throw new Exception("签发金额不可大于可用额度");
|
|
|
+ }
|
|
|
+ //如果最小融资金额大于签发金额
|
|
|
+ if(CommonUtil.compare(zfpMinimumAmount,zfiAmount) == 1){
|
|
|
+ throw new Exception("签发金额不可小于产品的最小融资金额");
|
|
|
+ }
|
|
|
+ ZcFinanceInf financeInf = new ZcFinanceInf();
|
|
|
+ //编号
|
|
|
+ financeInf.setZfiId(zfiId);
|
|
|
financeInf.setZfiCoreQuotaId(zfiCoreQuotaId);
|
|
|
//产品
|
|
|
financeInf.setZfiProductId(zfpId);
|
|
@@ -129,13 +140,11 @@ public class CreditHandleController extends BaseController {
|
|
|
String zfiExpireDate = CommonUtil.objToString(map.get("zfiExpireDate"));
|
|
|
//签发有效期
|
|
|
String zfiEffectiveDate = CommonUtil.objToString(map.get("zfiEffectiveDate"));
|
|
|
- if("00".equals(flag)){
|
|
|
- if(CommonUtil.isEmpty(zfiEffectiveDate)){
|
|
|
- throw new Exception("请选择签发有效期");
|
|
|
- }
|
|
|
- if(CommonUtil.isEmpty(zfiExpireDate)){
|
|
|
- throw new Exception("请选择承诺付款日");
|
|
|
- }
|
|
|
+ if(CommonUtil.isEmpty(zfiEffectiveDate)){
|
|
|
+ throw new Exception("请选择签发有效期");
|
|
|
+ }
|
|
|
+ if(CommonUtil.isEmpty(zfiExpireDate)){
|
|
|
+ throw new Exception("请选择承诺付款日");
|
|
|
}
|
|
|
if(!CommonUtil.isEmpty(zfiEffectiveDate)){
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
@@ -148,29 +157,19 @@ public class CreditHandleController extends BaseController {
|
|
|
Date signDate = simpleDateFormat.parse(zfiExpireDate);
|
|
|
financeInf.setZfiExpireDate(signDate);
|
|
|
}
|
|
|
+ financeInfService.updateById(financeInf);
|
|
|
}
|
|
|
//获取当前时间
|
|
|
Date createTime = DateUtils.getNowDate();
|
|
|
- //通过
|
|
|
- if("00".equals(flag)){
|
|
|
- /* //申请
|
|
|
- if("0".equals(zfiCreateType)){
|
|
|
- //待签收
|
|
|
- financeInf.setZfiStatus("01");
|
|
|
- }else if("2".equals(zfiCreateType)){
|
|
|
- //已生效
|
|
|
- financeInf.setZfiStatus("02");
|
|
|
- //签收日期
|
|
|
- financeInf.setZfiSignDate(createTime);
|
|
|
- }*/
|
|
|
-
|
|
|
- }else if("01".equals(flag)){//拒绝
|
|
|
+ if("01".equals(flag)){//拒绝
|
|
|
+ ZcFinanceInf financeInf = new ZcFinanceInf();
|
|
|
+ //编号
|
|
|
+ financeInf.setZfiId(zfiId);
|
|
|
//已失效
|
|
|
financeInf.setZfiStatus("03");
|
|
|
- }
|
|
|
- financeInfService.updateById(financeInf);
|
|
|
-
|
|
|
- if("01".equals(flag)){//拒绝
|
|
|
+ financeInf.setUpdateTime(createTime);
|
|
|
+ financeInf.setUpdateBy(CommonUtil.objToString(use.getUserId()));
|
|
|
+ financeInfService.updateById(financeInf);
|
|
|
//给融资方经办人添加失效消息
|
|
|
//获取融资方信息
|
|
|
String zfiSupplierId = CommonUtil.objToString(map.get("zfiSupplierId"));
|