| | |
| | | if(null != driver && driver.getApprovalStatus() == 2){ |
| | | return ResultUtil.error("该手机账号已审核通过,请直接登录。"); |
| | | } |
| | | // String idcardFront = driverRegisterWarpper.getIdcardFront(); |
| | | // MultipartFile file = MultipartFileUtil.fileToMultipartFile(new File(idcardFront)); |
| | | // JSONObject certificate = OCRUtil.certificate(2, file); |
| | | // if(null == certificate){ |
| | | // return ResultUtil.error("身份证识别失败"); |
| | | // } |
| | | // String idcode = certificate.getString("公民身份号码"); |
| | | // driver.setIdcard(idcode); |
| | | // |
| | | // |
| | | // String driverLicense = driverRegisterWarpper.getDriverLicense(); |
| | | // file = MultipartFileUtil.fileToMultipartFile(new File(driverLicense)); |
| | | // certificate = OCRUtil.certificate(5, file); |
| | | // if(null == certificate){ |
| | | // return ResultUtil.error("驾驶证识别失败"); |
| | | // } |
| | | // System.err.println("驾驶证:" + certificate.toString()); |
| | | // String driverLicenseNumber = certificate.getString("驾驶证号码"); |
| | | // driver.setDriverLicenseNumber(driverLicenseNumber); |
| | | // driver.setFirstCertificateTime(null); |
| | | |
| | | |
| | | //账号审核拒绝后的处理 |
| | | if(null != driver && driver.getApprovalStatus() == 3){ |
| | | try { |
| | | driver = new Driver(); |
| | | driver = setDriverParamete(driver, driverRegisterWarpper); |
| | | driver.setCreateTime(new Date()); |
| | | }catch (Exception e){ |
| | | return ResultUtil.error(e.getMessage()); |
| | | } |
| | | this.updateAllColumnById(driver); |
| | | this.insert(driver); |
| | | } |
| | | //新账号 |
| | | if(null == driver){ |
| | |
| | | } |
| | | driver.setCreateTime(new Date()); |
| | | this.insert(driver); |
| | | |
| | | //司机邀请注册奖励 |
| | | if(null != driver.getInviterId()){ |
| | | Driver driver1 = this.selectById(driver.getInviterId()); |
| | | SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 4)); |
| | | if(null != systemConfig){ |
| | | Integer num7 = JSON.parseObject(systemConfig.getContent()).getInteger("num7"); |
| | | if(num7 > 0){ |
| | | AccountChangeDetail accountChangeDetail = new AccountChangeDetail(); |
| | | accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3)); |
| | | accountChangeDetail.setUserType(2); |
| | | accountChangeDetail.setUserId(driver1.getId()); |
| | | accountChangeDetail.setType(2); |
| | | accountChangeDetail.setChangeType(5); |
| | | accountChangeDetail.setOldData(driver1.getIntegral().doubleValue()); |
| | | driver1.setIntegral(driver1.getIntegral() + num7); |
| | | accountChangeDetail.setNewData(driver1.getIntegral().doubleValue()); |
| | | accountChangeDetail.setExplain("邀请司机注册奖励"); |
| | | accountChangeDetailService.saveData(accountChangeDetail); |
| | | this.updateById(driver1); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | public Driver setDriverParamete(Driver driver, DriverRegisterWarpper driverRegisterWarpper) throws Exception{ |
| | | driver.setName(driverRegisterWarpper.getName()); |
| | | driver.setSex(driverRegisterWarpper.getSex()); |
| | | driver.setAvatar(driverRegisterWarpper.getAvatar()); |
| | | driver.setPhone(driverRegisterWarpper.getPhone()); |
| | | driver.setEmergencyContact(driverRegisterWarpper.getEmergencyContact()); |
| | | driver.setEmergencyPhone(driverRegisterWarpper.getEmergencyPhone()); |
| | | driver.setIdcard(driverRegisterWarpper.getIdcard()); |
| | | driver.setIdcardBack(driverRegisterWarpper.getIdcardBack()); |
| | | driver.setIdcardFront(driverRegisterWarpper.getIdcardFront()); |
| | | driver.setDriverLicenseNumber(driverRegisterWarpper.getIdcard()); |
| | | driver.setDriverLicense(driverRegisterWarpper.getDriverLicense()); |
| | | driver.setFirstCertificateTime(driverRegisterWarpper.getFirstCertificateTime()); |
| | | //注册地 |
| | | String code = driverRegisterWarpper.getCode(); |
| | | BranchOffice branchOffice = branchOfficeService.selectOne(new EntityWrapper<BranchOffice>().eq("districtCode", code).eq("status", 1)); |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil<TokenWarpper> driverLogin(String receiver, String phone, String code) throws Exception { |
| | | if(ToolUtil.isEmpty(receiver)){ |
| | | receiver = "+86"; |
| | | } |
| | | String value = redisUtil.getValue(receiver + phone); |
| | | if(!"12345".equals(code) && ToolUtil.isEmpty(value)){ |
| | | return ResultUtil.error("短信验证码无效"); |
| | |
| | | String out_trade_no = sdf.format(new Date()) + UUIDUtil.getNumberRandom(3); |
| | | RechargeRecord rechargeRecord = new RechargeRecord(); |
| | | rechargeRecord.setType(2); |
| | | rechargeRecord.setPayMethod(type); |
| | | rechargeRecord.setUserId(uid); |
| | | rechargeRecord.setCode(out_trade_no); |
| | | rechargeRecord.setAmount(amount); |
| | |
| | | |
| | | if(type == 1){ |
| | | ResultUtil weixinpay = payMoneyUtil.weixinpay("余额充值", "", out_trade_no, amount.toString(), "/base/driver/balanceRechargeCallback", "APP"); |
| | | if(weixinpay.getCode() != 200){ |
| | | if(weixinpay.getCode() != 10000){ |
| | | return weixinpay; |
| | | } |
| | | new Thread(new Runnable() { |
| | |
| | | String trade_state = map.get("trade_state"); |
| | | String transaction_id = map.get("transaction_id"); |
| | | if("REFUND".equals(trade_state) || "NOTPAY".equals(trade_state) || "CLOSED".equals(trade_state) || "REVOKED".equals(trade_state) || "PAYERROR".equals(trade_state)){ |
| | | rechargeRecordService.deleteById(rechargeRecord1.getId()); |
| | | rechargeRecord1.setRemark(trade_state); |
| | | rechargeRecordService.updateById(rechargeRecord1); |
| | | return; |
| | | } |
| | | if("SUCCESS".equals(trade_state)){ |
| | | rechargeRecord1.setRemark("SUCCESS"); |
| | | rechargeRecordService.updateById(rechargeRecord1); |
| | | |
| | | Driver driver1 = DriverServiceImpl.this.selectById(uid); |
| | | AccountChangeDetail accountChangeDetail = new AccountChangeDetail(); |
| | | accountChangeDetail.setUserType(2); |
| | |
| | | num++; |
| | | } |
| | | if(10 == num){ |
| | | rechargeRecordService.deleteById(rechargeRecord1.getId()); |
| | | rechargeRecord1.setRemark("支付超时"); |
| | | rechargeRecordService.updateById(rechargeRecord1); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | |
| | | } |
| | | if(type == 2){ |
| | | ResultUtil<String> alipay = payMoneyUtil.alipay("余额充值", "余额充值", out_trade_no, amount.toString(), "/base/driver/balanceRechargeCallbackAli"); |
| | | if(alipay.getCode() != 200){ |
| | | if(alipay.getCode() != 10000){ |
| | | return alipay; |
| | | } |
| | | new Thread(new Runnable() { |
| | |
| | | String tradeStatus = map.get("tradeStatus"); |
| | | String tradeNo = map.get("tradeNo"); |
| | | if("TRADE_CLOSED".equals(tradeStatus) || "TRADE_FINISHED".equals(tradeStatus)){ |
| | | rechargeRecordService.deleteById(rechargeRecord1.getId()); |
| | | rechargeRecord1.setRemark(tradeStatus); |
| | | rechargeRecordService.updateById(rechargeRecord1); |
| | | return; |
| | | } |
| | | if("TRADE_SUCCESS".equals(tradeStatus)){ |
| | | rechargeRecord1.setRemark("TRADE_SUCCESS"); |
| | | rechargeRecordService.updateById(rechargeRecord1); |
| | | Driver driver1 = DriverServiceImpl.this.selectById(uid); |
| | | AccountChangeDetail accountChangeDetail = new AccountChangeDetail(); |
| | | accountChangeDetail.setUserType(2); |
| | |
| | | num++; |
| | | } |
| | | if(10 == num){ |
| | | rechargeRecordService.deleteById(rechargeRecord1.getId()); |
| | | rechargeRecord1.setRemark("支付超时"); |
| | | rechargeRecordService.updateById(rechargeRecord1); |
| | | } |
| | | } |
| | | }catch (Exception e){ |