Browse Source

Merge remote-tracking branch 'origin/master'

master
dimengzhe 1 year ago
parent
commit
bbefa11a63
  1. 2
      anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finuncollectedreceivablesdetailedjr/FinUncollectedReceivablesDetailedJR.java
  2. 1
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java
  3. 4
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finuncollectedreceivablesdetailedjr/FinUncollectedReceivablesDetailedJRService.java
  4. 4
      anrui-riskcenter-ui/src/views/collectionmeasures/collectionmeasures.vue
  5. 7
      anrui-riskcenter-ui/src/views/collectionmeasures/collectionmeasuresAdd.vue
  6. 7
      anrui-riskcenter-ui/src/views/collectionmeasures/collectionmeasuresInfo.vue
  7. 2
      anrui-riskcenter-ui/src/views/overduevehicle/overduevehicle.vue
  8. 2
      anrui-riskcenter-ui/src/views/overduevehicle/overduevehicleByRisk.vue
  9. 6
      anrui-riskcenter-ui/src/views/workFlow/cuishoucuoshiFlow/collectionmeasuresDaiBan.vue
  10. 6
      anrui-riskcenter-ui/src/views/workFlow/cuishoucuoshiFlow/collectionmeasuresEdit.vue
  11. 6
      anrui-riskcenter-ui/src/views/workFlow/cuishoucuoshiFlow/collectionmeasuresYiBan.vue
  12. 77
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymenthistory/LoanRepaymentHistoryService.java
  13. 6
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymentplandetails/LoanRepaymentPlanDetailsMapper.java
  14. 221
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymentplandetails/LoanRepaymentPlanDetailsMapper.xml
  15. 12
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymentplandetails/LoanRepaymentPlanDetailsService.java
  16. 99
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymentschedule/LoanRepaymentScheduleService.java
  17. 12
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanwarrantinformation/LoanWarrantInformationService.java

2
anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finuncollectedreceivablesdetailedjr/FinUncollectedReceivablesDetailedJR.java

@ -63,7 +63,7 @@ public class FinUncollectedReceivablesDetailedJR extends BaseEntity {
@ApiModelProperty("款项名称value") @ApiModelProperty("款项名称value")
private String payCostTitleValue; private String payCostTitleValue;
@ApiModelProperty("应收金额(不变)") @ApiModelProperty("应收金额(不变)")
private String reveivableMoney; private BigDecimal reveivableMoney;
@ApiModelProperty("当前应收金额") @ApiModelProperty("当前应收金额")
private BigDecimal currentReceivableMoney; // 当前应收金额 private BigDecimal currentReceivableMoney; // 当前应收金额
@ApiModelProperty("认款状态") @ApiModelProperty("认款状态")

1
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java

@ -3771,6 +3771,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
jr.setCreateByName(userVo.getName()); jr.setCreateByName(userVo.getName());
jr.setBusSid(planSid); jr.setBusSid(planSid);
jr.setCurrentReceivableMoney(new BigDecimal(v.getSubscriptionMoney())); jr.setCurrentReceivableMoney(new BigDecimal(v.getSubscriptionMoney()));
jr.setReveivableMoney(new BigDecimal(v.getSubscriptionMoney()));
jr.setPayCostTitleKey("007"); jr.setPayCostTitleKey("007");
jr.setPayCostTitleValue("资方退还垫款"); jr.setPayCostTitleValue("资方退还垫款");
jr.setOrgSidPath(planDetails.getOrgSidPath()); jr.setOrgSidPath(planDetails.getOrgSidPath());

4
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finuncollectedreceivablesdetailedjr/FinUncollectedReceivablesDetailedJRService.java

@ -135,8 +135,8 @@ public class FinUncollectedReceivablesDetailedJRService extends MybatisBaseServi
public ResultBean updateAll(String sid, String type, BigDecimal fundDay) { public ResultBean updateAll(String sid, String type, BigDecimal fundDay) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
FinUncollectedReceivablesDetailedJR finUncollectedReceivablesDetailedJR = baseMapper.selectByType(sid, type); FinUncollectedReceivablesDetailedJR finUncollectedReceivablesDetailedJR = baseMapper.selectByType(sid, type);
BigDecimal bigDecimal = new BigDecimal(finUncollectedReceivablesDetailedJR.getReveivableMoney()).add(fundDay); BigDecimal bigDecimal =finUncollectedReceivablesDetailedJR.getReveivableMoney().add(fundDay);
finUncollectedReceivablesDetailedJR.setReveivableMoney(bigDecimal.toString()); finUncollectedReceivablesDetailedJR.setReveivableMoney(bigDecimal);
baseMapper.updateById(finUncollectedReceivablesDetailedJR); baseMapper.updateById(finUncollectedReceivablesDetailedJR);
return rb.success(); return rb.success();
} }

