Explorar o código

Merge branch 'master' of http://s.dev01.dkiboss.com:9001/DK-SCU/dkscu-server-finance

xiachangming hai 10 meses
pai
achega
524cfcfadd
Modificáronse 19 ficheiros con 2879 adicións e 4 borrados
  1. 124 0
      src/main/java/com/dk/finance/controller/fia/AssetClearController.java
  2. 77 0
      src/main/java/com/dk/finance/controller/fia/AssetClearItemController.java
  3. 44 0
      src/main/java/com/dk/finance/infrastructure/convert/fia/AssetClearConvert.java
  4. 44 0
      src/main/java/com/dk/finance/infrastructure/convert/fia/AssetClearItemConvert.java
  5. 40 0
      src/main/java/com/dk/finance/mapper/fia/AssetClearItemMapper.java
  6. 363 0
      src/main/java/com/dk/finance/mapper/fia/AssetClearItemMapper.xml
  7. 40 0
      src/main/java/com/dk/finance/mapper/fia/AssetClearMapper.java
  8. 549 0
      src/main/java/com/dk/finance/mapper/fia/AssetClearMapper.xml
  9. 245 0
      src/main/java/com/dk/finance/model/pojo/fia/AssetClear.java
  10. 134 0
      src/main/java/com/dk/finance/model/pojo/fia/AssetClearItem.java
  11. 116 0
      src/main/java/com/dk/finance/model/query/fia/AssetClearItemQuery.java
  12. 193 0
      src/main/java/com/dk/finance/model/query/fia/AssetClearQuery.java
  13. 144 0
      src/main/java/com/dk/finance/model/response/fia/AssetClearItemResponse.java
  14. 193 0
      src/main/java/com/dk/finance/model/response/fia/AssetClearResponse.java
  15. 92 0
      src/main/java/com/dk/finance/model/vo/fia/AssetClearItemVO.java
  16. 173 0
      src/main/java/com/dk/finance/model/vo/fia/AssetClearVO.java
  17. 86 0
      src/main/java/com/dk/finance/service/fia/AssetClearItemService.java
  18. 217 0
      src/main/java/com/dk/finance/service/fia/AssetClearService.java
  19. 5 4
      src/main/java/com/dk/finance/service/fnc/VoucherService.java

+ 124 - 0
src/main/java/com/dk/finance/controller/fia/AssetClearController.java

@@ -0,0 +1,124 @@
+package com.dk.finance.controller.fia;
+
+import com.dk.finance.infrastructure.convert.fia.AssetClearConvert;
+import com.dk.finance.infrastructure.convert.fia.AssetClearItemConvert;
+import com.dk.finance.model.pojo.fia.AssetClear;
+import com.dk.finance.model.pojo.fia.AssetClearItem;
+import com.dk.finance.model.query.fia.AssetClearQuery;
+import com.dk.finance.model.vo.fia.AssetClearVO;
+import com.dk.finance.model.response.fia.AssetClearResponse;
+import com.dk.common.service.BaseService;
+import com.dk.common.response.ResponseResultVO;
+import com.dk.common.model.pojo.PageList;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import javax.validation.Valid;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import com.dk.finance.service.fia.AssetClearService;
+
+/**
+ * @desc   : 资产清理单控制器
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Api(tags = "资产清理单API接口")
+@RestController
+@RequestMapping("/fia/assetClear")
+public class AssetClearController{
+
+    public BaseService<AssetClear> getService() {
+        return assetClearService;
+    }
+
+    @Autowired
+    private AssetClearService assetClearService;
+
+    @Autowired
+    private AssetClearConvert assetClearConvert;
+
+    @Autowired
+    private AssetClearItemConvert assetClearItemConvert;
+
+    /**
+     * @desc   : 分页、关联、条件查询资产清理单
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    @ApiOperation(value = "分页、关联、条件查询",notes = "分页、关联、条件查询")
+    @PostMapping({"list_by"})
+    public ResponseResultVO<PageList<AssetClearResponse>> selectByCond(@RequestBody AssetClearQuery assetClearQuery) {
+        return assetClearService.selectByCond(assetClearQuery);
+    }
+
+    /**
+     * @desc   : 新建资产清理单
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    @ApiOperation(value = "新建", notes = "新建")
+    @PostMapping({"insert"})
+    public ResponseResultVO<?> insert(@Valid @RequestBody AssetClearVO assetClearVO) {
+        return assetClearService.insert(assetClearVO);
+    }
+
+    /**
+     * @desc   : 编辑资产清理单
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    @ApiOperation(value = "编辑资产清理单", notes = "编辑资产清理单")
+    @PostMapping({"update"})
+    public ResponseResultVO<?> update(@Valid @RequestBody AssetClearVO assetClearVO) {
+        return assetClearService.update(assetClearVO);
+    }
+
+    /**
+     * @desc   : 小编辑
+     * @author : 常皓宁
+     * @date   : 2025/5/27 16:46
+     */
+    @PostMapping("update_part")
+
+    public ResponseResultVO<?> updatePart(@RequestBody AssetClearVO assetClearVO) {
+        return assetClearService.updatePart(assetClearConvert.assetClearVO2PO(assetClearVO), assetClearItemConvert.assetClearItemVOList2POList(assetClearVO.getClearItem(), assetClearVO.getDocId()));
+    }
+
+    /**
+     * @desc   : 根据id查询资产清理单
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    @ApiOperation(value = "根据id查询资产清理单", notes = "根据id查询资产清理单")
+    @PostMapping({"/{id}"})
+    public ResponseResultVO selectById(@PathVariable String id) {
+        return assetClearService.selectById(id);
+    }
+
+    /**
+     * @desc   : 作废
+     * @author : 常皓宁
+     * @date   : 2025/5/27 13:43
+     */
+    @PostMapping({"invalid/{id}"})
+    public ResponseResultVO invalid(@PathVariable String id) {
+        return assetClearService.invalid(id);
+    }
+
+    /**
+     * @desc   : 撤回
+     * @author : 常皓宁
+     * @date   : 2025/5/27 14:21
+     */
+    /**
+     * @desc : 撤回
+     * @author : 夏常明
+     * @date : 2024/11/28 11:19
+     */
+    @PostMapping("withdraw/{id}")
+    public ResponseResultVO<?> withdraw(@PathVariable String id) {
+        return assetClearService.withdraw(id);
+    }
+
+
+}

+ 77 - 0
src/main/java/com/dk/finance/controller/fia/AssetClearItemController.java

@@ -0,0 +1,77 @@
+package com.dk.finance.controller.fia;
+
+import com.dk.finance.model.pojo.fia.AssetClearItem;
+import com.dk.finance.model.query.fia.AssetClearItemQuery;
+import com.dk.finance.model.vo.fia.AssetClearItemVO;
+import com.dk.finance.model.response.fia.AssetClearItemResponse;
+import com.dk.common.service.BaseService;
+import com.dk.common.response.ResponseResultVO;
+import com.dk.common.model.pojo.PageList;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import javax.validation.Valid;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import com.dk.finance.service.fia.AssetClearItemService;
+
+/**
+ * @desc   : 资产清理单明细控制器
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Api(tags = "资产清理单明细API接口")
+@RestController
+@RequestMapping("/fia/assetClearItem")
+public class AssetClearItemController{
+
+    public BaseService<AssetClearItem> getService() {
+        return assetClearItemService;
+    }
+
+    @Autowired
+    private AssetClearItemService assetClearItemService;
+
+    /**
+     * @desc   : 分页、关联、条件查询资产清理单明细
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    @ApiOperation(value = "分页、关联、条件查询",notes = "分页、关联、条件查询")
+    @PostMapping({"list_by"})
+    public ResponseResultVO<PageList<AssetClearItemResponse>> selectByCond(@RequestBody AssetClearItemQuery assetClearItemQuery) {
+        return assetClearItemService.selectByCond(assetClearItemQuery);
+    }
+
+    /**
+     * @desc   : 新建资产清理单明细
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    @ApiOperation(value = "新建", notes = "新建")
+    @PostMapping({"insert"})
+    public ResponseResultVO<?> insert(@Valid @RequestBody AssetClearItemVO assetClearItemVO) {
+        return assetClearItemService.insert(assetClearItemVO);
+    }
+
+    /**
+     * @desc   : 编辑资产清理单明细
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    @ApiOperation(value = "编辑资产清理单明细", notes = "编辑资产清理单明细")
+    @PostMapping({"update"})
+    public ResponseResultVO<?> update(@Valid @RequestBody AssetClearItemVO assetClearItemVO) {
+        return assetClearItemService.update(assetClearItemVO);
+    }
+
+    /**
+     * @desc   : 根据id查询资产清理单明细
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    @ApiOperation(value = "根据id查询资产清理单明细", notes = "根据id查询资产清理单明细")
+    @PostMapping({"/{id}"})
+    public ResponseResultVO selectById(@PathVariable String id) {
+        return assetClearItemService.selectById(id);
+    }
+}

+ 44 - 0
src/main/java/com/dk/finance/infrastructure/convert/fia/AssetClearConvert.java

@@ -0,0 +1,44 @@
+package com.dk.finance.infrastructure.convert.fia;
+
+import com.dk.finance.model.vo.fia.AssetClearVO;
+import com.dk.finance.model.pojo.fia.AssetClear;
+import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @desc   : 资产清理单实体转换类
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Mapper(componentModel = "spring")
+public interface AssetClearConvert{
+
+    /**
+     * @desc   : VO转换为POJO
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    AssetClear assetClearVO2PO(AssetClearVO assetClearVO);
+
+    /**
+     * @desc   : VO转换为POJO,重载方法,用于明细类实体转换时自动设置总单id
+                 注意:需要自行修改@Mapping中对应的总单id字段
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    //@Mapping(target = "总单id字段", source="id")
+    AssetClear assetClearVO2PO(AssetClearVO assetClearVO,String id);
+
+    /**
+     * @desc   : VOList转换为POJOList,用于明细类实体转换时自动设置总单id
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     * @param id 总单id的值
+     */
+    default List<AssetClear> assetClearVOList2POList(List<AssetClearVO> assetClearVOList,String id){
+        return assetClearVOList.stream().map(it->assetClearVO2PO(it,id)).collect(Collectors.toList());
+    }
+}

+ 44 - 0
src/main/java/com/dk/finance/infrastructure/convert/fia/AssetClearItemConvert.java

@@ -0,0 +1,44 @@
+package com.dk.finance.infrastructure.convert.fia;
+
+import com.dk.finance.model.vo.fia.AssetClearItemVO;
+import com.dk.finance.model.pojo.fia.AssetClearItem;
+import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @desc   : 资产清理单明细实体转换类
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Mapper(componentModel = "spring")
+public interface AssetClearItemConvert{
+
+    /**
+     * @desc   : VO转换为POJO
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    AssetClearItem assetClearItemVO2PO(AssetClearItemVO assetClearItemVO);
+
+    /**
+     * @desc   : VO转换为POJO,重载方法,用于明细类实体转换时自动设置总单id
+                 注意:需要自行修改@Mapping中对应的总单id字段
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    @Mapping(target = "docId", source="id")
+    AssetClearItem assetClearItemVO2PO(AssetClearItemVO assetClearItemVO,String id);
+
+    /**
+     * @desc   : VOList转换为POJOList,用于明细类实体转换时自动设置总单id
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     * @param id 总单id的值
+     */
+    default List<AssetClearItem> assetClearItemVOList2POList(List<AssetClearItemVO> assetClearItemVOList,String id){
+        return assetClearItemVOList.stream().map(it->assetClearItemVO2PO(it,id)).collect(Collectors.toList());
+    }
+}

+ 40 - 0
src/main/java/com/dk/finance/mapper/fia/AssetClearItemMapper.java

