客户规则逻辑

jg-waiwang-pro
胡川虎 9 months ago
parent 593ba99c78
commit 806ef0a938

@ -2,7 +2,23 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.SubjectSettlementRulesMapper">
<select id="getDefaultSettlementRules" parameterType="jnpf.entity.SubjectSettlementRulesEntity" resultType="jnpf.entity.SubjectSettlementRulesEntity">
<resultMap id="getDefaultSettlementRules" type="jnpf.entity.SubjectSettlementRulesEntity">
<id column="id" property="id"/>
<result column="underpayment_amount_down" property="underpaymentAmountDown"/>
<result column="underpayment_amount_upper" property="underpaymentAmountUpper"/>
<result column="underpayment_rate_down" property="underpaymentRateDown"/>
<result column="underpayment_rate_upper" property="underpaymentRateUpper"/>
<result column="margin_amount_down" property="marginAmountDown"/>
<result column="margin_amount_upper" property="marginAmountUpper"/>
<result column="margin_rate_down" property="marginRateDown"/>
<result column="margin_rate_upper" property="marginRateUpper"/>
<result column="overdue_annualized_down" property="overdueAnnualizedDown"/>
<result column="overdue_annualized_upper" property="overdueAnnualizedUpper"/>
<result column="overdue_monthly_down" property="overdueMonthlyDown"/>
<result column="overdue_monthly_upper" property="overdueMonthlyUpper"/>
</resultMap>
<select id="getDefaultSettlementRules" parameterType="jnpf.entity.SubjectSettlementRulesEntity" resultMap="getDefaultSettlementRules">
select a.* from jg_subject_settlement_rules a
left join flow_task b on a.id = b.f_id
where a.f_delete_mark is null and b.f_current_node_code = 'end' and f_status = 2 and f_completion = 100

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.SubjectaccountperiodrulesnoMapper">
<resultMap id="getDefaultAccountPeriodRules" type="jnpf.entity.SubjectaccountperiodrulesnoEntity">
<id column="id" property="id"/>
</resultMap>
<select id="getDefaultAccountPeriodRules" parameterType="jnpf.entity.SubjectaccountperiodrulesnoEntity" resultMap="getDefaultAccountPeriodRules">
select a.* from jg_subject_account_period_rules_no a
left join flow_task b on a.id = b.f_id
where a.f_delete_mark is null and b.f_current_node_code = 'end' and f_status = 2 and f_completion = 100
<if test="companyId != null and companyId != ''">
AND a.company_id= #{companyId}
</if>
<if test="businessType != null and businessType != ''">
AND a.business_type= #{businessType}
</if>
ORDER BY b.f_last_modify_time DESC LIMIT 1
</select>
</mapper>

@ -13,4 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface SubjectaccountperiodrulesnoMapper extends BaseMapper<SubjectaccountperiodrulesnoEntity> {
SubjectaccountperiodrulesnoEntity getDefaultAccountPeriodRules(SubjectaccountperiodrulesnoEntity subjectaccountperiodrulesnoEntity);
}

@ -36,4 +36,5 @@ public interface SubjectaccountperiodrulesnoService extends IService<Subjectacco
void saveOrUpdate(SubjectaccountperiodrulesnoForm subjectaccountperiodrulesnoForm,String id, boolean isSave) throws Exception;
SubjectaccountperiodrulesnoEntity getDefaultAccountPeriodRules(SubjectaccountperiodrulesnoEntity subjectaccountperiodrulesnoEntity);
}

@ -48,6 +48,10 @@ public class SubjectaccountperiodrulesnoServiceImpl extends ServiceImpl<Subjecta
@Autowired
private SubjectaccountperiodrulesService subjectaccountperiodrulesService;
@Autowired
private SubjectaccountperiodrulesnoMapper subjectaccountperiodrulesnoMapper;
@Override
public List<SubjectaccountperiodrulesnoEntity> getList(SubjectaccountperiodrulesnoPagination subjectaccountperiodrulesnoPagination){
return getTypeList(subjectaccountperiodrulesnoPagination,subjectaccountperiodrulesnoPagination.getDataType());
@ -308,6 +312,7 @@ public class SubjectaccountperiodrulesnoServiceImpl extends ServiceImpl<Subjecta
public List<SubjectaccountperiodrulesEntity> getSubjectaccountperiodrulesList(String id){
QueryWrapper<SubjectaccountperiodrulesEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SubjectaccountperiodrulesEntity::getNoId, id);
queryWrapper.lambda().orderByAsc(SubjectaccountperiodrulesEntity::getCreditRating);
return subjectaccountperiodrulesService.list(queryWrapper);
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@ -448,4 +453,9 @@ public class SubjectaccountperiodrulesnoServiceImpl extends ServiceImpl<Subjecta
}
}
}
@Override
public SubjectaccountperiodrulesnoEntity getDefaultAccountPeriodRules(SubjectaccountperiodrulesnoEntity subjectaccountperiodrulesnoEntity) {
return subjectaccountperiodrulesnoMapper.getDefaultAccountPeriodRules(subjectaccountperiodrulesnoEntity);
}
}

