Authored by 周少峰

Merge branch 'dev_fast_delivery' of git.yoho.cn:ufo/yohoufo-fore into dev_fast_delivery

Showing 27 changed files with 964 additions and 24 deletions
... ... @@ -4,6 +4,9 @@ package com.yohoufo.dal.order;
import com.yohoufo.dal.order.model.OrdersPayTransfer;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
public interface OrdersPayTransferMapper {
int insert(OrdersPayTransfer record);
... ... @@ -19,4 +22,6 @@ public interface OrdersPayTransferMapper {
int updateByPrimaryKey(OrdersPayTransfer record);
OrdersPayTransfer selectByBuyerOrderCode(long buyerOrderCode);
List<OrdersPayTransfer> selectByBuyerOrderCodeList(@Param("orderCodes") Collection<Long> buyerOrderCode);
}
\ No newline at end of file
... ...
package com.yohoufo.dal.order;
import com.yohobuy.ufo.model.order.resp.FastDeliveryGetShelfDetailResp;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.order.model.SellerOrderInfo;
import org.apache.ibatis.annotations.Param;
... ... @@ -47,6 +48,17 @@ public interface SellerOrderGoodsMapper {
int selectCntByUidStatusList(@Param("uid")int uid, @Param("statusList") List<Integer> statusList);
int selectCntByMulti(@Param("uid")int uid, @Param("status") Integer status,
@Param("skup") Integer skup, @Param("orderCode") Long orderCode,
@Param("startTime") Integer startTime, @Param("endTime") Integer endTime);
List<FastDeliveryGetShelfDetailResp> selectInfoByMulti(@Param("uid")int uid, @Param("status") Integer status,
@Param("skup") Integer skup, @Param("orderCode") Long orderCode,
@Param("startTime") Integer startTime, @Param("endTime") Integer endTime,
@Param("offset")Integer offset,
@Param("limit")Integer limit);
List<SellerOrderGoods> selectByUidStatusList(@Param("uid")int uid,
@Param("statusList") List<Integer> statusList,
@Param("offset")Integer offset,
... ...
package com.yohoufo.dal.order;
import java.util.Collection;
import java.util.List;
import java.util.Map;
... ... @@ -33,6 +34,8 @@ public interface TradeBillsMapper {
List<TradeBills> selectByKeyProps(TradeBills condition);
List<TradeBills> selectByOrderCodeList(@Param("orderCodes") Collection<Long> orderCodeList);
int updateLockOfUidTradeStatusAndDealTime(@Param("uid") Integer uid, @Param("tradeStatus") Integer tradeStatus, @Param("dealTime") Integer dealTime,
@Param("tagTradeStatus") Integer tagTradeStatus, @Param("tagDealTime") Integer tagDealTime);
... ...
... ... @@ -18,7 +18,7 @@ public class ProductProfit {
private Byte delStatus;
private BigDecimal profitMinPrice; // 费率价格下限
private BigDecimal profitMinPrice;
private BigDecimal profitMaxPrice; // 费率价格上限
private BigDecimal profitMaxPrice;
}
\ No newline at end of file
... ...
... ... @@ -36,6 +36,7 @@
<foreach collection="skups" item="skup" separator="," open="(" close=")">
#{skup,jdbcType=INTEGER}
</foreach>
order by id
</select>
<select id="selectByOrderCodeList" resultMap="BaseResultMap">
... ...
... ... @@ -40,6 +40,16 @@
where buyer_order_code = #{buyerOrderCode,jdbcType=INTEGER}
</select>
<select id="selectByBuyerOrderCodeList" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from orders_pay_transfer
where buyer_order_code IN
<foreach collection="orderCodes" item="orderCode" open="(" separator="," close=")">
#{orderCode,jdbcType=BIGINT}
</foreach>
</select>
<select id="selectByUidAndTransferType" resultType="java.lang.Integer" parameterType="java.lang.Integer" >
select
count(1)
... ...
... ... @@ -151,6 +151,55 @@
select count(*) from seller_order_goods where uid = #{uid,jdbcType=INTEGER}
</select>
<select id="selectCntByMulti" resultType="java.lang.Integer">
select count(1) from seller_order_goods sog, seller_order so
where sog.id=so.skup and so.uid= #{uid,jdbcType=INTEGER}
<if test="skup != null">
and sog.id=#{skup,jdbcType=INTEGER}
</if>
<if test="orderCode != null">
and so.order_code=#{orderCode,jdbcType=INTEGER}
</if>
<if test="status != null">
and sog.status=#{status,jdbcType=INTEGER}
</if>
<if test="startTime != null">
and <![CDATA[ so.create_time >= #{startTime,jdbcType=INTEGER}]]>
</if>
<if test="endTime != null">
and <![CDATA[ so.create_time <= #{endTime,jdbcType=INTEGER}]]>
</if>
</select>
<select id="selectInfoByMulti" resultType="com.yohobuy.ufo.model.order.resp.FastDeliveryGetShelfDetailResp">
select
sog.uid,
sog.id skup, so.order_code orderCode, sog.storage_id storageId, sog.product_name productName,
sog.size_name sizeName,
sog.product_id productId, sog.status, sog.goods_price price
from seller_order_goods sog, seller_order so
where sog.id=so.skup
and so.uid= #{uid,jdbcType=INTEGER}
<if test="skup != null">
and sog.id=#{skup,jdbcType=INTEGER}
</if>
<if test="orderCode != null">
and so.order_code=#{orderCode,jdbcType=INTEGER}
</if>
<if test="status != null">
and sog.status=#{status,jdbcType=INTEGER}
</if>
<if test="startTime != null">
and <![CDATA[ so.create_time >= #{startTime,jdbcType=INTEGER}]]>
</if>
<if test="endTime != null">
and <![CDATA[ so.create_time <= #{endTime,jdbcType=INTEGER}]]>
</if>
order by so.create_time desc
limit #{offset, jdbcType=INTEGER}, #{limit, jdbcType=INTEGER}
</select>
<select id="selectByUidStatusList" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from seller_order_goods
where <include refid="sql_where_4_select_UidStatusList"/>
... ...
... ... @@ -204,6 +204,19 @@
</if>
</select>
<select id="selectByOrderCodeList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from trade_bills
where 1=1 and order_code in
<foreach collection="orderCodes" item="orderCode" open="(" separator="," close=")">
#{orderCode,jdbcType=BIGINT}
</foreach>
</select>
<update id="updateLockOfUidTradeStatusAndDealTime" >
update trade_bills
set trade_status = #{tagTradeStatus,jdbcType=INTEGER},deal_time = #{tagDealTime,jdbcType=INTEGER}
... ...
... ... @@ -5,24 +5,41 @@ package com.yohoufo.order.common;
* Created by chao.chen on 2018/10/24.
*/
public enum BillTradeStatus {
NEW(0),
TRANSFER_WAITING(90),
SUCCESS(100),
FAIL(200),
NOT_EXIST_ALIPAY_ACCOUNT(201),
AMOUNT_IS_ILLEGAL(202),
HK_AMOUNT_WAIT_PAYMENT(203),
YOHO_STORE_AMOUNT_WAIT_PAYMENT(204),
HK_AMOUNT_PAYING(213),
TRANSFER_FAIL(299);
NEW(0, ""),
TRANSFER_WAITING(90 ,"等待付款结果"),
SUCCESS(100, "成功"),
FAIL(200, "失败"),
NOT_EXIST_ALIPAY_ACCOUNT(201, "没有支付宝账号"),
AMOUNT_IS_ILLEGAL(202, "金额不合法"),
HK_AMOUNT_WAIT_PAYMENT(203, "海外卖家等待付款"),
YOHO_STORE_AMOUNT_WAIT_PAYMENT(204, ""),
HK_AMOUNT_PAYING(213, ""),
TRANSFER_FAIL(299, "转账失败");
int code;
String desc;
BillTradeStatus(int code) {
public String getDesc() {
return desc;
}
BillTradeStatus(int code, String desc)
{
this.code = code;
this.desc = desc;
}
public int getCode() {
return code;
}
public static BillTradeStatus getTradeTypeByCode(int code){
for(BillTradeStatus v : values()){
if(v.code == code){
return v;
}
}
return NEW;
}
}
... ...
package com.yohoufo.order.controller;
import com.google.common.base.Throwables;
import com.yohobuy.ufo.model.order.req.FastDeliveryAdjustPriceReq;
import com.yohobuy.ufo.model.order.req.FastDeliveryBatchOnShelfReq;
import com.yohobuy.ufo.model.order.req.FastDeliveryDownShelfReq;
import com.yohobuy.ufo.model.order.req.FastDeliveryGetShelfReq;
import com.yohobuy.ufo.model.order.resp.FastDeliveryGetShelfResp;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.annotation.IgnoreSession;
import com.yohoufo.common.annotation.IgnoreSignature;
import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.order.service.IErpFastDeliveryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 急速发货第三方对接接口
*/
@RestController
@RequestMapping("/fastDelivery")
public class ErpFastDeliveryController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
IErpFastDeliveryService erpFastDeliveryService;
/**
* 批量上架
* @param req
* @return
*/
@IgnoreSignature
@IgnoreSession
@RequestMapping("/batchOnShelf")
public ApiResponse batchOnShelf(@RequestBody FastDeliveryBatchOnShelfReq req){
ApiResponse resp;
int code =200;
String msg = "成功";
try{
erpFastDeliveryService.batchOnShelf(req);
}catch (Exception ex){
code = 500;
if(ex instanceof UfoServiceException){
msg = ex.getMessage();
}else{
msg = "系统错误";
}
logger.warn("batchOnShelf fail, req {}, error {}", req, Throwables.getStackTraceAsString(ex));
}finally {
resp = new ApiResponse();
resp.setCode(code);
resp.setMessage(msg);
return resp;
}
}
/**
* 单个下架
* @param req
* @return
*/
@IgnoreSignature
@IgnoreSession
@RequestMapping("/singleDownSelf")
public ApiResponse singleDownSelf(@RequestBody FastDeliveryDownShelfReq req){
boolean result = erpFastDeliveryService.singleDownSelf(req);
String msg = "下架成功";
if (!result) {
msg = "下架失败";
}
return new ApiResponse.ApiResponseBuilder().data(result).code(200).message(msg).build();
}
/**
* 单个调价
* @param req
* @return
*/
@IgnoreSignature
@IgnoreSession
@RequestMapping("/singleAdjustPrice")
public ApiResponse singleAdjustPrice(@RequestBody FastDeliveryAdjustPriceReq req){
boolean result = erpFastDeliveryService.singleAdjustPrice(req);
String msg = "调价成功";
if (!result) {
msg = "调价失败";
}
return new ApiResponse.ApiResponseBuilder().data(result).code(200).message(msg).build();
}
/**
* 查询上架商品信息
* @param req
* @return
*/
@IgnoreSignature
@IgnoreSession
@RequestMapping("/getShelfInfo")
public ApiResponse getShelfInfo(@RequestBody FastDeliveryGetShelfReq req){
FastDeliveryGetShelfResp data = erpFastDeliveryService.getShelfInfo(req);
return new ApiResponse.ApiResponseBuilder().data(data).code(200).build();
}
}
... ...
... ... @@ -28,4 +28,13 @@ public class ImPrdNode{
AddressInfo hiddenBackAddress;
AddressInfo noHiddenBackAddress;
private Integer skupType;
/**
* 货号
*/
String productCode;
/**
* 尺寸
*/
String sizeName;
}
... ...
package com.yohoufo.order.service;
import com.yohobuy.ufo.model.order.req.FastDeliveryAdjustPriceReq;
import com.yohobuy.ufo.model.order.req.FastDeliveryBatchOnShelfReq;
import com.yohobuy.ufo.model.order.req.FastDeliveryDownShelfReq;
import com.yohobuy.ufo.model.order.req.FastDeliveryGetShelfReq;
import com.yohobuy.ufo.model.order.resp.FastDeliveryGetShelfResp;
import com.yohoufo.common.ApiResponse;
public interface IErpFastDeliveryService {
/**
* 单个调价
* @param req
* @return
*/
boolean singleAdjustPrice(FastDeliveryAdjustPriceReq req);
/**
* 批量上架
* @param req
*/
void batchOnShelf(FastDeliveryBatchOnShelfReq req);
/**
* 单个下架
* @param req
*/
boolean singleDownSelf(FastDeliveryDownShelfReq req);
/**
* 查询上架商品的信息
* @param req
*/
FastDeliveryGetShelfResp getShelfInfo(FastDeliveryGetShelfReq req);
}
... ...
... ... @@ -101,6 +101,12 @@ public class SellerDownShelfTaskHandler extends AbstractSellerTaskHandler<SkupDo
}
try {
if (SellerGoodsHelper.isFastDelivery(sdspDto.getSkupType())){
//清理缓存
cleanCache(uid, skupDtoMap);
return;
}
boolean isQuickDeliver = SellerGoodsHelper.isQuickDeliver(sdspDto.getSkupType());
if (!isQuickDeliver) {
boolean isSuper = sellerService.isSuperEntrySeller(uid);
... ...
package com.yohoufo.order.service.impl;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import com.yohobuy.ufo.model.ProductInfo;
import com.yohobuy.ufo.model.order.bo.SellerBo;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.common.SellerFuncEnum;
import com.yohobuy.ufo.model.order.common.SkupStatus;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.req.*;
import com.yohobuy.ufo.model.order.resp.FastDeliveryGetShelfDetailResp;
import com.yohobuy.ufo.model.order.resp.FastDeliveryGetShelfResp;
import com.yohobuy.ufo.model.order.resp.OrderListInfo;
import com.yohobuy.ufo.model.order.resp.PageResp;
import com.yohobuy.ufo.model.request.product.ProductImportTranItemBo;
import com.yohobuy.ufo.model.response.ProductDetailResp;
import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.dal.order.*;
import com.yohoufo.dal.order.model.*;
import com.yohoufo.order.common.BillTradeStatus;
import com.yohoufo.order.common.TradeType;
import com.yohoufo.order.model.dto.*;
import com.yohoufo.order.service.IErpFastDeliveryService;
import com.yohoufo.order.service.handler.SellerDecrPriceTaskHandler;
import com.yohoufo.order.service.handler.SellerDownShelfTaskHandler;
import com.yohoufo.order.service.handler.SellerIncrPriceTaskHandler;
import com.yohoufo.order.service.handler.SellerOrderSubmitHandler;
import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.service.seller.ImportPublishExcutor;
import com.yohoufo.order.service.seller.SellerAuthCheckService;
import com.yohoufo.order.service.seller.processor.AdjustPricePrepareProcessor;
import com.yohoufo.order.service.seller.processor.PriceComputePrepareProcessor;
import com.yohoufo.order.service.seller.processor.SellerDownShelfPrepareProcessor;
import com.yohoufo.order.service.seller.processor.SellerTaskProcessor;
import com.yohoufo.order.service.seller.setting.SellerFuncService;
import com.yohoufo.order.service.seller.setting.SellerService;
import com.yohoufo.order.service.seller.setting.SellerWrapper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private SellerService sellerService;
@Autowired
private SellerAuthCheckService sellerAuthCheckService;
@Autowired
private SellerFuncService sellerFuncService;
@Autowired
ImportPublishExcutor importPublishExcutor;
@Autowired
private ProductProxyService productProxyService;
@Autowired
private SellerDownShelfPrepareProcessor sellerDownShelfPrepareProcessor;
@Autowired
private SellerDownShelfTaskHandler sellerDownShelfTaskHandler;
@Autowired
private SellerTaskProcessor sellerTaskProcessor;
@Autowired
private AdjustPricePrepareProcessor adjustPricePrepareProcessor;
@Autowired
private SellerIncrPriceTaskHandler sellerIncrPriceTaskHandler;
@Autowired
private SellerDecrPriceTaskHandler sellerDecrPriceTaskHandler;
@Autowired
PriceComputePrepareProcessor priceComputePrepareProcessor;
@Autowired
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
@Autowired
private BuyerOrderMapper buyerOrderMapper;
@Autowired
private BuyerOrderGoodsMapper buyerOrderGoodsMapper;
@Autowired
private OrdersPayTransferMapper ordersPayTransferMapper;
@Autowired
private TradeBillsMapper tradeBillsMapper;
/**
* 货款收入
*/
private static List<Integer> GOODS_INCOME = Lists.newArrayList(OrderStatus.JUDGE_PASS.getCode(), OrderStatus.WAITING_RECEIVE.getCode(),
OrderStatus.DONE.getCode());
/**
* 保证金扣除
*/
private static List<Integer> DEDUCTION_EARNEST_MONEY = Lists.newArrayList(OrderStatus.SEND_OUT_TIMEOUT.getCode(),
OrderStatus.CHECKING_FAKE.getCode(),
OrderStatus.PLATFORM_DETECTION_NOT_PASS.getCode(),
OrderStatus.QUALITY_CHECK_FAKE.getCode(),
OrderStatus.SELLER_SHAM_SEND_OUT.getCode());
/**
* 因为买家原因获得的收入
*/
private static List<Integer> BUYER_REASON_INCOME = Lists.newArrayList(OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode(),
OrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.getCode());
/**
* 查询上架商品的信息
* @param req
*/
public FastDeliveryGetShelfResp getShelfInfo(FastDeliveryGetShelfReq req) {
if (req.getUid() < 0) {
logger.warn("uid is empty");
throw new UfoServiceException(400, "必须指定卖家");
}
if (req.getLimit() <= 0){
req.setLimit(10); // 默认值
}
if (req.getPage() <= 0){
req.setPage(1);
}
int total = sellerOrderGoodsMapper.selectCntByMulti(req.getUid(), req.getStatus(), req.getSkup(),
req.getOrderCode(), req.getStartTime(), req.getEndTime());
if (total == 0) {
return null;
}
int limit = req.getLimit();
int offset = (req.getPage() - 1) * limit;
List<FastDeliveryGetShelfDetailResp> list = sellerOrderGoodsMapper.selectInfoByMulti(req.getUid(), req.getStatus(),
req.getSkup(), req.getOrderCode(), req.getStartTime(), req.getEndTime(), offset, limit);
// product_id -----> productCode
Map<Integer, ProductInfo> productInfoMap = productProxyService.getProductCodeList(list.stream().map(FastDeliveryGetShelfDetailResp::getProductId).collect(Collectors.toList()));
// 对账信息 以买家订单号的状态为准
List<Integer> skupLists = list.stream().map(FastDeliveryGetShelfDetailResp::getSkup).collect(Collectors.toList());
List<BuyerOrderGoods> buyerOrderGoodList = buyerOrderGoodsMapper.selectBySkups(skupLists);
// skup ---> buyer orderCode (取最新的一个)
Map<Integer, Long> skupToOrderCode = buyerOrderGoodList.stream().collect(Collectors.toMap(BuyerOrderGoods::getSkup, BuyerOrderGoods::getOrderCode, (key1, key2) -> key2));
Collection<Long> buyerOrderCodeList = skupToOrderCode.values();
Map<Long, BuyerOrder> orderCodeToBuyer = null;
Map<Long, List<TradeBills>> buyerOrderToTradeBills = null;
if (CollectionUtils.isNotEmpty(buyerOrderCodeList)){
List<BuyerOrder> buyerOrderList = buyerOrderMapper.selectByOrderCodes(buyerOrderCodeList, null);
// buyer orderCode ---> buyer order
orderCodeToBuyer = buyerOrderList.stream().collect(Collectors.toMap(BuyerOrder::getOrderCode, Function.identity(), (key1, key2) -> key2));
// 交易记录
List<TradeBills> tradeBillsList = tradeBillsMapper.selectByOrderCodeList(buyerOrderCodeList);
// buyer orderCode ---> ordersPayTransfer
buyerOrderToTradeBills = tradeBillsList.stream().collect(Collectors.groupingBy(TradeBills::getOrderCode));
}
// 对账信息
// 鉴定通过 -- 货款收入
// 鉴定不通过 -- 保证金扣款
// 买家取消时 -- 扣款
Map<Long, BuyerOrder> finalOrderCodeToBuyer = orderCodeToBuyer;
Map<Long, List<TradeBills>> finalBuyerOrderToTradeBills = buyerOrderToTradeBills;
List<FastDeliveryGetShelfDetailResp> data = list.stream().map(sellerOrder -> {
return covertToFastDeliveryShelfResp(productInfoMap, skupToOrderCode, finalOrderCodeToBuyer, finalBuyerOrderToTradeBills, sellerOrder);
}).collect(Collectors.toList());
FastDeliveryGetShelfResp fastDeliveryGetShelfResp = new FastDeliveryGetShelfResp();
fastDeliveryGetShelfResp.setData(data);
fastDeliveryGetShelfResp.setPage(req.getPage());
fastDeliveryGetShelfResp.setPageSize(req.getLimit());
fastDeliveryGetShelfResp.setTotal(total);
fastDeliveryGetShelfResp.setPagetotal((total % limit == 0) ? (total / limit) : (total / limit + 1));
return fastDeliveryGetShelfResp;
}
private FastDeliveryGetShelfDetailResp covertToFastDeliveryShelfResp(Map<Integer, ProductInfo> productInfoMap,
Map<Integer, Long> skupToOrderCode,
Map<Long, BuyerOrder> orderCodeToBuyer,
Map<Long, List<TradeBills>> buyerOrderToTradeBills,
FastDeliveryGetShelfDetailResp sellerOrder) {
if (productInfoMap != null){
sellerOrder.setProductCode(productInfoMap.getOrDefault(sellerOrder.getProductId(), new ProductInfo()).getProductCode());
}
sellerOrder.setStatusDesc(SkupStatus.getSkupStatus(sellerOrder.getStatus()).getDesc());
// 商品是否是上架关闭
if (sellerOrder.getStatus() == SkupStatus.SELLER_CANCEL_SELL.getCode()) {
// 无对账信息
return sellerOrder;
}
// 是否存在买家订单
Long buyerOrderCode = null;
BuyerOrder buyerOrder = null;
// 检查是否存在买家信息
if (skupToOrderCode == null
|| orderCodeToBuyer == null
|| (buyerOrderCode=skupToOrderCode.get(sellerOrder.getSkup()))==null
|| (buyerOrder=orderCodeToBuyer.get(buyerOrderCode)) == null){
return sellerOrder;
}
// 买家
FastDeliveryGetShelfDetailResp.BuyerOrder buyerOrderResp = new FastDeliveryGetShelfDetailResp.BuyerOrder();
buyerOrderResp.setOrderCode(buyerOrderCode);
buyerOrderResp.setStatus(buyerOrder.getStatus());
buyerOrderResp.setStatusDesc(OrderStatus.getOrderStatus(buyerOrder.getStatus()).getDesc());
sellerOrder.setBuyerOrderCode(buyerOrderResp);
if (buyerOrderToTradeBills == null){
return sellerOrder;
}
List<TradeBills> tradeBills = buyerOrderToTradeBills.get(buyerOrderCode);
if (CollectionUtils.isEmpty(tradeBills)) {
return sellerOrder;
}
FastDeliveryGetShelfDetailResp.TradeBill tradeBillResp = new FastDeliveryGetShelfDetailResp.TradeBill();
// 货款收入 incomeOutcome 1:用户收入 2:用户支出
TradeBills one = null;
if (GOODS_INCOME.contains(buyerOrder.getStatus())) {
one = getOneTradeBills(tradeBills, sellerOrder.getUid(), TradeType.goods_income.getCode(), 1, buyerOrderCode);
if (one != null){
tradeBillResp.setGoodIncome(one.getAmount());
tradeBillResp.setStatus(BillTradeStatus.getTradeTypeByCode(one.getTradeStatus()).getDesc());
}
}
// 保证金扣除
else if (DEDUCTION_EARNEST_MONEY.contains(buyerOrder.getStatus())) {
one = getOneTradeBills(tradeBills, buyerOrder.getUid(), TradeType.compensateIncome.getCode(), 1, buyerOrderCode);
if (one != null){
tradeBillResp.setEarnestMoneyDeduction(one.getAmount());
tradeBillResp.setStatus(BillTradeStatus.getTradeTypeByCode(one.getTradeStatus()).getDesc());
}
}
// 罚款收入
else if (BUYER_REASON_INCOME.contains(buyerOrder.getStatus())) {
one = getOneTradeBills(tradeBills, sellerOrder.getUid(), TradeType.compensateIncome.getCode(), 1, buyerOrderCode);
if (one != null){
tradeBillResp.setBuyerPenaltyIncome(one.getAmount());
tradeBillResp.setStatus(BillTradeStatus.getTradeTypeByCode(one.getTradeStatus()).getDesc());
}
}
sellerOrder.setTradeBill(tradeBillResp);
return sellerOrder;
}
private TradeBills getOneTradeBills(List<TradeBills> tradeBills, int uid, Integer tradeType, Integer incomeOutcome, Long orderCode){
List<TradeBills> any = tradeBills.stream().filter(trade -> trade.getUid() == uid
&& trade.getTradeType() == tradeType
&& trade.getIncomeOutcome() == incomeOutcome).collect(Collectors.toList());
if (CollectionUtils.isEmpty(any)){
logger.warn("getOneTradeBills buyerOrderCode {}", orderCode);
return null;
}
return any.stream().sorted(Comparator.comparing(TradeBills::getCreateTime).reversed()).limit(1).findFirst().get();
}
/**
* 单个调价
* @param req
* @return
*/
public boolean singleAdjustPrice(FastDeliveryAdjustPriceReq req){
if (req.getUid() < 0){
logger.warn("uid is empty");
throw new UfoServiceException(400, "参数[uid]不合法");
}
if (req.getSkup() < 0){
logger.warn("skup is empty");
throw new UfoServiceException(401, "参数[skup]不合法");
}
if (StringUtils.isBlank(req.getNewPrice())){
logger.warn("price is invalidate");
throw new UfoServiceException(402, "参数[newPrice]不合法");
}
ChangePricePrepareDTO cppDto = adjustPricePrepareProcessor.getChangePricePreDto(req);
SellerTaskDTO<ChangePricePrepareDTO> taskDTO = null;
if (cppDto.getSalePrice().compareTo(cppDto.getPreSalePrice()) > 0) {
//涨价
taskDTO = new SellerTaskDTO(req.getUid(),
SellerWalletDetail.Type.ADD_PRICE.getValue(),
sellerIncrPriceTaskHandler,
JSON.toJSONString(req),cppDto);
} else if (cppDto.getSalePrice().compareTo(cppDto.getPreSalePrice()) < 0) {
//降价
taskDTO = new SellerTaskDTO(req.getUid(),
SellerWalletDetail.Type.SUBTRACT_PRICE.getValue(),
sellerDecrPriceTaskHandler,
JSON.toJSONString(req),cppDto);
} else {
throw new UfoServiceException(400, "价格没有变化");
}
SellerTaskResult result = sellerTaskProcessor.process(taskDTO);
return result.successCnt > 0 ? true : false;
}
/**
* 单个下架
* @param req
*/
public boolean singleDownSelf(FastDeliveryDownShelfReq req){
if (req.getUid() < 0){
logger.warn("uid is empty");
throw new UfoServiceException(400, "参数[uid]不合法");
}
if (req.getSkup() < 0){
logger.warn("skup is empty");
throw new UfoServiceException(401, "参数[skup]不合法");
}
SkupDownShelfPrepareDto skupDtoMap = sellerDownShelfPrepareProcessor.getDownShelfPreDto(req.getSkup());
SellerTaskDTO<SkupDownShelfPrepareDto> taskDTO = new SellerTaskDTO(req.getUid(),
SellerWalletDetail.Type.SELLER_OFF.getValue(),
sellerDownShelfTaskHandler,
JSON.toJSONString(req),
skupDtoMap);
SellerTaskResult result = sellerTaskProcessor.process(taskDTO);
return result.successCnt > 0 ? true : false;
}
@Override
public void batchOnShelf(FastDeliveryBatchOnShelfReq req) {
// 检查入口参数
checkBatchOnShelf(req);
// 检查用户权限(批量上架权限)
int uid = req.getUid();
SellerWrapper sellerWrapper = sellerService.getFullDimensionSeller(req.getUid());
SellerBo sellerBo = sellerWrapper.buildSellerBo();
if (!sellerBo.isFastDeliverySuper()){
logger.warn("batchOnShelf not legal super, uid {} ", uid);
throw new UfoServiceException(501, "用户权限不合法!");
}
sellerWrapper = sellerWrapper.attachSellerLevelFunc((sw)->sellerFuncService.getSellerLevelFunc(sw));
sellerAuthCheckService.checkAuth(sellerBo, null, SellerFuncEnum.BATCH_PUBLISH);
// 检查货号and尺寸是否存在
List<ProductInfoReq> productInfoReqList = req.getProductInfos().stream().map(x -> {
ProductInfoReq productInfoReq = new ProductInfoReq();
productInfoReq.setProductCode(x.getProductCode());
productInfoReq.setSizeName(x.getSizeName());
return productInfoReq;
}).distinct().collect(Collectors.toList());
// 调用商品服务获取到商品的storageId
// 无法获取则异常
// 上架
List<ProductImportTranItemBo> responseList = Lists.newArrayList();
for(FastDeliveryBatchOnShelfReq.ProductInfo productInfo : req.getProductInfos()){
Integer storageId = productInfo.getStorageId();
BigDecimal salePrice = productInfo.getConvertedPrice();
int storageNum = productInfo.getNum();
ImPrdNode node = ImPrdNode.builder().uid(uid)
.sellerWrapper(sellerWrapper)
.storageId(storageId).salePrice(salePrice).storageNum(storageNum).productCode(productInfo.getProductCode()).sizeName(productInfo.getSizeName())
.skupType(SkupType.FAST_DELIVERY.getCode())
.build();
int successNum=0;
try{
SellerOrderSubmitHandler.ForkJoinResult fjr = importPublishExcutor.publishOne(node);
successNum = Objects.isNull(fjr) || Objects.isNull(fjr.getSkupIds()) ? 0 : fjr.getSkupIds().size();
responseList.add(buildShelfResp(req, productInfo, successNum));
}catch(Exception ex){
logger.warn("in batchOnShelf.publishOne fail, uid {} productCode {} sizeName {} storageId {} salePrice {} storageNum {}",
uid, productInfo.getProductCode(), productInfo.getSizeName(), storageId, salePrice, storageNum);
}
}
if (CollectionUtils.isNotEmpty(responseList)){
productProxyService.batchAdd(responseList);
}else{
logger.warn("responseList empty");
throw new UfoServiceException(502, "上架失败!");
}
}
private ProductImportTranItemBo buildShelfResp(FastDeliveryBatchOnShelfReq req, FastDeliveryBatchOnShelfReq.ProductInfo productInfo, int successNum) {
// 构造结果对象 最终结果插入到 商品服务的product_import_tran_item表中
ProductImportTranItemBo productImportTranItemBo = new ProductImportTranItemBo();
productImportTranItemBo.setUid(req.getUid());
productImportTranItemBo.setProductCode(productInfo.getProductCode());
productImportTranItemBo.setStorageId(productInfo.getStorageId());
productImportTranItemBo.setSizeName(productInfo.getSizeName());
productImportTranItemBo.setPrice(productInfo.getConvertedPrice());
productImportTranItemBo.setNum(productInfo.getNum());
productImportTranItemBo.setSuccessdNum(successNum);
productImportTranItemBo.setTranId(0); // 不关心这个值 固定为0
return productImportTranItemBo;
}
private void checkBatchOnShelf(FastDeliveryBatchOnShelfReq req) {
if (req.getUid() < 0){
logger.warn("uid is empty");
throw new UfoServiceException(400, "参数[uid]错误");
}
if (CollectionUtils.isEmpty(req.getProductInfos())){
logger.warn("productInfo is empty");
throw new UfoServiceException(400, "商品信息为空");
}
for(FastDeliveryBatchOnShelfReq.ProductInfo productInfo : req.getProductInfos()){
if (StringUtils.isBlank(productInfo.getSizeName())
|| StringUtils.isBlank(productInfo.getProductCode())
|| productInfo.getNum() == null){
logger.warn("productInfo is invalidate {}", productInfo);
throw new UfoServiceException(400, "商品信息不合法");
}
// 价格已9结尾
BigDecimal salePrice = priceComputePrepareProcessor.checkAndAcquireSalePrice(productInfo.getPrice(), SkupType.FAST_DELIVERY);
productInfo.setConvertedPrice(salePrice);
}
}
}
... ...
... ... @@ -143,6 +143,7 @@ public class MetaConfigService {
case FLAW:
case SECOND_HAND:
case HK_IN_STOCK:
case FAST_DELIVERY:
cellKey = skupType.getLocalCacheKey();
break;
}
... ...
... ... @@ -377,6 +377,7 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServic
ErpCancelSellerOrderEvent event = ErpCancelSellerOrderEvent.builder().skup(skup).build();
OffShelveCancelCase offShelveCancelCase = new OffShelveCancelCase(event);
offShelveCancelCase.accept(sellerOrderCancelService);
sellerOrderCancelService.cancel(offShelveCancelCase);
return true;
}
... ...
package com.yohoufo.order.service.proxy;
import com.google.common.base.Throwables;
import com.sun.tools.corba.se.idl.ExceptionEntry;
import com.yohobuy.ufo.model.ProductInfo;
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
import com.yohobuy.ufo.model.order.bo.PrdPrice;
... ... @@ -163,6 +164,18 @@ public class ProductProxyService extends AbsProxyService{
return new HashMap<>();
}
public Map<Integer, ProductInfo> getProductCodeList(List<Integer> storageIdList){
try{
return ufoServiceCaller.call("ufo.product.list.data", storageIdList);
}catch (Exception e){
logger.warn("getProductCode storageIdList {}", storageIdList);
}
return null;
}
public PrdPrice getPrdPriceRange(Integer uid,
int storageId){
StorageDataResp storage = getStorageData(storageId);
... ...
... ... @@ -39,7 +39,7 @@ public class SellerAuthCheckService {
int uid = sellerBo.getUid();
EntrySellerType est = sellerBo.getEntrySellerType();
boolean excludeSkupType = SellerGoodsHelper.isQuickDeliver(skupType);
boolean includeSellerType = sellerBo.isNormalSuper() || sellerBo.isLargeSettlementSuper();
boolean includeSellerType = sellerBo.isNormalSuper() || sellerBo.isLargeSettlementSuper() || sellerBo.isFastDeliverySuper();
if (!excludeSkupType && includeSellerType){
SellerLevelFuncBo slfb = sellerBo.getSellerLevelFunc();
... ...
package com.yohoufo.order.service.seller.fastDelivery;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohoufo.order.model.dto.BuyerPenalty;
import com.yohoufo.order.model.dto.EarnestMoney;
import com.yohoufo.order.model.dto.PlatformFeeDto;
import com.yohoufo.order.model.dto.ServiceFeeRate;
import com.yohoufo.order.service.seller.AbsSellerOrderComputeHandler;
import com.yohoufo.order.service.seller.OrderComputeHandler;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.Collection;
@Component
public class FastDeliveryOrderComputeHandler extends AbsSellerOrderComputeHandler implements OrderComputeHandler {
@Override
protected SkupType getSkupType() {
return SkupType.FAST_DELIVERY;
}
@Override
protected EarnestMoney getDefaultEarnestMoney() {
EarnestMoney earnestMoney = new EarnestMoney();
earnestMoney.setRate(new BigDecimal(0.04D));
earnestMoney.setMin(new BigDecimal(28));
earnestMoney.setMax(new BigDecimal(200));
return earnestMoney;
}
@Override
protected ServiceFeeRate buildDefaultServiceFeeRate() {
ServiceFeeRate serviceFeeRate = new ServiceFeeRate();
serviceFeeRate.setGoodsPaymentRate(new BigDecimal(0.05));
serviceFeeRate.setPayChannelRate(new BigDecimal(0.01));
return serviceFeeRate;
}
@Override
protected Collection<BuyerPenalty.Fee> buildStagedCollection() {
return null;
}
@Override
protected PlatformFeeDto buildDefaultPlatformFeeDto(){
PlatformFeeDto platformFeeDto = new PlatformFeeDto();
platformFeeDto.setPackageFee(new BigDecimal(packageFee));
platformFeeDto.setAppraiseFee(new BigDecimal(appraiseFee));
return platformFeeDto;
}
}
... ...
... ... @@ -7,6 +7,7 @@ import com.yohoufo.dal.order.model.SellerOrderMeta;
import com.yohoufo.order.constants.MetaKey;
import com.yohobuy.ufo.model.order.vo.AddressInfo;
import com.yohoufo.order.model.SellerOrderContext;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
... ... @@ -49,7 +50,11 @@ public class SellerAddressService {
public int saveBatchSendBackAddress(SellerOrderContext ctx, List<Integer> skupIds){
int result = 0;
String value = JSONObject.toJSONString(ctx.getBackAddress());
String hValue = JSONObject.toJSONString(ctx.getBackHiddenAddress());
if (StringUtils.isEmpty(value) || StringUtils.isBlank(hValue)){
return result;
}
List<SellerOrderMeta> list = new ArrayList<>( 2*skupIds.size() );
for(Integer skupId : skupIds){
SellerOrderMeta som = new SellerOrderMeta();
... ...
package com.yohoufo.order.service.seller.processor;
import com.google.common.collect.Maps;
import com.yohobuy.ufo.model.order.bo.PrdPrice;
import com.yohobuy.ufo.model.order.bo.SellerBo;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.common.SkupStatus;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.req.FastDeliveryAdjustPriceReq;
import com.yohobuy.ufo.model.order.req.SellerBaseChangeReq;
import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.common.utils.BigDecimalHelper;
... ... @@ -78,6 +81,73 @@ public abstract class AbsEntryChangePricePrepareProcessor<T extends SellerBaseCh
private SellerOrderRiskWatchDog sellerOrderRiskWatchDog;
final static List<Integer> CAN_OFF_STATUS = Arrays.asList(SkupStatus.CAN_SELL.getCode());
public ChangePricePrepareDTO getChangePricePreDto(FastDeliveryAdjustPriceReq req){
/**
* 1. 检查skup的状态 出售中
* 2. 对应的买家订单 状态不可是 待付款
* 3. 价格必须以9即为
* 4. 调价前后价格有变化
* 5. 重新计算费率
*/
SellerOrderGoods sog = sellerOrderGoodsMapper.selectByPrimaryKey(req.getSkup());
if (sog == null || (sog.getStatus() != null && !CAN_OFF_STATUS.contains(sog.getStatus()))){
logger.warn("getChangePricePreDto has buyed, skup {}", req.getSkup());
throw new UfoServiceException(501, "商品已被下单购买");
}
List<BuyerOrderGoods> buyerOrderGoodsList = buyerOrderGoodsMapper.selectOrderBySkups(req.getSkup());
List<BuyerOrder> buyerOrderList = null;
if (CollectionUtils.isNotEmpty(buyerOrderGoodsList)){
List<Long> orderCodeList = buyerOrderGoodsList.parallelStream()
.map(BuyerOrderGoods::getOrderCode).collect(Collectors.toList());
buyerOrderList = buyerOrderMapper.selectByOrderCodes(orderCodeList, Arrays.asList(OrderStatus.WAITING_PAY.getCode()));
}
if (CollectionUtils.isNotEmpty(buyerOrderList)){
List<Long> waitingPayOrderCodes = buyerOrderList.parallelStream().map(BuyerOrder::getOrderCode).collect(Collectors.toList());
logger.warn("ChangePrice checkAndAcquire exist waiting pay skup , req {} waitingPayOrderCodes {}", req, waitingPayOrderCodes);
throw new UfoServiceException(400, "部分商品正在等待买家支付");
}
// 构造调价的任务的skupDto
Map<Integer, SkupDto> skupMap = Maps.newHashMap();
skupMap.put(req.getSkup(), SkupDto.builder().skup(sog.getId()).sellerOrderGoods(sog).batchNo(sog.getBatchNo()).build());
SkupType skupType = SkupType.getSkupType(sog.getAttributes());
// 价格已9结尾
BigDecimal salePrice = priceComputePrepareProcessor.checkAndAcquireSalePrice(req.getNewPrice(), skupType);
// 调价前后 价格有无变化
changePriceCommonPrepareProcessor.checkChangeNecessary(req.getSkup(), sog.getGoodsPrice(), salePrice);
SellerOrder sellerOrder = sellerOrderMapper.selectBySkup(req.getSkup());
// compute every fee from price
SellerOrderComputeResult pcc = goodsAmountService.getGoodsServiceFeeRate(req.getUid(), sog.getStorageId(), null, skupType);
OrderComputeHandler computeHandler = orderComputeProvider.findBySkupType(skupType);
SellerOrderComputeResult computeResult = computeHandler.compute(salePrice, pcc);
SellerBo sellerBo = sellerService.getSellerWithAuth(req.getUid());
return ChangePricePrepareDTO.builder()
.baseSellerOrderGoods(sog)
.preSalePrice(sog.getGoodsPrice())
.salePrice(salePrice)
.diffEarnestMoney(BigDecimalHelper.calDiff(sellerOrder.getEarnestMoney(), computeResult.getEarnestMoney().getEarnestMoney()))
.skupMap(skupMap)
.computeResult(computeResult)
.preEarnestMoney(sellerOrder.getEarnestMoney())
.sellerBo(sellerBo)
.skupType(skupType)
.build();
}
public ChangePricePrepareDTO checkAndAcquire(T req) {
int uid = req.getUid();
if (uid <= 0){
... ...
... ... @@ -70,6 +70,7 @@ public class ImportPublishProcessor
supportSkupTypes = new ArrayList<>(8);
supportSkupTypes.add(SkupType.IN_STOCK);
supportSkupTypes.add(SkupType.HK_IN_STOCK);
supportSkupTypes.add(SkupType.FAST_DELIVERY);
}
... ...
... ... @@ -196,7 +196,10 @@ public class PriceComputePrepareProcessor {
log.info("in checkPulishAuthNPriceRange,uid {} prdPrice {}, storageId {} prdPriceRange {}",
uid, prdPrice, storageId, prdPriceRange);
checkPublishAuth(uid, storageId, prdPrice, prdPriceRange);
checkBasePriceRange(uid, storageId, prdPrice, prdPriceRange, isShowError);
if (isShowError){
checkBasePriceRange(uid, storageId, prdPrice, prdPriceRange);
}
return prdPriceRange;
}
/**
... ... @@ -212,28 +215,27 @@ public class PriceComputePrepareProcessor {
PrdPrice prdPriceRange = productProxyService.getPrdPriceRange(uid, storageId);
log.info("in checkPriceRange,uid {} prdPrice {}, storageId {} prdPriceRange {}",
uid, prdPrice, storageId, prdPriceRange);
checkBasePriceRange(uid, storageId, prdPrice, prdPriceRange, isShowError);
if (isShowError){
checkBasePriceRange(uid, storageId, prdPrice, prdPriceRange);
}
return prdPriceRange;
}
private void checkBasePriceRange(Integer uid,int storageId, BigDecimal prdPrice, PrdPrice prdPriceRange, boolean isShowError){
private void checkBasePriceRange(Integer uid,int storageId, BigDecimal prdPrice, PrdPrice prdPriceRange){
BigDecimal minPrice = prdPriceRange.getMinPrice();
BigDecimal maxPrice = prdPriceRange.getMaxPrice();
if (prdPrice.subtract(minPrice).doubleValue() < 0D){
log.warn("in computePublishPrd,uid {} minPrice {}, storageId {}",
uid, minPrice, storageId);
if (isShowError){
throw new UfoServiceException(501, "您的出价过低");
}
throw new UfoServiceException(501, "您的出价过低");
}
if (prdPrice.subtract(maxPrice).doubleValue() > 0D){
log.warn("in computePublishPrd,uid {} maxPrice {}, storageId {}",
uid, maxPrice, storageId);
if (isShowError){
throw new UfoServiceException(501, "您的出价过高");
}
throw new UfoServiceException(501, "您的出价过高");
}
}
... ...
package com.yohoufo.order.service.seller.processor;
import com.google.common.collect.Maps;
import com.yohobuy.ufo.model.order.common.SkupStatus;
import com.yohobuy.ufo.model.order.constants.OrderDetailDesc;
import com.yohobuy.ufo.model.order.constants.SkupType;
... ... @@ -79,6 +80,29 @@ public class SellerDownShelfPrepareProcessor {
return sdspDto;
}
/**
* 获取skup对应的商品信息
* @param skup
* @return
*/
public SkupDownShelfPrepareDto getDownShelfPreDto(int skup){
SellerOrderGoods sog = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
if (sog == null || (sog.getStatus() != null && !CAN_OFF_STATUS.contains(sog.getStatus()))){
logger.warn("getSellerOrderGoodInfo has buyed, skup {}", skup);
throw new UfoServiceException(501, "商品已被下单购买");
}
Map<Integer, SkupDto> skupMap = Maps.newHashMap();
skupMap.put(sog.getId(), SkupDto.builder().skup(sog.getId()).sellerOrderGoods(sog).batchNo(sog.getBatchNo()).build());
SkupDownShelfPrepareDto sdspDto = SkupDownShelfPrepareDto.builder()
.idSkupMap(skupMap)
.skupType(SkupType.getSkupType(sog.getAttributes()))
.build();
return sdspDto;
}
private Map<Integer, SkupDto> checkNeedProcessSkups(SellerBatchChangeReq req, SkupType skupType) {
SellerOrderGoods condition = new SellerOrderGoods();
... ...
... ... @@ -95,6 +95,7 @@ public class SellerWrapper {
sellerBo.setEntrySellerType(est);
sellerBo.setEntryTypeCode(est.getCode());
SellerTypeNode sellerTypeNode = SellerHelper.buildSellerType(est);
sellerBo.setFastDeliverySuper(sellerTypeNode.isFastDeliverySuper());
sellerBo.setCommonEntry(sellerTypeNode.isCommonEntry());
sellerBo.setNormalSuper(sellerTypeNode.isNormalSuper());
sellerBo.setSuper(sellerTypeNode.isSuper());
... ...
... ... @@ -93,6 +93,10 @@ public final class SellerGoodsHelper {
return skupType != null && SkupType.QUICK_DELIVER.equals(skupType);
}
public static boolean isFastDelivery(SkupType skupType){
return skupType != null && SkupType.FAST_DELIVERY.equals(skupType);
}
public static boolean isInStock(SkupType skupType){
return skupType!=null && SkupType.IN_STOCK.equals(skupType);
}
... ...
... ... @@ -58,6 +58,7 @@ public class SellerHelper {
break;
case SUPER_ENTRY:
case LARGE_SETTLEMENT:
case FAST_DELIVERY_SUPER:
et = estMap.get(targetEst);
level = getSuperLevel(et, left);
break;
... ... @@ -91,10 +92,16 @@ public class SellerHelper {
public static boolean isSuper(EntrySellerType est){
boolean result = Objects.equals(est, EntrySellerType.SPECIAL_SUPER)
|| isNormalSuper(est)
|| isLargeSettlement(est);
|| isLargeSettlement(est)
|| isFastDeliverySuper(est) ;
return result;
}
public static boolean isFastDeliverySuper(EntrySellerType est){
return Objects.equals(est, EntrySellerType.FAST_DELIVERY_SUPER);
}
public static boolean isLargeSettlement(EntrySellerType est){
return Objects.equals(est, EntrySellerType.LARGE_SETTLEMENT);
}
... ... @@ -129,6 +136,7 @@ public class SellerHelper {
if (isSuper){
sellerTypeNode.setSuper(isSuper);
}
boolean isNormalSuper = isNormalSuper(est);
if (isNormalSuper){
... ... @@ -139,6 +147,10 @@ public class SellerHelper {
if (isLargeSettlement(est)){
sellerTypeNode.setLargeSettlementSuper(true);
}
if (isFastDeliverySuper(est)){
sellerTypeNode.setFastDeliverySuper(true);
}
return sellerTypeNode;
}
... ...