Compare commits
No commits in common. "3e45254fc16d356ba83a28dd992ff34f88e9bba9" and "2f51b562984199eb938b6f285467769d9b2b51f5" have entirely different histories.
3e45254fc1
...
2f51b56298
|
|
@ -79,7 +79,7 @@ export function changeUserStatus(userId, status) {
|
||||||
// 查询用户个人信息
|
// 查询用户个人信息
|
||||||
export function getUserProfile() {
|
export function getUserProfile() {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/profile/vue',
|
url: '/system/user/profile',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -94,11 +94,14 @@ export function updateUserProfile(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户密码重置
|
// 用户密码重置
|
||||||
export function updateUserPwd(data) {
|
export function updateUserPwd(oldPassword, newPassword) {
|
||||||
|
const data = {
|
||||||
|
oldPassword,
|
||||||
|
newPassword
|
||||||
|
}
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/profile/resetPwd',
|
url: '/system/user/profile/updatePwd',
|
||||||
method: 'post',
|
method: 'put',
|
||||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,28 +74,6 @@ export const constantRoutes = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/purchase',
|
|
||||||
component: Layout,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'approved',
|
|
||||||
component: () => import('@/views/approve/purchaase/approved/index'),
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/approve',
|
|
||||||
component: Layout,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'orderLog',
|
|
||||||
component: () => import('@/views/approve/approved_order/index'),
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/user',
|
path: '/user',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
|
|
||||||
|
|
@ -19,17 +19,17 @@ export function toFixed(value, dp = DEFAULT_DP) {
|
||||||
|
|
||||||
// 加法
|
// 加法
|
||||||
export function add(a, b, dp = DEFAULT_DP) {
|
export function add(a, b, dp = DEFAULT_DP) {
|
||||||
return D(a).plus(D(b)).toDecimalPlaces(dp).toNumber()
|
return D(a).plus(b).toDecimalPlaces(dp).toNumber()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 减法
|
// 减法
|
||||||
export function sub(a, b, dp = DEFAULT_DP) {
|
export function sub(a, b, dp = DEFAULT_DP) {
|
||||||
return D(a).minus(D(b)).toDecimalPlaces(dp).toNumber()
|
return D(a).minus(b).toDecimalPlaces(dp).toNumber()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 乘法
|
// 乘法
|
||||||
export function mul(a, b, dp = DEFAULT_DP) {
|
export function mul(a, b, dp = DEFAULT_DP) {
|
||||||
return D(a).times(D(b)).toDecimalPlaces(dp).toNumber()
|
return D(a).times(b).toDecimalPlaces(dp).toNumber()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 除法
|
// 除法
|
||||||
|
|
|
||||||
|
|
@ -56,14 +56,6 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
size="mini"
|
|
||||||
@click="()=>{this.$router.back()}"
|
|
||||||
>返回</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,18 +58,7 @@
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
size="mini"
|
|
||||||
@click="toApproved()"
|
|
||||||
>审批历史</el-button>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
<el-table v-loading="loading" :data="orderList">
|
<el-table v-loading="loading" :data="orderList">
|
||||||
<el-table-column label="合同编号" align="center" prop="orderCode" />
|
<el-table-column label="合同编号" align="center" prop="orderCode" />
|
||||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||||
|
|
@ -166,11 +155,6 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toApproved(){
|
|
||||||
this.$router.push({
|
|
||||||
path: '/approve/orderLog',
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 查询订单列表 */
|
/** 查询订单列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
|
||||||
|
|
@ -29,18 +29,7 @@
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
size="mini"
|
|
||||||
@click="toApproved()"
|
|
||||||
>审批历史</el-button>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
<el-table v-loading="loading" :data="purchaseorderList">
|
<el-table v-loading="loading" :data="purchaseorderList">
|
||||||
<!-- 表格列定义 -->
|
<!-- 表格列定义 -->
|
||||||
<el-table-column label="序号" type="index" width="50" align="center" />
|
<el-table-column label="序号" type="index" width="50" align="center" />
|
||||||
|
|
@ -133,7 +122,6 @@ export default {
|
||||||
loading: true,
|
loading: true,
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
total: 0,
|
total: 0,
|
||||||
confirmDialogTitle:'',
|
|
||||||
purchaseorderList: [],
|
purchaseorderList: [],
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
|
|
@ -180,9 +168,6 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toApproved(){
|
|
||||||
this.$router.push( '/purchase/approved' )
|
|
||||||
},
|
|
||||||
// 列表页方法
|
// 列表页方法
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
|
||||||
|
|
@ -29,18 +29,7 @@
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
size="mini"
|
|
||||||
@click="()=>{this.$router.back()}"
|
|
||||||
>返回</el-button>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
<el-table v-loading="loading" :data="purchaseorderList">
|
<el-table v-loading="loading" :data="purchaseorderList">
|
||||||
<!-- 表格列定义 -->
|
<!-- 表格列定义 -->
|
||||||
<el-table-column label="序号" type="index" width="50" align="center" />
|
<el-table-column label="序号" type="index" width="50" align="center" />
|
||||||
|
|
|
||||||
|
|
@ -50,24 +50,24 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="detail-item"><strong>未付款金额:</strong> {{ formData.unpaidPaymentAmount }}</div>
|
<div class="detail-item"><strong>未付款金额:</strong> {{ formData.unpaidAmount }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="detail-item"><strong>已付款金额:</strong> {{ formData.paidPaymentAmount }}</div>
|
<div class="detail-item"><strong>已付款金额:</strong> {{ formData.paidAmount }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="detail-item"><strong>付款中金额:</strong> {{ this.$calc.sub(this.$calc.sub(formData.totalPriceWithTax,formData.paidPaymentAmount),formData.unpaidPaymentAmount) }}</div>
|
<div class="detail-item"><strong>付款中金额:</strong> {{ formData.payingAmount }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="detail-item"><strong>未收票金额:</strong> {{ formData.unreceivedTicketAmount }}</div>
|
<div class="detail-item"><strong>未收票金额:</strong> {{ formData.unInvoicedAmount }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="detail-item"><strong>已收票金额:</strong> {{ formData.receivedTicketAmount }}</div>
|
<div class="detail-item"><strong>已收票金额:</strong> {{ formData.invoicedAmount }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="detail-item"><strong>收票中金额:</strong> {{ this.$calc.sub(this.$calc.sub(formData.totalPriceWithTax,formData.receivedTicketAmount),formData.unreceivedTicketAmount)}}</div>
|
<div class="detail-item"><strong>收票中金额:</strong> {{ formData.invoicingAmount }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,11 @@
|
||||||
<el-divider content-position="left">采购应付单表</el-divider>
|
<el-divider content-position="left">采购应付单表</el-divider>
|
||||||
<el-table :data="payableOrdersWithPlans" border max-height="300px" style="margin-bottom: 20px;">
|
<el-table :data="payableOrdersWithPlans" border max-height="300px" style="margin-bottom: 20px;">
|
||||||
<el-table-column label="应付单编号" align="center" prop="payableBillCode" width="150"/>
|
<el-table-column label="应付单编号" align="center" prop="payableBillCode" width="150"/>
|
||||||
<el-table-column label="预计付款时间" align="center" prop="planPaymentDate" width="180"/>
|
<el-table-column label="预计付款时间" align="center" prop="estimatedPaymentTime" width="180"/>
|
||||||
<el-table-column label="付款计划" align="center" width="100" prop="planAmount">
|
<el-table-column label="付款计划" align="center" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.paymentPlans ? scope.row.paymentPlans.length : 0 }} 条计划</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="项目名称" align="center" prop="projectName" width="150"/>
|
<el-table-column label="项目名称" align="center" prop="projectName" width="150"/>
|
||||||
<el-table-column label="合同编号" align="center" prop="orderCode" width="150"/>
|
<el-table-column label="合同编号" align="center" prop="orderCode" width="150"/>
|
||||||
|
|
@ -189,35 +192,24 @@ export default {
|
||||||
this.form.paymentBillType = 'FROM_PAYABLE'; // Default
|
this.form.paymentBillType = 'FROM_PAYABLE'; // Default
|
||||||
|
|
||||||
// Initialize payableOrdersWithPlans
|
// Initialize payableOrdersWithPlans
|
||||||
this.payableOrdersWithPlans = this.payableOrders.map(order => {
|
this.payableOrdersWithPlans = this.payableOrders.map(order => ({
|
||||||
const paymentPlans = order.paymentPlans ? [...order.paymentPlans] : [];
|
...order,
|
||||||
if (paymentPlans.length === 0 && order.lastPaymentPlanId) {
|
paymentPlans: order.paymentPlans || [], // Retain existing plans if any, otherwise empty
|
||||||
paymentPlans.push({
|
totalPriceWithTax: order.totalPriceWithTax || 0, // Ensure numeric for calculations
|
||||||
id: order.lastPaymentPlanId,
|
unpaidAmount: order.unpaidAmount || 0,
|
||||||
planAmount: order.planAmount,
|
paidAmount: order.paidAmount || 0, // Ensure numeric for calculations
|
||||||
planPaymentDate: order.planPaymentDate,
|
}));
|
||||||
planRate: this.$calc.mul(this.$calc.div(order.planAmount, order.totalPriceWithTax, 4), 100)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
...order,
|
|
||||||
paymentPlans: paymentPlans, // Retain existing plans if any, otherwise empty
|
|
||||||
totalPriceWithTax: order.totalPriceWithTax || 0, // Ensure numeric for calculations
|
|
||||||
unpaidAmount: order.unpaidAmount || 0,
|
|
||||||
paidAmount: order.paidAmount || 0, // Ensure numeric for calculations
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
handleClose() {
|
handleClose() {
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.resetForm();
|
this.resetForm();
|
||||||
},
|
},
|
||||||
handleChooseConfirm() {
|
handleChooseConfirm() {
|
||||||
if (!this.$refs.planSelector) {
|
if (!this.$refs.planSelector || !this.$refs.planSelector.selectedPlan) {
|
||||||
this.$modal.msgError('无法获取计划选择器组件');
|
this.$modal.msgError('无法获取计划选择器组件或其选择的计划');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const selectedPlans = this.$refs.planSelector.selectedPlan || [];
|
const selectedPlans = this.$refs.planSelector.selectedPlan;
|
||||||
|
|
||||||
const orderIndex = this.payableOrdersWithPlans.findIndex(o => o.id === this.choosePayable.id);
|
const orderIndex = this.payableOrdersWithPlans.findIndex(o => o.id === this.choosePayable.id);
|
||||||
if (orderIndex === -1) {
|
if (orderIndex === -1) {
|
||||||
|
|
@ -227,11 +219,27 @@ export default {
|
||||||
|
|
||||||
const currentOrder = this.payableOrdersWithPlans[orderIndex];
|
const currentOrder = this.payableOrdersWithPlans[orderIndex];
|
||||||
|
|
||||||
// Update the payment plans for the specific order
|
// Ensure the paymentPlans array exists
|
||||||
this.$set(currentOrder, 'paymentPlans', [...selectedPlans]);
|
if (!currentOrder.paymentPlans) {
|
||||||
|
this.$set(currentOrder, 'paymentPlans', []);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add new plans, checking for duplicates by plan ID
|
||||||
|
let addedCount = 0;
|
||||||
|
selectedPlans.forEach(newPlan => {
|
||||||
|
const existingPlan = currentOrder.paymentPlans.find(p => p.id === newPlan.id);
|
||||||
|
if (!existingPlan) {
|
||||||
|
currentOrder.paymentPlans.push(newPlan);
|
||||||
|
addedCount++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.isPaymentPlanSelectorOpen = false;
|
this.isPaymentPlanSelectorOpen = false;
|
||||||
this.$modal.msgSuccess(`已更新付款计划选择,共 ${selectedPlans.length} 条`);
|
if (addedCount > 0) {
|
||||||
|
this.$modal.msgSuccess(`成功补充 ${addedCount} 条付款计划`);
|
||||||
|
} else {
|
||||||
|
this.$modal.msgWarning('没有新的付款计划被添加');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
// Validate main form fields
|
// Validate main form fields
|
||||||
|
|
@ -275,7 +283,6 @@ export default {
|
||||||
// Collect all payable orders with their updated payment plans
|
// Collect all payable orders with their updated payment plans
|
||||||
payableOrders: this.payableOrdersWithPlans.map(order => ({
|
payableOrders: this.payableOrdersWithPlans.map(order => ({
|
||||||
id: order.id,
|
id: order.id,
|
||||||
taxRate: order.taxRate,
|
|
||||||
payableBillCode: order.payableBillCode,
|
payableBillCode: order.payableBillCode,
|
||||||
paymentPlans: order.paymentPlans.map(plan => ({
|
paymentPlans: order.paymentPlans.map(plan => ({
|
||||||
planPaymentDate: plan.planPaymentDate,
|
planPaymentDate: plan.planPaymentDate,
|
||||||
|
|
|
||||||
|
|
@ -30,24 +30,17 @@
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="厂家开票时间" prop="vendorTicketTime">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="form.vendorTicketTime"
|
|
||||||
type="date"
|
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
placeholder="选择日期"
|
|
||||||
></el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-divider content-position="left">采购应付单表</el-divider>
|
<el-divider content-position="left">采购应付单表</el-divider>
|
||||||
<el-table :data="payableOrdersWithPlans" border max-height="300px" style="margin-bottom: 20px;">
|
<el-table :data="payableOrdersWithPlans" border max-height="300px" style="margin-bottom: 20px;">
|
||||||
<el-table-column label="应付单编号" align="center" prop="payableBillCode" width="150"/>
|
<el-table-column label="应付单编号" align="center" prop="payableBillCode" width="150"/>
|
||||||
<el-table-column label="预计收票时间" align="center" prop="planTicketDate" width="180"/>
|
<el-table-column label="预计收票时间" align="center" prop="estimatedPaymentTime" width="180"/>
|
||||||
<el-table-column label="收票计划" align="center" width="100" prop="planTicketAmount">
|
<el-table-column label="收票计划" align="center" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.ticketPlans ? scope.row.ticketPlans.length : 0 }} 条计划</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="项目名称" align="center" prop="projectName" width="150"/>
|
<el-table-column label="项目名称" align="center" prop="projectName" width="150"/>
|
||||||
<el-table-column label="合同编号" align="center" prop="orderCode" width="150"/>
|
<el-table-column label="合同编号" align="center" prop="orderCode" width="150"/>
|
||||||
|
|
@ -141,7 +134,6 @@ export default {
|
||||||
ticketBillType: 'FROM_PAYABLE', // Default to a type, or make it dynamic
|
ticketBillType: 'FROM_PAYABLE', // Default to a type, or make it dynamic
|
||||||
vendorName: '',
|
vendorName: '',
|
||||||
ticketTime: null,
|
ticketTime: null,
|
||||||
vendorTicketTime: null,
|
|
||||||
},
|
},
|
||||||
payableOrdersWithPlans: [], // Each order will now have its own ticketPlans array
|
payableOrdersWithPlans: [], // Each order will now have its own ticketPlans array
|
||||||
isTicketPlanSelectorOpen: false,
|
isTicketPlanSelectorOpen: false,
|
||||||
|
|
@ -193,44 +185,31 @@ export default {
|
||||||
const allSameVendor = this.payableOrders.every(order => order.vendorName === firstVendorName);
|
const allSameVendor = this.payableOrders.every(order => order.vendorName === firstVendorName);
|
||||||
this.form.vendorName = allSameVendor ? firstVendorName : '多个制造商';
|
this.form.vendorName = allSameVendor ? firstVendorName : '多个制造商';
|
||||||
this.form.ticketTime = null; // Reset time
|
this.form.ticketTime = null; // Reset time
|
||||||
this.form.vendorTicketTime = null;
|
|
||||||
} else {
|
} else {
|
||||||
this.form.vendorName = '';
|
this.form.vendorName = '';
|
||||||
this.form.ticketTime = null;
|
this.form.ticketTime = null;
|
||||||
this.form.vendorTicketTime = null;
|
|
||||||
}
|
}
|
||||||
this.form.ticketBillType = 'FROM_PAYABLE'; // Default
|
this.form.ticketBillType = 'FROM_PAYABLE'; // Default
|
||||||
|
|
||||||
// Initialize payableOrdersWithPlans
|
// Initialize payableOrdersWithPlans
|
||||||
this.payableOrdersWithPlans = this.payableOrders.map(order => {
|
this.payableOrdersWithPlans = this.payableOrders.map(order => ({
|
||||||
const ticketPlans = order.ticketPlans ? [...order.ticketPlans] : [];
|
...order,
|
||||||
if (ticketPlans.length === 0 && order.lastTicketPlanId) {
|
ticketPlans: order.ticketPlans || [], // Retain existing plans if any, otherwise empty
|
||||||
ticketPlans.push({
|
totalPriceWithTax: order.totalPriceWithTax || 0, // Ensure numeric for calculations
|
||||||
id: order.lastTicketPlanId,
|
unInvoicedAmount: order.unInvoicedAmount || 0,
|
||||||
planAmount: order.planTicketAmount,
|
invoicedAmount: order.invoicedAmount || 0, // Ensure numeric for calculations
|
||||||
planTicketDate: order.planTicketDate,
|
}));
|
||||||
planRate: this.$calc.mul(this.$calc.div(order.planTicketAmount, order.totalPriceWithTax, 4), 100)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
...order,
|
|
||||||
ticketPlans: ticketPlans, // Retain existing plans if any, otherwise empty
|
|
||||||
totalPriceWithTax: order.totalPriceWithTax || 0, // Ensure numeric for calculations
|
|
||||||
unInvoicedAmount: order.unInvoicedAmount || 0,
|
|
||||||
invoicedAmount: order.invoicedAmount || 0, // Ensure numeric for calculations
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
handleClose() {
|
handleClose() {
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.resetForm();
|
this.resetForm();
|
||||||
},
|
},
|
||||||
handleChooseConfirm() {
|
handleChooseConfirm() {
|
||||||
if (!this.$refs.planSelector) {
|
if (!this.$refs.planSelector || !this.$refs.planSelector.selectedPlan) {
|
||||||
this.$modal.msgError('无法获取计划选择器组件');
|
this.$modal.msgError('无法获取计划选择器组件或其选择的计划');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const selectedPlans = this.$refs.planSelector.selectedPlan || [];
|
const selectedPlans = this.$refs.planSelector.selectedPlan;
|
||||||
|
|
||||||
const orderIndex = this.payableOrdersWithPlans.findIndex(o => o.id === this.choosePayable.id);
|
const orderIndex = this.payableOrdersWithPlans.findIndex(o => o.id === this.choosePayable.id);
|
||||||
if (orderIndex === -1) {
|
if (orderIndex === -1) {
|
||||||
|
|
@ -240,11 +219,27 @@ export default {
|
||||||
|
|
||||||
const currentOrder = this.payableOrdersWithPlans[orderIndex];
|
const currentOrder = this.payableOrdersWithPlans[orderIndex];
|
||||||
|
|
||||||
// Update the ticket plans for the specific order
|
// Ensure the ticketPlans array exists
|
||||||
this.$set(currentOrder, 'ticketPlans', [...selectedPlans]);
|
if (!currentOrder.ticketPlans) {
|
||||||
|
this.$set(currentOrder, 'ticketPlans', []);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add new plans, checking for duplicates by plan ID
|
||||||
|
let addedCount = 0;
|
||||||
|
selectedPlans.forEach(newPlan => {
|
||||||
|
const existingPlan = currentOrder.ticketPlans.find(p => p.id === newPlan.id);
|
||||||
|
if (!existingPlan) {
|
||||||
|
currentOrder.ticketPlans.push(newPlan);
|
||||||
|
addedCount++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.isTicketPlanSelectorOpen = false;
|
this.isTicketPlanSelectorOpen = false;
|
||||||
this.$modal.msgSuccess(`已更新收票计划选择,共 ${selectedPlans.length} 条`);
|
if (addedCount > 0) {
|
||||||
|
this.$modal.msgSuccess(`成功补充 ${addedCount} 条收票计划`);
|
||||||
|
} else {
|
||||||
|
this.$modal.msgWarning('没有新的收票计划被添加');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
// Validate main form fields
|
// Validate main form fields
|
||||||
|
|
@ -256,10 +251,6 @@ export default {
|
||||||
this.$modal.msgError('请选择预计收票时间');
|
this.$modal.msgError('请选择预计收票时间');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.form.vendorTicketTime) {
|
|
||||||
this.$modal.msgError('请选择厂家开票时间');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate each payable order's ticket plans
|
// Validate each payable order's ticket plans
|
||||||
for (const order of this.payableOrdersWithPlans) {
|
for (const order of this.payableOrdersWithPlans) {
|
||||||
|
|
@ -289,7 +280,6 @@ export default {
|
||||||
const mergedReceiptData = {
|
const mergedReceiptData = {
|
||||||
ticketBillType: this.form.ticketBillType,
|
ticketBillType: this.form.ticketBillType,
|
||||||
ticketTime: this.form.ticketTime,
|
ticketTime: this.form.ticketTime,
|
||||||
vendorTicketTime: this.form.vendorTicketTime,
|
|
||||||
// Collect all payable orders with their updated ticket plans
|
// Collect all payable orders with their updated ticket plans
|
||||||
payableOrders: this.payableOrdersWithPlans.map(order => ({
|
payableOrders: this.payableOrdersWithPlans.map(order => ({
|
||||||
id: order.id,
|
id: order.id,
|
||||||
|
|
@ -317,7 +307,6 @@ export default {
|
||||||
ticketBillType: 'FROM_PAYABLE',
|
ticketBillType: 'FROM_PAYABLE',
|
||||||
vendorName: '',
|
vendorName: '',
|
||||||
ticketTime: null,
|
ticketTime: null,
|
||||||
vendorTicketTime: null,
|
|
||||||
};
|
};
|
||||||
this.payableOrdersWithPlans = [];
|
this.payableOrdersWithPlans = [];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,8 +128,8 @@
|
||||||
<el-table-column label="项目名称" align="center" prop="projectName" width="150" />
|
<el-table-column label="项目名称" align="center" prop="projectName" width="150" />
|
||||||
<el-table-column label="应付单编号" align="center" prop="payableBillCode" width="150" />
|
<el-table-column label="应付单编号" align="center" prop="payableBillCode" width="150" />
|
||||||
<!-- <el-table-column label="生成时间" align="center" prop="createTime" width="180"/>-->
|
<!-- <el-table-column label="生成时间" align="center" prop="createTime" width="180"/>-->
|
||||||
<el-table-column label="预计付款时间" align="center" prop="planPaymentDate" width="180"/>
|
<el-table-column label="预计付款时间" align="center" prop="estimatedPaymentTime" width="180"/>
|
||||||
<el-table-column label="预计付款金额" align="center" prop="planAmount" width="120" />
|
<el-table-column label="预计付款金额" align="center" prop="totalPriceWithTax" width="120" />
|
||||||
<el-table-column label="该制造商是否有预付单" align="center" prop="hasAdvancePayment" width="150" />
|
<el-table-column label="该制造商是否有预付单" align="center" prop="hasAdvancePayment" width="150" />
|
||||||
<!-- <el-table-column label="预付金额" align="center" prop="advancePaymentAmount" width="120" />-->
|
<!-- <el-table-column label="预付金额" align="center" prop="advancePaymentAmount" width="120" />-->
|
||||||
<el-table-column label="制造商名称" align="center" prop="vendorName" width="150" />
|
<el-table-column label="制造商名称" align="center" prop="vendorName" width="150" />
|
||||||
|
|
@ -167,8 +167,7 @@
|
||||||
<!-- >生成收票单</el-button>-->
|
<!-- >生成收票单</el-button>-->
|
||||||
<!-- </template>-->
|
<!-- </template>-->
|
||||||
<!-- </el-table-column>-->
|
<!-- </el-table-column>-->
|
||||||
<el-table-column label="未付款金额" align="center" prop="unpaidPaymentAmount" width="120" />
|
<el-table-column label="未付款金额" align="center" prop="unpaidAmount" width="120" />
|
||||||
<el-table-column label="未收票金额" align="center" prop="unreceivedTicketAmount" width="120" />
|
|
||||||
<!-- <el-table-column label="付款中金额" align="center" prop="payingAmount" width="120" />-->
|
<!-- <el-table-column label="付款中金额" align="center" prop="payingAmount" width="120" />-->
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160" fixed="right">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,7 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-refresh-left"
|
icon="el-icon-refresh-left"
|
||||||
|
v-show="scope.row.approveStatus=='1'"
|
||||||
@click="handleReturn(scope.row)"
|
@click="handleReturn(scope.row)"
|
||||||
>退回</el-button>
|
>退回</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
|
|
|
||||||
|
|
@ -411,8 +411,7 @@ export default {
|
||||||
productDesc: this.form.productDesc,
|
productDesc: this.form.productDesc,
|
||||||
innerPrice: this.form.price,
|
innerPrice: this.form.price,
|
||||||
warehouseId: this.form.warehouseId,
|
warehouseId: this.form.warehouseId,
|
||||||
warehouseName: this.form.warehouseName,
|
warehouseName: this.form.warehouseName
|
||||||
taxRate: this.form.taxRate
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.form.inventoryInfoList.push(...productsToAdd);
|
this.form.inventoryInfoList.push(...productsToAdd);
|
||||||
|
|
@ -422,7 +421,7 @@ export default {
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
if (this.activeTab==='service'){
|
if (this.activeTab==='service'){
|
||||||
this.queryParams.productTypeList = ['11','22','70'];
|
this.queryParams.productTypeList = ['11','22'];
|
||||||
}else{
|
}else{
|
||||||
this.queryParams.productTypeList = ['1','2','99'];
|
this.queryParams.productTypeList = ['1','2','99'];
|
||||||
}
|
}
|
||||||
|
|
@ -453,7 +452,7 @@ export default {
|
||||||
this.reset();
|
this.reset();
|
||||||
if (type==='maintenance'){
|
if (type==='maintenance'){
|
||||||
this.isServiceIn = true;
|
this.isServiceIn = true;
|
||||||
this.queryProductType=['11','22','70']
|
this.queryProductType=['11','22']
|
||||||
}else{
|
}else{
|
||||||
this.isServiceIn = false;
|
this.isServiceIn = false;
|
||||||
this.queryProductType=['1','2','99']
|
this.queryProductType=['1','2','99']
|
||||||
|
|
@ -480,7 +479,6 @@ export default {
|
||||||
innerPrice: order.price,
|
innerPrice: order.price,
|
||||||
quantity: order.quantity,
|
quantity: order.quantity,
|
||||||
warehouseId: order.warehouseId,
|
warehouseId: order.warehouseId,
|
||||||
taxRate:order.taxRate
|
|
||||||
}];
|
}];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -602,7 +600,6 @@ export default {
|
||||||
item.warehouseId=this.form.warehouseId;
|
item.warehouseId=this.form.warehouseId;
|
||||||
item.warehouseName=this.form.warehouseName;
|
item.warehouseName=this.form.warehouseName;
|
||||||
item.innerPrice=this.form.price;
|
item.innerPrice=this.form.price;
|
||||||
item.taxRate=this.form.taxRate;
|
|
||||||
})
|
})
|
||||||
this.$modal.msgSuccess("导入成功");
|
this.$modal.msgSuccess("导入成功");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -45,13 +45,6 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
|
||||||
<el-col :span="6" v-if="isImported">
|
|
||||||
<el-form-item label="税率" prop="taxRate">
|
|
||||||
<el-input v-model="taxRate" placeholder="请输入税率"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
|
|
@ -184,7 +177,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleSelectPurchaseBeforeImport() {
|
handleSelectPurchaseBeforeImport() {
|
||||||
if (((this.productData.orderType || '1') === '1' ) && !(this.outerData.vendorName.startsWith('新华三') && this.productData.productType==='2')) {
|
if ((this.productData.orderType || '1') === '1') {
|
||||||
this.purchaseOrderSelectVisible = true;
|
this.purchaseOrderSelectVisible = true;
|
||||||
}else{
|
}else{
|
||||||
this.handleImport()
|
this.handleImport()
|
||||||
|
|
@ -221,6 +214,7 @@ export default {
|
||||||
item.warehouseName = this.warehouseName;
|
item.warehouseName = this.warehouseName;
|
||||||
item.warehouseId = this.warehouseId;
|
item.warehouseId = this.warehouseId;
|
||||||
item.innerPrice = this.price;
|
item.innerPrice = this.price;
|
||||||
|
item.taxRate = this.taxRate;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.total = this.snList.length;
|
this.total = this.snList.length;
|
||||||
|
|
@ -246,9 +240,6 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isImported) {
|
|
||||||
this.snList.forEach(item => item.taxRate = this.taxRate)
|
|
||||||
}
|
|
||||||
const data = {
|
const data = {
|
||||||
...this.form,
|
...this.form,
|
||||||
productSnList: this.selectedSnList.map(item => item.productSn),
|
productSnList: this.selectedSnList.map(item => item.productSn),
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<select-project :visible.sync="selectProjectVisible" @project-selected="selectProject"/>
|
<select-project :visible.sync="selectProjectVisible" @project-selected="handleProjectSelected"/>
|
||||||
<select-user :visible.sync="selectUserVisible" @user-selected="handleUserSelected"/>
|
<select-user :visible.sync="selectUserVisible" @user-selected="handleUserSelected"/>
|
||||||
<select-partner :visible.sync="selectPartnerVisible" @partner-selected="handlePartnerSelected"/>
|
<select-partner :visible.sync="selectPartnerVisible" @partner-selected="handlePartnerSelected"/>
|
||||||
<select-commit-type :visible.sync="selectCommitTypeVisible" :order-channel="form.orderChannel" @commit-type-selected="handleCommitTypeSelected"/>
|
<select-commit-type :visible.sync="selectCommitTypeVisible" :order-channel="form.orderChannel" @commit-type-selected="handleCommitTypeSelected"/>
|
||||||
|
|
@ -400,6 +400,8 @@ export default {
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
this.activeContractVersionTab = currentVersion;
|
this.activeContractVersionTab = currentVersion;
|
||||||
|
console.log('11111')
|
||||||
|
console.log(this.projectId)
|
||||||
if (this.projectId) {
|
if (this.projectId) {
|
||||||
getProject(this.projectId).then(response => {
|
getProject(this.projectId).then(response => {
|
||||||
this.handleProjectSelected(response.data.project);
|
this.handleProjectSelected(response.data.project);
|
||||||
|
|
@ -407,11 +409,6 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectProject(projectData){
|
|
||||||
getProject(projectData.id).then(response => {
|
|
||||||
this.handleProjectSelected(response.data.project);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleClose() {
|
handleClose() {
|
||||||
this.$emit('update:visible', false);
|
this.$emit('update:visible', false);
|
||||||
},
|
},
|
||||||
|
|
@ -508,7 +505,6 @@ export default {
|
||||||
this.form.industryType = projectData.industryType;
|
this.form.industryType = projectData.industryType;
|
||||||
this.isProjectSelected = true;
|
this.isProjectSelected = true;
|
||||||
this.selectProjectVisible = false;
|
this.selectProjectVisible = false;
|
||||||
this.form.shipmentAmount = this.totalConfigAmount;
|
|
||||||
},
|
},
|
||||||
openSelectPeople() {
|
openSelectPeople() {
|
||||||
this.selectUserVisible = true;
|
this.selectUserVisible = true;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="制造商" prop="vendorId">
|
<el-form-item label="制造商" prop="vendorId">
|
||||||
<el-select v-model="form.vendorId" placeholder="请选择制造商" style="width:100%" @change="handleVendorChange">
|
<el-select v-model="form.vendorId" placeholder="请选择制造商" style="width:100%" @change="handleVendorChange">
|
||||||
<el-option v-for="item in vendorOptions" :key="item.vendorId" :label="item.vendorAddress" :value="item.vendorId"></el-option>
|
<el-option v-for="item in vendorOptions" :key="item.vendorId" :label="item.vendorName" :value="item.vendorId"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
<el-row v-if="selectedVendor.vendorId">
|
<el-row v-if="selectedVendor.vendorId">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="制造商名称">
|
<el-form-item label="制造商名称">
|
||||||
<span>{{ selectedVendor.vendorName }}</span>
|
<span>{{ selectedVendor.vendorAddress }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
|
||||||
|
|
@ -142,11 +142,6 @@
|
||||||
<span>{{ scope.row.price }}</span>
|
<span>{{ scope.row.price }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="税率(%)" prop="taxRate">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ scope.row.taxRate *100}}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="含税小计" prop="amountTotal"></el-table-column>
|
<el-table-column label="含税小计" prop="amountTotal"></el-table-column>
|
||||||
<el-table-column label="交货日期">
|
<el-table-column label="交货日期">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<svg-icon icon-class="tree" />所属部门
|
<svg-icon icon-class="tree" />所属部门
|
||||||
<div class="pull-right" v-if="user.dept">{{ user.dept.deptName }} </div>
|
<div class="pull-right" v-if="user.dept">{{ user.dept.deptName }} / {{ postGroup }}</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<svg-icon icon-class="peoples" />所属角色
|
<svg-icon icon-class="peoples" />所属角色
|
||||||
|
|
@ -86,8 +86,8 @@ export default {
|
||||||
getUser() {
|
getUser() {
|
||||||
getUserProfile().then(response => {
|
getUserProfile().then(response => {
|
||||||
this.user = response.data
|
this.user = response.data
|
||||||
this.roleGroup = this.user.roles.map(item=>item.roleName).join(',')
|
this.roleGroup = response.roleGroup
|
||||||
|
this.postGroup = response.postGroup
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,14 +55,7 @@ export default {
|
||||||
submit() {
|
submit() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let data={
|
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
|
||||||
userId:this.user.userId,
|
|
||||||
loginName:this.user.loginName,
|
|
||||||
oldPassword: this.user.oldPassword,
|
|
||||||
newPassword: this.user.newPassword,
|
|
||||||
confirmPassword: this.user.newPassword
|
|
||||||
}
|
|
||||||
updateUserPwd(data).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功")
|
this.$modal.msgSuccess("修改成功")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,14 +56,6 @@ public class SysProfileController extends BaseController
|
||||||
mmap.put("postGroup", userService.selectUserPostGroup(user.getUserId()));
|
mmap.put("postGroup", userService.selectUserPostGroup(user.getUserId()));
|
||||||
return prefix + "/profile";
|
return prefix + "/profile";
|
||||||
}
|
}
|
||||||
@GetMapping("/vue")
|
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult profileVue()
|
|
||||||
{
|
|
||||||
SysUser user = getSysUser();
|
|
||||||
|
|
||||||
return AjaxResult.success(user);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/checkPassword")
|
@GetMapping("/checkPassword")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.sip.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.sip.domain.OmsPaymentBill;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
|
@ -17,6 +18,8 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.sip.service.IOmsPaymentBillService;
|
import com.ruoyi.sip.service.IOmsPaymentBillService;
|
||||||
import com.ruoyi.sip.service.IOmsInvoiceReceiptBillService;
|
import com.ruoyi.sip.service.IOmsInvoiceReceiptBillService;
|
||||||
|
import com.ruoyi.sip.domain.OmsInvoiceReceiptBill;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
|
||||||
import com.ruoyi.sip.domain.dto.MergedPaymentDataDto;
|
import com.ruoyi.sip.domain.dto.MergedPaymentDataDto;
|
||||||
import com.ruoyi.sip.domain.dto.MergedReceiptDataDto;
|
import com.ruoyi.sip.domain.dto.MergedReceiptDataDto;
|
||||||
|
|
@ -86,17 +89,17 @@ public class OmsPayableBillController extends BaseController
|
||||||
return prefix + "/add";
|
return prefix + "/add";
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * 新增保存采购应付单
|
* 新增保存采购应付单
|
||||||
// */
|
*/
|
||||||
// @RequiresPermissions("finance:payable:add")
|
@RequiresPermissions("finance:payable:add")
|
||||||
// @Log(title = "采购应付单", businessType = BusinessType.INSERT)
|
@Log(title = "采购应付单", businessType = BusinessType.INSERT)
|
||||||
// @PostMapping("/add")
|
@PostMapping("/add")
|
||||||
// @ResponseBody
|
@ResponseBody
|
||||||
// public AjaxResult addSave(OmsPayableBill omsPayableBill)
|
public AjaxResult addSave(OmsPayableBill omsPayableBill)
|
||||||
// {
|
{
|
||||||
// return toAjax(omsPayableBillService.insertOmsPayableBill(omsPayableBill, vendorInfo.getPayConfigDay()));
|
return toAjax(omsPayableBillService.insertOmsPayableBill(omsPayableBill));
|
||||||
// }
|
}
|
||||||
@RequiresPermissions("finance:payable:query")
|
@RequiresPermissions("finance:payable:query")
|
||||||
@Log(title = "采购应付单", businessType = BusinessType.INSERT)
|
@Log(title = "采购应付单", businessType = BusinessType.INSERT)
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
|
|
|
||||||
|
|
@ -142,13 +142,6 @@ public class ProjectOrderInfoController extends BaseController
|
||||||
// return prefix + "/approve";
|
// return prefix + "/approve";
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
@PostMapping("/order/approve/batch")
|
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult approveOrderBatch(@RequestBody Todo todo) {
|
|
||||||
projectOrderInfoService.approveOrderBatch(todo);
|
|
||||||
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 查询订单管理列表
|
* 查询订单管理列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.ruoyi.sip.domain;
|
package com.ruoyi.sip.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,5 @@ public class InventoryOuterDetail extends BaseEntity
|
||||||
private String productCode;
|
private String productCode;
|
||||||
private String model;
|
private String model;
|
||||||
private String productName;
|
private String productName;
|
||||||
private String productType;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ public class OmsPayableBill extends BaseEntity
|
||||||
|
|
||||||
/** 主键ID */
|
/** 主键ID */
|
||||||
private Long id;
|
private Long id;
|
||||||
private List<Long> idList;
|
|
||||||
|
|
||||||
/** 应付单编号 */
|
/** 应付单编号 */
|
||||||
@Excel(name = "应付单编号")
|
@Excel(name = "应付单编号")
|
||||||
|
|
@ -33,10 +32,10 @@ public class OmsPayableBill extends BaseEntity
|
||||||
@Excel(name = "生成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "生成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/** 最后付款计划ID */
|
/** 预计付款时间 */
|
||||||
private Long lastPaymentPlanId;
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
/** 最后票据计划ID */
|
@Excel(name = "预计付款时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Long lastTicketPlanId;
|
private Date estimatedPaymentTime;
|
||||||
|
|
||||||
/** 制造商编码 */
|
/** 制造商编码 */
|
||||||
@Excel(name = "制造商编码")
|
@Excel(name = "制造商编码")
|
||||||
|
|
@ -72,7 +71,6 @@ public class OmsPayableBill extends BaseEntity
|
||||||
/** 税额 */
|
/** 税额 */
|
||||||
@Excel(name = "税额")
|
@Excel(name = "税额")
|
||||||
private BigDecimal taxAmount;
|
private BigDecimal taxAmount;
|
||||||
private BigDecimal taxRate;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -84,34 +82,12 @@ public class OmsPayableBill extends BaseEntity
|
||||||
private Date estimatedPaymentTimeEnd;
|
private Date estimatedPaymentTimeEnd;
|
||||||
private Date estimatedPaymentTimeStart;
|
private Date estimatedPaymentTimeStart;
|
||||||
|
|
||||||
|
private BigDecimal unpaidAmount;
|
||||||
|
private BigDecimal paidAmount;
|
||||||
|
private BigDecimal payingAmount;
|
||||||
|
|
||||||
/** 已付款金额 */
|
|
||||||
@Excel(name = "已付款金额")
|
|
||||||
private BigDecimal paidPaymentAmount;
|
|
||||||
|
|
||||||
/** 未付款金额 */
|
|
||||||
@Excel(name = "未付款金额")
|
|
||||||
private BigDecimal unpaidPaymentAmount;
|
|
||||||
|
|
||||||
/** 已收票金额 */
|
|
||||||
@Excel(name = "已收票金额")
|
|
||||||
private BigDecimal receivedTicketAmount;
|
|
||||||
|
|
||||||
/** 未收票金额 */
|
|
||||||
@Excel(name = "未收票金额")
|
|
||||||
private BigDecimal unreceivedTicketAmount;
|
|
||||||
|
|
||||||
/** 计划付款日期 */
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
|
||||||
private Date planPaymentDate;
|
|
||||||
private Date planTicketDate;
|
|
||||||
|
|
||||||
/** 计划金额 */
|
|
||||||
private BigDecimal planAmount;
|
|
||||||
private BigDecimal planTicketAmount;
|
|
||||||
|
|
||||||
private Date planPaymentDateStart;
|
|
||||||
private Date planPaymentDateEnd;
|
|
||||||
|
|
||||||
private List<OmsPayablePaymentDetail> detailList;
|
private List<OmsPayablePaymentDetail> detailList;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,13 +124,13 @@ public class VendorInfo extends BaseEntity
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
public enum PayTypeEnum {
|
public enum PayTypeEnum {
|
||||||
INNER_PAY(0, "入库付款"),
|
INNER_PAY("0", "入库付款"),
|
||||||
OUTER_PAY(1, "出库付款"),
|
OUTER_PAY("1", "出库付款"),
|
||||||
;
|
;
|
||||||
private final String desc;
|
private final String desc;
|
||||||
private final Integer code;
|
private final String code;
|
||||||
|
|
||||||
PayTypeEnum(Integer code, String desc) {
|
PayTypeEnum(String code, String desc) {
|
||||||
this.desc = desc;
|
this.desc = desc;
|
||||||
this.code = code;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import java.util.List;
|
||||||
public class MergedReceiptDataDto {
|
public class MergedReceiptDataDto {
|
||||||
private String ticketBillType;
|
private String ticketBillType;
|
||||||
private Date ticketTime;
|
private Date ticketTime;
|
||||||
private Date vendorTicketTime;
|
|
||||||
private List<PayableOrderReceiptDto> payableOrders;
|
private List<PayableOrderReceiptDto> payableOrders;
|
||||||
private BigDecimal totalMergeTicketAmount;
|
private BigDecimal totalMergeTicketAmount;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,12 @@ package com.ruoyi.sip.domain.dto;
|
||||||
import com.ruoyi.sip.domain.OmsPayablePaymentPlan;
|
import com.ruoyi.sip.domain.OmsPayablePaymentPlan;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class PayableOrderDto {
|
public class PayableOrderDto {
|
||||||
private Long id;
|
private Long id;
|
||||||
private String payableBillCode;
|
private String payableBillCode;
|
||||||
private BigDecimal taxRate;
|
|
||||||
private List<OmsPayablePaymentPlan> paymentPlans;
|
private List<OmsPayablePaymentPlan> paymentPlans;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,11 @@ package com.ruoyi.sip.domain.dto;
|
||||||
import com.ruoyi.sip.domain.OmsPayableTicketPlan;
|
import com.ruoyi.sip.domain.OmsPayableTicketPlan;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class PayableOrderReceiptDto {
|
public class PayableOrderReceiptDto {
|
||||||
private Long id;
|
private Long id;
|
||||||
private String payableBillCode;
|
private String payableBillCode;
|
||||||
private BigDecimal taxRate;
|
|
||||||
private List<OmsPayableTicketPlan> ticketPlans;
|
private List<OmsPayableTicketPlan> ticketPlans;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,21 +53,11 @@ public interface OmsPayableBillMapper
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除采购应付单
|
* 批量删除采购应付单
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的数据主键集合
|
* @param ids 需要删除的数据主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteOmsPayableBillByIds(String[] ids);
|
public int deleteOmsPayableBillByIds(String[] ids);
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量更新应付单的付款相关信息
|
|
||||||
*
|
|
||||||
* @param payableBills 需要更新的应付单列表
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
public int updateBatchPayableBillPaymentInfo(List<OmsPayableBill> payableBills);
|
|
||||||
|
|
||||||
Integer selectMaxCodeByPrefix(String codePrefix);
|
Integer selectMaxCodeByPrefix(String codePrefix);
|
||||||
|
|
||||||
int updateBatchPayableBillTicketInfo(List<OmsPayableBill> omsPayableBills);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,4 @@ public interface OmsPayablePaymentDetailMapper {
|
||||||
void insertBatch(List<OmsPayablePaymentDetail> addList);
|
void insertBatch(List<OmsPayablePaymentDetail> addList);
|
||||||
|
|
||||||
List<PaymentBillPayableDetailDTO> listPayableByPaymentCode(List<String> paymentBillCodeList);
|
List<PaymentBillPayableDetailDTO> listPayableByPaymentCode(List<String> paymentBillCodeList);
|
||||||
|
|
||||||
List<OmsPayablePaymentDetail> selectByPaymentPlanIds(@Param("paymentPlanIds") List<Long> paymentPlanIds);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,4 @@ public interface OmsPayablePaymentPlanMapper {
|
||||||
* @return 付款计划ID列表
|
* @return 付款计划ID列表
|
||||||
*/
|
*/
|
||||||
public List<Long> selectOmsPayablePaymentPlanIdsByPayableBillId(Long payableBillId);
|
public List<Long> selectOmsPayablePaymentPlanIdsByPayableBillId(Long payableBillId);
|
||||||
|
|
||||||
OmsPayablePaymentPlan firstUnPayPlan(Long payableBillId);
|
|
||||||
|
|
||||||
List<OmsPayablePaymentPlan> listDetailByPayableBillIdList(List<Long> idList);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,4 @@ public interface OmsPayableTicketDetailMapper
|
||||||
|
|
||||||
List<OmsPayableTicketDetail> listByPayableBillIdList(List<Long> payableBillId);
|
List<OmsPayableTicketDetail> listByPayableBillIdList(List<Long> payableBillId);
|
||||||
|
|
||||||
List<OmsPayableTicketDetail> selectByTicketPlanIds(List<Long> ticketPlanIds);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -58,6 +58,4 @@ public interface OmsPayableTicketPlanMapper
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteOmsPayableTicketPlanByIds(Long[] ids);
|
public int deleteOmsPayableTicketPlanByIds(Long[] ids);
|
||||||
|
|
||||||
OmsPayableTicketPlan firstUnPayPlan(Long payableBillId);
|
|
||||||
}
|
}
|
||||||
|
|
@ -32,12 +32,11 @@ public interface IOmsPayableBillService
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增采购应付单
|
* 新增采购应付单
|
||||||
*
|
*
|
||||||
* @param omsPayableBill 采购应付单
|
* @param omsPayableBill 采购应付单
|
||||||
* @param payConfigDay
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertOmsPayableBill(OmsPayableBill omsPayableBill, Integer payConfigDay);
|
public int insertOmsPayableBill(OmsPayableBill omsPayableBill);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改采购应付单
|
* 修改采购应付单
|
||||||
|
|
@ -78,8 +77,6 @@ public interface IOmsPayableBillService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int mergeAndInitiateReceipt(MergedReceiptDataDto dto);
|
public int mergeAndInitiateReceipt(MergedReceiptDataDto dto);
|
||||||
public int updatePaymentAmount(List<Long> idList);
|
|
||||||
public int updateTicketAmount(List<Long> idList);
|
|
||||||
|
|
||||||
OmsPayableBill query(Long id);
|
OmsPayableBill query(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,4 @@ public interface IOmsPayablePaymentDetailService {
|
||||||
void applyRefund(String payableBillCode, String payableBillCode1);
|
void applyRefund(String payableBillCode, String payableBillCode1);
|
||||||
|
|
||||||
List<PaymentBillPayableDetailDTO> listPayableByPaymentCode(String paymentBillCode);
|
List<PaymentBillPayableDetailDTO> listPayableByPaymentCode(String paymentBillCode);
|
||||||
|
|
||||||
List<OmsPayablePaymentDetail> selectByPaymentPlanIds(List<Long> paymentPlanIds);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,4 @@ public interface IOmsPayableTicketDetailService
|
||||||
void clearRelationPayable(String ticketBillCode);
|
void clearRelationPayable(String ticketBillCode);
|
||||||
|
|
||||||
List<OmsPayableTicketDetail> listByPayableBillIdList(List<Long> collect);
|
List<OmsPayableTicketDetail> listByPayableBillIdList(List<Long> collect);
|
||||||
|
|
||||||
List<OmsPayableTicketDetail> selectByTicketPlanIds(List<Long> ticketPlanIds);
|
|
||||||
}
|
}
|
||||||
|
|
@ -103,6 +103,4 @@ public interface IProjectOrderInfoService
|
||||||
|
|
||||||
String financeExport(ProjectOrderInfo projectOrderInfo);
|
String financeExport(ProjectOrderInfo projectOrderInfo);
|
||||||
|
|
||||||
void approveOrderBatch(Todo todo);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.ShiroUtils;
|
import com.ruoyi.common.utils.ShiroUtils;
|
||||||
|
|
@ -61,7 +62,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOmsPayableBillService payableBillService;
|
private IOmsPayableBillService payableBillService;
|
||||||
|
|
||||||
@Value("${oms.inventory.innerTax:0.13}")
|
@Value("${oms.inventory.innerTax:1.13}")
|
||||||
private String defaultTax;
|
private String defaultTax;
|
||||||
/**
|
/**
|
||||||
* 查询产品库存
|
* 查询产品库存
|
||||||
|
|
@ -246,26 +247,23 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
||||||
}
|
}
|
||||||
OmsPayableBill payableBill = new OmsPayableBill();
|
OmsPayableBill payableBill = new OmsPayableBill();
|
||||||
payableBill.setProductCode(inventoryOuter.getProductCode());
|
payableBill.setProductCode(inventoryOuter.getProductCode());
|
||||||
// payableBill.setEstimatedPaymentTime(DateUtils.addDays(DateUtils.getNowDate(), vendorInfo.getPayConfigDay()));
|
payableBill.setEstimatedPaymentTime(DateUtils.addDays(DateUtils.getNowDate(), vendorInfo.getPayConfigDay()));
|
||||||
payableBill.setProductType(productInfo.getType());
|
payableBill.setProductType(productInfo.getType());
|
||||||
payableBill.setVendorCode(productInfo.getVendorCode());
|
payableBill.setVendorCode(productInfo.getVendorCode());
|
||||||
payableBill.setInventoryCode(inventoryDelivery.getOuterCode());
|
payableBill.setInventoryCode(inventoryDelivery.getOuterCode());
|
||||||
BigDecimal allPrice = inventoryInfos.stream().map(InventoryInfo::getInnerPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
|
BigDecimal allPrice = inventoryInfos.stream().map(InventoryInfo::getInnerPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
payableBill.setTotalPriceWithTax(allPrice);
|
payableBill.setTotalPriceWithTax(allPrice);
|
||||||
BigDecimal defaultTaxRate = new BigDecimal(defaultTax);
|
payableBill.setTotalPriceWithoutTax(allPrice.divide(new BigDecimal(defaultTax), 2, RoundingMode.HALF_UP));
|
||||||
BigDecimal allPriceWithOutTax = inventoryInfos.stream().map(item ->
|
|
||||||
{
|
|
||||||
BigDecimal taxRate = item.getTaxRate() == null ? defaultTaxRate : item.getTaxRate();
|
|
||||||
return item.getInnerPrice().divide(BigDecimal.ONE.add(taxRate), 2, RoundingMode.HALF_UP);
|
|
||||||
})
|
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
||||||
payableBill.setTaxRate(inventoryInfos.get(0).getTaxRate() == null ? defaultTaxRate : inventoryInfos.get(0).getTaxRate());
|
|
||||||
payableBill.setTotalPriceWithoutTax(allPriceWithOutTax);
|
|
||||||
payableBill.setTaxAmount(allPrice.subtract(payableBill.getTotalPriceWithoutTax()));
|
payableBill.setTaxAmount(allPrice.subtract(payableBill.getTotalPriceWithoutTax()));
|
||||||
payableBill.setProductCode(inventoryDelivery.getProductCode());
|
payableBill.setProjectCode(inventoryDelivery.getProjectCode());
|
||||||
payableBill.setOrderCode(inventoryDelivery.getOrderCode());
|
payableBill.setOrderCode(inventoryDelivery.getOrderCode());
|
||||||
payableBillService.insertOmsPayableBill(payableBill, vendorInfo.getPayConfigDay());
|
payableBillService.insertOmsPayableBill(payableBill);
|
||||||
List<InventoryInfo> saveList = inventoryInfos.stream().peek(item -> item.setPayableBillCode(payableBill.getPayableBillCode())).collect(Collectors.toList());
|
List<InventoryInfo> saveList = inventoryInfos.stream().map(item -> {
|
||||||
|
InventoryInfo inventoryInfo = new InventoryInfo();
|
||||||
|
inventoryInfo.setProductSn(item.getProductSn());
|
||||||
|
inventoryInfo.setPayableBillCode(payableBill.getPayableBillCode());
|
||||||
|
return inventoryInfo;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
inventoryInfoService.saveBatch(saveList);
|
inventoryInfoService.saveBatch(saveList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -313,10 +311,6 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void recall(Long id) {
|
public void recall(Long id) {
|
||||||
//todo 判断应付或应收状态 不允许退
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
InventoryDelivery inventoryDelivery = inventoryDeliveryMapper.selectInventoryDeliveryById(id);
|
InventoryDelivery inventoryDelivery = inventoryDeliveryMapper.selectInventoryDeliveryById(id);
|
||||||
deleteInventoryOuterById(id);
|
deleteInventoryOuterById(id);
|
||||||
List<ProjectProductInfo> projectProductInfos = projectProductInfoService.listDeliveryProductByOrderCode(Collections.singletonList(inventoryDelivery.getOrderCode()));
|
List<ProjectProductInfo> projectProductInfos = projectProductInfoService.listDeliveryProductByOrderCode(Collections.singletonList(inventoryDelivery.getOrderCode()));
|
||||||
|
|
@ -351,6 +345,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
||||||
//修改累计发货数量
|
//修改累计发货数量
|
||||||
productInfoService.updateCumulativeCount(-inventoryDelivery.getQuantity(), inventoryDelivery.getProductCode());
|
productInfoService.updateCumulativeCount(-inventoryDelivery.getQuantity(), inventoryDelivery.getProductCode());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,6 @@ public class InventoryOuterServiceImpl implements IInventoryOuterService
|
||||||
vo.setId(item.getId());
|
vo.setId(item.getId());
|
||||||
vo.setProductCode(item.getProductCode());
|
vo.setProductCode(item.getProductCode());
|
||||||
vo.setModel(item.getModel());
|
vo.setModel(item.getModel());
|
||||||
vo.setProductType(item.getProductType());
|
|
||||||
vo.setQuantity(item.getQuantity());
|
vo.setQuantity(item.getQuantity());
|
||||||
vo.setWarehouseId(item.getWarehouseId());
|
vo.setWarehouseId(item.getWarehouseId());
|
||||||
vo.setWarehouseName(item.getWarehouseName());
|
vo.setWarehouseName(item.getWarehouseName());
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ import com.ruoyi.common.utils.ShiroUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.sip.domain.*;
|
import com.ruoyi.sip.domain.*;
|
||||||
import com.ruoyi.sip.dto.inventory.InventoryInfoExcelDto;
|
import com.ruoyi.sip.dto.inventory.InventoryInfoExcelDto;
|
||||||
import com.ruoyi.sip.dto.inventory.OmsPurchaseOrderItemDto;
|
|
||||||
import com.ruoyi.sip.service.*;
|
import com.ruoyi.sip.service.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
|
@ -50,10 +49,9 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOmsPurchaseOrderService purchaseOrderService;
|
private IOmsPurchaseOrderService purchaseOrderService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOmsPayableBillService payableBillService;
|
private IOmsPayableBillService payableBillService;
|
||||||
@Value("${oms.inventory.innerTax:0.13}")
|
@Value("${oms.inventory.innerTax:1.13}")
|
||||||
private String defaultTax;
|
private String defaultTax;
|
||||||
/**
|
/**
|
||||||
* 查询入库单信息
|
* 查询入库单信息
|
||||||
|
|
@ -149,32 +147,19 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
||||||
if (vendorInfo != null && VendorInfo.PayTypeEnum.INNER_PAY.getCode().equals(vendorInfo.getPayType())) {
|
if (vendorInfo != null && VendorInfo.PayTypeEnum.INNER_PAY.getCode().equals(vendorInfo.getPayType())) {
|
||||||
BigDecimal reduce = inventoryInfoList.stream().map(InventoryInfo::getInnerPrice).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
BigDecimal reduce = inventoryInfoList.stream().map(InventoryInfo::getInnerPrice).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
//服务金额为单价* 数量 没有具体的详情
|
//服务金额为单价* 数量 没有具体的详情
|
||||||
BigDecimal totalPriceWithTax = Arrays.asList("11", "22").contains(omsInventoryInner.getProductType()) ?
|
BigDecimal totalPriceWithTax =Arrays.asList("11","22").contains(omsInventoryInner.getProductCode())?
|
||||||
reduce.multiply(new BigDecimal(omsInventoryInner.getQuantity())).setScale(2, RoundingMode.HALF_UP)
|
reduce.multiply(new BigDecimal(omsInventoryInner.getQuantity())).setScale(2, RoundingMode.HALF_UP)
|
||||||
: reduce;
|
: reduce;
|
||||||
//生成应付单
|
//生成应付单
|
||||||
payableBill.setInventoryCode(omsInventoryInner.getInnerCode());
|
payableBill.setInventoryCode(omsInventoryInner.getInnerCode());
|
||||||
payableBill.setVendorCode(omsInventoryInner.getVendorCode());
|
payableBill.setVendorCode(omsInventoryInner.getVendorCode());
|
||||||
payableBill.setProductType(productInfos.get(0).getType());
|
payableBill.setProductType(productInfos.get(0).getType());
|
||||||
payableBill.setProductCode(omsInventoryInner.getProductCode());
|
payableBill.setProjectCode(omsInventoryInner.getProductCode());
|
||||||
|
payableBill.setEstimatedPaymentTime(DateUtils.addDays(DateUtils.getNowDate(), vendorInfo.getPayConfigDay()));
|
||||||
payableBill.setTotalPriceWithTax(totalPriceWithTax);
|
payableBill.setTotalPriceWithTax(totalPriceWithTax);
|
||||||
String purchaseNo = omsInventoryInner.getPurchaseNo();
|
payableBill.setTotalPriceWithoutTax(totalPriceWithTax.divide(new BigDecimal(defaultTax), 2, RoundingMode.HALF_UP));
|
||||||
BigDecimal taxRate = null;
|
|
||||||
if (StringUtils.isNotEmpty(purchaseNo)) {
|
|
||||||
OmsPurchaseOrderItemDto query = new OmsPurchaseOrderItemDto();
|
|
||||||
query.setPurchaseNo(purchaseNo);
|
|
||||||
List<OmsPurchaseOrderItemDto> omsPurchaseOrderItemDtos = purchaseOrderService.listItem(query);
|
|
||||||
Map<String, BigDecimal> decimalMap = omsPurchaseOrderItemDtos.stream().collect(Collectors.toMap(OmsPurchaseOrderItemDto::getProductCode, OmsPurchaseOrderItemDto::getTaxRate, (v1, v2) -> v1));
|
|
||||||
taxRate = decimalMap.get(omsInventoryInner.getProductCode());
|
|
||||||
|
|
||||||
}
|
|
||||||
BigDecimal finalTaxRate = taxRate == null ? new BigDecimal(defaultTax) : taxRate;
|
|
||||||
BigDecimal withoutTax = inventoryInfoList.stream().reduce(BigDecimal.ZERO, (a, b) -> a.add(b.getInnerPrice().divide(BigDecimal.ONE.add(finalTaxRate), 2, RoundingMode.HALF_UP)), BigDecimal::add);
|
|
||||||
payableBill.setTotalPriceWithoutTax(withoutTax);
|
|
||||||
payableBill.setTaxRate(finalTaxRate);
|
|
||||||
payableBill.setTaxAmount(totalPriceWithTax);
|
|
||||||
payableBill.setTaxAmount(totalPriceWithTax.subtract(payableBill.getTotalPriceWithoutTax()));
|
payableBill.setTaxAmount(totalPriceWithTax.subtract(payableBill.getTotalPriceWithoutTax()));
|
||||||
payableBillService.insertOmsPayableBill(payableBill, vendorInfo.getPayConfigDay());
|
payableBillService.insertOmsPayableBill(payableBill);
|
||||||
}
|
}
|
||||||
inventoryInfoList.forEach(item->{
|
inventoryInfoList.forEach(item->{
|
||||||
item.setInnerCode(omsInventoryInner.getInnerCode());
|
item.setInnerCode(omsInventoryInner.getInnerCode());
|
||||||
|
|
@ -291,7 +276,7 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
||||||
throw new ServiceException("产品编码对应产品未找到");
|
throw new ServiceException("产品编码对应产品未找到");
|
||||||
}
|
}
|
||||||
Map<String, OmsWarehouseInfo> warehouseInfoMap=Collections.emptyMap();
|
Map<String, OmsWarehouseInfo> warehouseInfoMap=Collections.emptyMap();
|
||||||
if ("2".equalsIgnoreCase(orderType) || (("2".equalsIgnoreCase(productInfos.get(0).getType()) && productInfos.get(0).getVendorName().startsWith("新华三"))) ){
|
if ("2".equalsIgnoreCase(orderType)){
|
||||||
List<String> warehouseNameList = inventoryInfoExcelDtoList.stream().map(InventoryInfoExcelDto::getWarehouseName).distinct().collect(Collectors.toList());
|
List<String> warehouseNameList = inventoryInfoExcelDtoList.stream().map(InventoryInfoExcelDto::getWarehouseName).distinct().collect(Collectors.toList());
|
||||||
if (warehouseNameList.size() > 1){
|
if (warehouseNameList.size() > 1){
|
||||||
throw new ServiceException("导入清单只能有一个仓库");
|
throw new ServiceException("导入清单只能有一个仓库");
|
||||||
|
|
@ -312,7 +297,7 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
||||||
info.setModel(productInfos.get(0).getModel());
|
info.setModel(productInfos.get(0).getModel());
|
||||||
info.setProductDesc(productInfos.get(0).getDescription());
|
info.setProductDesc(productInfos.get(0).getDescription());
|
||||||
info.setInnerPrice(item.getInnerPrice());
|
info.setInnerPrice(item.getInnerPrice());
|
||||||
if ("2".equalsIgnoreCase(orderType)|| (("2".equalsIgnoreCase(productInfos.get(0).getType()) && productInfos.get(0).getVendorName().startsWith("新华三"))) ){
|
if ("2".equalsIgnoreCase(orderType)){
|
||||||
OmsWarehouseInfo omsWarehouseInfo = finalWarehouseInfoMap.get(item.getWarehouseName());
|
OmsWarehouseInfo omsWarehouseInfo = finalWarehouseInfoMap.get(item.getWarehouseName());
|
||||||
info.setWarehouseId(omsWarehouseInfo.getId());
|
info.setWarehouseId(omsWarehouseInfo.getId());
|
||||||
info.setWarehouseName(omsWarehouseInfo.getWarehouseName());
|
info.setWarehouseName(omsWarehouseInfo.getWarehouseName());
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,9 @@ import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.ruoyi.common.core.text.Convert;
|
import com.ruoyi.common.core.text.Convert;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.PageUtils;
|
import com.ruoyi.common.utils.PageUtils;
|
||||||
import com.ruoyi.common.utils.ShiroUtils;
|
import com.ruoyi.common.utils.ShiroUtils;
|
||||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
|
||||||
import com.ruoyi.sip.domain.*;
|
import com.ruoyi.sip.domain.*;
|
||||||
import com.ruoyi.sip.domain.dto.MergedPaymentDataDto;
|
import com.ruoyi.sip.domain.dto.MergedPaymentDataDto;
|
||||||
import com.ruoyi.sip.domain.dto.MergedReceiptDataDto;
|
import com.ruoyi.sip.domain.dto.MergedReceiptDataDto;
|
||||||
|
|
@ -16,10 +14,8 @@ import com.ruoyi.sip.domain.dto.PayableOrderDto;
|
||||||
import com.ruoyi.sip.domain.dto.PayableOrderReceiptDto;
|
import com.ruoyi.sip.domain.dto.PayableOrderReceiptDto;
|
||||||
import com.ruoyi.sip.mapper.OmsPayableBillMapper;
|
import com.ruoyi.sip.mapper.OmsPayableBillMapper;
|
||||||
import com.ruoyi.sip.mapper.OmsPayablePaymentPlanMapper;
|
import com.ruoyi.sip.mapper.OmsPayablePaymentPlanMapper;
|
||||||
import com.ruoyi.sip.mapper.OmsPayableTicketPlanMapper;
|
|
||||||
import com.ruoyi.sip.service.*;
|
import com.ruoyi.sip.service.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
@ -36,7 +32,6 @@ import java.util.stream.Collectors;
|
||||||
* @date 2025-10-22
|
* @date 2025-10-22
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
|
public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private OmsPayableBillMapper omsPayableBillMapper;
|
private OmsPayableBillMapper omsPayableBillMapper;
|
||||||
|
|
@ -44,8 +39,6 @@ public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private OmsPayablePaymentPlanMapper omsPayablePaymentPlanMapper;
|
private OmsPayablePaymentPlanMapper omsPayablePaymentPlanMapper;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private OmsPayableTicketPlanMapper omsPayableTicketPlanMapper;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOmsPaymentBillService omsPaymentBillService;
|
private IOmsPaymentBillService omsPaymentBillService;
|
||||||
|
|
||||||
|
|
@ -59,8 +52,7 @@ public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOmsPayableTicketDetailService omsPayableTicketDetailService;
|
private IOmsPayableTicketDetailService omsPayableTicketDetailService;
|
||||||
@Value("${oms.inventory.innerTax:0.13}")
|
|
||||||
private String defaultTax;
|
|
||||||
/**
|
/**
|
||||||
* 查询采购应付单
|
* 查询采购应付单
|
||||||
*
|
*
|
||||||
|
|
@ -81,7 +73,27 @@ public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
|
||||||
@Override
|
@Override
|
||||||
public List<OmsPayableBill> selectOmsPayableBillList(OmsPayableBill omsPayableBill) {
|
public List<OmsPayableBill> selectOmsPayableBillList(OmsPayableBill omsPayableBill) {
|
||||||
List<OmsPayableBill> omsPayableBills = omsPayableBillMapper.selectOmsPayableBillList(omsPayableBill);
|
List<OmsPayableBill> omsPayableBills = omsPayableBillMapper.selectOmsPayableBillList(omsPayableBill);
|
||||||
//todo 是否有预付单信息
|
PageUtils.clearPage();
|
||||||
|
if (CollUtil.isNotEmpty(omsPayableBills)){
|
||||||
|
List<Long> idList = omsPayableBills.stream().map(OmsPayableBill::getId).distinct().collect(Collectors.toList());
|
||||||
|
List<OmsPayablePaymentDetail> omsPayablePaymentDetails = omsPayablePaymentDetailService.listByPayableBillIdList(idList);
|
||||||
|
Map<Long, Map<String, BigDecimal>> planMap = omsPayablePaymentDetails.stream().collect(Collectors.groupingBy(OmsPayablePaymentDetail::getPayableBillId,
|
||||||
|
Collectors.groupingBy(
|
||||||
|
item->item.getPaymentStatus()==null?OmsPaymentBill.PaymentStatusEnum.WAIT_PAYMENT.getCode(): item.getPaymentStatus(),
|
||||||
|
Collectors.reducing(
|
||||||
|
BigDecimal.ZERO,
|
||||||
|
detail -> (detail.getPaymentAmount() != null) ? detail.getPaymentAmount() : BigDecimal.ZERO,
|
||||||
|
BigDecimal::add
|
||||||
|
))));
|
||||||
|
omsPayableBills.forEach(bill -> {
|
||||||
|
|
||||||
|
bill.setPaidAmount(planMap.getOrDefault(bill.getId(), Collections.emptyMap()).getOrDefault(OmsPaymentBill.PaymentStatusEnum.PAYMENT.getCode(), BigDecimal.ZERO));
|
||||||
|
bill.setPayingAmount(planMap.getOrDefault(bill.getId(), Collections.emptyMap()).getOrDefault(OmsPaymentBill.PaymentStatusEnum.WAIT_PAYMENT.getCode(), BigDecimal.ZERO));
|
||||||
|
bill.setUnpaidAmount(bill.getTotalPriceWithTax().subtract(bill.getPaidAmount()).subtract(bill.getPayingAmount()));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return omsPayableBills;
|
return omsPayableBills;
|
||||||
}
|
}
|
||||||
|
|
@ -90,19 +102,12 @@ public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
|
||||||
* 新增采购应付单
|
* 新增采购应付单
|
||||||
*
|
*
|
||||||
* @param omsPayableBill 采购应付单
|
* @param omsPayableBill 采购应付单
|
||||||
* @param payConfigDay
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int insertOmsPayableBill(OmsPayableBill omsPayableBill, Integer payConfigDay) {
|
public int insertOmsPayableBill(OmsPayableBill omsPayableBill) {
|
||||||
//生成采购应付单编号
|
//生成采购应付单编号
|
||||||
|
|
||||||
omsPayableBill.setUnpaidPaymentAmount(omsPayableBill.getTotalPriceWithTax());
|
|
||||||
omsPayableBill.setUnreceivedTicketAmount(omsPayableBill.getTotalPriceWithTax());
|
|
||||||
omsPayableBill.setPaidPaymentAmount(BigDecimal.ZERO);
|
|
||||||
omsPayableBill.setReceivedTicketAmount(BigDecimal.ZERO);
|
|
||||||
|
|
||||||
omsPayableBill.setPayableBillCode(generatePayableBillCode());
|
omsPayableBill.setPayableBillCode(generatePayableBillCode());
|
||||||
omsPayableBill.setCreateTime(DateUtils.getNowDate());
|
omsPayableBill.setCreateTime(DateUtils.getNowDate());
|
||||||
omsPayableBill.setCreateBy(ShiroUtils.getUserId().toString());
|
omsPayableBill.setCreateBy(ShiroUtils.getUserId().toString());
|
||||||
|
|
@ -112,33 +117,13 @@ public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
|
||||||
if (rows > 0) {
|
if (rows > 0) {
|
||||||
OmsPayablePaymentPlan defaultPlan = new OmsPayablePaymentPlan();
|
OmsPayablePaymentPlan defaultPlan = new OmsPayablePaymentPlan();
|
||||||
defaultPlan.setPayableBillId(omsPayableBill.getId());
|
defaultPlan.setPayableBillId(omsPayableBill.getId());
|
||||||
defaultPlan.setPlanPaymentDate(DateUtils.addDays(DateUtils.getNowDate(), payConfigDay));
|
defaultPlan.setPlanPaymentDate(omsPayableBill.getEstimatedPaymentTime());
|
||||||
defaultPlan.setPlanAmount(omsPayableBill.getTotalPriceWithTax());
|
defaultPlan.setPlanAmount(omsPayableBill.getTotalPriceWithTax());
|
||||||
defaultPlan.setPlanRate(new java.math.BigDecimal("100"));
|
defaultPlan.setPlanRate(new java.math.BigDecimal(100));
|
||||||
defaultPlan.setRemark("默认付款计划");
|
defaultPlan.setRemark("默认付款计划");
|
||||||
defaultPlan.setCreateBy(ShiroUtils.getUserId().toString());
|
defaultPlan.setCreateBy(ShiroUtils.getLoginName());
|
||||||
omsPayablePaymentPlanMapper.insertOmsPayablePaymentPlan(defaultPlan);
|
omsPayablePaymentPlanMapper.batchOmsPayablePaymentPlan(java.util.Collections.singletonList(defaultPlan));
|
||||||
omsPayableBill.setLastPaymentPlanId(defaultPlan.getId());
|
|
||||||
//创建收票计划
|
|
||||||
OmsPayableTicketPlan omsPayableTicketPlan = new OmsPayableTicketPlan();
|
|
||||||
omsPayableTicketPlan.setPayableBillId(omsPayableBill.getId());
|
|
||||||
omsPayableTicketPlan.setPlanTicketDate(DateUtils.addDays(DateUtils.getNowDate(), payConfigDay));
|
|
||||||
omsPayableTicketPlan.setPlanAmount(omsPayableBill.getTotalPriceWithTax());
|
|
||||||
omsPayableTicketPlan.setPlanRate(new java.math.BigDecimal("100"));
|
|
||||||
omsPayableTicketPlan.setRemark("默认收票计划");
|
|
||||||
omsPayableTicketPlan.setCreateBy(ShiroUtils.getUserId().toString());
|
|
||||||
omsPayableTicketPlan.setCreateTime(DateUtils.getNowDate());
|
|
||||||
omsPayableTicketPlanMapper.insertOmsPayableTicketPlan(omsPayableTicketPlan);
|
|
||||||
omsPayableBill.setLastTicketPlanId(omsPayableTicketPlan.getId());
|
|
||||||
|
|
||||||
updateOmsPayableBill(omsPayableBill);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -167,7 +152,6 @@ public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
|
||||||
@Override
|
@Override
|
||||||
public int updateOmsPayableBill(OmsPayableBill omsPayableBill) {
|
public int updateOmsPayableBill(OmsPayableBill omsPayableBill) {
|
||||||
omsPayableBill.setUpdateTime(DateUtils.getNowDate());
|
omsPayableBill.setUpdateTime(DateUtils.getNowDate());
|
||||||
omsPayableBill.setUpdateBy(ShiroUtils.getUserId().toString());
|
|
||||||
return omsPayableBillMapper.updateOmsPayableBill(omsPayableBill);
|
return omsPayableBillMapper.updateOmsPayableBill(omsPayableBill);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -200,25 +184,25 @@ public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public int mergeAndInitiatePayment(MergedPaymentDataDto dto) {
|
public int mergeAndInitiatePayment(MergedPaymentDataDto dto) {
|
||||||
// 1. Calculate Tax Totals
|
// 1. Calculate Tax Totals
|
||||||
BigDecimal totalWithoutTax = BigDecimal.ZERO;
|
BigDecimal totalWithoutTax = BigDecimal.ZERO;
|
||||||
if (CollUtil.isEmpty(dto.getPayableOrders())) {
|
Map<Long, OmsPayableBill> billMap = new java.util.HashMap<>();
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
// Fetch bills once
|
// Fetch bills once
|
||||||
for (PayableOrderDto order : dto.getPayableOrders()) {
|
for (PayableOrderDto order : dto.getPayableOrders()) {
|
||||||
|
OmsPayableBill bill = omsPayableBillMapper.selectOmsPayableBillById(order.getId());
|
||||||
|
billMap.put(order.getId(), bill);
|
||||||
|
// todo 此处存疑 税额的计算到底应该怎么计算
|
||||||
for (OmsPayablePaymentPlan plan : order.getPaymentPlans()) {
|
for (OmsPayablePaymentPlan plan : order.getPaymentPlans()) {
|
||||||
// 计算每个 plan 的未税金额 = planAmount / (1 + 税率),保留两位小数
|
if (bill.getTotalPriceWithTax() != null && bill.getTotalPriceWithTax().compareTo(BigDecimal.ZERO) != 0) {
|
||||||
BigDecimal taxRate = order.getTaxRate();
|
// ratio = planAmount / totalWithTax
|
||||||
if (taxRate == null || taxRate.compareTo(BigDecimal.ZERO) < 0) {
|
BigDecimal ratio = plan.getPlanAmount().divide(bill.getTotalPriceWithTax(), 10, java.math.RoundingMode.HALF_UP);
|
||||||
// 如果税率为空或小于0,则默认为0
|
// planWithoutTax = totalWithoutTax * ratio
|
||||||
taxRate = new BigDecimal(defaultTax);
|
BigDecimal planWithoutTax = bill.getTotalPriceWithoutTax().multiply(ratio).setScale(2, java.math.RoundingMode.HALF_UP);
|
||||||
|
totalWithoutTax = totalWithoutTax.add(planWithoutTax);
|
||||||
}
|
}
|
||||||
// 计算未税金额 = planAmount / (1 + 税率)
|
|
||||||
BigDecimal divisor = BigDecimal.ONE.add(taxRate);
|
|
||||||
BigDecimal planWithoutTax = plan.getPlanAmount().divide(divisor, 2, java.math.RoundingMode.HALF_UP);
|
|
||||||
totalWithoutTax = totalWithoutTax.add(planWithoutTax);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -229,48 +213,17 @@ public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
|
||||||
paymentBill.setVendorCode(firstPayableBill.getVendorCode());
|
paymentBill.setVendorCode(firstPayableBill.getVendorCode());
|
||||||
paymentBill.setPaymentTime(dto.getEstimatedPaymentTime());
|
paymentBill.setPaymentTime(dto.getEstimatedPaymentTime());
|
||||||
paymentBill.setTotalPriceWithTax(dto.getTotalMergePaymentAmount());
|
paymentBill.setTotalPriceWithTax(dto.getTotalMergePaymentAmount());
|
||||||
|
|
||||||
// Set Calculated Tax Info
|
// Set Calculated Tax Info
|
||||||
paymentBill.setTotalPriceWithoutTax(totalWithoutTax);
|
paymentBill.setTotalPriceWithoutTax(totalWithoutTax);
|
||||||
paymentBill.setTaxAmount(dto.getTotalMergePaymentAmount().subtract(totalWithoutTax));
|
paymentBill.setTaxAmount(dto.getTotalMergePaymentAmount().subtract(totalWithoutTax));
|
||||||
|
|
||||||
paymentBill.setPaymentBillType(OmsPaymentBill.PaymentBillTypeEnum.FROM_PAYABLE.getCode());
|
paymentBill.setPaymentBillType(OmsPaymentBill.PaymentBillTypeEnum.FROM_PAYABLE.getCode());
|
||||||
omsPaymentBillService.insertOmsPaymentBill(paymentBill);
|
omsPaymentBillService.insertOmsPaymentBill(paymentBill);
|
||||||
|
|
||||||
// 3. 创建付款明细 - 防止重复付款
|
// 3. 创建付款明细
|
||||||
// 收集所有支付计划ID
|
|
||||||
List<Long> allPaymentPlanIds = dto.getPayableOrders().stream()
|
|
||||||
.flatMap(order -> order.getPaymentPlans().stream())
|
|
||||||
.map(OmsPayablePaymentPlan::getId)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
// 查询现有的付款明细记录
|
|
||||||
Map<Long, OmsPayablePaymentDetail> existingDetailsMap = new java.util.HashMap<>();
|
|
||||||
if (!allPaymentPlanIds.isEmpty()) {
|
|
||||||
List<OmsPayablePaymentDetail> existingDetails = omsPayablePaymentDetailService.selectByPaymentPlanIds(allPaymentPlanIds);
|
|
||||||
|
|
||||||
// 使用stream将查询结果转化为Map,以planId为key,detail为value,取createtime最新的数据
|
|
||||||
existingDetailsMap = existingDetails.stream()
|
|
||||||
.collect(Collectors.toMap(
|
|
||||||
OmsPayablePaymentDetail::getPaymentPlanId,
|
|
||||||
detail -> detail,
|
|
||||||
// 如果有重复数据,取createtime最新的数据
|
|
||||||
(existing, replacement) -> existing.getCreateTime().compareTo(replacement.getCreateTime()) >= 0 ? existing : replacement
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 遍历所有计划并检查是否有已付款的记录
|
|
||||||
for (PayableOrderDto payableOrderDto : dto.getPayableOrders()) {
|
for (PayableOrderDto payableOrderDto : dto.getPayableOrders()) {
|
||||||
for (OmsPayablePaymentPlan paymentPlanDto : payableOrderDto.getPaymentPlans()) {
|
for (OmsPayablePaymentPlan paymentPlanDto : payableOrderDto.getPaymentPlans()) {
|
||||||
// 检查是否存在已付款的记录
|
|
||||||
OmsPayablePaymentDetail existingDetail = existingDetailsMap.get(paymentPlanDto.getId());
|
|
||||||
if (existingDetail != null) {
|
|
||||||
// 检查是否是已付款状态,如果是则抛出异常
|
|
||||||
if (!OmsPayablePaymentDetail.PayableDetailTypeEnum.REFUND.getCode().equals(existingDetail.getPayableDetailType())) {
|
|
||||||
throw new ServiceException("计划ID为 " + paymentPlanDto.getId() + " 的付款已处理,请刷新页面后重试");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
OmsPayablePaymentDetail detail = new OmsPayablePaymentDetail();
|
OmsPayablePaymentDetail detail = new OmsPayablePaymentDetail();
|
||||||
detail.setPayableBillId(payableOrderDto.getId());
|
detail.setPayableBillId(payableOrderDto.getId());
|
||||||
detail.setPaymentPlanId(paymentPlanDto.getId());
|
detail.setPaymentPlanId(paymentPlanDto.getId());
|
||||||
|
|
@ -284,96 +237,57 @@ public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
|
||||||
omsPayablePaymentDetailService.insertOmsPayablePaymentDetail(detail);
|
omsPayablePaymentDetailService.insertOmsPayablePaymentDetail(detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 更新应付单最新付款id和已付和未付金额
|
// 3. 更新应付单状态
|
||||||
|
// OmsPayableBill payableBill = omsPayableBillMapper.selectOmsPayableBillById(payableOrderDto.getId());
|
||||||
|
// // 这里可以根据业务逻辑更新状态,例如 "付款中"
|
||||||
|
// // payableBill.setPaymentStatus("1");
|
||||||
|
// omsPayableBillMapper.updateOmsPayableBill(payableBill);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 批量更新应付单的付款相关信息
|
|
||||||
SpringUtils.getAopProxy(this).updatePaymentAmount(dto.getPayableOrders().stream().map(PayableOrderDto::getId).collect(Collectors.toList()));
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int mergeAndInitiateReceipt(MergedReceiptDataDto dto) {
|
public int mergeAndInitiateReceipt(MergedReceiptDataDto dto) {
|
||||||
// 1. Calculate Tax Totals
|
// 1. Calculate Tax Totals
|
||||||
BigDecimal totalWithoutTax = BigDecimal.ZERO;
|
BigDecimal totalWithoutTax = BigDecimal.ZERO;
|
||||||
if (CollUtil.isEmpty(dto.getPayableOrders())) {
|
Map<Long, OmsPayableBill> billMap = new java.util.HashMap<>();
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Fetch bills once
|
// Fetch bills once
|
||||||
for (PayableOrderReceiptDto order : dto.getPayableOrders()) {
|
for (PayableOrderReceiptDto order : dto.getPayableOrders()) {
|
||||||
|
OmsPayableBill bill = omsPayableBillMapper.selectOmsPayableBillById(order.getId());
|
||||||
|
billMap.put(order.getId(), bill);
|
||||||
|
|
||||||
for (OmsPayableTicketPlan plan : order.getTicketPlans()) {
|
for (OmsPayableTicketPlan plan : order.getTicketPlans()) {
|
||||||
// 计算每个 plan 的未税金额 = planAmount / (1 + 税率),保留两位小数
|
if (bill.getTotalPriceWithTax() != null && bill.getTotalPriceWithTax().compareTo(BigDecimal.ZERO) != 0) {
|
||||||
BigDecimal taxRate = order.getTaxRate();
|
BigDecimal ratio = plan.getPlanAmount().divide(bill.getTotalPriceWithTax(), 10, java.math.RoundingMode.HALF_UP);
|
||||||
if (taxRate == null || taxRate.compareTo(BigDecimal.ZERO) < 0) {
|
BigDecimal planWithoutTax = bill.getTotalPriceWithoutTax().multiply(ratio).setScale(2, java.math.RoundingMode.HALF_UP);
|
||||||
// 如果税率为空或小于0,则默认为0
|
totalWithoutTax = totalWithoutTax.add(planWithoutTax);
|
||||||
taxRate = new BigDecimal(defaultTax);
|
|
||||||
}
|
}
|
||||||
// 计算未税金额 = planAmount / (1 + 税率)
|
|
||||||
BigDecimal divisor = BigDecimal.ONE.add(taxRate);
|
|
||||||
BigDecimal planWithoutTax = plan.getPlanAmount().divide(divisor, 2, java.math.RoundingMode.HALF_UP);
|
|
||||||
totalWithoutTax = totalWithoutTax.add(planWithoutTax);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 创建收票单
|
// 2. 创建收票单
|
||||||
OmsTicketBill ticketBill = new OmsTicketBill();
|
OmsTicketBill ticketBill = new OmsTicketBill();
|
||||||
OmsPayableBill firstPayableBill = omsPayableBillMapper.selectOmsPayableBillById(dto.getPayableOrders().get(0).getId());
|
OmsPayableBill firstPayableBill = billMap.get(dto.getPayableOrders().get(0).getId());
|
||||||
ticketBill.setTicketBillType(dto.getTicketBillType());
|
ticketBill.setTicketBillType(dto.getTicketBillType());
|
||||||
ticketBill.setVendorTicketTime(dto.getVendorTicketTime());
|
|
||||||
ticketBill.setVendorCode(firstPayableBill.getVendorCode());
|
ticketBill.setVendorCode(firstPayableBill.getVendorCode());
|
||||||
ticketBill.setVendorName(firstPayableBill.getVendorName());
|
ticketBill.setVendorName(firstPayableBill.getVendorName());
|
||||||
ticketBill.setTicketTime(dto.getTicketTime());
|
ticketBill.setTicketTime(dto.getTicketTime());
|
||||||
ticketBill.setTotalPriceWithTax(dto.getTotalMergeTicketAmount());
|
ticketBill.setTotalPriceWithTax(dto.getTotalMergeTicketAmount());
|
||||||
|
|
||||||
// Set Calculated Tax Info
|
// Set Calculated Tax Info
|
||||||
ticketBill.setTotalPriceWithoutTax(totalWithoutTax);
|
ticketBill.setTotalPriceWithoutTax(totalWithoutTax);
|
||||||
ticketBill.setTaxAmount(dto.getTotalMergeTicketAmount().subtract(totalWithoutTax));
|
ticketBill.setTaxAmount(dto.getTotalMergeTicketAmount().subtract(totalWithoutTax));
|
||||||
|
|
||||||
ticketBill.setTicketBillType(OmsTicketBill.TicketBillTypeEnum.FROM_PAYABLE.getCode());
|
ticketBill.setTicketBillType(OmsTicketBill.TicketBillTypeEnum.FROM_PAYABLE.getCode());
|
||||||
ticketBill.setTicketStatus(OmsTicketBill.TicketStatusEnum.WAIT_TICKET.getCode());
|
ticketBill.setTicketStatus(OmsTicketBill.TicketStatusEnum.WAIT_TICKET.getCode());
|
||||||
omsTicketBillService.insertOmsTicketBill(ticketBill);
|
omsTicketBillService.insertOmsTicketBill(ticketBill);
|
||||||
|
|
||||||
// 3. 创建收票明细 - 防止重复收票
|
// 3. 创建收票明细
|
||||||
// 收集所有收票计划ID
|
|
||||||
List<Long> allTicketPlanIds = dto.getPayableOrders().stream()
|
|
||||||
.flatMap(order -> order.getTicketPlans().stream())
|
|
||||||
.map(OmsPayableTicketPlan::getId)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
// 查询现有的收票明细记录
|
|
||||||
Map<Long, OmsPayableTicketDetail> existingDetailsMap = new java.util.HashMap<>();
|
|
||||||
if (!allTicketPlanIds.isEmpty()) {
|
|
||||||
List<OmsPayableTicketDetail> existingDetails = omsPayableTicketDetailService.selectByTicketPlanIds(allTicketPlanIds);
|
|
||||||
|
|
||||||
// 使用stream将查询结果转化为Map,以planId为key,detail为value,取createtime最新的数据
|
|
||||||
existingDetailsMap = existingDetails.stream()
|
|
||||||
.collect(Collectors.toMap(
|
|
||||||
OmsPayableTicketDetail::getTicketPlanId,
|
|
||||||
detail -> detail,
|
|
||||||
// 如果有重复数据,取createtime最新的数据
|
|
||||||
(existing, replacement) -> existing.getCreateTime().compareTo(replacement.getCreateTime()) >= 0 ? existing : replacement
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 遍历所有计划并检查是否有已收票的记录
|
|
||||||
for (PayableOrderReceiptDto payableOrderDto : dto.getPayableOrders()) {
|
for (PayableOrderReceiptDto payableOrderDto : dto.getPayableOrders()) {
|
||||||
for (OmsPayableTicketPlan ticketPlanDto : payableOrderDto.getTicketPlans()) {
|
for (OmsPayableTicketPlan ticketPlanDto : payableOrderDto.getTicketPlans()) {
|
||||||
// 检查是否存在已收票的记录
|
|
||||||
OmsPayableTicketDetail existingDetail = existingDetailsMap.get(ticketPlanDto.getId());
|
|
||||||
if (existingDetail != null) {
|
|
||||||
// 检查是否是已收票状态,如果是则抛出异常
|
|
||||||
if (!OmsPayableTicketDetail.PayableDetailTypeEnum.RED_RUSH.getCode().equals(existingDetail.getPayableDetailType())) {
|
|
||||||
throw new ServiceException("计划ID为 " + ticketPlanDto.getId() + " 的收票已处理,请刷新页面后重试");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
OmsPayableTicketDetail detail = new OmsPayableTicketDetail();
|
OmsPayableTicketDetail detail = new OmsPayableTicketDetail();
|
||||||
detail.setPayableBillId(payableOrderDto.getId());
|
detail.setPayableBillId(payableOrderDto.getId());
|
||||||
detail.setTicketPlanId(ticketPlanDto.getId());
|
detail.setTicketPlanId(ticketPlanDto.getId());
|
||||||
|
|
@ -382,88 +296,12 @@ public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
|
||||||
detail.setPaymentAmount(ticketPlanDto.getPlanAmount());
|
detail.setPaymentAmount(ticketPlanDto.getPlanAmount());
|
||||||
detail.setPaymentRate(ticketPlanDto.getPlanRate());
|
detail.setPaymentRate(ticketPlanDto.getPlanRate());
|
||||||
detail.setPaymentTime(ticketPlanDto.getPlanTicketDate());
|
detail.setPaymentTime(ticketPlanDto.getPlanTicketDate());
|
||||||
detail.setRemark(ticketPlanDto.getRemark());
|
|
||||||
detail.setCreateBy(ShiroUtils.getLoginName());
|
detail.setCreateBy(ShiroUtils.getLoginName());
|
||||||
detail.setPayableDetailType(OmsPayableTicketDetail.PayableDetailTypeEnum.TICKET.getCode());
|
detail.setPayableDetailType(OmsPayableTicketDetail.PayableDetailTypeEnum.TICKET.getCode());
|
||||||
omsPayableTicketDetailService.insertOmsPayableTicketDetail(detail);
|
omsPayableTicketDetailService.insertOmsPayableTicketDetail(detail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 1;
|
||||||
// 批量更新应付单的收票相关信息
|
|
||||||
return SpringUtils.getAopProxy(this).updateTicketAmount(dto.getPayableOrders().stream().map(PayableOrderReceiptDto::getId).collect(Collectors.toList()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int updatePaymentAmount(List<Long> idList) {
|
|
||||||
if (CollUtil.isEmpty(idList)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
OmsPayableBill omsPayableBill = new OmsPayableBill();
|
|
||||||
omsPayableBill.setIdList(idList);
|
|
||||||
List<OmsPayableBill> omsPayableBills = omsPayableBillMapper.selectOmsPayableBillList(omsPayableBill);
|
|
||||||
if (CollUtil.isEmpty(omsPayableBills)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<OmsPayablePaymentDetail> omsPayablePaymentDetails = omsPayablePaymentDetailService.listByPayableBillIdList(idList);
|
|
||||||
Map<Long, Map<String, BigDecimal>> planMap = omsPayablePaymentDetails.stream().collect(Collectors.groupingBy(OmsPayablePaymentDetail::getPayableBillId,
|
|
||||||
Collectors.groupingBy(
|
|
||||||
item -> item.getPaymentStatus() == null ? OmsPaymentBill.PaymentStatusEnum.WAIT_PAYMENT.getCode() : item.getPaymentStatus(),
|
|
||||||
Collectors.reducing(
|
|
||||||
BigDecimal.ZERO,
|
|
||||||
detail -> (detail.getPaymentAmount() != null) ? detail.getPaymentAmount() : BigDecimal.ZERO,
|
|
||||||
BigDecimal::add
|
|
||||||
))));
|
|
||||||
for (OmsPayableBill payableBill : omsPayableBills) {
|
|
||||||
Map<String, BigDecimal> amountMap = planMap.get(payableBill.getId());
|
|
||||||
if (CollUtil.isNotEmpty(amountMap)) {
|
|
||||||
//已付金额 = 已付款金额-退款金额
|
|
||||||
payableBill.setPaidPaymentAmount(amountMap.getOrDefault(OmsPaymentBill.PaymentStatusEnum.PAYMENT.getCode(), BigDecimal.ZERO)
|
|
||||||
.subtract(amountMap.getOrDefault(OmsPaymentBill.PaymentStatusEnum.REFUNDED.getCode(), BigDecimal.ZERO)));
|
|
||||||
//未付金额=总金额-已付金额-付款中金额
|
|
||||||
payableBill.setUnpaidPaymentAmount(payableBill.getTotalPriceWithTax().subtract(payableBill.getPaidPaymentAmount())
|
|
||||||
.subtract(amountMap.getOrDefault(OmsPaymentBill.PaymentStatusEnum.WAIT_PAYMENT.getCode(), BigDecimal.ZERO)));
|
|
||||||
}
|
|
||||||
OmsPayablePaymentPlan payablePaymentPlan = omsPayablePaymentPlanMapper.firstUnPayPlan(payableBill.getId());
|
|
||||||
payableBill.setLastPaymentPlanId(payablePaymentPlan == null ? -1 : payablePaymentPlan.getId());
|
|
||||||
}
|
|
||||||
return omsPayableBillMapper.updateBatchPayableBillPaymentInfo(omsPayableBills);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int updateTicketAmount(List<Long> idList) {
|
|
||||||
if (CollUtil.isEmpty(idList)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
OmsPayableBill omsPayableBill = new OmsPayableBill();
|
|
||||||
omsPayableBill.setIdList(idList);
|
|
||||||
List<OmsPayableBill> omsPayableBills = omsPayableBillMapper.selectOmsPayableBillList(omsPayableBill);
|
|
||||||
if (CollUtil.isEmpty(omsPayableBills)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
List<OmsPayableTicketDetail> omsPayableTicketDetails = omsPayableTicketDetailService.listByPayableBillIdList(idList);
|
|
||||||
Map<Long, Map<String, BigDecimal>> planMap = omsPayableTicketDetails.stream().collect(Collectors.groupingBy(OmsPayableTicketDetail::getPayableBillId,
|
|
||||||
Collectors.groupingBy(
|
|
||||||
item -> item.getTicketStatus() == null ? OmsTicketBill.TicketStatusEnum.WAIT_TICKET.getCode() : item.getTicketStatus(),
|
|
||||||
Collectors.reducing(
|
|
||||||
BigDecimal.ZERO,
|
|
||||||
detail -> (detail.getPaymentAmount() != null) ? detail.getPaymentAmount() : BigDecimal.ZERO,
|
|
||||||
BigDecimal::add
|
|
||||||
))));
|
|
||||||
for (OmsPayableBill payableBill : omsPayableBills) {
|
|
||||||
Map<String, BigDecimal> amountMap = planMap.get(payableBill.getId());
|
|
||||||
if (CollUtil.isNotEmpty(amountMap)) {
|
|
||||||
//已付金额 = 已付款金额-退款金额
|
|
||||||
payableBill.setReceivedTicketAmount(amountMap.getOrDefault(OmsTicketBill.TicketStatusEnum.TICKET.getCode(), BigDecimal.ZERO)
|
|
||||||
.subtract(amountMap.getOrDefault(OmsPaymentBill.PaymentStatusEnum.REFUNDED.getCode(), BigDecimal.ZERO)));
|
|
||||||
//未付金额=总金额-已付金额-付款中金额
|
|
||||||
payableBill.setUnreceivedTicketAmount(payableBill.getTotalPriceWithTax().subtract(payableBill.getPaidPaymentAmount()
|
|
||||||
.subtract(amountMap.getOrDefault(OmsTicketBill.TicketStatusEnum.WAIT_TICKET.getCode(), BigDecimal.ZERO))));
|
|
||||||
}
|
|
||||||
OmsPayableTicketPlan omsPayableTicketPlan = omsPayableTicketPlanMapper.firstUnPayPlan(payableBill.getId());
|
|
||||||
payableBill.setLastTicketPlanId(omsPayableTicketPlan == null ? -1 : omsPayableTicketPlan.getId());
|
|
||||||
}
|
|
||||||
return omsPayableBillMapper.updateBatchPayableBillTicketInfo(omsPayableBills);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -471,20 +309,20 @@ public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
|
||||||
OmsPayableBill omsPayableBill = selectOmsPayableBillById(id);
|
OmsPayableBill omsPayableBill = selectOmsPayableBillById(id);
|
||||||
List<OmsPayablePaymentDetail> omsPayablePaymentDetails = omsPayablePaymentDetailService.listByPayableBillId(id);
|
List<OmsPayablePaymentDetail> omsPayablePaymentDetails = omsPayablePaymentDetailService.listByPayableBillId(id);
|
||||||
omsPayableBill.setDetailList(omsPayablePaymentDetails);
|
omsPayableBill.setDetailList(omsPayablePaymentDetails);
|
||||||
// Map<String, BigDecimal> decimalMap = omsPayablePaymentDetails.stream()
|
Map<String, BigDecimal> decimalMap = omsPayablePaymentDetails.stream()
|
||||||
// .collect(Collectors.groupingBy(
|
.collect(Collectors.groupingBy(
|
||||||
// item->item.getPaymentStatus()==null?OmsPaymentBill.PaymentStatusEnum.WAIT_PAYMENT.getCode(): item.getPaymentStatus(),
|
item->item.getPaymentStatus()==null?OmsPaymentBill.PaymentStatusEnum.WAIT_PAYMENT.getCode(): item.getPaymentStatus(),
|
||||||
// Collectors.reducing(
|
Collectors.reducing(
|
||||||
// BigDecimal.ZERO,
|
BigDecimal.ZERO,
|
||||||
// detail -> (detail.getPaymentAmount() != null) ? detail.getPaymentAmount() : BigDecimal.ZERO,
|
detail -> (detail.getPaymentAmount() != null) ? detail.getPaymentAmount() : BigDecimal.ZERO,
|
||||||
// BigDecimal::add
|
BigDecimal::add
|
||||||
// )
|
)
|
||||||
// ));
|
));
|
||||||
|
|
||||||
// omsPayableBill.setPaidAmount(decimalMap.getOrDefault(OmsPaymentBill.PaymentStatusEnum.PAYMENT.getCode(), BigDecimal.ZERO));
|
omsPayableBill.setPaidAmount(decimalMap.getOrDefault(OmsPaymentBill.PaymentStatusEnum.PAYMENT.getCode(), BigDecimal.ZERO));
|
||||||
// omsPayableBill.setPayingAmount(decimalMap.getOrDefault(OmsPaymentBill.PaymentStatusEnum.WAIT_PAYMENT.getCode(), BigDecimal.ZERO));
|
omsPayableBill.setPayingAmount(decimalMap.getOrDefault(OmsPaymentBill.PaymentStatusEnum.WAIT_PAYMENT.getCode(), BigDecimal.ZERO));
|
||||||
// BigDecimal decimal = omsPayableBill.getTotalPriceWithTax().subtract(omsPayableBill.getPaidAmount()).subtract(omsPayableBill.getPayingAmount());
|
BigDecimal decimal = omsPayableBill.getTotalPriceWithTax().subtract(omsPayableBill.getPaidAmount()).subtract(omsPayableBill.getPayingAmount());
|
||||||
// omsPayableBill.setUnpaidAmount(decimal);
|
omsPayableBill.setUnpaidAmount(decimal);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,9 +100,4 @@ public class OmsPayablePaymentDetailServiceImpl implements IOmsPayablePaymentDet
|
||||||
return paymentBillPayableDetailDTOS;
|
return paymentBillPayableDetailDTOS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<OmsPayablePaymentDetail> selectByPaymentPlanIds(List<Long> paymentPlanIds) {
|
|
||||||
return omsPayablePaymentDetailMapper.selectByPaymentPlanIds(paymentPlanIds);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.ruoyi.common.utils.ShiroUtils;
|
import com.ruoyi.common.utils.ShiroUtils;
|
||||||
import com.ruoyi.sip.domain.*;
|
import com.ruoyi.sip.domain.OmsPayablePaymentDetail;
|
||||||
import com.ruoyi.sip.mapper.OmsPayableBillMapper;
|
import com.ruoyi.sip.domain.OmsPayableTicketPlan;
|
||||||
import com.ruoyi.sip.service.IOmsPayablePaymentDetailService;
|
import com.ruoyi.sip.service.IOmsPayablePaymentDetailService;
|
||||||
import com.ruoyi.sip.service.IOmsPayableTicketPlanService;
|
import com.ruoyi.sip.service.IOmsPayableTicketPlanService;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
|
|
@ -19,17 +19,15 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import com.ruoyi.sip.mapper.OmsPayablePaymentPlanMapper;
|
import com.ruoyi.sip.mapper.OmsPayablePaymentPlanMapper;
|
||||||
|
import com.ruoyi.sip.domain.OmsPayablePaymentPlan;
|
||||||
import com.ruoyi.sip.service.IOmsPayablePaymentPlanService;
|
import com.ruoyi.sip.service.IOmsPayablePaymentPlanService;
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public class OmsPayablePaymentPlanServiceImpl implements IOmsPayablePaymentPlanService {
|
public class OmsPayablePaymentPlanServiceImpl implements IOmsPayablePaymentPlanService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private OmsPayablePaymentPlanMapper omsPayablePaymentPlanMapper;
|
private OmsPayablePaymentPlanMapper omsPayablePaymentPlanMapper;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private OmsPayableBillMapper billMapper;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOmsPayablePaymentDetailService omsPayablePaymentDetailService;
|
private IOmsPayablePaymentDetailService omsPayablePaymentDetailService;
|
||||||
|
|
||||||
|
|
@ -83,12 +81,6 @@ public class OmsPayablePaymentPlanServiceImpl implements IOmsPayablePaymentPlanS
|
||||||
for (Long idToDelete : existingPlanIdSet) {
|
for (Long idToDelete : existingPlanIdSet) {
|
||||||
omsPayablePaymentPlanMapper.deleteOmsPayablePaymentPlanById(idToDelete);
|
omsPayablePaymentPlanMapper.deleteOmsPayablePaymentPlanById(idToDelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
OmsPayablePaymentPlan payablePaymentPlan = omsPayablePaymentPlanMapper.firstUnPayPlan(payableBillId);
|
|
||||||
OmsPayableBill payableBill = new OmsPayableBill();
|
|
||||||
payableBill.setId(payableBillId);
|
|
||||||
payableBill.setLastPaymentPlanId(payablePaymentPlan == null ? -1 : payablePaymentPlan.getId());
|
|
||||||
billMapper.updateOmsPayableBill(payableBill);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -152,9 +152,4 @@ public class OmsPayableTicketDetailServiceImpl implements IOmsPayableTicketDetai
|
||||||
public List<OmsPayableTicketDetail> listByPayableBillIdList(List<Long> payableBillId) {
|
public List<OmsPayableTicketDetail> listByPayableBillIdList(List<Long> payableBillId) {
|
||||||
return omsPayableTicketDetailMapper.listByPayableBillIdList(payableBillId);
|
return omsPayableTicketDetailMapper.listByPayableBillIdList(payableBillId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<OmsPayableTicketDetail> selectByTicketPlanIds(List<Long> ticketPlanIds) {
|
|
||||||
return omsPayableTicketDetailMapper.selectByTicketPlanIds(ticketPlanIds);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -9,12 +9,14 @@ import java.util.stream.Collectors;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.ShiroUtils;
|
import com.ruoyi.common.utils.ShiroUtils;
|
||||||
import com.ruoyi.sip.domain.*;
|
import com.ruoyi.sip.domain.OmsPayablePaymentDetail;
|
||||||
import com.ruoyi.sip.mapper.OmsPayableBillMapper;
|
import com.ruoyi.sip.domain.OmsPayablePaymentPlan;
|
||||||
|
import com.ruoyi.sip.domain.OmsPayableTicketDetail;
|
||||||
import com.ruoyi.sip.service.IOmsPayableTicketDetailService;
|
import com.ruoyi.sip.service.IOmsPayableTicketDetailService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.sip.mapper.OmsPayableTicketPlanMapper;
|
import com.ruoyi.sip.mapper.OmsPayableTicketPlanMapper;
|
||||||
|
import com.ruoyi.sip.domain.OmsPayableTicketPlan;
|
||||||
import com.ruoyi.sip.service.IOmsPayableTicketPlanService;
|
import com.ruoyi.sip.service.IOmsPayableTicketPlanService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -29,8 +31,6 @@ public class OmsPayableTicketPlanServiceImpl implements IOmsPayableTicketPlanSer
|
||||||
private OmsPayableTicketPlanMapper omsPayableTicketPlanMapper;
|
private OmsPayableTicketPlanMapper omsPayableTicketPlanMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOmsPayableTicketDetailService detailService;
|
private IOmsPayableTicketDetailService detailService;
|
||||||
@Autowired
|
|
||||||
private OmsPayableBillMapper billMapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询应付单收票计划
|
* 查询应付单收票计划
|
||||||
|
|
@ -148,11 +148,5 @@ public class OmsPayableTicketPlanServiceImpl implements IOmsPayableTicketPlanSer
|
||||||
for (Long idToDelete : existingPlanIdSet) {
|
for (Long idToDelete : existingPlanIdSet) {
|
||||||
omsPayableTicketPlanMapper.deleteOmsPayableTicketPlanById(idToDelete);
|
omsPayableTicketPlanMapper.deleteOmsPayableTicketPlanById(idToDelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
OmsPayableTicketPlan payablePaymentPlan = omsPayableTicketPlanMapper.firstUnPayPlan(payableBillId);
|
|
||||||
OmsPayableBill payableBill = new OmsPayableBill();
|
|
||||||
payableBill.setId(payableBillId);
|
|
||||||
payableBill.setLastTicketPlanId(payablePaymentPlan == null ? -1 : payablePaymentPlan.getId());
|
|
||||||
billMapper.updateOmsPayableBill(payableBill);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1552,19 +1552,6 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void approveOrderBatch(Todo todo) {
|
|
||||||
Todo query = new Todo();
|
|
||||||
query.setApproveUser(getSysUser().getUserId().toString());
|
|
||||||
query.setProcessKeyList(Arrays.asList(orderOnlineFlowKey,orderOfflineFlowKey));
|
|
||||||
List<Todo> list = todoService.selectTodoList(query);
|
|
||||||
for (Todo todo1 : list) {
|
|
||||||
|
|
||||||
todo1.setVariables(new HashMap<>(todo.getVariables()));
|
|
||||||
approveOrder(todo1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成第一个sheet的数据
|
* 生成第一个sheet的数据
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,5 @@ public class OuterDeliveryProductVo {
|
||||||
private String warehouseName;
|
private String warehouseName;
|
||||||
private String orderType;
|
private String orderType;
|
||||||
private Long warehouseId;
|
private Long warehouseId;
|
||||||
private String productType;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<resultMap type="OmsPayableBill" id="OmsPayableBillResult">
|
<resultMap type="OmsPayableBill" id="OmsPayableBillResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="payableBillCode" column="payable_bill_code" />
|
<result property="payableBillCode" column="payable_bill_code" />
|
||||||
|
<result property="estimatedPaymentTime" column="estimated_payment_time" />
|
||||||
<result property="vendorCode" column="vendor_code" />
|
<result property="vendorCode" column="vendor_code" />
|
||||||
<result property="orderCode" column="order_code" />
|
<result property="orderCode" column="order_code" />
|
||||||
<result property="inventoryCode" column="inventory_code" />
|
<result property="inventoryCode" column="inventory_code" />
|
||||||
|
|
@ -14,14 +15,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="totalPriceWithTax" column="total_price_with_tax" />
|
<result property="totalPriceWithTax" column="total_price_with_tax" />
|
||||||
<result property="totalPriceWithoutTax" column="total_price_without_tax" />
|
<result property="totalPriceWithoutTax" column="total_price_without_tax" />
|
||||||
<result property="taxAmount" column="tax_amount" />
|
<result property="taxAmount" column="tax_amount" />
|
||||||
<result property="lastPaymentPlanId" column="last_payment_plan_id" />
|
|
||||||
<result property="lastTicketPlanId" column="last_ticket_plan_id" />
|
|
||||||
<result property="paidPaymentAmount" column="paid_payment_amount" />
|
|
||||||
<result property="unpaidPaymentAmount" column="unpaid_payment_amount" />
|
|
||||||
<result property="receivedTicketAmount" column="received_ticket_amount" />
|
|
||||||
<result property="unreceivedTicketAmount" column="unreceived_ticket_amount" />
|
|
||||||
<result property="planPaymentDate" column="plan_payment_date" />
|
|
||||||
<result property="planAmount" column="plan_amount" />
|
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
|
|
@ -31,34 +24,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectOmsPayableBillVo">
|
<sql id="selectOmsPayableBillVo">
|
||||||
select
|
select id, payable_bill_code, estimated_payment_time, vendor_code, order_code, inventory_code, product_type, total_price_with_tax, total_price_without_tax, tax_amount, create_by, create_time, update_by, update_time, remark, del_flag from oms_payable_bill
|
||||||
t1.id,
|
|
||||||
t1.payable_bill_code,
|
|
||||||
t1.vendor_code,
|
|
||||||
t1.order_code,
|
|
||||||
t1.inventory_code,
|
|
||||||
t1.product_type,
|
|
||||||
t1.total_price_with_tax,
|
|
||||||
t1.total_price_without_tax,
|
|
||||||
t1.tax_amount,
|
|
||||||
t1.paid_payment_amount,
|
|
||||||
t1.unpaid_payment_amount,
|
|
||||||
t1.received_ticket_amount,
|
|
||||||
t1.unreceived_ticket_amount,
|
|
||||||
t1.last_payment_plan_id,
|
|
||||||
t1.last_ticket_plan_id,
|
|
||||||
t1.create_by,
|
|
||||||
t1.create_time,
|
|
||||||
t1.update_by,
|
|
||||||
t1.update_time,
|
|
||||||
t1.remark,
|
|
||||||
t1.del_flag
|
|
||||||
from oms_payable_bill t1
|
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="selectOmsPayableBillRelationVo">
|
<sql id="selectOmsPayableBillRelationVo">
|
||||||
SELECT
|
SELECT
|
||||||
t1.id,
|
t1.id,
|
||||||
t1.payable_bill_code,
|
t1.payable_bill_code,
|
||||||
|
t1.estimated_payment_time,
|
||||||
t1.vendor_code,
|
t1.vendor_code,
|
||||||
t1.order_code,
|
t1.order_code,
|
||||||
t1.inventory_code,
|
t1.inventory_code,
|
||||||
|
|
@ -66,12 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
t1.total_price_with_tax,
|
t1.total_price_with_tax,
|
||||||
t1.total_price_without_tax,
|
t1.total_price_without_tax,
|
||||||
t1.tax_amount,
|
t1.tax_amount,
|
||||||
t1.paid_payment_amount,
|
|
||||||
t1.unpaid_payment_amount,
|
|
||||||
t1.received_ticket_amount,
|
|
||||||
t1.unreceived_ticket_amount,
|
|
||||||
t1.last_payment_plan_id,
|
|
||||||
t1.last_ticket_plan_id,
|
|
||||||
t1.create_by,
|
t1.create_by,
|
||||||
t1.create_time,
|
t1.create_time,
|
||||||
t1.update_by,
|
t1.update_by,
|
||||||
|
|
@ -80,24 +47,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
t1.del_flag ,
|
t1.del_flag ,
|
||||||
t3.project_code,
|
t3.project_code,
|
||||||
t3.project_name,
|
t3.project_name,
|
||||||
t4.vendor_name,
|
t4.vendor_name
|
||||||
ppp.plan_payment_date,
|
|
||||||
ppp.plan_amount,
|
|
||||||
t5.plan_ticket_date,
|
|
||||||
t5.plan_amount as plan_ticket_amount
|
|
||||||
FROM
|
FROM
|
||||||
oms_payable_bill t1
|
oms_payable_bill t1
|
||||||
left join project_order_info t2 on t1.order_code=t2.order_code
|
left join project_order_info t2 on t1.order_code=t2.order_code
|
||||||
left join project_info t3 on t2.project_id=t3.id
|
left join project_info t3 on t2.project_id=t3.id
|
||||||
left join oms_vendor_info t4 on t1.vendor_code=t4.vendor_code
|
left join oms_vendor_info t4 on t1.vendor_code=t4.vendor_code
|
||||||
left join oms_payable_payment_plan ppp on t1.last_payment_plan_id = ppp.id
|
|
||||||
left join oms_payable_ticket_plan t5 on t1.last_ticket_plan_id = t5.id
|
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectOmsPayableBillList" parameterType="OmsPayableBill" resultMap="OmsPayableBillResult">
|
<select id="selectOmsPayableBillList" parameterType="OmsPayableBill" resultMap="OmsPayableBillResult">
|
||||||
<include refid="selectOmsPayableBillRelationVo"/>
|
<include refid="selectOmsPayableBillRelationVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="payableBillCode != null and payableBillCode != ''"> and t1.payable_bill_code like concat( #{payableBillCode},'%') </if>
|
<if test="payableBillCode != null and payableBillCode != ''"> and t1.payable_bill_code like concat( #{payableBillCode},'%') </if>
|
||||||
<if test="idList != null and idList.size>0"> and t1.id in <foreach item="item" collection="idList" separator="," open="(" close=")" index="">#{item}</foreach></if>
|
<if test="estimatedPaymentTime != null "> and t1.estimated_payment_time = #{estimatedPaymentTime}</if>
|
||||||
<if test="vendorCode != null and vendorCode != ''"> and t1.vendor_code = #{vendorCode}</if>
|
<if test="vendorCode != null and vendorCode != ''"> and t1.vendor_code = #{vendorCode}</if>
|
||||||
<if test="vendorName != null and vendorName != ''"> and t4.vendor_name = #{vendorName}</if>
|
<if test="vendorName != null and vendorName != ''"> and t4.vendor_name = #{vendorName}</if>
|
||||||
<if test="projectCode != null and projectCode != ''"> and t3.project_code = #{projectCode}</if>
|
<if test="projectCode != null and projectCode != ''"> and t3.project_code = #{projectCode}</if>
|
||||||
|
|
@ -108,14 +69,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="totalPriceWithTax != null "> and t1.total_price_with_tax = #{totalPriceWithTax}</if>
|
<if test="totalPriceWithTax != null "> and t1.total_price_with_tax = #{totalPriceWithTax}</if>
|
||||||
<if test="totalPriceWithoutTax != null "> and t1.total_price_without_tax = #{totalPriceWithoutTax}</if>
|
<if test="totalPriceWithoutTax != null "> and t1.total_price_without_tax = #{totalPriceWithoutTax}</if>
|
||||||
<if test="taxAmount != null "> and t1.tax_amount = #{taxAmount}</if>
|
<if test="taxAmount != null "> and t1.tax_amount = #{taxAmount}</if>
|
||||||
<if test="paidPaymentAmount != null "> and t1.paid_payment_amount = #{paidPaymentAmount}</if>
|
|
||||||
<if test="unpaidPaymentAmount != null "> and t1.unpaid_payment_amount = #{unpaidPaymentAmount}</if>
|
|
||||||
<if test="receivedTicketAmount != null "> and t1.received_ticket_amount = #{receivedTicketAmount}</if>
|
|
||||||
<if test="unreceivedTicketAmount != null "> and t1.unreceived_ticket_amount = #{unreceivedTicketAmount}</if>
|
|
||||||
<if test="lastPaymentPlanId != null"> and t1.last_payment_plan_id = #{lastPaymentPlanId}</if>
|
|
||||||
<if test="lastTicketPlanId != null"> and t1.last_ticket_plan_id = #{lastTicketPlanId}</if>
|
|
||||||
<if test="planPaymentDate != null "> and ppp.plan_payment_date = #{planPaymentDate}</if>
|
|
||||||
<if test="planAmount != null "> and ppp.plan_amount = #{planAmount}</if>
|
|
||||||
<if test="createTimeStart != null or createTimeEnd != null">
|
<if test="createTimeStart != null or createTimeEnd != null">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="createTimeStart != null and createTimeEnd != null">
|
<when test="createTimeStart != null and createTimeEnd != null">
|
||||||
|
|
@ -130,17 +83,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
</choose>
|
</choose>
|
||||||
</if>
|
</if>
|
||||||
<if test="planPaymentDateStart != null or planPaymentDateEnd != null">
|
<if test="estimatedPaymentTimeStart != null or estimatedPaymentTimeEnd != null">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="planPaymentDateStart != null and planPaymentDateEnd != null">
|
<when test="estimatedPaymentTimeStart != null and estimatedPaymentTimeEnd != null">
|
||||||
and ppp.plan_payment_date between date_format(#{planPaymentDateStart}, '%Y-%m-%d 00:00:00') and date_format(#{planPaymentDateEnd}, '%Y-%m-%d 23:59:59')
|
and t1.estimated_payment_time between date_format(#{estimatedPaymentTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{estimatedPaymentTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||||
</when>
|
</when>
|
||||||
<when test="planPaymentDateStart != null">
|
<when test="estimatedPaymentTimeStart != null">
|
||||||
and ppp.plan_payment_date <![CDATA[ >= ]]> date_format(#{planPaymentDateStart}, '%Y-%m-%d 00:00:00')
|
and t1.estimated_payment_time <![CDATA[ >= ]]> date_format(#{estimatedPaymentTimeStart}, '%Y-%m-%d 00:00:00')
|
||||||
</when>
|
</when>
|
||||||
<when test="planPaymentDateEnd != null">
|
<when test="estimatedPaymentTimeEnd != null">
|
||||||
and ppp.plan_payment_date <![CDATA[ <= ]]> date_format(#{planPaymentDateEnd}, '%Y-%m-%d 23:59:59')
|
and t1.estimated_payment_time <![CDATA[ <= ]]> date_format(#{estimatedPaymentTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||||
</when>
|
</when>
|
||||||
|
|
||||||
</choose>
|
</choose>
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
|
@ -160,21 +114,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
insert into oms_payable_bill
|
insert into oms_payable_bill
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="payableBillCode != null and payableBillCode != ''">payable_bill_code,</if>
|
<if test="payableBillCode != null and payableBillCode != ''">payable_bill_code,</if>
|
||||||
|
<if test="estimatedPaymentTime != null">estimated_payment_time,</if>
|
||||||
<if test="vendorCode != null">vendor_code,</if>
|
<if test="vendorCode != null">vendor_code,</if>
|
||||||
<if test="orderCode != null">order_code,</if>
|
<if test="orderCode != null">order_code,</if>
|
||||||
<if test="inventoryCode != null">inventory_code,</if>
|
<if test="inventoryCode != null">inventory_code,</if>
|
||||||
<if test="productType != null">product_type,</if>
|
<if test="productType != null">product_type,</if>
|
||||||
<if test="productCode != null">product_code,</if>
|
|
||||||
<if test="totalPriceWithTax != null">total_price_with_tax,</if>
|
<if test="totalPriceWithTax != null">total_price_with_tax,</if>
|
||||||
<if test="totalPriceWithoutTax != null">total_price_without_tax,</if>
|
<if test="totalPriceWithoutTax != null">total_price_without_tax,</if>
|
||||||
<if test="taxAmount != null">tax_amount,</if>
|
<if test="taxAmount != null">tax_amount,</if>
|
||||||
<if test="paidPaymentAmount != null">paid_payment_amount,</if>
|
|
||||||
<if test="unpaidPaymentAmount != null">unpaid_payment_amount,</if>
|
|
||||||
<if test="receivedTicketAmount != null">received_ticket_amount,</if>
|
|
||||||
<if test="unreceivedTicketAmount != null">unreceived_ticket_amount,</if>
|
|
||||||
<if test="lastPaymentPlanId != null">last_payment_plan_id,</if>
|
|
||||||
<if test="lastTicketPlanId != null">last_ticket_plan_id,</if>
|
|
||||||
<if test="taxRate != null">tax_rate,</if>
|
|
||||||
|
|
||||||
|
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
|
|
@ -186,21 +133,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="payableBillCode != null and payableBillCode != ''">#{payableBillCode},</if>
|
<if test="payableBillCode != null and payableBillCode != ''">#{payableBillCode},</if>
|
||||||
|
<if test="estimatedPaymentTime != null">#{estimatedPaymentTime},</if>
|
||||||
<if test="vendorCode != null">#{vendorCode},</if>
|
<if test="vendorCode != null">#{vendorCode},</if>
|
||||||
<if test="orderCode != null">#{orderCode},</if>
|
<if test="orderCode != null">#{orderCode},</if>
|
||||||
<if test="inventoryCode != null">#{inventoryCode},</if>
|
<if test="inventoryCode != null">#{inventoryCode},</if>
|
||||||
<if test="productType != null">#{productType},</if>
|
<if test="productType != null">#{productType},</if>
|
||||||
<if test="productCode != null">#{productCode},</if>
|
|
||||||
<if test="totalPriceWithTax != null">#{totalPriceWithTax},</if>
|
<if test="totalPriceWithTax != null">#{totalPriceWithTax},</if>
|
||||||
<if test="totalPriceWithoutTax != null">#{totalPriceWithoutTax},</if>
|
<if test="totalPriceWithoutTax != null">#{totalPriceWithoutTax},</if>
|
||||||
<if test="taxAmount != null">#{taxAmount},</if>
|
<if test="taxAmount != null">#{taxAmount},</if>
|
||||||
<if test="paidPaymentAmount != null">#{paidPaymentAmount},</if>
|
|
||||||
<if test="unpaidPaymentAmount != null">#{unpaidPaymentAmount},</if>
|
|
||||||
<if test="receivedTicketAmount != null">#{receivedTicketAmount},</if>
|
|
||||||
<if test="unreceivedTicketAmount != null">#{unreceivedTicketAmount},</if>
|
|
||||||
<if test="lastPaymentPlanId != null">#{lastPaymentPlanId},</if>
|
|
||||||
<if test="lastTicketPlanId != null">#{lastTicketPlanId},</if>
|
|
||||||
<if test="taxRate != null">#{taxRate},</if>
|
|
||||||
|
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
|
@ -215,6 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
update oms_payable_bill
|
update oms_payable_bill
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="payableBillCode != null and payableBillCode != ''">payable_bill_code = #{payableBillCode},</if>
|
<if test="payableBillCode != null and payableBillCode != ''">payable_bill_code = #{payableBillCode},</if>
|
||||||
|
<if test="estimatedPaymentTime != null">estimated_payment_time = #{estimatedPaymentTime},</if>
|
||||||
<if test="vendorCode != null">vendor_code = #{vendorCode},</if>
|
<if test="vendorCode != null">vendor_code = #{vendorCode},</if>
|
||||||
<if test="orderCode != null">order_code = #{orderCode},</if>
|
<if test="orderCode != null">order_code = #{orderCode},</if>
|
||||||
<if test="inventoryCode != null">inventory_code = #{inventoryCode},</if>
|
<if test="inventoryCode != null">inventory_code = #{inventoryCode},</if>
|
||||||
|
|
@ -222,12 +164,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="totalPriceWithTax != null">total_price_with_tax = #{totalPriceWithTax},</if>
|
<if test="totalPriceWithTax != null">total_price_with_tax = #{totalPriceWithTax},</if>
|
||||||
<if test="totalPriceWithoutTax != null">total_price_without_tax = #{totalPriceWithoutTax},</if>
|
<if test="totalPriceWithoutTax != null">total_price_without_tax = #{totalPriceWithoutTax},</if>
|
||||||
<if test="taxAmount != null">tax_amount = #{taxAmount},</if>
|
<if test="taxAmount != null">tax_amount = #{taxAmount},</if>
|
||||||
<if test="paidPaymentAmount != null">paid_payment_amount = #{paidPaymentAmount},</if>
|
|
||||||
<if test="unpaidPaymentAmount != null">unpaid_payment_amount = #{unpaidPaymentAmount},</if>
|
|
||||||
<if test="receivedTicketAmount != null">received_ticket_amount = #{receivedTicketAmount},</if>
|
|
||||||
<if test="unreceivedTicketAmount != null">unreceived_ticket_amount = #{unreceivedTicketAmount},</if>
|
|
||||||
<if test="lastPaymentPlanId != null">last_payment_plan_id = #{lastPaymentPlanId},</if>
|
|
||||||
<if test="lastTicketPlanId != null">last_ticket_plan_id = #{lastTicketPlanId},</if>
|
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
|
@ -243,35 +179,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteOmsPayableBillByIds" parameterType="String">
|
<delete id="deleteOmsPayableBillByIds" parameterType="String">
|
||||||
delete from oms_payable_bill where id in
|
delete from oms_payable_bill where id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<update id="updateBatchPayableBillPaymentInfo">
|
|
||||||
<foreach collection="list" item="item" separator=";">
|
|
||||||
UPDATE oms_payable_bill
|
|
||||||
SET
|
|
||||||
last_payment_plan_id = #{item.lastPaymentPlanId},
|
|
||||||
paid_payment_amount = #{item.paidPaymentAmount},
|
|
||||||
unpaid_payment_amount = #{item.unpaidPaymentAmount},
|
|
||||||
update_time = NOW(),
|
|
||||||
update_by = #{item.updateBy}
|
|
||||||
WHERE id = #{item.id}
|
|
||||||
</foreach>
|
|
||||||
</update>
|
|
||||||
<update id="updateBatchPayableBillTicketInfo">
|
|
||||||
<foreach collection="list" item="item" separator=";">
|
|
||||||
UPDATE oms_payable_bill
|
|
||||||
SET
|
|
||||||
last_ticket_plan_id = #{item.lastTicketPlanId},
|
|
||||||
received_ticket_amount = #{item.receivedTicketAmount},
|
|
||||||
unreceived_ticket_amount = #{item.unreceivedTicketAmount},
|
|
||||||
update_time = NOW(),
|
|
||||||
update_by = #{item.updateBy}
|
|
||||||
WHERE id = #{item.id}
|
|
||||||
</foreach>
|
|
||||||
</update>
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -75,20 +75,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectByPaymentPlanIds" resultType="com.ruoyi.sip.domain.OmsPayablePaymentDetail">
|
|
||||||
SELECT
|
|
||||||
t1.id, t1.payment_plan_id, t1.payable_bill_id, t1.payment_time,
|
|
||||||
t1.payment_amount, t1.payment_rate, t1.payment_bill_code, t1.remark,
|
|
||||||
t1.create_time, t1.create_by, t1.update_time, t1.payable_detail_type
|
|
||||||
FROM
|
|
||||||
oms_payable_payment_detail t1
|
|
||||||
WHERE t1.payment_plan_id IN
|
|
||||||
<foreach collection="paymentPlanIds" item="item" open="(" separator="," close=")">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
ORDER BY t1.create_time DESC
|
|
||||||
</select>
|
|
||||||
<select id="listPayableByPaymentCode" resultType="com.ruoyi.sip.domain.dto.PaymentBillPayableDetailDTO">
|
<select id="listPayableByPaymentCode" resultType="com.ruoyi.sip.domain.dto.PaymentBillPayableDetailDTO">
|
||||||
select t1.payment_amount, t2.payable_bill_code, t4.project_name, t4.project_code, t2.total_price_with_tax
|
select t1.payment_amount, t2.payable_bill_code, t4.project_name, t4.project_code, t2.total_price_with_tax
|
||||||
from (SELECT sum(payment_amount) payment_amount,
|
from (SELECT sum(payment_amount) payment_amount,
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectInventoryInfoVo">
|
<sql id="selectInventoryInfoVo">
|
||||||
select t1.id, t1.product_code, t1.product_sn, t1.inventory_status, t1.inner_code, t1.outer_code, t1.warehouse_id, t1.inner_price,t1.tax_rate,
|
select t1.id, t1.product_code, t1.product_sn, t1.inventory_status, t1.inner_code, t1.outer_code, t1.warehouse_id, t1.inner_price,
|
||||||
t1.outer_price, t1.create_by, t1.create_time, t1.update_by, t1.update_time ,
|
t1.outer_price, t1.create_by, t1.create_time, t1.update_by, t1.update_time ,
|
||||||
t2.warehouse_name,t3.description as 'product_desc',t3.model
|
t2.warehouse_name,t3.description as 'product_desc',t3.model
|
||||||
from oms_inventory_info t1
|
from oms_inventory_info t1
|
||||||
|
|
@ -135,10 +135,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="saveBatch">
|
<insert id="saveBatch">
|
||||||
insert into oms_inventory_info (product_code, product_sn, inventory_status, inner_code, outer_code
|
insert into oms_inventory_info (product_code, product_sn, inventory_status, inner_code, outer_code
|
||||||
, warehouse_id, inner_price, outer_price, create_by, create_time, update_by, update_time,payable_bill_code,tax_rate) values
|
, warehouse_id, inner_price, outer_price, create_by, create_time, update_by, update_time,payable_bill_code) values
|
||||||
<foreach item="item" index="index" collection="list" separator=",">
|
<foreach item="item" index="index" collection="list" separator=",">
|
||||||
(#{item.productCode}, #{item.productSn}, #{item.inventoryStatus}, #{item.innerCode}, #{item.outerCode}
|
(#{item.productCode}, #{item.productSn}, #{item.inventoryStatus}, #{item.innerCode}, #{item.outerCode}
|
||||||
, #{item.warehouseId}, #{item.innerPrice}, #{item.outerPrice}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime},#{item.payableBillCode},#{item.taxRate})
|
, #{item.warehouseId}, #{item.innerPrice}, #{item.outerPrice}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime},#{item.payableBillCode})
|
||||||
</foreach>
|
</foreach>
|
||||||
ON DUPLICATE KEY UPDATE
|
ON DUPLICATE KEY UPDATE
|
||||||
inventory_status = VALUES(inventory_status),
|
inventory_status = VALUES(inventory_status),
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
t2.warehouse_name,
|
t2.warehouse_name,
|
||||||
t4.product_code,
|
t4.product_code,
|
||||||
t4.model,
|
t4.model,
|
||||||
t4.available_count,
|
t4.available_count
|
||||||
t4.type as product_type
|
|
||||||
from oms_inventory_outer_detail t1
|
from oms_inventory_outer_detail t1
|
||||||
left join oms_warehouse_info t2 on t1.warehouse_id=t2.id
|
left join oms_warehouse_info t2 on t1.warehouse_id=t2.id
|
||||||
left join oms_inventory_outer t3 on t1.outer_code=t3.outer_code
|
left join oms_inventory_outer t3 on t1.outer_code=t3.outer_code
|
||||||
|
|
|
||||||
|
|
@ -40,40 +40,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="selectOmsPayablePaymentPlanIdsByPayableBillId" parameterType="Long" resultType="Long">
|
<select id="selectOmsPayablePaymentPlanIdsByPayableBillId" parameterType="Long" resultType="Long">
|
||||||
select id from oms_payable_payment_plan where payable_bill_id = #{payableBillId}
|
select id from oms_payable_payment_plan where payable_bill_id = #{payableBillId}
|
||||||
</select>
|
</select>
|
||||||
<select id="firstUnPayPlan" resultType="com.ruoyi.sip.domain.OmsPayablePaymentPlan">
|
|
||||||
select t1.id,
|
|
||||||
t1.payable_bill_id,
|
|
||||||
t1.plan_payment_date,
|
|
||||||
t1.plan_amount,
|
|
||||||
t1.plan_rate,
|
|
||||||
t1.remark,
|
|
||||||
t1.create_time,
|
|
||||||
t1.create_by,
|
|
||||||
t1.update_time
|
|
||||||
from oms_payable_payment_plan t1
|
|
||||||
left join oms_payable_payment_detail t2 on t1.id = t2.payment_plan_id
|
|
||||||
where t2.id is null and t1.payable_bill_id = #{payableBillId}
|
|
||||||
order by plan_payment_date
|
|
||||||
limit 1
|
|
||||||
</select>
|
|
||||||
<select id="listDetailByPayableBillIdList" resultType="com.ruoyi.sip.domain.OmsPayablePaymentPlan">
|
|
||||||
select t1.id,
|
|
||||||
t1.payable_bill_id,
|
|
||||||
t1.plan_payment_date,
|
|
||||||
t1.plan_amount,
|
|
||||||
t1.plan_rate,
|
|
||||||
t1.remark,
|
|
||||||
t1.create_time,
|
|
||||||
t1.create_by,
|
|
||||||
t1.update_time
|
|
||||||
from oms_payable_payment_plan t1
|
|
||||||
left join oms_payable_payment_detail t2 on t1.id = t2.payment_plan_id
|
|
||||||
left join oms_payment_bill t3 on t1.id = t3.id
|
|
||||||
where t1.payable_bill_id in
|
|
||||||
<foreach item="item" index="index" collection="list" separator="," open="(" close=")">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="insertOmsPayablePaymentPlan" parameterType="OmsPayablePaymentPlan" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertOmsPayablePaymentPlan" parameterType="OmsPayablePaymentPlan" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into oms_payable_payment_plan(
|
insert into oms_payable_payment_plan(
|
||||||
|
|
|
||||||
|
|
@ -66,18 +66,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectByTicketPlanIds" resultType="com.ruoyi.sip.domain.OmsPayableTicketDetail">
|
|
||||||
<include refid="selectOmsPayableTicketDetailVo"/>
|
|
||||||
<where>
|
|
||||||
<if test="list != null and list.size > 0">
|
|
||||||
and ticket_plan_id in
|
|
||||||
<foreach item="item" collection="list" separator="," open="(" close=")" index="">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectOmsPayableTicketDetailById" parameterType="Long" resultMap="OmsPayableTicketDetailResult">
|
<select id="selectOmsPayableTicketDetailById" parameterType="Long" resultMap="OmsPayableTicketDetailResult">
|
||||||
<include refid="selectOmsPayableTicketDetailVo"/>
|
<include refid="selectOmsPayableTicketDetailVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
|
|
|
||||||
|
|
@ -55,15 +55,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<include refid="selectOmsPayableTicketPlanVo"/>
|
<include refid="selectOmsPayableTicketPlanVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="firstUnPayPlan" resultType="com.ruoyi.sip.domain.OmsPayableTicketPlan">
|
|
||||||
select t1.id, t1.payable_bill_id, t1.plan_ticket_date, t1.plan_amount, t1.plan_rate, t1.create_by, t1.create_time, t1.update_by,
|
|
||||||
t1.update_time
|
|
||||||
from oms_payable_ticket_plan t1
|
|
||||||
left join oms_payable_ticket_detail t2 on t1.id=t2.ticket_plan_id
|
|
||||||
where t2.id is null and t1.payable_bill_id=#{payableBillId}
|
|
||||||
order by t1.plan_ticket_date
|
|
||||||
limit 1
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="insertOmsPayableTicketPlan" parameterType="com.ruoyi.sip.domain.OmsPayableTicketPlan" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertOmsPayableTicketPlan" parameterType="com.ruoyi.sip.domain.OmsPayableTicketPlan" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into oms_payable_ticket_plan
|
insert into oms_payable_ticket_plan
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue