Authored by chenchao

fix sham deliver

... ... @@ -48,6 +48,11 @@ public interface AppraiseOrderMapper {
@Param("expectedStatus")int expectedStatus,
@Param("updateTime")int updateTime);
int updateStatusByParentOrderCode(@Param("parentOrderCode") long parentOrderCode,
@Param("targetStatus")int targetStatus,
@Param("expectedStatus")int expectedStatus,
@Param("updateTime")int updateTime);
// 修改订单的平台发货状态
int updatePlatformDeliveryStatusByOrderCode(@Param("orderCode")long orderCode,
@Param("uid")int uid,
... ...
... ... @@ -261,6 +261,16 @@
where order_code =#{orderCode,jdbcType=BIGINT} and status = #{expectedStatus,jdbcType=TINYINT}
</update>
<update id="updateStatusByParentOrderCode">
update appraise_order
<set>
status = #{targetStatus,jdbcType=TINYINT},
update_time = #{updateTime,jdbcType=INTEGER}
</set>
where parent_order_code =#{parentOrderCode,jdbcType=BIGINT} and status = #{expectedStatus,jdbcType=TINYINT}
</update>
<select id="selectByOrderCodeList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
... ...
... ... @@ -62,6 +62,9 @@ public class GoodsServiceRefundHandler extends AbsRefundOrderHandler {
@Override
public boolean refund() {
logger.info("{}.refund uid {} orderCode {} paidOrderCode {}",
getClass().getSimpleName(), uid, orderCode, paidOrderCode);
if (paidOrderCode == null){
throw new UfoServiceException(400, "退款订单不存在");
}
... ...
... ... @@ -42,6 +42,17 @@ public abstract class AbsGoodsServiceOrderService implements IGoodsService {
return rows;
}
protected int triggerStatusChangeByParentCode(Long parentOrderCode, AppraiseOrderStatus targetStatus, AppraiseOrderStatus expectedStatus){
int cdt = DateUtil.getCurrentTimeSecond();
int rows = appraiseOrderMapper.updateStatusByParentOrderCode(parentOrderCode, targetStatus.getCode(), expectedStatus.getCode(), cdt);
if (rows==0){
logger.warn("appraise order triggerStatusChange no need update status, parentOrderCode {}", parentOrderCode);
return 0;
}
return rows;
}
public int triggerStatusChange(Long orderCode, AppraiseOrderStatus targetStatus, AppraiseOrderStatus expectedStatus){
int cdt = DateUtil.getCurrentTimeSecond();
int rows = appraiseOrderMapper.updateStatusByOrderCode(orderCode, targetStatus.getCode(), expectedStatus.getCode(), cdt);
... ...
... ... @@ -456,19 +456,18 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
}
//
Long orderCode = appraiseOrder.getOrderCode();
boolean isParent = Objects.isNull(appraiseOrder.getParentOrderCode());
Long parentOrderCode;
boolean isParent = Objects.isNull(parentOrderCode=appraiseOrder.getParentOrderCode());
AppraiseOrderStatus targetOrderStatus = AppraiseOrderStatus.SHAM_SEND_OUT;
AppraiseOrderStatus expectedStatus = AppraiseOrderStatus.SELLER_SEND_OUT;
if(isParent){
triggerStatusChangeByParentCode(parentOrderCode, targetOrderStatus, expectedStatus);
}else {
//no parent
triggerStatusConsistencyCheck(orderCode);
}
//notice
inBoxFacade.sellerDepositOrderNotice(appraiseOrder.getUid(), orderCode, targetOrderStatus, isParent);
//
//refund amount
new GoodsServiceRefundHandler()
.loadLogger(logger)
... ...