Compare commits

...

6 Commits

Author SHA1 Message Date
chenhao 05865dc2ef feat(finance): 新增付款单管理功能
- 新增付款单详情抽屉组件,展示付款单及应付单详细信息
- 新增付款单列表页面,支持多条件筛选和分页查询
- 新增财务管理路由模块,包含付款单子菜单
- 优化应付单日期格式化逻辑,统一使用HH:mm:ss格式
- 实现合并付款单并发起支付功能,支持批量处理应付单
- 新增付款明细实体类及相关Mapper、Service实现
- 完善应付单查询条件,增加预计付款时间范围查询
- 调整付款计划相关类包结构,统一移至sip.domain包下
2025-12-09 09:11:32 +08:00
chenhao 30d551fe59 Merge branch 'refs/heads/master' into dev_1.0.0 2025-12-09 09:10:37 +08:00
chenhao 2899c05e95 fix(flow): 修正待办事项查询逻辑并新增统计功能
- 修正待办事项查询条件,使用用户ID替代用户名
- 新增待办事项统计接口及实现逻辑
- 调整项目订单信息字段拼写错误(order_tpye → order_type)
- 在XML映射文件中增加approveUser查询条件判断
- 实现按流程类型分组统计数据功能
2025-12-09 09:10:05 +08:00
chenhao b4984e6e4b feat(inventory): 增加订单类型字段支持
- 在出库相关组件和接口中新增 orderType 字段传递与处理逻辑
- 调整导入功能根据订单类型决定是否弹出采购单选择框
- 更新出库表单提交时携带订单类型参数
- 后端实体类 InventoryOuter 和 ProjectOrderInfo 新增 orderType 属性
- 数据库映射文件同步增加 order_type 字段查询与插入支持
- 优化税率计算逻辑,防止空指针异常
- 调整页面布局以容纳订单类型下拉选择框
- 修复前端字典加载及日期格式显示问题
2025-12-08 17:40:15 +08:00
chenhao 675c1f3b95 feat(sip): 增强采购订单与库存管理功能
- 修改采购订单状态判断逻辑,优化供应商确认按钮显示条件
- 库存导入接口新增订单类型参数,支持不同类型订单处理
- 完善库存信息校验逻辑,增加产品编码一致性检查
- 采购订单查询增加权限控制,支持按供应商编码过滤
- 优化采购订单详情计算逻辑,增强金额计算准确性
- 调整侧边栏字体大小,改善界面显示效果
- 修复Vue组件中价格设置相关逻辑问题
- 移除无用的控制台日志输出和冗余代码引用
2025-12-08 17:01:23 +08:00
chenhao 333b5e1a8e fix(finance): 优化付款计划选择逻辑并修正计算方式
- 移除重复的付款计划验证逻辑
- 修正订单当前付款比例的计算方法,使用含税总价替代未付金额
- 新增 handleChooseConfirm 方法处理付款计划的选择确认逻辑
- 在 PaymentPlan 组件中支持传入选中的付款计划,并初始化表格选中状态
- 更新 MergePaymentDialog 中对 PaymentPlanSelector 组件的引用及事件绑定
- 调整付款比例计算条件,允许未付金额为零的情况
2025-12-05 16:35:11 +08:00
63 changed files with 1884 additions and 240 deletions

View File

@ -25,3 +25,12 @@ export function updatePaymentPlan(payableBillId, data) {
data: data
})
}
// 合并并发起付款
export function mergeAndInitiatePayment(data) {
return request({
url: '/finance/payable/mergeAndInitiatePayment',
method: 'post',
data: data
})
}

View File

@ -0,0 +1,30 @@
import request from '@/utils/request'
import { tansParams } from "@/utils/ruoyi"
// 查询付款单列表
export function listPayment(query) {
return request({
url: '/finance/payment/list',
method: 'post',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: tansParams(query)
})
}
// 查询付款单详细
export function getPayment(id) {
return request({
url: '/finance/payment/' + id,
method: 'get'
})
}
// 退回付款单
export function returnPayment(id) {
return request({
url: '/finance/payment/returnPayment/' + id,
method: 'delete'
})
}

View File

@ -142,6 +142,24 @@ export const dynamicRoutes = [
}
]
},
{
path: '/finance',
component: Layout,
redirect: 'noRedirect',
name: 'Finance',
meta: {
title: '财务管理',
icon: 'money'
},
children: [
{
path: 'payment',
component: () => import('@/views/finance/payment/index'),
name: 'Payment',
meta: { title: '付款单', icon: 'form' }
}
]
},
{
path: '/inventory/execution',
component: Layout,

View File

@ -59,7 +59,7 @@
</el-table-column>
<el-table-column label="本次付款比例" align="center" width="120">
<template slot-scope="scope">
{{ calculateOrderCurrentPaymentRate(scope.row.id).toFixed(2) }}%
{{ calculateOrderCurrentPaymentRate(scope.row.id) }}%
</template>
</el-table-column>
<el-table-column label="已付款金额" align="center" prop="paidAmount" width="120"/>
@ -90,13 +90,15 @@
<el-dialog :title="planTitle" :visible.sync="isPaymentPlanSelectorOpen" width="70%"
@close="isPaymentPlanSelectorOpen=false" append-to-body>
<payment-plan-selector
ref="planSelector"
:payable-data="choosePayable"
:selected-plans="choosePayable.paymentPlans"
@confirm="handlePaymentPlanConfirm"
/>
<div slot="footer" class="dialog-footer">
<el-button @click="isPaymentPlanSelectorOpen=false"> </el-button>
<!-- <el-button type="primary" @click="handleConfirm" > </el-button>-->
<el-button type="primary" @click="handleConfirm"> </el-button>
<el-button type="primary" @click="handleChooseConfirm"> </el-button>
</div>
</el-dialog>
<!-- 付款计划选择器弹窗 -->
@ -205,6 +207,43 @@ export default {
this.dialogVisible = false;
this.resetForm();
},
handleChooseConfirm() {
if (!this.$refs.planSelector || !this.$refs.planSelector.selectedPlan) {
this.$modal.msgError('无法获取计划选择器组件或其选择的计划');
return;
}
const selectedPlans = this.$refs.planSelector.selectedPlan;
const orderIndex = this.payableOrdersWithPlans.findIndex(o => o.id === this.choosePayable.id);
if (orderIndex === -1) {
this.$modal.msgError('找不到要更新的应付单');
return;
}
const currentOrder = this.payableOrdersWithPlans[orderIndex];
// Ensure the paymentPlans array exists
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;
if (addedCount > 0) {
this.$modal.msgSuccess(`成功补充 ${addedCount} 条付款计划`);
} else {
this.$modal.msgWarning('没有新的付款计划被添加');
}
},
handleConfirm() {
// Validate main form fields
if (!this.form.paymentBillType) {
@ -223,11 +262,6 @@ export default {
return;
}
const totalPlannedAmountForOrder = order.paymentPlans.reduce((sum, plan) => sum + (plan.planAmount || 0), 0);
if (Math.abs(totalPlannedAmountForOrder - order.unpaidAmount) > 0.01) { // Compare against unpaidAmount
this.$modal.msgError(`应付单 ${order.payableBillCode} 的计划付款总金额 (${totalPlannedAmountForOrder.toFixed(2)}) 与其未付款金额 (${order.unpaidAmount.toFixed(2)}) 不符,请检查。`);
return;
}
for (const plan of order.paymentPlans) {
if (!plan.planPaymentDate) {
@ -258,6 +292,7 @@ export default {
planAmount: plan.planAmount,
planRate: plan.planRate,
remark: plan.remark,
id: plan.id,
})),
})),
totalMergePaymentAmount: this.totalPlannedAmount, // Total amount for the merged bill
@ -305,9 +340,9 @@ export default {
},
calculateOrderCurrentPaymentRate(orderId) {
const order = this.payableOrdersWithPlans.find(o => o.id === orderId);
if (order && order.paymentPlans && order.unpaidAmount > 0) {
if (order && order.paymentPlans && order.unpaidAmount >= 0) {
const currentAmount = this.calculateOrderCurrentPaymentAmount(orderId);
return (currentAmount / order.unpaidAmount * 100);
return this.$calc.mul(this.$calc.div(currentAmount ,order.totalPriceWithTax,4 ),100);
}
return 0;
},

View File

@ -10,14 +10,16 @@
style="margin-bottom: 10px;">
编辑
</el-button>
<el-table :data="paymentPlans" border @selection-change="selectPlan">
<el-table :data="paymentPlans" border @selection-change="selectPlan" ref="paymentPlanTable">
<el-table-column type="selection" width="50" align="center"/>
<el-table-column v-show="false" prop="id" width="50" align="center"/>
<el-table-column label="序号" type="index" width="50" align="center"></el-table-column>
<el-table-column label="预计付款时间" align="center" width="200">
<template slot-scope="scope">
<el-date-picker v-model="scope.row.planPaymentDate" type="date" style="width: 180px"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期"
:readonly="!scope.row.detailId"
:disabled="!isEditing || scope.row.status === 'paid'"></el-date-picker>
</template>
</el-table-column>
@ -28,6 +30,7 @@
:precision="2"
:step="100"
:min="0.01"
:readonly="!scope.row.detailId"
:max="totalPriceWithTax"
@change="handleAmountChange(scope.row)"
:disabled="!isEditing || scope.row.status === 'paid'"
@ -42,6 +45,7 @@
:step="1"
:min="0.01"
:max="100"
:readonly="!scope.row.detailId"
@change="handleRateChange(scope.row)"
:disabled="!isEditing || scope.row.status === 'paid'"
></el-input-number>
@ -50,19 +54,19 @@
<el-table-column label="备注" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.remark" placeholder="请输入备注"
:disabled="!isEditing || scope.row.status === 'paid'"></el-input>
:disabled="!isEditing || scope.row.detailId"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="150" fixed="right">
<template slot-scope="scope">
<el-button v-if="isEditing"
<el-button v-if="isEditing && !scope.row.detailId"
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAddPaymentPlanRow"
>增加下行
</el-button>
<el-button v-if="isEditing"
<el-button v-if="isEditing && !scope.row.detailId"
size="mini"
type="text"
icon="el-icon-delete"
@ -97,6 +101,10 @@ export default {
isInitEdit: {
type: Boolean,
default: false
},
selectedPlans: {
type: Array,
default: () => []
}
},
data() {
@ -141,6 +149,7 @@ export default {
},
methods: {
selectPlan( selection){
console.log(selection)
this.selectedPlan=selection
},
fetchPaymentPlans(payableId) {
@ -153,6 +162,15 @@ export default {
}));
if (this.paymentPlans.length === 0) {
this.initDefaultPaymentPlan();
} else {
this.$nextTick(() => {
this.paymentPlans.forEach(plan => {
const isSelected = this.selectedPlans.some(selected => selected.id === plan.id);
if (isSelected) {
this.$refs.paymentPlanTable.toggleRowSelection(plan, true);
}
});
});
}
})
} else {

View File

@ -73,7 +73,7 @@
<el-date-picker
v-model="dateRange"
style="width: 240px"
value-format="yyyy-MM-dd hh:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
@ -84,7 +84,7 @@
<el-date-picker
v-model="estimatedPaymentDateRange"
style="width: 240px"
value-format="yyyy-MM-dd hh:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
@ -200,7 +200,7 @@
</template>
<script>
import { listPayable } from "@/api/finance/payable";
import { listPayable, mergeAndInitiatePayment } from "@/api/finance/payable";
import EditForm from './components/EditForm.vue';
import MergePaymentDialog from './components/MergePaymentDialog.vue';
@ -328,11 +328,11 @@ export default {
},
/** 确认合并付款单操作 */
confirmMergePayment(paymentData) {
console.log("Merged payment data received:", paymentData);
// TODO: Call backend API to initiate merged payment
// this.$modal.msgSuccess("");
this.isMergePaymentDialogOpen = false;
this.getList(); // Refresh the list
mergeAndInitiatePayment(paymentData).then(() => {
this.$modal.msgSuccess("合并付款单发起成功");
this.isMergePaymentDialogOpen = false;
this.getList(); // Refresh the list
});
}
}
};

View File

