Merge #68 into master from cc_20260313_ws_wallet

网商钱包分账对接

* cc_20260313_ws_wallet: (9 commits squashed)

  - fix:新店开通网商钱包

  - fix:网商钱包开通回调修改

  - fix

  - fix

  - fix:关闭网商开通回调接口验签

  - Merge branch 'master' into cc_20260313_ws_wallet
    
    # Conflicts:
    #	coolstore-partner-service/src/main/java/com/cool/store/service/wallet/WalletService.java
    #	coolstore-partner-service/src/main/java/com/cool/store/service/wallet/impl/WalletServiceImpl.java
    #	coolstore-partner-web/src/main/java/com/cool/store/controller/webc/MiniWalletController.java

  - fix:钱包批量转账新增钱包类型字段

  - fix:网商钱包分账对接

  - fix

Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com>
Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>

CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/68
This commit is contained in:
王非凡
2026-03-23 09:00:24 +00:00
committed by 正新
parent 3b1e6f6cb9
commit 728bd0f8ef
20 changed files with 218 additions and 14 deletions

View File

@@ -6,6 +6,7 @@ import com.cool.store.mapper.fees.ShopAllocationInfoMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
import java.util.Objects;
@@ -60,4 +61,23 @@ public class ShopAllocationInfoDAO {
}
shopAllocationInfoMapper.insertOrUpdateBatch(list);
}
/**
* 更新分账状态
* @param shopId 门店id
* @param expenseTypes 费用类型列表
* @param status 状态
*/
public void updateStatusByShopId(Long shopId, List<String> expenseTypes, Integer status) {
if (CollectionUtils.isEmpty(expenseTypes)) {
return;
}
Example example = new Example(ShopAllocationInfoDO.class);
example.createCriteria()
.andEqualTo("shopId", shopId)
.andIn("expenseType", expenseTypes);
ShopAllocationInfoDO allocationInfoDO = new ShopAllocationInfoDO();
allocationInfoDO.setStatus(status);
shopAllocationInfoMapper.updateByExampleSelective(allocationInfoDO, example);
}
}

View File

@@ -125,4 +125,28 @@ public class WalletPayInfoDAO {
walletPayInfoDO.setClaimStatus(claimStatus);
walletPayInfoMapper.updateByExampleSelective(walletPayInfoDO, example);
}
/**
* 根据批次编号查询
* @param batchCode 批次编号
* @return 列表
*/
public List<WalletPayInfoDO> getByBatchCode(String batchCode) {
Example example = new Example(WalletPayInfoDO.class);
example.createCriteria().andEqualTo("batchCode", batchCode);
return walletPayInfoMapper.selectByExample(example);
}
/**
* 根据批次编号更新支付状态
* @param batchCode 批次编号
* @param payStatus 支付状态
*/
public void updatePayStatusByBatchCode(String batchCode, Integer payStatus) {
Example example = new Example(WalletPayInfoDO.class);
example.createCriteria().andEqualTo("batchCode", batchCode);
WalletPayInfoDO walletPayInfoDO = new WalletPayInfoDO();
walletPayInfoDO.setPayStatus(payStatus);
walletPayInfoMapper.updateByExampleSelective(walletPayInfoDO, example);
}
}

View File

@@ -56,4 +56,27 @@ public class WalletTradeDAO {
}
return walletTradeMapper.updateBatchByPayNo(list) > 0;
}
/**
* 查询支付中交易单批次号
* @param module 业务模块
* @param type 交易类型
* @return 批次号列表
*/
public List<String> getPayingOrderBatchCode(String module, Integer type) {
return walletTradeMapper.getPayingOrderBatchCode(module, type);
}
/**
* 根据批次号更新支付状态
* @param batchCode 批次号
* @param payStatus 支付状态
*/
public void updatePayStatusByBatchCode(String batchCode, Integer payStatus) {
Example example = new Example(WalletTradeDO.class);
example.createCriteria().andEqualTo("batchCode", batchCode);
WalletTradeDO walletTradeDO = new WalletTradeDO();
walletTradeDO.setPayStatus(payStatus);
walletTradeMapper.updateByExampleSelective(walletTradeDO, example);
}
}

View File

@@ -12,4 +12,12 @@ public interface WalletTradeMapper extends Mapper<WalletTradeDO> {
int updateByPayNo(WalletTradeDO record);
int updateBatchByPayNo(@Param("list") List<WalletTradeDO> list);
/**
* 查询支付中交易单批次号
* @param module 业务模块
* @param type 交易类型
* @return 批次号列表
*/
List<String> getPayingOrderBatchCode(@Param("module") String module, @Param("type") Integer type);
}

View File

@@ -18,13 +18,14 @@
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="batch_code" jdbcType="VARCHAR" property="batchCode" />
</resultMap>
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO zxjp_fees_wallet_pay_info (shop_id, module, pay_no, pay_user_name, pay_amount, trade_id, pay_status, pay_time, claim_status, expense_types, remark, create_user_id)
INSERT INTO zxjp_fees_wallet_pay_info (shop_id, module, pay_no, pay_user_name, pay_amount, trade_id, pay_status, pay_time, claim_status, expense_types, remark, create_user_id, batch_code)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.shopId}, #{item.module}, #{item.payNo}, #{item.payUserName}, #{item.payAmount}, #{item.tradeId}, #{item.payStatus}, #{item.payTime}, #{item.claimStatus}, #{item.expenseTypes}, #{item.remark}, #{item.createUserId})
(#{item.shopId}, #{item.module}, #{item.payNo}, #{item.payUserName}, #{item.payAmount}, #{item.tradeId}, #{item.payStatus}, #{item.payTime}, #{item.claimStatus}, #{item.expenseTypes}, #{item.remark}, #{item.createUserId}, #{item.batchCode})
</foreach>
</insert>

View File

@@ -17,14 +17,15 @@
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="batch_code" jdbcType="VARCHAR" property="batchCode" />
</resultMap>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO zxjp_wallet_trade (module, pay_no, trade_id, type, pay_user_name, pay_amount, pay_status, pay_time, remark, create_user_id)
INSERT INTO zxjp_wallet_trade (module, pay_no, trade_id, type, pay_user_name, pay_amount, pay_status, pay_time, remark, create_user_id, batch_code)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.module}, #{item.payNo}, #{item.tradeId}, #{item.type}, #{item.payUserName}, #{item.payAmount}, #{item.payStatus}, #{item.payTime}, #{item.remark}, #{item.createUserId})
(#{item.module}, #{item.payNo}, #{item.tradeId}, #{item.type}, #{item.payUserName}, #{item.payAmount}, #{item.payStatus}, #{item.payTime}, #{item.remark}, #{item.createUserId}, #{item.batchCode})
</foreach>
</insert>
@@ -63,4 +64,11 @@
WHERE pay_no = #{item.payNo}
</foreach>
</update>
<select id="getPayingOrderBatchCode" resultType="java.lang.String">
SELECT batch_code, pay_status
FROM zxjp_wallet_trade
WHERE pay_status = 3 AND module = #{module} AND type = #{type} AND batch_code IS NOT NULL
GROUP BY batch_code
</select>
</mapper>