Browse Source

[fix]

财务管理 应付账款
修改应付账款列表页面、详情页面,正常显示;
修改应付账款实体类,调整导出字段和顺序,添加供应商字段;
修改应付账款导出controller接口,新增结案接口;
新增按单号查询应付账款记录service方法和结案方法;
新增按单号查询应付账款记录mapper方法和结案方法;
dev
王晓迪 2 months ago
parent
commit
0e73741b43
  1. 27
      ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialAccountsPayableController.java
  2. 131
      ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialAccountsPayable.java
  3. 5
      ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialAccountsPayableMapper.java
  4. 5
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialAccountsPayableService.java
  5. 13
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialAccountsPayableServiceImpl.java
  6. 20
      ruoyi-admin/src/main/resources/mapper/financial/FinancialAccountsPayableMapper.xml
  7. 51
      ruoyi-admin/src/main/resources/templates/financial/payable/detail.html
  8. 71
      ruoyi-admin/src/main/resources/templates/financial/payable/payable.html

27
ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialAccountsPayableController.java

@ -6,10 +6,12 @@ import com.ruoyi.financial.domain.FinancialPayableRecords;
import com.ruoyi.financial.domain.FinancialReceivables;
import com.ruoyi.financial.domain.FinancialReceivablesRecords;
import com.ruoyi.financial.service.IFinancialPayableRecordsService;
import com.ruoyi.system.domain.OutsourceQuoteChild;
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.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@ -70,11 +72,18 @@ public class FinancialAccountsPayableController extends BaseController
@Log(title = "财务应付账款", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(FinancialAccountsPayable financialAccountsPayable)
public AjaxResult export(FinancialAccountsPayable financialAccountsPayable, String ids)
{
List<FinancialAccountsPayable> list = financialAccountsPayableService.selectFinancialAccountsPayableList(financialAccountsPayable);
ExcelUtil<FinancialAccountsPayable> util = new ExcelUtil<FinancialAccountsPayable>(FinancialAccountsPayable.class);
return util.exportExcel(list, "财务应付账款数据");
if (StringUtils.isEmpty(ids)){
List<FinancialAccountsPayable> list = financialAccountsPayableService.selectFinancialAccountsPayableList(financialAccountsPayable);
ExcelUtil<FinancialAccountsPayable> util = new ExcelUtil<FinancialAccountsPayable>(FinancialAccountsPayable.class);
return util.exportExcel(list, "财务应付账款数据");
}else {
String[] payCodes = ids.split(",");
List<FinancialAccountsPayable> list = financialAccountsPayableService.selectFinancialAccountsPayableByCodes(payCodes);
ExcelUtil<FinancialAccountsPayable> util = new ExcelUtil<FinancialAccountsPayable>(FinancialAccountsPayable.class);
return util.exportExcel(list, ids);
}
}
@ -162,5 +171,15 @@ public class FinancialAccountsPayableController extends BaseController
return toAjax(financialAccountsPayableService.deleteFinancialAccountsPayableByIds(ids));
}
/**
* 结案
*/
@RequiresPermissions("financial:payable:payableClosing")
@Log(title = "财务应付账款", businessType = BusinessType.UPDATE)
@GetMapping( "/payableClosing/{accountsPayableId}")
@ResponseBody
public AjaxResult receivablesClosing(@PathVariable("accountsPayableId") Long accountsPayableId){
return toAjax(financialAccountsPayableService.closingFinancialAccountsPayableById(accountsPayableId));
}
}

131
ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialAccountsPayable.java

