Authored by LUOXC

refactor

@@ -1417,7 +1417,7 @@ public class AppraiseService { @@ -1417,7 +1417,7 @@ public class AppraiseService {
1417 1417
1418 //平台已发货给买家 1418 //平台已发货给买家
1419 Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null); 1419 Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null);
1420 - inBoxFacade.appraisePassNoticeBuyer(buyerUid, orderCode, sellerOrderGoods); 1420 + inBoxFacade.appraisePassAndDeliveryGoodsToBuyerNoticeBuyer(buyerUid, orderCode, sellerOrderGoods);
1421 inBoxFacade.appraisePassNoticeSeller(buyerUid, orderCode, sellerOrderGoods); 1421 inBoxFacade.appraisePassNoticeSeller(buyerUid, orderCode, sellerOrderGoods);
1422 } catch (Exception ex) { 1422 } catch (Exception ex) {
1423 LOGGER.warn("in appraiseSuccess,refund fail, refundReqOfSeller {}", refundReqOfSeller, ex); 1423 LOGGER.warn("in appraiseSuccess,refund fail, refundReqOfSeller {}", refundReqOfSeller, ex);
@@ -44,7 +44,10 @@ public class BaseNoticeFacade { @@ -44,7 +44,10 @@ public class BaseNoticeFacade {
44 private final int uid; 44 private final int uid;
45 45
46 private InboxReqVO inBoxContent; 46 private InboxReqVO inBoxContent;
  47 + private Supplier<InboxReqVO> inBoxContentSupplier;
  48 +
47 private String smsContent; 49 private String smsContent;
  50 + private Supplier<String> smsContentSupplier;
48 51
49 private Supplier<SendMessageRspBo> pushSupplier; 52 private Supplier<SendMessageRspBo> pushSupplier;
50 53
@@ -57,11 +60,21 @@ public class BaseNoticeFacade { @@ -57,11 +60,21 @@ public class BaseNoticeFacade {
57 return this; 60 return this;
58 } 61 }
59 62
  63 + public Notice withInBox(Supplier<InboxReqVO> inBoxContentSupplier) {
  64 + this.inBoxContentSupplier = inBoxContentSupplier;
  65 + return this;
  66 + }
  67 +
60 public Notice withSms(InboxBusinessTypeEnum businessType, Object... args) { 68 public Notice withSms(InboxBusinessTypeEnum businessType, Object... args) {
61 smsContent = getReplacedContent(businessType.getContent(), args); 69 smsContent = getReplacedContent(businessType.getContent(), args);
62 return this; 70 return this;
63 } 71 }
64 72
  73 + public Notice withSms(Supplier<String> smsContentSupplier) {
  74 + this.smsContentSupplier = smsContentSupplier;
  75 + return this;
  76 + }
  77 +
65 public Notice withPush(Supplier<SendMessageRspBo> pushSupplier) { 78 public Notice withPush(Supplier<SendMessageRspBo> pushSupplier) {
66 this.pushSupplier = pushSupplier; 79 this.pushSupplier = pushSupplier;
67 return this; 80 return this;
@@ -70,16 +83,27 @@ public class BaseNoticeFacade { @@ -70,16 +83,27 @@ public class BaseNoticeFacade {
70 public void send() { 83 public void send() {
71 executorService.execute(() -> { 84 executorService.execute(() -> {
72 log.warn("send, uid {} inBoxContent {} smsContent {}", uid, inBoxContent, smsContent); 85 log.warn("send, uid {} inBoxContent {} smsContent {}", uid, inBoxContent, smsContent);
73 - try { 86 + InboxReqVO inBoxContent = getInBoxContent();
74 if (Objects.nonNull(inBoxContent)) { 87 if (Objects.nonNull(inBoxContent)) {
  88 + try {
75 InBoxResponse resp = inBoxSDK.addInbox(inBoxContent); 89 InBoxResponse resp = inBoxSDK.addInbox(inBoxContent);
76 log.info("send in box success, uid {}, content {} response {}", uid, inBoxContent, resp); 90 log.info("send in box success, uid {}, content {} response {}", uid, inBoxContent, resp);
  91 + } catch (Exception e) {
  92 + log.warn("send in box fail, uid {} content {}", uid, inBoxContent, e);
  93 + }
77 } 94 }
78 if (Objects.nonNull(pushSupplier)) { 95 if (Objects.nonNull(pushSupplier)) {
  96 + try {
79 SendMessageRspBo resp = pushSupplier.get(); 97 SendMessageRspBo resp = pushSupplier.get();
80 log.info("send push success, uid {}, response {}", uid, inBoxContent, resp); 98 log.info("send push success, uid {}, response {}", uid, inBoxContent, resp);
  99 + } catch (Exception e) {
  100 + log.warn("send push fail, uid {}", uid, e);
81 } 101 }
  102 + }
  103 +
  104 + String smsContent = getSmsContent();
82 if (Objects.nonNull(smsContent)) { 105 if (Objects.nonNull(smsContent)) {
  106 + try {
83 String phone = userProxyService.getMobile(uid); 107 String phone = userProxyService.getMobile(uid);
84 if (StringUtils.isBlank(phone)) { 108 if (StringUtils.isBlank(phone)) {
85 log.warn("send sms fail, uid {} content {} phone is blank", uid, smsContent); 109 log.warn("send sms fail, uid {} content {} phone is blank", uid, smsContent);
@@ -88,14 +112,45 @@ public class BaseNoticeFacade { @@ -88,14 +112,45 @@ public class BaseNoticeFacade {
88 sendSmsService.smsSendByMobile(smsContent, mobileList); 112 sendSmsService.smsSendByMobile(smsContent, mobileList);
89 log.info("send sms success, uid {} content {} phone {} ", uid, smsContent, phone); 113 log.info("send sms success, uid {} content {} phone {} ", uid, smsContent, phone);
90 } 114 }
91 - }  
92 } catch (Exception e) { 115 } catch (Exception e) {
93 - log.warn("send fail, uid {} inBoxContent {} smsContent {}", uid, inBoxContent, smsContent, e); 116 + log.warn("send sms fail, uid {} content {}", uid, smsContent, e);
  117 + }
94 } 118 }
  119 +
95 }); 120 });
96 } 121 }
97 122
98 - private String buildParams(Object... objects) { 123 + private InboxReqVO getInBoxContent() {
  124 + if (Objects.nonNull(inBoxContentSupplier)) {
  125 + try {
  126 + return inBoxContentSupplier.get();
  127 + } catch (Exception e) {
  128 + log.warn("send in box fail, uid {} get content fail", uid, e);
  129 + return null;
  130 + }
  131 + } else {
  132 + return this.inBoxContent;
  133 + }
  134 + }
  135 +
  136 + private String getSmsContent() {
  137 + if (Objects.nonNull(smsContentSupplier)) {
  138 + try {
  139 + return smsContentSupplier.get();
  140 + } catch (Exception e) {
  141 + log.warn("send sms fail, uid {} get content fail", uid, e);
  142 + return null;
  143 + }
  144 + } else {
  145 + return this.smsContent;
  146 + }
  147 + }
  148 +
  149 +
  150 +
  151 + }
  152 +
  153 + protected String buildParams(Object... objects) {
99 if (objects == null) { 154 if (objects == null) {
100 return null; 155 return null;
101 } 156 }
@@ -104,11 +159,10 @@ public class BaseNoticeFacade { @@ -104,11 +159,10 @@ public class BaseNoticeFacade {
104 return objects[0].toString(); 159 return objects[0].toString();
105 } 160 }
106 161
107 - String params = StringUtils.join(objects, ",");  
108 - return params; 162 + return StringUtils.join(objects, ",");
109 } 163 }
110 164
111 - private InboxReqVO buildInboxReqVO(int uid, String params, InboxBusinessTypeEnum ibt) { 165 + protected InboxReqVO buildInboxReqVO(int uid, String params, InboxBusinessTypeEnum ibt) {
112 InboxReqVO req = new InboxReqVO(); 166 InboxReqVO req = new InboxReqVO();
113 req.setType(ibt.getType()); 167 req.setType(ibt.getType());
114 req.setBusinessType(ibt.getBusinessType()); 168 req.setBusinessType(ibt.getBusinessType());
@@ -117,10 +171,12 @@ public class BaseNoticeFacade { @@ -117,10 +171,12 @@ public class BaseNoticeFacade {
117 return req; 171 return req;
118 } 172 }
119 173
120 - private String getReplacedContent(String content, Object... params) { 174 + protected String getReplacedContent(String content, Object... params) {
121 return MessageFormatter.arrayFormat(content, params).getMessage(); 175 return MessageFormatter.arrayFormat(content, params).getMessage();
122 } 176 }
123 177
  178 + protected String replaceSMSContent(InboxBusinessTypeEnum ibte, Object... params){
  179 + return getReplacedContent(ibte.getContent(), params);
124 } 180 }
125 181
126 } 182 }
@@ -64,7 +64,6 @@ public class BuyerNoticeFacade extends BaseNoticeFacade { @@ -64,7 +64,6 @@ public class BuyerNoticeFacade extends BaseNoticeFacade {
64 .withPush(() -> ufoSendService.platformDeliverBuyer(String.valueOf(buyerUid), String.valueOf(orderCode))) 64 .withPush(() -> ufoSendService.platformDeliverBuyer(String.valueOf(buyerUid), String.valueOf(orderCode)))
65 .send(); 65 .send();
66 66
67 - log.info("notice buyer delivery goods to buyer success, buyerUid {}, orderCode {}", buyerUid, orderCode);  
68 } catch (Exception e) { 67 } catch (Exception e) {
69 log.warn("notice buyer delivery goods to buyer fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e); 68 log.warn("notice buyer delivery goods to buyer fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e);
70 } 69 }
@@ -40,7 +40,7 @@ import java.util.function.Supplier; @@ -40,7 +40,7 @@ import java.util.function.Supplier;
40 * Created by chenchao on 2018/10/8. 40 * Created by chenchao on 2018/10/8.
41 */ 41 */
42 @Service 42 @Service
43 -public class InBoxFacade { 43 +public class InBoxFacade extends BaseNoticeFacade{
44 44
45 private final Logger logger = LoggerFactory.getLogger(getClass()); 45 private final Logger logger = LoggerFactory.getLogger(getClass());
46 46
@@ -74,49 +74,25 @@ public class InBoxFacade { @@ -74,49 +74,25 @@ public class InBoxFacade {
74 * @param buyerUid 74 * @param buyerUid
75 */ 75 */
76 public void buyerOrderNotPayed(int buyerUid, long orderCode) { 76 public void buyerOrderNotPayed(int buyerUid, long orderCode) {
77 - try {  
78 - executorService.execute(() -> {  
79 - String params = buildParams(orderCode);  
80 - InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.PURCHASE_UNPAID;  
81 - InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);  
82 -  
83 - //  
84 - InBoxResponse resp = inBoxSDK.addInbox(req);  
85 - logger.info("record buyerOrderNotPayed inbox msg, buyerUid {}, orderCode {}, resp {}",  
86 - buyerUid, orderCode, resp);  
87 -  
88 - //push  
89 - SendMessageRspBo bo = ufoSendService.buyerNotPay(String.valueOf(buyerUid),String.valueOf(orderCode));  
90 - logger.info("record buyerOrderNotPayed push buyer uid is {}, orderCode is {}, result is {}", buyerUid, orderCode, JSON.toJSONString(bo));  
91 - });  
92 - } catch (Exception e) {  
93 - logger.warn("InBoxFacade buyerOrderNotPayed error inbox msg, buyerUid {}, orderCode {} ",  
94 - buyerUid, orderCode, e);  
95 - } 77 + logger.info("notice buyer not paid, buyerUid {}, orderCode {}", buyerUid, orderCode);
  78 + newNotice(buyerUid)
  79 + .withInBox(InboxBusinessTypeEnum.PURCHASE_UNPAID, orderCode)
  80 + .withPush(() -> ufoSendService.buyerNotPay(String.valueOf(buyerUid), String.valueOf(orderCode)))
  81 + .send();
96 } 82 }
97 83
98 /** 84 /**
99 - * 已通知卖家发货:买家支付订单 85 + * 通知买家,已经支付成功已通知卖家发货
100 * 86 *
101 * @param buyerUid 87 * @param buyerUid
102 * @param orderCode 88 * @param orderCode
103 */ 89 */
104 - public void buyerFinishPaid(int buyerUid, long orderCode,int deliveryHours, String unit) {  
105 - try {  
106 - executorService.execute(() -> {  
107 - InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.PURCHASE_NOTIFIED_SELLER; 90 + public void buyerFinishPaid(int buyerUid, long orderCode, int deliveryHours, String unit) {
  91 + logger.info("notice buyer finish paid, buyerUid {}, orderCode {}", buyerUid, orderCode);
108 String timelimitDesc = new StringBuilder().append(deliveryHours).append(unit).toString(); 92 String timelimitDesc = new StringBuilder().append(deliveryHours).append(unit).toString();
109 - String params = buildParams(orderCode,timelimitDesc);  
110 - InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);  
111 -  
112 - InBoxResponse resp = inBoxSDK.addInbox(req);  
113 - logger.info("record buyerFinishPaid inbox msg, buyerUid {}, orderCode {}, resp {}",  
114 - buyerUid, orderCode, resp);  
115 - });  
116 - } catch (Exception e) {  
117 - logger.warn("InBoxFacade buyerFinishPaid error inbox msg, buyerUid {}, orderCode {} ",  
118 - buyerUid, orderCode, e);  
119 - } 93 + newNotice(buyerUid)
  94 + .withInBox(InboxBusinessTypeEnum.PURCHASE_NOTIFIED_SELLER, orderCode, timelimitDesc)
  95 + .send();
120 } 96 }
121 97
122 98
@@ -126,43 +102,26 @@ public class InBoxFacade { @@ -126,43 +102,26 @@ public class InBoxFacade {
126 * @param buyerUid 102 * @param buyerUid
127 * @param orderCode 103 * @param orderCode
128 */ 104 */
129 - public void sellerDeliver2Depot(int buyerUid, long orderCode,SellerOrderGoods psog ){  
130 - executorService.execute(()-> { 105 + public void sellerDeliver2Depot(int buyerUid, long orderCode, SellerOrderGoods psog) {
131 try { 106 try {
132 - String skupTypeText=SkupType.getSkupType(psog.getAttributes()).attrName();  
133 - String prdName = psog.getProductName();  
134 - InboxBusinessTypeEnum ibtOfBuyer = InboxBusinessTypeEnum.NOTICE_BUYER_WHEN_SELLER_DELIVER;  
135 - String params = buildParams(orderCode);  
136 - InboxReqVO req = buildInboxReqVO(buyerUid, params, ibtOfBuyer);  
137 - InBoxResponse resp = inBoxSDK.addInbox(req);  
138 - logger.info("record sellerDeliver2Depot inbox msg, buyerUid {}, orderCode {}, prdName {} resp {}",  
139 - buyerUid, orderCode, prdName, resp); 107 + executorService.execute(() -> {
140 108
141 - String sizeName= psog.getSizeName(); 109 + logger.info("notice buyer seller deliver 2 depot, buyerUid {}, orderCode {}", buyerUid, orderCode);
  110 + String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
  111 + String prdName = psog.getProductName();
  112 + String sizeName = psog.getSizeName();
142 Product product = productMapper.selectByPrimaryKey(psog.getProductId()); 113 Product product = productMapper.selectByPrimaryKey(psog.getProductId());
143 String productCode = product.getProductCode(); 114 String productCode = product.getProductCode();
144 115
145 - //发push  
146 - SendMessageRspBo bo = ufoSendService.sellerDeliverNotice(String.valueOf(buyerUid),String.valueOf(orderCode));  
147 - logger.info("record sellerDeliver2Depot push buyer uid is {}, orderCode is {}, result is {}", buyerUid, orderCode, JSON.toJSONString(bo));  
148 -  
149 - //sms  
150 - String phone = userProxyService.getMobile(buyerUid);  
151 - if (StringUtils.isBlank(phone)){  
152 - logger.warn("in sellerDeliver2Depot sms fail, buyerUid {} orderCode {} prdName {} ", buyerUid, orderCode,prdName);  
153 - return;  
154 - }  
155 - String content=getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_BUYER_WHEN_SELLER_DELIVER.getContent(),skupTypeText,prdName,sizeName,productCode,orderCode);  
156 - List<String> mobileList = Arrays.asList(phone);  
157 - sendSmsService.smsSendByMobile(content,mobileList);  
158 - logger.info("record sellerDeliver2Depot inbox sms msg, buyerUid {}, orderCode {}, prdName {} phone {}",  
159 - buyerUid, orderCode, prdName, phone);  
160 - 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)
  120 + .send();
  121 + });
161 } catch (Exception ex) { 122 } catch (Exception ex) {
162 - logger.warn("InBoxFacade depotDeliver2Buyer error inbox msg, buyerUid {}, orderCode {} ,prdName {}",  
163 - buyerUid, orderCode,psog, ex); 123 + logger.warn("notice buyer seller deliver 2 depot fail, buyerUid {}, orderCode {}", buyerUid, orderCode, ex);
164 } 124 }
165 - });  
166 } 125 }
167 126
168 /** 127 /**
@@ -170,92 +129,49 @@ public class InBoxFacade { @@ -170,92 +129,49 @@ public class InBoxFacade {
170 * 129 *
171 * @return 130 * @return
172 */ 131 */
173 - public void appraisePassNoticeBuyer(int buyerUid, long orderCode, SellerOrderGoods psog) {  
174 -  
175 - executorService.execute(()->{  
176 - 132 + public void appraisePassAndDeliveryGoodsToBuyerNoticeBuyer(int buyerUid, long orderCode, SellerOrderGoods psog) {
177 try { 133 try {
178 - logger.info("record appraisePassNotice inbox msg, buyerUid {}, orderCode {}, psog {},SellerOrderGoods {} ",  
179 - buyerUid, orderCode, psog, JSON.toJSONString(psog)); 134 + executorService.execute(() -> {
  135 + logger.info("notice buyer appraise pass, buyerUid {}, orderCode {}", buyerUid, orderCode);
180 Product product = productMapper.selectByPrimaryKey(psog.getProductId()); 136 Product product = productMapper.selectByPrimaryKey(psog.getProductId());
181 String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse(""); 137 String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse("");
182 - String skupTypeText=SkupType.getSkupType(psog.getAttributes()).attrName(); 138 + String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
183 String prdName = psog.getProductName(); 139 String prdName = psog.getProductName();
184 String sizeName = psog.getSizeName(); 140 String sizeName = psog.getSizeName();
185 - InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.PURCHASE_SENDED;  
186 - String params = buildParams(orderCode);  
187 - InboxReqVO req = buildInboxReqVO(buyerUid, params, ibt);  
188 -  
189 - InBoxResponse resp = inBoxSDK.addInbox(req);  
190 - logger.info("record appraisePassNotice inbox msg, buyerUid {}, orderCode {}, prdName {},SellerOrderGoods {} resp {}",  
191 - buyerUid, orderCode, prdName, JSON.toJSONString(psog), resp);  
192 141
193 - //短信  
194 - String phone = userProxyService.getMobile(buyerUid);  
195 - if (StringUtils.isBlank(phone)){  
196 - logger.warn("in appraisePassNotice notice buyer sms fail, buyerUid {} orderCode {} prdName {} ", buyerUid, orderCode,prdName);  
197 - }else{  
198 - List<String> mobileList = Arrays.asList(phone);  
199 - String content = getReplacedContent(InboxBusinessTypeEnum.SMS_SEND.getContent(),skupTypeText,prdName,sizeName,productCode,orderCode);  
200 - sendSmsService.smsSendByMobile(content,mobileList);  
201 - logger.info("record appraisePassNotice notice buyer sms msg, buyerUid {}, orderCode {}, prdName {} phone {}",  
202 - buyerUid, orderCode,prdName, phone);  
203 - } 142 + newNotice(buyerUid)
  143 + .withInBox(InboxBusinessTypeEnum.PURCHASE_SENDED, orderCode)
  144 + .withSms(InboxBusinessTypeEnum.SMS_SEND, skupTypeText, prdName, sizeName, productCode, orderCode)
  145 + .send();
  146 + });
204 } catch (Exception e) { 147 } catch (Exception e) {
205 - logger.warn("InBoxFacade appraisePassNotice error inbox msg, buyerUid {}, orderCode {} ,psog {}",  
206 - buyerUid, orderCode, psog, e); 148 + logger.warn("notice buyer appraise pass fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e);
207 } 149 }
208 - });  
209 -  
210 } 150 }
211 151
212 public void appraisePassNoticeSeller(int buyerUid, long orderCode, SellerOrderGoods psog) { 152 public void appraisePassNoticeSeller(int buyerUid, long orderCode, SellerOrderGoods psog) {
213 -  
214 - executorService.execute(()->{  
215 -  
216 try { 153 try {
217 - logger.info("record appraisePassNoticeSeller inbox msg, buyerUid {}, orderCode {}, psog {},SellerOrderGoods {} product {}",  
218 - buyerUid, orderCode, psog, JSON.toJSONString(psog)); 154 + executorService.execute(() -> {
  155 + logger.info("notice seller appraise pass, buyerUid {}, orderCode {}", buyerUid, orderCode);
219 String prdName = psog.getProductName(); 156 String prdName = psog.getProductName();
220 Product product = productMapper.selectByPrimaryKey(psog.getProductId()); 157 Product product = productMapper.selectByPrimaryKey(psog.getProductId());
221 String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse(""); 158 String productCode = Optional.ofNullable(product).map(Product::getProductCode).orElse("");
222 -  
223 - //seller notice  
224 String sizeName = psog.getSizeName(); 159 String sizeName = psog.getSizeName();
225 Integer sellerUid = psog.getUid(); 160 Integer sellerUid = psog.getUid();
226 - String skupTypeText=SkupType.getSkupType(psog.getAttributes()).attrName();  
227 - InboxBusinessTypeEnum ibtOfSeller = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_APPRAISE_PASS;  
228 - String paramsOfSeller = buildParams(skupTypeText,prdName, sizeName,productCode);  
229 - InboxReqVO reqOfSeller = buildInboxReqVO(sellerUid, paramsOfSeller, ibtOfSeller); 161 + String skupTypeText = SkupType.getSkupType(psog.getAttributes()).attrName();
230 162
231 - InBoxResponse respOfSeller = inBoxSDK.addInbox(reqOfSeller);  
232 - logger.info("record appraisePassNoticeSeller inbox msg, buyerUid {}, orderCode {}, prdName {} ,sizeName {} ,resp {}",  
233 - buyerUid, orderCode, prdName,sizeName, respOfSeller);  
234 - String phoneOfSeller = userProxyService.getMobile(sellerUid);  
235 - if (StringUtils.isBlank(phoneOfSeller)){  
236 - logger.warn("in appraisePassNoticeSeller sms fail, buyerUid {} orderCode {} prdName {} ", buyerUid, orderCode,prdName);  
237 - }else{  
238 - List<String> mobileList = Arrays.asList(phoneOfSeller);  
239 - String contentOfSeller = getReplacedContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_APPRAISE_PASS.getContent(),skupTypeText, orderCode);  
240 - sendSmsService.smsSendByMobile(contentOfSeller, mobileList);  
241 - logger.info("record appraisePassNoticeSeller sms msg notice seller, sellerUid {}, orderCode {}, prdName {} sizeName {} phone {}",  
242 - sellerUid, orderCode, prdName, sizeName, phoneOfSeller);  
243 - } 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)
  166 + .send();
  167 + });
244 168
245 } catch (Exception e) { 169 } catch (Exception e) {
246 - logger.warn("InBoxFacade appraisePassNoticeSeller error inbox msg, buyerUid {}, orderCode {} ,psog {}",  
247 - buyerUid, orderCode, psog, e); 170 + logger.warn("notice seller appraise pass fail, buyerUid {}, orderCode {}", buyerUid, orderCode, e);
248 } 171 }
249 - });  
250 172
251 } 173 }
252 - private String replaceSMSContent(InboxBusinessTypeEnum ibte, Object... params){  
253 - return getReplacedContent(ibte.getContent(), params);  
254 - }  
255 174
256 - private String getReplacedContent(String content ,Object... params) {  
257 - return MessageFormatter.arrayFormat(content, params).getMessage();  
258 - }  
259 175
260 /** 176 /**
261 * 订单生成,卖家取消售卖 177 * 订单生成,卖家取消售卖
@@ -1857,28 +1773,6 @@ public class InBoxFacade { @@ -1857,28 +1773,6 @@ public class InBoxFacade {
1857 } 1773 }
1858 } 1774 }
1859 1775
1860 - public InboxReqVO buildInboxReqVO(int uid, String params, InboxBusinessTypeEnum ibt) {  
1861 - InboxReqVO req = new InboxReqVO();  
1862 - req.setType(ibt.getType());  
1863 - req.setBusinessType(ibt.getBusinessType());  
1864 - //  
1865 - req.setUid(uid);  
1866 - req.setParams(params);  
1867 - return req;  
1868 - }  
1869 -  
1870 - public static String buildParams(Object... objects) {  
1871 - if (objects == null) {  
1872 - return null;  
1873 - }  
1874 -  
1875 - if (objects.length == 1) {  
1876 - return objects[0].toString();  
1877 - }  
1878 -  
1879 - String params = StringUtils.join(objects, ",");  
1880 - return params;  
1881 - }  
1882 1776
1883 1777
1884 } 1778 }