mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update 财务中心 计算金额
This commit is contained in:
@@ -132,4 +132,6 @@ public interface AdapayMemberAccountMapper {
|
||||
* @return
|
||||
*/
|
||||
AdapayMemberAccount selectRecentInfoByMerchantId(String merchantId);
|
||||
}
|
||||
|
||||
List<String> selectUsedAdapayMemberIdByMerchantId(String merchantId);
|
||||
}
|
||||
|
||||
@@ -122,4 +122,6 @@ public interface AdapayMemberAccountService {
|
||||
* @return
|
||||
*/
|
||||
AdapayMemberAccount selectRecentInfoByMerchantId(String merchantId);
|
||||
|
||||
List<String> selectUsedAdapayMemberIdByMerchantId(String merchantId);
|
||||
}
|
||||
|
||||
@@ -273,5 +273,13 @@ public class AdapayMemberAccountServiceImpl implements AdapayMemberAccountServic
|
||||
public AdapayMemberAccount selectRecentInfoByMerchantId(String merchantId) {
|
||||
return adapayMemberAccountMapper.selectRecentInfoByMerchantId(merchantId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据运营商id 查询该运营商所有使用过的AdapayMemberId
|
||||
*/
|
||||
@Override
|
||||
public List<String> selectUsedAdapayMemberIdByMerchantId(String merchantId) {
|
||||
return adapayMemberAccountMapper.selectUsedAdapayMemberIdByMerchantId(merchantId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -187,6 +187,7 @@ public class OrderSplitRecordServiceImpl implements OrderSplitRecordService {
|
||||
}
|
||||
// 根据merchantId查询汇付账户信息
|
||||
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(merchantId);
|
||||
List<String> usedAdapayMemberIdList = adapayMemberAccountService.selectUsedAdapayMemberIdByMerchantId(merchantId);
|
||||
// 按天分组, 组装结果集 key 为 tradeDate, value 为该天的订单分账记录
|
||||
Map<String, List<OrderSplitRecord>> dailyRecordMap = orderSplitRecords.stream().collect(Collectors.groupingBy(OrderSplitRecord::getTradeDate));
|
||||
// 按天分组 key 为 tradeDate, value 为该天的订单分账记录
|
||||
@@ -216,7 +217,9 @@ public class OrderSplitRecordServiceImpl implements OrderSplitRecordService {
|
||||
orderCodeSet.remove(record.getOrderCode());
|
||||
}
|
||||
// 区分运营商自己分账的金额, 和他人的分账金额
|
||||
if (adapayMemberAccount != null && adapayMemberAccount.getAdapayMemberId().equals(record.getAdapayMemberId())) {
|
||||
// if (adapayMemberAccount != null && adapayMemberAccount.getAdapayMemberId().equals(record.getAdapayMemberId())) {
|
||||
// record.getAdapayMemberId() 存在usedAdapayMemberIdList
|
||||
if (CollectionUtils.isNotEmpty(usedAdapayMemberIdList) && usedAdapayMemberIdList.contains(record.getAdapayMemberId())) {
|
||||
totalMerchantSplitAmount = totalMerchantSplitAmount.add(record.getElectricitySplitAmount()).add(record.getServiceSplitAmount());
|
||||
} else {
|
||||
totalOtherSplitAmount = totalOtherSplitAmount.add(record.getElectricitySplitAmount()).add(record.getServiceSplitAmount());
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, `status`, merchant_id, adapay_member_id, settle_account_id, remark, create_time,
|
||||
id, `status`, merchant_id, adapay_member_id, settle_account_id, remark, create_time,
|
||||
create_by, update_time, update_by, del_flag
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<!--@mbg.generated-->
|
||||
select
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from adapay_member_account
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
@@ -35,13 +35,13 @@
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.AdapayMemberAccount" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into adapay_member_account (`status`, merchant_id, adapay_member_id,
|
||||
settle_account_id, remark, create_time,
|
||||
create_by, update_time, update_by,
|
||||
insert into adapay_member_account (`status`, merchant_id, adapay_member_id,
|
||||
settle_account_id, remark, create_time,
|
||||
create_by, update_time, update_by,
|
||||
del_flag)
|
||||
values (#{status,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{adapayMemberId,jdbcType=VARCHAR},
|
||||
#{settleAccountId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
|
||||
values (#{status,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{adapayMemberId,jdbcType=VARCHAR},
|
||||
#{settleAccountId,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
|
||||
#{delFlag,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.AdapayMemberAccount" useGeneratedKeys="true">
|
||||
@@ -227,13 +227,13 @@
|
||||
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
|
||||
<!--@mbg.generated-->
|
||||
insert into adapay_member_account
|
||||
(`status`, merchant_id, adapay_member_id, settle_account_id, remark, create_time,
|
||||
(`status`, merchant_id, adapay_member_id, settle_account_id, remark, create_time,
|
||||
create_by, update_time, update_by, del_flag)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.status,jdbcType=VARCHAR}, #{item.merchantId,jdbcType=VARCHAR}, #{item.adapayMemberId,jdbcType=VARCHAR},
|
||||
#{item.settleAccountId,jdbcType=VARCHAR}, #{item.remark,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
|
||||
#{item.createBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR},
|
||||
(#{item.status,jdbcType=VARCHAR}, #{item.merchantId,jdbcType=VARCHAR}, #{item.adapayMemberId,jdbcType=VARCHAR},
|
||||
#{item.settleAccountId,jdbcType=VARCHAR}, #{item.remark,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
|
||||
#{item.createBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR},
|
||||
#{item.delFlag,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -271,7 +271,7 @@
|
||||
#{updateBy,jdbcType=VARCHAR},
|
||||
#{delFlag,jdbcType=VARCHAR},
|
||||
</trim>
|
||||
on duplicate key update
|
||||
on duplicate key update
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id = #{id,jdbcType=INTEGER},
|
||||
@@ -362,7 +362,7 @@
|
||||
#{delFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
on duplicate key update
|
||||
on duplicate key update
|
||||
<trim suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id = #{id,jdbcType=INTEGER},
|
||||
@@ -544,4 +544,11 @@
|
||||
order by create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
<select id="selectUsedAdapayMemberIdByMerchantId" resultType="java.lang.String">
|
||||
select
|
||||
adapay_member_id
|
||||
from adapay_member_account
|
||||
where merchant_id = #{merchantId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user