4
anrui-riskcenter-ui/src/views/collectionmeasures/collectionmeasures.vue

@ -103,9 +103,9 @@
<!--End查询列表部分--> <!--End查询列表部分-->
</div> </div>
</div> </div>
<!--款项结转新增及修改 --> <!--新增及修改 -->
<collectionmeasuresAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList"/> <collectionmeasuresAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList"/>
<!--款项结转申请详情--> <!--详情-->
<collectionmeasuresInfo v-show="viewState == 4" ref="divInfo" @doback="resetState" /> <collectionmeasuresInfo v-show="viewState == 4" ref="divInfo" @doback="resetState" />
<!-- 流程审批记录 --> <!-- 流程审批记录 -->
<el-dialog title="" :visible.sync="centerDialogVisible" width="78%" height="1%" :before-close="closeIt" center> <el-dialog title="" :visible.sync="centerDialogVisible" width="78%" height="1%" :before-close="closeIt" center>

7
anrui-riskcenter-ui/src/views/collectionmeasures/collectionmeasuresAdd.vue

@ -90,6 +90,11 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-row v-if="formobj.lockCarRemarks !== '' && yckzVisible">
<el-col :span="24">
<span style="color: red;font-weight: bold">{{ formobj.lockCarRemarks }}</span>
</el-col>
</el-row>
</el-form> </el-form>
</div> </div>
</div> </div>
@ -176,6 +181,7 @@ export default {
deptSid: '', deptSid: '',
files: [], files: [],
loanBeCollectionVehDetails: [], loanBeCollectionVehDetails: [],
lockCarRemarks: '',
nodeSid: '', nodeSid: '',
nodeState: '', nodeState: '',
orgPath: '', orgPath: '',
@ -346,6 +352,7 @@ export default {
deptSid: '', deptSid: '',
files: [], files: [],
loanBeCollectionVehDetails: [], loanBeCollectionVehDetails: [],
lockCarRemarks: '',
nodeSid: '', nodeSid: '',
nodeState: '', nodeState: '',
orgPath: '', orgPath: '',

7
anrui-riskcenter-ui/src/views/collectionmeasures/collectionmeasuresInfo.vue

@ -85,6 +85,11 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-row v-if="formobj.lockCarRemarks !== '' && yckzVisible">
<el-col :span="24">
<span style="color: red;font-weight: bold">{{ formobj.lockCarRemarks }}</span>
</el-col>
</el-row>
</el-form> </el-form>
</div> </div>
</div> </div>
@ -156,6 +161,7 @@ export default {
deptSid: '', deptSid: '',
files: [], files: [],
loanBeCollectionVehDetails: [], loanBeCollectionVehDetails: [],
lockCarRemarks: '',
nodeSid: '', nodeSid: '',
nodeState: '', nodeState: '',
orgPath: '', orgPath: '',
@ -286,6 +292,7 @@ export default {
deptSid: '', deptSid: '',
files: [], files: [],
loanBeCollectionVehDetails: [], loanBeCollectionVehDetails: [],
lockCarRemarks: '',
nodeSid: '', nodeSid: '',
nodeState: '', nodeState: '',
orgPath: '', orgPath: '',

2
anrui-riskcenter-ui/src/views/overduevehicle/overduevehicle.vue

@ -48,7 +48,7 @@
<el-input v-model="listQuery.params.riskStaffName" placeholder="" clearable/> <el-input v-model="listQuery.params.riskStaffName" placeholder="" clearable/>
</el-form-item> </el-form-item>
<el-form-item label="远程控制状态"> <el-form-item label="远程控制状态">
<el-select v-model="istQuery.params.lockCarState" clearable placeholder="请选择" filterable> <el-select v-model="listQuery.params.lockCarState" clearable placeholder="请选择" filterable>
<el-option v-for="item in lockCarState_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"> <el-option v-for="item in lockCarState_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey">
</el-option> </el-option>
</el-select> </el-select>

2
anrui-riskcenter-ui/src/views/overduevehicle/overduevehicleByRisk.vue

@ -48,7 +48,7 @@
<el-input v-model="listQuery.params.riskStaffName" placeholder="" clearable/> <el-input v-model="listQuery.params.riskStaffName" placeholder="" clearable/>
</el-form-item> </el-form-item>
<el-form-item label="远程控制状态"> <el-form-item label="远程控制状态">
<el-select v-model="istQuery.params.lockCarState" clearable placeholder="请选择" filterable> <el-select v-model="listQuery.params.lockCarState" clearable placeholder="请选择" filterable>
<el-option v-for="item in lockCarState_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"> <el-option v-for="item in lockCarState_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey">
</el-option> </el-option>
</el-select> </el-select>

6
anrui-riskcenter-ui/src/views/workFlow/cuishoucuoshiFlow/collectionmeasuresDaiBan.vue

@ -83,6 +83,11 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-row v-if="formobj.lockCarRemarks !== '' && yckzVisible">
<el-col :span="24">
<span style="color: red;font-weight: bold">{{ formobj.lockCarRemarks }}</span>
</el-col>
</el-row>
</el-form> </el-form>
</div> </div>
</div> </div>
@ -187,6 +192,7 @@ export default {
deptSid: '', deptSid: '',
files: [], files: [],
loanBeCollectionVehDetails: [], loanBeCollectionVehDetails: [],
lockCarRemarks: '',
nodeSid: '', nodeSid: '',
nodeState: '', nodeState: '',
orgPath: '', orgPath: '',

6
anrui-riskcenter-ui/src/views/workFlow/cuishoucuoshiFlow/collectionmeasuresEdit.vue

@ -89,6 +89,11 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-row v-if="formobj.lockCarRemarks !== '' && yckzVisible">
<el-col :span="24">
<span style="color: red;font-weight: bold">{{ formobj.lockCarRemarks }}</span>
</el-col>
</el-row>
</el-form> </el-form>
</div> </div>
</div> </div>
@ -175,6 +180,7 @@ export default {
deptSid: '', deptSid: '',
files: [], files: [],
loanBeCollectionVehDetails: [], loanBeCollectionVehDetails: [],
lockCarRemarks: '',
nodeSid: '', nodeSid: '',
nodeState: '', nodeState: '',
orgPath: '', orgPath: '',

6
anrui-riskcenter-ui/src/views/workFlow/cuishoucuoshiFlow/collectionmeasuresYiBan.vue

@ -80,6 +80,11 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-row v-if="formobj.lockCarRemarks !== '' && yckzVisible">
<el-col :span="24">
<span style="color: red;font-weight: bold">{{ formobj.lockCarRemarks }}</span>
</el-col>
</el-row>
</el-form> </el-form>
</div> </div>
</div> </div>
@ -147,6 +152,7 @@ export default {
deptSid: '', deptSid: '',
files: [], files: [],
loanBeCollectionVehDetails: [], loanBeCollectionVehDetails: [],
lockCarRemarks: '',
nodeSid: '', nodeSid: '',
nodeState: '', nodeState: '',
orgPath: '', orgPath: '',

77
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymenthistory/LoanRepaymentHistoryService.java

@ -201,26 +201,14 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen
} }
} }
} catch (Exception e) { } catch (Exception e) {
if (StringUtils.isBlank(trim)) { if (StringUtils.isNotBlank(trim)) {
String word = new String(); if (i == 2) {
switch (i) { checkWord.add("请导入正确的日期格式,如:2024-01-01");
case 0: importVo.setRealReturnTime("error");
word = "资方合同号"; continue;
break;
case 1:
word = "期数";
break;
case 2:
word = "实还日期";
break;
case 3:
word = "实还金额";
break;
default:
break;
} }
// String checkResult = "第" + (r + 1) + "行" + word + "为空"; }
// sb.append(checkResult).append(";"); if (StringUtils.isBlank(trim)) {
continue; continue;
} }
} }
@ -241,7 +229,7 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen
try { try {
sdf.parse(excelInfo.getRealReturnTime()); sdf.parse(excelInfo.getRealReturnTime());
} catch (ParseException e) { } catch (ParseException e) {
checkWord.add("请导入正确的日期格式,如:2023-01-01"); checkWord.add("请导入正确的日期格式,如:2024-01-01");
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -648,34 +636,28 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen
List<LoanRepaymentPlanDetails> planDetails = loanRepaymentPlanDetailsService.selPlanByNoAndPeriod(repaymentExcelInfo.getBankContractNo(), repaymentExcelInfo.getPeriod()); List<LoanRepaymentPlanDetails> planDetails = loanRepaymentPlanDetailsService.selPlanByNoAndPeriod(repaymentExcelInfo.getBankContractNo(), repaymentExcelInfo.getPeriod());
if (!planDetails.isEmpty()) { if (!planDetails.isEmpty()) {
for (LoanRepaymentPlanDetails planDetail : planDetails) { for (LoanRepaymentPlanDetails planDetail : planDetails) {
LoanRepaymentHistory repaymentHistory = new LoanRepaymentHistory(); String check = loanRepaymentPlanDetailsService.InsertForCheckPaymentAndBank(planDetail.getSid());
repaymentHistory.setBuckle("未申请"); if (StringUtils.isNotBlank(check)) {
repaymentHistory.setBuckleKey("001"); if (!check.equals("0")) {
repaymentHistory.setScheduleSid(planDetail.getScheduleSid()); LoanRepaymentHistory repaymentHistory = new LoanRepaymentHistory();
repaymentHistory.setPlanDetailSid(planDetail.getSid()); repaymentHistory.setBuckle("未申请");
repaymentHistory.setReturnWay("直还"); repaymentHistory.setBuckleKey("001");
repaymentHistory.setReturnWayKey("01"); repaymentHistory.setScheduleSid(planDetail.getScheduleSid());
try { repaymentHistory.setPlanDetailSid(planDetail.getSid());
repaymentHistory.setActualDate(sdf.parse(repaymentExcelInfo.getRealReturnTime())); repaymentHistory.setReturnWay("直还");
} catch (ParseException e) { repaymentHistory.setReturnWayKey("01");
e.printStackTrace(); try {
repaymentHistory.setActualDate(sdf.parse(repaymentExcelInfo.getRealReturnTime()));
} catch (ParseException e) {
e.printStackTrace();
}
BigDecimal realMoney = new BigDecimal(repaymentExcelInfo.getRealMoney());
BigDecimal divide = realMoney.divide(new BigDecimal(planDetails.size()), 2, BigDecimal.ROUND_HALF_UP);
repaymentHistory.setActualMoney(divide);
repaymentHistory.setDataTime(new DateTime());
baseMapper.insert(repaymentHistory);
}
} }
BigDecimal realMoney = new BigDecimal(repaymentExcelInfo.getRealMoney());
BigDecimal divide = realMoney.divide(new BigDecimal(planDetails.size()), 2, BigDecimal.ROUND_HALF_UP);
repaymentHistory.setActualMoney(divide);
repaymentHistory.setDataTime(new DateTime());
// List<LoanRepaymentHistory> histories = baseMapper.selHistoryByPlanSid(planDetail.getSid());
// BigDecimal returned = new BigDecimal(0);
// if (!histories.isEmpty()) {
// for (LoanRepaymentHistory history : histories) {
// returned = history.getActualMoney().add(returned);
// }
// }
// BigDecimal decimal = returned.add(divide);
// BigDecimal dueMoney = planDetail.getDueMoney();
// BigDecimal subtract = dueMoney.subtract(decimal);
// repaymentHistory.setOutstandingMoney(subtract);
baseMapper.insert(repaymentHistory);
} }
} }
} }
@ -800,6 +782,7 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen
FinUncollectedReceivablesDetailedJR jr = new FinUncollectedReceivablesDetailedJR(); FinUncollectedReceivablesDetailedJR jr = new FinUncollectedReceivablesDetailedJR();
jr.setBusSid(planDetails.getSid()); jr.setBusSid(planDetails.getSid());
jr.setCurrentReceivableMoney(amount); jr.setCurrentReceivableMoney(amount);
jr.setReveivableMoney(amount);
jr.setPayCostTitleKey("007"); jr.setPayCostTitleKey("007");
jr.setPayCostTitleValue("资方退还垫款"); jr.setPayCostTitleValue("资方退还垫款");
jr.setOrgSidPath(planDetails.getOrgSidPath()); jr.setOrgSidPath(planDetails.getOrgSidPath());

6
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymentplandetails/LoanRepaymentPlanDetailsMapper.java

@ -50,4 +50,10 @@ public interface LoanRepaymentPlanDetailsMapper extends BaseMapper<LoanRepayment
String reAdvancesOrPaymentMoney(@Param("pSid") String pSid); String reAdvancesOrPaymentMoney(@Param("pSid") String pSid);
DifferenceVo selDifference(@Param("pSid") String pSid); DifferenceVo selDifference(@Param("pSid") String pSid);
String InsertForCheckPaymentAndBank(@Param("sid") String sid);
int saveVehMark(@Param("busVinSid") String busVinSid,@Param("vehMark") String vehMark);
List<LoanRepaymentPlanDetails> getListByBusVinSid(@Param("busVinSid") String busVinSid);
} }