@ -0,0 +1,168 @@
<template>
<el-drawer
title="付款单详情"
:visible.sync="visible"
direction="rtl"
size="70%"
@close="handleClose"
>
<div class="dialog-body" v-if="detail">
<div class="section">
<el-divider content-position="left">采购-付款单</el-divider>
<div class="details-container">
<el-row :gutter="20">
<el-col :span="8">
<div class="detail-item"><strong>采购-付款单编号:</strong> {{ detail.paymentBillCode }}</div>
</el-col>
<el-col :span="8">
<div class="detail-item"><strong>预计付款时间:</strong> {{ detail.paymentTime }}</div>
</el-col>
<el-col :span="8">
<div class="detail-item"><strong>制造商名称:</strong> {{ detail.vendorName }}</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="detail-item"><strong>含税总价:</strong> {{ detail.totalPriceWithTax }}</div>
</el-col>
<el-col :span="8">
<div class="detail-item"><strong>未税总价:</strong> {{ detail.totalPriceWithoutTax }}</div>
</el-col>
<el-col :span="8">
<div class="detail-item"><strong>税额:</strong> {{ detail.taxAmount }}</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="detail-item"><strong>付款单类型:</strong>
<dict-tag :options="dict.type.payment_bill_type" :value="detail.paymentBillType"/>
</div>
</el-col>
<el-col :span="8">
<div class="detail-item"><strong>预付单剩余额度:</strong> {{ detail.preResidueAmount || '-' }}</div>
</el-col>
<el-col :span="8">
<div class="detail-item"><strong>财务付款时间:</strong> {{ detail.actualPaymentTime || '-'}}</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="detail-item"><strong>支付方式:</strong> {{ detail.paymentMethod || '-'}}</div>
</el-col>
<el-col :span="8">
<div class="detail-item"><strong>回执单/退款图:</strong> {{ detail.receiptAttachmentId }} /
{{ detail.refundProofAttachmentId }}
</div>
</el-col>
<el-col :span="8">
<div class="detail-item"><strong>付款状态:</strong> {{ detail.paymentStatus }}</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="detail-item"><strong>备注:</strong> {{ detail.remark }}</div>
</el-col>
<el-col :span="8">
<div class="detail-item"><strong>上传人姓名:</strong> {{ detail.createBy }}</div>
</el-col>
<el-col :span="8">
<div class="detail-item"><strong>账户名称:</strong> {{ detail.payName }}</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="detail-item"><strong>银行账号:</strong> {{ detail.payBankNumber }}</div>
</el-col>
<el-col :span="8">
<div class="detail-item"><strong>银行开户行:</strong> {{ detail.payBankOpenAddress }}</div>
</el-col>
<el-col :span="8">
<div class="detail-item"><strong>银行行号:</strong> {{ detail.bankNumber }}</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="detail-item"><strong>审批节点:</strong> {{ detail.approveNode|| '-' }}</div>
</el-col>
<el-col :span="8">
<div class="detail-item"><strong>审批状态:</strong> {{ detail.approveStatus || '-'}}</div>
</el-col>
<el-col :span="8">
<div class="detail-item"><strong>审批通过时间:</strong> {{ detail.approveTime || '-'}}</div>
</el-col>
</el-row>
</div>
</div>
<div class="section">
<el-divider content-position="left">采购-应付单</el-divider>
<el-table :data="detail.payableDetails">
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column property="projectCode" label="项目编号"></el-table-column>
<el-table-column property="projectName" label="项目名称"></el-table-column>
<el-table-column property="payableBillCode" label="采购应付单编号"></el-table-column>
<el-table-column property="totalPriceWithTax" label="含税总价"></el-table-column>
<el-table-column property="paymentAmount" label="本次付款金额"></el-table-column>
<el-table-column property="paymentRatio" label="本次付款比例"></el-table-column>
</el-table>
</div>
</div>
</el-drawer>
</template>
<script>
export default {
name: "DetailDrawer",
props: {
visible: {
type: Boolean,
default: false,
},
detail: {
type: Object,
default: () => null,
},
},
dicts:['payment_bill_type'],
methods: {
handleClose() {
this.$emit("update:visible", false);
},
},
};
</script>
<style scoped>
.dialog-body {
max-height: calc(100vh - 50px); /* Adjust based on actual header/footer height */
overflow-y: auto;
padding: 0 20px 20px 20px; /* Adjust padding to match dialog-body style */
}
.details-container {
border: 1px solid #EBEEF5;
padding: 20px;
border-radius: 4px;
}
.detail-item {
display: flex;
border: 1px solid #EBEEF5;
padding: 10px;
border-radius: 4px;
margin-bottom: 10px;
font-size: 14px;
align-items: center;
}
.section {
margin-bottom: 20px;
}
.grid-content {
border-radius: 4px;
min-height: 36px;
line-height: 36px;
}
</style>

View File

