test_class.file: service/settlement-service/src/test/java/com/meiduimall/service/settlement/api/OrderControllerTest.java
test_class.identifier: OrderControllerTest
test_class.superclass: extends BaseTest
test_case.body: @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());
  			}
  		});
  	}
test_case.class_method_signature: OrderControllerTest.testShareProfit()
test_case.full_signature: @Test public void testShareProfit()
test_case.identifier: testShareProfit
test_case.invocations: andExpect perform param param param woHun ntNam param param param param param param param param param param param param param param param param param param param param param post isOk status andDo println getContentAsString getResponse
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testShareProfit()
focal_class.declarator: log = LoggerFactory.getLogger(OrderController.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(OrderController.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: orderService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private OrderService orderService;
focal_class.type: OrderService
focal_class.var_name: orderService
focal_class.declarator: asyncTaskService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private AsyncTaskService asyncTaskService;
focal_class.type: AsyncTaskService
focal_class.var_name: asyncTaskService
focal_class.file: service/settlement-service/src/main/java/com/meiduimall/service/settlement/api/OrderController.java
focal_class.identifier: OrderController
focal_class.class_method_signature: OrderController.shareProfit(@Validated EcmOrder ecmOrder)
focal_class.full_signature: @PostMapping("/shareprofit") public ResBodyData shareProfit(@Validated EcmOrder ecmOrder)
focal_class.identifier: shareProfit
focal_class.modifiers: @PostMapping("/shareprofit") public
focal_class.parameters: (@Validated EcmOrder ecmOrder)
focal_class.return: ResBodyData
focal_class.signature: ResBodyData shareProfit(@Validated EcmOrder ecmOrder)
focal_class.class_method_signature: OrderController.queryOrderStatus(String[] orderSns)
focal_class.full_signature: @PostMapping(value="/queryorderstatus") public ResBodyData queryOrderStatus(String[] orderSns)
focal_class.identifier: queryOrderStatus
focal_class.modifiers: @PostMapping(value="/queryorderstatus") public
focal_class.parameters: (String[] orderSns)
focal_class.return: ResBodyData
focal_class.signature: ResBodyData queryOrderStatus(String[] orderSns)
focal_class.class_method_signature: OrderController.syncVerifyStatus(@Validated EcmMzfOrderStatus orderStatus)
focal_class.full_signature: @PostMapping(value="/syncverifystatus") public ResBodyData syncVerifyStatus(@Validated EcmMzfOrderStatus orderStatus)
focal_class.identifier: syncVerifyStatus
focal_class.modifiers: @PostMapping(value="/syncverifystatus") public
focal_class.parameters: (@Validated EcmMzfOrderStatus orderStatus)
focal_class.return: ResBodyData
focal_class.signature: ResBodyData syncVerifyStatus(@Validated EcmMzfOrderStatus orderStatus)
focal_class.class_method_signature: OrderController.queryShareProfit(String[] orderSns)
focal_class.full_signature: @PostMapping("/queryshareprofit") public ResBodyData queryShareProfit(String[] orderSns)
focal_class.identifier: queryShareProfit
focal_class.modifiers: @PostMapping("/queryshareprofit") public
focal_class.parameters: (String[] orderSns)
focal_class.return: ResBodyData
focal_class.signature: ResBodyData queryShareProfit(String[] orderSns)
focal_class.class_method_signature: OrderController.queryProfitByRole(String code,Integer accountRoleType)
focal_class.full_signature: @PostMapping("/queryprofitbyrole") public ResBodyData queryProfitByRole(String code,Integer accountRoleType)
focal_class.identifier: queryProfitByRole
focal_class.modifiers: @PostMapping("/queryprofitbyrole") public
focal_class.parameters: (String code,Integer accountRoleType)
focal_class.return: ResBodyData
focal_class.signature: ResBodyData queryProfitByRole(String code,Integer accountRoleType)
focal_class.class_method_signature: OrderController.queryTotalProfit(String[] codes,Integer billStartDate,Integer billEndDate)
focal_class.full_signature: @PostMapping("/querytotalprofit") public ResBodyData queryTotalProfit(String[] codes,Integer billStartDate,Integer billEndDate)
focal_class.identifier: queryTotalProfit
focal_class.modifiers: @PostMapping("/querytotalprofit") public
focal_class.parameters: (String[] codes,Integer billStartDate,Integer billEndDate)
focal_class.return: ResBodyData
focal_class.signature: ResBodyData queryTotalProfit(String[] codes,Integer billStartDate,Integer billEndDate)
focal_method.body: @PostMapping("/shareprofit")
  	public ResBodyData shareProfit(@Validated EcmOrder ecmOrder){
  		
  		long start = System.currentTimeMillis();
  		log.info("share profit for order start:{}", start);
  		
  		//shareStatus:0-未分润,1-已分润
  		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);
  		
  		//保存分润数据到DB
  		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));
  	}
focal_method.class_method_signature: OrderController.shareProfit(@Validated EcmOrder ecmOrder)
focal_method.full_signature: @PostMapping("/shareprofit") public ResBodyData shareProfit(@Validated EcmOrder ecmOrder)
focal_method.identifier: shareProfit
focal_method.invocations: currentTimeMillis info checkShareProfitExisted getOrderSn getZhMsg buildShareProfit error getZhMsg saveShareProfit updateScore2MemberSystem currentTimeMillis info info success of getOrderSn
focal_method.modifiers: @PostMapping("/shareprofit") public
focal_method.parameters: (@Validated EcmOrder ecmOrder)
focal_method.return: ResBodyData
focal_method.signature: ResBodyData shareProfit(@Validated EcmOrder ecmOrder)