update 取现成功支付回调

This commit is contained in:
2023-08-08 14:16:05 +08:00
parent 304ba6b2e1
commit ce92d1ccdf
6 changed files with 47 additions and 13 deletions

View File

@@ -123,6 +123,9 @@ public class OrderService {
@Autowired
private IAdapayMemberAccountService adapayMemberAccountService;
@Autowired
private ClearingWithdrawInfoService clearingWithdrawInfoService;
/**
* 生成订单
*
@@ -949,6 +952,8 @@ public class OrderService {
} else if (AdapayEventEnum.payment_reverse_succeeded.getValue().equals(type)) {
// 支付撤销成功
} else if (AdapayEventEnum.cash_succeeded.getValue().equals(type)) {
}
}
@@ -1066,4 +1071,16 @@ public class OrderService {
adapayMemberAccountService.updateAdapayMemberAccountByMemberId(adapayMemberAccount);
}
/**
* 取现成功
*/
private void cashSucceeded(String data) {
JSONObject jsonObject = JSON.parseObject(data);
String withdrawCode = jsonObject.getString("id");
// 通过取现id查询取现数据
ClearingWithdrawInfo clearingWithdrawInfo = clearingWithdrawInfoService.selectByWithdrawCode(withdrawCode);
clearingWithdrawInfo.setWithdrawStatus(Constants.ONE);
clearingWithdrawInfoService.insertOrUpdate(clearingWithdrawInfo);
}
}

View File

@@ -1,9 +1,10 @@
package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.ClearingWithdrawInfo;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ClearingWithdrawInfoMapper {
/**
* delete by primary key
@@ -54,4 +55,6 @@ public interface ClearingWithdrawInfoMapper {
int updateBatch(List<ClearingWithdrawInfo> list);
int batchInsert(@Param("list") List<ClearingWithdrawInfo> list);
ClearingWithdrawInfo selectByWithdrawCode(String withdrawCode);
}

View File

@@ -1,7 +1,8 @@
package com.jsowell.pile.service;
import java.util.List;
import com.jsowell.pile.domain.ClearingWithdrawInfo;
import java.util.List;
public interface ClearingWithdrawInfoService{
@@ -25,4 +26,5 @@ public interface ClearingWithdrawInfoService{
int batchInsert(List<ClearingWithdrawInfo> list);
ClearingWithdrawInfo selectByWithdrawCode(String withdrawCode);
}

View File

@@ -1,11 +1,12 @@
package com.jsowell.pile.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.jsowell.pile.mapper.ClearingWithdrawInfoMapper;
import java.util.List;
import com.jsowell.pile.domain.ClearingWithdrawInfo;
import com.jsowell.pile.mapper.ClearingWithdrawInfoMapper;
import com.jsowell.pile.service.ClearingWithdrawInfoService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class ClearingWithdrawInfoServiceImpl implements ClearingWithdrawInfoService{
@@ -62,4 +63,9 @@ public class ClearingWithdrawInfoServiceImpl implements ClearingWithdrawInfoServ
return clearingWithdrawInfoMapper.batchInsert(list);
}
@Override
public ClearingWithdrawInfo selectByWithdrawCode(String withdrawCode) {
return clearingWithdrawInfoMapper.selectByWithdrawCode(withdrawCode);
}
}

View File

@@ -983,6 +983,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
clearingBillInfo.setActualClearingAmount(actualClearingAmount);
clearingBillInfo.setCreateTime(DateUtils.getNowDate());
clearingBillInfo.setDelFlag(DelFlagEnum.NORMAL.getValue());
clearingBillInfo.setBillStatus("2");
// 保存清分账单
ClearingBillTransactionDTO dto = new ClearingBillTransactionDTO();

View File

@@ -230,13 +230,12 @@
<insert id="insertOrUpdate" parameterType="com.jsowell.pile.domain.ClearingWithdrawInfo">
<!--@mbg.generated-->
insert into clearing_withdraw_info
(id, withdraw_code, withdraw_status, application_time, arrival_time, create_by, create_time,
update_by, update_time, del_flag)
(id, withdraw_code, withdraw_status, application_time, arrival_time, create_by,
update_by, del_flag)
values
(#{id,jdbcType=INTEGER}, #{withdrawCode,jdbcType=VARCHAR}, #{withdrawStatus,jdbcType=VARCHAR},
#{applicationTime,jdbcType=TIMESTAMP}, #{arrivalTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=VARCHAR})
#{updateBy,jdbcType=VARCHAR}, #{delFlag,jdbcType=VARCHAR})
on duplicate key update
id = #{id,jdbcType=INTEGER},
withdraw_code = #{withdrawCode,jdbcType=VARCHAR},
@@ -244,9 +243,7 @@
application_time = #{applicationTime,jdbcType=TIMESTAMP},
arrival_time = #{arrivalTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
del_flag = #{delFlag,jdbcType=VARCHAR}
</insert>
<insert id="insertOrUpdateSelective" parameterType="com.jsowell.pile.domain.ClearingWithdrawInfo">
@@ -351,4 +348,12 @@
</if>
</trim>
</insert>
<select id="selectByWithdrawCode" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from clearing_withdraw_info
where del_flag = '0'
and withdraw_code = #{withdrawCode,jdbcType=VARCHAR}
</select>
</mapper>