@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()); } }); }
@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)){ 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); }
WaterController { @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)){ 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); } }
WaterController { @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)){ 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); }  }
WaterController { @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)){ 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); }  @PostMapping("/querywater") 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); @PostMapping("/querywaterbyid") ResBodyData queryWaterById(String waterId, String waterType, Integer loginType, String code,
			Integer pageNumber, Integer pageSize); @PostMapping("/getrecmoney") ResBodyData getRecMoney(@RequestParam Map<String, Object> params); }
WaterController { @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)){ 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); }  @PostMapping("/querywater") 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); @PostMapping("/querywaterbyid") ResBodyData queryWaterById(String waterId, String waterType, Integer loginType, String code,
			Integer pageNumber, Integer pageSize); @PostMapping("/getrecmoney") ResBodyData getRecMoney(@RequestParam Map<String, Object> params);  }