@ -6,8 +6,12 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.constant.PermissionConst;
import jnpf.exception.DataException;
import jnpf.model.subjectsettlementrules.SubjectSettlementRulesConstant;
import jnpf.permission.entity.OrganizeEntity;
import jnpf.permission.entity.UserEntity;
import jnpf.permission.service.OrganizeService;
import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
@ -74,7 +78,8 @@ public class SubjectaccountperiodrulesnoController {
@Autowired
private SubjectaccountperiodrulesService subjectaccountperiodrulesService;
@Autowired
private OrganizeService organizeService;
@Autowired
private ConfigValueUtil configValueUtil;
@ -440,4 +445,49 @@ public class SubjectaccountperiodrulesnoController {
return ActionResult.success(subjectaccountperiodrulesnoMap);
}
/**
* ()
* 使- businessType(1.2.3.)
* @param businessType
* @return
*/
@Operation(summary = "信息")
@GetMapping("getDefaultAccountPeriodRules/{businessType}")
public ActionResult getDefaultAccountPeriodRules(@PathVariable("businessType") String businessType){
UserInfo userInfo=userProvider.get();
String companyId = "";
if(userInfo != null && StringUtil.isNotEmpty(userInfo.getOrganizeId())){
OrganizeEntity organizeEntity = organizeService.getInfo(userInfo.getOrganizeId());
if(PermissionConst.DEPARTMENT.equals(organizeEntity.getCategory())){
userInfo.setDepartmentId(organizeEntity.getId());
do {
//获取父组织
organizeEntity = organizeService.getInfo(organizeEntity.getParentId());
}while (PermissionConst.DEPARTMENT.equals(organizeEntity.getCategory()));
companyId = organizeEntity.getId();
}else{
companyId = organizeEntity.getId();
}
}
/*QueryWrapper<SubjectSettlementRulesEntity> subjectSettlementRulesQueryWrapper=new QueryWrapper<>();
subjectSettlementRulesQueryWrapper.lambda().eq(SubjectSettlementRulesEntity::getCompanyId, companyId);
userInfo.getOrganizeId();*/
SubjectaccountperiodrulesnoEntity subjectaccountperiodrulesnoEntity = new SubjectaccountperiodrulesnoEntity();
subjectaccountperiodrulesnoEntity.setCompanyId(companyId);
subjectaccountperiodrulesnoEntity.setBusinessType(businessType);
//查询同公司的最后一条审批通过的流程
SubjectaccountperiodrulesnoEntity entity= subjectaccountperiodrulesnoService.getDefaultAccountPeriodRules(subjectaccountperiodrulesnoEntity);
Map<String, Object> subjectaccountperiodrulesnoMap=JsonUtil.entityToMap(entity);
subjectaccountperiodrulesnoMap.put("id", subjectaccountperiodrulesnoMap.get("id"));
//副表数据
//子表数据
List<SubjectaccountperiodrulesEntity> subjectaccountperiodrulesList = subjectaccountperiodrulesnoService.getSubjectaccountperiodrulesList(entity.getId());
subjectaccountperiodrulesnoMap.put("tableField102",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(subjectaccountperiodrulesList)));
subjectaccountperiodrulesnoMap = generaterSwapUtil.swapDataDetail(subjectaccountperiodrulesnoMap,SubjectaccountperiodrulesnoConstant.getFormData(),"522376064903685637",false);
return ActionResult.success(subjectaccountperiodrulesnoMap);
}
}