@@ -0,0 +1,40 @@
+package com.dk.finance.mapper.fia;
+
+import com.dk.common.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.dk.finance.model.pojo.fia.AssetClearItem;
+import com.dk.finance.model.query.fia.AssetClearItemQuery;
+import com.dk.finance.model.response.fia.AssetClearItemResponse;
+import java.util.List;
+
+/**
+ * @desc   : 资产清理单明细持久层
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Repository
+public interface AssetClearItemMapper extends BaseMapper<AssetClearItem>{
+
+
+    /**
+     * @desc   : 分页、关联、条件查询
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    List<AssetClearItemResponse> selectByCond(AssetClearItemQuery assetClearItemQuery);
+
+    /**
+     * @desc   : 分页、关联、条件查询数量
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    Long countByCond(AssetClearItemQuery assetClearItemQuery);
+
+    /**
+     * @desc   : 根据主键id查询
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    AssetClearItemResponse selectById(@Param("id") String id);
+}

+ 363 - 0
src/main/java/com/dk/finance/mapper/fia/AssetClearItemMapper.xml

@@ -0,0 +1,363 @@
+<?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.dk.finance.mapper.fia.AssetClearItemMapper">
+
+    <!-- **************************************** 数据库基础列映射 **************************************** -->
+    <resultMap id="Pojo_ResultMap" type="com.dk.finance.model.pojo.fia.AssetClearItem">
+        <id column="item_id" property="itemId"/>
+        <result column="doc_id" property="docId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="asset_id" property="assetId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="amt_net_worth" property="amtNetWorth"/>
+        <result column="amt_should" property="amtShould"/>
+        <result column="amt_clear" property="amtClear"/>
+        <result column="clear_subject_id" property="clearSubjectId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="source_id" property="sourceId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="source_item_id" property="sourceItemId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="display_no" property="displayNo"/>
+        <result column="remarks" property="remarks"/>
+        <result column="flg_valid" property="flgValid"/>
+        <result column="own_cp_id" property="ownCpId"/>
+        <result column="ctr_cp_id" property="ctrCpId"/>
+        <result column="op_create_time" property="opCreateTime" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="op_update_time" property="opUpdateTime" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="op_update_staff_id" property="opUpdateStaffId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+    </resultMap>
+
+    <!-- **************************************** 查询映射结果 **************************************** -->
+    <resultMap id="Response_ResultMap" type="com.dk.finance.model.response.fia.AssetClearItemResponse">
+        <!-- **************************************** 当前表映射 **************************************** -->
+        <id column="item_id" property="itemId"/>
+        <result column="doc_id" property="docId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="asset_id" property="assetId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="amt_net_worth" property="amtNetWorth"/>
+        <result column="amt_should" property="amtShould"/>
+        <result column="amt_clear" property="amtClear"/>
+        <result column="clear_subject_id" property="clearSubjectId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="source_id" property="sourceId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="source_item_id" property="sourceItemId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="display_no" property="displayNo"/>
+        <result column="remarks" property="remarks"/>
+        <result column="flg_valid" property="flgValid"/>
+        <result column="own_cp_id" property="ownCpId"/>
+        <result column="ctr_cp_id" property="ctrCpId"/>
+        <result column="op_create_time" property="opCreateTime" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="op_update_time" property="opUpdateTime" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="op_update_staff_id" property="opUpdateStaffId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <!-- **************************************** 关联表映射 **************************************** -->
+        <result column="op_update_staff_name" property="opUpdateStaffName"/>
+        <result column="assetNo" property="assetNo"/>
+        <result column="assetName" property="assetName"/>
+        <result column="typeName" property="typeName"/>
+        <result column="sumAmtAsset" property="sumAmtAsset"/>
+        <result column="sumAmtHappenCalc" property="sumAmtHappenCalc"/>
+        <result column="sumAmtLoss" property="sumAmtLoss"/>
+        <result column="sumAmtNetWorth" property="sumAmtNetWorth"/>
+        <result column="clearSubjectName" property="clearSubjectName"/>
+        <result column="taxRate" property="taxRate"/>
+        <result column="sumAmtTax" property="sumAmtTax"/>
+        <result column="happenCalcNo" property="happenCalcNo"/>
+        <result column="assetMakeTime" property="assetMakeTime" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="accCalcBegin" property="accCalcBegin" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+    </resultMap>
+
+
+    <!-- **************************************** 当前表列 **************************************** -->
+    <sql id="Base_Columns">
+        t.item_id,
+        t.doc_id,
+        t.asset_id,
+        t.amt_net_worth,
+        t.amt_should,
+        t.amt_clear,
+        t.clear_subject_id,
+        t.source_id,
+        t.source_item_id,
+        t.display_no,
+        t.remarks,
+        t.flg_valid,
+        t.own_cp_id,
+        t.ctr_cp_id,
+        t.op_create_time,
+        t.op_update_time,
+        t.op_update_staff_id,
+        
+    </sql>
+
+    <!-- **************************************** 当前表查询条件 **************************************** -->
+    <sql id="Base_Conditions">
+        <if test="docId != null">
+            AND t.doc_id = #{docId}::uuid
+        </if>
+        <if test="assetId != null">
+            AND t.asset_id = #{assetId}::uuid
+        </if>
+        <if test="amtNetWorth != null">
+            AND t.amt_net_worth = #{amtNetWorth}
+        </if>
+        <if test="amtShould != null">
+            AND t.amt_should = #{amtShould}
+        </if>
+        <if test="amtClear != null">
+            AND t.amt_clear = #{amtClear}
+        </if>
+        <if test="clearSubjectId != null">
+            AND t.clear_subject_id = #{clearSubjectId}::uuid
+        </if>
+        <if test="sourceId != null">
+            AND t.source_id = #{sourceId}::uuid
+        </if>
+        <if test="sourceItemId != null">
+            AND t.source_item_id = #{sourceItemId}::uuid
+        </if>
+        <if test="remarks != null and remarks != ''">
+            AND t.remarks LIKE concat('%',pgex.likequery(#{remarks}),'%')
+        </if>
+        <if test="flgValid != null">
+            AND t.flg_valid = #{flgValid}
+        </if>
+        <if test="ownCpId != null">
+            AND t.own_cp_id = #{ownCpId}
+        </if>
+        <if test="ctrCpId != null">
+            AND t.ctr_cp_id = #{ctrCpId}
+        </if>
+        <if test="opUpdateStaffId != null">
+            AND t.op_update_staff_id = #{opUpdateStaffId}::uuid
+        </if>
+        <!-- **************************************** 自动生成其他查询条件 **************************************** -->
+    
+        <if test="flgValidList != null and flgValidList.size()>0">
+            AND t.flg_valid = any(#{flgValidList, typeHandler= BooleanListTypeHandler})
+        </if>
+        <if test="ownCpIdList != null and ownCpIdList.size()>0">
+            AND t.own_cp_id = any(#{ownCpIdList, typeHandler= BigIntListTypeHandler})
+        </if>
+        <if test="opCreateTimeStart != null">
+            AND t.op_create_time &gt;= #{opCreateTimeStart}::timestamp with time zone
+        </if>
+        <if test="opCreateTimeEnd != null">
+            AND t.op_create_time &lt; #{opCreateTimeEnd}::timestamp with time zone + interval '1 day'
+        </if>
+        <if test="opUpdateTimeStart != null">
+            AND t.op_update_time &gt;= #{opUpdateTimeStart}::timestamp with time zone
+        </if>
+        <if test="opUpdateTimeEnd != null">
+            AND t.op_update_time &lt; #{opUpdateTimeEnd}::timestamp with time zone + interval '1 day'
+        </if>
+        
+    </sql>
+
+    <!-- **************************************** 关联表列 **************************************** -->
+    <sql id="Join_Columns">
+        update_staff.staff_name AS op_update_staff_name,
+        tfa.doc_no as "assetNo",
+        tfa.asset_name as "assetName",
+        tfat.type_name as "typeName",
+        tfa.sum_amt_asset as "sumAmtAsset",
+        tfa.sum_amt_happen_calc as "sumAmtHappenCalc",
+        tfa.sum_amt_loss as "sumAmtLoss",
+        tfa.sum_amt_net_worth as "sumAmtNetWorth",
+        tfs.subject_name as "clearSubjectName",
+        tfa.tax_rate as "taxRate",
+        tfa.sum_amt_tax as "sumAmtTax",
+        tfa.happen_calc_no as "happenCalcNo",
+        tfa.make_time as "assetMakeTime",
+        tfa.acc_calc_begin as "accCalcBegin",
+    </sql>
+
+    <!-- **************************************** 关联表 **************************************** -->
+    <sql id="Join_Tables">
+        LEFT JOIN dkscu_b.t_mst_staff AS update_staff ON t.op_update_staff_id = update_staff.staff_id
+        LEFT JOIN dkscu_b.t_fia_asset AS tfa ON t.asset_id = tfa.doc_id
+        LEFT JOIN dkscu_bs.t_fia_asset_type AS tfat ON tfa.asset_type_id = tfat.type_id
+        LEFT JOIN dkscu_b.t_fnc_subject tfs on t.clear_subject_id = tfs.subject_id
+    </sql>
+
+    <!-- **************************************** 关联表查询条件 **************************************** -->
+    <sql id="Join_Conditions">
+    </sql>
+
+    <!-- 查询表t_fia_asset_clear_item,(条件查询+分页)列表 -->
+    <select id="selectByCond" resultMap="Response_ResultMap">
+        SELECT
+        <trim suffixOverrides=",">
+        <include refid="Base_Columns"/>
+        <include refid="Join_Columns"/>
+        </trim>
+        FROM dkscu_b.t_fia_asset_clear_item t
+        <include refid="Join_Tables"/>
+        <where>
+        <include refid="Base_Conditions"/>
+        <include refid="Join_Conditions"/>
+        </where>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
+    <!-- 查询表t_fia_asset_clear_item,(条件查询)个数 -->
+    <select id="countByCond" resultType="Long">
+        SELECT
+        count(1)
+        FROM dkscu_b.t_fia_asset_clear_item t
+        <include refid="Join_Tables"/>
+        <where>
+        <include refid="Base_Conditions"/>
+        <include refid="Join_Conditions"/>
+        </where>
+    </select>
+
+    <!-- 根据主键查询表t_fia_asset_clear_item的一行数据 -->
+    <select id="selectById" resultMap="Response_ResultMap">
+        SELECT
+        <trim suffixOverrides=",">
+        <include refid="Base_Columns"/>
+        <include refid="Join_Columns"/>
+        </trim>
+        FROM dkscu_b.t_fia_asset_clear_item t
+        <include refid="Join_Tables"/>
+        WHERE t.item_id = #{itemId}::uuid
+    </select>
+
+    <!-- 根据主键itemId批量操作 -->
+    <sql id="idList">
+        WHERE t.item_id in
+        <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
+            #{item}::uuid
+        </foreach>
+    </sql>
+
+    <!-- 根据主键锁定表t_fia_asset_clear_item的一行数据 -->
+    <select id="selectByIdForUpdate" resultMap="Pojo_ResultMap">
+        SELECT
+        <trim suffixOverrides=",">
+        <include refid="Base_Columns"/>
+        </trim>
+        FROM dkscu_b.t_fia_asset_clear_item t
+        WHERE t.item_id = #{id}::uuid
+        for update
+    </select>
+
+    <!-- 根据主键锁定表t_fia_asset_clear_item的多行数据 -->
+    <select id="selectByIdsForUpdate" resultMap="Pojo_ResultMap">
+        SELECT
+        <trim suffixOverrides=",">
+        <include refid="Base_Columns"/>
+        </trim>
+        FROM dkscu_b.t_fia_asset_clear_item t
+        <include refid="idList"/>
+        for update
+    </select>
+
+    <!--  批量新建  -->
+    <insert id="insertBatch" useGeneratedKeys="true" keyProperty="itemId">
+        <include refid="insertBatchSql"/>
+    </insert>
+
+    <sql id="insertBatchSql">
+        insert into dkscu_b.t_fia_asset_clear_item
+        (
+        <trim suffixOverrides=",">
+            item_id,
+            doc_id,
+            asset_id,
+            amt_net_worth,
+            amt_should,
+            amt_clear,
+            clear_subject_id,
+            source_id,
+            source_item_id,
+            display_no,
+            remarks,
+            own_cp_id,
+            ctr_cp_id,
+        </trim>
+        )
+        values
+        <foreach collection="list" index="index" item="item" separator=",">
+        (
+        <trim suffixOverrides=",">
+            <choose>
+                <when test="item.itemId != null">
+                    #{item.itemId}::uuid,
+                </when>
+                <otherwise>
+                    DEFAULT,
+                </otherwise>
+            </choose>
+            #{item.docId}::uuid,
+            #{item.assetId}::uuid,
+            <choose>
+                <when test="item.amtNetWorth != null">
+                    #{item.amtNetWorth},
+                </when>
+                <otherwise>
+                    DEFAULT,
+                </otherwise>
+            </choose>
+            <choose>
+                <when test="item.amtShould != null">
+                    #{item.amtShould},
+                </when>
+                <otherwise>
+                    DEFAULT,
+                </otherwise>
+            </choose>
+            <choose>
+                <when test="item.amtClear != null">
+                    #{item.amtClear},
+                </when>
+                <otherwise>
+                    DEFAULT,
+                </otherwise>
+            </choose>
+            #{item.clearSubjectId}::uuid,
+            #{item.sourceId}::uuid,
+            #{item.sourceItemId}::uuid,
+            <choose>
+                <when test="item.displayNo != null">
+                    #{item.displayNo},
+                </when>
+                <otherwise>
+                    DEFAULT,
+                </otherwise>
+            </choose>
+            #{item.remarks},
+            #{item.ownCpId},
+            #{item.ctrCpId},
+        </trim>
+        )
+        </foreach>
+    </sql>
+
+    <!--  批量保存 - 有id则编辑无id则新建  -->
+    <insert id="saveBatch" useGeneratedKeys="true" keyProperty="itemId">
+        <include refid="insertBatchSql"/>
+        on conflict (item_id) do update set
+        <trim suffixOverrides=",">
+        doc_id = excluded."doc_id",
+        asset_id = excluded."asset_id",
+        amt_net_worth = excluded."amt_net_worth",
+        amt_should = excluded."amt_should",
+        amt_clear = excluded."amt_clear",
+        clear_subject_id = excluded."clear_subject_id",
+        source_id = excluded."source_id",
+        source_item_id = excluded."source_item_id",
+        display_no = excluded."display_no",
+        remarks = excluded."remarks",
+        own_cp_id = excluded."own_cp_id",
+        ctr_cp_id = excluded."ctr_cp_id",
+        </trim>
+    </insert>
+
+    <!-- 根据主键锁定表t_fia_asset_clear_item的一行数据 -->
+    <select id="selectItemsByDocIdForUpdate" resultMap="Pojo_ResultMap">
+        SELECT
+        <trim suffixOverrides=",">
+            <include refid="Base_Columns"/>
+        </trim>
+        FROM dkscu_b.t_fia_asset_clear_item t
+        WHERE t.doc_id = #{docId}::uuid
+        for update
+    </select>
+</mapper>

+ 40 - 0
src/main/java/com/dk/finance/mapper/fia/AssetClearMapper.java

@@ -0,0 +1,40 @@
+package com.dk.finance.mapper.fia;
+
+import com.dk.common.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.dk.finance.model.pojo.fia.AssetClear;
+import com.dk.finance.model.query.fia.AssetClearQuery;
+import com.dk.finance.model.response.fia.AssetClearResponse;
+import java.util.List;
+
+/**
+ * @desc   : 资产清理单持久层
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Repository
+public interface AssetClearMapper extends BaseMapper<AssetClear>{
+
+
+    /**
+     * @desc   : 分页、关联、条件查询
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    List<AssetClearResponse> selectByCond(AssetClearQuery assetClearQuery);
+
+    /**
+     * @desc   : 分页、关联、条件查询数量
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    Long countByCond(AssetClearQuery assetClearQuery);
+
+    /**
+     * @desc   : 根据主键id查询
+     * @author : 常皓宁
+     * @date   : 2025/05/26 15:41
+     */
+    AssetClearResponse selectById(@Param("id") String id);
+}

