Authored by tanling

主动确认和回调控制并发

... ... @@ -30,6 +30,9 @@ public class BuyerOrder {
private Integer status;
// 原始状态
private Integer originalStatus;
private Integer createTime;
private Integer updateTime;
... ... @@ -58,6 +61,14 @@ public class BuyerOrder {
@Getter@Setter
private Integer activityType;//活动类型:0:普通,18:砍价
public Integer getOriginalStatus() {
return originalStatus;
}
public void setOriginalStatus(Integer originalStatus) {
this.originalStatus = originalStatus;
}
public Integer getId() {
return id;
}
... ...
... ... @@ -350,6 +350,9 @@
update_time = #{updateTime,jdbcType=INTEGER}
where uid = #{uid,jdbcType=INTEGER}
and order_code = #{orderCode,jdbcType=BIGINT}
<if test="originalStatus != null">
and status = #{originalStatus,jdbcType=INTEGER}
</if>
</update>
... ...
... ... @@ -98,6 +98,9 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
buyerOrder.setStatus(orderStatusCode);
// 用于控制并发更新的
buyerOrder.setOriginalStatus(orderInfo.getStatus());
buyerOrder.setUpdateTime(DateUtil.getCurrentTimeSecond());
int result = buyerOrderMapper.updateByOrderCode(buyerOrder);
//
... ...