@ -7,3 +7,12 @@ export function queryDefaultSettlementRules(businessType) {
method: 'GET'
})
}
// 查询默认账期规则
export function queryDefaultAccountPeriodRules(businessType) {
return request({
url: `/api/scm/Subjectaccountperiodrulesno/getDefaultAccountPeriodRules/${businessType}`,
method: 'GET'
})
}

@ -558,7 +558,7 @@
</JnpfGroupTitle>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('collaborationMethod')">
<el-col :span="8" v-if="judgeShow('collaborationMethod')">
<jnpf-form-tip-item label="合作方式" v-if="judgeShow('collaborationMethod')" prop="collaborationMethod">
<JnpfRadio v-model="dataForm.collaborationMethod" @change="changeData('collaborationMethod',-1)"
:disabled="true" optionType="default" direction="horizontal"
@ -576,6 +576,17 @@
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('advanceRatio') && dataForm.settlementMethod == 2">
<jnpf-form-tip-item label="默认预付比例" v-if="judgeShow('advanceRatio')">
<JnpfInput v-model="defaultAccountPeriod.advanceRatioDown"
:disabled="true" addonAfter="%" :style='{"width":"40%"}'>
</JnpfInput>
<label></label>
<JnpfInput v-model="defaultAccountPeriod.advanceRatioUpper"
:disabled="true" addonAfter="%" :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('advanceRatio') && dataForm.settlementMethod == 2">
<jnpf-form-tip-item label="预付比例" v-if="judgeShow('advanceRatio')" prop="advanceRatio">
<JnpfInput v-model="dataForm.advanceRatio" @change="changeData('advanceRatio',-1)" placeholder="请输入"
@ -583,6 +594,17 @@
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('accountPeriod')">
<jnpf-form-tip-item label="默认账期" v-if="judgeShow('accountPeriod')">
<JnpfInput v-model="defaultAccountPeriod.accountPeriodDown"
:disabled="true" addonAfter="天" :style='{"width":"40%"}'>
</JnpfInput>
<label></label>
<JnpfInput v-model="defaultAccountPeriod.accountPeriodUpper"
:disabled="true" addonAfter="天" :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('accountPeriod')">
<jnpf-form-tip-item label="账期" v-if="judgeShow('accountPeriod')" prop="accountPeriod">
<JnpfInput v-model="dataForm.accountPeriod" @change="changeData('accountPeriod',-1)" placeholder="请输入"
@ -605,18 +627,33 @@
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('underpaymentMethod')">
<el-col :span="8" v-if="dataForm.underpaymentMethod == 0">
</el-col>
<el-col :span="8" v-if="dataForm.underpaymentMethod == 1">
<jnpf-form-tip-item label="默认压款金额" v-if="judgeShow('advanceRatio')" prop="advanceRatio">
<JnpfInput v-model="dataForm.advanceRatio" @change="changeData('advanceRatio',-1)" placeholder="请输入"
:disabled="judgeWrite('advanceRatio')" addonAfter="%" clearable :style='{"width":"40%"}'>
<JnpfInput v-model="defaultSettlementRules.underpaymentAmountDown"
:disabled="true" addonAfter="%" :style='{"width":"40%"}'>
</JnpfInput>
<label></label>
<JnpfInput v-model="dataForm.advanceRatio" @change="changeData('advanceRatio',-1)" placeholder="请输入"
:disabled="judgeWrite('advanceRatio')" addonAfter="%" clearable :style='{"width":"40%"}'>
<JnpfInput v-model="defaultSettlementRules.underpaymentAmountUpper"
:disabled="true" addonAfter="%" :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('applyForUnderpaymentRatio')">
<el-col :span="8" v-if="dataForm.underpaymentMethod == 2">
<jnpf-form-tip-item label="默认压款比例" v-if="judgeShow('advanceRatio')" prop="advanceRatio">
<JnpfInput v-model="defaultSettlementRules.underpaymentRateDown"
:disabled="true" addonAfter="%" :style='{"width":"40%"}'>
</JnpfInput>
<label></label>
<JnpfInput v-model="defaultSettlementRules.underpaymentRateUpper"
:disabled="true" addonAfter="%" :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('applyForUnderpaymentRatio') && dataForm.underpaymentMethod == 0">
</el-col>
<el-col :span="8" v-if="judgeShow('applyForUnderpaymentRatio') && dataForm.underpaymentMethod == 1">
<jnpf-form-tip-item label="申请压款金额" v-if="judgeShow('applyForUnderpaymentRatio')"
prop="applyForUnderpaymentRatio">
<JnpfInput v-model="dataForm.applyForUnderpaymentRatio"
@ -625,6 +662,15 @@
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('applyForUnderpaymentRatio') && dataForm.underpaymentMethod == 2">
<jnpf-form-tip-item label="申请压款比例" v-if="judgeShow('applyForUnderpaymentRatio')"
prop="applyForUnderpaymentRatio">
<JnpfInput v-model="dataForm.applyForUnderpaymentRatio"
@change="changeData('applyForUnderpaymentRatio',-1)" placeholder="请输入"
:disabled="judgeWrite('applyForUnderpaymentRatio')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('marginMethod')">
<jnpf-form-tip-item label="保证金方式" v-if="judgeShow('marginMethod')" prop="marginMethod">
<JnpfRadio v-model="dataForm.marginMethod" @change="changeData('marginMethod',-1)"
@ -633,19 +679,41 @@
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('underpaymentMethod')">
<el-col :span="8" v-if="dataForm.marginMethod == 0">
</el-col>
<el-col :span="8" v-if="dataForm.marginMethod == 1">
<jnpf-form-tip-item label="默认保证金额" v-if="judgeShow('advanceRatio')" prop="advanceRatio">
<JnpfInput v-model="dataForm.advanceRatio" @change="changeData('advanceRatio',-1)" placeholder="请输入"
:disabled="judgeWrite('advanceRatio')" addonAfter="%" clearable :style='{"width":"40%"}'>
<JnpfInput v-model="defaultSettlementRules.marginAmountDown"
:disabled="true" addonAfter="%" :style='{"width":"40%"}'>
</JnpfInput>
<label></label>
<JnpfInput v-model="dataForm.advanceRatio" @change="changeData('advanceRatio',-1)" placeholder="请输入"
:disabled="judgeWrite('advanceRatio')" addonAfter="%" clearable :style='{"width":"40%"}'>
<JnpfInput v-model="defaultSettlementRules.marginAmountUpper"
:disabled="true" addonAfter="%" :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="dataForm.marginMethod == 2">
<jnpf-form-tip-item label="默认保证比例" v-if="judgeShow('advanceRatio')" prop="advanceRatio">
<JnpfInput v-model="defaultSettlementRules.marginRateDown"
:disabled="true" addonAfter="%" :style='{"width":"40%"}'>
</JnpfInput>
<label></label>
<JnpfInput v-model="defaultSettlementRules.marginRateUpper"
:disabled="true" addonAfter="%" :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('applyForMarginRatio') && dataForm.marginMethod == 0">
</el-col>
<el-col :span="8" v-if="judgeShow('applyForMarginRatio') && dataForm.marginMethod == 1">
<jnpf-form-tip-item label="申请保证金额" v-if="judgeShow('applyForMarginRatio')" prop="applyForMarginRatio">
<JnpfInput v-model="dataForm.applyForMarginRatio" @change="changeData('applyForMarginRatio',-1)"
placeholder="请输入" :disabled="judgeWrite('applyForMarginRatio')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('applyForMarginRatio')">
<jnpf-form-tip-item label="申请保证金额/比例" v-if="judgeShow('applyForMarginRatio')" prop="applyForMarginRatio">
<el-col :span="8" v-if="judgeShow('applyForMarginRatio') && dataForm.marginMethod == 2">
<jnpf-form-tip-item label="申请保证比例" v-if="judgeShow('applyForMarginRatio')" prop="applyForMarginRatio">
<JnpfInput v-model="dataForm.applyForMarginRatio" @change="changeData('applyForMarginRatio',-1)"
placeholder="请输入" :disabled="judgeWrite('applyForMarginRatio')" clearable :style='{"width":"100%"}'>
</JnpfInput>
@ -660,19 +728,41 @@
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('underpaymentMethod')">
<jnpf-form-tip-item label="默认预期利率" v-if="judgeShow('advanceRatio')" prop="advanceRatio">
<JnpfInput v-model="dataForm.advanceRatio" @change="changeData('advanceRatio',-1)" placeholder="请输入"
:disabled="judgeWrite('advanceRatio')" addonAfter="%" clearable :style='{"width":"40%"}'>
<el-col :span="8" v-if="dataForm.overdueInterestRate == 0">
</el-col>
<el-col :span="8" v-if="dataForm.overdueInterestRate == 1">
<jnpf-form-tip-item label="默认逾期年化利率" v-if="judgeShow('advanceRatio')" prop="advanceRatio">
<JnpfInput v-model="defaultSettlementRules.overdueAnnualizedDown"
:disabled="true" addonAfter="%" :style='{"width":"40%"}'>
</JnpfInput>
<label></label>
<JnpfInput v-model="dataForm.advanceRatio" @change="changeData('advanceRatio',-1)" placeholder="请输入"
:disabled="judgeWrite('advanceRatio')" addonAfter="%" clearable :style='{"width":"40%"}'>
<JnpfInput v-model="defaultSettlementRules.overdueAnnualizedUpper"
:disabled="true" addonAfter="%" :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="dataForm.overdueInterestRate == 2">
<jnpf-form-tip-item label="默认逾期月化利率" v-if="judgeShow('advanceRatio')" prop="advanceRatio">
<JnpfInput v-model="defaultSettlementRules.overdueMonthlyDown"
:disabled="true" addonAfter="%" :style='{"width":"40%"}'>
</JnpfInput>
<label></label>
<JnpfInput v-model="defaultSettlementRules.overdueMonthlyUpper"
:disabled="true" addonAfter="%" :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('applyForOverdueRatio')">
<jnpf-form-tip-item label="申请逾期利率" v-if="judgeShow('applyForOverdueRatio')" prop="applyForOverdueRatio">
<el-col :span="8" v-if="judgeShow('applyForOverdueRatio') && dataForm.overdueInterestRate == 0">
</el-col>
<el-col :span="8" v-if="judgeShow('applyForOverdueRatio') && dataForm.overdueInterestRate == 1">
<jnpf-form-tip-item label="申请逾期年化利率" v-if="judgeShow('applyForOverdueRatio')" prop="applyForOverdueRatio">
<JnpfInput v-model="dataForm.applyForOverdueRatio" @change="changeData('applyForOverdueRatio',-1)"
placeholder="请输入" :disabled="judgeWrite('applyForOverdueRatio')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('applyForOverdueRatio') && dataForm.overdueInterestRate == 2">
<jnpf-form-tip-item label="申请逾期月化利率" v-if="judgeShow('applyForOverdueRatio')" prop="applyForOverdueRatio">
<JnpfInput v-model="dataForm.applyForOverdueRatio" @change="changeData('applyForOverdueRatio',-1)"
placeholder="请输入" :disabled="judgeWrite('applyForOverdueRatio')" clearable :style='{"width":"100%"}'>
</JnpfInput>
@ -1132,7 +1222,7 @@
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import {
queryDefaultSettlementRules
queryDefaultSettlementRules, queryDefaultAccountPeriodRules
} from '@/api/extend/scm'
import {
getDefaultCurrentValueUserId
@ -1156,6 +1246,9 @@
props: [],
data() {
return {
defaultSettlementRules: {},
defaultAccountPeriodRules: [],
defaultAccountPeriod: {},
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
@ -2329,12 +2422,24 @@
},
getDefaultSettlementRules() {
queryDefaultSettlementRules('1').then(res => {
debugger
this.defaultSettlementRules = res.data
})
},
getDefaultAccountPeriodRules() {
getDictionaryDataSelector('9b542177a477488994ce09fff3c93901').then(res => {
this.enterpriseNatureOptions = res.data.list
queryDefaultAccountPeriodRules('1').then(res => {
this.defaultAccountPeriodRules = res.data.tableField102
var customerStarRating = this.dataForm.customerStarRating
if(this.dataForm.customerStarRating == '517682428312028165'){
this.defaultAccountPeriod = res.data.tableField102[0]
}else if(this.dataForm.customerStarRating == '517682463938446341'){
this.defaultAccountPeriod = res.data.tableField102[1]
}else if(this.dataForm.customerStarRating == '517682488533844997'){
this.defaultAccountPeriod = res.data.tableField102[2]
}else if(this.dataForm.customerStarRating == '517682518925771781'){
this.defaultAccountPeriod = res.data.tableField102[3]
}else if(this.dataForm.customerStarRating == '517682574965867525'){
this.defaultAccountPeriod = res.data.tableField102[4]
}
})
},

Loading…
Cancel
Save