+ 549 - 0
src/main/java/com/dk/finance/mapper/fia/AssetClearMapper.xml

@@ -0,0 +1,549 @@
+<?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.dk.finance.mapper.fia.AssetClearMapper">
+
+    <!-- **************************************** 数据库基础列映射 **************************************** -->
+    <resultMap id="Pojo_ResultMap" type="com.dk.finance.model.pojo.fia.AssetClear">
+        <id column="doc_id" property="docId"/>
+        <result column="doc_no" property="docNo"/>
+        <result column="kind_code" property="kindCode"/>
+        <result column="status_invoice" property="statusInvoice"/>
+        <result column="status_flow" property="statusFlow"/>
+        <result column="org_id" property="orgId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="staff_id" property="staffId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="summary" property="summary"/>
+        <result column="status_receipt" property="statusReceipt"/>
+        <result column="mac_id" property="macId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="sum_amt_cash" property="sumAmtCash"/>
+        <result column="sum_amt_charge" property="sumAmtCharge"/>
+        <result column="sum_amt_total_cash" property="sumAmtTotalCash"/>
+        <result column="sum_amt_should" property="sumAmtShould"/>
+        <result column="obj_type" property="objType"/>
+        <result column="obj_id" property="objId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="due_date" property="dueDate" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="print_times" property="printTimes"/>
+        <result column="reversed_type" property="reversedType"/>
+        <result column="reversed_id" property="reversedId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="reversed_no" property="reversedNo"/>
+        <result column="apv_submit_id" property="apvSubmitId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="apv_staff_ids" property="apvStaffIds" typeHandler="com.dk.common.infrastructure.handler.UuidListTypeHandler"/>
+        <result column="apv_result_time" property="apvResultTime" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="annex_paths" property="annexPaths" typeHandler="com.dk.common.infrastructure.handler.JsonTypeHandler"/>
+        <result column="other_annex_paths" property="otherAnnexPaths" typeHandler="com.dk.common.infrastructure.handler.JsonTypeHandler"/>
+        <result column="remarks" property="remarks"/>
+        <result column="acc_date" property="accDate" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="make_staff" property="makeStaff" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="make_time" property="makeTime" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="flg_valid" property="flgValid"/>
+        <result column="own_cp_id" property="ownCpId"/>
+        <result column="ctr_cp_id" property="ctrCpId"/>
+        <result column="op_create_time" property="opCreateTime" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="op_update_time" property="opUpdateTime" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="op_update_staff_id" property="opUpdateStaffId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+    </resultMap>
+
+    <!-- **************************************** 查询映射结果 **************************************** -->
+    <resultMap id="Response_ResultMap" type="com.dk.finance.model.response.fia.AssetClearResponse">
+        <!-- **************************************** 当前表映射 **************************************** -->
+        <id column="doc_id" property="docId"/>
+        <result column="doc_no" property="docNo"/>
+        <result column="kind_code" property="kindCode"/>
+        <result column="status_invoice" property="statusInvoice"/>
+        <result column="status_flow" property="statusFlow"/>
+        <result column="org_id" property="orgId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="staff_id" property="staffId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="summary" property="summary"/>
+        <result column="status_receipt" property="statusReceipt"/>
+        <result column="mac_id" property="macId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="sum_amt_cash" property="sumAmtCash"/>
+        <result column="sum_amt_charge" property="sumAmtCharge"/>
+        <result column="sum_amt_total_cash" property="sumAmtTotalCash"/>
+        <result column="sum_amt_should" property="sumAmtShould"/>
+        <result column="obj_type" property="objType"/>
+        <result column="obj_id" property="objId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="due_date" property="dueDate" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="print_times" property="printTimes"/>
+        <result column="reversed_type" property="reversedType"/>
+        <result column="reversed_id" property="reversedId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="reversed_no" property="reversedNo"/>
+        <result column="apv_submit_id" property="apvSubmitId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="apv_staff_ids" property="apvStaffIds" typeHandler="com.dk.common.infrastructure.handler.UuidListTypeHandler"/>
+        <result column="apv_result_time" property="apvResultTime" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="annex_paths" property="annexPaths" typeHandler="com.dk.common.infrastructure.handler.JsonTypeHandler"/>
+        <result column="other_annex_paths" property="otherAnnexPaths" typeHandler="com.dk.common.infrastructure.handler.JsonTypeHandler"/>
+        <result column="remarks" property="remarks"/>
+        <result column="acc_date" property="accDate" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="make_staff" property="makeStaff" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <result column="make_time" property="makeTime" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="flg_valid" property="flgValid"/>
+        <result column="own_cp_id" property="ownCpId"/>
+        <result column="ctr_cp_id" property="ctrCpId"/>
+        <result column="op_create_time" property="opCreateTime" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="op_update_time" property="opUpdateTime" typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>
+        <result column="op_update_staff_id" property="opUpdateStaffId" typeHandler="com.dk.common.infrastructure.handler.UuidTypeHandler"/>
+        <!-- **************************************** 关联表映射 **************************************** -->
+        <result column="op_update_staff_name" property="opUpdateStaffName"/>
+        <result column="status_invoice_name" property="statusInvoiceName"/>
+        <result column="status_receipt_name" property="statusReceiptName"/>
+        <result column="status_flow_name" property="statusFlowName"/>
+        <result column="orgName" property="orgName"/>
+        <result column="makeStaffName" property="makeStaffName"/>
+        <result column="staffName" property="staffName"/>
+        <result column="macName" property="macName"/>
+        <result column="unRecAmt" property="unRecAmt"/>
+        <result column="objName" property="objName"/>
+    </resultMap>
+
+
+    <!-- **************************************** 当前表列 **************************************** -->
+    <sql id="Base_Columns">
+        t.doc_id,
+        t.doc_no,
+        t.kind_code,
+        t.status_invoice,
+        t.status_flow,
+        t.org_id,
+        t.staff_id,
+        t.summary,
+        t.status_receipt,
+        t.mac_id,
+        t.sum_amt_cash,
+        t.sum_amt_charge,
+        t.sum_amt_total_cash,
+        t.sum_amt_should,
+        t.obj_type,
+        t.obj_id,
+        t.due_date,
+        t.print_times,
+        t.reversed_type,
+        t.reversed_id,
+        t.reversed_no,
+        t.apv_submit_id,
+        t.apv_staff_ids,
+        t.apv_result_time,
+        t.annex_paths,
+        t.other_annex_paths,
+        t.remarks,
+        t.acc_date,
+        t.make_staff,
+        t.make_time,
+        t.flg_valid,
+        t.own_cp_id,
+        t.ctr_cp_id,
+        t.op_create_time,
+        t.op_update_time,
+        t.op_update_staff_id,
+        
+    </sql>
+
+    <!-- **************************************** 当前表查询条件 **************************************** -->
+    <sql id="Base_Conditions">
+        <if test="docNo != null and docNo != ''">
+            AND t.doc_no LIKE concat('%',pgex.likequery(#{docNo}),'%')
+        </if>
+        <if test="kindCode != null and kindCode != ''">
+            AND t.kind_code LIKE concat('%',pgex.likequery(#{kindCode}),'%')
+        </if>
+        <if test="statusInvoice != null and statusInvoice != ''">
+            AND t.status_invoice LIKE concat('%',pgex.likequery(#{statusInvoice}),'%')
+        </if>
+        <if test="statusFlow != null and statusFlow != ''">
+            AND t.status_flow LIKE concat('%',pgex.likequery(#{statusFlow}),'%')
+        </if>
+        <if test="orgId != null">
+            AND t.org_id = #{orgId}::uuid
+        </if>
+        <if test="staffId != null">
+            AND t.staff_id = #{staffId}::uuid
+        </if>
+        <if test="summary != null and summary != ''">
+            AND t.summary LIKE concat('%',pgex.likequery(#{summary}),'%')
+        </if>
+        <if test="statusReceipt != null and statusReceipt != ''">
+            AND t.status_receipt LIKE concat('%',pgex.likequery(#{statusReceipt}),'%')
+        </if>
+        <if test="macId != null">
+            AND t.mac_id = #{macId}::uuid
+        </if>
+        <if test="sumAmtCash != null">
+            AND t.sum_amt_cash = #{sumAmtCash}
+        </if>
+        <if test="sumAmtCharge != null">
+            AND t.sum_amt_charge = #{sumAmtCharge}
+        </if>
+        <if test="sumAmtTotalCash != null">
+            AND t.sum_amt_total_cash = #{sumAmtTotalCash}
+        </if>
+        <if test="sumAmtShould != null">
+            AND t.sum_amt_should = #{sumAmtShould}
+        </if>
+        <if test="objType != null">
+            AND t.obj_type = #{objType}
+        </if>
+        <if test="objId != null">
+            AND t.obj_id = #{objId}::uuid
+        </if>
+        <if test="printTimes != null">
+            AND t.print_times = #{printTimes}
+        </if>
+        <if test="reversedType != null">
+            AND t.reversed_type = #{reversedType}
+        </if>
+        <if test="reversedId != null">
+            AND t.reversed_id = #{reversedId}::uuid
+        </if>
+        <if test="reversedNo != null and reversedNo != ''">
+            AND t.reversed_no LIKE concat('%',pgex.likequery(#{reversedNo}),'%')
+        </if>
+        <if test="apvSubmitId != null">
+            AND t.apv_submit_id = #{apvSubmitId}::uuid
+        </if>
+        <if test="apvStaffIds != null">
+            AND t.apv_staff_ids = #{apvStaffIds}
+        </if>
+        <if test="annexPaths != null">
+            AND t.annex_paths = #{annexPaths}
+        </if>
+        <if test="otherAnnexPaths != null">
+            AND t.other_annex_paths = #{otherAnnexPaths}
+        </if>
+        <if test="remarks != null and remarks != ''">
+            AND t.remarks LIKE concat('%',pgex.likequery(#{remarks}),'%')
+        </if>
+        <if test="makeStaff != null">
+            AND t.make_staff = #{makeStaff}::uuid
+        </if>
+        <if test="flgValid != null">
+            AND t.flg_valid = #{flgValid}
+        </if>
+        <if test="ownCpId != null">
+            AND t.own_cp_id = #{ownCpId}
+        </if>
+        <if test="ctrCpId != null">
+            AND t.ctr_cp_id = #{ctrCpId}
+        </if>
+        <if test="opUpdateStaffId != null">
+            AND t.op_update_staff_id = #{opUpdateStaffId}::uuid
+        </if>
+        <!-- **************************************** 自动生成其他查询条件 **************************************** -->
+    
+        <if test="dueDateStart != null">
+            AND t.due_date &gt;= #{dueDateStart}
+        </if>
+        <if test="dueDateEnd != null">
+            AND t.due_date &lt;= #{dueDateEnd}
+        </if>
+        <if test="apvResultTimeStart != null">
+            AND t.apv_result_time &gt;= #{apvResultTimeStart}::timestamp with time zone
+        </if>
+        <if test="apvResultTimeEnd != null">
+            AND t.apv_result_time &lt; #{apvResultTimeEnd}::timestamp with time zone + interval '1 day'
+        </if>
+        <if test="accDateStart != null">
+            AND t.acc_date &gt;= #{accDateStart}
+        </if>
+        <if test="accDateEnd != null">
+            AND t.acc_date &lt;= #{accDateEnd}
+        </if>
+        <if test="makeTimeStart != null">
+            AND t.make_time &gt;= #{makeTimeStart}::timestamp with time zone
+        </if>
+        <if test="makeTimeEnd != null">
+            AND t.make_time &lt; #{makeTimeEnd}::timestamp with time zone + interval '1 day'
+        </if>
+        <if test="flgValidList != null and flgValidList.size()>0">
+            AND t.flg_valid = any(#{flgValidList, typeHandler= BooleanListTypeHandler})
+        </if>
+        <if test="ownCpIdList != null and ownCpIdList.size()>0">
+            AND t.own_cp_id = any(#{ownCpIdList, typeHandler= BigIntListTypeHandler})
+        </if>
+        <if test="opCreateTimeStart != null">
+            AND t.op_create_time &gt;= #{opCreateTimeStart}::timestamp with time zone
+        </if>
+        <if test="opCreateTimeEnd != null">
+            AND t.op_create_time &lt; #{opCreateTimeEnd}::timestamp with time zone + interval '1 day'
+        </if>
+        <if test="opUpdateTimeStart != null">
+            AND t.op_update_time &gt;= #{opUpdateTimeStart}::timestamp with time zone
+        </if>
+        <if test="opUpdateTimeEnd != null">
+            AND t.op_update_time &lt; #{opUpdateTimeEnd}::timestamp with time zone + interval '1 day'
+        </if>
+        
+    </sql>
+
+    <!-- **************************************** 关联表列 **************************************** -->
+    <sql id="Join_Columns">
+        t.sum_amt_should - t.sum_amt_total_cash as "unRecAmt",
+        update_staff.staff_name AS op_update_staff_name,
+        org.org_name AS "orgName",
+        tms.staff_name AS "makeStaffName",
+        tms1.staff_name AS "staffName",
+        tmma.mac_name as "macName",
+        obj.obj_name as "objName",
+        myex.f_get_name_i18n(tdk.kind_name_i18n,#{i18n}) AS  status_invoice_name,
+        myex.f_get_name_i18n(tdkf.kind_name_i18n,#{i18n}) AS  status_flow_name,
+        myex.f_get_name_i18n(tdkr.kind_name_i18n,#{i18n}) AS  status_receipt_name,
+    </sql>
+
+    <!-- **************************************** 关联表 **************************************** -->
+    <sql id="Join_Tables">
+        LEFT JOIN dkscu_b.t_mst_staff AS update_staff ON t.op_update_staff_id = update_staff.staff_id
+        LEFT JOIN dkscu_bs.t_data_kind tdk ON t.status_invoice = tdk.kind_code
+        LEFT JOIN dkscu_bs.t_data_kind tdkf ON t.status_flow = tdkf.kind_code
+        LEFT JOIN dkscu_bs.t_data_kind tdkr ON t.status_receipt = tdkr.kind_code
+        LEFT JOIN dkscu_b.t_mst_organization org ON t.org_id = org.org_id
+        LEFT JOIN dkscu_b.t_mst_staff tms ON tms.staff_id = t.make_staff
+        LEFT JOIN dkscu_b.t_mst_staff tms1 ON tms1.staff_id = t.staff_id
+        LEFT JOIN dkscu_b.t_mst_money_account tmma ON t.mac_id = tmma.mac_id
+        LEFT JOIN dkscu_b.t_mst_obj AS obj ON t.obj_id = obj.obj_id
+    </sql>
+
+    <!-- **************************************** 关联表查询条件 **************************************** -->
+    <sql id="Join_Conditions">
+    </sql>
+
+    <!-- 查询表t_fia_asset_clear,(条件查询+分页)列表 -->
+    <select id="selectByCond" resultMap="Response_ResultMap">
+        SELECT
+        <trim suffixOverrides=",">
+        <include refid="Base_Columns"/>
+        <include refid="Join_Columns"/>
+        </trim>
+        FROM dkscu_b.t_fia_asset_clear t
+        <include refid="Join_Tables"/>
+        <where>
+        <include refid="Base_Conditions"/>
+        <include refid="Join_Conditions"/>
+        </where>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
+    <!-- 查询表t_fia_asset_clear,(条件查询)个数 -->
+    <select id="countByCond" resultType="Long">
+        SELECT
+        count(1)
+        FROM dkscu_b.t_fia_asset_clear t
+        <include refid="Join_Tables"/>
+        <where>
+        <include refid="Base_Conditions"/>
+        <include refid="Join_Conditions"/>
+        </where>
+    </select>
+
+    <!-- 根据主键查询表t_fia_asset_clear的一行数据 -->
+    <select id="selectById" resultMap="Response_ResultMap">
+        SELECT
+        <trim suffixOverrides=",">
+        <include refid="Base_Columns"/>
+        <include refid="Join_Columns"/>
+        </trim>
+        FROM dkscu_b.t_fia_asset_clear t
+        <include refid="Join_Tables"/>
+        WHERE t.doc_id = #{id}::uuid
+    </select>
+
+    <!-- 根据主键docId批量操作 -->
+    <sql id="idList">
+        WHERE t.doc_id in
+        <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">
+            #{item}::uuid
+        </foreach>
+    </sql>
+
+    <!-- 根据主键锁定表t_fia_asset_clear的一行数据 -->
+    <select id="selectByIdForUpdate" resultMap="Pojo_ResultMap">
+        SELECT
+        <trim suffixOverrides=",">
+        <include refid="Base_Columns"/>
+        </trim>
+        FROM dkscu_b.t_fia_asset_clear t
+        WHERE t.doc_id = #{id}::uuid
+        for update
+    </select>
+
+    <!-- 根据主键锁定表t_fia_asset_clear的多行数据 -->
+    <select id="selectByIdsForUpdate" resultMap="Pojo_ResultMap">
+        SELECT
+        <trim suffixOverrides=",">
+        <include refid="Base_Columns"/>
+        </trim>
+        FROM dkscu_b.t_fia_asset_clear t
+        <include refid="idList"/>
+        for update
+    </select>
+
+    <!--  批量新建  -->
+    <insert id="insertBatch" useGeneratedKeys="true" keyProperty="docId">
+        <include refid="insertBatchSql"/>
+    </insert>
+
+    <sql id="insertBatchSql">
+        insert into dkscu_b.t_fia_asset_clear
+        (
+        <trim suffixOverrides=",">
+            doc_id,
+            doc_no,
+            kind_code,
+            status_invoice,
+            status_flow,
+            org_id,
+            staff_id,
+            summary,
+            status_receipt,
+            mac_id,
+            sum_amt_cash,
+            sum_amt_charge,
+            sum_amt_total_cash,
+            sum_amt_should,
+            obj_type,
+            obj_id,
+            due_date,
+            print_times,
+            reversed_type,
+            reversed_id,
+            reversed_no,
+            apv_submit_id,
+            apv_staff_ids,
+            apv_result_time,
+            annex_paths,
+            other_annex_paths,
+            remarks,
+            acc_date,
+            make_staff,
+            make_time,
+            own_cp_id,
+            ctr_cp_id,
+        </trim>
+        )
+        values
+        <foreach collection="list" index="index" item="item" separator=",">
+        (
+        <trim suffixOverrides=",">
+            #{item.docId}::uuid,
+            #{item.docNo},
+            #{item.kindCode},
+            #{item.statusInvoice},
+            #{item.statusFlow},
+            #{item.orgId}::uuid,
+            #{item.staffId}::uuid,
+            #{item.summary},
+            #{item.statusReceipt},
+            #{item.macId}::uuid,
+            <choose>
+                <when test="item.sumAmtCash != null">
+                    #{item.sumAmtCash},
+                </when>
+                <otherwise>
+                    DEFAULT,
+                </otherwise>
+            </choose>
+            <choose>
+                <when test="item.sumAmtCharge != null">
+                    #{item.sumAmtCharge},
+                </when>
+                <otherwise>
+                    DEFAULT,
+                </otherwise>
+            </choose>
+            <choose>
+                <when test="item.sumAmtTotalCash != null">
+                    #{item.sumAmtTotalCash},
+                </when>
+                <otherwise>
+                    DEFAULT,
+                </otherwise>
+            </choose>
+            <choose>
+                <when test="item.sumAmtShould != null">
+                    #{item.sumAmtShould},
+                </when>
+                <otherwise>
+                    DEFAULT,
+                </otherwise>
+            </choose>
+            <choose>
+                <when test="item.objType != null">
+                    #{item.objType},
+                </when>
+                <otherwise>
+                    DEFAULT,
+                </otherwise>
+            </choose>
+            #{item.objId}::uuid,
+            #{item.dueDate},
+            <choose>
+                <when test="item.printTimes != null">
+                    #{item.printTimes},
+                </when>
+                <otherwise>
+                    DEFAULT,
+                </otherwise>
+            </choose>
+            #{item.reversedType},
+            #{item.reversedId}::uuid,
+            #{item.reversedNo},
+            #{item.apvSubmitId}::uuid,
+            #{item.apvStaffIds,typeHandler=UuidListTypeHandler},
+            #{item.apvResultTime},
+            #{item.annexPaths,typeHandler=JsonTypeHandler},
+            #{item.otherAnnexPaths,typeHandler=JsonTypeHandler},
+            #{item.remarks},
+            #{item.accDate},
+            #{item.makeStaff}::uuid,
+            <choose>
+                <when test="item.makeTime != null">
+                    #{item.makeTime},
+                </when>
+                <otherwise>
+                    DEFAULT,
+                </otherwise>
+            </choose>
+            #{item.ownCpId},
+            #{item.ctrCpId},
+        </trim>
+        )
+        </foreach>
+    </sql>
+
+    <!--  批量保存 - 有id则编辑无id则新建  -->
+    <insert id="saveBatch" useGeneratedKeys="true" keyProperty="docId">
+        <include refid="insertBatchSql"/>
+        on conflict (doc_id) do update set
+        <trim suffixOverrides=",">
+        doc_no = excluded."doc_no",
+        kind_code = excluded."kind_code",
+        status_invoice = excluded."status_invoice",
+        status_flow = excluded."status_flow",
+        org_id = excluded."org_id",
+        staff_id = excluded."staff_id",
+        summary = excluded."summary",
+        status_receipt = excluded."status_receipt",
+        mac_id = excluded."mac_id",
+        sum_amt_cash = excluded."sum_amt_cash",
+        sum_amt_charge = excluded."sum_amt_charge",
+        sum_amt_total_cash = excluded."sum_amt_total_cash",
+        sum_amt_should = excluded."sum_amt_should",
+        obj_type = excluded."obj_type",
+        obj_id = excluded."obj_id",
+        due_date = excluded."due_date",
+        print_times = excluded."print_times",
+        reversed_type = excluded."reversed_type",
+        reversed_id = excluded."reversed_id",
+        reversed_no = excluded."reversed_no",
+        apv_submit_id = excluded."apv_submit_id",
+        apv_staff_ids = excluded."apv_staff_ids",
+        apv_result_time = excluded."apv_result_time",
+        annex_paths = excluded."annex_paths",
+        other_annex_paths = excluded."other_annex_paths",
+        remarks = excluded."remarks",
+        acc_date = excluded."acc_date",
+        make_staff = excluded."make_staff",
+        make_time = excluded."make_time",
+        own_cp_id = excluded."own_cp_id",
+        ctr_cp_id = excluded."ctr_cp_id",
+        </trim>
+    </insert>
+</mapper>

+ 245 - 0
src/main/java/com/dk/finance/model/pojo/fia/AssetClear.java

@@ -0,0 +1,245 @@
+package com.dk.finance.model.pojo.fia;
+
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+
+import com.dk.common.infrastructure.annotaiton.OrderNumber;
+import com.dk.common.infrastructure.annotaiton.UUID;
+import com.dk.common.infrastructure.constant.Constant;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.vo.AnnexVO;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+    import java.math.BigDecimal;
+    import java.time.LocalDate;
+    import java.time.LocalDateTime;
+
+/**
+ * @desc   : 资产清理单表持久化对象
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName(value = "t_fia_asset_clear", autoResultMap = true, schema = "dkscu_b")
+public class AssetClear implements Serializable {
+
+    /**
+     * 资产清理单ID
+     */
+    @UUID
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String docId;
+
+    /**
+     * 资产清理单单号
+     */
+    @OrderNumber(docType = Constant.Doc.FIA_ASSET_CLEAR)
+    private String docNo;
+
+    /**
+     * 单据类型 (【系统单据dkscu_bs.t_doc】资产清理单)
+     */
+    private String kindCode;
+
+    /**
+     * 单据状态 (【系统数据dkscu_bs.t_data_kind】暂存、未审核、审核中、审拒绝、审通过、确定;确定:更新固定资产表)
+     */
+    private String statusInvoice;
+
+    /**
+     * 流程状态 (【系统数据dkscu_bs.t_data_kind】未生效(审拒绝前)、已生效(确定)、冲正(确定))
+     */
+    private String statusFlow;
+
+    /**
+     * 经手部门
+     */
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String orgId;
+
+    /**
+     * 经手人
+     */
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String staffId;
+
+    /**
+     * 摘要
+     */
+    private String summary;
+
+    /**
+     * 收款状态 (【系统数据dkscu_bs.t_data_kind】未收款、部分收款、已收款)
+     */
+    private String statusReceipt;
+
+    /**
+     * 收款账户
+     */
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String macId;
+
+    /**
+     * 本单收款金额
+     */
+    private BigDecimal sumAmtCash;
+
+    /**
+     * 手续费
+     */
+    private BigDecimal sumAmtCharge;
+
+    /**
+     * 合计收款金额
+     */
+    private BigDecimal sumAmtTotalCash;
+
+    /**
+     * 清理应收
+     */
+    private BigDecimal sumAmtShould;
+
+    /**
+     * 账务对象类型 (dkscu_bs.t_obj_type.type_id)
+     */
+    private Integer objType;
+
+    /**
+     * 往来对象 (dkscu_b.t_mst_obj.obj_id)
+     */
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String objId;
+
+    /**
+     * 到期日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate dueDate;
+
+    /**
+     * 打印次数 (票据打印的次数,默认为0次)
+     */
+    private Integer printTimes;
+
+    /**
+     * 冲正类型 (1:原单;2:冲单)
+     */
+    private Integer reversedType;
+
+    /**
+     * 冲正单ID (记录了原单或冲单的Id)
+     */
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String reversedId;
+
+    /**
+     * 冲正单单号 (记录了原单或冲单的单号)
+     */
+    private String reversedNo;
+
+    /**
+     * 审批提交ID
+     */
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String apvSubmitId;
+
+    /**
+     * 当前审批人
+     */
+    @TableField(typeHandler = UuidListTypeHandler.class)
+    private List<String> apvStaffIds;
+
+    /**
+     * 审批时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime apvResultTime;
+
+    /**
+     * 收款附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)
+     */
+    @TableField(typeHandler = JsonTypeHandler.class)
+    private List<AnnexVO> annexPaths;
+
+    /**
+     * 其他附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)
+     */
+    @TableField(typeHandler = JsonTypeHandler.class)
+    private JSONObject otherAnnexPaths;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 账务日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate accDate;
+
+    /**
+     * 制单员
+     */
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String makeStaff;
+
+    /**
+     * 建档时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime makeTime;
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    private Boolean flgValid;
+
+    /**
+     * 财务主体企业ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    private Integer ownCpId;
+
+    /**
+     * 总公司ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    private Integer ctrCpId;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opCreateTime;
+
+    /**
+     * 修改时间 (触发器自动处理)
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opUpdateTime;
+
+    /**
+     * 修改用户 (触发器自动处理)
+     */
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String opUpdateStaffId;
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 134 - 0
src/main/java/com/dk/finance/model/pojo/fia/AssetClearItem.java

@@ -0,0 +1,134 @@
+package com.dk.finance.model.pojo.fia;
+
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+
+import com.dk.common.infrastructure.annotaiton.UUID;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.vo.AnnexVO;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+    import java.math.BigDecimal;
+    import java.time.LocalDate;
+    import java.time.LocalDateTime;
+
+/**
+ * @desc   : 资产清理单明细表持久化对象
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName(value = "t_fia_asset_clear_item", autoResultMap = true, schema = "dkscu_b")
+public class AssetClearItem implements Serializable {
+
+    /**
+     * 明细ID
+     */
+    @UUID
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String itemId;
+
+    /**
+     * 资产清理单ID
+     */
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String docId;
+
+    /**
+     * 固定资产ID (t_fia_asset.doc_id)
+     */
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String assetId;
+
+    /**
+     * 净值
+     */
+    private BigDecimal amtNetWorth;
+
+    /**
+     * 清理收入
+     */
+    private BigDecimal amtShould;
+
+    /**
+     * 清理损益金额
+     */
+    private BigDecimal amtClear;
+
+    /**
+     * 清理损益科目
+     */
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String clearSubjectId;
+
+    /**
+     * 原单ID (冲正时记录)
+     */
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String sourceId;
+
+    /**
+     * 原单明细ID (冲正时记录)
+     */
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String sourceItemId;
+
+    /**
+     * 显示顺序
+     */
+    private Integer displayNo;
+
+    /**
+     * 备注
+     */
+    private String remarks;
+
+    /**
+     * 有效标识 (1:正常 0:停用)
+     */
+    private Boolean flgValid;
+
+    /**
+     * 财务主体企业ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    private Integer ownCpId;
+
+    /**
+     * 总公司ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    private Integer ctrCpId;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opCreateTime;
+
+    /**
+     * 修改时间 (触发器自动处理)
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime opUpdateTime;
+
+    /**
+     * 修改用户 (触发器自动处理)
+     */
+    @TableField(typeHandler = UuidTypeHandler.class)
+    private String opUpdateStaffId;
+
+    private static final long serialVersionUID = 1L;
+
+}

+ 116 - 0
src/main/java/com/dk/finance/model/query/fia/AssetClearItemQuery.java

@@ -0,0 +1,116 @@
+package com.dk.finance.model.query.fia;
+
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.dk.common.model.vo.AnnexVO;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * @desc   : 资产清理单明细查询参数实体
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ApiModel(value="资产清理单明细查询参数实体", description="资产清理单明细查询参数实体")
+public class AssetClearItemQuery extends PageInfo<AssetClearItemQuery> implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    // region **************************************** 数据库字段映射属性 ****************************************
+
+    @ApiModelProperty(value = "明细ID")
+    private String itemId;
+
+    @ApiModelProperty(value = "资产清理单ID")
+    private String docId;
+
+    @ApiModelProperty(value = "固定资产ID (t_fia_asset.doc_id)")
+    private String assetId;
+
+    @ApiModelProperty(value = "净值")
+    private BigDecimal amtNetWorth;
+
+    @ApiModelProperty(value = "清理收入")
+    private BigDecimal amtShould;
+
+    @ApiModelProperty(value = "清理损益金额")
+    private BigDecimal amtClear;
+
+    @ApiModelProperty(value = "清理损益科目")
+    private String clearSubjectId;
+
+    @ApiModelProperty(value = "原单ID (冲正时记录)")
+    private String sourceId;
+
+    @ApiModelProperty(value = "原单明细ID (冲正时记录)")
+    private String sourceItemId;
+
+    @ApiModelProperty(value = "显示顺序")
+    private Integer displayNo;
+
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+    @ApiModelProperty(value = "财务主体企业ID")
+    private Integer ownCpId;
+
+    @ApiModelProperty(value = "总公司ID")
+    private Integer ctrCpId;
+
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    private String opUpdateStaffId;
+
+    // endregion
+
+    // region **************************************** 自动生成其他属性 ****************************************
+    
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用) - 集合")
+    private List<Boolean> flgValidList;
+    
+    @ApiModelProperty(value = "财务主体企业ID - 集合")
+    private List<Integer> ownCpIdList;
+    
+    @ApiModelProperty(value = "创建时间 - 起始")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime opCreateTimeStart;
+
+    @ApiModelProperty(value = "创建时间 - 截止")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime opCreateTimeEnd;
+    
+    @ApiModelProperty(value = "修改时间 (触发器自动处理) - 起始")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime opUpdateTimeStart;
+
+    @ApiModelProperty(value = "修改时间 (触发器自动处理) - 截止")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime opUpdateTimeEnd;
+    
+    // endregion
+
+    // region **************************************** 手动增加其他属性 ****************************************
+
+    // endregion
+}

+ 193 - 0
src/main/java/com/dk/finance/model/query/fia/AssetClearQuery.java

@@ -0,0 +1,193 @@
+package com.dk.finance.model.query.fia;
+
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.dk.common.model.vo.AnnexVO;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * @desc   : 资产清理单查询参数实体
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@ApiModel(value="资产清理单查询参数实体", description="资产清理单查询参数实体")
+public class AssetClearQuery extends PageInfo<AssetClearQuery> implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    // region **************************************** 数据库字段映射属性 ****************************************
+
+    @ApiModelProperty(value = "资产清理单ID")
+    private String docId;
+
+    @ApiModelProperty(value = "资产清理单单号")
+    private String docNo;
+
+    @ApiModelProperty(value = "单据类型 (【系统单据dkscu_bs.t_doc】资产清理单)")
+    private String kindCode;
+
+    @ApiModelProperty(value = "单据状态 (【系统数据dkscu_bs.t_data_kind】暂存、未审核、审核中、审拒绝、审通过、确定;确定:更新固定资产表)")
+    private String statusInvoice;
+
+    @ApiModelProperty(value = "流程状态 (【系统数据dkscu_bs.t_data_kind】未生效(审拒绝前)、已生效(确定)、冲正(确定))")
+    private String statusFlow;
+
+    @ApiModelProperty(value = "经手部门")
+    private String orgId;
+
+    @ApiModelProperty(value = "经手人")
+    private String staffId;
+
+    @ApiModelProperty(value = "摘要")
+    private String summary;
+
+    @ApiModelProperty(value = "收款状态 (【系统数据dkscu_bs.t_data_kind】未收款、部分收款、已收款)")
+    private String statusReceipt;
+
+    @ApiModelProperty(value = "收款账户")
+    private String macId;
+
+    @ApiModelProperty(value = "本单收款金额")
+    private BigDecimal sumAmtCash;
+
+    @ApiModelProperty(value = "手续费")
+    private BigDecimal sumAmtCharge;
+
+    @ApiModelProperty(value = "合计收款金额")
+    private BigDecimal sumAmtTotalCash;
+
+    @ApiModelProperty(value = "清理应收")
+    private BigDecimal sumAmtShould;
+
+    @ApiModelProperty(value = "账务对象类型 (dkscu_bs.t_obj_type.type_id)")
+    private Integer objType;
+
+    @ApiModelProperty(value = "往来对象 (dkscu_b.t_mst_obj.obj_id)")
+    private String objId;
+
+    @ApiModelProperty(value = "打印次数 (票据打印的次数,默认为0次)")
+    private Integer printTimes;
+
+    @ApiModelProperty(value = "冲正类型 (1:原单;2:冲单)")
+    private Integer reversedType;
+
+    @ApiModelProperty(value = "冲正单ID (记录了原单或冲单的Id)")
+    private String reversedId;
+
+    @ApiModelProperty(value = "冲正单单号 (记录了原单或冲单的单号)")
+    private String reversedNo;
+
+    @ApiModelProperty(value = "审批提交ID")
+    private String apvSubmitId;
+
+    @ApiModelProperty(value = "当前审批人")
+    private List<String> apvStaffIds;
+
+    @ApiModelProperty(value = "收款附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    private List<AnnexVO> annexPaths;
+
+    @ApiModelProperty(value = "其他附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    private JSONObject otherAnnexPaths;
+
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+    @ApiModelProperty(value = "制单员")
+    private String makeStaff;
+
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+    @ApiModelProperty(value = "财务主体企业ID")
+    private Integer ownCpId;
+
+    @ApiModelProperty(value = "总公司ID")
+    private Integer ctrCpId;
+
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    private String opUpdateStaffId;
+
+    // endregion
+
+    // region **************************************** 自动生成其他属性 ****************************************
+    
+    @ApiModelProperty(value = "到期日期 - 起始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate dueDateStart;
+
+    @ApiModelProperty(value = "到期日期 - 截止")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate dueDateEnd;
+    
+    @ApiModelProperty(value = "审批时间 - 起始")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime apvResultTimeStart;
+
+    @ApiModelProperty(value = "审批时间 - 截止")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime apvResultTimeEnd;
+    
+    @ApiModelProperty(value = "账务日期 - 起始")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate accDateStart;
+
+    @ApiModelProperty(value = "账务日期 - 截止")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate accDateEnd;
+    
+    @ApiModelProperty(value = "建档时间 - 起始")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime makeTimeStart;
+
+    @ApiModelProperty(value = "建档时间 - 截止")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime makeTimeEnd;
+    
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用) - 集合")
+    private List<Boolean> flgValidList;
+    
+    @ApiModelProperty(value = "财务主体企业ID - 集合")
+    private List<Integer> ownCpIdList;
+    
+    @ApiModelProperty(value = "创建时间 - 起始")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime opCreateTimeStart;
+
+    @ApiModelProperty(value = "创建时间 - 截止")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime opCreateTimeEnd;
+    
+    @ApiModelProperty(value = "修改时间 (触发器自动处理) - 起始")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime opUpdateTimeStart;
+
+    @ApiModelProperty(value = "修改时间 (触发器自动处理) - 截止")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime opUpdateTimeEnd;
+    
+    // endregion
+
+    // region **************************************** 手动增加其他属性 ****************************************
+
+    // endregion
+}

+ 144 - 0
src/main/java/com/dk/finance/model/response/fia/AssetClearItemResponse.java

@@ -0,0 +1,144 @@
+package com.dk.finance.model.response.fia;
+
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.dk.common.model.vo.AnnexVO;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * @desc   : 资产清理单明细响应实体
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@ApiModel(value="资产清理单明细响应实体", description="资产清理单明细响应实体")
+public class AssetClearItemResponse implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    // region **************************************** 数据库字段映射属性 ****************************************
+
+    @ApiModelProperty(value = "明细ID")
+    private String itemId;
+
+    @ApiModelProperty(value = "资产清理单ID")
+    private String docId;
+
+    @ApiModelProperty(value = "固定资产ID (t_fia_asset.doc_id)")
+    private String assetId;
+
+    @ApiModelProperty(value = "净值")
+    private BigDecimal amtNetWorth;
+
+    @ApiModelProperty(value = "清理收入")
+    private BigDecimal amtShould;
+
+    @ApiModelProperty(value = "清理损益金额")
+    private BigDecimal amtClear;
+
+    @ApiModelProperty(value = "清理损益科目")
+    private String clearSubjectId;
+
+    @ApiModelProperty(value = "原单ID (冲正时记录)")
+    private String sourceId;
+
+    @ApiModelProperty(value = "原单明细ID (冲正时记录)")
+    private String sourceItemId;
+
+    @ApiModelProperty(value = "显示顺序")
+    private Integer displayNo;
+
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+    @ApiModelProperty(value = "财务主体企业ID")
+    private Integer ownCpId;
+
+    @ApiModelProperty(value = "总公司ID")
+    private Integer ctrCpId;
+
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime opCreateTime;
+
+    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime opUpdateTime;
+
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    private String opUpdateStaffId;
+
+    // endregion
+
+    // region **************************************** 自动生成其他属性 ****************************************
+    
+    @ApiModelProperty(value = "修改者名称")
+    private String opUpdateStaffName;
+    
+    // endregion
+
+    // region **************************************** 手动增加其他属性 ****************************************
+
+    @ApiModelProperty(value = "资产编码")
+    private String assetNo;
+
+    @ApiModelProperty(value = "资产名称")
+    private String assetName;
+
+    @ApiModelProperty(value = "资产类别")
+    private String typeName;
+
+    @ApiModelProperty(value = "资产原值")
+    private String sumAmtAsset;
+
+    @ApiModelProperty(value = "累计折旧")
+    private String sumAmtHappenCalc;
+
+    @ApiModelProperty(value = "减值准备")
+    private String sumAmtLoss;
+
+    @ApiModelProperty(value = "资产净额")
+    private String sumAmtNetWorth;
+
+    @ApiModelProperty(value = "清理损益科目")
+    private String clearSubjectName;
+
+    @ApiModelProperty(value = "税率")
+    private BigDecimal taxRate;
+
+    @ApiModelProperty(value = "税额")
+    private BigDecimal sumAmtTax;
+
+    @ApiModelProperty(value = "已折旧期数")
+    private Integer happenCalcNo;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDateTime assetMakeTime;
+
+    @ApiModelProperty(value = "开始计提月份 (日期取1号)")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate accCalcBegin;
+    // endregion
+}

+ 193 - 0
src/main/java/com/dk/finance/model/response/fia/AssetClearResponse.java

@@ -0,0 +1,193 @@
+package com.dk.finance.model.response.fia;
+
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.dk.common.model.vo.AnnexVO;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * @desc   : 资产清理单响应实体
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@ApiModel(value="资产清理单响应实体", description="资产清理单响应实体")
+public class AssetClearResponse implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    // region **************************************** 数据库字段映射属性 ****************************************
+
+    @ApiModelProperty(value = "资产清理单ID")
+    private String docId;
+
+    @ApiModelProperty(value = "资产清理单单号")
+    private String docNo;
+
+    @ApiModelProperty(value = "单据类型 (【系统单据dkscu_bs.t_doc】资产清理单)")
+    private String kindCode;
+
+    @ApiModelProperty(value = "单据状态 (【系统数据dkscu_bs.t_data_kind】暂存、未审核、审核中、审拒绝、审通过、确定;确定:更新固定资产表)")
+    private String statusInvoice;
+
+    @ApiModelProperty(value = "流程状态 (【系统数据dkscu_bs.t_data_kind】未生效(审拒绝前)、已生效(确定)、冲正(确定))")
+    private String statusFlow;
+
+    @ApiModelProperty(value = "经手部门")
+    private String orgId;
+
+    @ApiModelProperty(value = "经手人")
+    private String staffId;
+
+    @ApiModelProperty(value = "摘要")
+    private String summary;
+
+    @ApiModelProperty(value = "收款状态 (【系统数据dkscu_bs.t_data_kind】未收款、部分收款、已收款)")
+    private String statusReceipt;
+
+    @ApiModelProperty(value = "收款账户")
+    private String macId;
+
+    @ApiModelProperty(value = "本单收款金额")
+    private BigDecimal sumAmtCash;
+
+    @ApiModelProperty(value = "手续费")
+    private BigDecimal sumAmtCharge;
+
+    @ApiModelProperty(value = "合计收款金额")
+    private BigDecimal sumAmtTotalCash;
+
+    @ApiModelProperty(value = "清理应收")
+    private BigDecimal sumAmtShould;
+
+    @ApiModelProperty(value = "账务对象类型 (dkscu_bs.t_obj_type.type_id)")
+    private Integer objType;
+
+    @ApiModelProperty(value = "往来对象 (dkscu_b.t_mst_obj.obj_id)")
+    private String objId;
+
+    @ApiModelProperty(value = "到期日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate dueDate;
+
+    @ApiModelProperty(value = "打印次数 (票据打印的次数,默认为0次)")
+    private Integer printTimes;
+
+    @ApiModelProperty(value = "冲正类型 (1:原单;2:冲单)")
+    private Integer reversedType;
+
+    @ApiModelProperty(value = "冲正单ID (记录了原单或冲单的Id)")
+    private String reversedId;
+
+    @ApiModelProperty(value = "冲正单单号 (记录了原单或冲单的单号)")
+    private String reversedNo;
+
+    @ApiModelProperty(value = "审批提交ID")
+    private String apvSubmitId;
+
+    @ApiModelProperty(value = "当前审批人")
+    private List<String> apvStaffIds;
+
+    @ApiModelProperty(value = "审批时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime apvResultTime;
+
+    @ApiModelProperty(value = "收款附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    private List<AnnexVO> annexPaths;
+
+    @ApiModelProperty(value = "其他附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    private JSONObject otherAnnexPaths;
+
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+    @ApiModelProperty(value = "账务日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate accDate;
+
+    @ApiModelProperty(value = "制单员")
+    private String makeStaff;
+
+    @ApiModelProperty(value = "建档时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime makeTime;
+
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+    @ApiModelProperty(value = "财务主体企业ID")
+    private Integer ownCpId;
+
+    @ApiModelProperty(value = "总公司ID")
+    private Integer ctrCpId;
+
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime opCreateTime;
+
+    @ApiModelProperty(value = "修改时间 (触发器自动处理)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime opUpdateTime;
+
+    @ApiModelProperty(value = "修改用户 (触发器自动处理)")
+    private String opUpdateStaffId;
+
+    // endregion
+
+    // region **************************************** 自动生成其他属性 ****************************************
+    
+    @ApiModelProperty(value = "修改者名称")
+    private String opUpdateStaffName;
+    
+    // endregion
+
+    // region **************************************** 手动增加其他属性 ****************************************
+    @ApiModelProperty(value = "单据状态")
+    private String statusInvoiceName;
+
+    @ApiModelProperty(value = "流程状态")
+    private String statusFlowName;
+
+    @ApiModelProperty(value = "收款状态")
+    private String statusReceiptName;
+
+    @ApiModelProperty(value = "部门")
+    private String orgName;
+
+    @ApiModelProperty(value = "业务员")
+    private String staffName;
+
+    @ApiModelProperty(value = "制单人")
+    private String makeStaffName;
+
+    @ApiModelProperty(value = "付款账户")
+    private String macName;
+
+    @ApiModelProperty(value = "未收金额")
+    private BigDecimal unRecAmt;
+
+    @ApiModelProperty(value = "对象名称")
+    private String objName;
+
+    @ApiModelProperty(value = "清理明细")
+    List<AssetClearItemResponse> clearItem;
+    // endregion
+}

+ 92 - 0
src/main/java/com/dk/finance/model/vo/fia/AssetClearItemVO.java

@@ -0,0 +1,92 @@
+package com.dk.finance.model.vo.fia;
+
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.dk.common.model.vo.AnnexVO;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+import javax.validation.constraints.NotNull;
+
+import java.util.List;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * @desc   : 资产清理单明细保存参数实体
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@ApiModel(value="资产清理单明细保存参数实体", description="资产清理单明细保存参数实体")
+public class AssetClearItemVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    // region **************************************** 数据库字段映射属性 ****************************************
+
+    @ApiModelProperty(value = "明细ID")
+    private String itemId;
+
+    @ApiModelProperty(value = "资产清理单ID")
+    private String docId;
+
+    @ApiModelProperty(value = "固定资产ID (t_fia_asset.doc_id)")
+    @NotNull(message = "固定资产ID (t_fia_asset.doc_id)不能为空")
+    private String assetId;
+
+    @ApiModelProperty(value = "净值")
+    private BigDecimal amtNetWorth;
+
+    @ApiModelProperty(value = "清理收入")
+    private BigDecimal amtShould;
+
+    @ApiModelProperty(value = "清理损益金额")
+    private BigDecimal amtClear;
+
+    @ApiModelProperty(value = "清理损益科目")
+    private String clearSubjectId;
+
+    @ApiModelProperty(value = "原单ID (冲正时记录)")
+    private String sourceId;
+
+    @ApiModelProperty(value = "原单明细ID (冲正时记录)")
+    private String sourceItemId;
+
+    @ApiModelProperty(value = "显示顺序")
+    private Integer displayNo;
+
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+    @ApiModelProperty(value = "财务主体企业ID")
+    private Integer ownCpId;
+
+    @ApiModelProperty(value = "总公司ID")
+    private Integer ctrCpId;
+
+    // endregion
+
+    // region **************************************** 自动生成其他属性 ****************************************
+    
+    // endregion
+
+    // region **************************************** 手动增加其他属性 ****************************************
+
+    // endregion
+}

+ 173 - 0
src/main/java/com/dk/finance/model/vo/fia/AssetClearVO.java

@@ -0,0 +1,173 @@
+package com.dk.finance.model.vo.fia;
+
+import com.baomidou.mybatisplus.annotation.*;
+import java.io.Serializable;
+import com.dk.common.infrastructure.handler.*;
+import com.dk.common.model.pojo.PageInfo;
+import com.dk.common.model.vo.AnnexVO;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.alibaba.fastjson.JSONObject;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+
+import java.util.List;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * @desc   : 资产清理单保存参数实体
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@ApiModel(value="资产清理单保存参数实体", description="资产清理单保存参数实体")
+public class AssetClearVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    // region **************************************** 数据库字段映射属性 ****************************************
+
+    @ApiModelProperty(value = "资产清理单ID")
+    private String docId;
+
+    @ApiModelProperty(value = "资产清理单单号")
+    private String docNo;
+
+    @ApiModelProperty(value = "单据类型 (【系统单据dkscu_bs.t_doc】资产清理单)")
+    private String kindCode;
+
+    @ApiModelProperty(value = "单据状态 (【系统数据dkscu_bs.t_data_kind】暂存、未审核、审核中、审拒绝、审通过、确定;确定:更新固定资产表)")
+    private String statusInvoice;
+
+    @ApiModelProperty(value = "流程状态 (【系统数据dkscu_bs.t_data_kind】未生效(审拒绝前)、已生效(确定)、冲正(确定))")
+    private String statusFlow;
+
+    @ApiModelProperty(value = "经手部门")
+    @NotNull(message = "经手部门不能为空")
+    private String orgId;
+
+    @ApiModelProperty(value = "经手人")
+    @NotNull(message = "经手人不能为空")
+    private String staffId;
+
+    @ApiModelProperty(value = "摘要")
+    private String summary;
+
+    @ApiModelProperty(value = "收款状态 (【系统数据dkscu_bs.t_data_kind】未收款、部分收款、已收款)")
+    private String statusReceipt;
+
+    @ApiModelProperty(value = "收款账户")
+    private String macId;
+
+    @ApiModelProperty(value = "本单收款金额")
+    private BigDecimal sumAmtCash;
+
+    @ApiModelProperty(value = "手续费")
+    private BigDecimal sumAmtCharge;
+
+    @ApiModelProperty(value = "合计收款金额")
+    private BigDecimal sumAmtTotalCash;
+
+    @ApiModelProperty(value = "清理应收")
+    private BigDecimal sumAmtShould;
+
+    @ApiModelProperty(value = "账务对象类型 (dkscu_bs.t_obj_type.type_id)")
+    private Integer objType;
+
+    @ApiModelProperty(value = "往来对象 (dkscu_b.t_mst_obj.obj_id)")
+    private String objId;
+
+    @ApiModelProperty(value = "到期日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate dueDate;
+
+    @ApiModelProperty(value = "打印次数 (票据打印的次数,默认为0次)")
+    private Integer printTimes;
+
+    @ApiModelProperty(value = "冲正类型 (1:原单;2:冲单)")
+    private Integer reversedType;
+
+    @ApiModelProperty(value = "冲正单ID (记录了原单或冲单的Id)")
+    private String reversedId;
+
+    @ApiModelProperty(value = "冲正单单号 (记录了原单或冲单的单号)")
+    private String reversedNo;
+
+    @ApiModelProperty(value = "审批提交ID")
+    private String apvSubmitId;
+
+    @ApiModelProperty(value = "当前审批人")
+    private List<String> apvStaffIds;
+
+    @ApiModelProperty(value = "审批时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime apvResultTime;
+
+    @ApiModelProperty(value = "收款附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    private List<AnnexVO> annexPaths;
+
+    @ApiModelProperty(value = "其他附件 (index(显示顺序)、name(文件名)、path(路径)、type(类型)、time(上传时间)...)")
+    private JSONObject otherAnnexPaths;
+
+    @ApiModelProperty(value = "备注")
+    private String remarks;
+
+    @ApiModelProperty(value = "账务日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private LocalDate accDate;
+
+    @ApiModelProperty(value = "制单员")
+    @NotNull(message = "制单员不能为空")
+    private String makeStaff;
+
+    @ApiModelProperty(value = "建档时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime makeTime;
+
+    @ApiModelProperty(value = "有效标识 (1:正常 0:停用)")
+    private Boolean flgValid;
+
+    @ApiModelProperty(value = "财务主体企业ID")
+    private Integer ownCpId;
+
+    @ApiModelProperty(value = "总公司ID")
+    private Integer ctrCpId;
+
+    // endregion
+
+    // region **************************************** 自动生成其他属性 ****************************************
+    
+    // endregion
+
+    // region **************************************** 手动增加其他属性 ****************************************
+    @ApiModelProperty(value = "暂存标识")
+    private Boolean stagingFlag;
+
+    @ApiModelProperty(value = "审批结果")
+    private Boolean apvResult;
+
+    @ApiModelProperty(value = "审批意见")
+    private String apvRemarks;
+
+    @Valid
+    @ApiModelProperty(value = "清理明细")
+    @NotEmpty(message = "清理明细不能为空")
+    private List<AssetClearItemVO> clearItem;
+
+    @ApiModelProperty(value = "删除的清理明细")
+    private List<AssetClearItemVO> delClearItem;
+    // endregion
+}

+ 86 - 0
src/main/java/com/dk/finance/service/fia/AssetClearItemService.java

@@ -0,0 +1,86 @@
+package com.dk.finance.service.fia;
+
+import com.dk.finance.model.pojo.fia.AssetClearItem;
+import com.dk.finance.mapper.fia.AssetClearItemMapper;
+import com.dk.finance.model.query.fia.AssetClearItemQuery;
+import com.dk.finance.model.vo.fia.AssetClearItemVO;
+import com.dk.finance.model.response.fia.AssetClearItemResponse;
+import com.dk.finance.infrastructure.convert.fia.AssetClearItemConvert;
+import com.dk.common.service.BaseService;
+import com.dk.common.mapper.BaseMapper;
+import com.dk.common.infrastructure.annotaiton.Pagination;
+import com.dk.common.model.pojo.PageList;
+import com.dk.common.response.ResponseResultVO;
+import com.dk.common.response.ResponseResultUtil;
+import org.springframework.stereotype.Service;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * @desc   : 资产清理单明细业务逻辑层
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Service
+public class AssetClearItemService extends BaseService<AssetClearItem> {
+
+	@Override
+	public String getPrimaryKey() {
+		return "item_id";
+	}
+
+	@Override
+	public BaseMapper<AssetClearItem> getRepository() {
+		return assetClearItemMapper;
+	}
+
+	@Autowired
+	private AssetClearItemMapper assetClearItemMapper;
+
+	@Autowired
+	private AssetClearItemConvert assetClearItemConvert;
+
+
+	/**
+	 * @desc   : 分页、关联、条件查询资产清理单明细
+	 * @author : 常皓宁
+	 * @date   : 2025/05/26 15:41
+	 */
+	@Pagination
+	public ResponseResultVO<PageList<AssetClearItemResponse>> selectByCond(AssetClearItemQuery assetClearItemQuery) {
+		return super.mergeListWithCount(assetClearItemQuery, assetClearItemMapper.selectByCond(assetClearItemQuery), assetClearItemMapper.countByCond(assetClearItemQuery));
+	}
+	
+	/**
+	 * @desc   : 新建资产清理单明细
+	 * @author : 常皓宁
+	 * @date   : 2025/05/26 15:41
+	 */
+	@Transactional(rollbackFor = {Exception.class})
+	public ResponseResultVO<?> insert(AssetClearItemVO assetClearItemVO) {
+		AssetClearItem assetClearItem = assetClearItemConvert.assetClearItemVO2PO(assetClearItemVO);
+		assetClearItemMapper.insert(assetClearItem);
+		return ResponseResultUtil.success(assetClearItem);
+	}
+
+    /**
+ 	 * @desc   : 编辑资产清理单明细
+	 * @author : 常皓宁
+	 * @date   : 2025/05/26 15:41
+	 */
+	@Transactional(rollbackFor = {Exception.class})
+	public ResponseResultVO<?> update(AssetClearItemVO assetClearItemVO) {
+		AssetClearItem assetClearItem = assetClearItemConvert.assetClearItemVO2PO(assetClearItemVO);
+		return super.updateByUuid(assetClearItem);
+	}
+
+    /**
+	 * @desc   : 根据id查询资产清理单明细
+	 * @author : 常皓宁
+	 * @date   : 2025/05/26 15:41
+	 */
+	@Override
+	public ResponseResultVO selectById(String id) {
+		return ResponseResultUtil.success(assetClearItemMapper.selectById(id));
+	}
+}

+ 217 - 0
src/main/java/com/dk/finance/service/fia/AssetClearService.java

@@ -0,0 +1,217 @@
+package com.dk.finance.service.fia;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.dk.common.business.AccountFeeBusiness;
+import com.dk.common.exception.BaseBusinessException;
+import com.dk.common.infrastructure.constant.Constant;
+import com.dk.common.infrastructure.enums.ErrorCodeEnum;
+import com.dk.common.response.ResponseCodeEnum;
+import com.dk.finance.infrastructure.convert.fia.AssetClearItemConvert;
+import com.dk.finance.mapper.fia.AssetClearItemMapper;
+import com.dk.finance.model.pojo.fia.AssetChangeItem;
+import com.dk.finance.model.pojo.fia.AssetClear;
+import com.dk.finance.mapper.fia.AssetClearMapper;
+import com.dk.finance.model.pojo.fia.AssetClearItem;
+import com.dk.finance.model.query.fia.AssetClearItemQuery;
+import com.dk.finance.model.query.fia.AssetClearQuery;
+import com.dk.finance.model.response.fia.AssetClearItemResponse;
+import com.dk.finance.model.vo.fia.AssetClearVO;
+import com.dk.finance.model.response.fia.AssetClearResponse;
+import com.dk.finance.infrastructure.convert.fia.AssetClearConvert;
+import com.dk.common.service.BaseService;
+import com.dk.common.mapper.BaseMapper;
+import com.dk.common.infrastructure.annotaiton.Pagination;
+import com.dk.common.model.pojo.PageList;
+import com.dk.common.response.ResponseResultVO;
+import com.dk.common.response.ResponseResultUtil;
+import org.springframework.stereotype.Service;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * @desc   : 资产清理单业务逻辑层
+ * @author : 常皓宁
+ * @date   : 2025/05/26 15:41
+ */
+@Service
+public class AssetClearService extends BaseService<AssetClear> implements AccountFeeBusiness {
+
+	@Override
+	public String getPrimaryKey() {
+		return "doc_id";
+	}
+
+	@Override
+	public BaseMapper<AssetClear> getRepository() {
+		return assetClearMapper;
+	}
+
+	@Autowired
+	private AssetClearMapper assetClearMapper;
+
+	@Autowired
+	private AssetClearItemMapper assetClearItemMapper;
+
+	@Autowired
+	private AssetClearConvert assetClearConvert;
+
+	@Autowired
+	private AssetClearItemConvert assetClearItemConvert;
+
+
+	/**
+	 * @desc   : 分页、关联、条件查询资产清理单
+	 * @author : 常皓宁
+	 * @date   : 2025/05/26 15:41
+	 */
+	@Pagination
+	public ResponseResultVO<PageList<AssetClearResponse>> selectByCond(AssetClearQuery assetClearQuery) {
+		return super.mergeListWithCount(assetClearQuery, assetClearMapper.selectByCond(assetClearQuery), assetClearMapper.countByCond(assetClearQuery));
+	}
+	
+	/**
+	 * @desc   : 新建资产清理单
+	 * @author : 常皓宁
+	 * @date   : 2025/05/26 15:41
+	 */
+	@Transactional(rollbackFor = {Exception.class})
+	public ResponseResultVO<?> insert(AssetClearVO assetClearVO) {
+		//建档日期
+		assetClearVO.setMakeTime(LocalDateTime.now());
+		//单据类型
+		assetClearVO.setKindCode(Constant.Doc.FIA_ASSET_CLEAR.getName());
+		//判断收款状态
+		//如果本单收款 = 清理应收就是已收款
+		if(assetClearVO.getSumAmtCash().compareTo(assetClearVO.getSumAmtShould()) == 0){
+			assetClearVO.setStatusReceipt(Constant.StatusFlow.FEE_RECEIVE_DONE.getName());
+		}
+		//如果本单收款 = 0 未收款
+		else if(assetClearVO.getSumAmtCash().compareTo(BigDecimal.ZERO) == 0){
+			assetClearVO.setStatusReceipt(Constant.StatusFlow.FEE_RECEIVE_NOT.getName());
+		}
+		else {
+			assetClearVO.setStatusReceipt(Constant.StatusFlow.FEE_RECEIVE_PART.getName());
+		}
+		//实体转换
+		AssetClear assetClear = assetClearConvert.assetClearVO2PO(assetClearVO);
+		super.autoSetIdAndOrderNumber(assetClear, Constant.Doc.FIA_ASSET_CLEAR);
+		//暂存
+		if(assetClearVO.getStagingFlag()){
+			assetClear.setStatusInvoice(Constant.StatusInvoice.STAGING.getName());
+		}else{
+			assetClear.setStatusInvoice(Constant.StatusInvoice.APPROVAL_NOT.getName());
+		}
+		//流程状态
+		assetClear.setStatusFlow(Constant.StatusFlow.ACC_EFFECT_NOT.getName());
+		//本单收款
+		assetClearMapper.insert(assetClear);
+
+		assetClearVO.setDocId(assetClear.getDocId());
+		//新建明细
+		List<AssetClearItem> itemList = assetClearItemConvert.assetClearItemVOList2POList(assetClearVO.getClearItem(),assetClearVO.getDocId());
+		//todo 保存前校验?
+
+		assetClearItemMapper.saveBatch(itemList);
+
+		//todo 调用审批
+		List<AssetClearItem> assetClearItems = assetClearItemMapper.selectList(new QueryWrapper<AssetClearItem>().lambda()
+				.eq(AssetClearItem::getDocId, UUID.fromString(assetClear.getDocId())));
+
+		return ResponseResultUtil.success(assetClear);
+	}
+
+    /**
+ 	 * @desc   : 编辑资产清理单
+	 * @author : 常皓宁
+	 * @date   : 2025/05/26 15:41
+	 */
+	@Transactional(rollbackFor = {Exception.class})
+	public ResponseResultVO<?> update(AssetClearVO assetClearVO) {
+		AssetClear assetClear = assetClearConvert.assetClearVO2PO(assetClearVO);
+		return super.updateByUuid(assetClear);
+	}
+
+    /**
+	 * @desc   : 根据id查询资产清理单
+	 * @author : 常皓宁
+	 * @date   : 2025/05/26 15:41
+	 */
+	@Override
+	public ResponseResultVO selectById(String id) {
+		AssetClearResponse assetClearResponse = assetClearMapper.selectById(id);
+		//清理明细
+		AssetClearItemQuery assetClearItemQuery = new AssetClearItemQuery().setDocId(id).setFlgValid(true);
+		List<AssetClearItemResponse> assetClearItemResponses = assetClearItemMapper.selectByCond(assetClearItemQuery);
+		assetClearResponse.setClearItem(assetClearItemResponses);
+		return ResponseResultUtil.success(assetClearResponse);
+	}
+
+	/**
+	 * @desc   : 作废 只有暂存能作废
+	 * @author : 常皓宁
+	 * @date   : 2025/5/27 13:43
+	 */
+	@Transactional(rollbackFor = {Exception.class})
+	public ResponseResultVO<?> invalid(String id){
+		//锁表
+		AssetClear assetClear = Locked(id);
+		//明细
+		List<AssetClearItem> itemList = LockDetail(id);
+		//校验状态
+		if (!assetClear.getStatusInvoice().equals(Constant.StatusInvoice.STAGING.getName())) {
+			return ResponseResultUtil.error(ErrorCodeEnum.INVENTORY_ADJUST_STATUS_CHANGE);
+		}
+		//总单
+		assetClear.setFlgValid(false);
+		super.updateByUuid(assetClear);
+		for (AssetClearItem assetClearItem:itemList){
+			assetClearItem.setFlgValid(false);
+		}
+		assetClearItemMapper.saveBatch(itemList);
+
+		return ResponseResultUtil.success();
+	}
+
+	/**
+	 * @desc   : 撤回 只有未审核的可以,回到暂存
+	 * @author : 常皓宁
+	 * @date   : 2025/5/27 14:20
+	 */
+	@Transactional(rollbackFor = {Exception.class})
+	public ResponseResultVO<?> withdraw(String id){
+		//锁表
+		AssetClear assetClear = Locked(id);
+		List<AssetClearItem> itemList = LockDetail(id);
+		if (!Constant.StatusInvoice.APPROVAL_NOT.getName().equals(assetClear.getStatusInvoice())) {
+			throw new BaseBusinessException(ResponseCodeEnum.UPDATE_FAIL.getCode(), ErrorCodeEnum.CANNOT_PERFORM_THIS_MANEUVER.getMessage());
+		}
+		//修改总单
+		assetClear.setStatusInvoice(Constant.StatusInvoice.STAGING.getName());
+		super.updateByUuid(assetClear);
+		return ResponseResultUtil.success();
+	}
+
+	/**
+	 * @desc   : 总单锁表
+	 * @author : 常皓宁
+	 * @date   : 2025/5/27 13:56
+	 */
+	private AssetClear Locked(String id){
+		return assetClearMapper.selectByIdForUpdate(id);
+	}
+
+	/**
+	 * @desc   : 明细锁表
+	 * @author : 常皓宁
+	 * @date   : 2025/5/27 13:57
+	 */
+	private List<AssetClearItem> LockDetail(String id){
+		return assetClearItemMapper.selectItemsByDocIdForUpdate(id);
+	}
+
+}

+ 5 - 4
src/main/java/com/dk/finance/service/fnc/VoucherService.java

@@ -298,7 +298,7 @@ public class VoucherService extends BaseService<Voucher> {
      * @author : 孙超
      * @date : 2025/05/26 10:19
      */
-    public Voucher setVoucherAttribute(LocalDate accDate, String kindCode,Long maxVoucherNo,String voucherId) {
+    public Voucher setVoucherAttribute(LocalDate accDateStart, String kindCode,Long maxVoucherNo,String voucherId) {
         Voucher voucher = new Voucher();
         voucher.setVoucherNo(maxVoucherNo.toString());
         voucher.setVoucherId(voucherId);
@@ -308,7 +308,8 @@ public class VoucherService extends BaseService<Voucher> {
         voucher.setStatusVoucher(Constant.statusVoucher.DOCUMENT_PREPARATION.getValue());
         //账务月
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM");
-        voucher.setAccMonth(accDate.format(formatter));
+        voucher.setAccMonth(accDateStart.format(formatter));
+        voucher.setAccYear(String.valueOf(accDateStart.getYear()));
         //制单人
         voucher.setMakeStaffId(authUtils.getStaff().getStaffId());
         //业务类型
@@ -318,10 +319,10 @@ public class VoucherService extends BaseService<Voucher> {
         //现金流量标识 根据明细中是否有现金流量项目来判断
         voucher.setFlgCash(false);
         //凭证日期 如果制单时间和账务月再同一个月,那么制单时间就是凭证日期,如果跨月,那么放在账务月所在的月末
-        if (LocalDate.now().getYear() == accDate.getYear() && LocalDate.now().getMonthValue() == accDate.getMonthValue()) {
+        if (LocalDate.now().getYear() == accDateStart.getYear() && LocalDate.now().getMonthValue() == accDateStart.getMonthValue()) {
             voucher.setAccDate(LocalDate.now());
         } else {
-            voucher.setAccDate(accDate.with(TemporalAdjusters.lastDayOfMonth()));
+            voucher.setAccDate(accDateStart.with(TemporalAdjusters.lastDayOfMonth()));
         }
         //制单时间
         voucher.setMakeTime(LocalDateTime.now());