@ -22,100 +22,117 @@ public class FinancialAccountsPayable extends BaseEntity
private Long accountsPayableId;
/** 应付单号 */
@Excel(name = "应付单号")
@Excel(name = "应付单号", sort = 1)
private String accountsPayableCode;
/** 付款状态 */
@Excel(name = "付款状态")
@Excel(name = "付款状态", sort = 2,dictType = "accounts_payable_status")
private String accountsPayableStatus;
/** 关联单号 */
@Excel(name = "关联单号")
@Excel(name = "关联单号", sort = 3)
private String relevanceCode;
/** 贷方科目 */
@Excel(name = "贷方科目")
private String creditAccount;
/** 供应商ID */
@Excel(name = "供应商ID", sort = 4)
private String supplierCode;
/** 贷方明细 */
@Excel(name = "贷方明细")
private String creditDetail;
/** 供应商名称 */
@Excel(name = "供应商名称", sort = 5)
private String supplierName;
/** 开户银行 */
@Excel(name = "开户银行")
@Excel(name = "开户银行", sort = 6)
private String openBank;
/** 开户账号 */
@Excel(name = "开户账号")
@Excel(name = "开户账号", sort = 7)
private String openAccount;
/** 贷方科目 */
// @Excel(name = "贷方科目")
private String creditAccount;
/** 贷方明细 */
// @Excel(name = "贷方明细")
private String creditDetail;
/** 供应商ID */
@Excel(name = "供应商ID")
private String supplierCode;
/** 供应商名称 */
@Excel(name = "供应商名称")
private String supplierName;
/** 合同编号 */
@Excel(name = "合同编号")
@Excel(name = "合同编号", sort = 8)
private String contractNumber;
/** 币种 */
@Excel(name = "币种")
@Excel(name = "币种", sort = 9)
private String currencyType;
/** 不含税金额 */
@Excel(name = "不含税金额")
@Excel(name = "不含税金额", sort = 10)
private BigDecimal priceExcludingTax;
/** 含税金额 */
@Excel(name = "含税金额")
@Excel(name = "含税金额", sort = 11)
private BigDecimal priceIncludesTax;
/** 付款条件 */
@Excel(name = "付款条件")
@Excel(name = "付款条件", sort = 12)
private String paymentCondition;
/** 实付金额 */
@Excel(name = "实付金额")
private String actualPaidPrice;
@Excel(name = "实付金额", sort = 13)
private BigDecimal actualPaidPrice;
/** 未付金额 */
@Excel(name = "未付金额")
private String unpaidPrice;
@Excel(name = "未付金额", sort = 14)
private BigDecimal unpaidPrice;
/** 采购员 */
@Excel(name = "采购员")
@Excel(name = "采购员", sort = 15)
private String purchaseBuyer;
/** 入库状态 */
@Excel(name = "入库状态")
@Excel(name = "入库状态", sort = 16, dictType = "erp_inbound_status")
private String storageStatus;
/** 付款凭证编号 */
@Excel(name = "付款凭证编号")
// @Excel(name = "付款凭证编号")
private String paidVoucherCode;
/** 付款金额 */
@Excel(name = "付款金额")
// @Excel(name = "付款金额")
private BigDecimal paidPrice;
/** 付款时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "付款时间", width = 30, dateFormat = "yyyy-MM-dd")
@Excel(name = "付款时间", width = 30, sort = 17, dateFormat = "yyyy-MM-dd")
private Date paidTime;
/** 创建人*/
@Excel(name = "创建人", sort = 18)
private String createBy;
/** 创建时间 */
@Excel(name = "创建时间", sort = 19, dateFormat = "yyyy-MM-dd")
private Date createTime;
/** 更新人 */
@Excel(name = "更新人", sort = 20)
private String updateBy;
/** 更新时间 */
@Excel(name = "更新时间", sort = 21, dateFormat = "yyyy-MM-dd")
private Date updateTime;
/** 付款明细 */
@Excel(name = "付款明细")
// @Excel(name = "付款明细")
private String paidDetail;
/** 收款备注 */
@Excel(name = "收款备注")
// @Excel(name = "收款备注")
private String paidPhotourl;
/** 操作人 */
@Excel(name = "操作人")
// @Excel(name = "操作人")
private String operatorPeople;
public void setAccountsPayableId(Long accountsPayableId)
@ -253,21 +270,21 @@ public class FinancialAccountsPayable extends BaseEntity
{
return paymentCondition;
}
public void setActualPaidPrice(String actualPaidPrice)
public void setActualPaidPrice(BigDecimal actualPaidPrice)
{
this.actualPaidPrice = actualPaidPrice;
}
public String getActualPaidPrice()
public BigDecimal getActualPaidPrice()
{
return actualPaidPrice;
}
public void setUnpaidPrice(String unpaidPrice)
public void setUnpaidPrice(BigDecimal unpaidPrice)
{
this.unpaidPrice = unpaidPrice;
}
public String getUnpaidPrice()
public BigDecimal getUnpaidPrice()
{
return unpaidPrice;
}
@ -344,6 +361,44 @@ public class FinancialAccountsPayable extends BaseEntity
return operatorPeople;
}
@Override
public String getCreateBy() {
return createBy;
}
@Override
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
@Override
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String getUpdateBy() {
return updateBy;
}
@Override
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
@Override
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

