OrderController { @PostMapping("/shareprofit") public ResBodyData shareProfit(@Validated EcmOrder ecmOrder){ long start = System.currentTimeMillis(); log.info("share profit for order start:{}", start); Integer shareStatus = 1; boolean isExisted = orderService.checkShareProfitExisted(ecmOrder.getOrderSn()); if(isExisted){ throw new ServiceException(SettlementApiCode.ORDER_ALREADY_SHAREPROFIT, BaseApiCode.getZhMsg(SettlementApiCode.ORDER_ALREADY_SHAREPROFIT)); } EcmMzfShareProfit shareProfit = orderService.buildShareProfit(ecmOrder); if (shareProfit == null) { log.error("订单分润数据为空(shareProfit)"); throw new ServiceException(SettlementApiCode.ORDER_SHARE_DATA_EMPTY, BaseApiCode.getZhMsg(SettlementApiCode.ORDER_SHARE_DATA_EMPTY)); } orderService.saveShareProfit(shareProfit); asyncTaskService.updateScore2MemberSystem(shareProfit, ShareProfitConstants.SHARE_PROFIT_SOURCE_O2O, null); long end = System.currentTimeMillis(); log.info("share profit for order end:{}",end); log.info("total time(second) for shareprofit:{}", (end-start)/1000); return SettlementUtil.success(ImmutableMap.of("orderSn", ecmOrder.getOrderSn(), "shareStatus", shareStatus)); }  @PostMapping("/shareprofit") ResBodyData shareProfit(@Validated EcmOrder ecmOrder); @PostMapping(value="/queryorderstatus") ResBodyData queryOrderStatus(String[] orderSns); @PostMapping(value="/syncverifystatus") ResBodyData syncVerifyStatus(@Validated EcmMzfOrderStatus orderStatus); @PostMapping("/queryshareprofit") ResBodyData queryShareProfit(String[] orderSns); @PostMapping("/queryprofitbyrole") ResBodyData queryProfitByRole(String code,Integer accountRoleType); @PostMapping("/querytotalprofit") ResBodyData queryTotalProfit(String[] codes,Integer billStartDate,Integer billEndDate);  }
@Test public void testShareProfit() throws Exception { ResultActions results = mockMvc.perform(MockMvcRequestBuilders .post("/settlementservice/orderservice/v1/shareprofit").param("orderSn", "D4405110000011704060002").param("sellerName", "440511000001") .param("sellerPhone", "13410229865").param("buyerName", "13798431927").param("addTime", "1491462068").param("status", "20") .param("payTime", "1491462068").param("payAmount", "1800.00").param("goodsAmount", "9000.00") .param("discount", "0.20").param("orderAmount", "1800.00").param("totalFee", "1800.00").param("storeDiscount", "7200.00") .param("norebate", "0.00").param("coupons", "0.00").param("brokerage", "0.00").param("discountInfo", "2") .param("agentNoRegion", "440511").param("agentNoPersonal", "4405111112").param("agentNoRegionS", "") .param("agentNameRegion", "美兑壹购物").param("agentNameRegionS", "").param("isTwoHundredArea", "0") .param("serviceFee", "20").param("serviceFeeCalc", "0").param("rebateAmount", "1800.00")) .andExpect(status().isOk()); results.andDo(new ResultHandler() { @Override public void handle(MvcResult result) throws Exception { System.out.println("*********"+result.getResponse().getContentAsString()); } }); }