| | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.yami.trading.bean.loan.LoanParam; |
| | | import com.yami.trading.bean.loan.SimpleLoanOrder; |
| | | import com.yami.trading.bean.model.User; |
| | | import com.yami.trading.common.util.DateTimeTools; |
| | | import com.yami.trading.common.util.UUIDGenerator; |
| | | import com.yami.trading.common.web.ResultObject; |
| | | import com.yami.trading.security.common.util.SecurityUtils; |
| | | import com.yami.trading.service.syspara.SysparaService; |
| | | import com.yami.trading.service.user.UserService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | */ |
| | | @Autowired |
| | | private LoanService loanService; |
| | | |
| | | @Autowired |
| | | UserService userService; |
| | | |
| | | @Autowired |
| | | SysparaService sysparaService; |
| | | |
| | | /** |
| | | * Token服务 |
| | |
| | | return resultObject; |
| | | } |
| | | |
| | | String term=getParamValue(request,resultObject,"term"); |
| | | if(null==term) return resultObject; |
| | | /*String term=getParamValue(request,resultObject,"term"); |
| | | if(null==term) return resultObject;*/ |
| | | |
| | | String quota=getParamValue(request,resultObject,"quota"); |
| | | if(null==quota) return resultObject; |
| | |
| | | return resultObject; |
| | | } |
| | | |
| | | String symbol=getParamValue(request,resultObject,"symbol"); |
| | | User party = userService.getById(partyId); |
| | | if (party.getLoanLimit() == 0 || Integer.parseInt(quota) > party.getLoanLimit()) { |
| | | resultObject.setCode("1"); |
| | | resultObject.setMsg("贷款额度不足"); |
| | | return resultObject; |
| | | } |
| | | |
| | | /*String symbol=getParamValue(request,resultObject,"symbol"); |
| | | if(null==symbol) return resultObject; |
| | | |
| | | String dailyRate=getParamValue(request,resultObject,"dailyRate"); |
| | |
| | | if(null==img_idimg_1) return resultObject; |
| | | String img_idimg_2=getParamValue(request,resultObject,"reverseFile"); |
| | | if(null==img_idimg_2) return resultObject; |
| | | /*String img_idimg_3=getParamValue(request,resultObject,"fileList"); |
| | | if(null==img_idimg_3) return resultObject;*/ |
| | | String img_idimg_3=getParamValue(request,resultObject,"fileList"); |
| | | if(null==img_idimg_3) return resultObject; |
| | | String houseImgs=new StringBuilder(img_idimg_1).append(",").append(img_idimg_2).toString(); |
| | | |
| | | String incomeImg=request.getParameter("incomeImg"); |
| | | if(null==incomeImg || (incomeImg=incomeImg.trim()).isEmpty()) { |
| | | incomeImg=null; |
| | | } |
| | | }*/ |
| | | |
| | | Date now = new Date(); |
| | | SimpleLoanOrder simpleLoanOrder=new SimpleLoanOrder(partyId,new BigDecimal(quota),symbol); |
| | | SimpleLoanOrder simpleLoanOrder=new SimpleLoanOrder(partyId,new BigDecimal(quota), "usdt"); |
| | | String uuid = UUIDGenerator.getUUID(); |
| | | simpleLoanOrder.setUuid(uuid); |
| | | simpleLoanOrder.setLendingInstitution(new Integer(lendingInstitution)); |
| | | simpleLoanOrder.setRepayCycle(new Integer(repayCycle)); |
| | | simpleLoanOrder.setRepayment(new Integer(repayment)); |
| | | simpleLoanOrder.setDailyRate(new BigDecimal(dailyRate)); |
| | | simpleLoanOrder.setTerm(new Integer(term)); |
| | | simpleLoanOrder.setHouseImgs(houseImgs); |
| | | simpleLoanOrder.setIncomeImg(incomeImg); |
| | | simpleLoanOrder.setLendingInstitution(null); |
| | | simpleLoanOrder.setRepayCycle(null); |
| | | simpleLoanOrder.setRepayment(null); |
| | | BigDecimal rate = new BigDecimal(sysparaService.find("loan_rate").getSvalue()); |
| | | simpleLoanOrder.setDailyRate(rate); |
| | | simpleLoanOrder.setTerm(null); |
| | | simpleLoanOrder.setHouseImgs(null); |
| | | simpleLoanOrder.setIncomeImg(null); |
| | | simpleLoanOrder.setState(1); |
| | | simpleLoanOrder.setLendingName(lendingName); |
| | | simpleLoanOrder.setLendingName(null); |
| | | simpleLoanOrder.setCreateTime(now); |
| | | try { |
| | | boolean flag = loanService.addLoanOrder(simpleLoanOrder); |