| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.token.TokenService; |
| | | import org.springframework.web.bind.annotation.CrossOrigin; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | return resultObject; |
| | | } |
| | | |
| | | /*String symbol=getParamValue(request,resultObject,"symbol"); |
| | | String symbol=getParamValue(request,resultObject,"symbol"); |
| | | if(null==symbol) return resultObject; |
| | | |
| | | String dailyRate=getParamValue(request,resultObject,"dailyRate"); |
| | | /*String dailyRate=getParamValue(request,resultObject,"dailyRate"); |
| | | if(null==dailyRate) return resultObject; |
| | | |
| | | String repayment=getParamValue(request,resultObject,"repayment"); |
| | |
| | | }*/ |
| | | |
| | | Date now = new Date(); |
| | | SimpleLoanOrder simpleLoanOrder=new SimpleLoanOrder(partyId,new BigDecimal(quota), "usdt"); |
| | | SimpleLoanOrder simpleLoanOrder=new SimpleLoanOrder(partyId,new BigDecimal(quota), symbol); |
| | | String uuid = UUIDGenerator.getUUID(); |
| | | simpleLoanOrder.setUuid(uuid); |
| | | simpleLoanOrder.setLendingInstitution(null); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 提交还款申请 |
| | | * @param request 请求对象 |
| | | * @return 申请结果 |
| | | */ |
| | | @GetMapping("/api/loan!refund.action") |
| | | public ResultObject refund(HttpServletRequest request) { |
| | | ResultObject resultObject = new ResultObject(); |
| | | |
| | | String partyId = SecurityUtils.getCurrentUserId(); |
| | | if(null==partyId) { |
| | | resultObject.setCode("1"); |
| | | resultObject.setMsg("通过Token获取partyId为空!"); |
| | | return resultObject; |
| | | } |
| | | |
| | | String orderNo=getParamValue(request,resultObject,"orderNo"); |
| | | if(null==orderNo) return resultObject; |
| | | |
| | | try { |
| | | boolean flag = loanService.refundLoanOrder(orderNo, partyId); |
| | | if (flag) { |
| | | resultObject.setMsg("提交成功"); |
| | | } else { |
| | | resultObject.setCode("1"); |
| | | resultObject.setMsg("提交失败"); |
| | | } |
| | | } catch(Throwable e) { |
| | | resultObject.setCode("1"); |
| | | resultObject.setMsg("程序错误"); |
| | | logger.error("error:", e); |
| | | } |
| | | |
| | | return resultObject; |
| | | } |
| | | |
| | | /** |
| | | * 查看借贷申请单列表 |
| | | * @param request 请求对象 |
| | | * @return 申请单列表 |