221
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymentplandetails/LoanRepaymentPlanDetailsMapper.xml

@ -15,6 +15,11 @@
#{planSid} #{planSid}
</foreach> </foreach>
</update> </update>
<update id="saveVehMark">
UPDATE loan_repayment_plan_details
SET vehMark = #{vehMark}
WHERE busVinSid = #{busVinSid}
</update>
<delete id="deletePlanDetails"> <delete id="deletePlanDetails">
DELETE DELETE
FROM loan_repayment_plan_details FROM loan_repayment_plan_details
@ -117,129 +122,125 @@
where paymentMoney > 0 where paymentMoney > 0
</select> </select>
<select id="overDueVoList" resultType="com.yxt.anrui.riskcenter.api.loanrepaymenthistory.HistoryOverDueVo"> <select id="overDueVoList" resultType="com.yxt.anrui.riskcenter.api.loanrepaymenthistory.HistoryOverDueVo">
SELECT SELECT b.sid as planSid,
b.sid as planSid, CASE
CASE WHEN (b.outstandingMoney + b.bankBeInter + b.fund) &gt; 0 THEN
WHEN ( b.outstandingMoney + b.bankBeInter + b.fund ) &gt; 0 THEN '0'
'0' WHEN (b.outstandingMoney + b.bankBeInter + b.fund) &lt;= 0 THEN
WHEN ( b.outstandingMoney + b.bankBeInter + b.fund ) &lt;= 0 THEN '1'
'1' END AS overdueState
END AS overdueState FROM (
FROM SELECT a.*
( FROM (
SELECT SELECT pd.dueDate,
a.* pd.useOrgSid,
FROM pd.sid,
( IFNULL(pd.fund, 0) AS fund,
SELECT pd.dueMoney,
pd.dueDate, pd.overdue,
pd.useOrgSid, t.repaidMoney,
pd.sid, t.outstandingMoney,
IFNULL( pd.fund, 0 ) AS fund, IFNULL(v.bankBeInter, 0) AS bankBeInter,
pd.dueMoney, pd.overdue AS dueOverdue,
pd.overdue, pd.updateTime AS updateDate
t.repaidMoney, FROM loan_repayment_plan_details AS pd
t.outstandingMoney, LEFT JOIN anrui_buscenter.bus_sales_order AS s ON s.sid = pd.salesOrderSid
IFNULL( v.bankBeInter, 0 ) AS bankBeInter, LEFT JOIN loan_be_padsincere_veh AS v ON v.saleVehSid = pd.busVinSid
pd.overdue AS dueOverdue, LEFT JOIN (
pd.updateTime AS updateDate SELECT p.sid,
FROM IFNULL((
loan_repayment_plan_details AS pd SELECT SUM(
LEFT JOIN anrui_buscenter.bus_sales_order AS s ON s.sid = pd.salesOrderSid IFNULL(h.actualMoney, 0))
LEFT JOIN loan_be_padsincere_veh AS v ON v.saleVehSid = pd.busVinSid FROM loan_repayment_history AS h
LEFT JOIN ( WHERE h.planDetailSid = p.sid
SELECT AND h.updateState = '1'
p.sid, ),
IFNULL(( 0
SELECT ) AS repaidMoney,
SUM( IFNULL(
IFNULL( h.actualMoney, 0 )) (
FROM p.dueMoney - IFNULL((
loan_repayment_history AS h SELECT SUM(
WHERE IFNULL(h.actualMoney, 0))
h.planDetailSid = p.sid FROM loan_repayment_history AS h
AND h.updateState = '1' WHERE h.planDetailSid = p.sid
), AND h.updateState = '1'
0 ),
) AS repaidMoney, 0
IFNULL( )),
( 0
p.dueMoney - IFNULL(( ) AS outstandingMoney
SELECT FROM loan_repayment_plan_details AS p
SUM( ) AS t ON pd.sid = t.sid
IFNULL( h.actualMoney, 0 )) ) AS a
FROM WHERE a.dueDate &lt;= a.updateDate
loan_repayment_history AS h AND a.overdue = 1
WHERE and a.useOrgSid = #{useOrgSid}
h.planDetailSid = p.sid ) AS b
AND h.updateState = '1'
),
0
)),
0
) AS outstandingMoney
FROM
loan_repayment_plan_details AS p
) AS t ON pd.sid = t.sid
) AS a
WHERE
a.dueDate &lt;= a.updateDate
AND a.overdue = 1
and a.useOrgSid = #{useOrgSid}
) AS b
</select> </select>
<select id="reAdvancesOrPaymentMoney" resultType="java.lang.String"> <select id="reAdvancesOrPaymentMoney" resultType="java.lang.String">
SELECT SELECT CASE
CASE WHEN p.paymentMoney > 0
WHEN p.paymentMoney > 0 AND b.reAdvances = 1
AND b.reAdvances = 1 THEN
THEN '0'
'0' ELSE '1'
ELSE '1' END as h
END as h FROM loan_repayment_plan_details as p
FROM LEFT JOIN loan_solutions as s ON p.salesOrderSid = s.salesOrderSid
loan_repayment_plan_details as p LEFT JOIN loan_fin_policy as py ON s.policySid = py.sid
LEFT JOIN loan_solutions as s ON p.salesOrderSid = s.salesOrderSid LEFT JOIN loan_fin_bank as b ON b.sid = py.bankSid
LEFT JOIN loan_fin_policy as py ON s.policySid = py.sid where
LEFT JOIN loan_fin_bank as b ON b.sid = py.bankSid s.isDelete = 0
AND s.isDelete = 0 and p.sid = #{pSid}
and p.sid =#{pSid}
</select> </select>
<select id="selDifference" resultType="com.yxt.anrui.riskcenter.api.loanrepaymenthistory.DifferenceVo"> <select id="selDifference" resultType="com.yxt.anrui.riskcenter.api.loanrepaymenthistory.DifferenceVo">
SELECT SELECT a.*
a.* FROM (
FROM SELECT pd.sid,
( t.difference
SELECT FROM loan_repayment_plan_details AS pd
pd.sid, LEFT JOIN anrui_buscenter.bus_sales_order AS s ON s.sid = pd.salesOrderSid
t.difference LEFT JOIN loan_be_padsincere_veh AS v ON v.saleVehSid = pd.busVinSid
FROM LEFT JOIN (
loan_repayment_plan_details AS pd SELECT p.sid,
LEFT JOIN anrui_buscenter.bus_sales_order AS s ON s.sid = pd.salesOrderSid
LEFT JOIN loan_be_padsincere_veh AS v ON v.saleVehSid = pd.busVinSid
LEFT JOIN (
SELECT
p.sid,
IFNULL( IFNULL(
( (
p.dueMoney - IFNULL(( p.dueMoney - IFNULL((
SELECT SELECT SUM(
SUM( IFNULL(h.actualMoney, 0))
IFNULL( h.actualMoney, 0 )) FROM loan_repayment_history AS h
FROM WHERE h.planDetailSid = p.sid
loan_repayment_history AS h
WHERE
h.planDetailSid = p.sid
AND h.updateState = '1' AND h.updateState = '1'
), ),
0 0
)), )),
0 0
) AS difference ) AS difference
FROM FROM loan_repayment_plan_details AS p
loan_repayment_plan_details AS p ) AS t ON pd.sid = t.sid
) AS t ON pd.sid = t.sid ) AS a
) AS a
WHERE a.sid = #{pSid} WHERE a.sid = #{pSid}
</select> </select>
<select id="InsertForCheckPaymentAndBank" resultType="java.lang.String">
SELECT
CASE
WHEN
IFNULL(p.paymentMoney,0) > 0
AND b.reAdvances = 0 THEN
'0' ELSE '1'
END AS h
FROM
loan_repayment_plan_details AS p
LEFT JOIN loan_solutions AS s ON p.salesOrderSid = s.salesOrderSid
LEFT JOIN loan_fin_policy AS py ON s.policySid = py.sid
LEFT JOIN loan_fin_bank AS b ON b.sid = py.bankSid
WHERE
p.sid = #{sid}
AND s.isDelete = 0
</select>
<select id="getListByBusVinSid"
resultType="com.yxt.anrui.riskcenter.api.loanrepaymentplandetails.LoanRepaymentPlanDetails">
select * from loan_repayment_plan_details where busVinSid =#{busVinSid}
</select>
</mapper> </mapper>

