Authored by mali

Merge branch 'test6.8.3' of http://git.yoho.cn/ufo/yohoufo-fore into test6.8.3

... ... @@ -72,4 +72,8 @@ public interface SellerOrderGoodsMapper {
@Param("statusList") List<Integer> statusList,
@Param("id")Integer id,
@Param("limit")Integer limit);
List<SellerOrderGoods> selectByUidStorageStatusGBBPSList(@Param("uid")int uid,
@Param("storageId")Integer storageId,
@Param("statusList") List<Integer> statusList);
}
\ No newline at end of file
... ...
... ... @@ -387,4 +387,10 @@
order by id desc
limit #{limit, jdbcType=INTEGER}
</select>
<select id="selectByUidStorageStatusGBBPSList" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from seller_order_goods
where storage_id = #{storageId,jdbcType=INTEGER},
and <include refid="sql_where_4_select_UidStatusGBBNList"/>
</select>
</mapper>
\ No newline at end of file
... ...
package com.yohoufo.order.model.dto;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.service.proxy.ProductProxyService;
import lombok.AllArgsConstructor;
import lombok.Data;
... ... @@ -18,6 +19,11 @@ import java.util.Map;
@AllArgsConstructor
@NoArgsConstructor
public class ChangePricePrepareDTO {
/**
* 这是一个商品的基本数据,也算是样例,不需要care它的id
* 使用场景:调价后清理storage-id 维度的缓存,卖家订单(商品)详情的缓存是根据group(bn+status+price)
*/
private SellerOrderGoods baseSellerOrderGoods;
ProductProxyService.PrdPrice prdPrice;
... ...
... ... @@ -319,7 +319,6 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
if(StringUtils.isBlank(expressInfoRespBo.getExpressSender())){
ExpressRecord expressRecord = expressRecordMapper.selectByUidAndOrderCodeAndExpressType(uid,orderCode,ExpressInfoConstant.EXPRESS_TYPE_1);
if(expressRecord!=null){
expressInfoRespBo.setExpressInfoDetailList(new ArrayList<>());
// 快递单号
expressInfoRespBo.setWayBillCode(expressRecord.getWaybillCode());
//物流类型
... ... @@ -328,6 +327,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
expressInfoRespBo.setExpressSender(EnumExpressSender.getSenderName(expressInfoRespBo.getExpressType().intValue()));
// 快递公司名称
expressInfoRespBo.setExpressCompanyName(expressCompanyService.getExpressName(expressRecord.getLogisticsType()));
expressInfoRespBo.setExpressInfoDetailList(new ArrayList<>());
}
}
List<ExpressInfo> previousExpressInfoList = expressInfoMapper.selectAllExpressInfo(uid, orderCode, ExpressInfoConstant.EXPRESS_TYPE_1);
... ...
... ... @@ -617,7 +617,8 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
merchantOrderPaymentService.changePriceAddWalletDetail(sellerWallet, orderList);
}
successCnt = skupMap.size();
List<RedisKeyBuilder> skupDetailRKBs = getSkupDetailRKBs(skupMap);
SellerOrderGoods sampleSog = cppDto.getBaseSellerOrderGoods();
List<RedisKeyBuilder> skupDetailRKBs = getSkupDetailRKBs(sampleSog);
skupDetailRKBs.add(CacheKeyBuilder.orderListKey(req.getUid(), TabType.SELL.getValue()));
cacheCleaner.delete(skupDetailRKBs);
}else {
... ... @@ -633,18 +634,27 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
return resp;
}
private List<RedisKeyBuilder> getSkupDetailRKBs(Map<Integer, SkupDto> skupMap){
Set<String> keys = new HashSet<>(skupMap.size());
List<RedisKeyBuilder> skupDetailRKBs = new ArrayList<>(skupMap.size());
for(Map.Entry<Integer, SkupDto> entry : skupMap.entrySet()){
SellerOrderGoods sog = entry.getValue().getSellerOrderGoods();
private List<RedisKeyBuilder> getSkupDetailRKBs(SellerOrderGoods sampleSog){
List<Integer> statusList = Arrays.asList(SkupStatus.CAN_SELL.getCode());
List<SellerOrderGoods> sellerOrderGoodsList = sellerOrderGoodsMapper.selectByUidStorageStatusGBBPSList(sampleSog.getUid(),
sampleSog.getStorageId(), statusList);
List<RedisKeyBuilder> skupDetailRKBs = new ArrayList<>(sellerOrderGoodsList.size());
if (CollectionUtils.isEmpty(sellerOrderGoodsList)){
return skupDetailRKBs;
}
Set<String> keys = new HashSet<>(sellerOrderGoodsList.size());
for(SellerOrderGoods sog : sellerOrderGoodsList){
String key = new StringBuilder().append(sog.getBatchNo()).append(sog.getGoodsPrice())
.append(sog.getStatus()).toString();
if (keys.contains(key)){
continue;
}
skupDetailRKBs.add(CacheKeyBuilder.sellerOrderDetailKey(sog));
}
log.info("build detail cache group keys {}", keys);
return skupDetailRKBs;
}
... ...
... ... @@ -128,6 +128,7 @@ public class ChangePricePrepareProcessor {
sellerOrderPrepareProcessor.checkIncome(storageId, computeResult.getIncome());
return ChangePricePrepareDTO.builder()
.baseSellerOrderGoods(sampleSog)
.prdPrice(prdPrice)
.salePrice(salePrice)
.diffEarnestMoney(diffEarnestMoney)
... ...
package com.yohoufo.order.service.proxy;
import com.alibaba.fastjson.JSON;
import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.inboxclient.model.InBoxResponse;
... ... @@ -138,19 +139,19 @@ public class InBoxFacade {
InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
logger.info("record appraisePassNotice inbox msg, buyerUid {}, orderCode {}, prdName {} resp {}",
buyerUid, orderCode, prdName, resp);
logger.info("record appraisePassNotice inbox msg, buyerUid {}, orderCode {}, prdName {},SellerOrderGoods {} resp {}",
buyerUid, orderCode, prdName, JSON.toJSONString(psog), resp);
//seller notice
String sizeName = psog.getSizeName();
Integer sellerUid = psog.getUid();
InboxBusinessTypeEnum ibtOfSeller = InboxBusinessTypeEnum.PURCHASE_SENDED;
InboxBusinessTypeEnum ibtOfSeller = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_PASS;
String paramsOfSeller = buildParams(prdName, sizeName);
InboxReqVO reqOfSeller = buildInboxReqVO(buyerUid, paramsOfSeller, ibtOfSeller);
InBoxResponse respOfSeller = inBoxSDK.addInbox(reqOfSeller);
logger.info("record appraisePassNotice inbox msg, buyerUid {}, orderCode {}, prdName {} resp {}",
buyerUid, orderCode, prdName, respOfSeller);
logger.info("record appraisePassNotice inbox msg, buyerUid {}, orderCode {}, prdName {} ,sizeName {} ,resp {}",
buyerUid, orderCode, prdName,sizeName, respOfSeller);
String phoneOfSeller = userProxyService.getMobile(sellerUid);
if (StringUtils.isBlank(phoneOfSeller)){
logger.warn("in appraisePassNotice sms fail, buyerUid {} orderCode {} prdName {} ", buyerUid, orderCode,prdName);
... ... @@ -393,8 +394,8 @@ public class InBoxFacade {
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
logger.info("record sellerSkupPaidByBuyer inbox msg, sellerUid {}, prdName {}, sizeName {},resp {}",
sellerUid, prdName, sizeName, resp);
logger.info("record sellerSkupPaidByBuyer inbox msg, SellerOrderGoods {} ,sellerUid {}, prdName {}, sizeName {},resp {}",
JSON.toJSONString(sog),sellerUid, prdName, sizeName, resp);
//短信
String phone = userProxyService.getMobile(sellerUid);
... ... @@ -405,8 +406,8 @@ public class InBoxFacade {
List<String> mobileList = Arrays.asList(phone);
String content = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTIFIED_SEND.getContent(),prdName,orderCode);
sendSmsService.smsSendByMobile(content, mobileList);
logger.info("record sellerSkupPaidByBuyer inbox sms msg,sellerUid {}, prdName {}",
sellerUid, prdName);
logger.info("record sellerSkupPaidByBuyer inbox sms msg,sellerUid {}, prdName {},orderCode {}",
sellerUid, prdName,orderCode);
});
} catch (Exception e) {
... ...