AgentController { @PostMapping("/sharedeposit") public ResBodyData shareDeposit(@Validated EcmAgent ecmAgent) { long start = System.currentTimeMillis(); logger.info("share profit for agent start:{}", start); List<EcmMzfAgentWater> shareResults = agentService.getShareProfitResult(ecmAgent.getId(), ecmAgent.getRecNo()); if(CollectionUtils.isNotEmpty(shareResults)){ throw new ServiceException(SettlementApiCode.ALREADY_SHAREPROIFT, BaseApiCode.getZhMsg(SettlementApiCode.ALREADY_SHAREPROIFT)); } List<Map<String, Object>> resultList = depositService.shareDeposit(ecmAgent); long end = System.currentTimeMillis(); logger.info("share profit for agent end:{}", end); logger.info("total time(second) for shareprofit:{}", (end - start) / 1000); if(CollectionUtils.isNotEmpty(resultList)){ return SettlementUtil.success(resultList); } return null; }  @PostMapping("/sharedeposit") ResBodyData shareDeposit(@Validated EcmAgent ecmAgent); @PostMapping("/sendscore") ResBodyData sendScore(@Validated EcmStore ecmStore); @PostMapping("/createaccoutbalance") ResBodyData createAccoutBalance(@Validated EcmMzfAccount ecmMzfAccount);  }
@Test public void testShareDeposit() throws Exception { ResultActions results = mockMvc.perform(MockMvcRequestBuilders .post("/settlementservice/agentservice/v1/sharedeposit") .param("id", "115").param("agentNo", "9999991112").param("bindPhone", "13410899920") .param("userName", "大区个代小天天").param("misUserId", "1gw_13410899920").param("companyName", "美兑o2o115") .param("cashDeposit", "6500").param("depositLeftAmount", "0").param("recommenderCode", "999999") .param("recommenderName", "大区联系人").param("recommenderPhone", "18999999999").param("recNo", "QTG999999161212001") .param("recType", "1").param("addAgentNo", "999999").param("addBindPhone", "18999999999") .param("addCompanyName", "大区").param("addDepositLeftAmount", "300")) .andExpect(status().isOk()); results.andDo(new ResultHandler() { @Override public void handle(MvcResult result) throws Exception { System.out.println("*********" + result.getResponse().getContentAsString()); } }); }