Authored by mali

Merge branch 'test6.9.8' into gray

... ... @@ -56,4 +56,6 @@ public interface StorageDepositMapper {
int getUserDepositCount(@Param("uid") Integer uid);
StorageDeposit selectByOrderCode(@Param("orderCode") Long orderCode);
int updateStorageStatusEx(@Param("depositCode")String depositCode, @Param("status")int status, @Param("initStatus")int initStatus,@Param("outType")Integer outType);
}
\ No newline at end of file
... ...
... ... @@ -359,4 +359,13 @@
from storage_deposit
where order_code = #{orderCode} and del_status=0 limit 1
</select>
<update id="updateStorageStatusEx">
update storage_deposit
set status = #{status,jdbcType=INTEGER} ,update_time = unix_timestamp(now())
<if test="outType != null" >
, out_type = #{outType}
</if>
where deposit_code = #{depositCode,jdbcType=VARCHAR} AND del_status = 0 AND status = #{initStatus,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
... ...
... ... @@ -8,4 +8,6 @@ public interface SellerConfig {
int ENTER_TYPE_DEFAULT_LEVEL = 0;
String ENTER_TYPE_DEFAULT_FUNCS="[]";
String DELIVER2DEPOTTIPS4DEPOSITGOODS = "此商品买家选择寄存在UFO仓库,所以需要您将该商品发送至UFO南京鉴定中心";
}
... ...
... ... @@ -92,11 +92,11 @@ public class ExpressInfoController {
* @return
*/
@RequestMapping(params = "method=ufo.order.noticeAppraiseAddressChanged")
public ApiResponse noticeAppraiseAddressChanged(@RequestParam("uid") Integer uid,
public ApiResponse forceNoticeAppraiseAddress(@RequestParam("uid") Integer uid,
@RequestParam(value="orderCode")Long orderCode) {
LOG.info("method=ufo.order.noticeAppraiseAddressChanged in, uid {}, orderCode {}", uid, orderCode);
AppraiseAddressResp appraiseAddressResp = null;//expressInfoService.noticeAppraiseAddressChanged(uid, orderCode);
AppraiseAddressResp appraiseAddressResp = expressInfoService.forceNoticeAppraiseAddress(uid, orderCode);
return new ApiResponse.ApiResponseBuilder().code(200).data(appraiseAddressResp).build();
}
}
... ...
... ... @@ -36,6 +36,15 @@ public class AppraiseAddressResp {
@JSONField(name="isChanged")
private boolean isChanged;
@Getter
@Setter
@JSONField(name="isForceShow")
private boolean isForceShow;
@Getter
@Setter
private String tips;
public Integer getType() {
return type;
}
... ...
... ... @@ -44,7 +44,7 @@ public class DepositFinishDeliveryDelayMsgConsumer implements YhConsumer {
}
//更新寄存状态为已完成
storageDepositMapper.updateStorageStatus(deposit.getDepositCode(), StorageDepositStatusEnum.HAS_END.getCode(), OrderStatus.WAITING_PAY.getCode(), null);
storageDepositMapper.updateStorageStatusEx(deposit.getDepositCode(), StorageDepositStatusEnum.HAS_END.getCode(), StorageDepositStatusEnum.HAS_OUT.getCode(), null);
}
}
... ...
... ... @@ -97,7 +97,7 @@ public interface IExpressInfoService {
AppraiseAddressResp queryAppraiseAddress(Integer uid, Long orderCode, Integer skup);
AppraiseAddressResp noticeAppraiseAddressChanged(Integer uid, Long orderCode);
AppraiseAddressResp forceNoticeAppraiseAddress(Integer uid, Long orderCode);
... ...
... ... @@ -264,15 +264,16 @@ public class AppraiseService {
LOGGER.warn("deliveryGoodsToBuyer getOrderInfo order not exist, orderCode is {}", orderCode);
throw new ServiceException(ServiceError.ORDER_NULL);
}
// 寄存订单
// 寄存订单 或者闪购的库存
if(BuyerOrderUtils.isDeposit(buyerOrder)){
deliveryDepositGoodsToBuyer(appraiseExpressInfoBo, buyerOrder);
//设置寄存状态为已发货
setDepositStatus(orderCode);
} else {
deliveryNonDepositGoodsToBuyer(appraiseExpressInfoBo, buyerOrder);
}
//设置寄存状态为已发货 寄存订单 或者闪购的库存 需要修改仓库记录的发货状态
setDepositStatus(orderCode);
}
... ... @@ -281,9 +282,13 @@ public class AppraiseService {
if(null == deposit) {
return;
}
int num = storageDepositMapper.updateStorageStatus(deposit.getDepositCode(), StorageDepositStatusEnum.HAS_OUT.getCode(), OrderStatus.WAITING_PAY.getCode(), null);
LOGGER.info("method setDepositStatus execute, orderCode is {}", orderCode);
int num = storageDepositMapper.updateStorageStatusEx(deposit.getDepositCode(), StorageDepositStatusEnum.HAS_OUT.getCode(), StorageDepositStatusEnum.WAITING_OUT.getCode(), null);
if(num > 0) {
LOGGER.info("method setDepositStatus end, orderCode is {}", orderCode);
//清缓存
ufoServiceCaller.call("ufo.deposit.clearOrderCache", deposit.getOwnerUid(), deposit.getDepositCode()); // 清理库存详情缓存
... ...
... ... @@ -24,6 +24,7 @@ import com.yohoufo.dal.order.model.StorageDepositCount;
import com.yohoufo.order.controller.DepositController;
import com.yohoufo.order.model.response.AppraiseAddressResp;
import com.yohoufo.order.service.DepositService;
import com.yohoufo.order.service.proxy.InBoxFacade;
import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.service.proxy.SellerNoticeFacade;
import com.yohoufo.order.service.seller.SkupService;
... ... @@ -73,6 +74,9 @@ public class DepositServiceImpl implements DepositService {
@Autowired
private SellerNoticeFacade sellerNoticeFacade;
@Autowired
private InBoxFacade inBoxFacade;
private static final int DEPOSIT_MAX_TIME = 45 * 24 * 60 * 60;
... ... @@ -318,7 +322,7 @@ public class DepositServiceImpl implements DepositService {
clearCache(uid, sd.getProductId(), sd.getStorageId());
SellerOrderGoods psog = sellerOrderGoodsMapper.selectByPrimaryKey(sd.getNewSkup());
sellerNoticeFacade.depositGoodsSaleUnShelf(uid, psog.getProductName(), psog.getSizeName(), psog.getProductId());
inBoxFacade.sellerPlaySelf(uid, psog);
}
/**
... ...
... ... @@ -27,6 +27,7 @@ import com.yohoufo.dal.order.*;
import com.yohoufo.dal.order.model.*;
import com.yohoufo.order.common.ExpressForMqSend;
import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.constants.SellerConfig;
import com.yohoufo.order.event.BuyerOrderSellerDeliveryCheckEvent;
import com.yohoufo.order.event.ErpBuyerOrderEvent;
import com.yohoufo.order.model.OperateTransferExpressInfo;
... ... @@ -1127,12 +1128,34 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
* @return
*/
@Override
public AppraiseAddressResp noticeAppraiseAddressChanged(Integer uid, Long orderCode) {
public AppraiseAddressResp forceNoticeAppraiseAddress(Integer uid, Long orderCode) {
if (null == uid || orderCode == null) {
LOGGER.warn("in noticeAppraiseAddressChanged check in-param fail, uid {}, orderCode {}", uid, orderCode);
LOGGER.warn("in forceNoticeAppraiseAddress check in-param fail, uid {}, orderCode {}", uid, orderCode);
throw new ServiceException(ServiceError.ORDER_REQUEST_PARM_IS_EMPTY);
}
AppraiseAddressResp resp = null;
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
if (Objects.isNull(buyerOrder)){
LOGGER.warn("in forceNoticeAppraiseAddress buyerOrder not exist,uid {}, orderCode {}", uid, orderCode);
return resp;
}
if(BuyerOrderUtils.isDeposit(buyerOrder)){
resp = getAppraiseAddressResp4Deposit(uid, orderCode);
}
return resp;
}
private AppraiseAddressResp getAppraiseAddressResp4Deposit(Integer uid, Long orderCode){
LOGGER.info("in getAppraiseAddressResp4Deposit uid {}, orderCode {}", uid, orderCode);
AppraiseAddressResp resp = appraiseAddressService.findByDepotType(DepotType.NJ.getCode());
final String tips = SellerConfig.DELIVER2DEPOTTIPS4DEPOSITGOODS;
resp.setForceShow(true);
resp.setTips(tips);
return resp;
}
private AppraiseAddressResp getAppraiseAddressResp4AddrressChange(int uid, long orderCode){
BuyerOrderGoods pbog = buyerOrderGoodsMapper.selectOnlyByOrderCode(orderCode);
if (Objects.isNull(pbog)){
LOGGER.warn("in noticeAppraiseAddressChanged BuyerOrderGoods not exist, uid {}, order code {}", uid, orderCode);
... ...
... ... @@ -100,7 +100,13 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
private static final List<Long> SELLER_TYPES = Arrays.asList(OrderCodeType.SELLER_TYPE.getType());
private static final List<Integer> quickDeliverFinishStatus ;
static {
quickDeliverFinishStatus = new ArrayList<>(8);
quickDeliverFinishStatus.add(OrderStatus.JUDGE_PASS.getCode());
quickDeliverFinishStatus.add(OrderStatus.WAITING_RECEIVE.getCode());
quickDeliverFinishStatus.add(OrderStatus.DONE.getCode());
}
@Override
public OrderDetailInfo getOrderDetail(OrderRequest orderRequest) {
int uid;
... ... @@ -493,12 +499,16 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
buyerOrder.getOrderCode(), detailDesc, orderOverTime);
}
}
if (BuyerOrderUtils.isQuickDeliverDeposit(skupType, buyerOrder)) {
detailDesc = OrderDetailDesc.Seller.TRADE_DONE_QUICK_DELIVER;
//急速发货商品,且已完成(区分寄存 发货)
if (SellerGoodsHelper.isQuickDeliver(skupType)) {
if (quickDeliverFinishStatus.contains(orderStatus.getCode())){
detailDesc = OrderDetailDesc.Seller.TRADE_DONE_QUICK_DELIVER;
}
}
return detailDesc;
}
@Override
protected void resetDynamicProporties(OrderDetailInfo orderDetailInfo,String appVersion) {
Long orderCode = orderDetailInfo.getOrderCode();
... ...
... ... @@ -73,9 +73,9 @@ public class SellerNoticeFacade extends BaseNoticeFacade {
String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse("");
String sizeName = psog.getSizeName();
String goodsTypeType = buildGoodsTypeTagForSeller(psog);
String earnMoneyPlacehold = "";
String earnMoneyPlacehold = "";
if (withEarnMoney){
earnMoneyPlacehold = "保证金已退还,";
earnMoneyPlacehold = "保证金已退还,";
}
return buildInboxContent(InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_PASS, goodsTypeType, prdName, sizeName, productCode,earnMoneyPlacehold);
})
... ... @@ -126,47 +126,8 @@ public class SellerNoticeFacade extends BaseNoticeFacade {
}
}
/**
* 寄存商品上架出售
*
* @param sellerUid
* @param prdName
*/
public void depositGoodsSaleShelf(int sellerUid, String prdName, String sizeName, Integer productId) {
try {
newNotice(sellerUid)
.withLogPrefix("notice seller deposit goods sale shelf")
.withInBox(() -> {
Product product = productMapper.selectByPrimaryKey(productId);
String productCode = product.getProductCode();
return buildInboxContent(InboxBusinessTypeEnum.DEPOSIT_GOODS_SALE_SHELF, prdName, sizeName, productCode);
})
.send();
} catch (Exception e) {
log.warn("notice seller deposit goods sale shelf fail, sellerUid {}, prdName {} ,sizeName {} ", sellerUid, prdName, sizeName, e);
}
}
/**
* 寄存商品下架
*
* @param sellerUid
* @param prdName
*/
public void depositGoodsSaleUnShelf(int sellerUid, String prdName, String sizeName, Integer productId) {
try {
newNotice(sellerUid)
.withLogPrefix("notice seller deposit goods sale shelf")
.withInBox(() -> {
Product product = productMapper.selectByPrimaryKey(productId);
String productCode = product.getProductCode();
return buildInboxContent(InboxBusinessTypeEnum.DEPOSIT_GOODS_SALE_UN_SHELF, prdName, sizeName, productCode);
})
.send();
} catch (Exception e) {
log.warn("notice seller deposit goods sale shelf fail, sellerUid {}, prdName {} ,sizeName {} ", sellerUid, prdName, sizeName, e);
}
}
public void buyerCancelBeforeDepotReceive(@NonNull BuyerOrder buyerOrder, SellerOrderGoods sog) {
Integer buyerUid = buyerOrder.getUid();
... ...
... ... @@ -8,6 +8,7 @@ import com.yohobuy.ufo.model.order.common.OrderCodeType;
import com.yohobuy.ufo.model.order.common.SellerOrderListType;
import com.yohobuy.ufo.model.order.common.SkupListType;
import com.yohobuy.ufo.model.order.common.SkupStatus;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.req.QuickDeliverOrderSubmitReq;
import com.yohobuy.ufo.model.order.resp.OrderListInfo;
import com.yohobuy.ufo.model.order.resp.PageResp;
... ... @@ -127,7 +128,8 @@ public class QuickDeliverGoodsService {
}
//在for循环中被用作值传递,部分数据会有变化,使用时需要注意动态变化的属性
GoodsInfo goodsInfo = context.getSoldProduct();
sellerNoticeFacade.depositGoodsSaleShelf(uid, goodsInfo.getProductName(), goodsInfo.getSizeName(), goodsInfo.getProductId());
SkupType skupType = goodsInfo.getSkupType();
sellerNoticeFacade.saleShelf(uid, goodsInfo.getProductName(), goodsInfo.getSizeName(), goodsInfo.getProductId(), skupType.getCode());
DepositPublishResp resp = DepositPublishResp.builder().successNum(successNum)
.build();
return resp;
... ...