public Result hitSingle(Context context) {
/**
* 1、查詢相同身份證號或不同身份正好相同房產證號 (查詢狀態不包括【自動完結】和【取消】和【待發起】)
* 2、結果為空,允許下戶申請
* 3、結果不為空 ,查詢對應的授信申請
* 4、如授信申請為空,不允許發起下戶(說明在7天保護期內)
* 5、如果不為空,【查看授信發起日期】
* 6、如果發起時間小于 【7天(可配置)】,不允許發起下戶申請(說明在7天保護期內)
* 7、如果大于7天,查詢 授信階段, 如果已超過 授信審批階段,允許發起下戶申請
* 8、都不符合,允許發起
*/
UdhMissionApply udhMissionApply = ContextUtils.getBean(UdhMissionApply.class, context);
List
//先獲取房產證號,然后查詢是否有此房產證號的資訊,并且下戶申請狀態為下戶申請中,打回,下戶完成三種的資料
List
if ((udhMissionApplyList != null && udhMissionApplyList.size() > 0) || udhMissionInfoList != null && udhMissionInfoList.size() > 0) {
//如果有,查找授信申請
LmtGrtApply lmtGrtApply = lmtGrtApplyService.selectByUnderhouseNum(udhMissionApply.getUnderhouseNum());
//如果授信申請為空,則授信申請正在進行中,不能進行下戶申請,(判斷當前時間是否超過簽到時間7天,未超過則不可下戶申請,否則可以下戶申請)
if (ObjectUtils.isEmpty(lmtGrtApply)) {
//獲取簽到時間
String signInTime = udhMissionApply.getSignInTime();
//把string型別改為LocalDateTime
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime dateTime = LocalDateTime.parse(signInTime, formatter);
//算出現在與簽到時間差是否超過7天
Duration duration = Duration.between(dateTime, LocalDateTime.now());
//相差的天數
long days = duration.toDays();
String day =configExtMapper.selectValidParamValueByParamCode(CommConstant.MAXIMUM_LENGTH_OF_CREDIT_EXTENSION_AFTER_SIGN_IN);
if (days <= Integer.valueOf(day)) {
return Result.fail(lmtGrtApply, "下戶申請失敗");
} else {
return Result.success();
}
} else {
//查看授信發起日期,如果發起時間小于 【7天(可配置)】,不允許發起下戶申請(說明在7天保護期內),否則可下戶申請
//獲取授信申請開始時間
String startTime = lmtGrtApply.getCreateTime();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime dateTime = LocalDateTime.parse(startTime, formatter);
//算出現在與授信申請開始的時間差是否超過7天
Duration duration = Duration.between(dateTime, LocalDateTime.now());
long days = duration.toDays();
String day = configExtMapper.selectValidParamValueByParamCode(CommConstant.MAXIMUM_LENGTH_OF_CREDIT_EXTENSION_APPLICATION);
if (days <= Integer.valueOf(day)) {
return Result.fail(lmtGrtApply, "下戶申請失敗");
} else {
//當授信時間超過七天,判斷授信狀態是否還在授信審批,如果還在授信審批,可以進行下戶申請,負責不可以
if ((DictConstant.LMT_GRT_STATUS_1).equals(lmtGrtApply.getApproveStatus())) {
return Result.success();
} else {
return Result.fail(lmtGrtApply, "下戶申請失敗");
}
}
}
}
return Result.success();
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/201480.html
標籤:其他
