@Test public void testConfirmDrawCashByIdByType() throws Exception { ResultActions results = mockMvc .perform(MockMvcRequestBuilders.post("/settlementservice/drawservice/v1/confirmdrawcashbyidbytype") .param("drawCode", "QZ187147764266217033101").param("remark", "驳回原因").param("financeId", "1") .param("type", "1")) .andExpect(status().isOk()); results.andDo(new ResultHandler() { @Override public void handle(MvcResult result) throws Exception { System.out.println("*********" + result.getResponse().getContentAsString()); } }); }
@PostMapping(value="/confirmdrawcashbyidbytype") public ResBodyData confirmDrawCashByIdByType(EcmMzfDraw ecmmzfdraw) { if(ecmmzfdraw.getType()!=null && ecmmzfdraw.getType()==1){ ecmmzfdraw.setStatus(DrawCashConstants.STATUS_TRANSFER_SUCCESS); ecmmzfdraw.setFinanceStatus(DrawCashConstants.STATUS_TRANSFER_SUCCESS); }else{ if(StringUtil.isEmpty(ecmmzfdraw.getRemark())){ throw new ServiceException(SettlementApiCode.FAILURE_REASON, BaseApiCode.getZhMsg(SettlementApiCode.FAILURE_REASON)); } ecmmzfdraw.setStatus(DrawCashConstants.STATUS_TRANSFER_FAIL); ecmmzfdraw.setFinanceStatus(DrawCashConstants.STATUS_TRANSFER_FAIL); } ecmmzfdraw.setFinanceTime(DateUtil.getCurrentTimeSec()); ecmmzfdraw.setFinanceName(StringUtil.isEmpty(ecmmzfdraw.getFinanceName())?ADMIN:ecmmzfdraw.getFinanceName()); Map<String, Object> hashMap = drawService.confirmDrawCashByIdByType(ecmmzfdraw); return SettlementUtil.success(hashMap); }
DrawController { @PostMapping(value="/confirmdrawcashbyidbytype") public ResBodyData confirmDrawCashByIdByType(EcmMzfDraw ecmmzfdraw) { if(ecmmzfdraw.getType()!=null && ecmmzfdraw.getType()==1){ ecmmzfdraw.setStatus(DrawCashConstants.STATUS_TRANSFER_SUCCESS); ecmmzfdraw.setFinanceStatus(DrawCashConstants.STATUS_TRANSFER_SUCCESS); }else{ if(StringUtil.isEmpty(ecmmzfdraw.getRemark())){ throw new ServiceException(SettlementApiCode.FAILURE_REASON, BaseApiCode.getZhMsg(SettlementApiCode.FAILURE_REASON)); } ecmmzfdraw.setStatus(DrawCashConstants.STATUS_TRANSFER_FAIL); ecmmzfdraw.setFinanceStatus(DrawCashConstants.STATUS_TRANSFER_FAIL); } ecmmzfdraw.setFinanceTime(DateUtil.getCurrentTimeSec()); ecmmzfdraw.setFinanceName(StringUtil.isEmpty(ecmmzfdraw.getFinanceName())?ADMIN:ecmmzfdraw.getFinanceName()); Map<String, Object> hashMap = drawService.confirmDrawCashByIdByType(ecmmzfdraw); return SettlementUtil.success(hashMap); } }
DrawController { @PostMapping(value="/confirmdrawcashbyidbytype") public ResBodyData confirmDrawCashByIdByType(EcmMzfDraw ecmmzfdraw) { if(ecmmzfdraw.getType()!=null && ecmmzfdraw.getType()==1){ ecmmzfdraw.setStatus(DrawCashConstants.STATUS_TRANSFER_SUCCESS); ecmmzfdraw.setFinanceStatus(DrawCashConstants.STATUS_TRANSFER_SUCCESS); }else{ if(StringUtil.isEmpty(ecmmzfdraw.getRemark())){ throw new ServiceException(SettlementApiCode.FAILURE_REASON, BaseApiCode.getZhMsg(SettlementApiCode.FAILURE_REASON)); } ecmmzfdraw.setStatus(DrawCashConstants.STATUS_TRANSFER_FAIL); ecmmzfdraw.setFinanceStatus(DrawCashConstants.STATUS_TRANSFER_FAIL); } ecmmzfdraw.setFinanceTime(DateUtil.getCurrentTimeSec()); ecmmzfdraw.setFinanceName(StringUtil.isEmpty(ecmmzfdraw.getFinanceName())?ADMIN:ecmmzfdraw.getFinanceName()); Map<String, Object> hashMap = drawService.confirmDrawCashByIdByType(ecmmzfdraw); return SettlementUtil.success(hashMap); }  }
DrawController { @PostMapping(value="/confirmdrawcashbyidbytype") public ResBodyData confirmDrawCashByIdByType(EcmMzfDraw ecmmzfdraw) { if(ecmmzfdraw.getType()!=null && ecmmzfdraw.getType()==1){ ecmmzfdraw.setStatus(DrawCashConstants.STATUS_TRANSFER_SUCCESS); ecmmzfdraw.setFinanceStatus(DrawCashConstants.STATUS_TRANSFER_SUCCESS); }else{ if(StringUtil.isEmpty(ecmmzfdraw.getRemark())){ throw new ServiceException(SettlementApiCode.FAILURE_REASON, BaseApiCode.getZhMsg(SettlementApiCode.FAILURE_REASON)); } ecmmzfdraw.setStatus(DrawCashConstants.STATUS_TRANSFER_FAIL); ecmmzfdraw.setFinanceStatus(DrawCashConstants.STATUS_TRANSFER_FAIL); } ecmmzfdraw.setFinanceTime(DateUtil.getCurrentTimeSec()); ecmmzfdraw.setFinanceName(StringUtil.isEmpty(ecmmzfdraw.getFinanceName())?ADMIN:ecmmzfdraw.getFinanceName()); Map<String, Object> hashMap = drawService.confirmDrawCashByIdByType(ecmmzfdraw); return SettlementUtil.success(hashMap); }  @PostMapping(value="/queryaccoutbalance") ResBodyData queryAccoutBalance(String code); @PostMapping(value = "/drawcash") ResBodyData drawCash(@Validated EcmMzfDraw ecmMzfDraw); @PostMapping(value = "/querydrawcash") ResBodyData queryDrawCash(
			@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); @PostMapping(value="/querydrawcashbyid") ResBodyData queryDrawCashById(String drawCode); @PostMapping(value="/verifydrawcashbyid") ResBodyData verifyDrawCashById(EcmMzfDraw ecmmzfdraw); @PostMapping(value="/rejectdrawcashbyid") ResBodyData rejectDrawCashById(EcmMzfDraw ecmmzfdraw); @PostMapping(value="/confirmdrawcashbyidbytype") ResBodyData confirmDrawCashByIdByType(EcmMzfDraw ecmmzfdraw); }