5
ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialAccountsPayableMapper.java

@ -74,4 +74,9 @@ public interface FinancialAccountsPayableMapper
* @return 结果
*/
public int restoreFinancialAccountsPayableById(Long accountsPayableId);
// 根据编号集合查询应付账款列表
public List<FinancialAccountsPayable> selectFinancialAccountsPayableByCodes(String[] accountsPayableCodes);
public int updatePayableClosingStatusById(Long accountsPayableId);
}

5
ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialAccountsPayableService.java

@ -72,4 +72,9 @@ public interface IFinancialAccountsPayableService
* @return
*/
int restoreFinancialAccountsPayableById(Long accountsPayableId);
// 根据编号集合查询应付账款列表
public List<FinancialAccountsPayable> selectFinancialAccountsPayableByCodes(String[] accountsPayableCodes);
int closingFinancialAccountsPayableById(Long accountsPayableId);
}

13
ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialAccountsPayableServiceImpl.java

@ -123,4 +123,17 @@ public class FinancialAccountsPayableServiceImpl implements IFinancialAccountsPa
{
return financialAccountsPayableMapper.restoreFinancialAccountsPayableById(accountsPayableId);
}
@Override
public List<FinancialAccountsPayable> selectFinancialAccountsPayableByCodes(String[] accountsPayableCodes) {
return financialAccountsPayableMapper.selectFinancialAccountsPayableByCodes(accountsPayableCodes);
}
@Override
public int closingFinancialAccountsPayableById(Long accountsPayableId) {
int result = financialAccountsPayableMapper.updatePayableClosingStatusById(accountsPayableId);
return result;
}
}

20
ruoyi-admin/src/main/resources/mapper/financial/FinancialAccountsPayableMapper.xml

@ -37,7 +37,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectFinancialAccountsPayableVo">
select accounts_payable_id, accounts_payable_code, accounts_payable_status, relevance_code, credit_account, credit_detail, open_bank, open_account, supplier_code, supplier_name, contract_number, currency_type, price_excluding_tax, price_includes_tax, payment_condition, actual_paid_price, unpaid_price, purchase_buyer, storage_status, paid_voucher_code, paid_price, paid_time, paid_detail, paid_photoUrl, operator_people, create_time, create_by, update_by, update_time from financial_accounts_payable
select accounts_payable_id, accounts_payable_code, accounts_payable_status,
relevance_code, credit_account, credit_detail, open_bank, open_account,
supplier_code, supplier_name, contract_number, currency_type,
price_excluding_tax, price_includes_tax, payment_condition,
actual_paid_price, unpaid_price, purchase_buyer, storage_status,
paid_voucher_code, paid_price, paid_time, paid_detail, paid_photoUrl,
operator_people, create_time, create_by, update_by, update_time
from financial_accounts_payable
</sql>
<select id="selectFinancialAccountsPayableList" parameterType="FinancialAccountsPayable" resultMap="FinancialAccountsPayableResult">
@ -184,4 +191,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update financial_accounts_payable set del_flag = '0' where accounts_payable_id = #{accountsPayableId}
</update>
<select id="selectFinancialAccountsPayableByCodes" parameterType="String" resultMap="FinancialAccountsPayableResult">
<include refid="selectFinancialAccountsPayableVo"/>
where accounts_payable_code in
<foreach item="accountsPayableCode" collection="array" open="(" separator="," close=")">
#{accountsPayableCode}
</foreach>
</select>
<update id="updatePayableClosingStatusById" parameterType="Long">
update financial_accounts_payable set accounts_payable_status = '4' where accounts_payable_id = #{accountsPayableId}
</update>
</mapper>

