Authored by Lixiaodi

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

package com.yohoufo.dal.order;
import com.yohoufo.dal.order.model.QiniuLiveRecord;
import org.apache.ibatis.annotations.Param;
/**
* Created by li.ma on 2018/12/14.
*/
public interface QiniuLiveRecordMapper {
int updateStatusByPersistId(@Param("persistId")String persistId, @Param("status")Integer status);
QiniuLiveRecord selectByOrderCodes(@Param("orderCode")Integer orderCode);
}
... ...
... ... @@ -10,6 +10,35 @@ public class QiniuLiveRecord {
private Integer status;
private Integer id;
private Long orderCode;
private Integer skup;
private Long sellerOrderCode;
private Integer depotNo;
private Integer startTime;
private Integer endTime;
private String vedioFileUrl;
private Integer createTime;
private Integer updateTime;
private Integer storageId;
private Integer goodsId;
private Integer productId;
private Integer showFlag;
public String getPersistId() {
return persistId;
}
... ... @@ -26,6 +55,118 @@ public class QiniuLiveRecord {
this.status = status;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Long getOrderCode() {
return orderCode;
}
public void setOrderCode(Long orderCode) {
this.orderCode = orderCode;
}
public Integer getSkup() {
return skup;
}
public void setSkup(Integer skup) {
this.skup = skup;
}
public Long getSellerOrderCode() {
return sellerOrderCode;
}
public void setSellerOrderCode(Long sellerOrderCode) {
this.sellerOrderCode = sellerOrderCode;
}
public Integer getDepotNo() {
return depotNo;
}
public void setDepotNo(Integer depotNo) {
this.depotNo = depotNo;
}
public Integer getStartTime() {
return startTime;
}
public void setStartTime(Integer startTime) {
this.startTime = startTime;
}
public Integer getEndTime() {
return endTime;
}
public void setEndTime(Integer endTime) {
this.endTime = endTime;
}
public String getVedioFileUrl() {
return vedioFileUrl;
}
public void setVedioFileUrl(String vedioFileUrl) {
this.vedioFileUrl = vedioFileUrl;
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
public Integer getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Integer updateTime) {
this.updateTime = updateTime;
}
public Integer getStorageId() {
return storageId;
}
public void setStorageId(Integer storageId) {
this.storageId = storageId;
}
public Integer getGoodsId() {
return goodsId;
}
public void setGoodsId(Integer goodsId) {
this.goodsId = goodsId;
}
public Integer getProductId() {
return productId;
}
public void setProductId(Integer productId) {
this.productId = productId;
}
public Integer getShowFlag() {
return showFlag;
}
public void setShowFlag(Integer showFlag) {
this.showFlag = showFlag;
}
@Override
public String toString() {
return JSONObject.toJSONString(this);
... ...
... ... @@ -13,7 +13,6 @@
<result column="vedio_file_url" property="vedioFileUrl" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
<result column="pid" property="pid" jdbcType="INTEGER" />
<result column="status" property="status" jdbcType="INTEGER" />
<result column="storage_id" property="storageId" jdbcType="INTEGER" />
<result column="goods_id" property="goodsId" jdbcType="INTEGER" />
... ... @@ -21,16 +20,14 @@
</resultMap>
<sql id="Base_Column_List" >
id, order_code, skup, seller_order_code, depot_no, start_time, end_time, persistId,
vedio_file_url, create_time, update_time, pid, status, storage_id, goods_id, product_id
vedio_file_url, create_time, update_time, status, storage_id, goods_id, product_id
</sql>
<select id="selectByOrderCodes" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from qiniu_live_record
where order_code in
<foreach collection="orderCodes" open="(" close=")" separator="," item="orderCode">
#{orderCode,jdbcType=BIGINT}
</foreach>
where order_code = #{orderCode, jdbcType=BIGINT}
and show_flag = 1 and status = 1 order by id DESC limit 1
</select>
<update id="updateStatusByPersistId">
... ...
... ... @@ -19,4 +19,7 @@ public class ExpressForMqSend extends BaseBO {
//用户id(*)
private Integer uid;
//收货人的手机号
private String mobile;
}
... ...
... ... @@ -37,7 +37,7 @@ public class AppraiseController {
@IgnoreSignature
public ApiResponse returnBack(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
logger.info("in returnBack , req {}", appraiseExpressInfoBo);
return appraiseService.returnBack(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum());
return appraiseService.returnBack(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile());
}
/**
... ... @@ -50,7 +50,7 @@ public class AppraiseController {
@IgnoreSignature
public ApiResponse appraiseFail(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
logger.info("in appraise Fail, req {}", appraiseExpressInfoBo);
return appraiseService.appraiseFail(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum());
return appraiseService.appraiseFail(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile());
}
/**
... ... @@ -62,7 +62,7 @@ public class AppraiseController {
@IgnoreSignature
public ApiResponse appraiseSuccess(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
logger.info("in appraiseSuccess, req {}", appraiseExpressInfoBo);
return appraiseService.appraiseSuccess(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum());
return appraiseService.appraiseSuccess(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile());
}
}
... ...
... ... @@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSONObject;
import com.yoho.core.rabbitmq.YhConsumer;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohoufo.dal.order.BuyerOrderMapper;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.order.event.DeliverNoticeEvent;
import com.yohoufo.order.mq.TopicConstants;
import com.yohoufo.order.service.proxy.InBoxFacade;
... ... @@ -30,6 +32,9 @@ public class NotDeliverNoticeDelayMsgConsumer implements YhConsumer {
@Autowired
private BuyerOrderMapper buyerOrderMapper;
@Autowired
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
@Override
public void handleMessage(Object o) throws Exception {
... ... @@ -47,8 +52,17 @@ public class NotDeliverNoticeDelayMsgConsumer implements YhConsumer {
}
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCodeUid(orderCode, buyerUid);
if(OrderStatus.HAS_PAYED.getCode() == buyerOrder.getStatus().intValue()){
SellerOrderGoods sog = msg.getSellerOrderGoods();
if (sog == null){
sog = sellerOrderGoodsMapper.selectByPrimaryKey(msg.getSkup());
}
if (sog == null){
sog = new SellerOrderGoods();
sog.setUid(msg.getSellerUid());
sog.setProductName(msg.getPrdName());
}
LOGGER.info("ready notice sellerDeliverNotice, msg {}", msg);
inBoxFacade.sellerDeliverNotice(msg.getSellerOrderGoods(),orderCode, 2);
inBoxFacade.sellerDeliverNotice(sog,orderCode, 2);
}
... ...
... ... @@ -7,7 +7,9 @@ import com.yohoufo.common.alarm.EventBusPublisher;
import com.yohoufo.common.alarm.SmsAlarmEvent;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.dal.order.BuyerOrderMapper;
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.dal.order.model.SellerWalletDetail;
import com.yohoufo.order.common.BillTradeStatus;
import com.yohoufo.order.common.RefundCase;
... ... @@ -49,6 +51,9 @@ public class SellerOrderCancelDeliverDelayMsgConsumer implements YhConsumer {
@Autowired
private PayRefundService payRefundService;
@Autowired
private SellerOrderGoodsMapper sellerOrderGoodsMapper;
public String getMessageTopic() {
return TopicConstants.SELLER_ORDER_AUTO_CANCEL_DELIVER;
}
... ... @@ -91,7 +96,12 @@ public class SellerOrderCancelDeliverDelayMsgConsumer implements YhConsumer {
try{
payRefundService.refund(req, bleb);
//
inBoxFacade.sellerDeliverNotice(event.getSellerOrderGoods(), orderCode,3);
SellerOrderGoods sog = event.getSellerOrderGoods();
if (sog == null){
sog = sellerOrderGoodsMapper.selectByPrimaryKey(event.getSkup());
}
inBoxFacade.sellerDeliverNotice(sog, orderCode,3);
}catch (Exception ex){
logger.warn("in topic {} , refund fail,req {}", getMessageTopic(), req, ex);
BillLogEvent buyererBillLogEvent = bleb.tradeStatus(BillTradeStatus.FAIL.getCode())
... ...
... ... @@ -35,7 +35,7 @@ public interface IExpressInfoService {
* @param orderCode 订单号
* @param wayBillCode 快递单号
*/
void returnBack(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum);
void returnBack(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile);
/**
* 商品鉴定不通过,鉴定中心寄回商品给卖家
... ... @@ -44,7 +44,7 @@ public interface IExpressInfoService {
* @param orderCode 订单号
* @param wayBillCode 快递单号
*/
void appraiseFail(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum);
void appraiseFail(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile);
/**
* 商品鉴定通过,鉴定中心发货给买家
... ... @@ -54,7 +54,7 @@ public interface IExpressInfoService {
* @param orderCode 订单号
* @param wayBillCode 快递单号
*/
void appraiseSuccess(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum);
void appraiseSuccess(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile);
/**
* 根据订单号查询快递信息
... ...
... ... @@ -18,6 +18,8 @@ import javax.annotation.PostConstruct;
import java.security.SecureRandom;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collector;
import java.util.stream.Collectors;
/**
* Created by li.ma on 2018/9/28.
... ... @@ -67,6 +69,24 @@ public class AppraiseAddressService {
return appraiseAddressResps.get(0);
}
// 根据默认鉴定中心地址
public AppraiseAddressResp queryInitAddressByDepotNum(int depotNum) {
List<AppraiseAddressResp> appraiseAddressResps = queryAddressInfoList();
if (CollectionUtils.isEmpty(appraiseAddressResps)) {
return new AppraiseAddressResp.builder().setMobile("15010019250").setType(0).setAddressName("宫布朗").setAddress("北京市朝阳区建国路81号华贸写字楼1座3层 UFO飞碟好物【北京】实物鉴定中心").build();
}
List<AppraiseAddressResp> collect = appraiseAddressResps.stream().filter(item -> item.getType() == depotNum).collect(Collectors.toList());
if (CollectionUtils.isEmpty(collect)) {
return new AppraiseAddressResp.builder().setMobile("15010019250").setType(0).setAddressName("宫布朗").setAddress("北京市朝阳区建国路81号华贸写字楼1座3层 UFO飞碟好物【北京】实物鉴定中心").build();
}
return collect.get(0);
}
public List<AppraiseAddressResp> queryAddressInfoList() {
Object value=localCache.get(CACHE_KEY);
if(null == value) {
... ...
... ... @@ -88,7 +88,7 @@ public class AppraiseService {
private SellerService sellerService;
public ApiResponse appraiseSuccess(Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum){
public ApiResponse appraiseSuccess(Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile){
ApiResponse apiResponse=new ApiResponse();
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
... ... @@ -181,7 +181,7 @@ public class AppraiseService {
BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build();
EventBusPublisher.publishEvent(buyerConfirmEvent);
//记录物流信息
expressInfoService.appraiseSuccess(buyerUid, expressCompanyId, orderCode, wayBillCode, depotNum);
expressInfoService.appraiseSuccess(buyerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile);
//平台已发货给买家
inBoxFacade.appraisePassNotice(buyerUid, orderCode, sellerOrderGoods);
}catch (Exception ex){
... ... @@ -228,7 +228,7 @@ public class AppraiseService {
* @param wayBillCode
* @return
*/
public ApiResponse returnBack(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum){
public ApiResponse returnBack(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum,String mobile){
ApiResponse apiResponse=new ApiResponse();
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
... ... @@ -246,7 +246,7 @@ public class AppraiseService {
//记录物流信息
int sellerUid = buyerOrder.getSellerUid();
expressInfoService.returnBack(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum);
expressInfoService.returnBack(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile);
//发送消息
inBoxFacade.sendCancelledProductToSellerByCenter(sellerUid,wayBillCode);
... ... @@ -262,7 +262,7 @@ public class AppraiseService {
* @param wayBillCode
* @return
*/
public ApiResponse appraiseFail(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum){
public ApiResponse appraiseFail(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum,String mobile){
ApiResponse apiResponse=new ApiResponse();
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
... ... @@ -360,7 +360,7 @@ public class AppraiseService {
}finally {
//更新物流信息,写到最后
expressInfoService.appraiseFail(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum);
expressInfoService.appraiseFail(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile);
}
}else{
... ...
... ... @@ -139,7 +139,12 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum);
// 发送mq获取物流信息
sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode);
String mobile ="";
AppraiseAddressResp appraiseAddressResp =appraiseAddressService.queryInitAddressByDepotNum(depotNum);
if(appraiseAddressResp!=null){
mobile = appraiseAddressResp.getMobile();
}
sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode,mobile);
psog = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
LOGGER.info("deliverToDepot end ! send express to erp ");
inBoxFacade.sellerDeliver2Depot(buyerUid, orderCode, psog.getProductName());
... ... @@ -157,47 +162,47 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
}
@Override
public void returnBack(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum){
public void returnBack(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile){
Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_REBACK;
LOGGER.info("returnBack expressCompanyId = {}, orderCode = {}, wayBillCode = {} " +
",expressType = {},depotNum={}", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum});
",expressType = {},depotNum={},mobile={}", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum,mobile});
// 保存订单物流信息
saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum);
// 发送mq获取物流信息
sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode);
sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode,mobile);
LOGGER.info("returnBack end ! send express to erp ");
}
@Override
public void appraiseFail(Integer sellerUid ,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum) {
public void appraiseFail(Integer sellerUid ,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile) {
Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_3;
LOGGER.info("appraiseFail expressCompanyId = {}, orderCode = {}, wayBillCode = {} " +
",expressType = {},depotNum={}", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum});
",expressType = {},depotNum={},mobile={}", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum,mobile});
// 保存订单物流信息
saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum);
// 发送mq获取物流信息
sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode);
sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode,mobile);
LOGGER.info("appraiseFail end ! send express to erp ");
}
@Override
public void appraiseSuccess(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum) {
public void appraiseSuccess(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile) {
Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_2;
LOGGER.info("appraiseSuccess expressCompanyId = {}, orderCode = {}, wayBillCode = {} " +
",expressType = {},depotNum={} ", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum});
",expressType = {},depotNum={},mobile={} ", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum,mobile});
// 保存订单物流信息
saveExpress(uid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum);
// 发送mq获取物流信息
sendExpressMQ(uid,expressCompanyId,orderCode,wayBillCode);
sendExpressMQ(uid,expressCompanyId,orderCode,wayBillCode,mobile);
LOGGER.info("appraiseSuccess end ! send express to erp ");
}
... ... @@ -227,13 +232,14 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
/**
* 发送mq消息,获取物流信息
*/
private void sendExpressMQ(Integer uid,Integer expressCompanyId,Long orderCode,String wayBillCode ){
private void sendExpressMQ(Integer uid,Integer expressCompanyId,Long orderCode,String wayBillCode,String mobile ){
ExpressForMqSend mqInfo=new ExpressForMqSend();
mqInfo.setExpressNumber(wayBillCode);
mqInfo.setExpressId(expressCompanyId);
mqInfo.setOrderCode(orderCode);
mqInfo.setUid(uid);
mqInfo.setBusinessType(5);
mqInfo.setMobile(mobile);
try{
ufoExpressInfoProducer.send(EXPRESS_MQ_SEND, mqInfo);
... ...
... ... @@ -129,6 +129,9 @@ public class PaymentServiceImpl implements IPaymentService {
TradeBillsMapper tradeBillsMapper;
@Autowired
EntrySellerRechargeOrderMapper entrySellerRechargeOrderMapper;
@Autowired
private BuyerCancelCompensateComputeHandler buyerCancelCompensateComputeHandler;
... ... @@ -884,10 +887,27 @@ public class PaymentServiceImpl implements IPaymentService {
throw new ServiceException(400, "manualDeal:流水已经处理过id=" + tradeBills.getId());
}
boolean isMerchantExit = false;
// 是否为退出入驻订单
CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
if(codeMeta.getType() == OrderCodeType.SELLER_RECHARGE_EARNEST_TYPE.getType()) {
EntrySellerRechargeOrder order = entrySellerRechargeOrderMapper.selectByOrderCode(orderCode);
if(order != null && order.getStatus() != null && order.getType() != null && order.getType() == 3) {
if (order.getStatus() == 0) {
isMerchantExit = true;
} else {
throw new ServiceException(400, "manualDeal:退款已成功,id=" + tradeBills.getId());
}
} else {
throw new ServiceException(400, "manualDeal:商家退出入驻订单异常,id=" + tradeBills.getId());
}
}
// '1:买家uid; 2:卖家uid','1:保证金;2:货款;3:补偿款', '1:用户收入; 2:用户支出'
try {
if (/* 退货款 */ (tradeBills.getUserType() == 1 && tradeBills.getTradeType() == 2 && tradeBills.getIncomeOutcome() == 1)
/* 退保证金 */ || (tradeBills.getUserType() == 2 && tradeBills.getTradeType() == 1 && tradeBills.getIncomeOutcome() == 1)) {
if (/* 退货款 */((tradeBills.getUserType() == 1 && tradeBills.getTradeType() == 2 && tradeBills.getIncomeOutcome() == 1)
/* 退保证金(普通用户) */
|| (tradeBills.getUserType() == 2 && tradeBills.getTradeType() == 1 && tradeBills.getIncomeOutcome() == 1 && !isMerchantExit))) {
logger.warn("manualDeal人工退款 , tradeBills is {}", tradeBills);
PayRefundBo refundBo = manualRefund(orderCode, amount);
if (refundBo.getRefundStatus() == RefundContant.PAYMENT_REFUND_RESULTCODE_SUCCESS) {
... ...
package com.yohoufo.order.service.impl;
import com.google.common.collect.Lists;
import com.yohoufo.dal.order.QiniuLiveRecordMapper;
import com.yohoufo.dal.order.model.QiniuLiveRecord;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by li.ma on 2018/12/14.
*/
@Service
public class QiniuLiveRecordService {
public static final String LIVE_VEDIO_DOMAIN = "http://yhb-img01.qiniudn.com/";
@Autowired
private QiniuLiveRecordMapper qiniuLiveRecordMapper;
... ... @@ -18,4 +25,16 @@ public class QiniuLiveRecordService {
qiniuLiveRecordMapper.updateStatusByPersistId(persistId, 1); // 更新直播记录状态为已转码成功
}
}
public QiniuLiveRecord selectByOrderCodes(Integer orderCode) {
QiniuLiveRecord qiniuLiveRecords = qiniuLiveRecordMapper.selectByOrderCodes(orderCode);
if (null == qiniuLiveRecords || StringUtils.isEmpty(qiniuLiveRecords.getVedioFileUrl())) {
return null;
}
qiniuLiveRecords.setVedioFileUrl(LIVE_VEDIO_DOMAIN + qiniuLiveRecords.getVedioFileUrl());
return qiniuLiveRecords;
}
}
... ...
... ... @@ -2,6 +2,7 @@ package com.yohoufo.product.service;
import java.util.List;
import com.yoho.core.dal.datasource.annotation.Database;
import com.yohoufo.dal.product.model.StoragePrice;
import com.yohoufo.product.request.StoragePriceBo;
import com.yohoufo.product.response.ProductDetailResp;
... ... @@ -48,6 +49,7 @@ public interface ProductService {
* @param skupList
* @param status
*/
@Database(ForceMaster = true)
void sellerBatchUpdateStatus(List<Integer> skupList, int status);
List<StoragePrice> getStoragePriceBySkupList(List<Integer> skupList);
... ...
... ... @@ -13,6 +13,7 @@ import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.yoho.core.dal.datasource.annotation.Database;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -335,9 +336,10 @@ public class ProductServiceImpl implements ProductService{
}
@Override
@Database(ForceMaster = true)
public void sellerBatchUpdateStatus(List<Integer> skupList, int status) {
LOGGER.info("sellerBatchUpdateStatus in, skupList is {}, status is {}", skupList, status);
// 卖家修改上下架状态:*1:可售(支付保证金),商家上架,104:商家下架
// 卖家修改上下架状态:*1:可售(支付保证金),商家上架,4:商家下架
int updateNum = storagePriceMapper.batchUpdateStatus(skupList, status);
if(updateNum == 0) {
... ... @@ -352,7 +354,7 @@ public class ProductServiceImpl implements ProductService{
storage.setId(entry.getKey());
if(status == 1) {
storage.setStorageNum(entry.getValue().size());
}else if(status == 104) {
}else if(status == 4) {
storage.setStorageNum(-entry.getValue().size());
}
... ...