Commit 3ecea36c authored by 耿迪迪's avatar 耿迪迪

借贷结算-还款

parent b6b0768b
......@@ -115,7 +115,7 @@ public class TDebitCreditController extends BaseController
* @param tDebitCredit 借贷实体
*/
@PostMapping("/settlementDebitCredit")
public AjaxResult settlementDebitCredit(TDebitCredit tDebitCredit){
public AjaxResult settlementDebitCredit(@RequestBody TDebitCredit tDebitCredit){
try{
return toAjax(tDebitCreditService.settlementDebitCredit(tDebitCredit));
}catch (BusinessException e){
......@@ -128,7 +128,7 @@ public class TDebitCreditController extends BaseController
* @param tDebitCredit 借贷实体
*/
@PostMapping("/repayDebitCredit")
public AjaxResult repayDebitCredit(TDebitCredit tDebitCredit){
public AjaxResult repayDebitCredit(@RequestBody TDebitCredit tDebitCredit){
try{
return toAjax(tDebitCreditService.repayDebitCredit(tDebitCredit));
}catch (BusinessException e){
......
......@@ -41,8 +41,8 @@ public class TDebitCredit extends BaseEntity
private Long lendDeptManageId;
/** 登记日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "登记日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "登记日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date registerTime;
/** 使用说明 */
......
......@@ -11,6 +11,7 @@ import com.zehong.system.service.impl.debitCredit.roles.*;
import com.zehong.system.service.impl.debitSettlement.SettlementDebit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
......@@ -151,6 +152,7 @@ public class TDebitCreditServiceImpl implements ITDebitCreditService
* 借贷结算
* @param tDebitCredit 借贷实体
*/
@Transactional(rollbackFor = Exception.class)
public int settlementDebitCredit(TDebitCredit tDebitCredit){
//结算
settlementDebit.settlementDebit(tDebitCredit);
......@@ -162,6 +164,7 @@ public class TDebitCreditServiceImpl implements ITDebitCreditService
* 还款
* @param tDebitCredit 借贷实体
*/
@Transactional(rollbackFor = Exception.class)
public int repayDebitCredit(TDebitCredit tDebitCredit){
//结算
settlementDebit.repayment(tDebitCredit);
......
......@@ -56,7 +56,7 @@ public class SettlementDebit {
this.tDebitCredit = tDebitCredit;
//计算还款日期
long time = tDebitCredit.getExpectedRepaymentDate().getTime() - tDebitCredit.getSumInterestDate().getTime();
int days = Math.round(time / 60 / 60 / 24);
int days = Math.round(time / 1000 / 60 / 60 / 24);
//还款部门
BigDecimal repayAmount = tDebitCredit.getLittleTotal().multiply( new BigDecimal(1 + 0.08/360 * days)).setScale(2, RoundingMode.HALF_UP);
tDebitCredit.setRealPaymentDate(new Date());
......
......@@ -65,7 +65,7 @@ export function exportCredit(query) {
export function settlementDebitCredit(data) {
return request({
url: '/debit/credit/settlementDebitCredit',
method: 'get',
method: 'post',
data: data
})
}
......@@ -74,7 +74,7 @@ export function settlementDebitCredit(data) {
export function repayDebitCredit(data) {
return request({
url: '/debit/credit/repayDebitCredit',
method: 'get',
method: 'post',
data: data
})
}
......@@ -198,6 +198,11 @@
<el-option label="收入" value="1"/>
<el-option label="支出" value="2" />
<el-option label="尾款扣除" value="3" />
<el-option label="采购支出" value="4" />
<el-option label="出借" value="5" />
<el-option label="借贷" value="6" />
<el-option label="还款" value="7" />
<el-option label="还款进账" value="8" />
</el-select>
</el-form-item>
......@@ -228,6 +233,11 @@
<span v-if="scope.row.operateType == '1'">收入</span>
<span v-if="scope.row.operateType == '2'">支出</span>
<span v-if="scope.row.operateType == '3'">尾款扣除</span>
<span v-if="scope.row.operateType == '4'">采购支出</span>
<span v-if="scope.row.operateType == '5'">出借</span>
<span v-if="scope.row.operateType == '6'">借贷</span>
<span v-if="scope.row.operateType == '7'">还款</span>
<span v-if="scope.row.operateType == '8'">还款进账</span>
</template>
</el-table-column>
<el-table-column label="金额" align="center" prop="operateAmount" />
......
......@@ -123,18 +123,18 @@
payable(){
let time = new Date(this.debitData.expectedRepaymentDate).getTime()/ 1000 - new Date(this.debitData.sumInterestDate).getTime()/ 1000;
let day = Math.round(time / 60 / 60 / 24);
return this.debitData.littleTotal *(1 + 0.08 /360 * day).toFixed(4);
return this.debitData.littleTotal *(1 + 0.08 /360 * day).toFixed(2);
}
}
}
</script>
<style>
<style lang="scss">
.common{
.el-form-item {
margin-bottom: 0px;
margin-bottom: 0px !important;
}
.el-divider--horizontal {
margin: 5px 0;
margin: 5px 0 !important;
}
}
</style>
......
......@@ -3,7 +3,7 @@
<el-button type="text" @click="openDialog" size="mini">{{getOperatorName()}}</el-button>
<el-dialog :title="getOperatorName()" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false" destroy-on-close>
<component :is="currentTabComponent" :debitData="debitData" ref="currentCom" v-if="open"></component>
<div slot="footer" class="dialog-footer" style="text-align: center" v-if="operatorName != 'debitDetail' || operatorName != 'repay'">
<div slot="footer" class="dialog-footer" style="text-align: center" v-if="operatorName != 'debitDetail' && operatorName != 'repay'">
<el-button style="width: 150px;border-color: #1890ff;color: #1890ff;" @click="resetSuggestion">重置意见</el-button>
<el-button type="primary" style="width: 150px" @click="submitSuggestion">提交</el-button>
</div>
......@@ -19,12 +19,14 @@
import debitDetail from "./DebitDetail";
import confirm from "./Confirm";
import calculate from "./Calculate";
import repay from "./Repay"
export default {
name: "operator-button",
components:{
debitDetail,
confirm,
calculate
calculate,
repay
},
props:{
operatorName: {
......
......@@ -43,7 +43,7 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:credit:remove']"
v-if="(scope.row.debitStatus == '0' || scope.row.debitStatus == '3') && scope.row.operatorId == $store.state.user.userId"
v-if="(scope.row.debitStatus == '0' || scope.row.debitStatus == '4') && scope.row.operatorId == $store.state.user.userId"
>删除</el-button>
<OperatorButton
v-for="item in scope.row.operators"
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="借贷部门" prop="debitDeptId">
<el-input
<el-form-item label="借贷部门" prop="debitDeptId" v-if="$store.state.user.roles.findIndex(item =>item == 'deptLeader') == -1">
<treeselect
v-model="queryParams.debitDeptId"
:options="queryDeptOptions"
:show-count="true"
placeholder="请输入借贷部门"
clearable
size="small"
@keyup.enter.native="handleQuery"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="出借部门" prop="lendDeptId">
<el-input
<el-form-item label="出借部门" prop="lendDeptId" v-if="$store.state.user.roles.findIndex(item =>item == 'deptLeader') == -1">
<treeselect
v-model="queryParams.lendDeptId"
:options="queryDeptOptions"
:show-count="true"
placeholder="请输入出借部门"
clearable
size="small"
@keyup.enter.native="handleQuery"
style="width: 200px"
/>
</el-form-item>
<el-form-item label="登记日期" prop="registerTime">
<el-date-picker clearable size="small"
v-model="queryParams.registerTime"
type="date"
value-format="yyyy-MM-dd"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择登记日期">
</el-date-picker>
</el-form-item>
<el-form-item label="使用人" prop="useId">
<el-input
v-model="queryParams.useId"
placeholder="请输入使用人"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!--<el-form-item label="使用人" prop="useId">
<el-select v-model="queryParams.useId" placeholder="请选择使用人">
<el-option v-for="item in usersList"
:key="item.userId"
:label="item.nickName"
:value="item.userId"/>
</el-select>
</el-form-item>-->
<el-form-item label="借贷状态" prop="debitStatus">
<el-select v-model="queryParams.debitStatus" placeholder="请选择借贷状态" clearable size="small">
<el-option
......@@ -357,7 +356,8 @@ export default {
usersList: [],
formDeptOptions: [],
tab: "0",
debitStatusList: []
debitStatusList: [],
queryDeptOptions: []
};
},
created() {
......@@ -369,6 +369,9 @@ export default {
this.getDicts("t_debit_status").then((response) => {
this.debitStatusList = response.data;
});
if(this.$store.state.user.roles.findIndex(item =>item == 'deptLeader') == -1){
this.queryParams.queryType = "";
}
},
methods: {
......@@ -613,6 +616,7 @@ export default {
getTreeselect() {
treeselect().then((response) => {
this.formDeptOptions = response.data;
this.queryDeptOptions = response.data;
// 申请服务时买方不能选自己部门
var items = this.formDeptOptions[0].children;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment