Merge branch 'cc_20260415_trans'

This commit is contained in:
suzhuhong
2026-04-20 16:43:02 +08:00
23 changed files with 702 additions and 17 deletions

View File

@@ -17,6 +17,10 @@ public class PreAllocationRecordDAO {
return preAllocationRecordMapper.insertSelective(record) > 0;
}
public boolean updateByPrimaryKeySelective(PreAllocationRecordDO record) {
return preAllocationRecordMapper.updateByPrimaryKeySelective(record) > 0;
}
public PreAllocationRecordDO getById(Long id) {
return preAllocationRecordMapper.getById(id);
}
@@ -74,4 +78,21 @@ public class PreAllocationRecordDAO {
}
return preAllocationRecordMapper.deleteByIdsNotPaid(ids) > 0;
}
/**
* 软删除
*/
public boolean softDeleteById(Long id) {
return preAllocationRecordMapper.softDeleteById(id) > 0;
}
/**
* 批量软删除
*/
public boolean softDeleteByIds(List<Long> ids) {
if (ids == null || ids.isEmpty()) {
return false;
}
return preAllocationRecordMapper.softDeleteByIds(ids) > 0;
}
}

View File

@@ -67,6 +67,17 @@ public class WalletTradeDAO {
return walletTradeMapper.getPayingOrderBatchCode(module, type);
}
/**
* 查询支付中的 单次支付的数据 非批量
* @param module
* @param type
* @return
*/
public List<WalletTradeDO> getPayingOrder(String module, Integer type) {
return walletTradeMapper.getPayingOrder(module, type);
}
public List<WalletTradeDO> transferTradeList(String module, Integer type) {
return walletTradeMapper.transferTradeList(module, type);
}

View File

@@ -33,4 +33,14 @@ public interface PreAllocationRecordMapper extends Mapper<PreAllocationRecordDO>
int deleteByIdsNotPaid(@Param("ids") List<Long> ids);
Integer updateByPayNoList(@Param("payNoList") List<String> payNoList, @Param("status") Integer status);
/**
* 软删除
*/
int softDeleteById(@Param("id") Long id);
/**
* 批量软删除
*/
int softDeleteByIds(@Param("ids") List<Long> ids);
}

View File

@@ -21,5 +21,7 @@ public interface WalletTradeMapper extends Mapper<WalletTradeDO> {
*/
List<String> getPayingOrderBatchCode(@Param("module") String module, @Param("type") Integer type);
List<WalletTradeDO> getPayingOrder(@Param("module") String module, @Param("type") Integer type);
List<WalletTradeDO> transferTradeList(@Param("module") String module, @Param("type") Integer type);
}

View File

@@ -14,11 +14,17 @@
<result column="allocation_status" property="allocationStatus" jdbcType="INTEGER"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/>
<result column="deleted" property="deleted" jdbcType="TINYINT"/>
</resultMap>
<sql id="Base_Column_List">
id, order_id, shop_id, pay_no, expense_type, payee_name, payee_code,
pay_amount, allocation_status, create_time, update_time
pay_amount, allocation_status, create_time, update_time, remark, deleted
</sql>
<sql id="Not_Deleted_Condition">
deleted = 0
</sql>
<select id="getById" resultMap="BaseResultMap">
@@ -31,6 +37,7 @@
SELECT <include refid="Base_Column_List"/>
FROM zxjp_pre_allocation_record
WHERE order_id = #{orderId}
AND <include refid="Not_Deleted_Condition"/>
ORDER BY create_time DESC
</select>
@@ -38,6 +45,7 @@
SELECT <include refid="Base_Column_List"/>
FROM zxjp_pre_allocation_record
WHERE shop_id = #{shopId}
AND <include refid="Not_Deleted_Condition"/>
ORDER BY create_time DESC
</select>
@@ -45,14 +53,16 @@
SELECT <include refid="Base_Column_List"/>
FROM zxjp_pre_allocation_record
WHERE shop_id = #{shopId}
and expense_type = #{expenseType}
AND expense_type = #{expenseType}
ORDER BY create_time DESC
limit 1
</select>
<select id="queryPageByPayNo" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"/>
FROM zxjp_pre_allocation_record
WHERE pay_no = #{payNo}
AND <include refid="Not_Deleted_Condition"/>
ORDER BY create_time DESC
</select>
@@ -130,6 +140,23 @@
</foreach>
</delete>
<update id="softDeleteById">
UPDATE zxjp_pre_allocation_record
SET deleted = 1,
update_time = NOW()
WHERE id = #{id}
AND <include refid="Not_Deleted_Condition"/>
</update>
<update id="softDeleteByIds">
UPDATE zxjp_pre_allocation_record
SET deleted = 1,
update_time = NOW()
WHERE id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
AND <include refid="Not_Deleted_Condition"/>
</update>
</mapper>

View File

@@ -72,6 +72,12 @@
GROUP BY batch_code
</select>
<select id="getPayingOrder" resultMap="BaseResultMap">
SELECT *
FROM zxjp_wallet_trade
WHERE pay_status = 3 AND module = #{module} AND type = #{type} AND batch_code IS NULL
</select>
<select id="transferTradeList" resultMap="BaseResultMap">
SELECT *
FROM zxjp_wallet_trade