51
ruoyi-admin/src/main/resources/templates/financial/payable/detail.html

@ -11,13 +11,13 @@
<div class="form-group">
<label class="col-sm-3 control-label">应付单号:</label>
<div class="col-sm-8">
<input name="accountsPayableCode" th:field="*{accountsPayableCode}" class="form-control" type="text">
<input disabled name="accountsPayableCode" th:field="*{accountsPayableCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">付款状态:</label>
<label class="col-sm-3 control-label">付款结案状态:</label>
<div class="col-sm-8">
<select name="accountsPayableStatus" class="form-control m-b" th:with="type=${@dict.getType('accounts_payable_status')}">
<select disabled name="accountsPayableStatus" class="form-control m-b" th:with="type=${@dict.getType('sys_pay_close')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{accountsPayableStatus}"></option>
</select>
</div>
@ -25,43 +25,43 @@
<div class="form-group">
<label class="col-sm-3 control-label">关联单号:</label>
<div class="col-sm-8">
<input name="relevanceCode" th:field="*{relevanceCode}" class="form-control" type="text">
<input disabled name="relevanceCode" th:field="*{relevanceCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">开户银行:</label>
<div class="col-sm-8">
<input name="openBank" th:field="*{openBank}" class="form-control" type="text">
<input disabled name="openBank" th:field="*{openBank}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">开户账号:</label>
<div class="col-sm-8">
<input name="openAccount" th:field="*{openAccount}" class="form-control" type="text">
<input disabled name="openAccount" th:field="*{openAccount}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商ID:</label>
<div class="col-sm-8">
<input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text">
<input disabled name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">供应商名称:</label>
<div class="col-sm-8">
<input name="supplierName" th:field="*{supplierName}" class="form-control" type="text">
<input disabled name="supplierName" th:field="*{supplierName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">合同编号:</label>
<div class="col-sm-8">
<input name="contractNumber" th:field="*{contractNumber}" class="form-control" type="text">
<input disabled name="contractNumber" th:field="*{contractNumber}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">币种:</label>
<div class="col-sm-8">
<select name="currencyType" class="form-control m-b" th:with="type=${@dict.getType('sys_common_currency')}">
<select disabled name="currencyType" class="form-control m-b" th:with="type=${@dict.getType('sys_common_currency')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{currencyType}"></option>
</select>
</div>
@ -69,25 +69,25 @@
<div class="form-group">
<label class="col-sm-3 control-label">不含税金额:</label>
<div class="col-sm-8">
<input name="priceExcludingTax" th:field="*{priceExcludingTax}" class="form-control" type="text">
<input disabled name="priceExcludingTax" th:field="*{priceExcludingTax}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">含税金额:</label>
<div class="col-sm-8">
<input name="priceIncludesTax" th:field="*{priceIncludesTax}" class="form-control" type="text">
<input disabled name="priceIncludesTax" th:field="*{priceIncludesTax}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">付款条件:</label>
<div class="col-sm-8">
<input name="paymentCondition" th:field="*{paymentCondition}" class="form-control" type="text">
<input disabled name="paymentCondition" th:field="*{paymentCondition}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库状态:</label>
<div class="col-sm-8">
<select name="storageStatus" class="form-control m-b" th:with="type=${@dict.getType('erp_inbound_status')}">
<select disabled name="storageStatus" class="form-control m-b" th:with="type=${@dict.getType('erp_inbound_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{storageStatus}"></option>
</select>
</div>
@ -95,7 +95,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">采购员:</label>
<div class="col-sm-8">
<input name="purchaseBuyer" th:field="*{purchaseBuyer}" class="form-control" type="text">
<input disabled name="purchaseBuyer" th:field="*{purchaseBuyer}" class="form-control" type="text">
</div>
</div>
@ -119,26 +119,18 @@
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-payable-edit').serialize());
}
}
$("input[name='paidTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
/*根据收款编号对应的收款明细*/
$(function() {
var options = {
id:"bootstrap-payableRecords-table",
url: prefix + "/getPayableRecords",
modalName: "收款记录",
modalName: "付款记录",
showFooter: true,
showColumns: false,
pagination: false,
showToggle: false,
@ -158,10 +150,18 @@
{
title: '付款凭证编号',
field: 'paidVoucherCode',
visible: false,
},
{
title: '付款金额',
field: 'paidPrice',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].paidPrice)|| 0;
}
return "总付款金额: " + sum.toFixed(2);
}
},
{
title: '付款时间',
@ -170,6 +170,7 @@
{
title: '付款明细',
field: 'paidDetail',
visible: false,
},
{
title: '付款图片',

71
ruoyi-admin/src/main/resources/templates/financial/payable/payable.html

@ -93,7 +93,7 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="financial:payable:export">
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="financial:payable:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
@ -107,7 +107,9 @@
var editFlag = [[${@permission.hasPermi('financial:payable:edit')}]];
var detailFlag = [[${@permission.hasPermi('financial:payable:detail')}]];
var removeFlag = [[${@permission.hasPermi('financial:payable:remove')}]];
var accountsPayableStatusDatas = [[${@dict.getType('accounts_payable_status')}]];
var closingFlag = [[${@permission.hasPermi('financial:payable:payableClosing')}]];
var accountsPayableStatusDatas = [[${@dict.getType('sys_pay_close')}]];
var currencyTypeDatas = [[${@dict.getType('sys_common_currency')}]];
var storageStatusDatas = [[${@dict.getType('erp_inbound_status')}]];
var prefix = ctx + "financial/payable";
@ -135,7 +137,7 @@
field: 'accountsPayableCode',
},
{
title: '付款状态',
title: '付款结案状态',
field: 'accountsPayableStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(accountsPayableStatusDatas, value);
@ -224,7 +226,10 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="detail(\'' + row.accountsPayableId + '\')"><i class="fa fa-edit"></i>详情</a> ');
if (row.accountsPayableStatus !== '4') {
actions.push('<a class="btn btn-success btn-xs ' + closingFlag + '" href="javascript:void(0)" onclick="confirmAndClose(\'' + row.accountsPayableId + '\')"><i class="fa fa-edit"></i>结案</a> ');
}
actions.push('<a class="btn btn-primary btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="detail(\'' + row.accountsPayableId + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join('');
}
}]
@ -236,6 +241,64 @@
var url = ctx+'financial/payable/detail/'+accountsPayableId;
$.modal.open("应付款账单详情",url);
}
//结案
function confirmAndClose(accountsPayableId) {
// 使用layer.confirm替代alert,以实现确认功能
layer.confirm("确定要结案吗?", {
title: "系统提示",
btn: ['确定', '取消'], // 自定义按钮文本
yes: function(index, layero) {
// 用户点击确定后的操作
$.ajax({
url: ctx + 'financial/payable/payableClosing/' + accountsPayableId,
type: 'GET',
dataType: 'json',
success: function(data) {
if (data.code == web_status.SUCCESS) {
// 成功后提示
layer.close(index); // 关闭当前confirm对话框
$.modal.alert("结案成功。");
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
} else {
layer.close(index); // 关闭当前confirm对话框
$.modal.alertError(data.msg);
}
},
error: function(error) {
layer.close(index); // 关闭当前confirm对话框
$.modal.alertError("结案失败。");
}
});
},
cancel: function(index, layero) {
// 用户点击取消的操作,通常无需处理,直接关闭对话框即可
layer.close(index);
}
});
}
// 导出
function exportExcel() {
var ids = $.table.selectColumns("accountsPayableCode");
var dataParam = $("#formId").serializeArray();
let tipMsg = "确定导出当前所有数据吗?";
if ($.common.isNotEmpty(ids)) {
tipMsg = `确定导出 ${ids} 数据吗?`;
dataParam.push({ "name": "ids", "value": ids });
}
$.modal.confirm(tipMsg, function () {
$.modal.loading("正在导出数据,请稍后...");
$.post( prefix + "/export", dataParam, function (result) {
if (result.code === web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName="+ encodeURI(result.msg) + "&delete=" + true;
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
});
});
}
</script>
</body>
</html>
Loading…
Cancel
Save