|
|
@ -8,10 +8,7 @@ import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfinotherPolicy.*; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfinpolicy.LoanFinPolicy; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfinpolicy.LoanFinPolicyStateQuery; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfinpolicy.LoanRiskStateQuery; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfinpolicy.UseDept; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfinpolicy.*; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanpreloancreditapply.*; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanpreloancreditpeo.LoanPreloanCreditPeoDto; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanfinpolicy.LoanFinPolicyService; |
|
|
@ -25,10 +22,9 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.List; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: |
|
|
@ -92,7 +88,7 @@ public class LoanFinOtherPolicyService extends MybatisBaseService<LoanFinOtherPo |
|
|
|
return baseMapper.selectByMainSids(sid); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<OtherPolicyVo>> selectList(String orgPath, String userSid, String sid, String name, String modelSid) { |
|
|
|
public ResultBean<List<OtherPolicyVo>> selectList(String orgPath, String userSid, String sid, String name, String modelSid, String period) { |
|
|
|
ResultBean<List<OtherPolicyVo>> rb = ResultBean.fireFail(); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getOrgSidByPath(orgPath).getData(); |
|
|
|
String vehTypeKey = loanFinPolicyService.selectVehType(modelSid); |
|
|
@ -102,8 +98,15 @@ public class LoanFinOtherPolicyService extends MybatisBaseService<LoanFinOtherPo |
|
|
|
if (list.isEmpty()) { |
|
|
|
list = baseMapper.selectListTwo(useOrgSid, name, vehTypeKey, deptSid); |
|
|
|
list.removeAll(Collections.singleton(null)); |
|
|
|
//移除超过期数的对象
|
|
|
|
Iterator iterator = list.iterator(); |
|
|
|
while (iterator.hasNext()) { |
|
|
|
OtherPolicyVo otherPolicyVo = (OtherPolicyVo) iterator.next(); |
|
|
|
if (Integer.parseInt(otherPolicyVo.getPeriod()) > Integer.parseInt(period)) { |
|
|
|
iterator.remove(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return rb.success().setData(list); |
|
|
|
|
|
|
|
} |
|
|
@ -191,6 +194,31 @@ public class LoanFinOtherPolicyService extends MybatisBaseService<LoanFinOtherPo |
|
|
|
qw.orderByDesc("createTime"); |
|
|
|
IPage<LoanFinOtherPolicy> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<LoanFinOtherPolicyPageVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
List<LoanFinOtherPolicyPageVo> records = pagging.getRecords(); |
|
|
|
records.removeAll(Collections.singleton(null)); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
if (!records.isEmpty()) { |
|
|
|
for (LoanFinOtherPolicyPageVo record : records) { |
|
|
|
record.setUpdateBtn(false); |
|
|
|
if (record.getFilingState().equals("未报备")) { |
|
|
|
record.setUpdateBtn(true); |
|
|
|
} |
|
|
|
if (record.getFilingState().equals("已报备")) { |
|
|
|
String validDateTo = record.getValidDateTo(); |
|
|
|
try { |
|
|
|
Date validDate = sdf.parse(validDateTo); |
|
|
|
int i = validDate.compareTo(new Date()); |
|
|
|
if (i < 0) { |
|
|
|
record.setUpdateBtn(true); |
|
|
|
} |
|
|
|
} catch (ParseException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PagerVo<LoanFinOtherPolicyPageVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
@ -218,16 +246,16 @@ public class LoanFinOtherPolicyService extends MybatisBaseService<LoanFinOtherPo |
|
|
|
} |
|
|
|
String otherPolicyName = ""; |
|
|
|
if (StringUtils.isNotBlank(entity.getBankShortName())) { |
|
|
|
otherPolicyName = otherPolicyName + entity.getBankShortName(); |
|
|
|
otherPolicyName = otherPolicyName + entity.getBankShortName() + " "; |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(entity.getProductTypeValue())) { |
|
|
|
otherPolicyName = otherPolicyName + entity.getProductTypeValue(); |
|
|
|
otherPolicyName = otherPolicyName + entity.getProductTypeValue() + " "; |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(entity.getPeriodKey())) { |
|
|
|
otherPolicyName = otherPolicyName + entity.getPeriod() + "期"; |
|
|
|
otherPolicyName = otherPolicyName + entity.getPeriod() + "期" + " "; |
|
|
|
} |
|
|
|
if (entity.getMaxLoanRatio() != null) { |
|
|
|
otherPolicyName = otherPolicyName + entity.getMaxLoanRatio(); |
|
|
|
otherPolicyName = otherPolicyName + entity.getMaxLoanRatio() + "%"; |
|
|
|
} |
|
|
|
entity.setOtherPolicyName(otherPolicyName); |
|
|
|
if (StringUtils.isNotBlank(useDeptSid)) { |
|
|
@ -269,20 +297,22 @@ public class LoanFinOtherPolicyService extends MybatisBaseService<LoanFinOtherPo |
|
|
|
} |
|
|
|
String otherPolicyName = ""; |
|
|
|
if (StringUtils.isNotBlank(entity.getBankShortName())) { |
|
|
|
otherPolicyName = otherPolicyName + entity.getBankShortName(); |
|
|
|
otherPolicyName = otherPolicyName + entity.getBankShortName() + " "; |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(entity.getProductTypeValue())) { |
|
|
|
otherPolicyName = otherPolicyName + entity.getProductTypeValue(); |
|
|
|
otherPolicyName = otherPolicyName + entity.getProductTypeValue() + " "; |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(entity.getPeriodKey())) { |
|
|
|
otherPolicyName = otherPolicyName + entity.getPeriod() + "期"; |
|
|
|
otherPolicyName = otherPolicyName + entity.getPeriod() + "期" + " "; |
|
|
|
} |
|
|
|
if (entity.getMaxLoanRatio() != null) { |
|
|
|
otherPolicyName = otherPolicyName + entity.getMaxLoanRatio(); |
|
|
|
otherPolicyName = otherPolicyName + entity.getMaxLoanRatio() + "%"; |
|
|
|
} |
|
|
|
entity.setOtherPolicyName(otherPolicyName); |
|
|
|
entity.setUseDeptSids(useDeptSid.substring(0, useDeptSid.lastIndexOf(","))); |
|
|
|
entity.setUseDeptNames(useDeptName.substring(0, useDeptName.lastIndexOf(","))); |
|
|
|
if (StringUtils.isNotBlank(useDeptSid)) { |
|
|
|
entity.setUseDeptSids(useDeptSid.substring(0, useDeptSid.lastIndexOf(","))); |
|
|
|
entity.setUseDeptNames(useDeptName.substring(0, useDeptName.lastIndexOf(","))); |
|
|
|
} |
|
|
|
List<String> vehTypeKeyList = dto.getVehTypeKeyList(); |
|
|
|
List<String> vehTypeValueList = dto.getVehTypeValueList(); |
|
|
|
String vehTypeKey = ""; |
|
|
@ -299,6 +329,10 @@ public class LoanFinOtherPolicyService extends MybatisBaseService<LoanFinOtherPo |
|
|
|
if (StringUtils.isNotBlank(vehTypeValue)) { |
|
|
|
entity.setVehTypeValue(vehTypeValue.substring(0, vehTypeValue.lastIndexOf(","))); |
|
|
|
} |
|
|
|
//----------已备案且超过有效期再次编辑时,修改备案状态为未备案-------
|
|
|
|
if (entity.getFilingState() == 1) { |
|
|
|
entity.setFilingState(0); |
|
|
|
} |
|
|
|
baseMapper.updateById(entity); |
|
|
|
} |
|
|
|
|
|
|
|