Authored by Lixiaodi

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

1 package com.yohoufo.dal.order; 1 package com.yohoufo.dal.order;
2 2
  3 +import com.yohoufo.dal.order.model.QiniuLiveRecord;
3 import org.apache.ibatis.annotations.Param; 4 import org.apache.ibatis.annotations.Param;
4 5
  6 +
5 /** 7 /**
6 * Created by li.ma on 2018/12/14. 8 * Created by li.ma on 2018/12/14.
7 */ 9 */
8 public interface QiniuLiveRecordMapper { 10 public interface QiniuLiveRecordMapper {
9 int updateStatusByPersistId(@Param("persistId")String persistId, @Param("status")Integer status); 11 int updateStatusByPersistId(@Param("persistId")String persistId, @Param("status")Integer status);
  12 +
  13 + QiniuLiveRecord selectByOrderCodes(@Param("orderCode")Integer orderCode);
10 } 14 }
@@ -10,6 +10,35 @@ public class QiniuLiveRecord { @@ -10,6 +10,35 @@ public class QiniuLiveRecord {
10 10
11 private Integer status; 11 private Integer status;
12 12
  13 + private Integer id;
  14 +
  15 + private Long orderCode;
  16 +
  17 + private Integer skup;
  18 +
  19 + private Long sellerOrderCode;
  20 +
  21 + private Integer depotNo;
  22 +
  23 + private Integer startTime;
  24 +
  25 + private Integer endTime;
  26 +
  27 + private String vedioFileUrl;
  28 +
  29 + private Integer createTime;
  30 +
  31 + private Integer updateTime;
  32 +
  33 + private Integer storageId;
  34 +
  35 + private Integer goodsId;
  36 +
  37 + private Integer productId;
  38 +
  39 + private Integer showFlag;
  40 +
  41 +
13 public String getPersistId() { 42 public String getPersistId() {
14 return persistId; 43 return persistId;
15 } 44 }
@@ -26,6 +55,118 @@ public class QiniuLiveRecord { @@ -26,6 +55,118 @@ public class QiniuLiveRecord {
26 this.status = status; 55 this.status = status;
27 } 56 }
28 57
  58 + public Integer getId() {
  59 + return id;
  60 + }
  61 +
  62 + public void setId(Integer id) {
  63 + this.id = id;
  64 + }
  65 +
  66 + public Long getOrderCode() {
  67 + return orderCode;
  68 + }
  69 +
  70 + public void setOrderCode(Long orderCode) {
  71 + this.orderCode = orderCode;
  72 + }
  73 +
  74 + public Integer getSkup() {
  75 + return skup;
  76 + }
  77 +
  78 + public void setSkup(Integer skup) {
  79 + this.skup = skup;
  80 + }
  81 +
  82 + public Long getSellerOrderCode() {
  83 + return sellerOrderCode;
  84 + }
  85 +
  86 + public void setSellerOrderCode(Long sellerOrderCode) {
  87 + this.sellerOrderCode = sellerOrderCode;
  88 + }
  89 +
  90 + public Integer getDepotNo() {
  91 + return depotNo;
  92 + }
  93 +
  94 + public void setDepotNo(Integer depotNo) {
  95 + this.depotNo = depotNo;
  96 + }
  97 +
  98 + public Integer getStartTime() {
  99 + return startTime;
  100 + }
  101 +
  102 + public void setStartTime(Integer startTime) {
  103 + this.startTime = startTime;
  104 + }
  105 +
  106 + public Integer getEndTime() {
  107 + return endTime;
  108 + }
  109 +
  110 + public void setEndTime(Integer endTime) {
  111 + this.endTime = endTime;
  112 + }
  113 +
  114 + public String getVedioFileUrl() {
  115 + return vedioFileUrl;
  116 + }
  117 +
  118 + public void setVedioFileUrl(String vedioFileUrl) {
  119 + this.vedioFileUrl = vedioFileUrl;
  120 + }
  121 +
  122 + public Integer getCreateTime() {
  123 + return createTime;
  124 + }
  125 +
  126 + public void setCreateTime(Integer createTime) {
  127 + this.createTime = createTime;
  128 + }
  129 +
  130 + public Integer getUpdateTime() {
  131 + return updateTime;
  132 + }
  133 +
  134 + public void setUpdateTime(Integer updateTime) {
  135 + this.updateTime = updateTime;
  136 + }
  137 +
  138 + public Integer getStorageId() {
  139 + return storageId;
  140 + }
  141 +
  142 + public void setStorageId(Integer storageId) {
  143 + this.storageId = storageId;
  144 + }
  145 +
  146 + public Integer getGoodsId() {
  147 + return goodsId;
  148 + }
  149 +
  150 + public void setGoodsId(Integer goodsId) {
  151 + this.goodsId = goodsId;
  152 + }
  153 +
  154 + public Integer getProductId() {
  155 + return productId;
  156 + }
  157 +
  158 + public void setProductId(Integer productId) {
  159 + this.productId = productId;
  160 + }
  161 +
  162 + public Integer getShowFlag() {
  163 + return showFlag;
  164 + }
  165 +
  166 + public void setShowFlag(Integer showFlag) {
  167 + this.showFlag = showFlag;
  168 + }
  169 +
29 @Override 170 @Override
30 public String toString() { 171 public String toString() {
31 return JSONObject.toJSONString(this); 172 return JSONObject.toJSONString(this);
@@ -13,7 +13,6 @@ @@ -13,7 +13,6 @@
13 <result column="vedio_file_url" property="vedioFileUrl" jdbcType="VARCHAR" /> 13 <result column="vedio_file_url" property="vedioFileUrl" jdbcType="VARCHAR" />
14 <result column="create_time" property="createTime" jdbcType="INTEGER" /> 14 <result column="create_time" property="createTime" jdbcType="INTEGER" />
15 <result column="update_time" property="updateTime" jdbcType="INTEGER" /> 15 <result column="update_time" property="updateTime" jdbcType="INTEGER" />
16 - <result column="pid" property="pid" jdbcType="INTEGER" />  
17 <result column="status" property="status" jdbcType="INTEGER" /> 16 <result column="status" property="status" jdbcType="INTEGER" />
18 <result column="storage_id" property="storageId" jdbcType="INTEGER" /> 17 <result column="storage_id" property="storageId" jdbcType="INTEGER" />
19 <result column="goods_id" property="goodsId" jdbcType="INTEGER" /> 18 <result column="goods_id" property="goodsId" jdbcType="INTEGER" />
@@ -21,16 +20,14 @@ @@ -21,16 +20,14 @@
21 </resultMap> 20 </resultMap>
22 <sql id="Base_Column_List" > 21 <sql id="Base_Column_List" >
23 id, order_code, skup, seller_order_code, depot_no, start_time, end_time, persistId, 22 id, order_code, skup, seller_order_code, depot_no, start_time, end_time, persistId,
24 - vedio_file_url, create_time, update_time, pid, status, storage_id, goods_id, product_id 23 + vedio_file_url, create_time, update_time, status, storage_id, goods_id, product_id
25 </sql> 24 </sql>
26 <select id="selectByOrderCodes" resultMap="BaseResultMap" parameterType="java.lang.Integer" > 25 <select id="selectByOrderCodes" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
27 select 26 select
28 <include refid="Base_Column_List" /> 27 <include refid="Base_Column_List" />
29 from qiniu_live_record 28 from qiniu_live_record
30 - where order_code in  
31 - <foreach collection="orderCodes" open="(" close=")" separator="," item="orderCode">  
32 - #{orderCode,jdbcType=BIGINT}  
33 - </foreach> 29 + where order_code = #{orderCode, jdbcType=BIGINT}
  30 + and show_flag = 1 and status = 1 order by id DESC limit 1
34 </select> 31 </select>
35 32
36 <update id="updateStatusByPersistId"> 33 <update id="updateStatusByPersistId">
@@ -19,4 +19,7 @@ public class ExpressForMqSend extends BaseBO { @@ -19,4 +19,7 @@ public class ExpressForMqSend extends BaseBO {
19 //用户id(*) 19 //用户id(*)
20 private Integer uid; 20 private Integer uid;
21 21
  22 + //收货人的手机号
  23 + private String mobile;
  24 +
22 } 25 }
@@ -37,7 +37,7 @@ public class AppraiseController { @@ -37,7 +37,7 @@ public class AppraiseController {
37 @IgnoreSignature 37 @IgnoreSignature
38 public ApiResponse returnBack(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) { 38 public ApiResponse returnBack(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
39 logger.info("in returnBack , req {}", appraiseExpressInfoBo); 39 logger.info("in returnBack , req {}", appraiseExpressInfoBo);
40 - return appraiseService.returnBack(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum()); 40 + return appraiseService.returnBack(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile());
41 } 41 }
42 42
43 /** 43 /**
@@ -50,7 +50,7 @@ public class AppraiseController { @@ -50,7 +50,7 @@ public class AppraiseController {
50 @IgnoreSignature 50 @IgnoreSignature
51 public ApiResponse appraiseFail(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) { 51 public ApiResponse appraiseFail(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
52 logger.info("in appraise Fail, req {}", appraiseExpressInfoBo); 52 logger.info("in appraise Fail, req {}", appraiseExpressInfoBo);
53 - return appraiseService.appraiseFail(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum()); 53 + return appraiseService.appraiseFail(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile());
54 } 54 }
55 55
56 /** 56 /**
@@ -62,7 +62,7 @@ public class AppraiseController { @@ -62,7 +62,7 @@ public class AppraiseController {
62 @IgnoreSignature 62 @IgnoreSignature
63 public ApiResponse appraiseSuccess(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) { 63 public ApiResponse appraiseSuccess(@RequestBody AppraiseExpressInfoBo appraiseExpressInfoBo) {
64 logger.info("in appraiseSuccess, req {}", appraiseExpressInfoBo); 64 logger.info("in appraiseSuccess, req {}", appraiseExpressInfoBo);
65 - return appraiseService.appraiseSuccess(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum()); 65 + return appraiseService.appraiseSuccess(appraiseExpressInfoBo.getExpressCompanyId(), appraiseExpressInfoBo.getOrderCode(), appraiseExpressInfoBo.getWayBillCode(),appraiseExpressInfoBo.getDepotNum(),appraiseExpressInfoBo.getMobile());
66 } 66 }
67 67
68 } 68 }
@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSONObject; @@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSONObject;
4 import com.yoho.core.rabbitmq.YhConsumer; 4 import com.yoho.core.rabbitmq.YhConsumer;
5 import com.yohobuy.ufo.model.order.common.OrderStatus; 5 import com.yohobuy.ufo.model.order.common.OrderStatus;
6 import com.yohoufo.dal.order.BuyerOrderMapper; 6 import com.yohoufo.dal.order.BuyerOrderMapper;
  7 +import com.yohoufo.dal.order.SellerOrderGoodsMapper;
7 import com.yohoufo.dal.order.model.BuyerOrder; 8 import com.yohoufo.dal.order.model.BuyerOrder;
  9 +import com.yohoufo.dal.order.model.SellerOrderGoods;
8 import com.yohoufo.order.event.DeliverNoticeEvent; 10 import com.yohoufo.order.event.DeliverNoticeEvent;
9 import com.yohoufo.order.mq.TopicConstants; 11 import com.yohoufo.order.mq.TopicConstants;
10 import com.yohoufo.order.service.proxy.InBoxFacade; 12 import com.yohoufo.order.service.proxy.InBoxFacade;
@@ -30,6 +32,9 @@ public class NotDeliverNoticeDelayMsgConsumer implements YhConsumer { @@ -30,6 +32,9 @@ public class NotDeliverNoticeDelayMsgConsumer implements YhConsumer {
30 @Autowired 32 @Autowired
31 private BuyerOrderMapper buyerOrderMapper; 33 private BuyerOrderMapper buyerOrderMapper;
32 34
  35 + @Autowired
  36 + private SellerOrderGoodsMapper sellerOrderGoodsMapper;
  37 +
33 38
34 @Override 39 @Override
35 public void handleMessage(Object o) throws Exception { 40 public void handleMessage(Object o) throws Exception {
@@ -47,8 +52,17 @@ public class NotDeliverNoticeDelayMsgConsumer implements YhConsumer { @@ -47,8 +52,17 @@ public class NotDeliverNoticeDelayMsgConsumer implements YhConsumer {
47 } 52 }
48 BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCodeUid(orderCode, buyerUid); 53 BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCodeUid(orderCode, buyerUid);
49 if(OrderStatus.HAS_PAYED.getCode() == buyerOrder.getStatus().intValue()){ 54 if(OrderStatus.HAS_PAYED.getCode() == buyerOrder.getStatus().intValue()){
  55 + SellerOrderGoods sog = msg.getSellerOrderGoods();
  56 + if (sog == null){
  57 + sog = sellerOrderGoodsMapper.selectByPrimaryKey(msg.getSkup());
  58 + }
  59 + if (sog == null){
  60 + sog = new SellerOrderGoods();
  61 + sog.setUid(msg.getSellerUid());
  62 + sog.setProductName(msg.getPrdName());
  63 + }
50 LOGGER.info("ready notice sellerDeliverNotice, msg {}", msg); 64 LOGGER.info("ready notice sellerDeliverNotice, msg {}", msg);
51 - inBoxFacade.sellerDeliverNotice(msg.getSellerOrderGoods(),orderCode, 2); 65 + inBoxFacade.sellerDeliverNotice(sog,orderCode, 2);
52 } 66 }
53 67
54 68
@@ -7,7 +7,9 @@ import com.yohoufo.common.alarm.EventBusPublisher; @@ -7,7 +7,9 @@ import com.yohoufo.common.alarm.EventBusPublisher;
7 import com.yohoufo.common.alarm.SmsAlarmEvent; 7 import com.yohoufo.common.alarm.SmsAlarmEvent;
8 import com.yohoufo.common.utils.DateUtil; 8 import com.yohoufo.common.utils.DateUtil;
9 import com.yohoufo.dal.order.BuyerOrderMapper; 9 import com.yohoufo.dal.order.BuyerOrderMapper;
  10 +import com.yohoufo.dal.order.SellerOrderGoodsMapper;
10 import com.yohoufo.dal.order.model.BuyerOrder; 11 import com.yohoufo.dal.order.model.BuyerOrder;
  12 +import com.yohoufo.dal.order.model.SellerOrderGoods;
11 import com.yohoufo.dal.order.model.SellerWalletDetail; 13 import com.yohoufo.dal.order.model.SellerWalletDetail;
12 import com.yohoufo.order.common.BillTradeStatus; 14 import com.yohoufo.order.common.BillTradeStatus;
13 import com.yohoufo.order.common.RefundCase; 15 import com.yohoufo.order.common.RefundCase;
@@ -49,6 +51,9 @@ public class SellerOrderCancelDeliverDelayMsgConsumer implements YhConsumer { @@ -49,6 +51,9 @@ public class SellerOrderCancelDeliverDelayMsgConsumer implements YhConsumer {
49 @Autowired 51 @Autowired
50 private PayRefundService payRefundService; 52 private PayRefundService payRefundService;
51 53
  54 + @Autowired
  55 + private SellerOrderGoodsMapper sellerOrderGoodsMapper;
  56 +
52 public String getMessageTopic() { 57 public String getMessageTopic() {
53 return TopicConstants.SELLER_ORDER_AUTO_CANCEL_DELIVER; 58 return TopicConstants.SELLER_ORDER_AUTO_CANCEL_DELIVER;
54 } 59 }
@@ -91,7 +96,12 @@ public class SellerOrderCancelDeliverDelayMsgConsumer implements YhConsumer { @@ -91,7 +96,12 @@ public class SellerOrderCancelDeliverDelayMsgConsumer implements YhConsumer {
91 try{ 96 try{
92 payRefundService.refund(req, bleb); 97 payRefundService.refund(req, bleb);
93 // 98 //
94 - inBoxFacade.sellerDeliverNotice(event.getSellerOrderGoods(), orderCode,3); 99 + SellerOrderGoods sog = event.getSellerOrderGoods();
  100 + if (sog == null){
  101 + sog = sellerOrderGoodsMapper.selectByPrimaryKey(event.getSkup());
  102 + }
  103 +
  104 + inBoxFacade.sellerDeliverNotice(sog, orderCode,3);
95 }catch (Exception ex){ 105 }catch (Exception ex){
96 logger.warn("in topic {} , refund fail,req {}", getMessageTopic(), req, ex); 106 logger.warn("in topic {} , refund fail,req {}", getMessageTopic(), req, ex);
97 BillLogEvent buyererBillLogEvent = bleb.tradeStatus(BillTradeStatus.FAIL.getCode()) 107 BillLogEvent buyererBillLogEvent = bleb.tradeStatus(BillTradeStatus.FAIL.getCode())
@@ -35,7 +35,7 @@ public interface IExpressInfoService { @@ -35,7 +35,7 @@ public interface IExpressInfoService {
35 * @param orderCode 订单号 35 * @param orderCode 订单号
36 * @param wayBillCode 快递单号 36 * @param wayBillCode 快递单号
37 */ 37 */
38 - void returnBack(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum); 38 + void returnBack(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile);
39 39
40 /** 40 /**
41 * 商品鉴定不通过,鉴定中心寄回商品给卖家 41 * 商品鉴定不通过,鉴定中心寄回商品给卖家
@@ -44,7 +44,7 @@ public interface IExpressInfoService { @@ -44,7 +44,7 @@ public interface IExpressInfoService {
44 * @param orderCode 订单号 44 * @param orderCode 订单号
45 * @param wayBillCode 快递单号 45 * @param wayBillCode 快递单号
46 */ 46 */
47 - void appraiseFail(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum); 47 + void appraiseFail(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile);
48 48
49 /** 49 /**
50 * 商品鉴定通过,鉴定中心发货给买家 50 * 商品鉴定通过,鉴定中心发货给买家
@@ -54,7 +54,7 @@ public interface IExpressInfoService { @@ -54,7 +54,7 @@ public interface IExpressInfoService {
54 * @param orderCode 订单号 54 * @param orderCode 订单号
55 * @param wayBillCode 快递单号 55 * @param wayBillCode 快递单号
56 */ 56 */
57 - void appraiseSuccess(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum); 57 + void appraiseSuccess(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile);
58 58
59 /** 59 /**
60 * 根据订单号查询快递信息 60 * 根据订单号查询快递信息
@@ -18,6 +18,8 @@ import javax.annotation.PostConstruct; @@ -18,6 +18,8 @@ import javax.annotation.PostConstruct;
18 import java.security.SecureRandom; 18 import java.security.SecureRandom;
19 import java.util.List; 19 import java.util.List;
20 import java.util.concurrent.TimeUnit; 20 import java.util.concurrent.TimeUnit;
  21 +import java.util.stream.Collector;
  22 +import java.util.stream.Collectors;
21 23
22 /** 24 /**
23 * Created by li.ma on 2018/9/28. 25 * Created by li.ma on 2018/9/28.
@@ -67,6 +69,24 @@ public class AppraiseAddressService { @@ -67,6 +69,24 @@ public class AppraiseAddressService {
67 return appraiseAddressResps.get(0); 69 return appraiseAddressResps.get(0);
68 } 70 }
69 71
  72 +
  73 + // 根据默认鉴定中心地址
  74 + public AppraiseAddressResp queryInitAddressByDepotNum(int depotNum) {
  75 + List<AppraiseAddressResp> appraiseAddressResps = queryAddressInfoList();
  76 +
  77 + if (CollectionUtils.isEmpty(appraiseAddressResps)) {
  78 + return new AppraiseAddressResp.builder().setMobile("15010019250").setType(0).setAddressName("宫布朗").setAddress("北京市朝阳区建国路81号华贸写字楼1座3层 UFO飞碟好物【北京】实物鉴定中心").build();
  79 + }
  80 +
  81 + List<AppraiseAddressResp> collect = appraiseAddressResps.stream().filter(item -> item.getType() == depotNum).collect(Collectors.toList());
  82 +
  83 + if (CollectionUtils.isEmpty(collect)) {
  84 + return new AppraiseAddressResp.builder().setMobile("15010019250").setType(0).setAddressName("宫布朗").setAddress("北京市朝阳区建国路81号华贸写字楼1座3层 UFO飞碟好物【北京】实物鉴定中心").build();
  85 + }
  86 +
  87 + return collect.get(0);
  88 + }
  89 +
70 public List<AppraiseAddressResp> queryAddressInfoList() { 90 public List<AppraiseAddressResp> queryAddressInfoList() {
71 Object value=localCache.get(CACHE_KEY); 91 Object value=localCache.get(CACHE_KEY);
72 if(null == value) { 92 if(null == value) {
@@ -88,7 +88,7 @@ public class AppraiseService { @@ -88,7 +88,7 @@ public class AppraiseService {
88 private SellerService sellerService; 88 private SellerService sellerService;
89 89
90 90
91 - public ApiResponse appraiseSuccess(Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum){ 91 + public ApiResponse appraiseSuccess(Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile){
92 ApiResponse apiResponse=new ApiResponse(); 92 ApiResponse apiResponse=new ApiResponse();
93 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); 93 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
94 94
@@ -181,7 +181,7 @@ public class AppraiseService { @@ -181,7 +181,7 @@ public class AppraiseService {
181 BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build(); 181 BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build();
182 EventBusPublisher.publishEvent(buyerConfirmEvent); 182 EventBusPublisher.publishEvent(buyerConfirmEvent);
183 //记录物流信息 183 //记录物流信息
184 - expressInfoService.appraiseSuccess(buyerUid, expressCompanyId, orderCode, wayBillCode, depotNum); 184 + expressInfoService.appraiseSuccess(buyerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile);
185 //平台已发货给买家 185 //平台已发货给买家
186 inBoxFacade.appraisePassNotice(buyerUid, orderCode, sellerOrderGoods); 186 inBoxFacade.appraisePassNotice(buyerUid, orderCode, sellerOrderGoods);
187 }catch (Exception ex){ 187 }catch (Exception ex){
@@ -228,7 +228,7 @@ public class AppraiseService { @@ -228,7 +228,7 @@ public class AppraiseService {
228 * @param wayBillCode 228 * @param wayBillCode
229 * @return 229 * @return
230 */ 230 */
231 - public ApiResponse returnBack(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum){ 231 + public ApiResponse returnBack(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum,String mobile){
232 ApiResponse apiResponse=new ApiResponse(); 232 ApiResponse apiResponse=new ApiResponse();
233 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); 233 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
234 234
@@ -246,7 +246,7 @@ public class AppraiseService { @@ -246,7 +246,7 @@ public class AppraiseService {
246 246
247 //记录物流信息 247 //记录物流信息
248 int sellerUid = buyerOrder.getSellerUid(); 248 int sellerUid = buyerOrder.getSellerUid();
249 - expressInfoService.returnBack(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum); 249 + expressInfoService.returnBack(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile);
250 250
251 //发送消息 251 //发送消息
252 inBoxFacade.sendCancelledProductToSellerByCenter(sellerUid,wayBillCode); 252 inBoxFacade.sendCancelledProductToSellerByCenter(sellerUid,wayBillCode);
@@ -262,7 +262,7 @@ public class AppraiseService { @@ -262,7 +262,7 @@ public class AppraiseService {
262 * @param wayBillCode 262 * @param wayBillCode
263 * @return 263 * @return
264 */ 264 */
265 - public ApiResponse appraiseFail(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum){ 265 + public ApiResponse appraiseFail(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum,String mobile){
266 ApiResponse apiResponse=new ApiResponse(); 266 ApiResponse apiResponse=new ApiResponse();
267 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); 267 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
268 268
@@ -360,7 +360,7 @@ public class AppraiseService { @@ -360,7 +360,7 @@ public class AppraiseService {
360 }finally { 360 }finally {
361 361
362 //更新物流信息,写到最后 362 //更新物流信息,写到最后
363 - expressInfoService.appraiseFail(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum); 363 + expressInfoService.appraiseFail(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum,mobile);
364 } 364 }
365 365
366 }else{ 366 }else{
@@ -139,7 +139,12 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -139,7 +139,12 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
139 saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum); 139 saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum);
140 140
141 // 发送mq获取物流信息 141 // 发送mq获取物流信息
142 - sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode); 142 + String mobile ="";
  143 + AppraiseAddressResp appraiseAddressResp =appraiseAddressService.queryInitAddressByDepotNum(depotNum);
  144 + if(appraiseAddressResp!=null){
  145 + mobile = appraiseAddressResp.getMobile();
  146 + }
  147 + sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode,mobile);
143 psog = sellerOrderGoodsMapper.selectByPrimaryKey(skup); 148 psog = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
144 LOGGER.info("deliverToDepot end ! send express to erp "); 149 LOGGER.info("deliverToDepot end ! send express to erp ");
145 inBoxFacade.sellerDeliver2Depot(buyerUid, orderCode, psog.getProductName()); 150 inBoxFacade.sellerDeliver2Depot(buyerUid, orderCode, psog.getProductName());
@@ -157,47 +162,47 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -157,47 +162,47 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
157 } 162 }
158 163
159 @Override 164 @Override
160 - public void returnBack(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum){ 165 + public void returnBack(Integer sellerUid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile){
161 Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_REBACK; 166 Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_REBACK;
162 167
163 LOGGER.info("returnBack expressCompanyId = {}, orderCode = {}, wayBillCode = {} " + 168 LOGGER.info("returnBack expressCompanyId = {}, orderCode = {}, wayBillCode = {} " +
164 - ",expressType = {},depotNum={}", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum}); 169 + ",expressType = {},depotNum={},mobile={}", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum,mobile});
165 170
166 // 保存订单物流信息 171 // 保存订单物流信息
167 saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum); 172 saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum);
168 173
169 // 发送mq获取物流信息 174 // 发送mq获取物流信息
170 - sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode); 175 + sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode,mobile);
171 LOGGER.info("returnBack end ! send express to erp "); 176 LOGGER.info("returnBack end ! send express to erp ");
172 } 177 }
173 178
174 @Override 179 @Override
175 - public void appraiseFail(Integer sellerUid ,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum) { 180 + public void appraiseFail(Integer sellerUid ,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile) {
176 Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_3; 181 Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_3;
177 182
178 LOGGER.info("appraiseFail expressCompanyId = {}, orderCode = {}, wayBillCode = {} " + 183 LOGGER.info("appraiseFail expressCompanyId = {}, orderCode = {}, wayBillCode = {} " +
179 - ",expressType = {},depotNum={}", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum}); 184 + ",expressType = {},depotNum={},mobile={}", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum,mobile});
180 185
181 // 保存订单物流信息 186 // 保存订单物流信息
182 saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum); 187 saveExpress(sellerUid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum);
183 188
184 // 发送mq获取物流信息 189 // 发送mq获取物流信息
185 - sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode); 190 + sendExpressMQ(sellerUid,expressCompanyId,orderCode,wayBillCode,mobile);
186 LOGGER.info("appraiseFail end ! send express to erp "); 191 LOGGER.info("appraiseFail end ! send express to erp ");
187 } 192 }
188 193
189 @Override 194 @Override
190 - public void appraiseSuccess(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum) { 195 + public void appraiseSuccess(Integer uid,Integer expressCompanyId, Long orderCode, String wayBillCode,Integer depotNum,String mobile) {
191 Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_2; 196 Integer expressType = ExpressInfoConstant.EXPRESS_TYPE_2;
192 197
193 LOGGER.info("appraiseSuccess expressCompanyId = {}, orderCode = {}, wayBillCode = {} " + 198 LOGGER.info("appraiseSuccess expressCompanyId = {}, orderCode = {}, wayBillCode = {} " +
194 - ",expressType = {},depotNum={} ", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum}); 199 + ",expressType = {},depotNum={},mobile={} ", new Object[]{expressCompanyId, orderCode, wayBillCode,expressType,depotNum,mobile});
195 200
196 // 保存订单物流信息 201 // 保存订单物流信息
197 saveExpress(uid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum); 202 saveExpress(uid,expressCompanyId,orderCode,wayBillCode,expressType,depotNum);
198 203
199 // 发送mq获取物流信息 204 // 发送mq获取物流信息
200 - sendExpressMQ(uid,expressCompanyId,orderCode,wayBillCode); 205 + sendExpressMQ(uid,expressCompanyId,orderCode,wayBillCode,mobile);
201 LOGGER.info("appraiseSuccess end ! send express to erp "); 206 LOGGER.info("appraiseSuccess end ! send express to erp ");
202 } 207 }
203 208
@@ -227,13 +232,14 @@ public class ExpressInfoServiceImpl implements IExpressInfoService { @@ -227,13 +232,14 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
227 /** 232 /**
228 * 发送mq消息,获取物流信息 233 * 发送mq消息,获取物流信息
229 */ 234 */
230 - private void sendExpressMQ(Integer uid,Integer expressCompanyId,Long orderCode,String wayBillCode ){ 235 + private void sendExpressMQ(Integer uid,Integer expressCompanyId,Long orderCode,String wayBillCode,String mobile ){
231 ExpressForMqSend mqInfo=new ExpressForMqSend(); 236 ExpressForMqSend mqInfo=new ExpressForMqSend();
232 mqInfo.setExpressNumber(wayBillCode); 237 mqInfo.setExpressNumber(wayBillCode);
233 mqInfo.setExpressId(expressCompanyId); 238 mqInfo.setExpressId(expressCompanyId);
234 mqInfo.setOrderCode(orderCode); 239 mqInfo.setOrderCode(orderCode);
235 mqInfo.setUid(uid); 240 mqInfo.setUid(uid);
236 mqInfo.setBusinessType(5); 241 mqInfo.setBusinessType(5);
  242 + mqInfo.setMobile(mobile);
237 243
238 try{ 244 try{
239 ufoExpressInfoProducer.send(EXPRESS_MQ_SEND, mqInfo); 245 ufoExpressInfoProducer.send(EXPRESS_MQ_SEND, mqInfo);
@@ -129,6 +129,9 @@ public class PaymentServiceImpl implements IPaymentService { @@ -129,6 +129,9 @@ public class PaymentServiceImpl implements IPaymentService {
129 TradeBillsMapper tradeBillsMapper; 129 TradeBillsMapper tradeBillsMapper;
130 130
131 @Autowired 131 @Autowired
  132 + EntrySellerRechargeOrderMapper entrySellerRechargeOrderMapper;
  133 +
  134 + @Autowired
132 private BuyerCancelCompensateComputeHandler buyerCancelCompensateComputeHandler; 135 private BuyerCancelCompensateComputeHandler buyerCancelCompensateComputeHandler;
133 136
134 137
@@ -884,10 +887,27 @@ public class PaymentServiceImpl implements IPaymentService { @@ -884,10 +887,27 @@ public class PaymentServiceImpl implements IPaymentService {
884 throw new ServiceException(400, "manualDeal:流水已经处理过id=" + tradeBills.getId()); 887 throw new ServiceException(400, "manualDeal:流水已经处理过id=" + tradeBills.getId());
885 } 888 }
886 889
  890 + boolean isMerchantExit = false;
  891 + // 是否为退出入驻订单
  892 + CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
  893 + if(codeMeta.getType() == OrderCodeType.SELLER_RECHARGE_EARNEST_TYPE.getType()) {
  894 + EntrySellerRechargeOrder order = entrySellerRechargeOrderMapper.selectByOrderCode(orderCode);
  895 + if(order != null && order.getStatus() != null && order.getType() != null && order.getType() == 3) {
  896 + if (order.getStatus() == 0) {
  897 + isMerchantExit = true;
  898 + } else {
  899 + throw new ServiceException(400, "manualDeal:退款已成功,id=" + tradeBills.getId());
  900 + }
  901 + } else {
  902 + throw new ServiceException(400, "manualDeal:商家退出入驻订单异常,id=" + tradeBills.getId());
  903 + }
  904 + }
  905 +
887 // '1:买家uid; 2:卖家uid','1:保证金;2:货款;3:补偿款', '1:用户收入; 2:用户支出' 906 // '1:买家uid; 2:卖家uid','1:保证金;2:货款;3:补偿款', '1:用户收入; 2:用户支出'
888 try { 907 try {
889 - if (/* 退货款 */ (tradeBills.getUserType() == 1 && tradeBills.getTradeType() == 2 && tradeBills.getIncomeOutcome() == 1)  
890 - /* 退保证金 */ || (tradeBills.getUserType() == 2 && tradeBills.getTradeType() == 1 && tradeBills.getIncomeOutcome() == 1)) { 908 + if (/* 退货款 */((tradeBills.getUserType() == 1 && tradeBills.getTradeType() == 2 && tradeBills.getIncomeOutcome() == 1)
  909 + /* 退保证金(普通用户) */
  910 + || (tradeBills.getUserType() == 2 && tradeBills.getTradeType() == 1 && tradeBills.getIncomeOutcome() == 1 && !isMerchantExit))) {
891 logger.warn("manualDeal人工退款 , tradeBills is {}", tradeBills); 911 logger.warn("manualDeal人工退款 , tradeBills is {}", tradeBills);
892 PayRefundBo refundBo = manualRefund(orderCode, amount); 912 PayRefundBo refundBo = manualRefund(orderCode, amount);
893 if (refundBo.getRefundStatus() == RefundContant.PAYMENT_REFUND_RESULTCODE_SUCCESS) { 913 if (refundBo.getRefundStatus() == RefundContant.PAYMENT_REFUND_RESULTCODE_SUCCESS) {
1 package com.yohoufo.order.service.impl; 1 package com.yohoufo.order.service.impl;
2 2
  3 +import com.google.common.collect.Lists;
3 import com.yohoufo.dal.order.QiniuLiveRecordMapper; 4 import com.yohoufo.dal.order.QiniuLiveRecordMapper;
  5 +import com.yohoufo.dal.order.model.QiniuLiveRecord;
  6 +import org.apache.commons.lang3.StringUtils;
4 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.stereotype.Service; 8 import org.springframework.stereotype.Service;
6 9
  10 +import java.util.List;
  11 +
7 /** 12 /**
8 * Created by li.ma on 2018/12/14. 13 * Created by li.ma on 2018/12/14.
9 */ 14 */
10 @Service 15 @Service
11 public class QiniuLiveRecordService { 16 public class QiniuLiveRecordService {
  17 + public static final String LIVE_VEDIO_DOMAIN = "http://yhb-img01.qiniudn.com/";
  18 +
12 @Autowired 19 @Autowired
13 private QiniuLiveRecordMapper qiniuLiveRecordMapper; 20 private QiniuLiveRecordMapper qiniuLiveRecordMapper;
14 21
@@ -18,4 +25,16 @@ public class QiniuLiveRecordService { @@ -18,4 +25,16 @@ public class QiniuLiveRecordService {
18 qiniuLiveRecordMapper.updateStatusByPersistId(persistId, 1); // 更新直播记录状态为已转码成功 25 qiniuLiveRecordMapper.updateStatusByPersistId(persistId, 1); // 更新直播记录状态为已转码成功
19 } 26 }
20 } 27 }
  28 +
  29 + public QiniuLiveRecord selectByOrderCodes(Integer orderCode) {
  30 + QiniuLiveRecord qiniuLiveRecords = qiniuLiveRecordMapper.selectByOrderCodes(orderCode);
  31 +
  32 + if (null == qiniuLiveRecords || StringUtils.isEmpty(qiniuLiveRecords.getVedioFileUrl())) {
  33 + return null;
  34 + }
  35 +
  36 + qiniuLiveRecords.setVedioFileUrl(LIVE_VEDIO_DOMAIN + qiniuLiveRecords.getVedioFileUrl());
  37 +
  38 + return qiniuLiveRecords;
  39 + }
21 } 40 }
@@ -2,6 +2,7 @@ package com.yohoufo.product.service; @@ -2,6 +2,7 @@ package com.yohoufo.product.service;
2 2
3 import java.util.List; 3 import java.util.List;
4 4
  5 +import com.yoho.core.dal.datasource.annotation.Database;
5 import com.yohoufo.dal.product.model.StoragePrice; 6 import com.yohoufo.dal.product.model.StoragePrice;
6 import com.yohoufo.product.request.StoragePriceBo; 7 import com.yohoufo.product.request.StoragePriceBo;
7 import com.yohoufo.product.response.ProductDetailResp; 8 import com.yohoufo.product.response.ProductDetailResp;
@@ -48,6 +49,7 @@ public interface ProductService { @@ -48,6 +49,7 @@ public interface ProductService {
48 * @param skupList 49 * @param skupList
49 * @param status 50 * @param status
50 */ 51 */
  52 + @Database(ForceMaster = true)
51 void sellerBatchUpdateStatus(List<Integer> skupList, int status); 53 void sellerBatchUpdateStatus(List<Integer> skupList, int status);
52 54
53 List<StoragePrice> getStoragePriceBySkupList(List<Integer> skupList); 55 List<StoragePrice> getStoragePriceBySkupList(List<Integer> skupList);
@@ -13,6 +13,7 @@ import java.util.function.BinaryOperator; @@ -13,6 +13,7 @@ import java.util.function.BinaryOperator;
13 import java.util.function.Function; 13 import java.util.function.Function;
14 import java.util.stream.Collectors; 14 import java.util.stream.Collectors;
15 15
  16 +import com.yoho.core.dal.datasource.annotation.Database;
16 import org.apache.commons.lang3.StringUtils; 17 import org.apache.commons.lang3.StringUtils;
17 import org.slf4j.Logger; 18 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory; 19 import org.slf4j.LoggerFactory;
@@ -335,9 +336,10 @@ public class ProductServiceImpl implements ProductService{ @@ -335,9 +336,10 @@ public class ProductServiceImpl implements ProductService{
335 } 336 }
336 337
337 @Override 338 @Override
  339 + @Database(ForceMaster = true)
338 public void sellerBatchUpdateStatus(List<Integer> skupList, int status) { 340 public void sellerBatchUpdateStatus(List<Integer> skupList, int status) {
339 LOGGER.info("sellerBatchUpdateStatus in, skupList is {}, status is {}", skupList, status); 341 LOGGER.info("sellerBatchUpdateStatus in, skupList is {}, status is {}", skupList, status);
340 - // 卖家修改上下架状态:*1:可售(支付保证金),商家上架,104:商家下架 342 + // 卖家修改上下架状态:*1:可售(支付保证金),商家上架,4:商家下架
341 343
342 int updateNum = storagePriceMapper.batchUpdateStatus(skupList, status); 344 int updateNum = storagePriceMapper.batchUpdateStatus(skupList, status);
343 if(updateNum == 0) { 345 if(updateNum == 0) {
@@ -352,7 +354,7 @@ public class ProductServiceImpl implements ProductService{ @@ -352,7 +354,7 @@ public class ProductServiceImpl implements ProductService{
352 storage.setId(entry.getKey()); 354 storage.setId(entry.getKey());
353 if(status == 1) { 355 if(status == 1) {
354 storage.setStorageNum(entry.getValue().size()); 356 storage.setStorageNum(entry.getValue().size());
355 - }else if(status == 104) { 357 + }else if(status == 4) {
356 storage.setStorageNum(-entry.getValue().size()); 358 storage.setStorageNum(-entry.getValue().size());
357 } 359 }
358 360