|
|
@ -52,9 +52,63 @@ public class LoanFinPolicyService extends MybatisBaseService<LoanFinPolicyMapper |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String sid = dto.getSid(); |
|
|
|
String orgPath = dto.getOrgPath(); |
|
|
|
List<UseDept> useDeptList = dto.getUseDeptList(); |
|
|
|
useDeptList.removeAll(Collections.singleton(null)); |
|
|
|
if (useDeptList.isEmpty()) { |
|
|
|
return rb.setMsg("适用销售部门不允许为空"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(dto.getBankSid())) { |
|
|
|
return rb.setMsg("资方不允许为空"); |
|
|
|
return rb.setMsg("资方简称不允许为空"); |
|
|
|
} |
|
|
|
List<String> vehTypeKeyList = dto.getVehTypeKeyList(); |
|
|
|
vehTypeKeyList.removeAll(Collections.singleton(null)); |
|
|
|
if (vehTypeKeyList.isEmpty()) { |
|
|
|
return rb.setMsg("车辆功能不允许为空"); |
|
|
|
} |
|
|
|
String guaranteeTypeKey = dto.getGuaranteeTypeKey(); |
|
|
|
if (StringUtils.isBlank(guaranteeTypeKey)) { |
|
|
|
return rb.setMsg("担保类型不允许为空"); |
|
|
|
} |
|
|
|
//首付比例
|
|
|
|
if (StringUtils.isBlank(dto.getDownPayRatio())) { |
|
|
|
return rb.setMsg("首付比例不允许为空"); |
|
|
|
} |
|
|
|
//最低首付比例
|
|
|
|
if (StringUtils.isBlank(dto.getDownPayRatioLeast())) { |
|
|
|
return rb.setMsg("最低首付比例不允许为空"); |
|
|
|
} |
|
|
|
//保证金比例
|
|
|
|
if (StringUtils.isBlank(dto.getBondRatio())) { |
|
|
|
return rb.setMsg("保证金比例不允许为空"); |
|
|
|
} |
|
|
|
//保证金类型
|
|
|
|
if (StringUtils.isBlank(dto.getBondType())) { |
|
|
|
return rb.setMsg("保证金类型不允许为空"); |
|
|
|
} |
|
|
|
//期数
|
|
|
|
if(StringUtils.isBlank(dto.getPeriodKey())){ |
|
|
|
return rb.setMsg("期数不允许为空"); |
|
|
|
} |
|
|
|
//标准年利率
|
|
|
|
if (StringUtils.isBlank(dto.getYearRatio())) { |
|
|
|
return rb.setMsg("标准年利率不允许为空"); |
|
|
|
} |
|
|
|
//服务费类型
|
|
|
|
if (StringUtils.isBlank(dto.getServiceAmountTypeValue())) { |
|
|
|
return rb.setMsg("服务费类型不允许为空"); |
|
|
|
} |
|
|
|
//服务费
|
|
|
|
if (StringUtils.isBlank(dto.getServiceAmount())) { |
|
|
|
return rb.setMsg("服务费不允许为空"); |
|
|
|
} |
|
|
|
//贴息放款类型
|
|
|
|
if (StringUtils.isBlank(dto.getDiscountUseType())) { |
|
|
|
return rb.setMsg("贴息放款类型不允许为空"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(dto.getValidDateTo())) { |
|
|
|
return rb.setMsg("有效期至不允许为空"); |
|
|
|
} |
|
|
|
|
|
|
|
String useOrgSid = sysStaffOrgFeign.getOrgSidByPath(orgPath).getData(); |
|
|
|
String useOrgName = ""; |
|
|
|
ResultBean<SysOrganizationVo> sysOrganizationVoResultBean = sysOrganizationFeign.fetchBySid(useOrgSid); |
|
|
@ -64,7 +118,6 @@ public class LoanFinPolicyService extends MybatisBaseService<LoanFinPolicyMapper |
|
|
|
if (StringUtils.isBlank(sid)) { |
|
|
|
LoanFinPolicy loanFinPolicy = new LoanFinPolicy(); |
|
|
|
BeanUtil.copyProperties(dto, loanFinPolicy, "sid"); |
|
|
|
List<String> vehTypeKeyList = dto.getVehTypeKeyList(); |
|
|
|
if (!vehTypeKeyList.isEmpty()) { |
|
|
|
String vehTypeKey = String.join(",", vehTypeKeyList); |
|
|
|
loanFinPolicy.setVehTypeKey(vehTypeKey); |
|
|
@ -74,7 +127,6 @@ public class LoanFinPolicyService extends MybatisBaseService<LoanFinPolicyMapper |
|
|
|
String vehTypeValue = String.join(",", vehTypeValueList); |
|
|
|
loanFinPolicy.setVehTypeValue(vehTypeValue); |
|
|
|
} |
|
|
|
List<UseDept> useDeptList = dto.getUseDeptList(); |
|
|
|
String deptSids = ""; |
|
|
|
String deptNames = ""; |
|
|
|
if (!useDeptList.isEmpty()) { |
|
|
@ -131,6 +183,22 @@ public class LoanFinPolicyService extends MybatisBaseService<LoanFinPolicyMapper |
|
|
|
BeanUtil.copyProperties(dto, loanFinOtherPolicy, "sid"); |
|
|
|
LoanFinOtherPolicyDto loanFinOtherPolicyDto = dto.getLoanFinOtherPolicy(); |
|
|
|
BeanUtil.copyProperties(loanFinOtherPolicyDto, loanFinOtherPolicy); |
|
|
|
//产品类别
|
|
|
|
if (StringUtils.isBlank(loanFinOtherPolicyDto.getProductTypeValue())) { |
|
|
|
return rb.setMsg("其他融产品类别不允许为空"); |
|
|
|
} |
|
|
|
//最高融资比例
|
|
|
|
if (StringUtils.isBlank(loanFinOtherPolicyDto.getMaxLoanRatio())) { |
|
|
|
return rb.setMsg("其他融最高融资比例不允许为空"); |
|
|
|
} |
|
|
|
//最高融资额
|
|
|
|
if (StringUtils.isBlank(loanFinOtherPolicyDto.getMaxLoanAmount())) { |
|
|
|
return rb.setMsg("其他融最高融资额不允许为空"); |
|
|
|
} |
|
|
|
//年利率
|
|
|
|
if (StringUtils.isBlank(loanFinOtherPolicyDto.getYearRatio())) { |
|
|
|
return rb.setMsg("其他融年利率不允许为空"); |
|
|
|
} |
|
|
|
//其它融名称=资方+产品类别+最高融资比例+期数
|
|
|
|
//其它融产品名称=资方简称+产品类别+期数+最高融资比例,如:中车首付贷 24 期20
|
|
|
|
String name = loanFinOtherPolicy.getBankShortName() + " " + loanFinOtherPolicy.getProductTypeValue() + " " + loanFinOtherPolicy.getPeriod() + "期 "; |
|
|
@ -165,7 +233,6 @@ public class LoanFinPolicyService extends MybatisBaseService<LoanFinPolicyMapper |
|
|
|
return rb.setMsg("该金融产品政策不存在"); |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(dto, loanFinPolicy, "sid"); |
|
|
|
List<String> vehTypeKeyList = dto.getVehTypeKeyList(); |
|
|
|
if (!vehTypeKeyList.isEmpty()) { |
|
|
|
String vehTypeKey = String.join(",", vehTypeKeyList); |
|
|
|
loanFinPolicy.setVehTypeKey(vehTypeKey); |
|
|
@ -181,7 +248,6 @@ public class LoanFinPolicyService extends MybatisBaseService<LoanFinPolicyMapper |
|
|
|
} |
|
|
|
String deptSids = ""; |
|
|
|
String deptNames = ""; |
|
|
|
List<UseDept> useDeptList = dto.getUseDeptList(); |
|
|
|
if (!useDeptList.isEmpty()) { |
|
|
|
List<String> deptSidsList = useDeptList.stream().map(v -> v.getDeptSid()).collect(Collectors.toList()); |
|
|
|
deptSids = String.join(",", deptSidsList); |
|
|
@ -213,13 +279,13 @@ public class LoanFinPolicyService extends MybatisBaseService<LoanFinPolicyMapper |
|
|
|
if (!vehTypeKeyList.isEmpty()) { |
|
|
|
String vehTypeKey = String.join(",", vehTypeKeyList); |
|
|
|
loanFinOtherPolicy.setVehTypeKey(vehTypeKey); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
loanFinOtherPolicy.setVehTypeKey(""); |
|
|
|
} |
|
|
|
if (!vehTypeValueList.isEmpty()) { |
|
|
|
String vehTypeValue = String.join(",", vehTypeValueList); |
|
|
|
loanFinOtherPolicy.setVehTypeValue(vehTypeValue); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
loanFinOtherPolicy.setVehTypeValue(""); |
|
|
|
} |
|
|
|
loanFinOtherPolicyService.updateById(loanFinOtherPolicy); |
|
|
@ -349,6 +415,16 @@ public class LoanFinPolicyService extends MybatisBaseService<LoanFinPolicyMapper |
|
|
|
if (loanFinPolicy == null) { |
|
|
|
return rb.setMsg("选择中包含金融产品政策不存在的数据,请刷新后操作"); |
|
|
|
} |
|
|
|
if("1".equals(query.getUseState())){//useState为1时走停用,为0时走开启
|
|
|
|
if(loanFinPolicy.getUseSate() == 1){ |
|
|
|
return rb.setMsg("该数据已是停用状态,不要重复操作"); |
|
|
|
} |
|
|
|
} |
|
|
|
if("0".equals(query.getUseState())){ |
|
|
|
if(loanFinPolicy.getUseSate() == 0){ |
|
|
|
return rb.setMsg("该数据已是开启状态,不要重复操作"); |
|
|
|
} |
|
|
|
} |
|
|
|
loanFinPolicy.setUseSate(Integer.valueOf(useState).intValue()); |
|
|
|
loanFinPolicy.setModifyTime(new Date()); |
|
|
|
loanFinPolicy.setUpdateBySid(query.getUserSid()); |
|
|
@ -477,6 +553,18 @@ public class LoanFinPolicyService extends MybatisBaseService<LoanFinPolicyMapper |
|
|
|
if (loanFinPolicy == null) { |
|
|
|
return rb.setMsg("选择中包含金融产品政策不存在的数据,请刷新后操作"); |
|
|
|
} |
|
|
|
if("1".equals(query.getRiskState())){//useState为1时走停用,为0时走开启
|
|
|
|
if(loanFinPolicy.getRiskState() == 1){ |
|
|
|
return rb.setMsg("该数据已是禁用状态,不要重复操作"); |
|
|
|
} |
|
|
|
} |
|
|
|
if("0".equals(query.getRiskState())){ |
|
|
|
if(loanFinPolicy.getRiskState() == 0){ |
|
|
|
return rb.setMsg("该数据已是启用状态,不要重复操作"); |
|
|
|
} |
|
|
|
} |
|
|
|
loanFinPolicy.setModifyTime(new Date()); |
|
|
|
loanFinPolicy.setUpdateBySid(query.getUserSid()); |
|
|
|
loanFinPolicy.setRiskState(Integer.valueOf(riskState).intValue()); |
|
|
|
baseMapper.updateById(loanFinPolicy); |
|
|
|
LoanFinOtherPolicy loanFinOtherPolicy = loanFinOtherPolicyService.selectByMainSid(sid); |
|
|
@ -572,10 +660,11 @@ public class LoanFinPolicyService extends MybatisBaseService<LoanFinPolicyMapper |
|
|
|
return rb.success().setData(appPolicyDetailsVo); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<PolicyVo>> selectList(String orgPath, String userSid, String isPack, String name) { |
|
|
|
public ResultBean<List<PolicyVo>> selectList(String orgPath, String userSid, String isPack, String name,String vehTypeKey) { |
|
|
|
ResultBean<List<PolicyVo>> rb = ResultBean.fireFail(); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getOrgSidByPath(orgPath).getData(); |
|
|
|
List<PolicyVo> list = baseMapper.selectListOne(useOrgSid, isPack, name); |
|
|
|
String deptSid = Arrays.asList(orgPath.split("/")).get(Arrays.asList(orgPath.split("/")).size()-1); |
|
|
|
List<PolicyVo> list = baseMapper.selectListOne(deptSid, isPack, name,vehTypeKey); |
|
|
|
list.removeAll(Collections.singleton(null)); |
|
|
|
return rb.success().setData(list); |
|
|
|
} |
|
|
|