DrawController { @PostMapping(value="/confirmdrawcashbyidbytype") public ResBodyData confirmDrawCashByIdByType(EcmMzfDraw ecmmzfdraw) { if(ecmmzfdraw.getType()!=null && ecmmzfdraw.getType()==1){ ecmmzfdraw.setStatus(DrawCashConstants.STATUS_TRANSFER_SUCCESS); ecmmzfdraw.setFinanceStatus(DrawCashConstants.STATUS_TRANSFER_SUCCESS); }else{ if(StringUtil.isEmpty(ecmmzfdraw.getRemark())){ throw new ServiceException(SettlementApiCode.FAILURE_REASON, BaseApiCode.getZhMsg(SettlementApiCode.FAILURE_REASON)); } ecmmzfdraw.setStatus(DrawCashConstants.STATUS_TRANSFER_FAIL); ecmmzfdraw.setFinanceStatus(DrawCashConstants.STATUS_TRANSFER_FAIL); } ecmmzfdraw.setFinanceTime(DateUtil.getCurrentTimeSec()); ecmmzfdraw.setFinanceName(StringUtil.isEmpty(ecmmzfdraw.getFinanceName())?ADMIN:ecmmzfdraw.getFinanceName()); Map<String, Object> hashMap = drawService.confirmDrawCashByIdByType(ecmmzfdraw); return SettlementUtil.success(hashMap); }  @PostMapping(value="/queryaccoutbalance") ResBodyData queryAccoutBalance(String code); @PostMapping(value = "/drawcash") ResBodyData drawCash(@Validated EcmMzfDraw ecmMzfDraw); @PostMapping(value = "/querydrawcash") ResBodyData queryDrawCash(
			@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); @PostMapping(value="/querydrawcashbyid") ResBodyData queryDrawCashById(String drawCode); @PostMapping(value="/verifydrawcashbyid") ResBodyData verifyDrawCashById(EcmMzfDraw ecmmzfdraw); @PostMapping(value="/rejectdrawcashbyid") ResBodyData rejectDrawCashById(EcmMzfDraw ecmmzfdraw); @PostMapping(value="/confirmdrawcashbyidbytype") ResBodyData confirmDrawCashByIdByType(EcmMzfDraw ecmmzfdraw);  }