no message
This commit is contained in:
parent
51aea52701
commit
18b0598787
@ -24,21 +24,24 @@ export default {
|
||||
upadate: '2016-05-02',
|
||||
}, ],
|
||||
form: {
|
||||
deductionRate: '', // 扣点费率
|
||||
likelyTransactionVolume: '0', // 已发生交易流量
|
||||
serviceFeeStatistics: 0, // 系统服务费统计(这里假设为0,实际可能需要计算)
|
||||
serviceFeeLimit: '', // 系统服务费限制
|
||||
deductionRate: '', // 扣点费率
|
||||
likelyTransactionVolume: '0', // 已发生交易流量
|
||||
serviceFeeStatistics: 0, // 系统服务费统计(这里假设为0,实际可能需要计算)
|
||||
serviceFeeLimit: '', // 系统服务费限制
|
||||
paymentAmount: '', // 收款金额
|
||||
deptId:this.deptId,
|
||||
},
|
||||
status: 0,
|
||||
|
||||
},
|
||||
sum:''
|
||||
}
|
||||
},
|
||||
props: {
|
||||
deptId: String
|
||||
deptId: Number
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
@ -48,10 +51,15 @@ export default {
|
||||
},
|
||||
getData() {
|
||||
getALlInfoBydeptIdApi({deptId : this.deptId}).then(res => {
|
||||
this.form.serviceFeeStatistics = res.data.payMoney;
|
||||
// this.form.serviceFeeStatistics = res.data.payMoney;
|
||||
this.form.likelyTransactionVolume = res.data.payMoney;
|
||||
})
|
||||
},
|
||||
getjisuan() {
|
||||
let a = this.form.deductionRate/10000
|
||||
this.form.serviceFeeStatistics = this.form.likelyTransactionVolume*a
|
||||
|
||||
},
|
||||
onSubmit() {
|
||||
console.log('表单提交', this.form);
|
||||
// 在这里添加提交表单的逻辑
|
||||
@ -96,11 +104,13 @@ export default {
|
||||
cl() {
|
||||
this.form = {
|
||||
deductionRate: '', // 扣点费率
|
||||
likelyTransactionVolume: '100', // 已发生交易流量
|
||||
likelyTransactionVolume: '', // 已发生交易流量
|
||||
serviceFeeStatistics: 0, // 系统服务费统计(这里假设为0,实际可能需要计算)
|
||||
serviceFeeLimit: '', // 系统服务费限制
|
||||
paymentAmount: '', // 收款金额
|
||||
deptId:this.deptId,
|
||||
status: 0,
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -159,13 +169,17 @@ export default {
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleUpdate1(scope.row)"
|
||||
>新增</el-button>
|
||||
</template>
|
||||
width="200"
|
||||
align="center"
|
||||
label="操作"
|
||||
>
|
||||
<!-- <template slot="header" slot-scope="scope">-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleUpdate1(scope.row)"-->
|
||||
<!-- >新增</el-button>-->
|
||||
<!-- 操作-->
|
||||
<!-- </template>-->
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -184,16 +198,24 @@ export default {
|
||||
<!-- 表头插入按钮 -->
|
||||
<el-form :model="form" label-width="120px">
|
||||
<el-form-item label="扣点费率">
|
||||
<el-input v-model="form.deductionRate" placeholder="请输入扣点费率" suffix="%"></el-input>
|
||||
<el-input v-model="form.deductionRate" placeholder="请输入扣点费率" @input="getjisuan()">
|
||||
<template slot="append">‱</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="已发生交易流量">
|
||||
<el-input v-model="form.likelyTransactionVolume" placeholder="请输入已发生交易流量" suffix="万元" readonly></el-input>
|
||||
<el-input v-model="form.likelyTransactionVolume" placeholder="请输入已发生交易流量" readonly disabled="true">
|
||||
<template slot="append">万元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="系统服务费">
|
||||
<el-input v-model="form.serviceFeeStatistics" placeholder="请输入系统服务费" suffix="万元" readonly></el-input>
|
||||
<el-input v-model="form.serviceFeeStatistics" placeholder="请输入系统服务费" suffix="万元" readonly disabled="true">
|
||||
<template slot="append">万元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="系统服务费限制">
|
||||
<el-input v-model="form.serviceFeeLimit" placeholder="请输入系统服务费限制" suffix="万元"></el-input>
|
||||
<el-input v-model="form.serviceFeeLimit" placeholder="请输入系统服务费限制" suffix="万元">
|
||||
<template slot="append">万元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="button-group">
|
||||
@ -210,21 +232,30 @@ export default {
|
||||
<el-form :model="form" label-width="120px">
|
||||
<el-form-item label="扣点费率">
|
||||
<!-- 假设扣点费率是固定的,这里仅显示 -->
|
||||
<el-input v-model="form.deductionRate" placeholder="" readonly></el-input>
|
||||
|
||||
<el-input v-model="form.deductionRate" placeholder="" readonly>
|
||||
<template slot="append">‱</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="已发生交易流量">
|
||||
<el-input v-model="form.likelyTransactionVolume" placeholder="" readonly></el-input>
|
||||
<el-input v-model="form.likelyTransactionVolume" placeholder="" readonly>
|
||||
<template slot="append">万元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="系统服务费统计">
|
||||
<el-input v-model="form.serviceFeeStatistics" placeholder="" readonly></el-input>
|
||||
<el-input v-model="form.serviceFeeStatistics" placeholder="" readonly>
|
||||
<template slot="append">万元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="系统服务费限制">
|
||||
<!-- 假设这是固定的,这里仅显示 -->
|
||||
<el-input v-model="form.serviceFeeLimit" placeholder="" readonly></el-input>
|
||||
<el-input v-model="form.serviceFeeLimit" placeholder="" readonly>
|
||||
<template slot="append">万元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="收款金额">
|
||||
<el-input v-model="form.paymentAmount" placeholder="请输入收款金额"></el-input>
|
||||
<el-input v-model="form.paymentAmount" placeholder="请输入收款金额">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('form')">保存</el-button>
|
||||
|
@ -12,20 +12,14 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible:false,
|
||||
tableData: [{
|
||||
price:2000,
|
||||
yprice:2500,
|
||||
date: '2016-05-02',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄',
|
||||
status:'进行中',
|
||||
upadate: '2016-05-02',
|
||||
}, ],
|
||||
tableData: [ ],
|
||||
form: {
|
||||
prepaidAmount:null,
|
||||
deductionRate:null,
|
||||
estimatedTransactionVolume:null,
|
||||
remainingTransactionVolume:null,
|
||||
deptId:this.deptId,
|
||||
status: 0,
|
||||
|
||||
},
|
||||
// form2: {
|
||||
@ -41,7 +35,7 @@ export default {
|
||||
}
|
||||
},
|
||||
props: {
|
||||
deptId: String
|
||||
deptId: Number
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
@ -99,16 +93,31 @@ export default {
|
||||
}
|
||||
},
|
||||
handleUpdate1(data){
|
||||
this.clean()
|
||||
|
||||
this.dialogVisible=true
|
||||
// this.form = data
|
||||
|
||||
},
|
||||
handleEdit(data){
|
||||
this.clean()
|
||||
|
||||
this.form = data
|
||||
console.log("123",data)
|
||||
this.dialogVisible=true
|
||||
|
||||
},
|
||||
clean() {
|
||||
this.form= {
|
||||
prepaidAmount:null,
|
||||
deductionRate:null,
|
||||
estimatedTransactionVolume:null,
|
||||
remainingTransactionVolume:null,
|
||||
deptId:this.deptId,
|
||||
status: 0,
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -179,19 +188,30 @@ export default {
|
||||
<el-dialog
|
||||
title="新增"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%">
|
||||
width="25%">
|
||||
<el-form :model="form" label-width="150px">
|
||||
<el-form-item label="预付金额">
|
||||
<el-input @change="inputval" v-model="form.prepaidAmount" placeholder="请输入预付金额"></el-input>
|
||||
<el-input @change="inputval" v-model="form.prepaidAmount" placeholder="请输入预付金额"style="width: 240px;">
|
||||
<template slot="append">元</template>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="扣点费率">
|
||||
<el-input @change="inputval" v-model="form.deductionRate" placeholder="请输入扣点费率‱" suffix-icon="el-icon-percent"></el-input>
|
||||
<el-input @change="inputval" v-model="form.deductionRate" placeholder="请输入扣点费率‱" suffix-icon="el-icon-percent" style="width: 240px;">
|
||||
<template slot="append">‱</template>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="预估交易流量">
|
||||
<el-input v-model="form.estimatedTransactionVolume" placeholder="请输入预估交易流量" suffix-icon="el-icon-percent" readonly></el-input>
|
||||
<el-input v-model="form.estimatedTransactionVolume" placeholder="预估交易流量" suffix-icon="el-icon-percent" readonly style="width: 240px;" disabled="true">
|
||||
<template slot="append">万元</template>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="剩余交易流量">
|
||||
<el-input v-model="form.remainingTransactionVolume" placeholder="请输入剩余交易流量" suffix-icon="el-icon-percent" readonly></el-input>
|
||||
<el-input v-model="form.remainingTransactionVolume" placeholder="剩余交易流量" suffix-icon="el-icon-percent" style="width: 240px;" readonly disabled="true">
|
||||
<template slot="append">万元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
||||
|
@ -17,6 +17,7 @@ export default {
|
||||
validDate: [],
|
||||
systemValidityPeriodStart:'',
|
||||
systemValidityPeriodEnd:'',
|
||||
status: 0,
|
||||
deptId:this.deptId,
|
||||
},
|
||||
}
|
||||
@ -51,7 +52,7 @@ export default {
|
||||
}else {
|
||||
addYearApi(this.form).then(res => {
|
||||
this.getList();
|
||||
this.dialogVisible
|
||||
this.dialogVisible = false;
|
||||
})
|
||||
}
|
||||
// 这里可以添加提交表单的逻辑
|
||||
@ -75,6 +76,7 @@ export default {
|
||||
price: '',
|
||||
prepaidAmount: '',
|
||||
validDate: [],
|
||||
status: 0,
|
||||
systemValidityPeriodStart:'',
|
||||
systemValidityPeriodEnd:'',
|
||||
deptId:this.deptId,
|
||||
@ -125,7 +127,7 @@ export default {
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createBy"
|
||||
prop="createName"
|
||||
align="center"
|
||||
label="创建人">
|
||||
</el-table-column>
|
||||
@ -150,16 +152,22 @@ export default {
|
||||
<el-dialog
|
||||
title="新增"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%">
|
||||
width="25%">
|
||||
<el-form :model="form" label-width="120px">
|
||||
<el-form-item label="价格">
|
||||
<el-input v-model="form.price" placeholder="请输入价格"></el-input>
|
||||
<el-input v-model="form.price" placeholder="请输入价格" style="width: 240px;">
|
||||
<template slot="append">元</template>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="付款金额">
|
||||
<el-input v-model="form.prepaidAmount" placeholder="请输入付款金额"></el-input>
|
||||
<el-input v-model="form.prepaidAmount" placeholder="请输入付款金额" style="width: 240px;">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="系统有效日期">
|
||||
<el-form-item label="系统有效日期" >
|
||||
<el-date-picker
|
||||
style="width: 240px;"
|
||||
v-model="form.validDate"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
|
@ -300,7 +300,7 @@
|
||||
<el-radio-group :disabled="isTopDept" v-model="ruleForm.turnoverType" @input="changeTheBillingRule">
|
||||
<el-radio v-if="ruleForm.turnoverType=='1'" label=1>无限制</el-radio>
|
||||
<el-radio v-if="ruleForm.turnoverType=='5'" label=5>年付费</el-radio>
|
||||
<el-radio v-if="ruleForm.turnoverType=='2'" label=2>时间限制</el-radio>
|
||||
<!-- <el-radio v-if="ruleForm.turnoverType=='2'" label=2>时间限制</el-radio>-->
|
||||
<el-radio v-if="ruleForm.turnoverType=='3'" label=3>预付费</el-radio>
|
||||
<el-radio v-if="ruleForm.turnoverType=='4'" label=4>后付费</el-radio>
|
||||
</el-radio-group>
|
||||
|
@ -68,7 +68,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="systemPosition" label="系统位置"></el-table-column>
|
||||
<el-table-column prop="sortOrder" label="排序号"></el-table-column>
|
||||
<el-table-column prop="productImage" label="banner图链接"></el-table-column>
|
||||
<el-table-column prop="bannerLink" label="banner图链接"></el-table-column>
|
||||
<el-table-column prop="note" label="备注"></el-table-column>
|
||||
<el-table-column prop="bannerStatus" label="banner图状态">
|
||||
<template slot-scope="scope">
|
||||
@ -110,10 +110,10 @@
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="50%" append-to-body>
|
||||
<el-form ref="form" :model="deviceInfo" label-width="80px">
|
||||
<el-form :model="deviceInfo" ref="deviceForm" label-width="120px">
|
||||
<el-form-item label="banner名字" prop="machineCode">
|
||||
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="35%" append-to-body>
|
||||
<el-form ref="form" :model="deviceInfo" label-width="80px" :rules="rules">
|
||||
<el-form :model="deviceInfo" ref="deviceForm" label-width="120px" :rules="rules">
|
||||
<el-form-item label="banner名称" prop="bannerName">
|
||||
<el-input v-model="deviceInfo.bannerName" style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="图片" prop="uploadAction">
|
||||
@ -135,8 +135,8 @@
|
||||
<i v-if="!this.deviceInfo.productImage" class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="系统位置" prop="deviceName">
|
||||
<el-select v-model="deviceInfo.systemPosition" placeholder="系统位置">
|
||||
<el-form-item label="系统位置" prop="systemPosition">
|
||||
<el-select v-model="deviceInfo.systemPosition" placeholder="系统位置" style="width: 300px">
|
||||
<el-option
|
||||
v-for="item in systemPositionList"
|
||||
:key="item.value"
|
||||
@ -145,12 +145,12 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序号" prop="userId">
|
||||
<el-input v-model="deviceInfo.sortOrder"></el-input>
|
||||
<el-form-item label="排序号" prop="sortOrder">
|
||||
<el-input v-model="deviceInfo.sortOrder" style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="Banner链接" prop="bannerLink">
|
||||
<el-input v-model="deviceInfo.bannerLink" style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="Banner链接" prop="appKey">-->
|
||||
<!-- <el-input v-model="deviceInfo.bannerLink"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="Banner状态" prop="bannerStatus">
|
||||
<el-switch
|
||||
v-model="deviceInfo.bannerStatus"
|
||||
@ -158,8 +158,8 @@
|
||||
inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="appSecret">
|
||||
<el-input v-model="deviceInfo.note"></el-input>
|
||||
<el-form-item label="备注" prop="note">
|
||||
<el-input v-model="deviceInfo.note" style="width: 300px" ></el-input>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
@ -215,6 +215,23 @@ export default {
|
||||
systemPosition:'',
|
||||
bannerStatus:'',
|
||||
},
|
||||
rules: {
|
||||
bannerName:[
|
||||
{required: true, message: '请填写banner名称', trigger: 'blur'},
|
||||
],
|
||||
systemPosition:[
|
||||
{required: true, message: '请填写系统位置', trigger: ''},
|
||||
],
|
||||
sortOrder:[
|
||||
{required: true, message: '请填写排序号', trigger: 'blur'},
|
||||
],
|
||||
bannerLink:[
|
||||
{required: true, message: '请填写链接', trigger: 'blur'},
|
||||
],
|
||||
note:[
|
||||
{required: true, message: '请选择备注', trigger: 'blur'},
|
||||
],
|
||||
},
|
||||
|
||||
// 上传地址
|
||||
uploadAction: process.env.VUE_APP_BASE_API + 'backendApi/file/upload',
|
||||
|
@ -15,6 +15,7 @@ import io.lettuce.core.dynamic.annotation.Param;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 存储预付费的表(DeptTransactionInfo)表控制层
|
||||
@ -61,7 +62,10 @@ public class DeptTransactionInfoController extends BaseController {
|
||||
public ResponseObject queryById(@PathVariable("id") Integer id) {
|
||||
return getSuccessResult(this.deptTransactionInfoService.queryById(id));
|
||||
}
|
||||
|
||||
@GetMapping("/selectAllETV")
|
||||
public ResponseObject selectAllETV() {
|
||||
return getSuccessResult(this.deptTransactionInfoService.selectAllETV());
|
||||
}
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
|
@ -39,7 +39,8 @@ public class DeptPriceInfo extends BaseEntity {
|
||||
* 状态,布尔类型,不能为空
|
||||
*/
|
||||
private Integer status; //0未开始1进行中2已完成
|
||||
private Integer deptId;
|
||||
private Long deptId;
|
||||
private String createName;
|
||||
|
||||
|
||||
|
||||
|
@ -41,8 +41,8 @@ public class DeptServiceFeeInfo extends BaseEntity {
|
||||
* 状态,布尔类型,不能为空
|
||||
*/
|
||||
private Integer status;
|
||||
private Integer deptId;
|
||||
@TableField(exist = false)
|
||||
private Long deptId;
|
||||
// @TableField(exist = false)
|
||||
private String createName;
|
||||
|
||||
|
||||
|
@ -3,6 +3,8 @@ package com.fuint.business.deptPay.entity;
|
||||
import com.fuint.repository.model.base.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 存储预付费的表(DeptTransactionInfo)实体类
|
||||
*
|
||||
@ -19,15 +21,15 @@ public class DeptTransactionInfo extends BaseEntity {
|
||||
/**
|
||||
* 预付金额,最多10位数字,其中2位小数,不能为空
|
||||
*/
|
||||
private Double prepaidAmount;
|
||||
private BigDecimal prepaidAmount;
|
||||
/**
|
||||
* 扣点费率,百分比表示,最多5位数字,其中2位小数,不能为空
|
||||
*/
|
||||
private Double deductionRate;
|
||||
private BigDecimal deductionRate;
|
||||
/**
|
||||
* 预估交易流量,最多10位数字,其中2位小数,不能为空
|
||||
*/
|
||||
private Double estimatedTransactionVolume;
|
||||
private BigDecimal estimatedTransactionVolume;
|
||||
/**
|
||||
* 剩余交易流量,最多10位数字,其中2位小数,不能为空
|
||||
*/
|
||||
@ -35,8 +37,9 @@ public class DeptTransactionInfo extends BaseEntity {
|
||||
/**
|
||||
* 状态,布尔类型,不能为空
|
||||
*/
|
||||
private Boolean status;
|
||||
private Integer deptId;
|
||||
private Integer status;
|
||||
private Long deptId;
|
||||
private String createName;
|
||||
|
||||
|
||||
|
||||
|
@ -34,6 +34,7 @@ public interface DeptPriceInfoMapper {
|
||||
*/
|
||||
IPage<DeptPriceInfo> queryAllByLimit(@Param("page") Page page,@Param("info") DeptPriceInfo deptPriceInfo);
|
||||
|
||||
int queryBetweenTimeByNow(DeptPriceInfo deptPriceInfo);
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
@ -74,6 +75,7 @@ public interface DeptPriceInfoMapper {
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(DeptPriceInfo deptPriceInfo);
|
||||
int updateStatus(DeptPriceInfo deptPriceInfo);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
@ -84,5 +86,6 @@ public interface DeptPriceInfoMapper {
|
||||
int deleteById(Integer id);
|
||||
|
||||
Map<String, Object> getALlInfoBydeptId(@Param("deptId") List<Long> deptId);
|
||||
int getCountByTime(DeptPriceInfo deptPriceInfo);
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.deptPay.entity.DeptServiceFeeInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 存储后付费的表(DeptServiceFeeInfo)表数据库访问层
|
||||
@ -31,7 +34,7 @@ public interface DeptServiceFeeInfoMapper {
|
||||
* @param page 分页对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
IPage<DeptServiceFeeInfo> queryAllByLimit(@Param("page") Page page, @Param("deptServiceFeeInfo") DeptServiceFeeInfo deptServiceFeeInfo);
|
||||
IPage<DeptServiceFeeInfo> queryAllByLimit(@Param("page") Page page, @Param("info") DeptServiceFeeInfo deptServiceFeeInfo);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
@ -82,5 +85,7 @@ public interface DeptServiceFeeInfoMapper {
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
HashMap<String, Object> getAllYue(Long deptId);
|
||||
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import com.fuint.business.deptPay.entity.DeptTransactionInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 存储预付费的表(DeptTransactionInfo)表数据库访问层
|
||||
@ -22,8 +23,13 @@ public interface DeptTransactionInfoMapper {
|
||||
* @return 实例对象
|
||||
*/
|
||||
DeptTransactionInfo queryById(Integer id);
|
||||
DeptTransactionInfo queryByStauts();
|
||||
|
||||
DeptTransactionInfo queryByDeptId(Long id);
|
||||
DeptTransactionInfo queryByDeptIdLimit(Long deptId);
|
||||
// 获取所有已完成的预估交易流量
|
||||
Map<String , Object> getSumETV(Long deptId);
|
||||
int editStatus(Long deptId);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
@ -75,6 +81,10 @@ public interface DeptTransactionInfoMapper {
|
||||
*/
|
||||
int update(DeptTransactionInfo deptTransactionInfo);
|
||||
|
||||
// 将第一条数据修改为进行中
|
||||
|
||||
// 将剩余为复数的数据修改为已完成
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
|
@ -11,6 +11,7 @@
|
||||
<result property="createTime" column="create_time" jdbcType="DATE"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
||||
<result property="createName" column="create_name" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
@ -26,9 +27,10 @@ status,create_time,create_by
|
||||
<select id="queryAllByLimit" resultMap="DeptPriceInfoMap">
|
||||
select
|
||||
id,price,prepaid_amount,system_validity_period_start,system_validity_period_end,status,
|
||||
create_time,create_by
|
||||
create_time,create_by,create_name
|
||||
from dept_price_info
|
||||
<where>
|
||||
dept_id = #{info.deptId}
|
||||
<if test="info.id != null">
|
||||
and id = #{info.id}
|
||||
</if>
|
||||
@ -72,8 +74,9 @@ create_time,create_by
|
||||
id,price,prepaid_amount,system_validity_period_start,system_validity_period_end,
|
||||
status,create_time,create_by
|
||||
from dept_price_info
|
||||
where deptId = #{deptId}
|
||||
where dept_id = #{deptId}
|
||||
and status = 1
|
||||
limit 1
|
||||
</select>
|
||||
<select id="getALlInfoBydeptId" resultType="java.util.Map">
|
||||
select sum(pay_money) payMoney
|
||||
@ -84,12 +87,32 @@ create_time,create_by
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="getCountByTime" resultType="java.lang.Integer">
|
||||
SELECT COUNT(1)
|
||||
FROM dept_price_info
|
||||
<where>
|
||||
<if test="id != null and id != ''">
|
||||
id = #{id}
|
||||
</if>
|
||||
AND (
|
||||
#{systemValidityPeriodStart} BETWEEN system_validity_period_start AND system_validity_period_end
|
||||
OR #{systemValidityPeriodEnd} BETWEEN system_validity_period_start AND system_validity_period_end
|
||||
OR system_validity_period_start BETWEEN #{systemValidityPeriodStart} AND #{systemValidityPeriodEnd}
|
||||
OR system_validity_period_end BETWEEN #{systemValidityPeriodStart} AND #{systemValidityPeriodEnd}
|
||||
)
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryByDeptIdAndStatus" resultType="com.fuint.business.deptPay.entity.DeptPriceInfo">
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into dept_price_info(price,prepaid_amount,system_validity_period_start,system_validity_period_end,status,dept_id
|
||||
insert into dept_price_info(price,prepaid_amount,system_validity_period_start,system_validity_period_end,status,dept_id,create_name
|
||||
)
|
||||
values (#{price},#{prepaidAmount},#{systemValidityPeriodStart},#{systemValidityPeriodEnd},#{status},#{deptId})
|
||||
values (#{price},#{prepaidAmount},#{systemValidityPeriodStart},#{systemValidityPeriodEnd},#{status},#{deptId},#{createName})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
@ -138,7 +161,13 @@ price = values(price)prepaid_amount = values(prepaid_amount)system_validity_peri
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateStatus">
|
||||
update dept_price_info set status = 3 where status = 2
|
||||
|
||||
</update>
|
||||
<update id="queryBetweenTimeByNow" >
|
||||
update dept_price_info set status = 1 where now() BETWEEN system_validity_period_start AND system_validity_period_end
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from dept_price_info where id = #{id}
|
||||
|
@ -10,6 +10,8 @@
|
||||
<result property="serviceFeeStatistics" column="service_fee_statistics" jdbcType="NUMERIC"/>
|
||||
<result property="serviceFeeLimit" column="service_fee_limit" jdbcType="NUMERIC"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="createName" column="create_name" jdbcType="VARCHAR"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
@ -24,9 +26,10 @@ id,deduction_rate,payment_amount,likely_transaction_volume,service_fee_statistic
|
||||
<select id="queryAllByLimit" resultMap="DeptServiceFeeInfoMap">
|
||||
select
|
||||
id,deduction_rate,payment_amount,likely_transaction_volume,
|
||||
service_fee_statistics,service_fee_limit,status
|
||||
service_fee_statistics,service_fee_limit,status,create_name
|
||||
from dept_service_fee_info
|
||||
<where>
|
||||
dept_id = #{info.deptId}
|
||||
|
||||
</where>
|
||||
</select>
|
||||
@ -86,13 +89,22 @@ service_fee_statistics,service_fee_limit,status
|
||||
where deptId = #{deptId}
|
||||
and status = 1
|
||||
</select>
|
||||
<select id="getAllYue" resultType="java.util.HashMap">
|
||||
select
|
||||
sum(likely_transaction_volume) as lto
|
||||
from dept_service_fee_info
|
||||
where
|
||||
dept_id = #{deptId}
|
||||
and status = 2
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into dept_service_fee_info(deduction_rate,payment_amount,likely_transaction_volume,service_fee_statistics,service_fee_limit,status
|
||||
insert into dept_service_fee_info(deduction_rate,payment_amount,likely_transaction_volume,
|
||||
service_fee_statistics,service_fee_limit,status,dept_id,create_name
|
||||
|
||||
)
|
||||
values (#{deductionRate},#{paymentAmount},#{likelyTransactionVolume},#{serviceFeeStatistics},#{serviceFeeLimit},#{status})
|
||||
values (#{deductionRate},#{paymentAmount},#{likelyTransactionVolume},#{serviceFeeStatistics},#{serviceFeeLimit},#{status},#{deptId},#{createName})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
|
@ -11,13 +11,15 @@
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="DATE"/>
|
||||
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
||||
<result property="createName" column="create_name" jdbcType="VARCHAR"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="DeptTransactionInfoMap">
|
||||
select
|
||||
id,prepaid_amount,deduction_rate,estimated_transaction_volume,
|
||||
remaining_transaction_volume,status,create_time,create_by
|
||||
remaining_transaction_volume,status,create_time,create_by,create_name
|
||||
from dept_transaction_info
|
||||
where id = #{id}
|
||||
</select>
|
||||
@ -26,10 +28,10 @@ remaining_transaction_volume,status,create_time,create_by
|
||||
<select id="queryAllByLimit" resultMap="DeptTransactionInfoMap">
|
||||
select
|
||||
id,prepaid_amount,deduction_rate,estimated_transaction_volume,
|
||||
remaining_transaction_volume,status,create_time,create_by
|
||||
remaining_transaction_volume,status,create_time,create_by,create_name
|
||||
from dept_transaction_info
|
||||
<where>
|
||||
|
||||
dept_id = #{info.deptId}
|
||||
</where>
|
||||
</select>
|
||||
<!-- <if test="info.id != null">-->
|
||||
@ -80,15 +82,35 @@ remaining_transaction_volume,status,create_time,create_by
|
||||
id,prepaid_amount,deduction_rate,estimated_transaction_volume,
|
||||
remaining_transaction_volume,status,create_time,create_by
|
||||
from dept_transaction_info
|
||||
where deptId = #{deptId}
|
||||
where dept_id = #{deptId}
|
||||
and status = 1
|
||||
limit 1
|
||||
</select>
|
||||
<select id="queryByStauts" resultType="com.fuint.business.deptPay.entity.DeptTransactionInfo">
|
||||
|
||||
</select>
|
||||
<select id="queryByDeptIdLimit" resultType="com.fuint.business.deptPay.entity.DeptTransactionInfo">
|
||||
select
|
||||
id,prepaid_amount,deduction_rate,estimated_transaction_volume,
|
||||
remaining_transaction_volume,status,create_time,create_by
|
||||
from dept_transaction_info
|
||||
where dept_id = #{deptId}
|
||||
and status = 0
|
||||
order by create_time ASC
|
||||
limit 1
|
||||
</select>
|
||||
<select id="getSumETV" resultType="java.util.Map">
|
||||
SELECT COALESCE(SUM(estimated_transaction_volume), 0) AS etv
|
||||
from dept_transaction_info
|
||||
where dept_id = #{deptId}
|
||||
and status = 0
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into dept_transaction_info(prepaid_amount,deduction_rate,estimated_transaction_volume,remaining_transaction_volume,status,create_by
|
||||
insert into dept_transaction_info(prepaid_amount,deduction_rate,estimated_transaction_volume,remaining_transaction_volume,status,create_by,dept_id,create_name
|
||||
)
|
||||
values (#{prepaidAmount},#{deductionRate},#{estimatedTransactionVolume},#{remainingTransactionVolume},#{status},#{createBy})
|
||||
values (#{prepaidAmount},#{deductionRate},#{estimatedTransactionVolume},#{remainingTransactionVolume},#{status},#{createBy},#{deptId},#{createName})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
@ -137,6 +159,15 @@ prepaid_amount = values(prepaid_amount)deduction_rate = values(deduction_rate)es
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="editStatus">
|
||||
update dept_transaction_info
|
||||
<set>
|
||||
|
||||
status = 2,
|
||||
|
||||
</set>
|
||||
where dept_id = #{deptId} and status = 1
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
|
@ -60,7 +60,7 @@ public interface DeptPriceInfoService {
|
||||
/**
|
||||
* 根据条件查询数据
|
||||
*
|
||||
* @param deptPriceInfo 筛选条件
|
||||
* @param 筛选条件
|
||||
* @return 对象列表
|
||||
*/
|
||||
Map<String,Object> getALlInfoBydeptId(Long deptId) ;
|
||||
|
@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.deptPay.entity.DeptTransactionInfo;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 存储预付费的表(DeptTransactionInfo)表服务接口
|
||||
@ -38,6 +41,7 @@ public interface DeptTransactionInfoService {
|
||||
* @return 实例对象
|
||||
*/
|
||||
DeptTransactionInfo insert(DeptTransactionInfo deptTransactionInfo);
|
||||
public Map<String,Object> selectAllETV();
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.deptPay.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.deptPay.entity.DeptPriceInfo;
|
||||
@ -16,6 +17,7 @@ import com.fuint.common.dto.AccountInfo;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -51,12 +53,31 @@ public class DeptPriceInfoServiceImpl implements DeptPriceInfoService {
|
||||
@Override
|
||||
public IPage<DeptPriceInfo> queryByPage(@Param("page") Page page, DeptPriceInfo deptPriceInfo) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
// deptPriceInfo.setStoreId(nowAccountInfo.getStoreId());
|
||||
deptPriceInfo.setDeptId(nowAccountInfo.getDeptId());
|
||||
// 判断以进行中的数据进行判断并修改状态
|
||||
// Data data = new Data();
|
||||
DeptPriceInfo deptPriceInfo1 = deptPriceInfoMapper.queryByDeptId(nowAccountInfo.getDeptId());
|
||||
if (ObjectUtil.isNotEmpty(deptPriceInfo1)) {
|
||||
boolean isValid = isDateInRange(deptPriceInfo1.getSystemValidityPeriodStart(),deptPriceInfo1.getSystemValidityPeriodEnd());
|
||||
if (!isValid) {
|
||||
// 修改为已完成
|
||||
deptPriceInfoMapper.updateStatus(deptPriceInfo1);
|
||||
// 查询当前时间是否再包含时间之内
|
||||
deptPriceInfoMapper.queryBetweenTimeByNow(deptPriceInfo1);
|
||||
}
|
||||
}else {
|
||||
// 查询当前时间是否再包含时间之内
|
||||
deptPriceInfoMapper.queryBetweenTimeByNow(deptPriceInfo1);
|
||||
}
|
||||
|
||||
return this.deptPriceInfoMapper.queryAllByLimit(page, deptPriceInfo);
|
||||
}
|
||||
|
||||
public static boolean isDateInRange(Date start, Date end) {
|
||||
Date now = new Date();
|
||||
// 检查当前时间是否在给定的时间范围内
|
||||
return (start.before(now) || start.equals(now)) && (end.after(now) || end.equals(now));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
@ -65,8 +86,21 @@ public class DeptPriceInfoServiceImpl implements DeptPriceInfoService {
|
||||
*/
|
||||
@Override
|
||||
public DeptPriceInfo insert(DeptPriceInfo deptPriceInfo) {
|
||||
int countByTime = getCountByTime(deptPriceInfo);
|
||||
if (countByTime>0) {
|
||||
throw new RuntimeException("该时间段已有数据");
|
||||
}
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
deptPriceInfo.setCreateBy(nowAccountInfo.getRealName());
|
||||
deptPriceInfo.setCreateName(nowAccountInfo.getRealName());
|
||||
deptPriceInfo.setDeptId(nowAccountInfo.getDeptId());
|
||||
|
||||
boolean isValid = isDateInRange(deptPriceInfo.getSystemValidityPeriodStart(),deptPriceInfo.getSystemValidityPeriodEnd());
|
||||
|
||||
if (isValid) {
|
||||
deptPriceInfo.setStatus(1);
|
||||
// 将其他进行中的改为已完成
|
||||
deptPriceInfoMapper.updateStatus(deptPriceInfo);
|
||||
}
|
||||
this.deptPriceInfoMapper.insert(deptPriceInfo);
|
||||
return deptPriceInfo;
|
||||
}
|
||||
@ -79,6 +113,16 @@ public class DeptPriceInfoServiceImpl implements DeptPriceInfoService {
|
||||
*/
|
||||
@Override
|
||||
public DeptPriceInfo update(DeptPriceInfo deptPriceInfo) {
|
||||
int countByTime = getCountByTime(deptPriceInfo);
|
||||
if (countByTime>0) {
|
||||
throw new RuntimeException("该时间段已有数据");
|
||||
}
|
||||
boolean isValid = isDateInRange(deptPriceInfo.getSystemValidityPeriodStart(),deptPriceInfo.getSystemValidityPeriodEnd());
|
||||
|
||||
if (isValid) {
|
||||
deptPriceInfo.setStatus(1);
|
||||
deptPriceInfoMapper.updateStatus(deptPriceInfo);
|
||||
}
|
||||
this.deptPriceInfoMapper.update(deptPriceInfo);
|
||||
return this.queryById(deptPriceInfo.getId());
|
||||
}
|
||||
@ -103,4 +147,11 @@ public class DeptPriceInfoServiceImpl implements DeptPriceInfoService {
|
||||
return deptPriceInfoMapper.getALlInfoBydeptId(longs);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 查询开始时间和结束时间是否在时间段内
|
||||
public int getCountByTime(DeptPriceInfo deptPriceInfo) {
|
||||
return deptPriceInfoMapper.getCountByTime(deptPriceInfo);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,12 @@
|
||||
package com.fuint.business.deptPay.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.deptPay.entity.DeptServiceFeeInfo;
|
||||
import com.fuint.business.deptPay.mapper.DeptPriceInfoMapper;
|
||||
import com.fuint.business.deptPay.mapper.DeptServiceFeeInfoMapper;
|
||||
import com.fuint.business.deptPay.service.DeptPriceInfoService;
|
||||
import com.fuint.business.deptPay.service.DeptServiceFeeInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
@ -13,6 +16,7 @@ import com.fuint.common.dto.AccountInfo;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 存储后付费的表(DeptServiceFeeInfo)表服务实现类
|
||||
@ -36,6 +40,9 @@ public class DeptServiceFeeInfoServiceImpl implements DeptServiceFeeInfoService
|
||||
return this.deptServiceFeeInfoMapper.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
@Resource
|
||||
DeptPriceInfoService deptPriceInfoService;
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
@ -47,6 +54,32 @@ public class DeptServiceFeeInfoServiceImpl implements DeptServiceFeeInfoService
|
||||
public IPage<DeptServiceFeeInfo> queryByPage(@Param("page") Page page, DeptServiceFeeInfo deptServiceFeeInfo) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
// deptServiceFeeInfo.setStoreId(nowAccountInfo.getStoreId());
|
||||
// 首先查询进行中的是否已缴费 查询当前进行中的
|
||||
DeptServiceFeeInfo deptServiceFeeInfo1 = deptServiceFeeInfoMapper.queryByDeptId(nowAccountInfo.getDeptId());
|
||||
// 查询总的交易数据
|
||||
Map<String, Object> aLlInfoBydeptId = deptPriceInfoService.getALlInfoBydeptId(nowAccountInfo.getDeptId());
|
||||
// 查询已发生的交易
|
||||
Map<String, Object> allyue = deptServiceFeeInfoMapper.getAllYue(nowAccountInfo.getDeptId());
|
||||
String payMoney = ObjectUtil.isNotEmpty(aLlInfoBydeptId.get("payMoney"))?aLlInfoBydeptId.get("payMoney").toString():"0";
|
||||
String lto = ObjectUtil.isNotEmpty(allyue.get("lto"))?allyue.get("lto").toString():"0";
|
||||
|
||||
// 总的交易数据减去已发生的交易
|
||||
Double v = Double.parseDouble(payMoney) - Double.parseDouble(lto);
|
||||
//当缴费时 判断当前是否超出缴费金额
|
||||
if (v > deptServiceFeeInfo1.getDeductionRate()) {
|
||||
// 超出金额新增一条数据
|
||||
double v1 = deptServiceFeeInfo1.getLikelyTransactionVolume() / deptServiceFeeInfo1.getDeductionRate();
|
||||
if (v1>0) {
|
||||
DeptServiceFeeInfo deptServiceFeeInfo2 = new DeptServiceFeeInfo();
|
||||
}
|
||||
}
|
||||
// 修改已发生的交易流量
|
||||
deptServiceFeeInfo1.setLikelyTransactionVolume(v);
|
||||
deptServiceFeeInfoMapper.update(deptServiceFeeInfo1);
|
||||
//剩余交易减去 v
|
||||
|
||||
|
||||
deptServiceFeeInfo.setDeptId(nowAccountInfo.getDeptId());
|
||||
return this.deptServiceFeeInfoMapper.queryAllByLimit(page, deptServiceFeeInfo);
|
||||
}
|
||||
|
||||
@ -60,6 +93,8 @@ public class DeptServiceFeeInfoServiceImpl implements DeptServiceFeeInfoService
|
||||
public DeptServiceFeeInfo insert(DeptServiceFeeInfo deptServiceFeeInfo) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
// deptServiceFeeInfo.setStoreId(nowAccountInfo.getStoreId());
|
||||
deptServiceFeeInfo.setDeptId(nowAccountInfo.getDeptId());
|
||||
deptServiceFeeInfo.setCreateName(nowAccountInfo.getRealName());
|
||||
this.deptServiceFeeInfoMapper.insert(deptServiceFeeInfo);
|
||||
return deptServiceFeeInfo;
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
package com.fuint.business.deptPay.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.deptPay.entity.DeptTransactionInfo;
|
||||
import com.fuint.business.deptPay.mapper.DeptTransactionInfoMapper;
|
||||
import com.fuint.business.deptPay.service.DeptPriceInfoService;
|
||||
import com.fuint.business.deptPay.service.DeptTransactionInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
@ -13,6 +15,9 @@ import com.fuint.common.dto.AccountInfo;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 存储预付费的表(DeptTransactionInfo)表服务实现类
|
||||
@ -36,6 +41,9 @@ public class DeptTransactionInfoServiceImpl implements DeptTransactionInfoServic
|
||||
return this.deptTransactionInfoMapper.queryById(id);
|
||||
}
|
||||
|
||||
|
||||
@Resource
|
||||
DeptPriceInfoService deptPriceInfoService;
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
@ -47,6 +55,35 @@ public class DeptTransactionInfoServiceImpl implements DeptTransactionInfoServic
|
||||
public IPage<DeptTransactionInfo> queryByPage(@Param("page") Page page, DeptTransactionInfo deptTransactionInfo) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
// deptTransactionInfo.setStoreId(nowAccountInfo.getStoreId());
|
||||
deptTransactionInfo.setDeptId(nowAccountInfo.getDeptId());
|
||||
// 修改进行中的数据 remainingTransactionVolume
|
||||
// 查询正在进行中的数据
|
||||
DeptTransactionInfo deptTransactionInfo1 = deptTransactionInfoMapper.queryByDeptId(nowAccountInfo.getDeptId());
|
||||
|
||||
// 查询已跑流量
|
||||
Map<String, Object> aLlInfoBydeptId = deptPriceInfoService.getALlInfoBydeptId(nowAccountInfo.getDeptId());
|
||||
String payMoney = aLlInfoBydeptId.get("payMoney").toString();
|
||||
// 根据deptId查询所有流量
|
||||
// 流量折合
|
||||
Map<String, Object> etv = deptTransactionInfoMapper.getSumETV(nowAccountInfo.getDeptId());
|
||||
BigDecimal etv1 = new BigDecimal(etv.get("etv").toString()).subtract(new BigDecimal(payMoney));
|
||||
|
||||
if (ObjectUtil.isEmpty(deptTransactionInfo1) || deptTransactionInfo1.getRemainingTransactionVolume()<=0 ) {
|
||||
// 将所有进行中的设置为已完成
|
||||
deptTransactionInfoMapper.editStatus(nowAccountInfo.getDeptId());
|
||||
// 查询未开始的最旧一个
|
||||
DeptTransactionInfo deptTransactionInfo2 = deptTransactionInfoMapper.queryByDeptIdLimit(nowAccountInfo.getDeptId());
|
||||
deptTransactionInfo2.setStatus(1);
|
||||
deptTransactionInfo2.setRemainingTransactionVolume(deptTransactionInfo2.getRemainingTransactionVolume() -Double.parseDouble(etv1.toString()) );
|
||||
|
||||
deptTransactionInfoMapper.update(deptTransactionInfo2);
|
||||
|
||||
}else {
|
||||
deptTransactionInfo1.setRemainingTransactionVolume(deptTransactionInfo1.getRemainingTransactionVolume() -Double.parseDouble(etv1.toString()) );
|
||||
deptTransactionInfoMapper.update(deptTransactionInfo1);
|
||||
}
|
||||
|
||||
|
||||
return this.deptTransactionInfoMapper.queryAllByLimit(page, deptTransactionInfo);
|
||||
}
|
||||
|
||||
@ -59,11 +96,37 @@ public class DeptTransactionInfoServiceImpl implements DeptTransactionInfoServic
|
||||
@Override
|
||||
public DeptTransactionInfo insert(DeptTransactionInfo deptTransactionInfo) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
deptTransactionInfo.setCreateBy(nowAccountInfo.getRealName());
|
||||
deptTransactionInfo.setCreateName(nowAccountInfo.getRealName());
|
||||
deptTransactionInfo.setDeptId(nowAccountInfo.getDeptId());
|
||||
|
||||
// 查询当前是否有进行中的数据,没有则更新状态
|
||||
DeptTransactionInfo deptTransactionInfo1 = this.deptTransactionInfoMapper.queryByDeptId(nowAccountInfo.getDeptId());
|
||||
if (ObjectUtil.isNotEmpty(deptTransactionInfo1)) {
|
||||
deptTransactionInfo.setStatus(1);
|
||||
}
|
||||
this.deptTransactionInfoMapper.insert(deptTransactionInfo);
|
||||
return deptTransactionInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有已完成预估交易流量
|
||||
*/
|
||||
@Override
|
||||
public Map<String,Object> selectAllETV() {
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
||||
// 查询已跑流量
|
||||
Map<String, Object> aLlInfoBydeptId = deptPriceInfoService.getALlInfoBydeptId(nowAccountInfo.getDeptId());
|
||||
String payMoney = aLlInfoBydeptId.get("payMoney").toString();
|
||||
// 根据deptId查询所有流量
|
||||
// 流量折合
|
||||
Map<String, Object> etv = deptTransactionInfoMapper.getSumETV(nowAccountInfo.getDeptId());
|
||||
BigDecimal etv1 = new BigDecimal(etv.get("etv").toString()).subtract(new BigDecimal(payMoney));
|
||||
map.put("etv",etv1.toString());
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
|
@ -54,6 +54,9 @@ id,banner_name,product_image,system_position,sort_order,banner_link,banner_statu
|
||||
and note = #{sysBanner.note}
|
||||
</if>
|
||||
</where>
|
||||
order by sort_order ASC,create_time desc
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
|
Loading…
Reference in New Issue
Block a user