12
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymentplandetails/LoanRepaymentPlanDetailsService.java

@ -133,4 +133,16 @@ public class LoanRepaymentPlanDetailsService extends MybatisBaseService<LoanRepa
public DifferenceVo selDifference(String pSid) { public DifferenceVo selDifference(String pSid) {
return baseMapper.selDifference(pSid); return baseMapper.selDifference(pSid);
} }
public String InsertForCheckPaymentAndBank(String sid) {
return baseMapper.InsertForCheckPaymentAndBank(sid);
}
public int saveVehMark(String busVinSid,String vehMark) {
return baseMapper.saveVehMark(busVinSid,vehMark);
}
public List<LoanRepaymentPlanDetails> getListByBusVinSid(String busVinSid) {
return baseMapper.getListByBusVinSid(busVinSid);
}
} }

99
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymentschedule/LoanRepaymentScheduleService.java

@ -321,6 +321,17 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme
if (StringUtils.isNotBlank(dto.getOtherBankNo())) { if (StringUtils.isNotBlank(dto.getOtherBankNo())) {
loanRepaymentSchedule.setOtherBankNo(dto.getOtherBankNo()); loanRepaymentSchedule.setOtherBankNo(dto.getOtherBankNo());
} }
List<String> repayDate = returnRepayDate(dto.getMainRepayDate(), dto.getMainPeriod());
if (!repayDate.isEmpty()) {
String lastDate = repayDate.get(repayDate.size() - 1);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
Date date = sdf.parse(lastDate);
loanRepaymentSchedule.setMainLastDate(date);
} catch (ParseException e) {
e.printStackTrace();
}
}
baseMapper.updateById(loanRepaymentSchedule); baseMapper.updateById(loanRepaymentSchedule);
loanRepaymentPlanDetailsService.deletePlanDetails(loanRepaymentSchedule.getSid()); loanRepaymentPlanDetailsService.deletePlanDetails(loanRepaymentSchedule.getSid());
BusSalesOrder busSalesOrder = busSalesOrderFeign.fetchBySid(orderSid).getData(); BusSalesOrder busSalesOrder = busSalesOrderFeign.fetchBySid(orderSid).getData();
@ -620,7 +631,7 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme
} else if (i == Integer.parseInt(otherPeriod) - 1) { } else if (i == Integer.parseInt(otherPeriod) - 1) {
otherRepay = new BigDecimal(otherLastPay); otherRepay = new BigDecimal(otherLastPay);
} else if (i < Integer.parseInt(otherPeriod) - 1) { } else if (i < Integer.parseInt(otherPeriod) - 1) {
otherRepay = new BigDecimal(otherLastPay); otherRepay = new BigDecimal(otherMidPay);
} }
if (i == 0) { if (i == 0) {
BigDecimal mainF = new BigDecimal(mainFirstRepay); BigDecimal mainF = new BigDecimal(mainFirstRepay);
@ -1005,7 +1016,7 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme
} else if (i == Integer.parseInt(otherPeriod) - 1) { } else if (i == Integer.parseInt(otherPeriod) - 1) {
otherRepay = new BigDecimal(otherLastPay); otherRepay = new BigDecimal(otherLastPay);
} else if (i > 0 && i < Integer.parseInt(otherPeriod) - 1) { } else if (i > 0 && i < Integer.parseInt(otherPeriod) - 1) {
otherRepay = new BigDecimal(otherLastPay); otherRepay = new BigDecimal(otherMidPay);
} }
if (i == 0) { if (i == 0) {
BigDecimal mainF = new BigDecimal(mainFirstRepay); BigDecimal mainF = new BigDecimal(mainFirstRepay);
@ -1607,89 +1618,7 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme
return rb.success().setData(vo); return rb.success().setData(vo);
} }
/**
* 还款计划表多台回显
*
* @param salesOrderSid
* @return
*/
// public ResultBean<LoanCreateScheduleVinsVo> viewVinsSchedule2(String salesOrderSid) {
// ResultBean<LoanCreateScheduleVinsVo> rb = ResultBean.fireFail();
// LoanCreateScheduleVinsVo vo = new LoanCreateScheduleVinsVo();
// BusSalesOrderLoancontractDetailsVo loancontract = busSalesOrderLoancontractFeign.fetchDetailsBySid(salesOrderSid).getData();
// if (null != loancontract) {
// if (StringUtils.isNotBlank(loancontract.getBankName())) {
// vo.setBankName(loancontract.getBankName());
// }
// if (null != loancontract.getVehCount()) {
// vo.setVehCount(String.valueOf(loancontract.getVehCount()));
// }
// if (StringUtils.isNotBlank(loancontract.getLoanContractNo())) {
// vo.setLoanContractNo(loancontract.getLoanContractNo());
// }
// if (StringUtils.isNotBlank(loancontract.getBorrowerName())) {
// vo.setBorrowerName(loancontract.getBorrowerName());
// }
// LoanRepaymentSchedule schedule = baseMapper.selByLoanContractSid(salesOrderSid);
// if (null != schedule) {
// if (StringUtils.isNotBlank(schedule.getIsOtherPolicy())) {
// vo.setIsOtherPolicy(schedule.getIsOtherPolicy());
// }
// if (null != schedule.getMainRepayDate()) {
// mainDate = sdf.format(schedule.getMainRepayDate());
// }
// if (null != schedule.getOtherRepayDate()) {
// otherDate = sdf.format(schedule.getOtherRepayDate());
// }
// //主产品月还日
// if (StringUtils.isNotBlank(mainDate)) {
// String[] splitMainDate = mainDate.split("-");
// String day = splitMainDate[2];
// if (day.length() == 2 && Integer.parseInt(day) >= 10) {
// vo.setMainRepayDate(day);
// } else {
// vo.setMainRepayDate(day.replace("0", ""));
// }
// }
// //其他融月还日
// if (StringUtils.isNotBlank(otherDate)) {
// String[] splitOtherDate = otherDate.split("-");
// String day = splitOtherDate[2];
// if (day.length() == 2 && Integer.parseInt(day) >= 10) {
// vo.setOtherRepayDate(day);
// } else {
// vo.setOtherRepayDate(day.replace("0", ""));
// }
// }
// }
// List<BusSalesOrderVehicle> busSalesOrderVehicles = busSalesOrderVehicleFeign.selbyContractSid(salesOrderSid).getData();
// busSalesOrderVehicles.removeAll(Collections.singleton(null));
// if (!busSalesOrderVehicles.isEmpty()) {
// List<String> stringVinNos = busSalesOrderVehicles.stream().map(c -> c.getLinkNo()).collect(Collectors.toList());
// if (!stringVinNos.isEmpty()) {
// List<String> vinList = new ArrayList<>();
// for (String linkNo : stringVinNos) {
// String vinNo = "";
// if (linkNo.length() > 8) {
// vinNo = linkNo.substring(linkNo.length() - 8);
//
// } else {
// vinNo = linkNo;
// }
// vinList.add(vinNo);
// }
// vo.setVinNo(String.join(",", vinList));
// }
// for (BusSalesOrderVehicle busSalesOrderVehicle : busSalesOrderVehicles) {
//
//
//
// }
// }
// }
// vo.setSalesOrderSid(salesOrderSid);
// return rb.success().setData(vo);
// }
/** /**
* 生成pdf * 生成pdf
* *

12
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanwarrantinformation/LoanWarrantInformationService.java

@ -22,8 +22,10 @@ import com.yxt.anrui.riskcenter.api.loanmortgageinformationtransact.*;
import com.yxt.anrui.riskcenter.api.loanparameter.LoanParameter; import com.yxt.anrui.riskcenter.api.loanparameter.LoanParameter;
import com.yxt.anrui.riskcenter.api.loanparameter.LoanParameterQuery; import com.yxt.anrui.riskcenter.api.loanparameter.LoanParameterQuery;
import com.yxt.anrui.riskcenter.api.loanparameter.LoanParameterVo; import com.yxt.anrui.riskcenter.api.loanparameter.LoanParameterVo;
import com.yxt.anrui.riskcenter.api.loanrepaymentplandetails.LoanRepaymentPlanDetails;
import com.yxt.anrui.riskcenter.api.loanwarrantinformation.*; import com.yxt.anrui.riskcenter.api.loanwarrantinformation.*;
import com.yxt.anrui.riskcenter.biz.loanfile.LoanFileService; import com.yxt.anrui.riskcenter.biz.loanfile.LoanFileService;
import com.yxt.anrui.riskcenter.biz.loanrepaymentplandetails.LoanRepaymentPlanDetailsService;
import com.yxt.common.base.config.component.FileUploadComponent; import com.yxt.common.base.config.component.FileUploadComponent;
import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.base.utils.PagerUtil; import com.yxt.common.base.utils.PagerUtil;
@ -68,6 +70,8 @@ public class LoanWarrantInformationService extends MybatisBaseService<LoanWarran
private LoanFileService loanFileService; private LoanFileService loanFileService;
@Autowired @Autowired
private FileUploadComponent fileUploadComponent; private FileUploadComponent fileUploadComponent;
@Autowired
private LoanRepaymentPlanDetailsService loanRepaymentPlanDetailsService;
public LoanWarrantInformation fetchByBusVinSid(String busVinSid) { public LoanWarrantInformation fetchByBusVinSid(String busVinSid) {
return baseMapper.fetchByBusVinSid(busVinSid); return baseMapper.fetchByBusVinSid(busVinSid);
@ -270,6 +274,14 @@ public class LoanWarrantInformationService extends MybatisBaseService<LoanWarran
entity.setAuditStateKey("002"); entity.setAuditStateKey("002");
entity.setAuditStateValue("已审核未移交"); entity.setAuditStateValue("已审核未移交");
baseMapper.updateById(entity); baseMapper.updateById(entity);
//维护还款计划表中的车牌号
String busVinSid = entity.getBusVinSid();
if (StringUtils.isNotBlank(entity.getVehicleMark())) {
List<LoanRepaymentPlanDetails> planSids = loanRepaymentPlanDetailsService.getListByBusVinSid(busVinSid);
if (!planSids.isEmpty()) {
int i = loanRepaymentPlanDetailsService.saveVehMark(busVinSid, entity.getVehicleMark());
}
}
} }
return rb.success().setData(dto.getSid()); return rb.success().setData(dto.getSid());
} }

Loading…
Cancel
Save