test_class.file: service/settlement-service/src/test/java/com/meiduimall/service/settlement/api/WaterControllerTest.java
test_class.identifier: WaterControllerTest
test_class.superclass: extends BaseTest
test_case.body: @Test
  	public void testQueryWaterById() throws Exception {
  		ResultActions results = mockMvc
  				.perform(MockMvcRequestBuilders.post("/settlementservice/revenueservice/v1/querywaterbyid")
  						.param("waterId", "QL41010216121426").param("waterType", "3"))
  				.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: WaterControllerTest.testQueryWaterById()
test_case.full_signature: @Test public void testQueryWaterById()
test_case.identifier: testQueryWaterById
test_case.invocations: andExpect perform 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 testQueryWaterById()
focal_class.declarator: logger = LoggerFactory.getLogger(WaterController.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(WaterController.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: agentService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private AgentService agentService;
focal_class.type: AgentService
focal_class.var_name: agentService
focal_class.declarator: waterService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private WaterService waterService;
focal_class.type: WaterService
focal_class.var_name: waterService
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.file: service/settlement-service/src/main/java/com/meiduimall/service/settlement/api/WaterController.java
focal_class.identifier: WaterController
focal_class.class_method_signature: WaterController.queryWater(@RequestParam(value = "pageNumber", defaultValue = "1") int pageNumber,
  			@RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
  			@RequestParam(value = "type", defaultValue = "list") String type,
  			@RequestParam Map<String, Object> params, String waterType)
focal_class.full_signature: @PostMapping("/querywater") public ResBodyData queryWater(@RequestParam(value = "pageNumber", defaultValue = "1") int pageNumber,
  			@RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
  			@RequestParam(value = "type", defaultValue = "list") String type,
  			@RequestParam Map<String, Object> params, String waterType)
focal_class.identifier: queryWater
focal_class.modifiers: @PostMapping("/querywater") public
focal_class.parameters: (@RequestParam(value = "pageNumber", defaultValue = "1") int pageNumber,
  			@RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
  			@RequestParam(value = "type", defaultValue = "list") String type,
  			@RequestParam Map<String, Object> params, String waterType)
focal_class.return: ResBodyData
focal_class.signature: ResBodyData queryWater(@RequestParam(value = "pageNumber", defaultValue = "1") int pageNumber,
  			@RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
  			@RequestParam(value = "type", defaultValue = "list") String type,
  			@RequestParam Map<String, Object> params, String waterType)
focal_class.class_method_signature: WaterController.queryWaterById(String waterId, String waterType, Integer loginType, String code,
  			Integer pageNumber, Integer pageSize)
focal_class.full_signature: @PostMapping("/querywaterbyid") public ResBodyData queryWaterById(String waterId, String waterType, Integer loginType, String code,
  			Integer pageNumber, Integer pageSize)
focal_class.identifier: queryWaterById
focal_class.modifiers: @PostMapping("/querywaterbyid") public
focal_class.parameters: (String waterId, String waterType, Integer loginType, String code,
  			Integer pageNumber, Integer pageSize)
focal_class.return: ResBodyData
focal_class.signature: ResBodyData queryWaterById(String waterId, String waterType, Integer loginType, String code,
  			Integer pageNumber, Integer pageSize)
focal_class.class_method_signature: WaterController.getRecMoney(@RequestParam Map<String, Object> params)
focal_class.full_signature: @PostMapping("/getrecmoney") public ResBodyData getRecMoney(@RequestParam Map<String, Object> params)
focal_class.identifier: getRecMoney
focal_class.modifiers: @PostMapping("/getrecmoney") public
focal_class.parameters: (@RequestParam Map<String, Object> params)
focal_class.return: ResBodyData
focal_class.signature: ResBodyData getRecMoney(@RequestParam Map<String, Object> params)
focal_method.body: @PostMapping("/querywaterbyid")
  	public ResBodyData queryWaterById(String waterId, String waterType, Integer loginType, String code,
  			Integer pageNumber, Integer pageSize) {
  		
  		if(StringUtil.isEmpty(waterId) || StringUtil.isEmpty(waterType)){
  			logger.error("流水编号或流水类型不能为空");
  			throw new ServiceException(SettlementApiCode.WATERID_OR_WATERTYPE_ISNULL, BaseApiCode.getZhMsg(SettlementApiCode.WATERID_OR_WATERTYPE_ISNULL));
  		}
  
  		Map<String, Object> result = Maps.newHashMap();
  		
  		if(ShareProfitConstants.WATER_TYPE_DRAW_CASH.equals(waterType)){//提现流水详情
  			
  			result = waterService.getWaterType1Detail(waterId, waterType);
  			
  		}else if(ShareProfitConstants.WATER_TYPE_BILL.equals(waterType)){//账单流水详情
  			//1：代理 2：商家 3：其他(比如admin)
  			if(loginType==null){
  				logger.error("查询账单流水详情，登陆类型不能为空");
  				throw new ServiceException(SettlementApiCode.LOGIN_TYPE_ISNULL, BaseApiCode.getZhMsg(SettlementApiCode.LOGIN_TYPE_ISNULL));
  			}else if(loginType==1 && StringUtil.isEmpty(code)){
  				logger.error("查询账单流水详情，登陆类型为代理，代理编号不能为空");
  				throw new ServiceException(SettlementApiCode.LOGIN_TYPE_AGENTCODE_ISNULL, BaseApiCode.getZhMsg(SettlementApiCode.LOGIN_TYPE_AGENTCODE_ISNULL));
  			}
  			
  			Integer count = orderService.queryProfitCountByWaterId(waterId);
  			
  			List<EcmMzfShareProfit> shareProfitList=orderService.queryProfitByWaterByType(waterId,loginType,code,pageNumber,pageSize);
  			
  			result.put("shareProfitList", shareProfitList);
  			result.put("total", count);
  			
  		}else if(ShareProfitConstants.WATER_TYPE_AGENT_PROFIT.equals(waterType) || ShareProfitConstants.WATER_TYPE_DEPOSIT.equals(waterType)){//代理费流水详情,保证金流水详情
  			
  			result = waterService.getWaterDetail(waterId, waterType);
  		}
  		
  		return SettlementUtil.success(result);
  	}
focal_method.class_method_signature: WaterController.queryWaterById(String waterId, String waterType, Integer loginType, String code,
  			Integer pageNumber, Integer pageSize)
focal_method.full_signature: @PostMapping("/querywaterbyid") public ResBodyData queryWaterById(String waterId, String waterType, Integer loginType, String code,
  			Integer pageNumber, Integer pageSize)
focal_method.identifier: queryWaterById
focal_method.invocations: isEmpty isEmpty error getZhMsg newHashMap equals getWaterType1Detail equals error getZhMsg isEmpty error getZhMsg queryProfitCountByWaterId queryProfitByWaterByType put put equals equals getWaterDetail success
focal_method.modifiers: @PostMapping("/querywaterbyid") public
focal_method.parameters: (String waterId, String waterType, Integer loginType, String code,
  			Integer pageNumber, Integer pageSize)
focal_method.return: ResBodyData
focal_method.signature: ResBodyData queryWaterById(String waterId, String waterType, Integer loginType, String code,
  			Integer pageNumber, Integer pageSize)