@ -0,0 +1,298 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="项目编号" prop="projectCode">
<el-input
v-model="queryParams.projectCode"
placeholder="请输入项目编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="项目名称" prop="projectName">
<el-input
v-model="queryParams.projectName"
placeholder="请输入项目名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="付款单编号" prop="paymentBillCode">
<el-input
v-model="queryParams.paymentBillCode"
placeholder="请输入付款单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="制造商名称" prop="vendorCode">
<el-input
v-model="queryParams.vendorCode"
placeholder="请输入制造商名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="应付单编号" prop="payableBillCode">
<el-input
v-model="queryParams.payableBillCode"
placeholder="请输入应付单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="付款单类型" prop="paymentBillType">
<el-select v-model="queryParams.paymentBillType" placeholder="请选择付款单类型" clearable>
<el-option v-for="dict in dict.type.payment_bill_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="支付方式" prop="paymentMethod">
<el-select v-model="queryParams.paymentMethod" placeholder="请选择支付方式" clearable>
<el-option label="方式一" value="1" />
<el-option label="方式二" value="2" />
</el-select>
</el-form-item>
<el-form-item label="审批状态" prop="approveStatus">
<el-select v-model="queryParams.approveStatus" placeholder="请选择审批状态" clearable>
<el-option label="待提交" value="0" />
<el-option label="审批中" value="1" />
<el-option label="已审批" value="2" />
<el-option label="已驳回" value="3" />
</el-select>
</el-form-item>
<el-form-item label="付款状态" prop="paymentStatus">
<el-select v-model="queryParams.paymentStatus" placeholder="请选择付款状态" clearable>
<el-option label="待付款" value="0" />
<el-option label="已付款" value="1" />
</el-select>
</el-form-item>
<el-form-item label="审批节点" prop="approveNode">
<el-input
v-model="queryParams.approveNode"
placeholder="请输入审批节点"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="审批通过时间">
<el-date-picker
v-model="dateRangeApproval"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="预计付款时间">
<el-date-picker
v-model="dateRangeEstimated"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="实际付款时间">
<el-date-picker
v-model="dateRangeActual"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="paymentList">
<el-table-column label="付款单编号" align="center" prop="paymentBillCode" />
<el-table-column label="预计付款时间" align="center" prop="paymentTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.paymentTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="制造商名称" align="center" prop="vendorCode" />
<el-table-column label="含税总价" align="center" prop="totalPriceWithTax" />
<el-table-column label="付款单类型" align="center" prop="paymentBillType" >
<template slot-scope="scope">
<dict-tag :options="dict.type.payment_bill_type" :value="scope.row.paymentBillType"/>
</template>
</el-table-column>
<el-table-column label="预付单剩余额度" align="center" prop="preResidueAmount" />
<el-table-column label="实际付款时间" align="center" prop="actualPaymentTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.actualPaymentTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="支付方式" align="center" prop="paymentMethod" />
<el-table-column label="付款状态" align="center" prop="paymentStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.payment_status" :value="scope.row.paymentStatus"/>
</template>
</el-table-column>
<el-table-column label="审批状态" align="center" prop="approveStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.approve_status" :value="scope.row.approveStatus"/>
</template>
</el-table-column>
<el-table-column label="审批通过时间" align="center" prop="approveTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.approveTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="审批节点" align="center" prop="approveNode" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleDetail(scope.row)"
>查看详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-refresh-left"
@click="handleReturn(scope.row)"
>退回</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 详情抽屉 -->
<detail-drawer :visible.sync="detailOpen" :detail="detailData"></detail-drawer>
</div>
</template>
<script>
import { listPayment, getPayment, returnPayment } from "@/api/finance/payment";
import { addDateRange } from "@/utils/ruoyi";
import DetailDrawer from "./components/DetailDrawer.vue";
export default {
name: "Payment",
components: {
DetailDrawer
},
dicts:['payment_bill_type','approve_status','payment_status'],
data() {
return {
//
loading: true,
//
showSearch: true,
//
total: 0,
//
paymentList: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
projectCode: null,
projectName: null,
paymentBillCode: null,
vendorCode: null,
payableBillCode: null,
paymentBillType: null,
paymentMethod: null,
approveStatus: null,
paymentStatus: null,
approveNode: null,
},
//
dateRangeApproval: [],
dateRangeEstimated: [],
dateRangeActual: [],
//
detailOpen: false,
detailData: null,
};
},
created() {
this.getList();
},
methods: {
addDateRange, // Mixin addDateRange function
/** 查询付款单列表 */
getList() {
this.loading = true;
let query = { ...this.queryParams };
query = this.addDateRange(query, this.dateRangeApproval, 'ApproveTime');
query = this.addDateRange(query, this.dateRangeEstimated, 'PaymentTime');
query = this.addDateRange(query, this.dateRangeActual, 'ActualPaymentTime');
listPayment(query).then(response => {
this.paymentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeApproval = [];
this.dateRangeEstimated = [];
this.dateRangeActual = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
//
console.log("handleAdd");
},
/** 详情按钮操作 */
handleDetail(row) {
getPayment(row.id).then(response => {
this.detailData = response.data;
this.detailOpen = true;
});
},
/** 退回按钮操作 */
handleReturn(row) {
this.$modal.confirm('是否确认退回付款单编号为"' + row.paymentBillCode + '"的数据项?').then(function() {
return returnPayment(row.id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("退回成功");
}).catch(() => {});
}
}
};
</script>

View File

@ -84,6 +84,7 @@
import { addDelivery, listProductSn } from '@/api/inventory/delivery';
import {importSnData,exportDownloadTemplate} from '@/api/inventory/outer'
import PurchaseOrderSelectDialog from '../../../purchaseorder/components/PurchaseOrderSelectDialog.vue';
import {handleTree} from "@/utils/ruoyi";
export default {
name: "GenerateDeliveryForm",
@ -176,7 +177,12 @@ export default {
});
},
handleSelectPurchaseBeforeImport() {
this.purchaseOrderSelectVisible = true;
if ((this.productData.orderType || '1') === '1') {
this.purchaseOrderSelectVisible = true;
}else{
this.handleImport()
}
},
handlePurchaseOrderSelect(order) {
this.warehouseId = order.warehouseId;
@ -198,6 +204,7 @@ export default {
formData.append('file', file);
formData.append('productCode', this.productData.productCode);
formData.append('quantity', this.queryParams.pageSize);
formData.append('orderType', this.productData.orderType);
importSnData(formData).then(response => {
this.$message.success('导入成功');

View File

@ -164,7 +164,8 @@
</style>
<script>
import { getOrder, addOrder, updateOrder, delContractFile, uploadContractFile, getProject } from "@/api/project/order";
import { getOrder, addOrder, updateOrder, delContractFile, uploadContractFile } from "@/api/project/order";
import { getProject } from "@/api/project/info";
import ProductConfig from '@/views/project/info/ProductConfig.vue';
import SelectCommitType from "./SelectCommitType.vue";
import OrderInfo from '@/views/project/order/components/OrderInfo.vue';
@ -399,6 +400,8 @@ export default {
]
});
this.activeContractVersionTab = currentVersion;
console.log('11111')
console.log(this.projectId)
if (this.projectId) {
getProject(this.projectId).then(response => {
this.handleProjectSelected(response.data.project);

View File

@ -61,11 +61,18 @@
<el-input v-model="localOrderData.orderCode" placeholder="自动生成" readonly :disabled="isReadonly"/>
</el-form-item>
</el-col>
<el-col :span="16">
<el-col :span="8">
<el-form-item label="执行单截止时间" prop="orderEndTime">
<el-date-picker v-model="localOrderData.orderEndTime" type="date" value-format="yyyy-MM-dd" placeholder="审批完成后自动计算" disabled></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="订单类型" prop="orderType">
<el-select v-model="localOrderData.orderType" :disabled="isReadonly">
<el-option v-for="dict in dict.type.delivery_order_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="币种" prop="currencyType">
<el-select v-model="localOrderData.currencyType" placeholder="请选择币种" :disabled="isReadonly">
@ -82,7 +89,7 @@
</el-col>
<el-col :span="(localOrderData.processTemplate=='1' ||(localOrderData.processTemplate!='1' &&( localOrderData.orderStatus=='1'||localOrderData.orderStatus=='2')))?8:16">
<el-form-item label="总代出货金额" prop="shipmentAmount">
<el-input v-model="localOrderData.shipmentAmount" placeholder="请输入金额" :disabled="isReadonly"/>
<el-input v-model="localOrderData.shipmentAmount" placeholder="请输入金额" readonly :disabled="isReadonly"/>
</el-form-item>
</el-col>
<el-col :span="8">
@ -227,6 +234,7 @@ export default {
default: false
}
},
dicts:['delivery_order_type'],
data() {
return {
localOrderData: {},

View File

@ -286,9 +286,9 @@ export default {
},
totalAmountWithoutTax() {
const total = this.form.omsPurchaseOrderItemList?.reduce((acc, cur) => {
const amount = this.$calc.mul(cur.quantity, cur.price) || 0;
const amount = this.$calc.mul(cur.quantity||0, cur.price||0) || 0;
const taxRate = cur.taxRate || 0;
console.log(taxRate)
return acc + this.$calc.div(amount , (1 + taxRate));
}, 0);
return (this.$calc.toFixed(total)) || 0;
@ -369,7 +369,7 @@ export default {
this.$set(item, 'productCode', product.productCode);
this.$set(item, 'productModel', product.model);
this.$set(item, 'productDescription', product.description);
this.$set(item, 'price', product.cataloguePrice);
// this.$set(item, 'price', product.cataloguePrice);
this.calculateRowTotal(item)
}
this.productSelectOpen = false;
@ -402,13 +402,10 @@ export default {
},
/** 计算含税小计 */
calculateRowTotal(row) {
if (row.quantity != null && row.price != null) {
row.amountTotal = this.$calc.mul(row.quantity , row.price);
row.taxTotal = row.amountTotal - this.$calc.div(row.amountTotal , (1 + row.taxRate));
} else {
row.amountTotal = 0;
row.taxTotal = 0;
}
row.amountTotal = this.$calc.mul(row.quantity || 0, row.price || 0);
row.taxTotal = row.amountTotal - this.$calc.div(row.amountTotal, (1 + row.taxRate || 0));
},
/** 获取厂商列表 */
getVendorList() {

View File

@ -228,7 +228,6 @@ import {listAllVendor} from "@/api/base/vendor";
import {getDicts} from "@/api/system/dict/data";
export default {
name: "PurchaseOrderDetailView",
dicts: ['approve_status'],
@ -309,7 +308,11 @@ export default {
created() {
this.getVendorList().then(() => {
getDicts("product_type").then(response => {
this.productTypeOptions = response.data;
this.productTypeOptions = response.data.map(item => ({
value: item.dictValue,
label: item.dictLabel,
id:item.id
}));
});
// orderData
if (this.orderData) {

View File

@ -168,7 +168,7 @@
>发起供应商确认
</el-button>
<el-button
v-if="scope.row.approveStatus === '2' && (!scope.row.confirmStatus || scope.row.confirmStatus === ''|| scope.row.confirmStatus === '2')"
v-if="scope.row.approveStatus === '2' && (!scope.row.confirmStatus || scope.row.confirmStatus === ''|| scope.row.confirmStatus === '1')"
size="mini"
type="text"
icon="el-icon-refresh-left"

View File

@ -5,20 +5,12 @@ import java.io.InputStream;
import java.util.*;
import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.sip.domain.OmsInventoryInner;
import com.ruoyi.sip.domain.ProjectOrderFileLog;
import com.ruoyi.sip.dto.inventory.InventoryInfoExcelDto;
import com.ruoyi.sip.service.IInventoryAuthService;
import com.ruoyi.sip.service.IOmsInventoryInnerService;
import com.ruoyi.sip.vo.ExecutionOrderVo;
import com.ruoyi.sip.vo.OuterDeliveryVo;
import com.ruoyi.sip.vo.OuterViewVo;
import liquibase.pro.packaged.A;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -171,7 +163,8 @@ public class InventoryOuterController extends BaseController
@PostMapping("/importData")
@ResponseBody
public AjaxResult importTemplate(@RequestPart("file") MultipartFile file, @RequestParam(value = "productCode") String productCode,@RequestParam(value = "quantity") Long quantity) {
public AjaxResult importTemplate(@RequestPart("file") MultipartFile file, @RequestParam(value = "productCode") String productCode
, @RequestParam(value = "orderType") String orderType,@RequestParam(value = "quantity") Long quantity) {
ExcelUtil<InventoryInfoExcelDto> util = new ExcelUtil<InventoryInfoExcelDto>(InventoryInfoExcelDto.class);
try (InputStream inputStream = file.getInputStream()) {
@ -182,7 +175,7 @@ public class InventoryOuterController extends BaseController
if (inventoryInfoExcelDtoList.size()!=quantity.intValue()){
return AjaxResult.error("导入数据应等于发货数量");
}
return AjaxResult.success(innerService.getInventoryInfoList(inventoryInfoExcelDtoList, productCode));
return AjaxResult.success(innerService.getInventoryInfoList(inventoryInfoExcelDtoList, productCode, orderType));
} catch (IOException e) {
throw new ServiceException("读取excel错误,请联系管理员");

View File

@ -21,6 +21,8 @@ import com.ruoyi.sip.service.IOmsInvoiceReceiptBillService;
import com.ruoyi.sip.domain.OmsInvoiceReceiptBill;
import org.springframework.ui.ModelMap;
import com.ruoyi.sip.domain.dto.MergedPaymentDataDto;
/**
* Controller
*
@ -133,4 +135,16 @@ public class OmsPayableBillController extends BaseController
{
return toAjax(omsPayableBillService.deleteOmsPayableBillByIds(ids));
}
/**
*
*/
@RequiresPermissions("finance:payable:mergePayment")
@Log(title = "合并并发起付款单", businessType = BusinessType.INSERT)
@PostMapping("/mergeAndInitiatePayment")
@ResponseBody
public AjaxResult mergeAndInitiatePayment(@RequestBody MergedPaymentDataDto dto)
{
return toAjax(omsPayableBillService.mergeAndInitiatePayment(dto));
}
}

View File

@ -3,9 +3,9 @@ package com.ruoyi.sip.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.sip.oms.domain.OmsPayablePaymentPlan;
import com.ruoyi.sip.domain.OmsPayablePaymentPlan;
import com.ruoyi.sip.oms.service.IOmsPayablePaymentPlanService;
import com.ruoyi.sip.service.IOmsPayablePaymentPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

View File

@ -5,11 +5,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sip.domain.OmsPaymentBill;
@ -71,11 +67,12 @@ public class OmsPaymentBillController extends BaseController
/**
*
*/
@RequiresPermissions("finance:payment:add")
@GetMapping("/add")
public String add()
@RequiresPermissions("finance:payment:query")
@GetMapping("/{id}")
@ResponseBody
public AjaxResult query(@PathVariable("id") Long id)
{
return prefix + "/add";
return AjaxResult.success(omsPaymentBillService.query(id));
}
/**
@ -125,4 +122,109 @@ public class OmsPaymentBillController extends BaseController
{
return toAjax(omsPaymentBillService.deleteOmsPaymentBillByIds(ids));
}
/**
* 退
*/
@RequiresPermissions("finance:payment:return")
@Log(title = "退回付款单", businessType = BusinessType.UPDATE)
@DeleteMapping("/returnPayment/{id}")
@ResponseBody
public AjaxResult returnPayment(@PathVariable("id") Long id)
{
try {
// 验证付款单ID
if (id == null) {
return AjaxResult.error("付款单ID不能为空");
}
// 调用服务层方法处理退回逻辑
return omsPaymentBillService.returnPaymentBill(id);
} catch (Exception e) {
logger.error("退回付款单失败", e);
return AjaxResult.error("操作失败:" + e.getMessage());
}
}
// /**
// * 提交申请付款
// */
// @RequiresPermissions("finance:payment:apply")
// @Log(title = "申请付款", businessType = BusinessType.UPDATE)
// @PostMapping("/applyPayment")
// @ResponseBody
// public AjaxResult applyPaymentSave(OmsPaymentBill omsPaymentBill)
// {
// return toAjax(omsPaymentBillService.applyPayment(omsPaymentBill));
// }
//
// /**
// * 查看回执单页面
// */
// @GetMapping("/viewReceipt/{id}")
// public String viewReceipt(@PathVariable("id") Long id, @RequestParam("type") String type, ModelMap mmap)
// {
// OmsPaymentBill paymentBill = omsPaymentBillService.selectOmsPaymentBillById(id);
// if (paymentBill != null)
// {
// if ("receipt".equals(type) && (paymentBill.getReceiptAttachmentId() != null)) {
// mmap.put("attachment", omsFinAttachmentService.selectOmsFinAttachmentById(paymentBill.getReceiptAttachmentId()));
// } else if ("proof".equals(type) && paymentBill.getRefundProofAttachmentId() != null) {
// mmap.put("attachment", omsFinAttachmentService.selectOmsFinAttachmentById(paymentBill.getRefundProofAttachmentId()));
// }
// }
// mmap.put("paymentBill", paymentBill);
// return prefix + "/viewReceipt";
// }
//
// /**
// * 上传回执单
// */
// @RequiresPermissions("finance:payment:uploadReceipt")
// @Log(title = "上传回执单", businessType = BusinessType.UPDATE)
// @PostMapping("/uploadReceipt")
// @ResponseBody
// public AjaxResult uploadReceipt(@RequestParam("paymentBillId") Long paymentBillId, @RequestParam("file") MultipartFile file)
// {
// try
// {
// return omsPaymentBillService.uploadReceipt(paymentBillId, file);
// }
// catch (Exception e)
// {
// logger.error("上传回执单失败", e);
// return AjaxResult.error("操作失败:" + e.getMessage());
// }
// }
//
// /**
// * 申请退款
// */
// @PostMapping("/applyRefund")
// @ResponseBody
// public AjaxResult applyRefund(@RequestParam("id") Long id) {
// try {
// return omsPaymentBillService.applyRefund(id);
// } catch (Exception e) {
// logger.error("申请退款失败", e);
// return AjaxResult.error("操作失败:" + e.getMessage());
// }
// }
//
// /**
// * 上传退款图
// */
// @PostMapping("/uploadRefundProof")
// @ResponseBody
// public AjaxResult uploadRefundProof(@RequestParam("paymentBillId") Long paymentBillId, @RequestParam("file") MultipartFile file) {
// try {
// return omsPaymentBillService.uploadRefundProof(paymentBillId, file);
// } catch (Exception e) {
// logger.error("上传退款图失败", e);
// return AjaxResult.error("操作失败:" + e.getMessage());
// }
// }
}

View File

@ -1,5 +1,6 @@
package com.ruoyi.sip.controller.vue;
import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@ -8,9 +9,11 @@ import com.ruoyi.common.enums.ApproveStatusEnum;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.sip.domain.OmsPurchaseOrder;
import com.ruoyi.sip.domain.VendorInfo;
import com.ruoyi.sip.dto.inventory.OmsPurchaseOrderItemDto;
import com.ruoyi.sip.flowable.domain.Todo;
import com.ruoyi.sip.flowable.service.TodoService;
import com.ruoyi.sip.service.IInventoryAuthService;
import com.ruoyi.sip.service.IOmsPurchaseOrderHistoryService;
import com.ruoyi.sip.service.IOmsPurchaseOrderService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@ -19,7 +22,9 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* Controller
@ -39,6 +44,9 @@ public class OmsPurchaseOrderController extends BaseController
@Autowired
private TodoService todoService;
@Autowired
private IInventoryAuthService inventoryAuthService;
/**
*
*/
@ -46,6 +54,14 @@ public class OmsPurchaseOrderController extends BaseController
@GetMapping("/list")
public TableDataInfo list(OmsPurchaseOrder omsPurchaseOrder)
{
if (!inventoryAuthService.authAll()) {
List<VendorInfo> vendorInfos = inventoryAuthService.currentVendor();
if (CollUtil.isEmpty(vendorInfos)) {
return getDataTable(Collections.emptyList());
}
omsPurchaseOrder.setAuthVendorCodeList(vendorInfos.stream().map(VendorInfo::getVendorCode).collect(Collectors.toList()));
}
startPage();
List<OmsPurchaseOrder> list = omsPurchaseOrderService.selectOmsPurchaseOrderList(omsPurchaseOrder);
clearPage();
@ -59,6 +75,14 @@ public class OmsPurchaseOrderController extends BaseController
@GetMapping("/item/list")
public TableDataInfo listItem(OmsPurchaseOrderItemDto omsPurchaseOrder)
{
if (!inventoryAuthService.authAll()) {
List<VendorInfo> vendorInfos = inventoryAuthService.currentVendor();
if (CollUtil.isEmpty(vendorInfos)) {
return getDataTable(Collections.emptyList());
}
omsPurchaseOrder.setAuthVendorCodeList(vendorInfos.stream().map(VendorInfo::getVendorCode).collect(Collectors.toList()));
}
startPage();
List<OmsPurchaseOrderItemDto> list = omsPurchaseOrderService.listItem(omsPurchaseOrder);
return getDataTable(list);
@ -70,7 +94,14 @@ public class OmsPurchaseOrderController extends BaseController
@GetMapping("/vendor/list")
public TableDataInfo listVendor(OmsPurchaseOrder omsPurchaseOrder)
{
if (!inventoryAuthService.authAll()) {
List<VendorInfo> vendorInfos = inventoryAuthService.currentVendor();
if (CollUtil.isEmpty(vendorInfos)) {
return getDataTable(Collections.emptyList());
}
omsPurchaseOrder.setAuthVendorCodeList(vendorInfos.stream().map(VendorInfo::getVendorCode).collect(Collectors.toList()));
}
omsPurchaseOrder.setApproveStatus(ApproveStatusEnum.APPROVE_COMPLETE.getCode());
omsPurchaseOrder.setFlowType(OmsPurchaseOrder.FlowTypeEnum.ONLINE.getCode());
startPage();

View File

@ -110,7 +110,8 @@ public class VueInventoryOuterController extends BaseController
}
@PostMapping("/importData")
@ResponseBody
public AjaxResult importTemplate(@RequestPart("file") MultipartFile file, @RequestParam(value = "productCode") String productCode, @RequestParam(value = "quantity") Long quantity) {
public AjaxResult importTemplate(@RequestPart("file") MultipartFile file, @RequestParam(value = "productCode") String productCode
,@RequestParam(value = "orderType",defaultValue = "1") String orderType, @RequestParam(value = "quantity") Long quantity) {
ExcelUtil<InventoryInfoExcelDto> util = new ExcelUtil<InventoryInfoExcelDto>(InventoryInfoExcelDto.class);
try (InputStream inputStream = file.getInputStream()) {
@ -121,7 +122,7 @@ public class VueInventoryOuterController extends BaseController
if (inventoryInfoExcelDtoList.size()!=quantity.intValue()){
return AjaxResult.error("导入数据应等于发货数量");
}
return AjaxResult.success(innerService.getInventoryInfoList(inventoryInfoExcelDtoList, productCode));
return AjaxResult.success(innerService.getInventoryInfoList(inventoryInfoExcelDtoList, productCode,orderType));
} catch (IOException e) {
throw new ServiceException("读取excel错误,请联系管理员");

View File

@ -1,16 +1,19 @@
package com.ruoyi.sip.controller.vue;
import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sip.domain.VendorInfo;
import com.ruoyi.sip.service.IInventoryAuthService;
import com.ruoyi.sip.service.IVendorInfoService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Collections;
import java.util.List;
/**
@ -25,6 +28,8 @@ public class VueVendorInfoController extends BaseController {
@Autowired
private IVendorInfoService vendorInfoService;
@Autowired
private IInventoryAuthService inventoryAuthService;
/**
*
*/
@ -80,7 +85,7 @@ public class VueVendorInfoController extends BaseController {
*/
@GetMapping("/listAll")
public AjaxResult listAll() {
List<VendorInfo> list = vendorInfoService.selectVendorInfoList(new VendorInfo());
return AjaxResult.success(list);
return AjaxResult.success(inventoryAuthService.currentVendor());
}
}

View File

@ -87,7 +87,7 @@ public class VueWarehouseInfoController extends BaseController {
public AjaxResult listAll() {
OmsWarehouseInfo params = new OmsWarehouseInfo();
params.setWarehouseStatus(OmsWarehouseInfo.WarehouseStatusEnum.NORMAL.getValue());
List<OmsWarehouseInfo> list = omsWarehouseInfoService.list(params);
List<OmsWarehouseInfo> list = omsWarehouseInfoService.listByAuth(params);
return AjaxResult.success(list);
}
}

View File

@ -50,6 +50,7 @@ public class InventoryOuter extends BaseEntity
@Excel(name = "产品型号")
private String model;
private String vendorName;
private String orderType;
private List<String> productCodeList;
/** 数量 */

View File

@ -67,7 +67,7 @@ public class OmsInventoryInner extends BaseEntity {
private String warehouseType;
@Excel(name = "经办人")
private String createByName;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "入库时间",dateFormat="yyyy-MM-dd HH:mm:ss")
private Date createTime;

View File

@ -77,5 +77,7 @@ public class OmsPayableBill extends BaseEntity
private Date createTimeStart;
private Date createTimeEnd;
private Date estimatedPaymentTimeEnd;
private Date estimatedPaymentTimeStart;
}

View File

@ -0,0 +1,23 @@
package com.ruoyi.sip.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class OmsPayablePaymentDetail extends BaseEntity {
private static final long serialVersionUID = 1L;
private Long id;
private Long paymentPlanId;
private Long payableBillId;
private Integer paymentStatus;
private Date paymentTime;
private BigDecimal paymentAmount;
private BigDecimal paymentRate;
private String paymentBillCode;
}

View File

@ -1,4 +1,4 @@
package com.ruoyi.sip.oms.domain;
package com.ruoyi.sip.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
@ -23,5 +23,6 @@ public class OmsPayablePaymentPlan extends BaseEntity {
/** 计划付款比例 */
private BigDecimal planRate;
private Long detailId;
}

View File

@ -3,6 +3,8 @@ package com.ruoyi.sip.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.Getter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -14,6 +16,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi
* @date 2025-10-22
*/
@Data
public class OmsPaymentBill extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ -37,6 +40,7 @@ public class OmsPaymentBill extends BaseEntity
/** 制造商名称 */
@Excel(name = "制造商名称")
private String vendorCode;
private String vendorName;
/** 合同编号 */
@Excel(name = "合同编号")
@ -57,124 +61,115 @@ public class OmsPaymentBill extends BaseEntity
/** 删除标志0代表存在 2代表删除 */
private String delFlag;
public void setId(Long id)
{
this.id = id;
/** 项目编号 */
@Excel(name = "项目编号")
private String projectCode;
/** 项目名称 */
@Excel(name = "项目名称")
private String projectName;
/** 预付单剩余额度 */
@Excel(name = "预付单剩余额度")
private BigDecimal preResidueAmount;
/** 实际付款时间 */
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Excel(name = "实际付款时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date actualPaymentTime;
/** 付款状态 */
@Excel(name = "付款状态")
private String paymentStatus;
/** 审批状态 */
@Excel(name = "审批状态")
private String approveStatus;
/** 审批节点 */
@Excel(name = "审批节点")
private String approveNode;
/** 审批时间 */
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date approveTime;
/** 支付方式 */
@Excel(name = "支付方式")
private String paymentMethod;
/** 应付单编号(关联查询字段) */
@Excel(name = "应付单编号")
private String payableBillCode;
/** 账户名称 */
@Excel(name = "账户名称")
private String payName;
/** 银行账号 */
@Excel(name = "银行账号")
private String payBankNumber;
/** 银行开户行 */
@Excel(name = "银行开户行")
private String payBankOpenAddress;
/** 银行行号 */
@Excel(name = "银行行号")
private String bankNumber;
/** 回执单附件ID */
private Long receiptAttachmentId;
/** 关联的原始付款单ID */
private Long originalBillId;
/** 退款状态 */
private String refundStatus;
/** 退款图附件ID */
private Long refundProofAttachmentId;
@Getter
public enum PaymentBillTypeEnum {
/** 应付单生成 */
FROM_PAYABLE("FROM_PAYABLE", "应付单生成"),
/** 预付单 */
PRE_PAYMENT("PRE_PAYMENT", "预付单"),
/** 退款单 */
REFUND("REFUND", "退款单"),
;
private final String code;
private final String desc;
PaymentBillTypeEnum(String code, String desc) {
this.code = code;
this.desc = desc;
}
}
@Getter
public enum PaymentStatusEnum {
/** 应付单生成 */
REFUNDED("-1", "已退款"),
WAIT_PAYMENT("1", "未付款"),
/** 预付单 */
PAYMENT("2", "已付款"),
;
private final String code;
private final String desc;
PaymentStatusEnum(String code, String desc) {
this.code = code;
this.desc = desc;
}
}
public Long getId()
{
return id;
}
public void setPaymentBillCode(String paymentBillCode)
{
this.paymentBillCode = paymentBillCode;
}
public String getPaymentBillCode()
{
return paymentBillCode;
}
public void setPaymentBillType(String paymentBillType)
{
this.paymentBillType = paymentBillType;
}
public String getPaymentBillType()
{
return paymentBillType;
}
public void setPaymentTime(Date paymentTime)
{
this.paymentTime = paymentTime;
}
public Date getPaymentTime()
{
return paymentTime;
}
public void setVendorCode(String vendorCode)
{
this.vendorCode = vendorCode;
}
public String getVendorCode()
{
return vendorCode;
}
public void setOrderCode(String orderCode)
{
this.orderCode = orderCode;
}
public String getOrderCode()
{
return orderCode;
}
public void setTotalPriceWithTax(BigDecimal totalPriceWithTax)
{
this.totalPriceWithTax = totalPriceWithTax;
}
public BigDecimal getTotalPriceWithTax()
{
return totalPriceWithTax;
}
public void setTotalPriceWithoutTax(BigDecimal totalPriceWithoutTax)
{
this.totalPriceWithoutTax = totalPriceWithoutTax;
}
public BigDecimal getTotalPriceWithoutTax()
{
return totalPriceWithoutTax;
}
public void setTaxAmount(BigDecimal taxAmount)
{
this.taxAmount = taxAmount;
}
public BigDecimal getTaxAmount()
{
return taxAmount;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("paymentBillCode", getPaymentBillCode())
.append("paymentBillType", getPaymentBillType())
.append("paymentTime", getPaymentTime())
.append("vendorCode", getVendorCode())
.append("orderCode", getOrderCode())
.append("totalPriceWithTax", getTotalPriceWithTax())
.append("totalPriceWithoutTax", getTotalPriceWithoutTax())
.append("taxAmount", getTaxAmount())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("delFlag", getDelFlag())
.toString();
}
}

View File

@ -38,6 +38,7 @@ public class OmsPurchaseOrder extends BaseEntity
private Long vendorId;
private String vendorCode;
private List<String> authVendorCodeList;
private String vendorName;
private String vendorUser;
private String vendorPhone;

View File

@ -61,6 +61,7 @@ public class ProjectOrderInfo extends BaseEntity {
private String customerCode;
private String customerPhone;
private String customerUserName;
private String orderType;
/**
*

View File

@ -0,0 +1,45 @@
package com.ruoyi.sip.domain.dto;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
public class MergedPaymentDataDto {
private String paymentBillType;
private Date estimatedPaymentTime;
private List<PayableOrderDto> payableOrders;
private BigDecimal totalMergePaymentAmount;
// Getters and Setters
public String getPaymentBillType() {
return paymentBillType;
}
public void setPaymentBillType(String paymentBillType) {
this.paymentBillType = paymentBillType;
}
public Date getEstimatedPaymentTime() {
return estimatedPaymentTime;
}
public void setEstimatedPaymentTime(Date estimatedPaymentTime) {
this.estimatedPaymentTime = estimatedPaymentTime;
}
public List<PayableOrderDto> getPayableOrders() {
return payableOrders;
}
public void setPayableOrders(List<PayableOrderDto> payableOrders) {
this.payableOrders = payableOrders;
}
public BigDecimal getTotalMergePaymentAmount() {
return totalMergePaymentAmount;
}
public void setTotalMergePaymentAmount(BigDecimal totalMergePaymentAmount) {
this.totalMergePaymentAmount = totalMergePaymentAmount;
}
}

View File

@ -0,0 +1,15 @@
package com.ruoyi.sip.domain.dto;
import com.ruoyi.sip.domain.OmsPayablePaymentPlan;
import lombok.Data;
import java.util.List;
@Data
public class PayableOrderDto {
private Long id;
private String payableBillCode;
private List<OmsPayablePaymentPlan> paymentPlans;
}

View File

@ -0,0 +1,24 @@
package com.ruoyi.sip.domain.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.sip.domain.OmsPaymentBill;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* DTO
*
* @author ruoyi
* @date 2024-12-08
*/
@Data
public class PaymentBillDetailDTO extends OmsPaymentBill {
/** 关联的应付单明细列表 */
private List<PaymentBillPayableDetailDTO> payableDetails;
}

View File

@ -0,0 +1,33 @@
package com.ruoyi.sip.domain.dto;
import lombok.Data;
import java.math.BigDecimal;
/**
* DTO
*
* @author ruoyi
* @date 2024-12-08
*/
@Data
public class PaymentBillPayableDetailDTO {
/** 项目编号 */
private String projectCode;
/** 项目名称 */
private String projectName;
/** 采购应付单编号 */
private String payableBillCode;
/** 应付单含税总价 */
private BigDecimal totalPriceWithTax;
/** 本次付款金额 */
private BigDecimal paymentAmount;
/** 本次付款比例 */
private BigDecimal paymentRate;
}

View File

@ -0,0 +1,44 @@
package com.ruoyi.sip.domain.dto;
import java.math.BigDecimal;
import java.util.Date;
public class PaymentPlanDto {
private Date planPaymentDate;
private BigDecimal planAmount;
private BigDecimal planRate;
private String remark;
// Getters and Setters
public Date getPlanPaymentDate() {
return planPaymentDate;
}
public void setPlanPaymentDate(Date planPaymentDate) {
this.planPaymentDate = planPaymentDate;
}
public BigDecimal getPlanAmount() {
return planAmount;
}
public void setPlanAmount(BigDecimal planAmount) {
this.planAmount = planAmount;
}
public BigDecimal getPlanRate() {
return planRate;
}
public void setPlanRate(BigDecimal planRate) {
this.planRate = planRate;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}

View File

@ -48,7 +48,7 @@ public class TodoController extends BaseController {
@ResponseBody
public TableDataInfo todoList( Todo todo) {
startPage();
todo.setApproveUserName(getSysUser().getUserName());
todo.setApproveUser(getSysUser().getUserId().toString());
List<Todo> list = todoService.selectTodoList(todo);
return getDataTable(list);
}
@ -61,7 +61,7 @@ public class TodoController extends BaseController {
@ResponseBody
public TableDataInfo editSave( Todo todo) {
startPage();
todo.setApproveUserName(getSysUser().getUserName());
todo.setApproveUser(getSysUser().getUserId().toString());
List<Todo> list = todoService.selectTodoCompletedList(todo);
return getDataTable(list);
}
@ -110,4 +110,10 @@ public class TodoController extends BaseController {
public AjaxResult statistics(@RequestBody Todo todo){
return todoService.statistics(todo);
}
@GetMapping("/todo/statistics")
@ResponseBody
public AjaxResult statisticsTodo(){
return todoService.statisticsTodo();
}
}

View File

@ -136,4 +136,9 @@ public interface TodoService
void fillOrderApproveNode(List<ProjectOrderInfo> list);
void fillPurchaseOrderApproveNode(List<OmsPurchaseOrder> list);
AjaxResult statisticsTodo();
}

View File

@ -370,6 +370,29 @@ public class TodoServiceImpl implements TodoService {
}
}
@Override
public AjaxResult statisticsTodo() {
Long userId = ShiroUtils.getUserId();
if (userId == null) {
return AjaxResult.success();
}
List<String> orderKeyList = Arrays.asList(processConfig.getDefinition().getOrderApproveOffline(), processConfig.getDefinition().getOrderApproveOnline());
Todo todo = new Todo();
todo.setApproveUser(userId.toString());
List<Todo> todoList = todoMapper.selectTodoList(todo);
Map<String, Long> map = todoList.stream().collect(Collectors.groupingBy(Todo::getProcessKey, Collectors.counting()));
HashMap<String, Long> resultMap = new HashMap<>();
for (Map.Entry<String, Long> entry : map.entrySet()) {
String key = orderKeyList.contains(entry.getKey()) ? "order_approve" : entry.getKey();
resultMap.compute(key, (k, v) -> {
Long value = entry.getValue() == null ? 0L : entry.getValue();
return v == null ? value : v + value;
});
}
return AjaxResult.success(resultMap);
}
/**
*
*/

View File

@ -0,0 +1,8 @@
package com.ruoyi.sip.mapper;
import com.ruoyi.sip.domain.OmsPayablePaymentDetail;
import java.util.List;
public interface OmsPayablePaymentDetailMapper {
public int insertOmsPayablePaymentDetail(OmsPayablePaymentDetail omsPayablePaymentDetail);
}

View File

@ -1,8 +1,7 @@
package com.ruoyi.sip.oms.mapper;
package com.ruoyi.sip.mapper;
import java.util.List;
import com.ruoyi.sip.oms.domain.OmsPayablePaymentPlan;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.sip.domain.OmsPayablePaymentPlan;
public interface OmsPayablePaymentPlanMapper {
/**

View File

@ -1,19 +1,23 @@
package com.ruoyi.sip.mapper;
import java.util.List;
import com.ruoyi.sip.domain.OmsPayableBill;
import com.ruoyi.sip.domain.OmsPaymentBill;
import com.ruoyi.sip.domain.dto.PaymentBillDetailDTO;
import com.ruoyi.sip.domain.dto.PaymentBillPayableDetailDTO;
/**
* Mapper
*
*
* @author ruoyi
* @date 2025-10-22
*/
public interface OmsPaymentBillMapper
public interface OmsPaymentBillMapper
{
/**
*
*
*
* @param id
* @return
*/
@ -21,7 +25,7 @@ public interface OmsPaymentBillMapper
/**
*
*
*
* @param omsPaymentBill
* @return
*/
@ -29,7 +33,7 @@ public interface OmsPaymentBillMapper
/**
*
*
*
* @param omsPaymentBill
* @return
*/
@ -37,7 +41,7 @@ public interface OmsPaymentBillMapper
/**
*
*
*
* @param omsPaymentBill
* @return
*/
@ -45,7 +49,7 @@ public interface OmsPaymentBillMapper
/**
*
*
*
* @param id
* @return
*/
@ -53,9 +57,37 @@ public interface OmsPaymentBillMapper
/**
*
*
*
* @param ids
* @return
*/
public int deleteOmsPaymentBillByIds(String[] ids);
/**
*
*
* @param prefix
* @return
*/
public int selectMaxCodeByPrefix(String prefix);
/**
*
*
* @param id
* @return
*/
public PaymentBillDetailDTO selectPaymentBillDetail(Long id);
/**
*
*
* @param paymentBillId
* @return
*/
public List<PaymentBillPayableDetailDTO> selectPaymentBillPayableDetails(Long paymentBillId);
void clearRelationPayable(String payableBillCode);
}

View File

@ -65,5 +65,5 @@ public interface IOmsInventoryInnerService
void importByOuter(List<InventoryInfo> inventoryInfoList, String productCode, String purchaseNo,Long itemId);
Map<String,Object> getInventoryInfoList(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode);
Map<String,Object> getInventoryInfoList(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode, String orderType);
}

View File

@ -3,6 +3,8 @@ package com.ruoyi.sip.service;
import java.util.List;
import com.ruoyi.sip.domain.OmsPayableBill;
import com.ruoyi.sip.domain.dto.MergedPaymentDataDto;
/**
* Service
*
@ -58,4 +60,12 @@ public interface IOmsPayableBillService
* @return
*/
public int deleteOmsPayableBillById(Long id);
/**
*
*
* @param dto
* @return
*/
public int mergeAndInitiatePayment(MergedPaymentDataDto dto);
}

View File

@ -0,0 +1,7 @@
package com.ruoyi.sip.service;
import com.ruoyi.sip.domain.OmsPayablePaymentDetail;
public interface IOmsPayablePaymentDetailService {
public int insertOmsPayablePaymentDetail(OmsPayablePaymentDetail omsPayablePaymentDetail);
}

View File

@ -1,7 +1,7 @@
package com.ruoyi.sip.oms.service;
package com.ruoyi.sip.service;
import java.util.List;
import com.ruoyi.sip.oms.domain.OmsPayablePaymentPlan;
import com.ruoyi.sip.domain.OmsPayablePaymentPlan;
public interface IOmsPayablePaymentPlanService {
/**

View File

@ -1,7 +1,10 @@
package com.ruoyi.sip.service;
import java.util.List;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.sip.domain.OmsPaymentBill;
import com.ruoyi.sip.domain.dto.PaymentBillDetailDTO;
/**
* Service
@ -58,4 +61,9 @@ public interface IOmsPaymentBillService
* @return
*/
public int deleteOmsPaymentBillById(Long id);
PaymentBillDetailDTO query(Long id);
AjaxResult returnPaymentBill(Long id);
}

View File

@ -278,6 +278,7 @@ public class InventoryOuterServiceImpl implements IInventoryOuterService
vo.setQuantity(item.getQuantity());
vo.setDeliveryGenerateQuantity(0L);
vo.setDeliveryConfirmQuantity(0L);
vo.setOrderType(inventoryOuter.getOrderType());
List<InventoryDelivery> tempDeliveryList = deliveryListMap.get(vo.getWarehouseId());
if (CollUtil.isNotEmpty(tempDeliveryList)){
for (InventoryDelivery inventoryDelivery : tempDeliveryList) {

View File

@ -3,6 +3,7 @@ package com.ruoyi.sip.service.impl;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
@ -249,7 +250,8 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
// omsInventoryInner.setTaxTotal(inventoryInfoList.stream().map(item->
// item.getInnerPrice().divide(BigDecimal.ONE.add(item.getTaxRate()),2, RoundingMode.HALF_UP)
// ).reduce(BigDecimal.ZERO, BigDecimal::add));
BigDecimal divide = omsInventoryInner.getTotalAmount().divide(BigDecimal.ONE.add(omsInventoryInner.getTaxRate()), 2, RoundingMode.HALF_UP);
BigDecimal taxRate = omsInventoryInner.getTaxRate()==null?new BigDecimal("0.13"):omsInventoryInner.getTaxRate();
BigDecimal divide = omsInventoryInner.getTotalAmount().divide(BigDecimal.ONE.add(taxRate), 2, RoundingMode.HALF_UP);
omsInventoryInner.setTaxTotal(omsInventoryInner.getTotalAmount().subtract(divide));
@ -263,24 +265,30 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
}
@Override
public Map<String,Object> getInventoryInfoList(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode) {
public Map<String,Object> getInventoryInfoList(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode, String orderType) {
long count = inventoryInfoExcelDtoList.stream().filter(item -> !item.getProductCode().equals(productCode)).count();
if (count > 0){
throw new ServiceException("导入清单的产品与出库单不符");
}
// List<String> warehouseNameList = inventoryInfoExcelDtoList.stream().map(InventoryInfoExcelDto::getWarehouseName).distinct().collect(Collectors.toList());
// if (warehouseNameList.size() > 1){
// throw new ServiceException("导入清单只能有一个仓库");
// }
List<ProductInfo> productInfos = productInfoService.selectProductInfoByCodeList(Collections.singletonList(productCode));
if (CollUtil.isEmpty(productInfos)){
throw new ServiceException("产品编码对应产品未找到");
}
// List<OmsWarehouseInfo> warehouseInfoList = warehouseInfoService.listByNameList(warehouseNameList);
// if (CollUtil.isEmpty(warehouseInfoList)) {
// throw new ServiceException("仓库未找到,导入失败");
// }
// Map<String, OmsWarehouseInfo> warehouseInfoMap = warehouseInfoList.stream().collect(Collectors.toMap(OmsWarehouseInfo::getWarehouseName, Function.identity(), (v1, v2) -> v1));
Map<String, OmsWarehouseInfo> warehouseInfoMap=Collections.emptyMap();
if ("2".equalsIgnoreCase(orderType)){
List<String> warehouseNameList = inventoryInfoExcelDtoList.stream().map(InventoryInfoExcelDto::getWarehouseName).distinct().collect(Collectors.toList());
if (warehouseNameList.size() > 1){
throw new ServiceException("导入清单只能有一个仓库");
}
List<OmsWarehouseInfo> warehouseInfoList = warehouseInfoService.listByNameList(warehouseNameList);
if (CollUtil.isEmpty(warehouseInfoList)) {
throw new ServiceException("仓库未找到,导入失败");
}
warehouseInfoMap = warehouseInfoList.stream().collect(Collectors.toMap(OmsWarehouseInfo::getWarehouseName, Function.identity(), (v1, v2) -> v1));
}
Map<String, OmsWarehouseInfo> finalWarehouseInfoMap=warehouseInfoMap;
List<InventoryInfo> inventoryInfoList = inventoryInfoExcelDtoList.stream().map(item -> {
InventoryInfo info = new InventoryInfo();
info.setInventoryStatus(InventoryInfo.InventoryStatusEnum.INNER.getCode());
@ -289,9 +297,12 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
info.setModel(productInfos.get(0).getModel());
info.setProductDesc(productInfos.get(0).getDescription());
info.setInnerPrice(item.getInnerPrice());
// OmsWarehouseInfo omsWarehouseInfo = warehouseInfoMap.get(item.getWarehouseName());
// info.setWarehouseId(omsWarehouseInfo.getId());
// info.setWarehouseName(omsWarehouseInfo.getWarehouseName());
if ("2".equalsIgnoreCase(orderType)){
OmsWarehouseInfo omsWarehouseInfo = finalWarehouseInfoMap.get(item.getWarehouseName());
info.setWarehouseId(omsWarehouseInfo.getId());
info.setWarehouseName(omsWarehouseInfo.getWarehouseName());
}
return info;
}).collect(Collectors.toList());

View File

@ -1,23 +1,29 @@
package com.ruoyi.sip.service.impl;
import java.text.DateFormat;
import java.util.List;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.ApproveStatusEnum;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.sip.domain.OmsPayableBill;
import com.ruoyi.sip.domain.*;
import com.ruoyi.sip.mapper.OmsPayableBillMapper;
import com.ruoyi.sip.service.IOmsPayableBillService;
import com.ruoyi.sip.service.IVendorInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import com.ruoyi.sip.oms.domain.OmsPayablePaymentPlan;
import com.ruoyi.sip.oms.mapper.OmsPayablePaymentPlanMapper;
import com.ruoyi.sip.mapper.OmsPayablePaymentPlanMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.sip.domain.dto.MergedPaymentDataDto;
import com.ruoyi.sip.domain.dto.PayableOrderDto;
import com.ruoyi.sip.domain.dto.PaymentPlanDto;
import com.ruoyi.sip.service.IOmsPaymentBillService;
import com.ruoyi.sip.service.IOmsPayablePaymentDetailService;
/**
* Service
*
@ -32,6 +38,14 @@ public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
@Autowired
private OmsPayablePaymentPlanMapper omsPayablePaymentPlanMapper;
@Autowired
private IOmsPaymentBillService omsPaymentBillService;
@Autowired
private IOmsPayablePaymentDetailService omsPayablePaymentDetailService;
@Autowired
private IVendorInfoService vendorInfoService;
/**
*
*
@ -138,4 +152,52 @@ public class OmsPayableBillServiceImpl implements IOmsPayableBillService {
omsPayablePaymentPlanMapper.deleteOmsPayablePaymentPlanByPayableBillId(id);
return omsPayableBillMapper.deleteOmsPayableBillById(id);
}
@Override
@Transactional
public int mergeAndInitiatePayment(MergedPaymentDataDto dto) {
// 1. 创建付款单
OmsPaymentBill paymentBill = new OmsPaymentBill();
OmsPayableBill firstPayableBill = omsPayableBillMapper.selectOmsPayableBillById(dto.getPayableOrders().get(0).getId());
VendorInfo vendorInfo = vendorInfoService.selectVendorInfoByVendorCode(firstPayableBill.getVendorCode());
paymentBill.setPaymentBillType(dto.getPaymentBillType());
paymentBill.setPaymentTime(dto.getEstimatedPaymentTime());
paymentBill.setTotalPriceWithTax(dto.getTotalMergePaymentAmount());
paymentBill.setVendorCode(firstPayableBill.getVendorCode());
paymentBill.setCreateBy(ShiroUtils.getUserId().toString());
paymentBill.setPaymentBillType(OmsPaymentBill.PaymentBillTypeEnum.FROM_PAYABLE.getCode());
paymentBill.setPayName(vendorInfo.getPayName());
paymentBill.setPayBankNumber(vendorInfo.getPayBankNumber());
paymentBill.setPayBankOpenAddress(vendorInfo.getPayBankOpenAddress());
paymentBill.setBankNumber(vendorInfo.getBankNumber());
paymentBill.setPaymentStatus(OmsPaymentBill.PaymentStatusEnum.WAIT_PAYMENT.getCode());
paymentBill.setApproveStatus(ApproveStatusEnum.WAIT_APPROVE.getCode());
omsPaymentBillService.insertOmsPaymentBill(paymentBill);
// 2. 创建付款明细
for (PayableOrderDto payableOrderDto : dto.getPayableOrders()) {
for (OmsPayablePaymentPlan paymentPlanDto : payableOrderDto.getPaymentPlans()) {
OmsPayablePaymentDetail detail = new OmsPayablePaymentDetail();
detail.setPayableBillId(payableOrderDto.getId());
detail.setPaymentPlanId(paymentPlanDto.getId());
detail.setPaymentBillCode(paymentBill.getPaymentBillCode());
detail.setPaymentAmount(paymentPlanDto.getPlanAmount());
detail.setPaymentRate(paymentPlanDto.getPlanRate());
detail.setPaymentTime(paymentPlanDto.getPlanPaymentDate());
detail.setRemark(paymentPlanDto.getRemark());
detail.setCreateBy(ShiroUtils.getLoginName());
omsPayablePaymentDetailService.insertOmsPayablePaymentDetail(detail);
}
// 3. 更新应付单状态
// OmsPayableBill payableBill = omsPayableBillMapper.selectOmsPayableBillById(payableOrderDto.getId());
// // 这里可以根据业务逻辑更新状态,例如 "付款中"
// // payableBill.setPaymentStatus("1");
// omsPayableBillMapper.updateOmsPayableBill(payableBill);
}
return 1;
}
}

View File

@ -0,0 +1,19 @@
package com.ruoyi.sip.service.impl;
import com.ruoyi.sip.domain.OmsPayablePaymentDetail;
import com.ruoyi.sip.mapper.OmsPayablePaymentDetailMapper;
import com.ruoyi.sip.service.IOmsPayablePaymentDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class OmsPayablePaymentDetailServiceImpl implements IOmsPayablePaymentDetailService {
@Autowired
private OmsPayablePaymentDetailMapper omsPayablePaymentDetailMapper;
@Override
public int insertOmsPayablePaymentDetail(OmsPayablePaymentDetail omsPayablePaymentDetail) {
return omsPayablePaymentDetailMapper.insertOmsPayablePaymentDetail(omsPayablePaymentDetail);
}
}

View File

@ -1,4 +1,4 @@
package com.ruoyi.sip.oms.service.impl;
package com.ruoyi.sip.service.impl;
import java.util.List;
import java.util.Set;
@ -8,9 +8,9 @@ import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.sip.oms.mapper.OmsPayablePaymentPlanMapper;
import com.ruoyi.sip.oms.domain.OmsPayablePaymentPlan;
import com.ruoyi.sip.oms.service.IOmsPayablePaymentPlanService;
import com.ruoyi.sip.mapper.OmsPayablePaymentPlanMapper;
import com.ruoyi.sip.domain.OmsPayablePaymentPlan;
import com.ruoyi.sip.service.IOmsPayablePaymentPlanService;
@Service

View File

@ -1,13 +1,21 @@
package com.ruoyi.sip.service.impl;
import java.util.List;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.sip.domain.OmsPayableBill;
import com.ruoyi.sip.domain.dto.PaymentBillDetailDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sip.mapper.OmsPaymentBillMapper;
import com.ruoyi.sip.domain.OmsPaymentBill;
import com.ruoyi.sip.service.IOmsPaymentBillService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
/**
* Service
@ -16,6 +24,7 @@ import com.ruoyi.common.core.text.Convert;
* @date 2025-10-22
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class OmsPaymentBillServiceImpl implements IOmsPaymentBillService
{
@Autowired
@ -54,10 +63,27 @@ public class OmsPaymentBillServiceImpl implements IOmsPaymentBillService
@Override
public int insertOmsPaymentBill(OmsPaymentBill omsPaymentBill)
{
omsPaymentBill.setPaymentBillCode(generatePaymentBillCode());
omsPaymentBill.setCreateTime(DateUtils.getNowDate());
return omsPaymentBillMapper.insertOmsPaymentBill(omsPaymentBill);
}
/**
* FK+YYMMdd+
* @return
*/
private String generatePaymentBillCode() {
String prefix = "FK";
// 查询当天已有的最大序列号
String codePrefix = prefix + DateUtil.format(DateUtil.date(), DatePattern.PURE_DATE_PATTERN);
int maxSequence = omsPaymentBillMapper.selectMaxCodeByPrefix(codePrefix);
// 生成新的序列号
int newSequence = maxSequence + 1;
// 序列号补零到4位
String sequenceStr = String.format("%04d", newSequence);
return codePrefix + sequenceStr;
}
/**
*
*
@ -94,4 +120,169 @@ public class OmsPaymentBillServiceImpl implements IOmsPaymentBillService
{
return omsPaymentBillMapper.deleteOmsPaymentBillById(id);
}
@Override
public PaymentBillDetailDTO query(Long id) {
PaymentBillDetailDTO paymentBillDetailDTO = omsPaymentBillMapper.selectPaymentBillDetail(id);
return paymentBillDetailDTO;
}
@Override
public AjaxResult returnPaymentBill(Long paymentBillId) {
try {
// 1. 验证付款单是否存在
OmsPaymentBill paymentBill = omsPaymentBillMapper.selectOmsPaymentBillById(paymentBillId);
if (paymentBill == null) {
return AjaxResult.error("付款单不存在");
}
// 2. 检查付款单类型只有FROM_PAYABLE类型的付款单才能退回
if (!OmsPaymentBill.PaymentBillTypeEnum.FROM_PAYABLE.getCode().equals(paymentBill.getPaymentBillType())) {
return AjaxResult.error("只有由应付单合并生成的付款单才能执行退回操作");
}
// 3. 清楚关联
omsPaymentBillMapper.clearRelationPayable(paymentBill.getPaymentBillCode());
// 6. 删除付款单记录
int result = omsPaymentBillMapper.deleteOmsPaymentBillById(paymentBillId);
if (result <= 0) {
throw new RuntimeException("删除付款单失败");
}
return AjaxResult.success("付款单退回成功!");
} catch (Exception e) {
throw new RuntimeException("退回付款单操作失败:" + e.getMessage(), e);
}
}
/**
*
*
* @param paymentBill
* @return
*/
// @Override
// public int applyPayment(OmsPaymentBill paymentBill) {
// paymentBill.setUpdateTime(DateUtils.getNowDate());
// paymentBill.setUpdateBy(ShiroUtils.getLoginName());
// // todo 开启审批流程
// paymentBill.setApproveStatus(OmsPaymentBill.ApproveStatusEnum.UNDER_APPROVAL.getCode());
// return omsPaymentBillMapper.updateOmsPaymentBill(paymentBill);
// }
// @Override
// public AjaxResult uploadReceipt(Long paymentBillId, MultipartFile file) throws Exception {
// OmsPaymentBill paymentBill = selectOmsPaymentBillById(paymentBillId);
// if (paymentBill == null) {
// return AjaxResult.error("付款单不存在");
// }
//
// if (file.isEmpty())
// {
// return AjaxResult.error("上传文件不能为空");
// }
// // 上传文件路径
// String filePath = RuoYiConfig.getUploadPath();
// // 上传并返回新文件名称
// String fileName = FileUploadUtils.upload(filePath, file);
//
// SysUser loginUser = ShiroUtils.getSysUser();
// OmsFinAttachment attachment = new OmsFinAttachment();
// attachment.setRelatedBillId(paymentBillId);
// attachment.setRelatedBillType(OmsFinAttachment.RelatedBillTypeEnum.PAYMENT.getCode());
// attachment.setFileName(file.getOriginalFilename());
// attachment.setFilePath(fileName);
// attachment.setFileSize(file.getSize());
// attachment.setFileType(file.getContentType());
// attachment.setCreateBy(loginUser.getUserId().toString());
// omsFinAttachmentService.insertOmsFinAttachment(attachment);
// paymentBill.setActualPaymentTime(DateUtils.getNowDate());
// paymentBill.setReceiptAttachmentId(attachment.getId());
// paymentBill.setPaymentStatus(OmsPaymentBill.PaymentStatusEnum.PAYMENT.getCode());
// updateOmsPaymentBill(paymentBill);
//
// return AjaxResult.success(attachment);
// }
//
// @Override
// @Transactional
// public AjaxResult applyRefund(Long originalPaymentId) {
// // 1. 验证原始付款单
// OmsPaymentBill originalBill = selectOmsPaymentBillById(originalPaymentId);
// if (originalBill == null) {
// return AjaxResult.error("原始付款单不存在");
// }
// if (!OmsPaymentBill.PaymentStatusEnum.PAYMENT.getCode().equals(originalBill.getPaymentStatus())) {
// return AjaxResult.error("只有已付款的订单才能申请退款");
// }
// if ("REFUND_APPLIED".equals(originalBill.getRefundStatus())) {
// return AjaxResult.error("该付款单已申请过退款,请勿重复操作");
// }
//
// // 2. 创建新的退款单
// OmsPaymentBill refundBill = new OmsPaymentBill();
//
// // 复制属性并取反金额
// refundBill.setTotalPriceWithTax(originalBill.getTotalPriceWithTax().negate());
// refundBill.setTotalPriceWithoutTax(originalBill.getTotalPriceWithoutTax().negate());
// refundBill.setTaxAmount(originalBill.getTaxAmount().negate());
//
// refundBill.setVendorCode(originalBill.getVendorCode());
// refundBill.setOrderCode(originalBill.getOrderCode());
// refundBill.setPayName(originalBill.getPayName());
// refundBill.setPayBankNumber(originalBill.getPayBankNumber());
// refundBill.setPayBankOpenAddress(originalBill.getPayBankOpenAddress());
// refundBill.setBankNumber(originalBill.getBankNumber());
//
// // 设置新属性
// refundBill.setPaymentBillType(OmsPaymentBill.PaymentBillTypeEnum.REFUND.getCode());
// refundBill.setPaymentStatus(OmsPaymentBill.PaymentStatusEnum.WAIT_PAYMENT.getCode());
// refundBill.setApproveStatus(OmsPaymentBill.ApproveStatusEnum.UNDER_APPROVAL.getCode());
// refundBill.setOriginalBillId(originalPaymentId);
// refundBill.setRemark("退款-关联原付款单:" + originalBill.getPaymentBillCode());
//
// insertOmsPaymentBill(refundBill);
//
// // 3. 更新原始付款单状态
// originalBill.setRefundStatus("1");
// updateOmsPaymentBill(originalBill);
//
// return AjaxResult.success("退款申请已提交,新的退款单号为:" + refundBill.getPaymentBillCode());
// }
//
// @Override
// public AjaxResult uploadRefundProof(Long paymentBillId, MultipartFile file) throws Exception {
// OmsPaymentBill paymentBill = selectOmsPaymentBillById(paymentBillId);
// if (paymentBill == null) {
// return AjaxResult.error("付款单不存在");
// }
// if (!OmsPaymentBill.PaymentBillTypeEnum.REFUND.getCode().equals(paymentBill.getPaymentBillType())) {
// return AjaxResult.error("只有退款单才能上传退款图");
// }
//
// if (file.isEmpty())
// {
// return AjaxResult.error("上传文件不能为空");
// }
//
// // 上传文件并创建附件记录
// OmsFinAttachment attachment = omsFinAttachmentService.uploadAttachment(file, paymentBillId, OmsFinAttachment.RelatedBillTypeEnum.PAYMENT);
//
// // 更新付款单
// paymentBill.setRefundProofAttachmentId(attachment.getId());
// // 更新为“已付款”
// paymentBill.setPaymentStatus(OmsPaymentBill.PaymentStatusEnum.PAYMENT.getCode());
// paymentBill.setActualPaymentTime(DateUtils.getNowDate());
// updateOmsPaymentBill(paymentBill);
//
// return AjaxResult.success(attachment);
// }
}

View File

@ -20,6 +20,7 @@ import com.ruoyi.sip.flowable.service.TodoService;
import com.ruoyi.sip.mapper.OmsPurchaseOrderItemHistoryMapper;
import com.ruoyi.sip.mapper.OmsPurchaseOrderHistoryMapper;
import com.ruoyi.sip.service.ICnareaService;
import com.ruoyi.sip.service.IInventoryAuthService;
import com.ruoyi.sip.service.IVendorInfoService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
@ -373,6 +374,7 @@ public class OmsPurchaseOrderServiceImpl implements IOmsPurchaseOrderService, To
for (OmsPurchaseOrderItem omsPurchaseOrderItem : omsPurchaseOrderItemList)
{
omsPurchaseOrderItem.setPurchaseId(id);
omsPurchaseOrderItem.setInnerQuantity(BigDecimal.ZERO);
list.add(omsPurchaseOrderItem);
}
if (list.size() > 0)
@ -490,7 +492,7 @@ public class OmsPurchaseOrderServiceImpl implements IOmsPurchaseOrderService, To
OmsPurchaseOrder omsPurchaseOrder = new OmsPurchaseOrder();
omsPurchaseOrder.setPurchaseNo(businessKey);
omsPurchaseOrder.setApproveStatus(ApproveStatusEnum.APPROVE_COMPLETE.getCode());
if (existOrder.getFlowType().equalsIgnoreCase(OmsPurchaseOrder.FlowTypeEnum.OFFLINE.getValue())){
if (existOrder.getFlowType().equalsIgnoreCase(OmsPurchaseOrder.FlowTypeEnum.OFFLINE.getCode())){
omsPurchaseOrder.setConfirmStatus(OmsPurchaseOrder.ConfirmStatusEnum.CONFIRM.getCode());
}
omsPurchaseOrder.setApproveTime(DateUtils.getNowDate());

View File

@ -523,7 +523,7 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
public String exportList(ProjectOrderInfo projectOrderInfo) {
try {
// 获取项目信息列表
List<ProjectOrderInfo> projectInfos = fetchProjectInfos(projectOrderInfo);
List<ProjectOrderInfo> projectInfos = this.selectProjectOrderInfoList(projectOrderInfo);
// 补充项目详细数据
enrichProjectData(projectInfos);

View File

@ -26,6 +26,7 @@ public class OuterDeliveryProductVo {
private Long deliveryConfirmQuantity;
private Long availableCount;
private String warehouseName;
private String orderType;
private Long warehouseId;
}

View File

@ -72,13 +72,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTimeStart != null or createTimeEnd != null">
<choose>
<when test="createTimeStart != null and createTimeEnd != null">
and t1.create_time between #{createTimeStart} and #{createTimeEnd}
and t1.create_time between date_format(#{createTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{createTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
<when test="createTimeStart != null">
and t1.create_time <![CDATA[ >= ]]> #{createTimeStart}
and t1.create_time <![CDATA[ >= ]]> date_format(#{createTimeStart}, '%Y-%m-%d 00:00:00')
</when>
<when test="createTimeEnd != null">
and t1.create_time <![CDATA[ <= ]]> #{createTimeEnd}
and t1.create_time <![CDATA[ <= ]]> date_format(#{createTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
</choose>
</if>
<if test="estimatedPaymentTimeStart != null or estimatedPaymentTimeEnd != null">
<choose>
<when test="estimatedPaymentTimeStart != null and estimatedPaymentTimeEnd != null">
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 test="estimatedPaymentTimeStart != null">
and t1.estimated_payment_time <![CDATA[ >= ]]> date_format(#{estimatedPaymentTimeStart}, '%Y-%m-%d 00:00:00')
</when>
<when test="estimatedPaymentTimeEnd != null">
and t1.estimated_payment_time <![CDATA[ <= ]]> date_format(#{estimatedPaymentTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
</choose>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.sip.mapper.OmsPayablePaymentDetailMapper">
<resultMap type="OmsPayablePaymentDetail" id="OmsPayablePaymentDetailResult">
<result property="id" column="id" />
<result property="paymentPlanId" column="payment_plan_id" />
<result property="payableBillId" column="payable_bill_id" />
<result property="paymentStatus" column="payment_status" />
<result property="paymentTime" column="payment_time" />
<result property="paymentAmount" column="payment_amount" />
<result property="paymentRate" column="payment_rate" />
<result property="paymentBillCode" column="payment_bill_code" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<insert id="insertOmsPayablePaymentDetail" parameterType="OmsPayablePaymentDetail" useGeneratedKeys="true" keyProperty="id">
insert into oms_payable_payment_detail (
<if test="paymentPlanId != null">payment_plan_id,</if>
<if test="payableBillId != null">payable_bill_id,</if>
<if test="paymentStatus != null">payment_status,</if>
<if test="paymentTime != null">payment_time,</if>
<if test="paymentAmount != null">payment_amount,</if>
<if test="paymentRate != null">payment_rate,</if>
<if test="paymentBillCode != null and paymentBillCode != ''">payment_bill_code,</if>
<if test="remark != null and remark != ''">remark,</if>
create_by,
create_time
) values (
<if test="paymentPlanId != null">#{paymentPlanId},</if>
<if test="payableBillId != null">#{payableBillId},</if>
<if test="paymentStatus != null">#{paymentStatus},</if>
<if test="paymentTime != null">#{paymentTime},</if>
<if test="paymentAmount != null">#{paymentAmount},</if>
<if test="paymentRate != null">#{paymentRate},</if>
<if test="paymentBillCode != null and paymentBillCode != ''">#{paymentBillCode},</if>
<if test="remark != null and remark != ''">#{remark},</if>
#{createBy},
sysdate()
)
</insert>
</mapper>

View File

@ -20,29 +20,128 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="delFlag" column="del_flag" />
<result property="projectCode" column="project_code" />
<result property="projectName" column="project_name" />
<result property="preResidueAmount" column="pre_residue_amount" />
<result property="actualPaymentTime" column="actual_payment_time" />
<result property="paymentStatus" column="payment_status" />
<result property="approveStatus" column="approve_status" />
<result property="approveNode" column="approve_node" />
<result property="approveTime" column="approve_time" />
<result property="paymentMethod" column="payment_method" />
<result property="payableBillCode" column="payable_bill_code" />
<result property="payName" column="pay_name" />
<result property="payBankNumber" column="pay_bank_number" />
<result property="payBankOpenAddress" column="pay_bank_open_address" />
<result property="bankNumber" column="bank_number" />
<result property="receiptAttachmentId" column="receipt_attachment_id" />
<result property="refundProofAttachmentId" column="refund_proof_attachment_id" />
<result property="refundStatus" column="refund_status" />
</resultMap>
<resultMap type="com.ruoyi.sip.domain.dto.PaymentBillDetailDTO" id="PaymentBillDetailResult">
<result property="id" column="id" />
<result property="paymentBillCode" column="payment_bill_code" />
<result property="paymentTime" column="payment_time" />
<result property="vendorCode" column="vendor_code" />
<result property="totalPriceWithTax" column="total_price_with_tax" />
<result property="totalPriceWithoutTax" column="total_price_without_tax" />
<result property="taxAmount" column="tax_amount" />
<result property="paymentBillType" column="payment_bill_type" />
<result property="preResidueAmount" column="pre_residue_amount" />
<result property="actualPaymentTime" column="actual_payment_time" />
<result property="paymentMethod" column="payment_method" />
<result property="receiptAttachmentId" column="receipt_attachment_id" />
<result property="refundProofAttachmentId" column="refund_proof_attachment_id" />
<result property="paymentStatus" column="payment_status" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="payName" column="pay_name" />
<result property="payBankNumber" column="pay_bank_number" />
<result property="payBankOpenAddress" column="pay_bank_open_address" />
<result property="bankNumber" column="bank_number" />
<result property="approveNode" column="approve_node" />
<result property="approveStatus" column="approve_status" />
<result property="approveTime" column="approve_time" />
</resultMap>
<resultMap type="com.ruoyi.sip.domain.dto.PaymentBillPayableDetailDTO" id="PaymentBillPayableDetailResult">
<result property="projectCode" column="project_code" />
<result property="projectName" column="project_name" />
<result property="payableBillCode" column="payable_bill_code" />
<result property="totalPriceWithTax" column="total_price_with_tax" />
<result property="paymentAmount" column="payment_amount" />
<result property="paymentRate" column="payment_rate" />
</resultMap>
<sql id="selectOmsPaymentBillVo">
select id, payment_bill_code, payment_bill_type, payment_time, vendor_code, order_code, total_price_with_tax, total_price_without_tax, tax_amount, create_by, create_time, update_by, update_time, remark, del_flag from oms_payment_bill
select
pb.id,
pb.payment_bill_code,
pb.payment_bill_type,
pb.payment_time,
pb.vendor_code,
pb.order_code,
pb.total_price_with_tax,
pb.total_price_without_tax,
pb.tax_amount,
pb.create_by,
pb.create_time,
pb.update_by,
pb.update_time,
pb.remark,
pb.del_flag,
pb.project_code,
pb.project_name,
pb.pre_residue_amount,
pb.actual_payment_time,
pb.payment_status,
pb.approve_status,
pb.approve_node,
pb.approve_time,
pb.payment_method,
pb.pay_name,
pb.pay_bank_number,
pb.pay_bank_open_address,
pb.bank_number,
pb.refund_proof_attachment_id,
pb.receipt_attachment_id,
pb.refund_status,
ovi.vendor_name
from oms_payment_bill pb
left join oms_vendor_info ovi on pb.vendor_code = ovi.vendor_code
</sql>
<select id="selectOmsPaymentBillList" parameterType="OmsPaymentBill" resultMap="OmsPaymentBillResult">
<include refid="selectOmsPaymentBillVo"/>
<where>
<if test="paymentBillCode != null and paymentBillCode != ''"> and payment_bill_code = #{paymentBillCode}</if>
<if test="paymentBillType != null and paymentBillType != ''"> and payment_bill_type = #{paymentBillType}</if>
<if test="paymentTime != null "> and payment_time = #{paymentTime}</if>
<if test="vendorCode != null and vendorCode != ''"> and vendor_code = #{vendorCode}</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="totalPriceWithTax != null "> and total_price_with_tax = #{totalPriceWithTax}</if>
<if test="totalPriceWithoutTax != null "> and total_price_without_tax = #{totalPriceWithoutTax}</if>
<if test="taxAmount != null "> and tax_amount = #{taxAmount}</if>
<where>
<if test="paymentBillCode != null and paymentBillCode != ''"> and pb.payment_bill_code like concat('%', #{paymentBillCode}, '%')</if>
<if test="paymentBillType != null and paymentBillType != ''"> and pb.payment_bill_type = #{paymentBillType}</if>
<if test="paymentTime != null "> and date_format(pb.payment_time,'%Y-%m-%d') = date_format(#{paymentTime},'%Y-%m-%d')</if>
<if test="vendorCode != null and vendorCode != ''"> and pb.vendor_code like concat('%', #{vendorCode}, '%')</if>
<if test="orderCode != null and orderCode != ''"> and pb.order_code like concat('%', #{orderCode}, '%')</if>
<if test="totalPriceWithTax != null "> and pb.total_price_with_tax = #{totalPriceWithTax}</if>
<if test="totalPriceWithoutTax != null "> and pb.total_price_without_tax = #{totalPriceWithoutTax}</if>
<if test="taxAmount != null "> and pb.tax_amount = #{taxAmount}</if>
<if test="projectCode != null and projectCode != ''"> and pb.project_code like concat('%', #{projectCode}, '%')</if>
<if test="projectName != null and projectName != ''"> and pb.project_name like concat('%', #{projectName}, '%')</if>
<if test="paymentStatus != null and paymentStatus != ''"> and pb.payment_status = #{paymentStatus}</if>
<if test="approveStatus != null and approveStatus != ''"> and pb.approve_status = #{approveStatus}</if>
<if test="approveNode != null and approveNode != ''"> and pb.approve_node = #{approveNode}</if>
<if test="approveTime != null "> and date_format(pb.approve_time,'%Y-%m-%d') = date_format(#{approveTime},'%Y-%m-%d')</if>
<if test="actualPaymentTime != null "> and date_format(pb.actual_payment_time,'%Y-%m-%d') = date_format(#{actualPaymentTime},'%Y-%m-%d')</if>
<if test="paymentMethod != null and paymentMethod != ''"> and pb.payment_method = #{paymentMethod}</if>
<if test="payableBillCode != null and payableBillCode != ''"> and apb.payable_bill_code like concat('%', #{payableBillCode}, '%')</if>
and pb.del_flag = '0'
</where>
group by pb.id
order by pb.create_time desc
</select>
<select id="selectOmsPaymentBillById" parameterType="Long" resultMap="OmsPaymentBillResult">
<include refid="selectOmsPaymentBillVo"/>
where id = #{id}
where pb.id = #{id}
group by pb.id
</select>
<insert id="insertOmsPaymentBill" parameterType="OmsPaymentBill" useGeneratedKeys="true" keyProperty="id">
@ -62,6 +161,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="delFlag != null">del_flag,</if>
<if test="projectCode != null">project_code,</if>
<if test="projectName != null">project_name,</if>
<if test="preResidueAmount != null">pre_residue_amount,</if>
<if test="actualPaymentTime != null">actual_payment_time,</if>
<if test="paymentStatus != null">payment_status,</if>
<if test="approveStatus != null">approve_status,</if>
<if test="approveNode != null">approve_node,</if>
<if test="approveTime != null">approve_time,</if>
<if test="paymentMethod != null">payment_method,</if>
<if test="payName != null">pay_name,</if>
<if test="payBankNumber != null">pay_bank_number,</if>
<if test="payBankOpenAddress != null">pay_bank_open_address,</if>
<if test="bankNumber != null">bank_number,</if>
<if test="refundProofAttachmentId != null">refund_proof_attachment_id,</if>
<if test="receiptAttachmentId != null">receipt_attachment_id,</if>
<if test="refundStatus != null">refund_status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="paymentBillCode != null and paymentBillCode != ''">#{paymentBillCode},</if>
@ -78,6 +193,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="projectCode != null">#{projectCode},</if>
<if test="projectName != null">#{projectName},</if>
<if test="preResidueAmount != null">#{preResidueAmount},</if>
<if test="actualPaymentTime != null">#{actualPaymentTime},</if>
<if test="paymentStatus != null">#{paymentStatus},</if>
<if test="approveStatus != null">#{approveStatus},</if>
<if test="approveNode != null">#{approveNode},</if>
<if test="approveTime != null">#{approveTime},</if>
<if test="paymentMethod != null">#{paymentMethod},</if>
<if test="payName != null">#{payName},</if>
<if test="payBankNumber != null">#{payBankNumber},</if>
<if test="payBankOpenAddress != null">#{payBankOpenAddress},</if>
<if test="bankNumber != null">#{bankNumber},</if>
<if test="refundProofAttachmentId != null">#{refundProofAttachmentId},</if>
<if test="receiptAttachmentId != null">#{receiptAttachmentId},</if>
<if test="refundStatus != null">#{refundStatus},</if>
</trim>
</insert>
@ -98,6 +229,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="projectCode != null">project_code = #{projectCode},</if>
<if test="projectName != null">project_name = #{projectName},</if>
<if test="preResidueAmount != null">pre_residue_amount = #{preResidueAmount},</if>
<if test="actualPaymentTime != null">actual_payment_time = #{actualPaymentTime},</if>
<if test="paymentStatus != null">payment_status = #{paymentStatus},</if>
<if test="approveStatus != null">approve_status = #{approveStatus},</if>
<if test="approveNode != null">approve_node = #{approveNode},</if>
<if test="approveTime != null">approve_time = #{approveTime},</if>
<if test="paymentMethod != null">payment_method = #{paymentMethod},</if>
<if test="payName != null">pay_name = #{payName},</if>
<if test="payBankNumber != null">pay_bank_number = #{payBankNumber},</if>
<if test="payBankOpenAddress != null">pay_bank_open_address = #{payBankOpenAddress},</if>
<if test="bankNumber != null">bank_number = #{bankNumber},</if>
<if test="refundProofAttachmentId != null">refund_proof_attachment_id = #{refundProofAttachmentId},</if>
<if test="receiptAttachmentId != null">receipt_attachment_id = #{receiptAttachmentId},</if>
<if test="refundStatus != null">refund_status = #{refundStatus},</if>
</trim>
where id = #{id}
</update>
@ -112,5 +259,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="clearRelationPayable">
delete from oms_payable_payment_detail where payment_bill_code=#{code}
</delete>
<select id="selectMaxCodeByPrefix" parameterType="String" resultType="Integer">
SELECT IFNULL(MAX(CAST(SUBSTRING(payment_bill_code, LENGTH(#{prefix}) + 1) AS SIGNED)), 0)
FROM oms_payment_bill
WHERE payment_bill_code LIKE CONCAT(#{prefix}, '%')
</select>
<select id="selectPaymentBillDetail" resultType="com.ruoyi.sip.domain.dto.PaymentBillDetailDTO">
<include refid="selectOmsPaymentBillVo"/>
where pb.id = #{id}
</select>
<select id="selectPaymentBillPayableDetails"
resultType="com.ruoyi.sip.domain.dto.PaymentBillPayableDetailDTO">
</select>
</mapper>

View File

@ -44,6 +44,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
<if test="taskName != null and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if>
<if test="approveUserName != null and approveUserName != ''">and approve_user_name = #{approveUserName}
</if>
<if test="approveUser != null and approveUser != ''">and approve_user = #{approveUser}
</if>
<if test="applyUserName != null and applyUserName != ''">and apply_user_name like concat('%',
#{applyUserName}, '%')

View File

@ -125,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t1.update_time,
t2.model,
t3.vendor_name,
t4.order_type,
t5.project_name,
t5.project_code
from oms_inventory_outer t1

View File

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.sip.mapper.OmsPayablePaymentPlanMapper">
<resultMap type="OmsPayablePaymentPlan" id="OmsPayablePaymentPlanResult">
<result property="id" column="id" />
<result property="payableBillId" column="payable_bill_id" />
<result property="planPaymentDate" column="plan_payment_date" />
<result property="planAmount" column="plan_amount" />
<result property="planRate" column="plan_rate" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectOmsPayablePaymentPlanVo">
select id, payable_bill_id, plan_payment_date, plan_amount, plan_rate, remark, create_time, create_by, update_time from oms_payable_payment_plan
</sql>
<select id="selectOmsPayablePaymentPlanListByPayableBillId" parameterType="Long" resultMap="OmsPayablePaymentPlanResult">
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,
t2.id as detail_id
FROM
oms_payable_payment_plan t1
left join oms_payable_payment_detail t2 on t1.id=t2.payment_plan_id
where t1.payable_bill_id = #{payableBillId}
order by t1.plan_payment_date
</select>
<select id="selectOmsPayablePaymentPlanIdsByPayableBillId" parameterType="Long" resultType="Long">
select id from oms_payable_payment_plan where payable_bill_id = #{payableBillId}
</select>
<insert id="insertOmsPayablePaymentPlan" parameterType="OmsPayablePaymentPlan" useGeneratedKeys="true" keyProperty="id">
insert into oms_payable_payment_plan(
<if test="payableBillId != null">payable_bill_id,</if>
<if test="planPaymentDate != null">plan_payment_date,</if>
<if test="planAmount != null">plan_amount,</if>
<if test="planRate != null">plan_rate,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
<if test="payableBillId != null">#{payableBillId},</if>
<if test="planPaymentDate != null">#{planPaymentDate},</if>
<if test="planAmount != null">#{planAmount},</if>
<if test="planRate != null">#{planRate},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<update id="updateOmsPayablePaymentPlan" parameterType="OmsPayablePaymentPlan">
update oms_payable_payment_plan
<trim prefix="SET" suffixOverrides=",">
<if test="planPaymentDate != null">plan_payment_date = #{planPaymentDate},</if>
<if test="planAmount != null">plan_amount = #{planAmount},</if>
<if test="planRate != null">plan_rate = #{planRate},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
update_time = sysdate()
</trim>
where id = #{id}
</update>
<delete id="deleteOmsPayablePaymentPlanById" parameterType="Long">
delete from oms_payable_payment_plan where id = #{id}
</delete>
<delete id="deleteOmsPayablePaymentPlanByPayableBillId" parameterType="Long">
delete from oms_payable_payment_plan where payable_bill_id = #{payableBillId}
</delete>
<insert id="batchOmsPayablePaymentPlan">
insert into oms_payable_payment_plan( payable_bill_id, plan_payment_date, plan_amount, plan_rate, remark, create_by, create_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.payableBillId}, #{item.planPaymentDate}, #{item.planAmount}, #{item.planRate}, #{item.remark}, #{item.createBy}, sysdate())
</foreach>
</insert>
</mapper>

View File

@ -87,6 +87,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="flowType != null "> and t1.flow_type = #{flowType}</if>
<if test="vendorName != null "> and t2.vendor_name = #{vendorName}</if>
<if test="ownerName != null "> and t1.owner_name = #{ownerName}</if>
<if test="authVendorCodeList != null and authVendorCodeList.size>0 "> and t2.vendor_code in
<foreach item="item" collection="authVendorCodeList" separator="," open="(" close=")">#{item}</foreach>
</if>
</where>
</select>
@ -192,6 +195,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
</if>
<if test="authVendorCodeList != null and authVendorCodeList.size>0 "> and t4.vendor_code in
<foreach item="item" collection="authVendorCodeList" separator="," open="(" close=")">#{item}</foreach>
</if>
</where>
order by t2.create_time desc

View File

@ -44,13 +44,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
shipment_amount, actual_purchase_amount, order_end_time, delivery_time, company_delivery, notifier,finance_status,
notifier_email, notifier_phone, duty, duty_email, duty_phone, order_channel, partner_code, supplier,notifier_address,
remark, order_status, create_by, create_time, update_by, update_time,version_code,process_type,process_template,discount_fold,
delivery_status,sign_status,outer_status,approve_time,payment_method,payment_ratio,payment_description
delivery_status,sign_status,outer_status,approve_time,payment_method,payment_ratio,payment_description,order_type
from project_order_info t1
</sql>
<sql id="selectProjectOrderInfoRelationVo">
select t1.id, t1.project_id,t1.province, t1.city, t1.business_person, t1.business_email, t1.business_phone, t1.order_code, t1.currencyType,
t1.shipment_amount, t1.actual_purchase_amount, t1.order_end_time, t1.delivery_time, t1.company_delivery, t1.notifier,
t1.shipment_amount, t1.actual_purchase_amount, t1.order_end_time, t1.delivery_time, t1.company_delivery, t1.notifier,t1.order_type,
t1.notifier_email, t1.notifier_phone, t1.duty, t1.duty_email, t1.duty_phone, t1.order_channel, t1.partner_code, t1.supplier,
t1.remark, t1.order_status, t1.create_by, t1.create_time, t1.update_by, t1.update_time,t1.partner_user_name,t1.partner_email
,t1.partner_phone,t1.version_code,t1.process_type,t1.process_template,t1.discount_fold,t1.notifier_address,t1.finance_status,
@ -491,6 +491,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="notifierPhone != null">notifier_phone,</if>
<if test="notifierAddress != null">notifier_address,</if>
<if test="duty != null">duty,</if>
<if test="orderType != null and orderType!=''">order_type,</if>
<if test="dutyEmail != null">duty_email,</if>
<if test="dutyPhone != null">duty_phone,</if>
<if test="orderChannel != null">order_channel,</if>
@ -532,6 +533,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="notifierPhone != null">#{notifierPhone},</if>
<if test="notifierAddress != null">#{notifierAddress},</if>
<if test="duty != null">#{duty},</if>
<if test="orderType != null and orderType!=''">#{orderType},</if>
<if test="dutyEmail != null">#{dutyEmail},</if>
<if test="dutyPhone != null">#{dutyPhone},</if>
<if test="orderChannel != null">#{orderChannel},</if>
@ -595,6 +597,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_time,
process_type,
process_template,
order_type,
discount_fold)
select id,
project_id,
@ -636,6 +639,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_time,
process_type,
process_template,
order_type,
discount_fold
from project_order_info
where order_code = #{orderCode}
@ -647,6 +651,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectId != null">project_id = #{projectId},</if>
<if test="province != null">province = #{province},</if>
<if test="city != null">city = #{city},</if>
<if test="orderType != null and orderType!=''">order_type=#{orderType},</if>
<if test="businessPerson != null">business_person = #{businessPerson},</if>
<if test="businessEmail != null">business_email = #{businessEmail},</if>
<if test="businessPhone != null">business_phone = #{businessPhone},</if>