Authored by chenchao

add delete api

... ... @@ -40,6 +40,7 @@
<select id="selectCntByOrderType" resultType="java.lang.Integer">
select count(*) from appraise_order
where uid = #{uid,jdbcType=INTEGER} and attributes = #{attributes,jdbcType=INTEGER}
and is_del = 1
and status in
<foreach collection="statusList" item="status" open="(" close=")" separator=",">
#{status,jdbcType=TINYINT}
... ... @@ -51,6 +52,7 @@
<include refid="Base_Column_List" />
from appraise_order
where uid = #{uid,jdbcType=INTEGER} and attributes = #{attributes,jdbcType=INTEGER}
and is_del = 1
and status in
<foreach collection="statusList" item="status" open="(" close=")" separator=",">
#{status,jdbcType=TINYINT}
... ...
... ... @@ -234,5 +234,16 @@ public class SellerDepositOrderController {
}
@RequestMapping(params = "method=ufo.depositOrder.delete")
public ApiResponse deleteVisuable(@RequestParam(name = "uid")int uid,
@RequestParam(name = "orderCode")long orderCode
){
logger.info("in method=ufo.depositOrder.addOrModifyAddress orderCode {} uid {}", orderCode, uid);
sellerDepositOrderService.deleteVisuable(uid, orderCode);
return new ApiResponse.ApiResponseBuilder()
.code(200)
.message("成功")
.build();
}
}
... ...
... ... @@ -26,6 +26,7 @@ import com.yohoufo.dal.order.model.AppraiseOrderGoods;
import com.yohoufo.dal.order.model.AppraiseOrderMeta;
import com.yohoufo.dal.order.model.AppraiseOrderStorage;
import com.yohoufo.order.common.ClientType;
import com.yohoufo.order.common.DelStatus;
import com.yohoufo.order.model.dto.SellerDepositOrderContext;
import com.yohoufo.order.model.dto.SellerDepositSubOrderContext;
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
... ... @@ -43,7 +44,6 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Service
public class SellerDepositOrderService extends AbsGoodsServiceOrderService implements IGoodsService {
... ... @@ -373,6 +373,15 @@ public class SellerDepositOrderService extends AbsGoodsServiceOrderService imple
}
public int deleteVisuable(int uid, long orderCode){
logger.info("in delete deposit order Visuable uid {} orderCode {}", uid, orderCode);
AppraiseOrder condition = new AppraiseOrder();
condition.setOrderCode(orderCode);
condition.setIsDel(DelStatus.IS_DEL.getCode());
int rows = appraiseOrderMapper.updateByOrderCode(condition);
logger.info("in delete deposit order Visuable uid {} orderCode {} rows {}", uid, orderCode, rows);
return rows;
}
}
... ...
... ... @@ -55,6 +55,12 @@ public class QuickDeliverPublishProcessor implements PublishProcessor<QuickDeliv
.num(num=qdosr.getNum())
.price(qdosr.getPrice()).skupType(qdosr.getSkupTypeCode()).build();
PriceComputePrepareProcessor.PriceComputeNode icpNode = priceComputePrepareProcessor.checkAndAcquire(socr);
if (num>10){
logger.warn("in buildSellerOrderContext storageId num over limit , qdosr {}", qdosr);
throw new UfoServiceException(400, "上架数目不能超过10个");
}
BigDecimal salePrice = icpNode.getSalePrice();
SkupType skupType = icpNode.getSkupType();
//step 1: rpc get product detail by storage id
... ...