class DrawController {

	@PostMapping(value="/confirmdrawcashbyidbytype")
	public ResBodyData confirmDrawCashByIdByType(EcmMzfDraw ecmmzfdraw) {
		
		if(ecmmzfdraw.getType()!=null && ecmmzfdraw.getType()==1){  //1:转账成功；0：转账失败
			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);
	}

}