Browse Source

[feat]

财务管理 应付账款
修改应付账款实体类和mapper,新增结案原因字段;
新增应付账款跳转结案和保存结案controller;
新增应付账款结案service方法;
dev
王晓迪 2 months ago
parent
commit
fd810a4567
  1. 22
      ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialAccountsPayableController.java
  2. 11
      ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialAccountsPayable.java
  3. 2
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialAccountsPayableService.java
  4. 7
      ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialAccountsPayableServiceImpl.java
  5. 11
      ruoyi-admin/src/main/resources/mapper/financial/FinancialAccountsPayableMapper.xml

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

@ -171,15 +171,25 @@ public class FinancialAccountsPayableController extends BaseController
return toAjax(financialAccountsPayableService.deleteFinancialAccountsPayableByIds(ids)); return toAjax(financialAccountsPayableService.deleteFinancialAccountsPayableByIds(ids));
} }
/** /**
* 结案 * 应收款账单结案
*/ */
@RequiresPermissions("financial:payable:payableClosing") @GetMapping("/closed/{accountsPayableId}")
@Log(title = "财务应付账款", businessType = BusinessType.UPDATE) public String receivablesClosed(@PathVariable("accountsPayableId") Long accountsPayableId, ModelMap mmap)
@GetMapping( "/payableClosing/{accountsPayableId}") {
FinancialAccountsPayable accountsPayable = financialAccountsPayableService.selectFinancialAccountsPayableById(accountsPayableId);
mmap.put("accountsPayable", accountsPayable);
return prefix + "/closed";
}
/**
* 保存应收账款结案
*/
@PostMapping("/closed")
@ResponseBody @ResponseBody
public AjaxResult receivablesClosing(@PathVariable("accountsPayableId") Long accountsPayableId){ public AjaxResult saveClosed(FinancialAccountsPayable accountsPayable)
return toAjax(financialAccountsPayableService.closingFinancialAccountsPayableById(accountsPayableId)); {
return toAjax(financialAccountsPayableService.closingFinancialAccountsPayableById(accountsPayable));
} }
} }

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

@ -135,6 +135,9 @@ public class FinancialAccountsPayable extends BaseEntity
// @Excel(name = "操作人") // @Excel(name = "操作人")
private String operatorPeople; private String operatorPeople;
/** 结案原因 */
private String closedReason;
public void setAccountsPayableId(Long accountsPayableId) public void setAccountsPayableId(Long accountsPayableId)
{ {
this.accountsPayableId = accountsPayableId; this.accountsPayableId = accountsPayableId;
@ -399,6 +402,14 @@ public class FinancialAccountsPayable extends BaseEntity
this.updateTime = updateTime; this.updateTime = updateTime;
} }
public String getClosedReason() {
return closedReason;
}
public void setClosedReason(String closedReason) {
this.closedReason = closedReason;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

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

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

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

@ -130,8 +130,11 @@ public class FinancialAccountsPayableServiceImpl implements IFinancialAccountsPa
} }
@Override @Override
public int closingFinancialAccountsPayableById(Long accountsPayableId) { public int closingFinancialAccountsPayableById(FinancialAccountsPayable accountsPayable) {
int result = financialAccountsPayableMapper.updatePayableClosingStatusById(accountsPayableId); accountsPayable.setAccountsPayableStatus("4");//结案
accountsPayable.setUpdateBy(ShiroUtils.getLoginName());
accountsPayable.setUpdateTime(DateUtils.getNowDate());
int result = financialAccountsPayableMapper.updateFinancialAccountsPayable(accountsPayable);
return result; return result;
} }

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

@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="closedReason" column="closed_reason" />
</resultMap> </resultMap>
<sql id="selectFinancialAccountsPayableVo"> <sql id="selectFinancialAccountsPayableVo">
@ -43,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
price_excluding_tax, price_includes_tax, payment_condition, price_excluding_tax, price_includes_tax, payment_condition,
actual_paid_price, unpaid_price, purchase_buyer, storage_status, actual_paid_price, unpaid_price, purchase_buyer, storage_status,
paid_voucher_code, paid_price, paid_time, paid_detail, paid_photoUrl, paid_voucher_code, paid_price, paid_time, paid_detail, paid_photoUrl,
operator_people, create_time, create_by, update_by, update_time operator_people, create_time, create_by, update_by, update_time, closed_reason
from financial_accounts_payable from financial_accounts_payable
</sql> </sql>
@ -62,10 +63,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="currencyType != null and currencyType != ''"> and currency_type = #{currencyType}</if> <if test="currencyType != null and currencyType != ''"> and currency_type = #{currencyType}</if>
<if test="purchaseBuyer != null and purchaseBuyer != ''"> and purchase_buyer like concat('%', #{purchaseBuyer}, '%')</if> <if test="purchaseBuyer != null and purchaseBuyer != ''"> and purchase_buyer like concat('%', #{purchaseBuyer}, '%')</if>
<if test="storageStatus != null and storageStatus != ''"> and storage_status = #{storageStatus}</if> <if test="storageStatus != null and storageStatus != ''"> and storage_status = #{storageStatus}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if> <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and Date(create_time) between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if> <if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
<if test="params.beginUpdateTime != null and params.beginUpdateTime != '' and params.endUpdateTime != null and params.endUpdateTime != ''"> and update_time between #{params.beginUpdateTime} and #{params.endUpdateTime}</if> <if test="params.beginUpdateTime != null and params.beginUpdateTime != '' and params.endUpdateTime != null and params.endUpdateTime != ''"> and Date(update_time) between #{params.beginUpdateTime} and #{params.endUpdateTime}</if>
</where> </where>
order by create_time desc
</select> </select>
<select id="selectFinancialAccountsPayableById" parameterType="Long" resultMap="FinancialAccountsPayableResult"> <select id="selectFinancialAccountsPayableById" parameterType="Long" resultMap="FinancialAccountsPayableResult">
@ -104,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="closedReason != null">closed_reason,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="accountsPayableCode != null">#{accountsPayableCode},</if> <if test="accountsPayableCode != null">#{accountsPayableCode},</if>
@ -134,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="closedReason != null">#{closedReason},</if>
</trim> </trim>
</insert> </insert>
@ -168,6 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="closedReason != null">closed_reason = #{closedReason},</if>
</trim> </trim>
where accounts_payable_id = #{accountsPayableId} where accounts_payable_id = #{accountsPayableId}
</update> </update>

Loading…
Cancel
Save