Authored by chenchao

complete note

@@ -109,7 +109,9 @@ public class AppraiseService { @@ -109,7 +109,9 @@ public class AppraiseService {
109 109
110 private static final Logger LOGGER = LoggerFactory.getLogger(AppraiseService.class); 110 private static final Logger LOGGER = LoggerFactory.getLogger(AppraiseService.class);
111 111
112 - private ExecutorService executorService = new ThreadPoolExecutor(5, 10, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<>(1000), new PubThreadFactory("appraise-processor")); 112 + private ExecutorService executorService = new ThreadPoolExecutor(5, 10, 60, TimeUnit.SECONDS,
  113 + new ArrayBlockingQueue<>(1000),
  114 + new PubThreadFactory("appraise-processor"));
113 115
114 @Autowired 116 @Autowired
115 private IExpressInfoService expressInfoService; 117 private IExpressInfoService expressInfoService;
@@ -771,7 +773,17 @@ public class AppraiseService { @@ -771,7 +773,17 @@ public class AppraiseService {
771 return apiResponse; 773 return apiResponse;
772 } 774 }
773 775
774 - //更新卖家订单的状态,并清缓存 776 + /**
  777 + * 更新卖家订单的状态,并清缓存
  778 + * @param sellerUid
  779 + * @param sellerOrderCode
  780 + * @param expectSOStatus
  781 + * @param targetSoStatus
  782 + * @param skup
  783 + * @param orderCode
  784 + * @param buyerUid
  785 + * @return
  786 + */
775 private SellerOrderGoods updateSellerOrderStatusAndCleanCache(int sellerUid, 787 private SellerOrderGoods updateSellerOrderStatusAndCleanCache(int sellerUid,
776 long sellerOrderCode, 788 long sellerOrderCode,
777 SellerOrderStatus expectSOStatus, 789 SellerOrderStatus expectSOStatus,
@@ -1247,16 +1259,12 @@ public class AppraiseService { @@ -1247,16 +1259,12 @@ public class AppraiseService {
1247 */ 1259 */
1248 SellerOrderGoods sellerOrderGoods = updateSellerOrderStatusAndCleanCache(sellerUid, sellerOrderCode, expectSOStatus, targetSoStatus, 1260 SellerOrderGoods sellerOrderGoods = updateSellerOrderStatusAndCleanCache(sellerUid, sellerOrderCode, expectSOStatus, targetSoStatus,
1249 skup, orderCode, buyerUid); 1261 skup, orderCode, buyerUid);
1250 -  
1251 -  
1252 //退款给卖家(仅退一次) 1262 //退款给卖家(仅退一次)
1253 PaymentRequest refundReqOfSeller = operateMoneyWhenOk(buyerUid, orderCode, skup, sellerOrder, targetSoStatus); 1263 PaymentRequest refundReqOfSeller = operateMoneyWhenOk(buyerUid, orderCode, skup, sellerOrder, targetSoStatus);
1254 -  
1255 try { 1264 try {
1256 //记录订单的状态变更信息 1265 //记录订单的状态变更信息
1257 LOGGER.info("in judgeCenterPass record status change, orderCode {},uid {} ,sellerUid {}", orderCode, buyerUid, sellerUid); 1266 LOGGER.info("in judgeCenterPass record status change, orderCode {},uid {} ,sellerUid {}", orderCode, buyerUid, sellerUid);
1258 orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetOrderStatus.getCode()); 1267 orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetOrderStatus.getCode());
1259 -  
1260 //TODO 鉴定通过, 1268 //TODO 鉴定通过,
1261 Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null); 1269 Product product = Optional.ofNullable(sellerOrderGoods).map(SellerOrderGoods::getProductId).map(productMapper::selectByPrimaryKey).orElse(null);
1262 inBoxFacade.appraisePassNoticeSeller(buyerUid, orderCode, sellerOrderGoods, product); 1270 inBoxFacade.appraisePassNoticeSeller(buyerUid, orderCode, sellerOrderGoods, product);
@@ -1287,6 +1295,12 @@ public class AppraiseService { @@ -1287,6 +1295,12 @@ public class AppraiseService {
1287 return apiResponse; 1295 return apiResponse;
1288 } 1296 }
1289 1297
  1298 + /**
  1299 + * 鉴定通过转货款
  1300 + * @param sellerUid
  1301 + * @param skup
  1302 + * @param orderCode
  1303 + */
1290 private void transferGoodsMoneyWhenPass(Integer sellerUid, Integer skup, Long orderCode){ 1304 private void transferGoodsMoneyWhenPass(Integer sellerUid, Integer skup, Long orderCode){
1291 1305
1292 BigDecimal saleIncome = getSaleIncome(sellerUid, skup); 1306 BigDecimal saleIncome = getSaleIncome(sellerUid, skup);
@@ -1318,15 +1332,7 @@ public class AppraiseService { @@ -1318,15 +1332,7 @@ public class AppraiseService {
1318 */ 1332 */
1319 private PaymentRequest operateMoneyWhenOk(Integer buyerUid, Long orderCode, int skup, SellerOrder sellerOrder, SellerOrderStatus targetSoStatus) { 1333 private PaymentRequest operateMoneyWhenOk(Integer buyerUid, Long orderCode, int skup, SellerOrder sellerOrder, SellerOrderStatus targetSoStatus) {
1320 final Integer sellerUid = sellerOrder.getUid(); 1334 final Integer sellerUid = sellerOrder.getUid();
1321 - BigDecimal saleIncome = getSaleIncome(sellerUid, skup);  
1322 -  
1323 - TranseferCellNode transeferCellNode = new TranseferCellNode();  
1324 - transeferCellNode.setUid(sellerUid);  
1325 - transeferCellNode.setAmount(saleIncome);  
1326 -  
1327 -  
1328 transferGoodsMoneyWhenPass(sellerUid, skup, orderCode); 1335 transferGoodsMoneyWhenPass(sellerUid, skup, orderCode);
1329 -  
1330 //退保证金给卖家 1336 //退保证金给卖家
1331 //refund earnestMoney 1337 //refund earnestMoney
1332 BigDecimal earnestMoney = sellerOrder.getEarnestMoney(); 1338 BigDecimal earnestMoney = sellerOrder.getEarnestMoney();
@@ -1335,6 +1341,15 @@ public class AppraiseService { @@ -1335,6 +1341,15 @@ public class AppraiseService {
1335 return refundReqOfSeller; 1341 return refundReqOfSeller;
1336 } 1342 }
1337 1343
  1344 + /**
  1345 + * 鉴定通过,鉴定中心发货给买家
  1346 + * @param expressCompanyId
  1347 + * @param orderCode
  1348 + * @param wayBillCode
  1349 + * @param depotNum
  1350 + * @param mobile
  1351 + * @return
  1352 + */
1338 public ApiResponse appraiseSuccessAndDelivery(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum, String mobile) { 1353 public ApiResponse appraiseSuccessAndDelivery(Integer expressCompanyId, Long orderCode, String wayBillCode, Integer depotNum, String mobile) {
1339 ApiResponse apiResponse = new ApiResponse(); 1354 ApiResponse apiResponse = new ApiResponse();
1340 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); 1355 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);