|
@@ -20,7 +20,6 @@ import lombok.NonNull; |
|
@@ -20,7 +20,6 @@ import lombok.NonNull; |
20
|
import org.apache.commons.lang3.StringUtils;
|
20
|
import org.apache.commons.lang3.StringUtils;
|
21
|
import org.slf4j.Logger;
|
21
|
import org.slf4j.Logger;
|
22
|
import org.slf4j.LoggerFactory;
|
22
|
import org.slf4j.LoggerFactory;
|
23
|
-import org.slf4j.helpers.MessageFormatter;
|
|
|
24
|
import org.springframework.beans.factory.annotation.Autowired;
|
23
|
import org.springframework.beans.factory.annotation.Autowired;
|
25
|
import org.springframework.stereotype.Service;
|
24
|
import org.springframework.stereotype.Service;
|
26
|
|
25
|
|
|
@@ -33,8 +32,6 @@ import java.util.concurrent.ArrayBlockingQueue; |
|
@@ -33,8 +32,6 @@ import java.util.concurrent.ArrayBlockingQueue; |
33
|
import java.util.concurrent.ExecutorService;
|
32
|
import java.util.concurrent.ExecutorService;
|
34
|
import java.util.concurrent.ThreadPoolExecutor;
|
33
|
import java.util.concurrent.ThreadPoolExecutor;
|
35
|
import java.util.concurrent.TimeUnit;
|
34
|
import java.util.concurrent.TimeUnit;
|
36
|
-import java.util.function.Function;
|
|
|
37
|
-import java.util.function.Supplier;
|
|
|
38
|
|
35
|
|
39
|
/**
|
36
|
/**
|
40
|
* Created by chenchao on 2018/10/8.
|
37
|
* Created by chenchao on 2018/10/8.
|
|
@@ -96,29 +93,27 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
@@ -96,29 +93,27 @@ public class InBoxFacade extends BaseNoticeFacade{ |
96
|
}
|
93
|
}
|
97
|
|
94
|
|
98
|
|
95
|
|
99
|
-
|
|
|
100
|
/**
|
96
|
/**
|
101
|
* 卖家发货后
|
97
|
* 卖家发货后
|
|
|
98
|
+ *
|
102
|
* @param buyerUid
|
99
|
* @param buyerUid
|
103
|
* @param orderCode
|
100
|
* @param orderCode
|
104
|
*/
|
101
|
*/
|
105
|
public void sellerDeliver2Depot(int buyerUid, long orderCode, SellerOrderGoods psog) {
|
102
|
public void sellerDeliver2Depot(int buyerUid, long orderCode, SellerOrderGoods psog) {
|
106
|
try {
|
103
|
try {
|
107
|
- executorService.execute(() -> {
|
|
|
108
|
-
|
|
|
109
|
logger.info("notice buyer seller deliver 2 depot, buyerUid {}, orderCode {}", buyerUid, orderCode);
|
104
|
logger.info("notice buyer seller deliver 2 depot, buyerUid {}, orderCode {}", buyerUid, orderCode);
|
|
|
105
|
+ newNotice(buyerUid)
|
|
|
106
|
+ .withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_SELLER_DELIVER, orderCode)
|
|
|
107
|
+ .withPush(() -> ufoSendService.sellerDeliverNotice(String.valueOf(buyerUid), String.valueOf(orderCode)))
|
|
|
108
|
+ .withSms(() -> {
|
110
|
String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
|
109
|
String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
|
111
|
String prdName = psog.getProductName();
|
110
|
String prdName = psog.getProductName();
|
112
|
String sizeName = psog.getSizeName();
|
111
|
String sizeName = psog.getSizeName();
|
113
|
Product product = productMapper.selectByPrimaryKey(psog.getProductId());
|
112
|
Product product = productMapper.selectByPrimaryKey(psog.getProductId());
|
114
|
String productCode = product.getProductCode();
|
113
|
String productCode = product.getProductCode();
|
115
|
-
|
|
|
116
|
- newNotice(buyerUid)
|
|
|
117
|
- .withInBox(InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_SELLER_DELIVER, orderCode)
|
|
|
118
|
- .withPush(() -> ufoSendService.sellerDeliverNotice(String.valueOf(buyerUid), String.valueOf(orderCode)))
|
|
|
119
|
- .withSms(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_SELLER_DELIVER, skupTypeText, prdName, sizeName, productCode, orderCode)
|
114
|
+ return buildSmsContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_SELLER_DELIVER, skupTypeText, prdName, sizeName, productCode, orderCode);
|
|
|
115
|
+ })
|
120
|
.send();
|
116
|
.send();
|
121
|
- });
|
|
|
122
|
} catch (Exception ex) {
|
117
|
} catch (Exception ex) {
|
123
|
logger.warn("notice buyer seller deliver 2 depot fail, buyerUid {}, orderCode {}", buyerUid, orderCode, ex);
|
118
|
logger.warn("notice buyer seller deliver 2 depot fail, buyerUid {}, orderCode {}", buyerUid, orderCode, ex);
|
124
|
}
|
119
|
}
|
|
@@ -131,19 +126,18 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
@@ -131,19 +126,18 @@ public class InBoxFacade extends BaseNoticeFacade{ |
131
|
*/
|
126
|
*/
|
132
|
public void appraisePassAndDeliveryGoodsToBuyerNoticeBuyer(int buyerUid, long orderCode, SellerOrderGoods psog) {
|
127
|
public void appraisePassAndDeliveryGoodsToBuyerNoticeBuyer(int buyerUid, long orderCode, SellerOrderGoods psog) {
|
133
|
try {
|
128
|
try {
|
134
|
- executorService.execute(() -> {
|
|
|
135
|
logger.info("notice buyer appraise pass, buyerUid {}, orderCode {}", buyerUid, orderCode);
|
129
|
logger.info("notice buyer appraise pass, buyerUid {}, orderCode {}", buyerUid, orderCode);
|
|
|
130
|
+ newNotice(buyerUid)
|
|
|
131
|
+ .withInBox(InboxBusinessTypeEnum.PURCHASE_SENDED, orderCode)
|
|
|
132
|
+ .withSms(() -> {
|
136
|
Product product = productMapper.selectByPrimaryKey(psog.getProductId());
|
133
|
Product product = productMapper.selectByPrimaryKey(psog.getProductId());
|
137
|
String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse("");
|
134
|
String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse("");
|
138
|
String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
|
135
|
String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
|
139
|
String prdName = psog.getProductName();
|
136
|
String prdName = psog.getProductName();
|
140
|
String sizeName = psog.getSizeName();
|
137
|
String sizeName = psog.getSizeName();
|
141
|
-
|
|
|
142
|
- newNotice(buyerUid)
|
|
|
143
|
- .withInBox(InboxBusinessTypeEnum.PURCHASE_SENDED, orderCode)
|
|
|
144
|
- .withSms(InboxBusinessTypeEnum.SMS_SEND, skupTypeText, prdName, sizeName, productCode, orderCode)
|
138
|
+ return buildSmsContent(InboxBusinessTypeEnum.SMS_SEND, skupTypeText, prdName, sizeName, productCode, orderCode);
|
|
|
139
|
+ })
|
145
|
.send();
|
140
|
.send();
|
146
|
- });
|
|
|
147
|
} catch (Exception e) {
|
141
|
} catch (Exception e) {
|
148
|
logger.warn("notice buyer appraise pass fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e);
|
142
|
logger.warn("notice buyer appraise pass fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e);
|
149
|
}
|
143
|
}
|
|
@@ -151,20 +145,21 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
@@ -151,20 +145,21 @@ public class InBoxFacade extends BaseNoticeFacade{ |
151
|
|
145
|
|
152
|
public void appraisePassNoticeSeller(int buyerUid, long orderCode, SellerOrderGoods psog) {
|
146
|
public void appraisePassNoticeSeller(int buyerUid, long orderCode, SellerOrderGoods psog) {
|
153
|
try {
|
147
|
try {
|
154
|
- executorService.execute(() -> {
|
|
|
155
|
logger.info("notice seller appraise pass, buyerUid {}, orderCode {}", buyerUid, orderCode);
|
148
|
logger.info("notice seller appraise pass, buyerUid {}, orderCode {}", buyerUid, orderCode);
|
|
|
149
|
+ newNotice(psog.getUid())
|
|
|
150
|
+ .withInBox(() -> {
|
156
|
String prdName = psog.getProductName();
|
151
|
String prdName = psog.getProductName();
|
157
|
Product product = productMapper.selectByPrimaryKey(psog.getProductId());
|
152
|
Product product = productMapper.selectByPrimaryKey(psog.getProductId());
|
158
|
String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse("");
|
153
|
String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse("");
|
159
|
String sizeName = psog.getSizeName();
|
154
|
String sizeName = psog.getSizeName();
|
160
|
- Integer sellerUid = psog.getUid();
|
|
|
161
|
String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
|
155
|
String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
|
162
|
-
|
|
|
163
|
- newNotice(sellerUid)
|
|
|
164
|
- .withInBox(InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_PASS, skupTypeText, prdName, sizeName, productCode)
|
|
|
165
|
- .withSms(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_APPRAISE_PASS, skupTypeText, orderCode)
|
156
|
+ return buildInboxContent(InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_PASS,skupTypeText, prdName, sizeName, productCode);
|
|
|
157
|
+ })
|
|
|
158
|
+ .withSms(() -> {
|
|
|
159
|
+ String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
|
|
|
160
|
+ return buildSmsContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_APPRAISE_PASS, skupTypeText, orderCode);
|
|
|
161
|
+ })
|
166
|
.send();
|
162
|
.send();
|
167
|
- });
|
|
|
168
|
|
163
|
|
169
|
} catch (Exception e) {
|
164
|
} catch (Exception e) {
|
170
|
logger.warn("notice seller appraise pass fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e);
|
165
|
logger.warn("notice seller appraise pass fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e);
|
|
@@ -1475,7 +1470,7 @@ public class InBoxFacade extends BaseNoticeFacade{ |
|
@@ -1475,7 +1470,7 @@ public class InBoxFacade extends BaseNoticeFacade{ |
1475
|
if(autoReSell){
|
1470
|
if(autoReSell){
|
1476
|
sms=InboxBusinessTypeEnum.SMS_NOTICE_SELLER_AUTO_RESELL_WHEN_BUYER_CANCEL_NO_RESPONSIBILITY;
|
1471
|
sms=InboxBusinessTypeEnum.SMS_NOTICE_SELLER_AUTO_RESELL_WHEN_BUYER_CANCEL_NO_RESPONSIBILITY;
|
1477
|
}
|
1472
|
}
|
1478
|
- String content = replaceSMSContent(sms, orderCode,skupTypeText, prdName,sizeName,productCode);
|
1473
|
+ String content = buildSmsContent(sms, orderCode,skupTypeText, prdName,sizeName,productCode);
|
1479
|
sendSmsService.smsSendByMobile(content,mobileList);
|
1474
|
sendSmsService.smsSendByMobile(content,mobileList);
|
1480
|
logger.info("record noticeSellerWhenBuyerCancelNoResponsibility inbox sms msg, sellerUid {}, orderCode {},prdName {}",
|
1475
|
logger.info("record noticeSellerWhenBuyerCancelNoResponsibility inbox sms msg, sellerUid {}, orderCode {},prdName {}",
|
1481
|
sellerUid, orderCode, prdName);
|
1476
|
sellerUid, orderCode, prdName);
|