50个文件已修改
34个文件已删除
1个文件已添加
| | |
| | | <artifactId>hutool-all</artifactId> |
| | | <version>5.7.7</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>commons-fileupload</groupId> |
| | | <artifactId>commons-fileupload</artifactId> |
| | | <version>1.3.1</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/microenterprise") |
| | | // @ServiceLog(name = "绑定商户", url = "/api/driver/microenterprise") |
| | | @ApiOperation(value = "绑定商户", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "姓名", name = "name", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "身份证号码", name = "IDCode", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "手机号", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper microenterprise(String name, String IDCode, String phone){ |
| | | try { |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil resultUtil = driverService.microenterprise(uid, name, IDCode, phone); |
| | | return ResponseWarpper.success(resultUtil); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | // |
| | | // @ResponseBody |
| | | // @PostMapping("/api/driver/microenterprise") |
| | | //// @ServiceLog(name = "绑定商户", url = "/api/driver/microenterprise") |
| | | // @ApiOperation(value = "绑定商户", tags = {"司机端-个人中心"}, notes = "") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(value = "姓名", name = "name", required = true, dataType = "String"), |
| | | // @ApiImplicitParam(value = "身份证号码", name = "IDCode", required = true, dataType = "String"), |
| | | // @ApiImplicitParam(value = "手机号", name = "phone", required = true, dataType = "String"), |
| | | // @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | // }) |
| | | // public ResponseWarpper microenterprise(String name, String IDCode, String phone){ |
| | | // try { |
| | | // Integer uid = driverService.getUserByRequest(); |
| | | // if(null == uid){ |
| | | // return ResponseWarpper.tokenErr(); |
| | | // } |
| | | // ResultUtil resultUtil = driverService.microenterprise(uid, name, IDCode, phone); |
| | | // return ResponseWarpper.success(resultUtil); |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // return new ResponseWarpper(500, e.getMessage()); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/queryBank") |
| | | // @ServiceLog(name = "获取绑定的银行卡", url = "/api/driver/queryBank") |
| | | @ApiOperation(value = "获取绑定的银行卡", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper<DriverBank> queryBank(){ |
| | | try { |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | DriverBank driverId = driverBankService.selectOne(new EntityWrapper<DriverBank>().eq("driverId", uid)); |
| | | return ResponseWarpper.success(driverId); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | // @ResponseBody |
| | | // @PostMapping("/api/driver/queryBank") |
| | | //// @ServiceLog(name = "获取绑定的银行卡", url = "/api/driver/queryBank") |
| | | // @ApiOperation(value = "获取绑定的银行卡", tags = {"司机端-个人中心"}, notes = "") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | // }) |
| | | // public ResponseWarpper<DriverBank> queryBank(){ |
| | | // try { |
| | | // Integer uid = driverService.getUserByRequest(); |
| | | // if(null == uid){ |
| | | // return ResponseWarpper.tokenErr(); |
| | | // } |
| | | // DriverBank driverId = driverBankService.selectOne(new EntityWrapper<DriverBank>().eq("driverId", uid)); |
| | | // return ResponseWarpper.success(driverId); |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // return new ResponseWarpper(500, e.getMessage()); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/addDriverBank") |
| | | // @ServiceLog(name = "绑定银行卡", url = "/api/driver/addDriverBank") |
| | | @ApiOperation(value = "绑定银行卡", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "姓名", name = "name", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "身份证号码", name = "IDCode", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "手机号", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "银行卡号", name = "bankNumber", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper addDriverBank(String name, String phone, String IDCode, String bankNumber){ |
| | | try { |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil resultUtil = driverBankService.addDriverBank(uid, name, phone, IDCode, bankNumber); |
| | | return ResponseWarpper.success(resultUtil); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/delDriverBank") |
| | | // @ServiceLog(name = "解绑银行卡", url = "/api/driver/delDriverBank") |
| | | @ApiOperation(value = "解绑银行卡", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "银行卡id", name = "id", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper delDriverBank(Integer id){ |
| | | try { |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | ResultUtil resultUtil = driverBankService.delDriverBank(uid, id); |
| | | return ResponseWarpper.success(resultUtil); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | // @ResponseBody |
| | | // @PostMapping("/api/driver/addDriverBank") |
| | | //// @ServiceLog(name = "绑定银行卡", url = "/api/driver/addDriverBank") |
| | | // @ApiOperation(value = "绑定银行卡", tags = {"司机端-个人中心"}, notes = "") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(value = "姓名", name = "name", required = true, dataType = "String"), |
| | | // @ApiImplicitParam(value = "身份证号码", name = "IDCode", required = true, dataType = "String"), |
| | | // @ApiImplicitParam(value = "手机号", name = "phone", required = true, dataType = "String"), |
| | | // @ApiImplicitParam(value = "银行卡号", name = "bankNumber", required = true, dataType = "String"), |
| | | // @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | // }) |
| | | // public ResponseWarpper addDriverBank(String name, String phone, String IDCode, String bankNumber){ |
| | | // try { |
| | | // Integer uid = driverService.getUserByRequest(); |
| | | // if(null == uid){ |
| | | // return ResponseWarpper.tokenErr(); |
| | | // } |
| | | // ResultUtil resultUtil = driverBankService.addDriverBank(uid, name, phone, IDCode, bankNumber); |
| | | // return ResponseWarpper.success(resultUtil); |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // return new ResponseWarpper(500, e.getMessage()); |
| | | // } |
| | | // } |
| | | // |
| | | // |
| | | // @ResponseBody |
| | | // @PostMapping("/api/driver/delDriverBank") |
| | | //// @ServiceLog(name = "解绑银行卡", url = "/api/driver/delDriverBank") |
| | | // @ApiOperation(value = "解绑银行卡", tags = {"司机端-个人中心"}, notes = "") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(value = "银行卡id", name = "id", required = true, dataType = "int"), |
| | | // @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | // }) |
| | | // public ResponseWarpper delDriverBank(Integer id){ |
| | | // try { |
| | | // Integer uid = driverService.getUserByRequest(); |
| | | // if(null == uid){ |
| | | // return ResponseWarpper.tokenErr(); |
| | | // } |
| | | // ResultUtil resultUtil = driverBankService.delDriverBank(uid, id); |
| | | // return ResponseWarpper.success(resultUtil); |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // return new ResponseWarpper(500, e.getMessage()); |
| | | // } |
| | | // } |
| | | } |
| | |
| | | import com.agentdriving.driver.modular.system.model.DriverBank; |
| | | import com.agentdriving.driver.modular.system.service.IDriverBankService; |
| | | import com.agentdriving.driver.modular.system.service.IDriverService; |
| | | import com.agentdriving.driver.modular.system.util.MallBook.model.BindAccount; |
| | | import com.agentdriving.driver.modular.system.util.MallBook.model.InterfaceResponse; |
| | | import com.agentdriving.driver.modular.system.util.MallBook.model.UnbindAccount; |
| | | import com.agentdriving.driver.modular.system.util.MallBook.util.TrhRequest; |
| | | import com.agentdriving.driver.modular.system.util.ResultUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | driverBank.setName(name); |
| | | driverBank.setPhone(phone); |
| | | |
| | | BindAccount bindAccount = new BindAccount(); |
| | | bindAccount.setUserId(driver.getMerchantNumber()); |
| | | bindAccount.setCertId(IDCode); |
| | | bindAccount.setCardName(name); |
| | | bindAccount.setCardNo(bankNumber); |
| | | bindAccount.setBankAcctType("2"); |
| | | bindAccount.setPhone(phone); |
| | | TrhRequest<BindAccount> request = new TrhRequest(); |
| | | InterfaceResponse execute = request.execute(bindAccount, BindAccount.SERVICE_CODE); |
| | | if(!"0000".equals(execute.getResult())){ |
| | | return ResultUtil.error(execute.getMsg()); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | String status = jsonObject.getString("status"); |
| | | if("2".equals(status)){ |
| | | return ResultUtil.error("失败"); |
| | | } |
| | | if("0".equals(status)){ |
| | | return ResultUtil.error("处理中"); |
| | | } |
| | | this.insert(driverBank); |
| | | // BindAccount bindAccount = new BindAccount(); |
| | | // bindAccount.setUserId(driver.getMerchantNumber()); |
| | | // bindAccount.setCertId(IDCode); |
| | | // bindAccount.setCardName(name); |
| | | // bindAccount.setCardNo(bankNumber); |
| | | // bindAccount.setBankAcctType("2"); |
| | | // bindAccount.setPhone(phone); |
| | | // TrhRequest<BindAccount> request = new TrhRequest(); |
| | | // InterfaceResponse execute = request.execute(bindAccount, BindAccount.SERVICE_CODE); |
| | | // if(!"0000".equals(execute.getResult())){ |
| | | // return ResultUtil.error(execute.getMsg()); |
| | | // } |
| | | // JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | // String status = jsonObject.getString("status"); |
| | | // if("2".equals(status)){ |
| | | // return ResultUtil.error("失败"); |
| | | // } |
| | | // if("0".equals(status)){ |
| | | // return ResultUtil.error("处理中"); |
| | | // } |
| | | // this.insert(driverBank); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | if(ToolUtil.isEmpty(driver.getMerchantNumber())){ |
| | | return ResultUtil.error("请先注册商户"); |
| | | } |
| | | UnbindAccount unbindAccount = new UnbindAccount(); |
| | | unbindAccount.setUserId(driver.getMerchantNumber()); |
| | | |
| | | TrhRequest<UnbindAccount> request = new TrhRequest<>(); |
| | | InterfaceResponse execute = request.execute(unbindAccount, UnbindAccount.SERVICE_CODE); |
| | | if(!"0000".equals(execute.getResult())){ |
| | | return ResultUtil.error(execute.getMsg()); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | String status = jsonObject.getString("status"); |
| | | if("2".equals(status)){ |
| | | return ResultUtil.error("失败"); |
| | | } |
| | | if("0".equals(status)){ |
| | | return ResultUtil.error("处理中"); |
| | | } |
| | | this.deleteById(id); |
| | | // UnbindAccount unbindAccount = new UnbindAccount(); |
| | | // unbindAccount.setUserId(driver.getMerchantNumber()); |
| | | // |
| | | // TrhRequest<UnbindAccount> request = new TrhRequest<>(); |
| | | // InterfaceResponse execute = request.execute(unbindAccount, UnbindAccount.SERVICE_CODE); |
| | | // if(!"0000".equals(execute.getResult())){ |
| | | // return ResultUtil.error(execute.getMsg()); |
| | | // } |
| | | // JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | // String status = jsonObject.getString("status"); |
| | | // if("2".equals(status)){ |
| | | // return ResultUtil.error("失败"); |
| | | // } |
| | | // if("0".equals(status)){ |
| | | // return ResultUtil.error("处理中"); |
| | | // } |
| | | // this.deleteById(id); |
| | | return ResultUtil.success(); |
| | | } |
| | | } |
| | |
| | | import com.agentdriving.driver.modular.system.model.*; |
| | | import com.agentdriving.driver.modular.system.service.*; |
| | | import com.agentdriving.driver.modular.system.util.*; |
| | | import com.agentdriving.driver.modular.system.util.MallBook.model.InterfaceResponse; |
| | | import com.agentdriving.driver.modular.system.util.MallBook.model.Register; |
| | | import com.agentdriving.driver.modular.system.util.MallBook.util.TrhRequest; |
| | | import com.agentdriving.driver.modular.system.util.juhe.OCRUtil; |
| | | import com.agentdriving.driver.modular.system.util.mongodb.model.Location; |
| | | import com.agentdriving.driver.modular.system.util.rongyun.RongYunUtil; |
| | | import com.agentdriving.driver.modular.system.warpper.*; |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.agentdriving.driver.modular.system.model.*; |
| | | import com.agentdriving.driver.modular.system.service.*; |
| | | import com.agentdriving.driver.modular.system.util.*; |
| | | import com.agentdriving.driver.modular.system.warpper.*; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | | import org.apache.shiro.authc.UsernamePasswordToken; |
| | | import org.apache.shiro.authc.credential.HashedCredentialsMatcher; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | |
| | | 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){ |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil microenterprise(Integer uid, String name, String number, String phone) throws Exception { |
| | | Driver driver = this.selectById(uid); |
| | | Register registerVO = new Register(); |
| | | registerVO.setMerUserId("driver_" + uid); |
| | | registerVO.setPhone(phone); |
| | | registerVO.setUserType("0"); |
| | | registerVO.setUserName(name); |
| | | registerVO.setCertId(number); |
| | | registerVO.setNotifyUrl(""); |
| | | TrhRequest<Register> request = new TrhRequest(); |
| | | InterfaceResponse execute = request.execute(registerVO, Register.SERVICE_CODE); |
| | | if(!"0000".equals(execute.getResult())){ |
| | | return ResultUtil.error(execute.getMsg()); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | String status = jsonObject.getString("status"); |
| | | if("2".equals(status)){ |
| | | return ResultUtil.error("失败"); |
| | | } |
| | | if("0".equals(status)){ |
| | | return ResultUtil.error("处理中"); |
| | | } |
| | | String userId = jsonObject.getString("userId"); |
| | | driver.setMerchantNumber(userId); |
| | | driver.setMerchantIDCode(number); |
| | | driver.setMerchantName(name); |
| | | driver.setMerchantPhone(phone); |
| | | this.updateById(driver); |
| | | // Driver driver = this.selectById(uid); |
| | | // Register registerVO = new Register(); |
| | | // registerVO.setMerUserId("driver_" + uid); |
| | | // registerVO.setPhone(phone); |
| | | // registerVO.setUserType("0"); |
| | | // registerVO.setUserName(name); |
| | | // registerVO.setCertId(number); |
| | | // registerVO.setNotifyUrl(""); |
| | | // TrhRequest<Register> request = new TrhRequest(); |
| | | // InterfaceResponse execute = request.execute(registerVO, Register.SERVICE_CODE); |
| | | // if(!"0000".equals(execute.getResult())){ |
| | | // return ResultUtil.error(execute.getMsg()); |
| | | // } |
| | | // JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | // String status = jsonObject.getString("status"); |
| | | // if("2".equals(status)){ |
| | | // return ResultUtil.error("失败"); |
| | | // } |
| | | // if("0".equals(status)){ |
| | | // return ResultUtil.error("处理中"); |
| | | // } |
| | | // String userId = jsonObject.getString("userId"); |
| | | // driver.setMerchantNumber(userId); |
| | | // driver.setMerchantIDCode(number); |
| | | // driver.setMerchantName(name); |
| | | // driver.setMerchantPhone(phone); |
| | | // this.updateById(driver); |
| | | return ResultUtil.success(); |
| | | } |
| | | } |
| | |
| | | JSONArray chargeStandard = jsonObject.getJSONArray("ChargeStandard"); |
| | | JSONObject extraCost = jsonObject.getJSONObject("ExtraCost"); |
| | | Date date = new Date(); |
| | | for (int i = 0; i < chargeStandard.size(); i++) { |
| | | |
| | | boolean b = true; |
| | | for (int i = 1; i < chargeStandard.size(); i++) {//各种时间段 |
| | | JSONObject jsonObject1 = chargeStandard.getJSONObject(i); |
| | | String num1 = jsonObject1.getString("num1"); |
| | | String num2 = jsonObject1.getString("num2"); |
| | | Double num3 = jsonObject1.getDouble("num3");//起步里程 |
| | | Double num4 = jsonObject1.getDouble("num4");//起步价格 |
| | | Double num5 = jsonObject1.getDouble("num5");//超过公里 |
| | | Double num6 = jsonObject1.getDouble("num6");//超过num3每num5公里收取num6 |
| | | Double num7 = jsonObject1.getDouble("num7");//长途起始公里 |
| | | Double num8 = jsonObject1.getDouble("num8");//长途结束公里 |
| | | Double num9 = jsonObject1.getDouble("num9");//长途费 |
| | | Double num10 = jsonObject1.getDouble("num10");//超出长途里程每num10公里 |
| | | Double num11 = jsonObject1.getDouble("num11");//超过num8每num10公里收取num11 |
| | | JSONArray num3 = jsonObject1.getJSONArray("num3");//起步里程 |
| | | Double num4 = jsonObject1.getDouble("num4");//长途里程 |
| | | Double num5 = jsonObject1.getDouble("num5");//长途里程 |
| | | Double num6 = jsonObject1.getDouble("num6");//长途费 |
| | | Double num7 = jsonObject1.getDouble("num7");//超出长途里程每num10公里 |
| | | Double num8 = jsonObject1.getDouble("num8");//超过num8每num10公里收取num11 |
| | | |
| | | String[] split = num1.split(":"); |
| | | Calendar s = Calendar.getInstance(); |
| | |
| | | e.set(Calendar.SECOND, 0); |
| | | |
| | | if(date.getTime() >= s.getTimeInMillis() && date.getTime() < e.getTimeInMillis()){ |
| | | if(num3.compareTo(distance) >= 0){//起步里程内 |
| | | order.setStartDistance(distance);//起步里程 |
| | | order.setStartPrice(num4);//起步价 |
| | | }else{ |
| | | BigDecimal subtract = new BigDecimal(distance).subtract(new BigDecimal(num3));//超出起步里程 |
| | | BigDecimal divide = subtract.divide(new BigDecimal(num5), new MathContext(2, RoundingMode.HALF_EVEN)); |
| | | BigDecimal multiply = divide.multiply(new BigDecimal(num6)); |
| | | order.setStartDistance(num3);//起步里程 |
| | | order.setStartPrice(num4);//起步价 |
| | | order.setOverDriveDistance(subtract.doubleValue());//超出起步里程 |
| | | order.setOverDrivePrice(multiply.doubleValue());//超出起步里程费 |
| | | |
| | | b = false; |
| | | Double dd = 0d; |
| | | for (int j = 0; j < num3.size(); j++) { |
| | | JSONObject jsonObject2 = num3.getJSONObject(j); |
| | | Double num1_1 = jsonObject2.getDouble("num1"); |
| | | Double num2_1 = jsonObject2.getDouble("num2"); |
| | | Double num3_1 = jsonObject2.getDouble("num3"); |
| | | if(num1_1.compareTo(distance) <= 0 && num2_1.compareTo(distance) > 0){ |
| | | order.setStartDistance(distance);//起步里程 |
| | | order.setStartPrice(num3_1);//起步价 |
| | | } |
| | | if(j == num3.size() - 1 && order.getStartPrice() == 0){ |
| | | order.setStartDistance(num2_1);//起步里程 |
| | | order.setStartPrice(num3_1);//起步价 |
| | | dd = distance - num2_1; |
| | | } |
| | | } |
| | | if(dd != 0){ |
| | | //计算长途费 |
| | | if(distance.compareTo(num7) > 0){ |
| | | order.setLongDistance(num7 + "-" + num8);//长途里程 |
| | | order.setLongDistancePrice(num9);//长途费 |
| | | if(distance.compareTo(num4) > 0){ |
| | | order.setLongDistance(num4 + "-" + num5);//长途里程 |
| | | order.setLongDistancePrice(num6);//长途费 |
| | | } |
| | | //计算长途里程超出的部分 |
| | | if(distance.compareTo(num8) > 0){ |
| | | BigDecimal subtract1 = new BigDecimal(distance).subtract(new BigDecimal(num8)); |
| | | BigDecimal divide1 = subtract1.divide(new BigDecimal(num10), new MathContext(2, RoundingMode.HALF_EVEN)); |
| | | BigDecimal multiply1 = divide1.multiply(new BigDecimal(num11)); |
| | | if(distance.compareTo(num5) > 0){ |
| | | BigDecimal subtract1 = new BigDecimal(distance).subtract(new BigDecimal(num5)); |
| | | BigDecimal divide1 = subtract1.divide(new BigDecimal(num7), new MathContext(2, RoundingMode.HALF_EVEN)); |
| | | BigDecimal multiply1 = divide1.multiply(new BigDecimal(num8)); |
| | | order.setOverLongDistance(subtract1.doubleValue());//超出长途里程 |
| | | order.setOverLongDistancePrice(multiply1.doubleValue());//超出长途里程费 |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if(b){//默认配置 |
| | | JSONObject jsonObject1 = chargeStandard.getJSONObject(0); |
| | | JSONArray num3 = jsonObject1.getJSONArray("num3");//起步里程 |
| | | Double num4 = jsonObject1.getDouble("num4");//长途里程 |
| | | Double num5 = jsonObject1.getDouble("num5");//长途里程 |
| | | Double num6 = jsonObject1.getDouble("num6");//长途费 |
| | | Double num7 = jsonObject1.getDouble("num7");//超出长途里程每num10公里 |
| | | Double num8 = jsonObject1.getDouble("num8");//超过num8每num10公里收取num11 |
| | | |
| | | Double dd = 0d; |
| | | for (int j = 0; j < num3.size(); j++) { |
| | | JSONObject jsonObject2 = num3.getJSONObject(j); |
| | | Double num1_1 = jsonObject2.getDouble("num1"); |
| | | Double num2_1 = jsonObject2.getDouble("num2"); |
| | | Double num3_1 = jsonObject2.getDouble("num3"); |
| | | if(num1_1.compareTo(distance) <= 0 && num2_1.compareTo(distance) > 0){ |
| | | order.setStartDistance(distance);//起步里程 |
| | | order.setStartPrice(num3_1);//起步价 |
| | | } |
| | | if(j == num3.size() - 1 && order.getStartPrice() == 0){ |
| | | order.setStartDistance(num2_1);//起步里程 |
| | | order.setStartPrice(num3_1);//起步价 |
| | | dd = distance - num2_1; |
| | | } |
| | | } |
| | | if(dd != 0){ |
| | | //计算长途费 |
| | | if(distance.compareTo(num4) > 0){ |
| | | order.setLongDistance(num4 + "-" + num5);//长途里程 |
| | | order.setLongDistancePrice(num6);//长途费 |
| | | } |
| | | //计算长途里程超出的部分 |
| | | if(distance.compareTo(num5) > 0){ |
| | | BigDecimal subtract1 = new BigDecimal(distance).subtract(new BigDecimal(num5)); |
| | | BigDecimal divide1 = subtract1.divide(new BigDecimal(num7), new MathContext(2, RoundingMode.HALF_EVEN)); |
| | | BigDecimal multiply1 = divide1.multiply(new BigDecimal(num8)); |
| | | order.setOverLongDistance(subtract1.doubleValue());//超出长途里程 |
| | | order.setOverLongDistancePrice(multiply1.doubleValue());//超出长途里程费 |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | //恶劣天气 |
| | | systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 8)); |
| | | if(null != systemConfig) { |
| | | if(null != systemConfig){ |
| | | JSONObject jsonObject1 = JSON.parseObject(systemConfig.getContent()); |
| | | Integer num11 = jsonObject1.getInteger("num1");//开启恶劣天气计价 |
| | | if(1 == num11){ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | //计算折扣 |
| | | if(null != order.getUserId()){ |
| | | |
| | | } |
| | | |
| | | //计算总金额 |
| | | BigDecimal bigDecimal = new BigDecimal(order.getStartPrice() + order.getOverDrivePrice() + order.getLongDistancePrice() + order.getOverLongDistancePrice() + |
| | |
| | | Driver driver = driverService.selectById(order.getDriverId()); |
| | | driver.setServerStatus(1); |
| | | driverService.updateById(driver); |
| | | accountChangeDetailService.deductionInsurance();//扣减保险费 |
| | | saveIntegral(order); |
| | | break; |
| | | case 401: |
| | |
| | | /** |
| | | * 高德key |
| | | */ |
| | | String key = "e0370a9a4d10739045fb0b8f4742a67e"; |
| | | String key = "588845b621c3c42d6d6c8f50ba00cb41"; |
| | | } |
New file |
| | |
| | | package com.agentdriving.driver.modular.system.util; |
| | | |
| | | import org.apache.commons.fileupload.FileItem; |
| | | import org.apache.commons.fileupload.FileItemFactory; |
| | | import org.apache.commons.fileupload.disk.DiskFileItemFactory; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile; |
| | | |
| | | import java.io.*; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/5/23 18:29 |
| | | */ |
| | | public class MultipartFileUtil { |
| | | |
| | | private MultipartFileUtil() { } |
| | | |
| | | |
| | | public static MultipartFile fileToMultipartFile(File file) { |
| | | FileItem fileItem = createFileItem(file); |
| | | MultipartFile multipartFile = new CommonsMultipartFile(fileItem); |
| | | return multipartFile; |
| | | } |
| | | |
| | | private static FileItem createFileItem(File file) { |
| | | FileItemFactory factory = new DiskFileItemFactory(16, null); |
| | | FileItem item = factory.createItem("textField", "text/plain", true, file.getName()); |
| | | int bytesRead = 0; |
| | | byte[] buffer = new byte[8192]; |
| | | try { |
| | | FileInputStream fis = new FileInputStream(file); |
| | | OutputStream os = item.getOutputStream(); |
| | | while ((bytesRead = fis.read(buffer, 0, 8192)) != -1) { |
| | | os.write(buffer, 0, bytesRead); |
| | | } |
| | | os.close(); |
| | | fis.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return item; |
| | | } |
| | | } |
| | |
| | | @Scheduled(cron = "0 0 0 * * *") |
| | | public void taskDay(){ |
| | | try { |
| | | accountChangeDetailService.deductionInsurance(); |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | */ |
| | | public class OBSUtil { |
| | | |
| | | public static String endPoint = "https://obs.cn-south-1.myhuaweicloud.com"; |
| | | public static String ak = "N52IGR6DHOC3JAZFHZIW"; |
| | | public static String sk = "jq7Q7jnFS4Gxamwh3naN2sbNKwQQ7cZISPVumGBS"; |
| | | public static String bucketname = "csxdj"; |
| | | public static String endPoint = "https://obs.cn-southwest-2.myhuaweicloud.com"; |
| | | public static String ak = "YMBKC9LS6CDG9QHCIGUU"; |
| | | public static String sk = "kztanexutGzoGiYcIALCNhazfxoU6yecDOSBrFXu"; |
| | | public static String bucketname = "fanghuadaijia"; |
| | | |
| | | /** |
| | | * 上传文件 |
| | |
| | | // 待上传的本地文件路径,需要指定到具体的文件名 |
| | | PutObjectRequest request = new PutObjectRequest(); |
| | | request.setBucketName(bucketname); |
| | | request.setObjectKey(objectKey); |
| | | request.setObjectKey("img/" + objectKey); |
| | | request.setInput(inputStream); |
| | | PutObjectResult putObjectResult = obsClient.putObject(request); |
| | | return putObjectResult.getObjectUrl(); |
| | |
| | | |
| | | static Logger logger = LoggerFactory.getLogger("ServiceLog"); |
| | | |
| | | private final static String key = "5cc9622f299335639dbc046f3812c52a"; |
| | | private final static String key = "7589cb21f09f6ab1a1263ca98f0b4d52"; |
| | | |
| | | private static HttpClientUtil httpClientUtil = new HttpClientUtil(); |
| | | |
| | |
| | | |
| | | private final static String bad_weather = "[{\"wid\":\"03\",\"weather\":\"阵雨\"},{\"wid\":\"04\",\"weather\":\"雷阵雨\"},{\"wid\":\"05\",\"weather\":\"雷阵雨伴有冰雹\"},{\"wid\":\"06\",\"weather\":\"雨夹雪\"},{\"wid\":\"07\",\"weather\":\"小雨\"},{\"wid\":\"08\",\"weather\":\"中雨\"},{\"wid\":\"09\",\"weather\":\"大雨\"},{\"wid\":\"10\",\"weather\":\"暴雨\"},{\"wid\":\"11\",\"weather\":\"大暴雨\"},{\"wid\":\"12\",\"weather\":\"特大暴雨\"},{\"wid\":\"13\",\"weather\":\"阵雪\"},{\"wid\":\"14\",\"weather\":\"小雪\"},{\"wid\":\"15\",\"weather\":\"中雪\"},{\"wid\":\"16\",\"weather\":\"大雪\"},{\"wid\":\"17\",\"weather\":\"暴雪\"},{\"wid\":\"19\",\"weather\":\"冻雨\"},{\"wid\":\"20\",\"weather\":\"沙尘暴\"},{\"wid\":\"21\",\"weather\":\"小到中雨\"},{\"wid\":\"22\",\"weather\":\"中到大雨\"},{\"wid\":\"23\",\"weather\":\"大到暴雨\"},{\"wid\":\"24\",\"weather\":\"暴雨到大暴雨\"},{\"wid\":\"25\",\"weather\":\"大暴雨到特大暴雨\"},{\"wid\":\"26\",\"weather\":\"小到中雪\"},{\"wid\":\"27\",\"weather\":\"中到大雪\"},{\"wid\":\"28\",\"weather\":\"大到暴雪\"},{\"wid\":\"30\",\"weather\":\"扬沙\"},{\"wid\":\"31\",\"weather\":\"强沙尘暴\"},{\"wid\":\"53\",\"weather\":\"霾\"}]"; |
| | | |
| | | private final static String key = "aaebb3e5c18fd371257a2ab6b5670efe"; |
| | | private final static String key = "edc965edb129580401ed211eaa4ae8ab"; |
| | | |
| | | private static HttpClientUtil httpClientUtil = new HttpClientUtil(); |
| | | |
| | |
| | | private Integer cancelTimes; |
| | | @ApiModelProperty("与用户距离") |
| | | private Double currentDistance; |
| | | @ApiModelProperty("订单来源(1=用户创建,2=司机创建)") |
| | | @ApiModelProperty("订单来源(1=用户创建,2=司机创建,3=后台创建)") |
| | | private Integer source; |
| | | @ApiModelProperty("下单时间") |
| | | private Long createTime; |
| | |
| | | private Double currentDistance; |
| | | @ApiModelProperty("预估接驾时间") |
| | | private Integer pickUpTime; |
| | | @ApiModelProperty("订单来源(1=用户创建,2=司机创建)") |
| | | @ApiModelProperty("订单来源(1=用户创建,2=司机创建,3=后台创建)") |
| | | private Integer source; |
| | | @ApiModelProperty("下单时间") |
| | | private Long createTime; |
| | |
| | | application: |
| | | name: driver-server |
| | | profiles: |
| | | active: dev |
| | | # active: produce |
| | | # active: dev |
| | | active: produce |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/fh_agent_driving?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | # password: PI_v6J5@dvHwGTqc |
| | | password: 123456 |
| | | password: PI_v6J5@dvHwGTqc |
| | | # password: 123456 |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | |
| | | |
| | | wx: |
| | | grantType: authorization_code #填authorization_code |
| | | appid: wx8a9af3889395d0e1 #应用唯一标识,在微信开放平台提交应用审核通过后获得 |
| | | appSecret: 95a34f114973298cce4297a20bb59bc3 #应用密钥AppSecret,在微信开放平台提交应用审核通过后获得 |
| | | appid: wxa89b3291683bb3ff #应用唯一标识,在微信开放平台提交应用审核通过后获得 |
| | | appSecret: 3883f641d86c6f0e4e9365bbdaa1affe #应用密钥AppSecret,在微信开放平台提交应用审核通过后获得 |
| | | appletsAppid: 1 #小程序APPid |
| | | appletsAppSecret: 1 # |
| | | mchId: 1636941942 #微信支付分配的商户号 |
| | | key: Eri2GR2SB3b6iIhaoD7k3KQ8X0wf1Ybh #key为商户平台设置的密钥key: |
| | | apiv3: AKJ51Z4nhSqYBxmOXgUyCKA1vLP0J5Aj #key为商户平台设置的密钥key: |
| | | mchId: 1644659263 #微信支付分配的商户号 |
| | | key: KY7XYaJwnZPV4O5CvJ6CreywiUxxnUGM #key为商户平台设置的密钥key: |
| | | apiv3: mAhbxa2ez1GUNWIArATff4b630AH99yg #key为商户平台设置的密钥key: |
| | | |
| | | --- |
| | | |
| | | alipay: |
| | | appid: 2021001161600393 #应用程序唯一标识 |
| | | appPrivateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCEbTcG2wz+kaYDo2YxflpHE59MvKc3rbl6RlBgO6i5GzgphzeRTv5kRWUpSVkKCsbxFvAYLcgFPmm5nY2fz5hCTKiRcYfpUjH/OougUbzYU3ilUc9JqMbmvy7KN+Kv7+kQYCGLvMqlyYPiJ7LrmJLpE/FUcNLDwo6xUmwJSxaF7M4TbD3ZQZdddki1iJp9GihlqehZCMWOBeotEXvPKDEzSEkYlnvHPQaaspVgeesGmlHDuOiZUokENutxpjo7klWe97NA49hXEtI+xlczNGJKdBr0keBX/kSMsnx8kMxYDjh4QTySBaR6zlO4RYPFekWv9QZ2CrfiKCS7AHUpZYZ5AgMBAAECggEAXjCoUPIBHhhOcowIJe/vGlr0lUohzdJ8+GGGzcvhSDf6DF+mwG3lN0C8oU8QS7o6okRkZW46tLAd1u4fS6oGbDHGPBz6RJQ4B4eGxHMe1OcaCsxTmdq4DmuxRhfV3rnPldwqQA/6O01HxtXhxvzwkWOj5SGSZ7a8c5diTIHh9ULd6neUI/rIFC97mH1TeW0uDIxAtyvswz0pIfDhAR+lsOyTg/8qzsIXjpBFG4gAVxhUeUqQA5HzbsFglC08V7ViDk1OEoWi3yIj1CmNdtntJI4cxqLgTK7MNB9udhbN2I9YasuIpZvlAcvPi5R9cYT8vvFBCFGM+i22wtcsQmxdAQKBgQDaD9y6WNmsp+IaAUG3FqbJC8SqwreGIiEflWwVjrd+LuN6yhyr45CobOmhbTz0de8gRJEZKgJZEJcywL1ScrPIC4n1JaG688lk5aR+0Lik5fy1+L6G/CydJoJqlh6KKdwPJmDGpVu/geLJcLkWcYOwL56IL7GK2JI1p607R0x6iQKBgQCbd0n4xG9GkpvW4LDAJiMEhwPu9QcCKIT0mXVXCgMFdWel9bY3+8RSZoziWutaofm9tRHFAqwjbRyOZ+EdckkNsWVkkTnkKGtAhYKgM0GaOwdMFxmvME5WYJ74a5t1jiezDmR3obUBtS2nyQ8CFPUnlimoTR9F6APrth3h8uvwcQKBgFWaCn1AqdrEYNbyjViRVNHxg7fBDohiV3xtjOt9hfzL7VLjipPTlpL3hlNvbZFNxpx1LjyhqCBMif5LeUanbnnmRbbtmeqpDvNDzupVh1Z8TlMlHa4hymW6m1G6MqzsN83es/jnKvgnxd5sGMx9rUN5vhMaHekykVrswu1VVOl5AoGAMDljh7gfMEv/7TqLeT8bM6dR8AivoNrCy0Di5hnj8AiIGzHJ0TnWnxzSbNB5GwcNeew109/NV7vb1MyiRskRoh657eUiiQSEqGIBsAHWQqo2zEKKJA6e7ipQhYyTj3aGGAPJ5FYT2LDDtb0nW6T2ms34pA0wOzYKKU63nEQHLfECgYEAgbbpZJRtPxWB1M/Dg7loguT5O/VUsKefS0JrSD+tJIqYkumH5mejvYW5YEeDdelkvBhAEFUW9JOkzL+1w1g3wz2QQ2aPV/r55cJE3EfOzbwgw6GsO+8UuyiavbFhS3pFZNI0pR5M3u1+SIcLqQCnYLbO11vnEXglB6wjw9/oxPE= #开发者应用私钥 |
| | | alipayPublicKey: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhG03BtsM/pGmA6NmMX5aRxOfTLynN625ekZQYDuouRs4KYc3kU7+ZEVlKUlZCgrG8RbwGC3IBT5puZ2Nn8+YQkyokXGH6VIx/zqLoFG82FN4pVHPSajG5r8uyjfir+/pEGAhi7zKpcmD4iey65iS6RPxVHDSw8KOsVJsCUsWhezOE2w92UGXXXZItYiafRooZanoWQjFjgXqLRF7zygxM0hJGJZ7xz0GmrKVYHnrBppRw7jomVKJBDbrcaY6O5JVnvezQOPYVxLSPsZXMzRiSnQa9JHgV/5EjLJ8fJDMWA44eEE8kgWkes5TuEWDxXpFr/UGdgq34igkuwB1KWWGeQIDAQAB #应用公钥 |
| | | alipay_public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzmDrvcNvhexu3KkxVS9bemdSn6pyQUFmpyOGMDOirGR+RbmldpH2N9bPegzZynb5+bmRHii4ib31XeoXc7M7r6UsPhmPeLoSBNwpC+Uig0VxPa0hmvHjAl6StArhB3eMib6Zo40nM6eCYZLLZ1kKpI5Ad/APov9uLrbSnoeZsgeRibQix07arvTEsZq6pJavNlA+UBjp65o6Bv0+kfQ65pMTpbu+jRtTzkTj1hoW9PjwlWrY21F1FvN67zDWkTB2LjGFsqan0Qoe4/X8nK3VsDvkjIm/ZQsnQr8ZzfcuTzQPrcZpo3h9DPZoHeiToEfXtyk7E0bQHEmYVpmrvk/IJwIDAQAB #支付宝公钥 |
| | | |
| | | --- |
| | | |
| | | juhe: #聚合数据 |
| | | appKey: 0d3fd83eddaa33e5563f548257648577 # |
| | | appid: 111 #应用程序唯一标识 |
| | | appPrivateKey: 111 #开发者应用私钥 |
| | | alipayPublicKey: 111 #应用公钥 |
| | | alipay_public_key: 111 #支付宝公钥 |
| | | |
| | | |
| | | --- |
| | |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | # uri: mongodb://root:bv@_N36o+cTe1LpS@127.0.0.1:27017/admin |
| | | uri: mongodb://127.0.0.1:27017/admin |
| | | uri: mongodb://root:PaWPtGG95APCMBEb@127.0.0.1:27017/admin |
| | | # uri: mongodb://127.0.0.1:27017/admin |
| | | |
| | | --- |
| | | |
| | | rongyun: |
| | | app_key: k51hidwqkx92b |
| | | app_secret: t0jxbPrHHar |
| | | |
| | | |
| | | # mallbook 调起接口参数配置 |
| | | mallbook: |
| | | # pay_url:mallbook接口地址 测试环境: http://ld.mallbook.cn:12000/api 生产环境:https://cloudpay.mallbook.cn/api |
| | | pay_url: http://ld.mallbook.cn:12000/api |
| | | # merchant_no 业务系统商户平台编号,需替换为mallbook工作人员提供的商户编号 |
| | | merchant_no: 需要替换内容 |
| | | # version 接口版本号 |
| | | version: 1.0.0 |
| | | # channel_type 渠道类型 HF:汇付 |
| | | channel_type: HF |
| | | # merchant_private_key 商户平台私钥,需要替换成商户平台自己生成的私钥 |
| | | merchant_private_key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAIoGARvX6k6rVwuUW6HjAPkzXVntCtDI8q/niGZbeILc5T/noer+UNDECSy9f8T6ENw7tEKWaHOFcicrqgRv+wXeo2hPiJI2iYsUNs6I8ckd8i4uy/PBEDMW78GlnQLAatk0NC44HKjn8cuIHaETKNG2Vk3rwGBzNgDZ/God1L6JAgMBAAECgYBhCsOwzehBk5pJ2+9pLO+8Rm72EQGvtflb0BBI1zst1x2gBr4DOPedMJe6yymQVrmP/rJItvONdV/DRqHtKMZ2Wa4ul/U1mDnAtS/FkpRYBA5FaXV2hNEW11xBLhL5iGk35P23Bzaa0MJw9Vsd0vjeykridIw/PweDyTdeRBwC2QJBANS+iOaKRuf6BRwCKDmBSHOiZmc/kKnpx2f5BD3h+LWEX3JsNxObMbW1SxQIf2/qwqzIoEm/WbWaOyuwtRZkXQ8CQQCmFjTm5l+Ws2LoQgM+5+eLmPyMyRFOu4G8yqsUkhKuANHK/qrsS1GTbv6SN341NijjNYl05e0h6Jq1T9UZmtrnAkEAwTfzmn7H+3RmI5QJ+IBkzzEWFHv05X0/8DyID7QmcKWzEncaZqIzObdYYu983qa2/LqSaahyz68uQnYRYi7xHQJATr3SgPIRuaH8r360iTtrRHzYp2qgYQJ25On1KECEyKgszp/kqzieSVbjLLFQjavKwMXeEGT+AwiDaJibwJLxWwJAXZApORsqGqdxc9FTxt5iiqG2ZP5DTXxc6E+ihmlmoVl9KncgTf9ez0Q0Qz/4KUTPTHNVgzt1nyBxiLtnyzFavA== |
| | | # mall_book_public_key mallbook测试环境公钥 不需要替换 |
| | | mall_book_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD0L2DaHOO8ekhktB6RoHxIcki/0v7OUeOn9tX9VBE+jv6PRjqlZRWL3Qezxz5ADtHEyLv+RFFaceXSep6rWyoQ6DRlvLv5CySUAxAM42LLVe4DI3l/0ccEAIuU5NCpwAAj1zkm2X01DwUCZwymLjlqbDlBvQhpq+1fddtTtA/QLQIDAQAB |
| | | # mall_book_public_key mallbook生产环境公钥 不需要替换 |
| | | # mall_book_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq6OLZKgUHH5wOk9xSBgN7yC17r3PQwMlY9/IorqrOlaIqrU0eAVZ5+dWrJD/3bdu7Ctq8n8trTm/IUYs7wtMg5SKwyX4/N+KQc2N7LL4yCq4vNl41q9sYgrtA0QnZoucIZcq1mwyu7RTDC8Wp7LGddnlkJsmL8masgMxA6cc9NwIDAQAB |
| | | app_key: 82hegw5u86n4x |
| | | app_secret: 16ezqnP0EEU7 |
| | | |
| | |
| | | # RedisÊý¾Ý¿âË÷Òý£¨Ä¬ÈÏΪ0£© |
| | | spring.redis.database=0 |
| | | |
| | | ## Redis·þÎñÆ÷µØÖ· |
| | | #spring.redis.host=127.0.0.1 |
| | | ## Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | #spring.redis.port=16379 |
| | | ## Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | #spring.redis.password=wuOT@8NLdZ*V09Jt |
| | | |
| | | # Redis·þÎñÆ÷µØÖ· |
| | | spring.redis.host=127.0.0.1 |
| | | # Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | spring.redis.port=6379 |
| | | spring.redis.port=16379 |
| | | # Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | spring.redis.password=123456 |
| | | spring.redis.password=wuOT@8NLdZ*V09Jt |
| | | |
| | | ## Redis·þÎñÆ÷µØÖ· |
| | | #spring.redis.host=127.0.0.1 |
| | | ## Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | #spring.redis.port=6379 |
| | | ## Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | #spring.redis.password=123456 |
| | | |
| | | # Á¬½Ó³Ø×î´óÁ¬½ÓÊý£¨Ê¹ÓøºÖµ±íʾûÓÐÏÞÖÆ£© |
| | | spring.redis.jedis.pool.max-active=1024 |
| | |
| | | import com.stylefeng.guns.modular.system.controller.resp.RevenueExpenditureResp; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TDriverCommissionResp; |
| | | import com.stylefeng.guns.modular.system.controller.util.ExcelUtil; |
| | | import com.stylefeng.guns.modular.system.model.TCashWithdrawal; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.stylefeng.guns.modular.system.service.ITCashWithdrawalService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import com.stylefeng.guns.modular.system.model.TRevenue; |
| | | import com.stylefeng.guns.modular.system.service.ITRevenueService; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ITRevenueService tRevenueService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITCashWithdrawalService cashWithdrawalService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 同意提现 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/agreeWithdraw") |
| | | public Object agreeWithdraw(Integer id){ |
| | | TCashWithdrawal tCashWithdrawal = cashWithdrawalService.selectById(id); |
| | | tCashWithdrawal.setState(2); |
| | | cashWithdrawalService.updateById(tCashWithdrawal); |
| | | return SUCCESS; |
| | | } |
| | | } |
| | |
| | | .last("LIMIT 1")); |
| | | JSONObject jsonObject = JSONObject.parseObject(tSystemConfig.getContent()); |
| | | JSONArray array = jsonObject.getJSONArray("ChargeStandard"); |
| | | JSONArray objects = new JSONArray(); |
| | | for (int i = 0; i < array.size(); i++) { |
| | | JSONObject jsonObject1 = JSONObject.parseObject(JSONObject.toJSONString(array.get(i))); |
| | | if(i == 0){ |
| | | jsonObject1.put("key",0); |
| | | }else { |
| | | jsonObject1.put("key",1); |
| | | } |
| | | objects.add(jsonObject1); |
| | | JSONObject defaule = array.getJSONObject(0); |
| | | JSONArray num3 = defaule.getJSONArray("num3"); |
| | | for (int i = 0; i < num3.size(); i++) { |
| | | JSONObject jsonObject1 = num3.getJSONObject(i); |
| | | jsonObject1.put("index", i); |
| | | } |
| | | |
| | | JSONArray array1 = new JSONArray(); |
| | | for (int i = 1; i < array.size(); i++) { |
| | | JSONObject jsonObject1 = array.getJSONObject(i); |
| | | JSONArray num32 = jsonObject1.getJSONArray("num3"); |
| | | for (int j = 0; j < num32.size(); j++) { |
| | | JSONObject jsonObject2 = num32.getJSONObject(j); |
| | | jsonObject2.put("index", j); |
| | | } |
| | | array1.add(array.get(i)); |
| | | } |
| | | model.addAttribute("defaule", defaule); |
| | | model.addAttribute("array", array1); |
| | | TSystemConfig config = tSystemConfigService.selectOne(new EntityWrapper<TSystemConfig>().eq("type", 8) |
| | | .last("LIMIT 1")); |
| | | JSONObject jsonObj = JSONObject.parseObject(config.getContent()); |
| | | Integer zcOne = jsonObj.getInteger("num1"); |
| | | model.addAttribute("zcOne",zcOne); |
| | | model.addAttribute("array",objects); |
| | | model.addAttribute("zcOne", zcOne); |
| | | JSONObject extraCost = JSONObject.parseObject(jsonObject.getString("ExtraCost")); |
| | | model.addAttribute("ExtraCost",extraCost); |
| | | return PREFIX + "tSystemConfigPriceRules.html"; |
| | |
| | | |
| | | private Logger log = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | private final static String KEY = "5cc9622f299335639dbc046f3812c52a"; |
| | | private final static String KEY = "7589cb21f09f6ab1a1263ca98f0b4d52"; |
| | | |
| | | //请求超时时间 |
| | | private final static Integer TIME_OUT = 1000; |
| | |
| | | JSONArray chargeStandard = jsonObject.getJSONArray("ChargeStandard"); |
| | | JSONObject extraCost = jsonObject.getJSONObject("ExtraCost"); |
| | | Date date = new Date(); |
| | | for (int i = 0; i < chargeStandard.size(); i++) { |
| | | |
| | | boolean b = true; |
| | | for (int i = 1; i < chargeStandard.size(); i++) {//各种时间段 |
| | | JSONObject jsonObject1 = chargeStandard.getJSONObject(i); |
| | | String num1 = jsonObject1.getString("num1"); |
| | | String num2 = jsonObject1.getString("num2"); |
| | | Double num3 = jsonObject1.getDouble("num3");//起步里程 |
| | | Double num4 = jsonObject1.getDouble("num4");//起步价格 |
| | | Double num5 = jsonObject1.getDouble("num5");//超过公里 |
| | | Double num6 = jsonObject1.getDouble("num6");//超过num3每num5公里收取num6 |
| | | Double num7 = jsonObject1.getDouble("num7");//长途起始公里 |
| | | Double num8 = jsonObject1.getDouble("num8");//长途结束公里 |
| | | Double num9 = jsonObject1.getDouble("num9");//长途费 |
| | | Double num10 = jsonObject1.getDouble("num10");//超出长途里程每num10公里 |
| | | Double num11 = jsonObject1.getDouble("num11");//超过num8每num10公里收取num11 |
| | | JSONArray num3 = jsonObject1.getJSONArray("num3");//起步里程 |
| | | Double num4 = jsonObject1.getDouble("num4");//长途里程 |
| | | Double num5 = jsonObject1.getDouble("num5");//长途里程 |
| | | Double num6 = jsonObject1.getDouble("num6");//长途费 |
| | | Double num7 = jsonObject1.getDouble("num7");//超出长途里程每num10公里 |
| | | Double num8 = jsonObject1.getDouble("num8");//超过num8每num10公里收取num11 |
| | | |
| | | String[] split = num1.split(":"); |
| | | Calendar s = Calendar.getInstance(); |
| | |
| | | e.set(Calendar.SECOND, 0); |
| | | |
| | | if(date.getTime() >= s.getTimeInMillis() && date.getTime() < e.getTimeInMillis()){ |
| | | if(num3.compareTo(distance) >= 0){//起步里程内 |
| | | order.setStartDistance(distance);//起步里程 |
| | | order.setStartPrice(new BigDecimal(num4));//起步价 |
| | | }else{ |
| | | BigDecimal subtract = new BigDecimal(distance).subtract(new BigDecimal(num3));//超出起步里程 |
| | | BigDecimal divide = subtract.divide(new BigDecimal(num5), new MathContext(2, RoundingMode.HALF_EVEN)); |
| | | BigDecimal multiply = divide.multiply(new BigDecimal(num6)); |
| | | order.setStartDistance(num3);//起步里程 |
| | | order.setStartPrice(new BigDecimal(num4));//起步价 |
| | | order.setOverDriveDistance(subtract.doubleValue());//超出起步里程 |
| | | order.setOverDrivePrice(multiply);//超出起步里程费 |
| | | |
| | | b = false; |
| | | Double dd = 0d; |
| | | for (int j = 0; j < num3.size(); j++) { |
| | | JSONObject jsonObject2 = num3.getJSONObject(j); |
| | | Double num1_1 = jsonObject2.getDouble("num1"); |
| | | Double num2_1 = jsonObject2.getDouble("num2"); |
| | | Double num3_1 = jsonObject2.getDouble("num3"); |
| | | if(num1_1.compareTo(distance) <= 0 && num2_1.compareTo(distance) > 0){ |
| | | order.setStartDistance(distance);//起步里程 |
| | | order.setStartPrice(new BigDecimal(num3_1));//起步价 |
| | | } |
| | | if(j == num3.size() - 1 && order.getStartPrice().doubleValue() == 0){ |
| | | order.setStartDistance(num2_1);//起步里程 |
| | | order.setStartPrice(new BigDecimal(num3_1));//起步价 |
| | | dd = distance - num2_1; |
| | | } |
| | | } |
| | | if(dd != 0){ |
| | | //计算长途费 |
| | | if(distance.compareTo(num7) > 0){ |
| | | order.setLongDistance(num7 + "-" + num8);//长途里程 |
| | | order.setLongDistancePrice(new BigDecimal(num9));//长途费 |
| | | if(distance.compareTo(num4) > 0){ |
| | | order.setLongDistance(num4 + "-" + num5);//长途里程 |
| | | order.setLongDistancePrice(new BigDecimal(num6));//长途费 |
| | | } |
| | | //计算长途里程超出的部分 |
| | | if(distance.compareTo(num8) > 0){ |
| | | BigDecimal subtract1 = new BigDecimal(distance).subtract(new BigDecimal(num8)); |
| | | BigDecimal divide1 = subtract1.divide(new BigDecimal(num10), new MathContext(2, RoundingMode.HALF_EVEN)); |
| | | BigDecimal multiply1 = divide1.multiply(new BigDecimal(num11)); |
| | | if(distance.compareTo(num5) > 0){ |
| | | BigDecimal subtract1 = new BigDecimal(distance).subtract(new BigDecimal(num5)); |
| | | BigDecimal divide1 = subtract1.divide(new BigDecimal(num7), new MathContext(2, RoundingMode.HALF_EVEN)); |
| | | BigDecimal multiply1 = divide1.multiply(new BigDecimal(num8)); |
| | | order.setOverLongDistance(subtract1.doubleValue());//超出长途里程 |
| | | order.setOverLongDistancePrice(multiply1);//超出长途里程费 |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if(b){//默认配置 |
| | | JSONObject jsonObject1 = chargeStandard.getJSONObject(0); |
| | | JSONArray num3 = jsonObject1.getJSONArray("num3");//起步里程 |
| | | Double num4 = jsonObject1.getDouble("num4");//长途里程 |
| | | Double num5 = jsonObject1.getDouble("num5");//长途里程 |
| | | Double num6 = jsonObject1.getDouble("num6");//长途费 |
| | | Double num7 = jsonObject1.getDouble("num7");//超出长途里程每num10公里 |
| | | Double num8 = jsonObject1.getDouble("num8");//超过num8每num10公里收取num11 |
| | | |
| | | Double dd = 0d; |
| | | for (int j = 0; j < num3.size(); j++) { |
| | | JSONObject jsonObject2 = num3.getJSONObject(j); |
| | | Double num1_1 = jsonObject2.getDouble("num1"); |
| | | Double num2_1 = jsonObject2.getDouble("num2"); |
| | | Double num3_1 = jsonObject2.getDouble("num3"); |
| | | if(num1_1.compareTo(distance) <= 0 && num2_1.compareTo(distance) > 0){ |
| | | order.setStartDistance(distance);//起步里程 |
| | | order.setStartPrice(new BigDecimal(num3_1));//起步价 |
| | | } |
| | | if(j == num3.size() - 1 && order.getStartPrice().doubleValue() == 0){ |
| | | order.setStartDistance(num2_1);//起步里程 |
| | | order.setStartPrice(new BigDecimal(num3_1));//起步价 |
| | | dd = distance - num2_1; |
| | | } |
| | | } |
| | | if(dd != 0){ |
| | | //计算长途费 |
| | | if(distance.compareTo(num4) > 0){ |
| | | order.setLongDistance(num4 + "-" + num5);//长途里程 |
| | | order.setLongDistancePrice(new BigDecimal(num6));//长途费 |
| | | } |
| | | //计算长途里程超出的部分 |
| | | if(distance.compareTo(num5) > 0){ |
| | | BigDecimal subtract1 = new BigDecimal(distance).subtract(new BigDecimal(num5)); |
| | | BigDecimal divide1 = subtract1.divide(new BigDecimal(num7), new MathContext(2, RoundingMode.HALF_EVEN)); |
| | | BigDecimal multiply1 = divide1.multiply(new BigDecimal(num8)); |
| | | order.setOverLongDistance(subtract1.doubleValue());//超出长途里程 |
| | | order.setOverLongDistancePrice(multiply1);//超出长途里程费 |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | //恶劣天气 |
| | | systemConfig = systemConfigService.selectOne(new EntityWrapper<TSystemConfig>().eq("type", 8)); |
| | | if(null != systemConfig) { |
| | | if(null != systemConfig){ |
| | | JSONObject jsonObject1 = JSON.parseObject(systemConfig.getContent()); |
| | | Integer num11 = jsonObject1.getInteger("num1");//开启恶劣天气计价 |
| | | if(1 == num11){ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | //计算折扣 |
| | | if(null != order.getUserId()){ |
| | | |
| | | } |
| | | |
| | | //计算总金额 |
| | | BigDecimal bigDecimal = order.getStartPrice().add(order.getOverDrivePrice()).add(order.getLongDistancePrice()).add(order.getOverLongDistancePrice()) |
| | |
| | | |
| | | @Override |
| | | public void packageModel(RevenueExpenditureResp revenueExpenditureResp,Model model) { |
| | | model.addAttribute("id",revenueExpenditureResp.getId()); |
| | | model.addAttribute("code",revenueExpenditureResp.getCode()); |
| | | model.addAttribute("businessTime",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(revenueExpenditureResp.getBusinessTime())); |
| | | model.addAttribute("businessType",revenueExpenditureResp.getBusinessType()); |
| | |
| | | model.addAttribute("driverPhone",revenueExpenditureResp.getDriverPhone()); |
| | | model.addAttribute("amount",revenueExpenditureResp.getAmount()); |
| | | model.addAttribute("accountBalance",revenueExpenditureResp.getAccountBalance()); |
| | | model.addAttribute("state",revenueExpenditureResp.getState()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | */ |
| | | public class OBSUtil { |
| | | |
| | | public static String endPoint = "https://obs.cn-south-1.myhuaweicloud.com"; |
| | | public static String ak = "N52IGR6DHOC3JAZFHZIW"; |
| | | public static String sk = "jq7Q7jnFS4Gxamwh3naN2sbNKwQQ7cZISPVumGBS"; |
| | | public static String bucketname = "csxdj"; |
| | | public static String endPoint = "https://obs.cn-southwest-2.myhuaweicloud.com"; |
| | | public static String ak = "YMBKC9LS6CDG9QHCIGUU"; |
| | | public static String sk = "kztanexutGzoGiYcIALCNhazfxoU6yecDOSBrFXu"; |
| | | public static String bucketname = "fanghuadaijia"; |
| | | |
| | | /** |
| | | * 上传文件 |
| | |
| | | // 待上传的本地文件路径,需要指定到具体的文件名 |
| | | PutObjectRequest request = new PutObjectRequest(); |
| | | request.setBucketName(bucketname); |
| | | request.setObjectKey(objectKey); |
| | | request.setObjectKey("img/" + objectKey); |
| | | request.setInput(inputStream); |
| | | PutObjectResult putObjectResult = obsClient.putObject(request); |
| | | return putObjectResult.getObjectUrl(); |
| | |
| | | |
| | | private final static String bad_weather = "[{\"wid\":\"03\",\"weather\":\"阵雨\"},{\"wid\":\"04\",\"weather\":\"雷阵雨\"},{\"wid\":\"05\",\"weather\":\"雷阵雨伴有冰雹\"},{\"wid\":\"06\",\"weather\":\"雨夹雪\"},{\"wid\":\"07\",\"weather\":\"小雨\"},{\"wid\":\"08\",\"weather\":\"中雨\"},{\"wid\":\"09\",\"weather\":\"大雨\"},{\"wid\":\"10\",\"weather\":\"暴雨\"},{\"wid\":\"11\",\"weather\":\"大暴雨\"},{\"wid\":\"12\",\"weather\":\"特大暴雨\"},{\"wid\":\"13\",\"weather\":\"阵雪\"},{\"wid\":\"14\",\"weather\":\"小雪\"},{\"wid\":\"15\",\"weather\":\"中雪\"},{\"wid\":\"16\",\"weather\":\"大雪\"},{\"wid\":\"17\",\"weather\":\"暴雪\"},{\"wid\":\"19\",\"weather\":\"冻雨\"},{\"wid\":\"20\",\"weather\":\"沙尘暴\"},{\"wid\":\"21\",\"weather\":\"小到中雨\"},{\"wid\":\"22\",\"weather\":\"中到大雨\"},{\"wid\":\"23\",\"weather\":\"大到暴雨\"},{\"wid\":\"24\",\"weather\":\"暴雨到大暴雨\"},{\"wid\":\"25\",\"weather\":\"大暴雨到特大暴雨\"},{\"wid\":\"26\",\"weather\":\"小到中雪\"},{\"wid\":\"27\",\"weather\":\"中到大雪\"},{\"wid\":\"28\",\"weather\":\"大到暴雪\"},{\"wid\":\"30\",\"weather\":\"扬沙\"},{\"wid\":\"31\",\"weather\":\"强沙尘暴\"},{\"wid\":\"53\",\"weather\":\"霾\"}]"; |
| | | |
| | | private final static String key = "aaebb3e5c18fd371257a2ab6b5670efe"; |
| | | private final static String key = "edc965edb129580401ed211eaa4ae8ab"; |
| | | |
| | | private static HttpClientUtil httpClientUtil = new HttpClientUtil(); |
| | | |
| | |
| | | server: |
| | | port: 8011 |
| | | port: 8010 |
| | | |
| | | guns: |
| | | swagger-open: false #是否开启swagger (true/false) |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: local |
| | | # active: dev |
| | | active: produce |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | |
| | | secret: 95a34f114973298cce4297a20bb59bc3 |
| | | gaode: |
| | | map: |
| | | key: e0370a9a4d10739045fb0b8f4742a67e #高德key |
| | | key: 588845b621c3c42d6d6c8f50ba00cb41 #高德key |
| | | |
| | | #eureka: |
| | | # client: |
| | |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/fh_agent_driving?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8 |
| | | username: root |
| | | # password: PI_v6J5@dvHwGTqc |
| | | password: 123456 |
| | | password: PI_v6J5@dvHwGTqc |
| | | # password: 123456 |
| | | db-name: fh_agent_driving #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | # uri: mongodb://root:bv@_N36o+cTe1LpS@127.0.0.1:27017/admin |
| | | uri: mongodb://127.0.0.1:27017/admin |
| | | uri: mongodb://root:PaWPtGG95APCMBEb@127.0.0.1:27017/admin |
| | | # uri: mongodb://127.0.0.1:27017/admin |
| | | |
| | | --- |
| | | |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration> |
| | | <!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,比如: 如果设置为WARN,则低于WARN的信息都不会输出 --> |
| | | <!-- scan:当此属性设置为true时,配置文档如果发生改变,将会被重新加载,默认值为true --> |
| | | <!-- scanPeriod:设置监测配置文档是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 --> |
| | | <!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 --> |
| | | <configuration scan="true" scanPeriod="10 seconds"> |
| | | <contextName>logback</contextName> |
| | | |
| | | <!--定义日志存放的位置--> |
| | | <springProperty scope="context" name="gunsLogPath" source="log.path" defaultValue="guns-logs"/> |
| | | <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义后,可以使“${}”来使用变量。 --> |
| | | <property name="log.path" value="/usr/local/server/app/logs/manager"/> |
| | | <!--<property name="log.path" value="d:/logs/manager"/>--> |
| | | |
| | | <!-- ****************************************************************************************** --> |
| | | <!-- ****************************** 本地开发只在控制台打印日志 ******************************** --> |
| | | <!-- ****************************************************************************************** --> |
| | | <springProfile name="local"> |
| | | <!--0. 日志格式和颜色渲染 --> |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | | <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> |
| | | <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> |
| | | <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> |
| | | <!-- 彩色日志格式 --> |
| | | <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | |
| | | <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <!--encoder 默认配置为PatternLayoutEncoder--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %highlight(%-5level) %logger Line:%-3L - %msg%n</pattern> |
| | | <charset>utf-8</charset> |
| | | </encoder> |
| | | </appender> |
| | | <!--1. 输出到控制台--> |
| | | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> |
| | | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
| | | <level>debug</level> |
| | | </filter> |
| | | <encoder> |
| | | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
| | | <!-- 设置字符集 --> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- 日志记录器,日期滚动记录 --> |
| | | <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文件的路径及文件名 --> |
| | | <file>${gunsLogPath}/log_error.log</file> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 归档的日志文件的路径,例如今天是2013-12-21日志,当前写的日志文件路径为file节点指定,可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。 |
| | | 而2013-12-21的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 --> |
| | | <fileNamePattern>${gunsLogPath}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始, |
| | | 命名日志文件,例如log-error-2013-12-21.0.log --> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>2MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | </rollingPolicy> |
| | | <!-- 追加方式记录日志 --> |
| | | <append>true</append> |
| | | <!-- 日志文件的格式 --> |
| | | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger Line:%-3L - %msg%n</pattern> |
| | | <charset>utf-8</charset> |
| | | </encoder> |
| | | <!-- 日志文件记录级别配置。 |
| | | 日志级别:ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < OFF |
| | | onMatch="ACCEPT" 表示匹配该级别及以上 |
| | | onMatch="DENY" 表示不匹配该级别及以上 |
| | | onMatch="NEUTRAL" 表示该级别及以上的,由下一个filter处理,如果当前是最后一个,则表示匹配该级别及以上 |
| | | onMismatch="ACCEPT" 表示匹配该级别以下 |
| | | onMismatch="NEUTRAL" 表示该级别及以下的,由下一个filter处理,如果当前是最后一个,则不匹配该级别以下的 |
| | | onMismatch="DENY" 表示不匹配该级别以下的 |
| | | --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>ERROR</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | <!--2. 输出到文档--> |
| | | <!-- 2.1 level为 DEBUG 日志,时间滚动输出 --> |
| | | <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${log.path}/debug.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志归档 --> |
| | | <fileNamePattern>${log.path}/%d{yyyy-MM-dd}/debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录debug级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>debug</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <root level="INFO"> |
| | | <appender-ref ref="STDOUT"/> |
| | | <appender-ref ref="FILE"/> |
| | | <!-- 2.2 level为 INFO 日志,时间滚动输出 --> |
| | | <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${log.path}/info.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 每天日志归档路径以及格式 --> |
| | | <fileNamePattern>${log.path}/%d{yyyy-MM-dd}/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录info级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>info</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <!-- 2.3 level为 WARN 日志,时间滚动输出 --> |
| | | <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${log.path}/warn.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${log.path}/%d{yyyy-MM-dd}/warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录warn级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>warn</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <!-- 2.4 level为 ERROR 日志,时间滚动输出 --> |
| | | <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${log.path}/error.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${log.path}/%d{yyyy-MM-dd}/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档只记录ERROR级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>ERROR</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <!-- 2.5 所有 除了DEBUG级别的其它高于DEBUG的 日志,记录到一个文件 --> |
| | | <appender name="ALL_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文档的路径及文档名 --> |
| | | <file>${log.path}/all.log</file> |
| | | <!--日志文档输出格式--> |
| | | <encoder> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | <charset>UTF-8</charset> <!-- 此处设置字符集 --> |
| | | </encoder> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <fileNamePattern>${log.path}/%d{yyyy-MM-dd}/all-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </rollingPolicy> |
| | | <!-- 此日志文档记录除了DEBUG级别的其它高于DEBUG的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>DEBUG</level> |
| | | <onMatch>DENY</onMatch> |
| | | <onMismatch>ACCEPT</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <!-- |
| | | <logger>用来设置某一个包或者具体的某一个类的日志打印级别、 |
| | | 以及指定<appender>。<logger>仅有一个name属性, |
| | | 一个可选的level和一个可选的addtivity属性。 |
| | | name:用来指定受此logger约束的某一个包或者具体的某一个类。 |
| | | level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, |
| | | 还有一个特殊值INHERITED或者同义词NULL,代表强制执行上级的级别。 |
| | | 如果未设置此属性,那么当前logger将会继承上级的级别。 |
| | | addtivity:是否向上级logger传递打印信息。默认是true。 |
| | | <logger name="org.springframework.web" level="info"/> |
| | | <logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/> |
| | | --> |
| | | |
| | | <!-- |
| | | root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性 |
| | | level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, |
| | | 不能设置为INHERITED或者同义词NULL。默认是DEBUG |
| | | 可以包含零个或多个元素,标识这个appender将会添加到这个logger。 |
| | | --> |
| | | |
| | | <!-- 4 最终的策略: |
| | | 基本策略(root级) + 根据profile在启动时, logger标签中定制化package日志级别(优先级高于上面的root级)--> |
| | | <springProfile name="dev"> |
| | | <root level="info"> |
| | | <appender-ref ref="CONSOLE" /> |
| | | <appender-ref ref="DEBUG_FILE" /> |
| | | <appender-ref ref="INFO_FILE" /> |
| | | <appender-ref ref="WARN_FILE" /> |
| | | <appender-ref ref="ERROR_FILE" /> |
| | | <appender-ref ref="ALL_FILE" /> |
| | | </root> |
| | | <logger name="ServiceLog" level="debug"/> |
| | | <logger name="com.baomidou.mybatisplus" level="debug"/> |
| | | <logger name="com.stylefeng.guns.modular.system.dao" level="debug"/> |
| | | </springProfile> |
| | | |
| | | <!-- ****************************************************************************************** --> |
| | | <!-- ********************** 放到服务器上不管在什么环境都只在文件记录日志 ********************** --> |
| | | <!-- ****************************************************************************************** --> |
| | | <springProfile name="!local"> |
| | | |
| | | <!-- 日志记录器,日期滚动记录 --> |
| | | <appender name="FILE_ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文件的路径及文件名 --> |
| | | <file>${gunsLogPath}/log_error.log</file> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 归档的日志文件的路径,例如今天是2013-12-21日志,当前写的日志文件路径为file节点指定,可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。 |
| | | 而2013-12-21的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 --> |
| | | <fileNamePattern>${gunsLogPath}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始, |
| | | 命名日志文件,例如log-error-2013-12-21.0.log --> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>2MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | </rollingPolicy> |
| | | <!-- 追加方式记录日志 --> |
| | | <append>true</append> |
| | | <!-- 日志文件的格式 --> |
| | | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
| | | <pattern>===%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger Line:%-3L - %msg%n</pattern> |
| | | <charset>utf-8</charset> |
| | | </encoder> |
| | | <!-- 此日志文件只记录error级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>error</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <!-- 日志记录器,日期滚动记录 --> |
| | | <appender name="FILE_ALL" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文件的路径及文件名 --> |
| | | <file>${gunsLogPath}/log_total.log</file> |
| | | <!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 归档的日志文件的路径,例如今天是2013-12-21日志,当前写的日志文件路径为file节点指定,可以将此文件与file指定文件路径设置为不同路径,从而将当前日志文件或归档日志文件置不同的目录。 |
| | | 而2013-12-21的日志文件在由fileNamePattern指定。%d{yyyy-MM-dd}指定日期格式,%i指定索引 --> |
| | | <fileNamePattern>${gunsLogPath}/total/log-total-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始, |
| | | 命名日志文件,例如log-error-2013-12-21.0.log --> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>2MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | </rollingPolicy> |
| | | <!-- 追加方式记录日志 --> |
| | | <append>true</append> |
| | | <!-- 日志文件的格式 --> |
| | | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
| | | <pattern>===%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger Line:%-3L - %msg%n</pattern> |
| | | <charset>utf-8</charset> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <root level="INFO"> |
| | | <appender-ref ref="FILE_ERROR"/> |
| | | <appender-ref ref="FILE_ALL"/> |
| | | <springProfile name="fat"> |
| | | <root level="info"> |
| | | <appender-ref ref="CONSOLE" /> |
| | | <appender-ref ref="DEBUG_FILE" /> |
| | | <appender-ref ref="INFO_FILE" /> |
| | | <appender-ref ref="WARN_FILE" /> |
| | | <appender-ref ref="ERROR_FILE" /> |
| | | <appender-ref ref="ALL_FILE" /> |
| | | </root> |
| | | |
| | | <logger name="ServiceLog" level="debug"/> |
| | | <logger name="com.baomidou.mybatisplus" level="debug"/> |
| | | <logger name="com.stylefeng.guns.modular.system.dao" level="debug"/> |
| | | </springProfile> |
| | | |
| | | </configuration> |
| | | <springProfile name="produce"> |
| | | <root level="warn"> |
| | | <!-- 生产环境最好不配置console写文件 --> |
| | | <appender-ref ref="DEBUG_FILE" /> |
| | | <appender-ref ref="INFO_FILE" /> |
| | | <appender-ref ref="WARN_FILE" /> |
| | | <appender-ref ref="ERROR_FILE" /> |
| | | <appender-ref ref="ALL_FILE" /> |
| | | </root> |
| | | <logger name="ServiceLog" level="warn"/> |
| | | <logger name="com.baomidou.mybatisplus" level="error"/> |
| | | <logger name="com.stylefeng.guns.modular.system.dao" level="error"/> |
| | | </springProfile> |
| | | |
| | | |
| | | </configuration> |
| | |
| | | # RedisÊý¾Ý¿âË÷Òý£¨Ä¬ÈÏΪ0£© |
| | | spring.redis.database=0 |
| | | |
| | | ## Redis·þÎñÆ÷µØÖ· |
| | | #spring.redis.host=127.0.0.1 |
| | | ### Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | #spring.redis.port=16379 |
| | | ### Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | #spring.redis.password=wuOT@8NLdZ*V09Jt |
| | | |
| | | # Redis·þÎñÆ÷µØÖ· |
| | | spring.redis.host=127.0.0.1 |
| | | # Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | spring.redis.port=6379 |
| | | # Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | spring.redis.password=123456 |
| | | ## Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | spring.redis.port=16379 |
| | | ## Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | spring.redis.password=wuOT@8NLdZ*V09Jt |
| | | |
| | | ## Redis·þÎñÆ÷µØÖ· |
| | | #spring.redis.host=127.0.0.1 |
| | | ## Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | #spring.redis.port=6379 |
| | | ## Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | #spring.redis.password=123456 |
| | | |
| | | # Á¬½Ó³Ø×î´óÁ¬½ÓÊý£¨Ê¹ÓøºÖµ±íʾûÓÐÏÞÖÆ£© |
| | | spring.redis.jedis.pool.max-active=1024 |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=c59c0ec8058a8305009eb315584e07d1"></script> |
| | | <script src="https://webapi.amap.com/maps?v=1.4.15&key=c59c0ec8058a8305009eb315584e07d1&plugin=AMap.MouseTool"></script> |
| | | <script type="text/javascript"> |
| | | window._AMapSecurityConfig = { |
| | | securityJsCode:'34399ecced17d9c01ef705ef964fc077', |
| | | } |
| | | </script> |
| | | <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=86fcccf007b64ae97b01c3c982c0ef0f"></script> |
| | | <script src="https://webapi.amap.com/maps?v=1.4.15&key=86fcccf007b64ae97b01c3c982c0ef0f&plugin=AMap.MouseTool"></script> |
| | | <script type="text/javascript" src='https://a.amap.com/jsapi_demos/static/citys.js'></script> |
| | | <script src="${ctxPath}/static/home.js"></script> |
| | | <script src="${ctxPath}/static/js/jquery.sparkline 2.1.2.js"></script> |
| | |
| | | <option value="">请选择订单来源</option> |
| | | <option value="1">小程序</option> |
| | | <option value="2">司机创建</option> |
| | | <option value="3">后台添加</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | |
| | | @if(source==2){ |
| | | <label>APP</label> |
| | | @} |
| | | @if(source==3){ |
| | | <label>后台</label> |
| | | @} |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >乘车时间:</label> |
| | |
| | | <option value="">请选择订单来源</option> |
| | | <option value="1">小程序</option> |
| | | <option value="2">司机创建</option> |
| | | <option value="3">后台添加</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | |
| | | @if(source==2){ |
| | | <label>APP</label> |
| | | @} |
| | | @if(source==3){ |
| | | <label>后台</label> |
| | | @} |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >乘车时间:</label> |
| | |
| | | </div> |
| | | <script type="text/javascript"> |
| | | window._AMapSecurityConfig = { |
| | | securityJsCode:'0e712f129051b8df19a7f81484009f28', |
| | | securityJsCode:'34399ecced17d9c01ef705ef964fc077', |
| | | } |
| | | </script> |
| | | <script src="${ctxPath}/static/modular/system/tOrder/tOrder_info.js"></script> |
| | | <script type="text/javascript" src="https://webapi.amap.com/maps?v=2.0&key=99b1546635dac9d51440c9d5b1fde512"></script> |
| | | <script type="text/javascript" src="https://webapi.amap.com/maps?v=2.0&key=86fcccf007b64ae97b01c3c982c0ef0f"></script> |
| | | <script type="text/javascript"> |
| | | //地图加载 |
| | | var map1 = new AMap.Map("container1", { |
| | |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | |
| | | <input type="hidden" id="id" value="${id}"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >订单号:</label> |
| | |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label">提现金额:</label> |
| | | <label>${amount}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">状态:</label> |
| | | <label>${state == 1 ? '待审核' : '审核通过'}</label> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | |
| | | <div class="hidden-xs" id="TDriverTableToolbar" role="group" style="text-align: center"> |
| | | @if(state == 1){ |
| | | <#button name="同意" icon="fa-check" clickFun="TRevenueInfoDlg.agree()" /> |
| | | @} |
| | | <#button name="取消" icon="fa-plus" clickFun="TRevenueInfoDlg.close()" /> |
| | | </div> |
| | | |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="https://webapi.amap.com/maps?v=1.4.15&key=c59c0ec8058a8305009eb315584e07d1&plugin=AMap.MouseTool,AMap.DistrictSearch,AMap.PolyEditor,AMap.RectangleEditor,AMap.CircleEditor"></script> |
| | | <script type="text/javascript"> |
| | | window._AMapSecurityConfig = { |
| | | securityJsCode:'34399ecced17d9c01ef705ef964fc077', |
| | | } |
| | | </script> |
| | | <script src="https://webapi.amap.com/maps?v=1.4.15&key=86fcccf007b64ae97b01c3c982c0ef0f&plugin=AMap.MouseTool,AMap.DistrictSearch,AMap.PolyEditor,AMap.RectangleEditor,AMap.CircleEditor"></script> |
| | | <script src="${ctxPath}/static/modular/system/tSite/electricFence.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tSite/tSite_info.js"></script> |
| | | @} |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="https://webapi.amap.com/maps?v=1.4.15&key=c59c0ec8058a8305009eb315584e07d1&plugin=AMap.MouseTool,AMap.DistrictSearch,AMap.PolyEditor,AMap.RectangleEditor,AMap.CircleEditor"></script> |
| | | <script type="text/javascript"> |
| | | window._AMapSecurityConfig = { |
| | | securityJsCode:'34399ecced17d9c01ef705ef964fc077', |
| | | } |
| | | </script> |
| | | <script src="https://webapi.amap.com/maps?v=1.4.15&key=86fcccf007b64ae97b01c3c982c0ef0f&plugin=AMap.MouseTool,AMap.DistrictSearch,AMap.PolyEditor,AMap.RectangleEditor,AMap.CircleEditor"></script> |
| | | <script src="${ctxPath}/static/modular/system/tSite/electricFence.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tSite/tSite_info.js"></script> |
| | | @} |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span class="control-label" >司机订单保险费,每单固定抽取</span> |
| | | <input class="control-label" id="num1" name="num1" value="${num1}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元/天</span> |
| | | <span class="control-label" >元/单</span> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | <hr/> |
| | | |
| | | <input hidden id="array" value="${array}"> |
| | | <input hidden id="array" value=""> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" id="rules" style="text-align: left" > |
| | | @for(ChargeStandard in array){ |
| | | <div name="rulesForm"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >时间段</span> |
| | | <input class="control-label" id="num1" name="num1" value="${ChargeStandard.num1}" type="text" placeholder="00:00" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >——</span> |
| | | <input class="control-label" id="num2" name="num2" value="${ChargeStandard.num2}" type="text" placeholder="00:00" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >代驾里程</span> |
| | | <input class="control-label" id="num3" name="num3" value="${ChargeStandard.num3}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,起步价</span> |
| | | <input class="control-label" id="num4" name="num4" value="${ChargeStandard.num4}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出里程每</span> |
| | | <input class="control-label" id="num5" name="num5" value="${ChargeStandard.num5}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num6" name="num6" value="${ChargeStandard.num6}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | |
| | | @if(ChargeStandard.key == 0){ |
| | | <span class="fa fa-plus" onclick="TSystemConfig.addBox()"></span> |
| | | @} |
| | | @if(ChargeStandard.key == 1){ |
| | | <span class="fa fa-remove" onclick="TSystemConfig.delBox(this)"></span> |
| | | <button onclick="TSystemConfig.addTime()" style="padding: 5px 10px;font-size: 16px;background-color: #0086f6;color: #fff;border: none;border-radius: 5px;">添加时间段</button> |
| | | <div class="rulesForm" style="border: 1px solid #888888;padding-top: 10px;display: grid;margin: 10px 0px"> |
| | | <span style="position: absolute;right: 30px;color: #0086f6;font-size: 16px;">默认</span> |
| | | <div class="prices"> |
| | | @for(obj in defaule.num3){ |
| | | <div class="initialLevel col-sm-12 control-label form-group price"> |
| | | <span class="control-label" >代驾里程</span> |
| | | <input class="control-label" id="num1" name="num1" value="${obj.num1}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,至</span> |
| | | <input class="control-label" id="num2" name="num2" value="${obj.num2}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num3" name="num3" value="${obj.num3}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | @if(obj.index == 0){ |
| | | <span class="fa fa-plus" onclick="TSystemConfig.addBox(this)"></span> |
| | | @}else{ |
| | | <span class="fa fa-remove" onclick="TSystemConfig.delBox(this)"></span> |
| | | @} |
| | | </div> |
| | | @} |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >长途里程</span> |
| | | <input class="control-label" id="num7" name="num7" value="${ChargeStandard.num7}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <input class="control-label" id="num4" name="num4" value="${defaule.num4}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >——</span> |
| | | <input class="control-label" id="num8" name="num8" value="${ChargeStandard.num8}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num9" name="num9" value="${ChargeStandard.num9}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出里程每</span> |
| | | <input class="control-label" id="num10" name="num10" value="${ChargeStandard.num10}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num11" name="num11" value="${ChargeStandard.num11}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <input class="control-label" id="num5" name="num5" value="${defaule.num5}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,费用</span> |
| | | <input class="control-label" id="num6" name="num6" value="${defaule.num6}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出里程每</span> |
| | | <input class="control-label" id="num7" name="num7" value="${defaule.num7}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num8" name="num8" value="${defaule.num8}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | </div> |
| | | @for(o in array){ |
| | | <div class="rulesForm" style="border: 1px solid #888888;padding-top: 10px;display: grid;margin: 10px 0px"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" id='time' > |
| | | <span class="control-label" >时间段</span> |
| | | <input class="control-label" id="num1" name="num1" type="text" value="${o.num1}" placeholder="00:00" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >——</span> |
| | | <input class="control-label" id="num2" name="num2" type="text" value="${o.num2}" placeholder="00:00" style="height: 30px;width: 80px"> |
| | | <span class="fa fa-remove" style='position: absolute;right: 20px;color: red;font-size: 20px;' onclick="TSystemConfig.delTime(this)"></span> |
| | | </div> |
| | | <div class="prices"> |
| | | @for(obj in o.num3){ |
| | | <div class="initialLevel col-sm-12 control-label form-group price"> |
| | | <span class="control-label" >代驾里程</span> |
| | | <input class="control-label" id="num1" name="num1" value="${obj.num1}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,至</span> |
| | | <input class="control-label" id="num2" name="num2" value="${obj.num2}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num3" name="num3" value="${obj.num3}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | @if(obj.index == 0){ |
| | | <span class="fa fa-plus" onclick="TSystemConfig.addBox(this)"></span> |
| | | @}else{ |
| | | <span class="fa fa-remove" onclick="TSystemConfig.delBox(this)"></span> |
| | | @} |
| | | </div> |
| | | @} |
| | | </div> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >长途里程</span> |
| | | <input class="control-label" id="num4" name="num4" value="${o.num4}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >——</span> |
| | | <input class="control-label" id="num5" name="num5" value="${o.num5}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,费用</span> |
| | | <input class="control-label" id="num6" name="num6" value="${o.num6}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出里程每</span> |
| | | <input class="control-label" id="num7" name="num7" value="${o.num7}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收费</span> |
| | | <input class="control-label" id="num8" name="num8" value="${o.num8}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <hr/> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" style="text-align: left" > |
| | | <div class="initialLevel col-sm-12 control-label form-group" id="wait" style="text-align: left" > |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <span class="control-label" >等待</span> |
| | | <input class="control-label" id="num12" name="num12" value="${ExtraCost.num1}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >分钟,收取</span> |
| | | <span class="control-label" >分钟,收取</span> |
| | | <input class="control-label" id="num13" name="num13" value="${ExtraCost.num2}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出</span> |
| | | <span class="control-label" >元,超出</span> |
| | | <input class="control-label" id="num14" name="num14" value="${ExtraCost.num3}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >分钟,收取</span> |
| | | <span class="control-label" >分钟,收取</span> |
| | | <input class="control-label" id="num15" name="num15" value="${ExtraCost.num4}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元/分钟</span> |
| | | </div> |
| | | <input hidden id="zcOne" value="${zcOne}"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-12 control-label form-group" id="weather"> |
| | | <div class="col-sm-1"> |
| | | <input type="checkbox" class="js-switch1" id="isTaxiCar" |
| | | @if(isNotEmpty(zcOne)){ |
| | |
| | | <div class="initialLevel col-sm-10 control-label form-group" > |
| | | <span class="control-label" >恶劣天气</span> |
| | | <input class="control-label" id="num16" name="num16" value="${ExtraCost.num5}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里以内,加收</span> |
| | | <span class="control-label" >公里以内,加收</span> |
| | | <input class="control-label" id="num17" name="num17" value="${ExtraCost.num6}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元,超出</span> |
| | | <span class="control-label" >元,超出</span> |
| | | <input class="control-label" id="num18" name="num18" value="${ExtraCost.num7}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >公里,收取订单的</span> |
| | | <span class="control-label" >公里,收取订单的</span> |
| | | <input class="control-label" id="num19" name="num19" value="${ExtraCost.num8}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >倍计费,最高收取</span> |
| | | <span class="control-label" >倍计费,最高收取</span> |
| | | <input class="control-label" id="num20" name="num20" value="${ExtraCost.num9}" type="number" min="0" style="height: 30px;width: 80px"> |
| | | <span class="control-label" >元</span> |
| | | </div> |
| | |
| | | return '<span>小程序</span>' |
| | | }else if (row.source === 2){ |
| | | return '<span>司机创建</span>' |
| | | }else if (row.source === 3){ |
| | | return '<span>后台添加</span>' |
| | | } |
| | | }}, |
| | | {title: '开始服务时间', field: 'startTime', visible: true, align: 'center', valign: 'middle'}, |
| | |
| | | {title: '余额', field: 'accountBalance', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.state === 2){ |
| | | if (row.state === 1){ |
| | | return '<span>待审核</span>' |
| | | }else if (row.state === 2){ |
| | | return '<span>完成</span>' |
| | | }else if (row.state === 108){ |
| | | return '<span>完成</span>' |
| | |
| | | parent.layer.close(window.parent.TRevenue.layerIndex); |
| | | } |
| | | |
| | | |
| | | TRevenueInfoDlg.agree = function(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tRevenue/agreeWithdraw", function(data){ |
| | | Feng.success("审核成功!"); |
| | | window.parent.TRevenue.table.refresh(); |
| | | TRevenueInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("审核失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set('id', $('#id').val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | |
| | | * 价格规则 |
| | | */ |
| | | TSystemConfig.priceRulesSubmit = function () { |
| | | var content = {}; |
| | | var ChargeStandard = []; |
| | | $('.rulesForm').each(function (i, e) { |
| | | var time = $(e).find("#time"); |
| | | var obj = {}; |
| | | if(null != time && time.length != 0){ |
| | | var num1 = $(time).find('input[name="num1"]').val(); |
| | | var num2 = $(time).find('input[name="num2"]').val(); |
| | | obj.num1 = num1; |
| | | obj.num2 = num2; |
| | | } |
| | | var prices = $(this).find(".prices .price"); |
| | | |
| | | var arr = []; |
| | | prices.each(function (j, e) { |
| | | var o = {}; |
| | | var num1 = $(e).find('input[name="num1"]').val(); |
| | | var num2 = $(e).find('input[name="num2"]').val(); |
| | | var num3 = $(e).find('input[name="num3"]').val(); |
| | | o.num1 = num1; |
| | | o.num2 = num2; |
| | | o.num3 = num3; |
| | | arr.push(o); |
| | | }) |
| | | obj.num3 = arr; |
| | | |
| | | var num4 = $(this).find('input[name="num4"]').val(); |
| | | var num5 = $(this).find('input[name="num5"]').val(); |
| | | var num6 = $(this).find('input[name="num6"]').val(); |
| | | var num7 = $(this).find('input[name="num7"]').val(); |
| | | var num8 = $(this).find('input[name="num8"]').val(); |
| | | obj.num4 = num4; |
| | | obj.num5 = num5; |
| | | obj.num6 = num6; |
| | | obj.num7 = num7; |
| | | obj.num8 = num8; |
| | | ChargeStandard.push(obj); |
| | | }); |
| | | content.ChargeStandard = ChargeStandard; |
| | | |
| | | var ExtraCost = {}; |
| | | ExtraCost.num1 = $('#wait').find('input[name="num12"]').val(); |
| | | ExtraCost.num2 = $('#wait').find('input[name="num13"]').val(); |
| | | ExtraCost.num3 = $('#wait').find('input[name="num14"]').val(); |
| | | ExtraCost.num4 = $('#wait').find('input[name="num15"]').val(); |
| | | ExtraCost.num5 = $('#weather').find('input[name="num16"]').val(); |
| | | ExtraCost.num6 = $('#weather').find('input[name="num17"]').val(); |
| | | ExtraCost.num7 = $('#weather').find('input[name="num18"]').val(); |
| | | ExtraCost.num8 = $('#weather').find('input[name="num19"]').val(); |
| | | ExtraCost.num9 = $('#weather').find('input[name="num20"]').val(); |
| | | content.ExtraCost = ExtraCost; |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/tSystemConfig/systemConfigSubmit", function (data) { |
| | | Feng.success("保存成功!"); |
| | | TSystemConfig.table.refresh(); |
| | |
| | | Feng.error("保存失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | |
| | | var json1=[]; |
| | | for (let i = 0; i < $('input[name="num1"]').length; i++) { |
| | | var arr = {} |
| | | arr['num1'] = $($('input[name="num1"]')[i]).val(); |
| | | arr['num2'] = $($('input[name="num2"]')[i]).val(); |
| | | arr['num3'] = Number($($('input[name="num3"]')[i]).val()); |
| | | arr['num4'] = Number($($('input[name="num4"]')[i]).val()); |
| | | arr['num5'] = Number($($('input[name="num5"]')[i]).val()); |
| | | arr['num6'] = Number($($('input[name="num6"]')[i]).val()); |
| | | arr['num7'] = Number($($('input[name="num7"]')[i]).val()); |
| | | arr['num8'] = Number($($('input[name="num8"]')[i]).val()); |
| | | arr['num9'] = Number($($('input[name="num9"]')[i]).val()); |
| | | arr['num10'] = Number($($('input[name="num10"]')[i]).val()); |
| | | arr['num11'] = Number($($('input[name="num11"]')[i]).val()); |
| | | json1.push(arr) |
| | | } |
| | | |
| | | var ExtraCost = {}; |
| | | ExtraCost['num1'] = Number($('#num12').val()); |
| | | ExtraCost['num2'] = Number($('#num13').val()); |
| | | ExtraCost['num3'] = Number($('#num14').val()); |
| | | ExtraCost['num4'] = Number($('#num15').val()); |
| | | ExtraCost['num5'] = Number($('#num16').val()); |
| | | ExtraCost['num6'] = Number($('#num17').val()); |
| | | ExtraCost['num7'] = Number($('#num18').val()); |
| | | ExtraCost['num8'] = Number($('#num19').val()); |
| | | ExtraCost['num9'] = Number($('#num20').val()); |
| | | |
| | | var reqData = {}; |
| | | reqData['ChargeStandard'] = json1; |
| | | reqData['ExtraCost'] = ExtraCost; |
| | | ajax.set("content",JSON.stringify(reqData)); |
| | | ajax.set("content",JSON.stringify(content)); |
| | | ajax.set("type",5); |
| | | ajax.start(); |
| | | }; |
| | |
| | | ajax.start(); |
| | | }; |
| | | |
| | | TSystemConfig.addBox = function (){ |
| | | TSystemConfig.addTime = function (){ |
| | | var i = $('input[name="num1"]').length + 1; |
| | | var a ="<div>\n" + |
| | | " <div class=\"initialLevel col-sm-12 control-label form-group\" >\n" + |
| | | var a ="" + |
| | | "<div class=\"rulesForm\" style=\"border: 1px solid #888888;padding-top: 10px;display: grid;margin: 10px 0px\">" + |
| | | |
| | | " <div class=\"initialLevel col-sm-12 control-label form-group\" id='time' >\n" + |
| | | " <span class=\"control-label\" >时间段</span>\n" + |
| | | " <input class=\"control-label\" id=\"num1-"+i+"\" name=\"num1\" type=\"text\" placeholder=\"00:00\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <input class=\"control-label\" id=\"num1\" name=\"num1\" type=\"text\" placeholder=\"00:00\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >——</span>\n" + |
| | | " <input class=\"control-label\" id=\"num2-"+i+"\" name=\"num2\" type=\"text\" placeholder=\"00:00\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <input class=\"control-label\" id=\"num2\" name=\"num2\" type=\"text\" placeholder=\"00:00\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"fa fa-remove\" style='position: absolute;right: 20px;color: red;font-size: 20px;' onclick=\"TSystemConfig.delTime(this)\"></span>\n" + |
| | | " </div>\n" + |
| | | "<div class='prices'>\n" + |
| | | " <div class=\"initialLevel col-sm-12 control-label form-group price\" >\n" + |
| | | " <span class=\"control-label\" >代驾里程</span>\n" + |
| | | " <input class=\"control-label\" id=\"num3-"+i+"\" name=\"num3\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >公里,起步价</span>\n" + |
| | | " <input class=\"control-label\" id=\"num4-"+i+"\" name=\"num4\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >元,超出里程每</span>\n" + |
| | | " <input class=\"control-label\" id=\"num5-"+i+"\" name=\"num5\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >公里,收费</span>\n" + |
| | | " <input class=\"control-label\" id=\"num6-"+i+"\" name=\"num6\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <input class=\"control-label\" id=\"num1\" name=\"num1\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >公里,至</span>\n" + |
| | | " <input class=\"control-label\" id=\"num2\" name=\"num2\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >公里,收费</span>\n" + |
| | | " <input class=\"control-label\" id=\"num3\" name=\"num3\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >元</span>\n" + |
| | | " <span class=\"fa fa-plus\" onclick=\"TSystemConfig.addBox(this)\"></span>\n" + |
| | | " </div>\n" + |
| | | " </div>" + |
| | | " <div class=\"initialLevel col-sm-12 control-label form-group\" >\n" + |
| | | " <span class=\"control-label\" >长途里程</span>\n" + |
| | | " <input class=\"control-label\" id=\"num4\" name=\"num4\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >——</span>\n" + |
| | | " <input class=\"control-label\" id=\"num5\" name=\"num5\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >公里,费用</span>\n" + |
| | | " <input class=\"control-label\" id=\"num6\" name=\"num6\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >元,超出里程每</span>\n" + |
| | | " <input class=\"control-label\" id=\"num7\" name=\"num7\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >公里,收费</span>\n" + |
| | | " <input class=\"control-label\" id=\"num8\" name=\"num8\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >元</span>\n" + |
| | | " </div>\n" + |
| | | "</div>" |
| | | |
| | | $("#rules").append($(a)) |
| | | } |
| | | |
| | | |
| | | TSystemConfig.addBox = function (e){ |
| | | var a ="<div>\n" + |
| | | " <div class=\"initialLevel col-sm-12 control-label form-group price\" >\n" + |
| | | " <span class=\"control-label\" >代驾里程</span>\n" + |
| | | " <input class=\"control-label\" id=\"num1\" name=\"num1\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >公里,至</span>\n" + |
| | | " <input class=\"control-label\" id=\"num2\" name=\"num2\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >公里,收费</span>\n" + |
| | | " <input class=\"control-label\" id=\"num3\" name=\"num3\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >元</span>\n" + |
| | | " <span class=\"fa fa-remove\" onclick=\"TSystemConfig.delBox(this)\"></span>\n" + |
| | | " </div>\n" + |
| | | " <div class=\"initialLevel col-sm-12 control-label form-group\" >\n" + |
| | | " <span class=\"control-label\" >长途里程</span>\n" + |
| | | " <input class=\"control-label\" id=\"num7-"+i+"\" name=\"num7\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >——</span>\n" + |
| | | " <input class=\"control-label\" id=\"num8-"+i+"\" name=\"num8\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >公里,收费</span>\n" + |
| | | " <input class=\"control-label\" id=\"num9-"+i+"\" name=\"num9\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >元,超出里程每</span>\n" + |
| | | " <input class=\"control-label\" id=\"num10-"+i+"\" name=\"num10\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >公里,收费</span>\n" + |
| | | " <input class=\"control-label\" id=\"num11-"+i+"\" name=\"num11\" type=\"number\" style=\"height: 30px;width: 80px\">\n" + |
| | | " <span class=\"control-label\" >元</span>\n" + |
| | | " </div>\n" + |
| | | " </div>" |
| | | |
| | | $("#rules").append($(a)) |
| | | // laydate.render({ |
| | | // elem: '#num1-'+i, |
| | | // type: 'time', |
| | | // format: 'HH:mm', |
| | | // range: false, |
| | | // lang:'zn' |
| | | // }); |
| | | // laydate.render({ |
| | | // elem: '#num2-'+i, |
| | | // type: 'time', |
| | | // format: 'HH:mm', |
| | | // range: false, |
| | | // lang:'zn' |
| | | // }); |
| | | $(e).parent('div').parent(".prices").append($(a)) |
| | | } |
| | | |
| | | TSystemConfig.delTime = function (o) { |
| | | $(o).parent("div").parent('.rulesForm').remove() |
| | | }; |
| | | |
| | | |
| | | TSystemConfig.delBox = function (o) { |
| | | $(o).parent("div").parent("div").remove() |
| | | }; |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.agentdriving.user.modular.system.model.AppUser; |
| | | import com.agentdriving.user.modular.system.model.SystemConfig; |
| | | import com.agentdriving.user.modular.system.service.*; |
| | | import com.agentdriving.user.modular.system.util.MallBook.model.InterfaceResponse; |
| | | import com.agentdriving.user.modular.system.util.MallBook.util.RSASignature; |
| | | import com.agentdriving.user.modular.system.util.PayMoneyUtil; |
| | | import com.agentdriving.user.modular.system.util.RedisUtil; |
| | | import com.agentdriving.user.modular.system.util.ResultUtil; |
| | | import com.agentdriving.user.modular.system.util.UUIDUtil; |
| | | import com.agentdriving.user.modular.system.util.huawei.OBSUtil; |
| | | import com.agentdriving.user.modular.system.util.huawei.SMSUtil; |
| | | import com.agentdriving.user.modular.system.warpper.*; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import java.io.InputStream; |
| | | import java.io.PrintWriter; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 用户控制器 |
| | |
| | | // @ServiceLog(name = "余额充值回调", url = "/base/appUser/rechargeBalanceCallback") |
| | | public void rechargeBalanceCallback(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | String code = request.getParameter("code"); |
| | | String version = request.getParameter("version"); |
| | | String msg = request.getParameter("msg"); |
| | | String date = request.getParameter("date"); |
| | | String result = request.getParameter("result"); |
| | | String sign = request.getParameter("sign"); |
| | | InterfaceResponse interfaceResponse = new InterfaceResponse(); |
| | | interfaceResponse.setCode(code); |
| | | interfaceResponse.setVersion(version); |
| | | interfaceResponse.setMsg(msg); |
| | | interfaceResponse.setDate(date); |
| | | interfaceResponse.setResult(result); |
| | | interfaceResponse.setSign(sign); |
| | | // 验签 |
| | | boolean verify = RSASignature.validate(interfaceResponse.content(), interfaceResponse.getSign()); |
| | | if (verify) {//验签成功业务处理逻辑 |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | String merOrderId = jsonObject.getString("merOrderId"); |
| | | String orderId = jsonObject.getString("parameter1"); |
| | | appUserService.rechargeBalanceCallback(orderId, merOrderId); |
| | | response.setStatus(200); |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request); |
| | | if(null != map){ |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String transaction_id = map.get("transaction_id"); |
| | | String result = map.get("result"); |
| | | String orderId = out_trade_no.substring(17); |
| | | appUserService.rechargeBalanceCallback(out_trade_no, transaction_id); |
| | | PrintWriter out = response.getWriter(); |
| | | out.print("OK"); |
| | | out.print(result); |
| | | out.flush(); |
| | | out.close(); |
| | | } else {//验签失败业务处理逻辑 |
| | | System.err.println("支付回调验签失败"); |
| | | } |
| | | |
| | | // Map<String, String> map = payMoneyUtil.weixinpayCallback(request); |
| | | // if(null != map){ |
| | | // String out_trade_no = map.get("out_trade_no"); |
| | | // String transaction_id = map.get("transaction_id"); |
| | | // String result = map.get("result"); |
| | | // String orderId = out_trade_no.substring(17); |
| | | // appUserService.rechargeBalanceCallback(out_trade_no, transaction_id); |
| | | // PrintWriter out = response.getWriter(); |
| | | // out.print(result); |
| | | // out.flush(); |
| | | // out.close(); |
| | | // } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | package com.agentdriving.user.modular.api; |
| | | |
| | | import com.agentdriving.user.core.util.ToolUtil; |
| | | import com.agentdriving.user.modular.system.model.Driver; |
| | | import com.agentdriving.user.modular.system.service.*; |
| | | import com.agentdriving.user.modular.system.warpper.*; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.agentdriving.user.modular.system.model.AppUser; |
| | | import com.agentdriving.user.modular.system.model.Order; |
| | | import com.agentdriving.user.modular.system.model.Revenue; |
| | | import com.agentdriving.user.modular.system.service.*; |
| | | import com.agentdriving.user.modular.system.util.MallBook.model.InterfaceResponse; |
| | | import com.agentdriving.user.modular.system.util.MallBook.model.Receive; |
| | | import com.agentdriving.user.modular.system.util.MallBook.model.ReceiveUser; |
| | | import com.agentdriving.user.modular.system.util.MallBook.util.RSASignature; |
| | | import com.agentdriving.user.modular.system.util.MallBook.util.TrhRequest; |
| | | import com.agentdriving.user.modular.system.util.PayMoneyUtil; |
| | | import com.agentdriving.user.modular.system.util.ResultUtil; |
| | | import com.agentdriving.user.modular.system.warpper.*; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @PostMapping("/base/order/orderPayCallback") |
| | | public void orderPayCallback(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | String code = request.getParameter("code"); |
| | | String version = request.getParameter("version"); |
| | | String msg = request.getParameter("msg"); |
| | | String date = request.getParameter("date"); |
| | | String result = request.getParameter("result"); |
| | | String sign = request.getParameter("sign"); |
| | | InterfaceResponse interfaceResponse = new InterfaceResponse(); |
| | | interfaceResponse.setCode(code); |
| | | interfaceResponse.setVersion(version); |
| | | interfaceResponse.setMsg(msg); |
| | | interfaceResponse.setDate(date); |
| | | interfaceResponse.setResult(result); |
| | | interfaceResponse.setSign(sign); |
| | | // 验签 |
| | | boolean verify = RSASignature.validate(interfaceResponse.content(), interfaceResponse.getSign()); |
| | | if (verify) {//验签成功业务处理逻辑 |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | String merOrderId = jsonObject.getString("merOrderId"); |
| | | String orderId = jsonObject.getString("parameter1"); |
| | | ResultUtil resultUtil = orderService.orderPayCallback(orderId, merOrderId); |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request); |
| | | if(null != map){ |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String transaction_id = map.get("transaction_id"); |
| | | String result = map.get("result"); |
| | | String orderId = out_trade_no.substring(17); |
| | | ResultUtil resultUtil = orderService.orderPayCallback(orderId, transaction_id); |
| | | if(resultUtil.getCode() == 10000){ |
| | | response.setStatus(200); |
| | | PrintWriter out = response.getWriter(); |
| | | out.print("OK"); |
| | | out.print(result); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | } else {//验签失败业务处理逻辑 |
| | | System.err.println("支付回调验签失败"); |
| | | } |
| | | |
| | | |
| | | // Map<String, String> map = payMoneyUtil.weixinpayCallback(request); |
| | | // if(null != map){ |
| | | // String out_trade_no = map.get("out_trade_no"); |
| | | // String transaction_id = map.get("transaction_id"); |
| | | // String result = map.get("result"); |
| | | // String orderId = out_trade_no.substring(17); |
| | | // ResultUtil resultUtil = orderService.orderPayCallback(orderId, transaction_id); |
| | | // if(resultUtil.getCode() == 10000){ |
| | | // PrintWriter out = response.getWriter(); |
| | | // out.print(result); |
| | | // out.flush(); |
| | | // out.close(); |
| | | // } |
| | | // } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 异步分账回调 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/order/ledgerCallback") |
| | | public void ledgerCallback(HttpServletRequest request, HttpServletResponse response){ |
| | | try{ |
| | | String code = request.getParameter("code"); |
| | | String version = request.getParameter("version"); |
| | | String msg = request.getParameter("msg"); |
| | | String date = request.getParameter("date"); |
| | | String result = request.getParameter("result"); |
| | | String sign = request.getParameter("sign"); |
| | | InterfaceResponse interfaceResponse = new InterfaceResponse(); |
| | | interfaceResponse.setCode(code); |
| | | interfaceResponse.setVersion(version); |
| | | interfaceResponse.setMsg(msg); |
| | | interfaceResponse.setDate(date); |
| | | interfaceResponse.setResult(result); |
| | | interfaceResponse.setSign(sign); |
| | | // 验签 |
| | | boolean verify = RSASignature.validate(interfaceResponse.content(), interfaceResponse.getSign()); |
| | | if (verify) {//验签成功业务处理逻辑 |
| | | JSONObject jsonObject = JSON.parseObject(result); |
| | | String merOrderId = jsonObject.getString("merOrderId"); |
| | | String orderId = jsonObject.getString("parameter1"); |
| | | //确认收货 |
| | | new Timer().schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | Order order = orderService.selectById(orderId); |
| | | List<Revenue> revenues = revenueService.selectList(new EntityWrapper<Revenue>().eq("userType", 2).eq("orderId", order.getId())); |
| | | Receive receive = new Receive();//确认收货 |
| | | receive.setOriginalMerOrderId(merOrderId); |
| | | receive.setRcvAmount(String.valueOf(order.getPayMoney() * 100)); |
| | | List<ReceiveUser> splitList = new ArrayList<>(); |
| | | for (Revenue revenue : revenues) { |
| | | Driver driver = driverService.selectById(revenue.getUserId()); |
| | | ReceiveUser receiveUser = new ReceiveUser(); |
| | | receiveUser.setSplitUserId(driver.getMerchantNumber()); |
| | | receiveUser.setRcvSplitAmount(revenue.getAmount().toString()); |
| | | splitList.add(receiveUser); |
| | | } |
| | | receive.setSplitList(splitList); |
| | | TrhRequest<Receive> request1 = new TrhRequest(); |
| | | InterfaceResponse execute = request1.execute(receive, Receive.SERVICE_CODE); |
| | | if(!"0000".equals(execute.getResult())){ |
| | | System.err.println("确认收货" + execute.getMsg()); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | String status = jsonObject.getString("status"); |
| | | if("2".equals(status)){ |
| | | System.err.println("确认收货失败"); |
| | | } |
| | | if("0".equals(status)){ |
| | | System.err.println("确认收货处理中"); |
| | | } |
| | | } |
| | | }, 30000); |
| | | response.setStatus(200); |
| | | PrintWriter out = response.getWriter(); |
| | | out.print("OK"); |
| | | out.flush(); |
| | | out.close(); |
| | | } else {//验签失败业务处理逻辑 |
| | | System.err.println("支付回调验签失败"); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/orderAppraise") |
| | | // @ServiceLog(name = "订单评价操作", url = "/api/order/orderAppraise") |
| | |
| | | b.phone as driverPhone, |
| | | b.`code` as driverCode, |
| | | ifnull(DATE_FORMAT(now(), '%Y') - DATE_FORMAT(b.firstCertificateTime, '%Y'), 0) as driverAge, |
| | | (select count(1) from t_order where driverId = b.id and `status` = 1 and state in (107, 108, 109)) as driverNumber, |
| | | (select count(1) from t_order where driverId = b.id and `status` = 1 and state in (107, 108, 109)) + 200 as driverNumber, |
| | | b.score as driverScore, |
| | | a.state, |
| | | UNIX_TIMESTAMP(a.createTime) * 1000 as createTime, |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.agentdriving.user.modular.system.model.*; |
| | | import com.agentdriving.user.modular.system.service.*; |
| | | import com.agentdriving.user.modular.system.util.MallBook.model.InterfaceResponse; |
| | | import com.agentdriving.user.modular.system.util.MallBook.model.PaymentOrder; |
| | | import com.agentdriving.user.modular.system.util.MallBook.model.PaymentOrderGood; |
| | | import com.agentdriving.user.modular.system.util.MallBook.util.TrhRequest; |
| | | import com.agentdriving.user.modular.system.util.PayMoneyUtil; |
| | | import com.agentdriving.user.modular.system.util.RedisUtil; |
| | | import com.agentdriving.user.modular.system.util.ResultUtil; |
| | |
| | | import com.agentdriving.user.modular.system.util.weChat.WXCore; |
| | | import com.agentdriving.user.modular.system.util.weChat.WeChatUtil; |
| | | import com.agentdriving.user.modular.system.util.weChat.model.Code2Session; |
| | | import com.agentdriving.user.modular.system.warpper.*; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | | import org.apache.shiro.authc.UsernamePasswordToken; |
| | | import org.apache.shiro.authc.credential.HashedCredentialsMatcher; |
| | |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.net.InetAddress; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | |
| | | rechargeRecord.setPayStatus(1); |
| | | rechargeRecord.setPayType(1); |
| | | rechargeRecordService.insert(rechargeRecord); |
| | | // ResultUtil weixinpay = payMoneyUtil.weixinpay("余额充值", "", out_trade_no, amount.toString(), "/base/appUser/rechargeBalanceCallback", "JSAPI", appUser.getOpenid()); |
| | | // return weixinpay; |
| | | ResultUtil weixinpay = payMoneyUtil.weixinpay("余额充值", "", out_trade_no, amount.toString(), "/base/appUser/rechargeBalanceCallback", "JSAPI", appUser.getOpenid()); |
| | | if(weixinpay.getCode() == 200){ |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | int num = 1; |
| | | int wait = 0; |
| | | while (num <= 10) { |
| | | int min = 5000; |
| | | wait += (min * num); |
| | | RechargeRecord rechargeRecord1 = rechargeRecordService.selectById(rechargeRecord.getId()); |
| | | if (rechargeRecord1.getPayStatus() == 2) { |
| | | return; |
| | | } |
| | | ResultUtil<Map<String, String>> resultUtil = payMoneyUtil.queryWXOrder(out_trade_no, ""); |
| | | if (resultUtil.getCode() == 200) { |
| | | /** |
| | | * 订单状态 |
| | | * SUCCESS—支付成功, |
| | | * REFUND—转入退款, |
| | | * NOTPAY—未支付, |
| | | * CLOSED—已关闭, |
| | | * REVOKED—已撤销(刷卡支付), |
| | | * USERPAYING--用户支付中, |
| | | * PAYERROR--支付失败(其他原因,如银行返回失败) |
| | | */ |
| | | Map<String, String> data2 = resultUtil.getData(); |
| | | String s = data2.get("state"); |
| | | String transaction_id = data2.get("transaction_id"); |
| | | if ("REFUND".equals(s) || "NOTPAY".equals(s) || "CLOSED".equals(s) || "REVOKED".equals(s) || "PAYERROR".equals(s)) { |
| | | //回退 |
| | | return; |
| | | } |
| | | if ("SUCCESS".equals(s)) { |
| | | rechargeRecord1.setPayStatus(2); |
| | | rechargeRecord1.setPayTime(new Date()); |
| | | rechargeRecord1.setOrderNumber(transaction_id); |
| | | rechargeRecordService.updateById(rechargeRecord1); |
| | | |
| | | PaymentOrder paymentOrder = new PaymentOrder(); |
| | | paymentOrder.setBizOrderId(out_trade_no); |
| | | paymentOrder.setAmount(String.valueOf(amount * 100)); |
| | | paymentOrder.setOrderName("余额充值"); |
| | | paymentOrder.setPayType("WX_MINI"); |
| | | paymentOrder.setTransferType("0"); |
| | | paymentOrder.setAsynSplitFlag("1"); |
| | | paymentOrder.setAppid(appletsAppid); |
| | | paymentOrder.setOpenid(appUser.getOpenid()); |
| | | paymentOrder.setTerminalIp(InetAddress.getLocalHost().getHostAddress()); |
| | | List<PaymentOrderGood> goodsDetail = new ArrayList<>(); |
| | | PaymentOrderGood paymentOrderGood = new PaymentOrderGood(); |
| | | paymentOrderGood.setGoodsName("余额充值"); |
| | | goodsDetail.add(paymentOrderGood); |
| | | paymentOrder.setGoodsDetail(goodsDetail); |
| | | paymentOrder.setFrontUrl(""); |
| | | paymentOrder.setNotifyUrl(callbackPath + "/base/appUser/rechargeBalanceCallback"); |
| | | paymentOrder.setParameter1(out_trade_no); |
| | | |
| | | TrhRequest<PaymentOrder> request = new TrhRequest(); |
| | | InterfaceResponse execute = request.execute(paymentOrder, PaymentOrder.SERVICE_CODE); |
| | | if(!"0000".equals(execute.getResult())){ |
| | | return ResultUtil.error(execute.getMsg()); |
| | | AppUser appUser1 = AppUserServiceImpl.this.selectById(rechargeRecord1.getUserId()); |
| | | AccountChangeDetail accountChangeDetail = new AccountChangeDetail(); |
| | | accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3)); |
| | | accountChangeDetail.setUserType(1); |
| | | accountChangeDetail.setUserId(appUser1.getId()); |
| | | accountChangeDetail.setCreateTime(new Date()); |
| | | accountChangeDetail.setOldData(appUser1.getAccountBalance()); |
| | | accountChangeDetail.setType(1); |
| | | accountChangeDetail.setChangeType(3); |
| | | accountChangeDetail.setExplain("余额充值"); |
| | | appUser1.setAccountBalance(appUser1.getAccountBalance() + rechargeRecord1.getAmount()); |
| | | accountChangeDetail.setNewData(appUser1.getAccountBalance()); |
| | | AppUserServiceImpl.this.updateById(appUser1); |
| | | accountChangeDetailService.insert(accountChangeDetail); |
| | | return; |
| | | } |
| | | if ("USERPAYING".equals(s)) { |
| | | Thread.sleep(wait); |
| | | num++; |
| | | } |
| | | }else{ |
| | | Thread.sleep(wait); |
| | | num++; |
| | | } |
| | | if(10 == num){ |
| | | rechargeRecordService.deleteById(rechargeRecord1.getId()); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | String status = jsonObject.getString("status"); |
| | | if("2".equals(status)){ |
| | | return ResultUtil.error("失败"); |
| | | } |
| | | if("0".equals(status)){ |
| | | return ResultUtil.error("处理中"); |
| | | } |
| | | String payCode = jsonObject.getString("payCode"); |
| | | return ResultUtil.success(payCode); |
| | | return weixinpay; |
| | | } |
| | | |
| | | |
| | |
| | | import com.agentdriving.user.modular.system.model.*; |
| | | import com.agentdriving.user.modular.system.service.*; |
| | | import com.agentdriving.user.modular.system.util.*; |
| | | import com.agentdriving.user.modular.system.util.MallBook.model.*; |
| | | import com.agentdriving.user.modular.system.warpper.*; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.agentdriving.user.core.util.ToolUtil; |
| | | import com.agentdriving.user.modular.system.dao.OrderMapper; |
| | | import com.agentdriving.user.modular.system.model.*; |
| | | import com.agentdriving.user.modular.system.service.*; |
| | | import com.agentdriving.user.modular.system.util.*; |
| | | import com.agentdriving.user.modular.system.util.GaoDe.MapUtil; |
| | | import com.agentdriving.user.modular.system.util.GaoDe.model.District; |
| | | import com.agentdriving.user.modular.system.util.MallBook.model.*; |
| | | import com.agentdriving.user.modular.system.util.MallBook.util.Transfer; |
| | | import com.agentdriving.user.modular.system.util.MallBook.util.TrhRequest; |
| | | import com.agentdriving.user.modular.system.util.juhe.WeatherUtil; |
| | | import com.agentdriving.user.modular.system.util.mongodb.model.Location; |
| | | import com.agentdriving.user.modular.system.warpper.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.math.MathContext; |
| | | import java.math.RoundingMode; |
| | | import java.net.InetAddress; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | |
| | | @Autowired |
| | | private IRevenueService revenueService; |
| | | |
| | | @Autowired |
| | | private IAgentService agentService; |
| | | |
| | | @Autowired |
| | | private IPlatformRechargeRecordService platformRechargeRecordService; |
| | | |
| | | @Autowired |
| | | private IDivisionRecordService divisionRecordService; |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath;//支付回调网关地址 |
| | |
| | | JSONArray chargeStandard = jsonObject.getJSONArray("ChargeStandard"); |
| | | JSONObject extraCost = jsonObject.getJSONObject("ExtraCost"); |
| | | Date date = new Date(); |
| | | for (int i = 0; i < chargeStandard.size(); i++) { |
| | | |
| | | boolean b = true; |
| | | for (int i = 1; i < chargeStandard.size(); i++) {//各种时间段 |
| | | JSONObject jsonObject1 = chargeStandard.getJSONObject(i); |
| | | String num1 = jsonObject1.getString("num1"); |
| | | String num2 = jsonObject1.getString("num2"); |
| | | Double num3 = jsonObject1.getDouble("num3");//起步里程 |
| | | Double num4 = jsonObject1.getDouble("num4");//起步价格 |
| | | Double num5 = jsonObject1.getDouble("num5");//超过公里 |
| | | Double num6 = jsonObject1.getDouble("num6");//超过num3每num5公里收取num6 |
| | | Double num7 = jsonObject1.getDouble("num7");//长途起始公里 |
| | | Double num8 = jsonObject1.getDouble("num8");//长途结束公里 |
| | | Double num9 = jsonObject1.getDouble("num9");//长途费 |
| | | Double num10 = jsonObject1.getDouble("num10");//超出长途里程每num10公里 |
| | | Double num11 = jsonObject1.getDouble("num11");//超过num8每num10公里收取num11 |
| | | JSONArray num3 = jsonObject1.getJSONArray("num3");//起步里程 |
| | | Double num4 = jsonObject1.getDouble("num4");//长途里程 |
| | | Double num5 = jsonObject1.getDouble("num5");//长途里程 |
| | | Double num6 = jsonObject1.getDouble("num6");//长途费 |
| | | Double num7 = jsonObject1.getDouble("num7");//超出长途里程每num10公里 |
| | | Double num8 = jsonObject1.getDouble("num8");//超过num8每num10公里收取num11 |
| | | |
| | | String[] split = num1.split(":"); |
| | | Calendar s = Calendar.getInstance(); |
| | |
| | | e.set(Calendar.SECOND, 0); |
| | | |
| | | if(date.getTime() >= s.getTimeInMillis() && date.getTime() < e.getTimeInMillis()){ |
| | | if(num3.compareTo(distance) >= 0){//起步里程内 |
| | | order.setStartDistance(distance);//起步里程 |
| | | order.setStartPrice(num4);//起步价 |
| | | }else{ |
| | | BigDecimal subtract = new BigDecimal(distance).subtract(new BigDecimal(num3));//超出起步里程 |
| | | BigDecimal divide = subtract.divide(new BigDecimal(num5), new MathContext(2, RoundingMode.HALF_EVEN)); |
| | | BigDecimal multiply = divide.multiply(new BigDecimal(num6)); |
| | | order.setStartDistance(num3);//起步里程 |
| | | order.setStartPrice(num4);//起步价 |
| | | order.setOverDriveDistance(subtract.doubleValue());//超出起步里程 |
| | | order.setOverDrivePrice(multiply.doubleValue());//超出起步里程费 |
| | | |
| | | b = false; |
| | | Double dd = 0d; |
| | | for (int j = 0; j < num3.size(); j++) { |
| | | JSONObject jsonObject2 = num3.getJSONObject(j); |
| | | Double num1_1 = jsonObject2.getDouble("num1"); |
| | | Double num2_1 = jsonObject2.getDouble("num2"); |
| | | Double num3_1 = jsonObject2.getDouble("num3"); |
| | | if(num1_1.compareTo(distance) <= 0 && num2_1.compareTo(distance) > 0){ |
| | | order.setStartDistance(distance);//起步里程 |
| | | order.setStartPrice(num3_1);//起步价 |
| | | } |
| | | if(j == num3.size() - 1 && order.getStartPrice() == 0){ |
| | | order.setStartDistance(num2_1);//起步里程 |
| | | order.setStartPrice(num3_1);//起步价 |
| | | dd = distance - num2_1; |
| | | } |
| | | } |
| | | if(dd != 0){ |
| | | //计算长途费 |
| | | if(distance.compareTo(num7) > 0){ |
| | | order.setLongDistance(num7 + "-" + num8);//长途里程 |
| | | order.setLongDistancePrice(num9);//长途费 |
| | | if(distance.compareTo(num4) > 0){ |
| | | order.setLongDistance(num4 + "-" + num5);//长途里程 |
| | | order.setLongDistancePrice(num6);//长途费 |
| | | } |
| | | //计算长途里程超出的部分 |
| | | if(distance.compareTo(num8) > 0){ |
| | | BigDecimal subtract1 = new BigDecimal(distance).subtract(new BigDecimal(num8)); |
| | | BigDecimal divide1 = subtract1.divide(new BigDecimal(num10), new MathContext(2, RoundingMode.HALF_EVEN)); |
| | | BigDecimal multiply1 = divide1.multiply(new BigDecimal(num11)); |
| | | if(distance.compareTo(num5) > 0){ |
| | | BigDecimal subtract1 = new BigDecimal(distance).subtract(new BigDecimal(num5)); |
| | | BigDecimal divide1 = subtract1.divide(new BigDecimal(num7), new MathContext(2, RoundingMode.HALF_EVEN)); |
| | | BigDecimal multiply1 = divide1.multiply(new BigDecimal(num8)); |
| | | order.setOverLongDistance(subtract1.doubleValue());//超出长途里程 |
| | | order.setOverLongDistancePrice(multiply1.doubleValue());//超出长途里程费 |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if(b){//默认配置 |
| | | JSONObject jsonObject1 = chargeStandard.getJSONObject(0); |
| | | JSONArray num3 = jsonObject1.getJSONArray("num3");//起步里程 |
| | | Double num4 = jsonObject1.getDouble("num4");//长途里程 |
| | | Double num5 = jsonObject1.getDouble("num5");//长途里程 |
| | | Double num6 = jsonObject1.getDouble("num6");//长途费 |
| | | Double num7 = jsonObject1.getDouble("num7");//超出长途里程每num10公里 |
| | | Double num8 = jsonObject1.getDouble("num8");//超过num8每num10公里收取num11 |
| | | |
| | | Double dd = 0d; |
| | | for (int j = 0; j < num3.size(); j++) { |
| | | JSONObject jsonObject2 = num3.getJSONObject(j); |
| | | Double num1_1 = jsonObject2.getDouble("num1"); |
| | | Double num2_1 = jsonObject2.getDouble("num2"); |
| | | Double num3_1 = jsonObject2.getDouble("num3"); |
| | | if(num1_1.compareTo(distance) <= 0 && num2_1.compareTo(distance) > 0){ |
| | | order.setStartDistance(distance);//起步里程 |
| | | order.setStartPrice(num3_1);//起步价 |
| | | } |
| | | if(j == num3.size() - 1 && order.getStartPrice() == 0){ |
| | | order.setStartDistance(num2_1);//起步里程 |
| | | order.setStartPrice(num3_1);//起步价 |
| | | dd = distance - num2_1; |
| | | } |
| | | } |
| | | if(dd != 0){ |
| | | //计算长途费 |
| | | if(distance.compareTo(num4) > 0){ |
| | | order.setLongDistance(num4 + "-" + num5);//长途里程 |
| | | order.setLongDistancePrice(num6);//长途费 |
| | | } |
| | | //计算长途里程超出的部分 |
| | | if(distance.compareTo(num5) > 0){ |
| | | BigDecimal subtract1 = new BigDecimal(distance).subtract(new BigDecimal(num5)); |
| | | BigDecimal divide1 = subtract1.divide(new BigDecimal(num7), new MathContext(2, RoundingMode.HALF_EVEN)); |
| | | BigDecimal multiply1 = divide1.multiply(new BigDecimal(num8)); |
| | | order.setOverLongDistance(subtract1.doubleValue());//超出长途里程 |
| | | order.setOverLongDistancePrice(multiply1.doubleValue());//超出长途里程费 |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | orderPriceWarpper.setDiscountAmount(0D); |
| | | orderPriceWarpper.setPayType(1);//微信支付 |
| | | Double orderMoney = order.getOrderMoney(); |
| | | //先算优惠券 |
| | | // Coupon coupon = userToCouponService.queryCoupon(uid, orderMoney); |
| | | // if(null != coupon && null == couponId){ |
| | | // orderPriceWarpper.setDiscountedPrice(coupon.getCouponPreferentialAmount()); |
| | | // orderPriceWarpper.setCouponId(coupon.getId()); |
| | | // } |
| | | |
| | | if(payType == 1 && null == couponId && appUser.getHavDiscount() == 1 && balance.compareTo(orderMoney) >= 0){//使用余额抵扣 |
| | | orderPriceWarpper.setDiscount(9D); |
| | | orderPriceWarpper.setDiscountAmount(new BigDecimal(orderMoney * 0.1).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | |
| | | if(orderPayment.getPayType() == 3){//线下支付(由司机端操作) |
| | | } |
| | | if(orderPayment.getPayType() == 4){//微信+余额 |
| | | if(appUser.getAccountBalance() == 0){ |
| | | return ResultUtil.error("账户余额不足"); |
| | | } |
| | | return weixinAndBalancePayment(order, appUser, orderPayment.getCouponId()); |
| | | } |
| | | return ResultUtil.success(); |
| | |
| | | } |
| | | order.setPayType(1); |
| | | order.setPayMoney(payMoney); |
| | | this.updateById(order); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String out_trade_no = sdf.format(new Date()) + order.getId(); |
| | | // ResultUtil weixinpay = payMoneyUtil.weixinpay("代驾服务费", "", out_trade_no, payMoney.toString(), "/base/order/orderPayCallback", "JSAPI", appUser.getOpenid()); |
| | | // this.updateById(order); |
| | | ResultUtil weixinpay = payMoneyUtil.weixinpay("代驾服务费", "", out_trade_no, payMoney.toString(), "/base/order/orderPayCallback", "JSAPI", appUser.getOpenid()); |
| | | if(weixinpay.getCode() == 200){ |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | int num = 1; |
| | | int wait = 0; |
| | | while (num <= 10) { |
| | | int min = 5000; |
| | | wait += (min * num); |
| | | Order order1 = OrderServiceImpl.this.selectById(order.getId()); |
| | | if (order1.getState() != 107) { |
| | | return; |
| | | } |
| | | ResultUtil<Map<String, String>> resultUtil = payMoneyUtil.queryWXOrder(out_trade_no, ""); |
| | | if (resultUtil.getCode() == 200) { |
| | | /** |
| | | * 订单状态 |
| | | * SUCCESS—支付成功, |
| | | * REFUND—转入退款, |
| | | * NOTPAY—未支付, |
| | | * CLOSED—已关闭, |
| | | * REVOKED—已撤销(刷卡支付), |
| | | * USERPAYING--用户支付中, |
| | | * PAYERROR--支付失败(其他原因,如银行返回失败) |
| | | */ |
| | | Map<String, String> data2 = resultUtil.getData(); |
| | | String s = data2.get("state"); |
| | | String transaction_id = data2.get("transaction_id"); |
| | | if ("REFUND".equals(s) || "NOTPAY".equals(s) || "CLOSED".equals(s) || "REVOKED".equals(s) || "PAYERROR".equals(s) || num == 10) { |
| | | //回退 |
| | | return; |
| | | } |
| | | if ("SUCCESS".equals(s)) { |
| | | order1.setState(108); |
| | | order1.setPayTime(new Date()); |
| | | order1.setOrderNo(transaction_id); |
| | | OrderServiceImpl.this.updateById(order1); |
| | | |
| | | Driver driver = driverService.selectById(order1.getDriverId()); |
| | | AccountChangeDetail accountChangeDetail = new AccountChangeDetail(); |
| | | accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3)); |
| | | accountChangeDetail.setUserType(2); |
| | | accountChangeDetail.setUserId(order1.getDriverId()); |
| | | accountChangeDetail.setCreateTime(new Date()); |
| | | accountChangeDetail.setOldData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission()); |
| | | accountChangeDetail.setType(1); |
| | | accountChangeDetail.setChangeType(7); |
| | | accountChangeDetail.setOrderId(order1.getId()); |
| | | accountChangeDetail.setExplain("优惠券收入"); |
| | | driver.setCouponBalance(driver.getCouponBalance() + order1.getDiscountedPrice()); |
| | | accountChangeDetail.setNewData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission()); |
| | | driverService.updateById(driver); |
| | | accountChangeDetailService.insert(accountChangeDetail); |
| | | |
| | | |
| | | PaymentOrder paymentOrder = new PaymentOrder(); |
| | | paymentOrder.setBizOrderId(out_trade_no); |
| | | paymentOrder.setAmount(String.valueOf(payMoney * 100)); |
| | | paymentOrder.setOrderName("代驾服务费"); |
| | | paymentOrder.setPayType("WX_MINI"); |
| | | paymentOrder.setTransferType("0"); |
| | | paymentOrder.setAsynSplitFlag("1"); |
| | | paymentOrder.setAppid(""); |
| | | paymentOrder.setOpenid(appUser.getOpenid()); |
| | | paymentOrder.setTerminalIp(InetAddress.getLocalHost().getHostAddress()); |
| | | List<PaymentOrderGood> goodsDetail = new ArrayList<>(); |
| | | PaymentOrderGood paymentOrderGood = new PaymentOrderGood(); |
| | | paymentOrderGood.setGoodsName("服务费"); |
| | | goodsDetail.add(paymentOrderGood); |
| | | paymentOrder.setGoodsDetail(goodsDetail); |
| | | paymentOrder.setFrontUrl(""); |
| | | paymentOrder.setNotifyUrl(callbackPath + "/base/order/orderPayCallback"); |
| | | paymentOrder.setParameter1(order.getId().toString()); |
| | | |
| | | TrhRequest<PaymentOrder> request = new TrhRequest(); |
| | | InterfaceResponse execute = request.execute(paymentOrder, PaymentOrder.SERVICE_CODE); |
| | | if(!"0000".equals(execute.getResult())){ |
| | | return ResultUtil.error(execute.getMsg()); |
| | | pushUtil.pushOrderStatus(order1.getUserId(), 1, order1.getId(), order1.getState()); |
| | | if(null != order1.getDriverId()) { |
| | | PushOrderInfoWarpper pushOrderInfoWarpper = new PushOrderInfoWarpper(); |
| | | pushOrderInfoWarpper.setId(order1.getId()); |
| | | pushOrderInfoWarpper.setState(order1.getState()); |
| | | pushUtil.pushOrderInfo(order1.getDriverId(), 2, pushOrderInfoWarpper); |
| | | } |
| | | //处理佣金和收入记录 |
| | | saveCommission(order1); |
| | | return; |
| | | } |
| | | if ("USERPAYING".equals(s)) { |
| | | Thread.sleep(wait); |
| | | num++; |
| | | continue; |
| | | } |
| | | Thread.sleep(wait); |
| | | num++; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | String status = jsonObject.getString("status"); |
| | | if("2".equals(status)){ |
| | | return ResultUtil.error("失败"); |
| | | } |
| | | if("0".equals(status)){ |
| | | return ResultUtil.error("处理中"); |
| | | } |
| | | String payCode = jsonObject.getString("payCode"); |
| | | this.updateById(order); |
| | | return ResultUtil.success(payCode); |
| | | return weixinpay; |
| | | } |
| | | |
| | | |
| | |
| | | if(0 < payMoney){//还需要调起微信支付 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String out_trade_no = sdf.format(new Date()) + order.getId(); |
| | | // ResultUtil weixinpay = payMoneyUtil.weixinpay("代驾服务费", "", out_trade_no, payMoney.toString(), "/base/order/orderPayCallback", "JSAPI", appUser.getOpenid()); |
| | | ResultUtil weixinpay = payMoneyUtil.weixinpay("代驾服务费", "", out_trade_no, payMoney.toString(), "/base/order/orderPayCallback", "JSAPI", appUser.getOpenid()); |
| | | |
| | | PaymentOrder paymentOrder = new PaymentOrder(); |
| | | paymentOrder.setBizOrderId(out_trade_no); |
| | | paymentOrder.setAmount(String.valueOf(payMoney * 100)); |
| | | paymentOrder.setOrderName("代驾服务费"); |
| | | paymentOrder.setPayType("WX_MINI"); |
| | | paymentOrder.setTransferType("0"); |
| | | paymentOrder.setAsynSplitFlag("1"); |
| | | paymentOrder.setAppid(""); |
| | | paymentOrder.setOpenid(appUser.getOpenid()); |
| | | paymentOrder.setTerminalIp(InetAddress.getLocalHost().getHostAddress()); |
| | | List<PaymentOrderGood> goodsDetail = new ArrayList<>(); |
| | | PaymentOrderGood paymentOrderGood = new PaymentOrderGood(); |
| | | paymentOrderGood.setGoodsName("服务费"); |
| | | goodsDetail.add(paymentOrderGood); |
| | | paymentOrder.setGoodsDetail(goodsDetail); |
| | | paymentOrder.setFrontUrl(""); |
| | | paymentOrder.setNotifyUrl(callbackPath + "/base/order/orderPayCallback"); |
| | | paymentOrder.setParameter1(order.getId().toString()); |
| | | if(weixinpay.getCode() == 200){ |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | int num = 1; |
| | | int wait = 0; |
| | | while (num <= 10) { |
| | | int min = 5000; |
| | | wait += (min * num); |
| | | Order order1 = OrderServiceImpl.this.selectById(order.getId()); |
| | | if (order1.getState() != 107) { |
| | | return; |
| | | } |
| | | ResultUtil<Map<String, String>> resultUtil = payMoneyUtil.queryWXOrder(out_trade_no, ""); |
| | | if (resultUtil.getCode() == 200) { |
| | | /** |
| | | * 订单状态 |
| | | * SUCCESS—支付成功, |
| | | * REFUND—转入退款, |
| | | * NOTPAY—未支付, |
| | | * CLOSED—已关闭, |
| | | * REVOKED—已撤销(刷卡支付), |
| | | * USERPAYING--用户支付中, |
| | | * PAYERROR--支付失败(其他原因,如银行返回失败) |
| | | */ |
| | | Map<String, String> data2 = resultUtil.getData(); |
| | | String s = data2.get("state"); |
| | | String transaction_id = data2.get("transaction_id"); |
| | | if ("REFUND".equals(s) || "NOTPAY".equals(s) || "CLOSED".equals(s) || "REVOKED".equals(s) || "PAYERROR".equals(s) || num == 10) { |
| | | //回退 |
| | | AccountChangeDetail accountChangeDetail1 = accountChangeDetailService.selectById(accountChangeDetail.getId()); |
| | | double v = accountChangeDetail1.getOldData() - accountChangeDetail1.getNewData(); |
| | | AppUser appUser1 = appUserService.selectById(order1.getUserId()); |
| | | |
| | | TrhRequest<PaymentOrder> request = new TrhRequest(); |
| | | InterfaceResponse execute = request.execute(paymentOrder, PaymentOrder.SERVICE_CODE); |
| | | if(!"0000".equals(execute.getResult())){ |
| | | return ResultUtil.error(execute.getMsg()); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | String status = jsonObject.getString("status"); |
| | | if("2".equals(status)){ |
| | | return ResultUtil.error("失败"); |
| | | } |
| | | if("0".equals(status)){ |
| | | return ResultUtil.error("处理中"); |
| | | } |
| | | String payCode = jsonObject.getString("payCode"); |
| | | this.updateById(order); |
| | | return ResultUtil.success(payCode); |
| | | accountChangeDetail1 = new AccountChangeDetail(); |
| | | accountChangeDetail1.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3)); |
| | | accountChangeDetail1.setUserType(1); |
| | | accountChangeDetail1.setUserId(appUser1.getId()); |
| | | accountChangeDetail1.setCreateTime(new Date()); |
| | | accountChangeDetail1.setOldData(appUser1.getAccountBalance()); |
| | | accountChangeDetail1.setType(1); |
| | | accountChangeDetail1.setChangeType(2); |
| | | accountChangeDetail1.setOrderId(order1.getId()); |
| | | accountChangeDetail1.setExplain("支付失败回退"); |
| | | appUser1.setAccountBalance(appUser1.getAccountBalance() + v); |
| | | accountChangeDetail1.setNewData(appUser1.getAccountBalance()); |
| | | appUserService.updateById(appUser1); |
| | | accountChangeDetailService.insert(accountChangeDetail1); |
| | | return; |
| | | } |
| | | if ("SUCCESS".equals(s)) { |
| | | order1.setState(108); |
| | | order1.setPayTime(new Date()); |
| | | order1.setOrderNo(transaction_id); |
| | | OrderServiceImpl.this.updateById(order1); |
| | | |
| | | // TODO: 2023/5/18 取消支付后需要处理优惠券数据回退 |
| | | // |
| | | // |
| | | // new Thread(new Runnable() { |
| | | // @Override |
| | | // public void run() { |
| | | // try { |
| | | // int num = 1; |
| | | // int wait = 0; |
| | | // while (num <= 10){ |
| | | // int min = 5000; |
| | | // wait += (min * num); |
| | | // Order order1 = OrderServiceImpl.this.selectById(order.getId()); |
| | | // if(order1.getState() != 107){ |
| | | // return; |
| | | // } |
| | | // |
| | | // /** |
| | | // * SUCCESS--支付成功 |
| | | // * REFUND--转入退款 |
| | | // * NOTPAY--未支付 |
| | | // * CLOSED--已关闭 |
| | | // * REVOKED--已撤销(刷卡支付) |
| | | // * USERPAYING--用户支付中 |
| | | // * PAYERROR--支付失败(其他原因,如银行返回失败) |
| | | // * ACCEPT--已接收,等待扣款 |
| | | // */ |
| | | // ResultUtil<Map<String, String>> resultUtil = payMoneyUtil.queryWXOrder(out_trade_no, ""); |
| | | // if(resultUtil.getCode() == 200){ |
| | | // Map<String, String> map = resultUtil.getData(); |
| | | // String trade_type = map.get("trade_type"); |
| | | // 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)){ |
| | | // AccountChangeDetail accountChangeDetail1 = accountChangeDetailService.selectById(accountChangeDetail.getId()); |
| | | // AppUser appUser1 = appUserService.selectById(accountChangeDetail1.getUserId()); |
| | | // Double b = accountChangeDetail1.getOldData() - accountChangeDetail1.getNewData(); |
| | | // appUser1.setAccountBalance(appUser1.getAccountBalance() + b); |
| | | // appUserService.updateById(appUser1); |
| | | // |
| | | // accountChangeDetailService.deleteById(accountChangeDetail.getId()); |
| | | // return; |
| | | // } |
| | | // if("SUCCESS".equals(trade_state)){ |
| | | // order1.setPayTime(new Date()); |
| | | // order1.setState(108); |
| | | // order1.setOrderNo(transaction_id); |
| | | // OrderServiceImpl.this.updateById(order1); |
| | | // |
| | | // //处理抽成及收入 |
| | | // saveCommission(order1); |
| | | // return; |
| | | // } |
| | | // if("USERPAYING".equals(trade_state) || "ACCEPT".equals(trade_state)){ |
| | | // Thread.sleep(wait); |
| | | // num++; |
| | | // } |
| | | // }else{ |
| | | // Thread.sleep(wait); |
| | | // num++; |
| | | // } |
| | | // if(10 == num){ |
| | | // AccountChangeDetail accountChangeDetail1 = accountChangeDetailService.selectById(accountChangeDetail.getId()); |
| | | // AppUser appUser1 = appUserService.selectById(accountChangeDetail1.getUserId()); |
| | | // Double b = accountChangeDetail1.getOldData() - accountChangeDetail1.getNewData(); |
| | | // appUser1.setAccountBalance(appUser1.getAccountBalance() + b); |
| | | // appUserService.updateById(appUser1); |
| | | // |
| | | // accountChangeDetailService.deleteById(accountChangeDetail.getId()); |
| | | // } |
| | | // } |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // }).start(); |
| | | // return weixinpay; |
| | | Driver driver = driverService.selectById(order1.getDriverId()); |
| | | AccountChangeDetail accountChangeDetail = new AccountChangeDetail(); |
| | | accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3)); |
| | | accountChangeDetail.setUserType(2); |
| | | accountChangeDetail.setUserId(order1.getDriverId()); |
| | | accountChangeDetail.setCreateTime(new Date()); |
| | | accountChangeDetail.setOldData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission()); |
| | | accountChangeDetail.setType(1); |
| | | accountChangeDetail.setChangeType(7); |
| | | accountChangeDetail.setOrderId(order1.getId()); |
| | | accountChangeDetail.setExplain("优惠券收入"); |
| | | driver.setCouponBalance(driver.getCouponBalance() + order1.getDiscountedPrice()); |
| | | accountChangeDetail.setNewData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission()); |
| | | driverService.updateById(driver); |
| | | accountChangeDetailService.insert(accountChangeDetail); |
| | | |
| | | pushUtil.pushOrderStatus(order1.getUserId(), 1, order1.getId(), order1.getState()); |
| | | if(null != order1.getDriverId()) { |
| | | PushOrderInfoWarpper pushOrderInfoWarpper = new PushOrderInfoWarpper(); |
| | | pushOrderInfoWarpper.setId(order1.getId()); |
| | | pushOrderInfoWarpper.setState(order1.getState()); |
| | | pushUtil.pushOrderInfo(order1.getDriverId(), 2, pushOrderInfoWarpper); |
| | | } |
| | | //处理佣金和收入记录 |
| | | saveCommission(order1); |
| | | return; |
| | | } |
| | | if ("USERPAYING".equals(s)) { |
| | | Thread.sleep(wait); |
| | | num++; |
| | | continue; |
| | | } |
| | | Thread.sleep(wait); |
| | | num++; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | return weixinpay; |
| | | } |
| | | // order.setPayTime(new Date()); |
| | | // this.updateById(order); |
| | | |
| | | |
| | | return ResultUtil.success(); |
| | | |
| | | } |
| | |
| | | pushOrderInfoWarpper.setState(order.getState()); |
| | | pushUtil.pushOrderInfo(order.getDriverId(), 2, pushOrderInfoWarpper); |
| | | } |
| | | |
| | | //支付成功---->异步分账----->10s钟后再进行确认收货 |
| | | //确认收货后才能进行提现(结算接口) |
| | | //异步分账 |
| | | List<Revenue> revenues = revenueService.selectList(new EntityWrapper<Revenue>().eq("orderId", order.getId())); |
| | | Complete complete = new Complete(); |
| | | complete.setOriginalMerOrderId(transaction_id); |
| | | complete.setNotifyUrl(callbackPath + "/base/order/ledgerCallback"); |
| | | List<PamentOrderUser> splitList = new ArrayList<>(); |
| | | for (Revenue revenue : revenues) { |
| | | if(revenue.getUserType() == 2){//司机 |
| | | Driver driver = driverService.selectById(revenue.getUserId()); |
| | | PamentOrderUser pamentOrderUser = new PamentOrderUser(); |
| | | pamentOrderUser.setSplitUserId(driver.getMerchantNumber()); |
| | | pamentOrderUser.setSplitAmount(revenue.getAmount().toString()); |
| | | pamentOrderUser.setSplitType("2"); |
| | | splitList.add(pamentOrderUser); |
| | | |
| | | DivisionRecord divisionRecord = new DivisionRecord(); |
| | | divisionRecord.setUserType(1); |
| | | divisionRecord.setUserId(revenue.getUserId()); |
| | | divisionRecord.setOrderId(order.getId()); |
| | | divisionRecord.setMerOrderId(transaction_id); |
| | | divisionRecord.setSourceType(1); |
| | | divisionRecord.setAmount(revenue.getAmount()); |
| | | divisionRecord.setMerchantNumber(driver.getMerchantNumber()); |
| | | divisionRecord.setState(1); |
| | | divisionRecord.setCreateTime(new Date()); |
| | | divisionRecordService.insert(divisionRecord); |
| | | } |
| | | if(revenue.getUserType() == 3){//代理商 |
| | | Agent agent = agentService.selectById(revenue.getUserId()); |
| | | PamentOrderUser pamentOrderUser = new PamentOrderUser(); |
| | | pamentOrderUser.setSplitUserId(agent.getMerchantNumber()); |
| | | pamentOrderUser.setSplitAmount(revenue.getAmount().toString()); |
| | | pamentOrderUser.setSplitType("2"); |
| | | splitList.add(pamentOrderUser); |
| | | |
| | | DivisionRecord divisionRecord = new DivisionRecord(); |
| | | divisionRecord.setUserType(2); |
| | | divisionRecord.setUserId(revenue.getUserId()); |
| | | divisionRecord.setOrderId(order.getId()); |
| | | divisionRecord.setMerOrderId(transaction_id); |
| | | divisionRecord.setSourceType(1); |
| | | divisionRecord.setAmount(revenue.getAmount()); |
| | | divisionRecord.setMerchantNumber(agent.getMerchantNumber()); |
| | | divisionRecord.setState(1); |
| | | divisionRecord.setCreateTime(new Date()); |
| | | divisionRecordService.insert(divisionRecord); |
| | | } |
| | | |
| | | } |
| | | complete.setSplitList(splitList); |
| | | TrhRequest<Complete> request = new TrhRequest(); |
| | | InterfaceResponse execute = request.execute(complete, Complete.SERVICE_CODE); |
| | | if(!"0000".equals(execute.getResult())){ |
| | | return ResultUtil.error(execute.getMsg()); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | String status = jsonObject.getString("status"); |
| | | if("2".equals(status)){ |
| | | return ResultUtil.error("失败"); |
| | | } |
| | | if("0".equals(status)){ |
| | | return ResultUtil.error("处理中"); |
| | | } |
| | | |
| | | //使用优惠券的情况,通过转账接口将优惠券的收入转到司机电子账簿 |
| | | if(null != order.getCouponId()){ |
| | | List<PlatformRechargeRecord> platformRechargeRecords = platformRechargeRecordService.selectList(new EntityWrapper<PlatformRechargeRecord>().eq("state", 2).last(" and balance > 0 order by payTime")); |
| | | Double discountedPrice = order.getDiscountedPrice(); |
| | | Driver driver = driverService.selectById(order.getDriverId()); |
| | | |
| | | UserToCoupon userToCoupon = userToCouponService.selectById(order.getCouponId()); |
| | | Coupon coupon = couponService.selectById(userToCoupon.getCouponId()); |
| | | AccountChangeDetail accountChangeDetail = new AccountChangeDetail(); |
| | | accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3)); |
| | | accountChangeDetail.setUserType(2); |
| | | accountChangeDetail.setUserId(order.getDriverId()); |
| | | accountChangeDetail.setCreateTime(new Date()); |
| | | accountChangeDetail.setOldData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission()); |
| | | accountChangeDetail.setType(1); |
| | | accountChangeDetail.setChangeType(7); |
| | | accountChangeDetail.setOrderId(order.getId()); |
| | | accountChangeDetail.setExplain("优惠券收入"); |
| | | driver.setCouponBalance(driver.getCouponBalance() + coupon.getCouponPreferentialAmount()); |
| | | accountChangeDetail.setNewData(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission()); |
| | | driverService.updateById(driver); |
| | | accountChangeDetailService.insert(accountChangeDetail); |
| | | |
| | | |
| | | for (PlatformRechargeRecord platformRechargeRecord : platformRechargeRecords) { |
| | | if(discountedPrice == 0){ |
| | | break; |
| | | } |
| | | |
| | | if(platformRechargeRecord.getBalance().compareTo(discountedPrice) >= 0){ |
| | | discountedPrice = 0D; |
| | | platformRechargeRecord.setBalance(platformRechargeRecord.getBalance() - discountedPrice); |
| | | platformRechargeRecordService.updateById(platformRechargeRecord); |
| | | }else{ |
| | | |
| | | } |
| | | |
| | | Transfer transfer = new Transfer(); |
| | | transfer.setDepositMerOrderId("6831518911582834611"); |
| | | transfer.setToUserId(driver.getMerchantNumber()); |
| | | transfer.setAmount(discountedPrice.toString()); |
| | | transfer.setOrderName(""); |
| | | transfer.setNotifyUrl(""); |
| | | transfer.setParameter1(order.getId().toString()); |
| | | |
| | | TrhRequest<Transfer> request1 = new TrhRequest(); |
| | | InterfaceResponse execute1 = request1.execute(transfer, Transfer.SERVICE_CODE); |
| | | if(!"0000".equals(execute1.getResult())){ |
| | | return ResultUtil.error(execute1.getMsg()); |
| | | } |
| | | JSONObject jsonObject1 = JSON.parseObject(execute1.getResult()); |
| | | String status1 = jsonObject1.getString("status"); |
| | | if("2".equals(status1)){ |
| | | return ResultUtil.error("失败"); |
| | | } |
| | | if("0".equals(status1)){ |
| | | return ResultUtil.error("处理中"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | package com.agentdriving.user.modular.system.service.impl; |
| | | |
| | | import com.agentdriving.user.core.util.ToolUtil; |
| | | import com.agentdriving.user.modular.system.dao.SystemConfigMapper; |
| | | import com.agentdriving.user.modular.system.model.SystemConfig; |
| | | import com.agentdriving.user.modular.system.service.ISystemConfigService; |
| | |
| | | SystemConfig systemConfig = this.selectOne(new EntityWrapper<SystemConfig>().eq("type", 5)); |
| | | PriceRulesWarpper priceRulesWarpper = new PriceRulesWarpper(); |
| | | if(null != systemConfig){ |
| | | //{"ChargeStandard":[{"num1":"06:00","num2":"08:00","num3":2,"num4":2,"num5":2,"num6":2,"num7":2,"num8":2,"num9":2,"num10":2,"num11":2},{"num1":"06:00","num2":"08:00","num3":1,"num4":1,"num5":1,"num6":1,"num7":2,"num8":2,"num9":2,"num10":2,"num11":2},{"num1":"00:00","num2":"10:00","num3":3,"num4":3,"num5":3,"num6":3,"num7":3,"num8":3,"num9":3,"num10":3,"num11":3}],"ExtraCost":{"num1":1,"num2":1,"num3":1,"num4":1,"num5":1,"num6":1,"num7":1,"num8":1,"num9":1}} |
| | | JSONObject jsonObject = JSON.parseObject(systemConfig.getContent()); |
| | | JSONArray chargeStandard = jsonObject.getJSONArray("ChargeStandard"); |
| | | List<Map<String, Object>> basePrice = new ArrayList<>(); |
| | |
| | | JSONObject jsonObject1 = chargeStandard.getJSONObject(i); |
| | | String num1 = jsonObject1.getString("num1"); |
| | | String num2 = jsonObject1.getString("num2"); |
| | | Double num3 = jsonObject1.getDouble("num3"); |
| | | JSONArray num3 = jsonObject1.getJSONArray("num3"); |
| | | Double num4 = jsonObject1.getDouble("num4"); |
| | | Double num5 = jsonObject1.getDouble("num5"); |
| | | Double num6 = jsonObject1.getDouble("num6"); |
| | | Double num7 = jsonObject1.getDouble("num7"); |
| | | Double num8 = jsonObject1.getDouble("num8"); |
| | | Double num9 = jsonObject1.getDouble("num9"); |
| | | Double num10 = jsonObject1.getDouble("num10"); |
| | | Double num11 = jsonObject1.getDouble("num11"); |
| | | |
| | | |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | map1.put("time", num1 + "-" + num2); |
| | | map1.put("startingMileage", num3 + "公里(包含" + num3 + "公里)"); |
| | | map1.put("startingPrice", num4 + "元"); |
| | | map1.put("exceedStartingPrice", num6 + "元/" + num5 + "公里"); |
| | | map1.put("time", ToolUtil.isEmpty(num1) ? "其他时段" : num1 + "-" + num2); |
| | | List<Map<String, String>> list = new ArrayList<>(); |
| | | for (int j = 0; j < num3.size(); j++) { |
| | | Map<String, String> map = new HashMap<>(); |
| | | JSONObject jsonObject2 = num3.getJSONObject(j); |
| | | Double num1_1 = jsonObject2.getDouble("num1"); |
| | | Double num2_1 = jsonObject2.getDouble("num2"); |
| | | Double num3_1 = jsonObject2.getDouble("num3"); |
| | | map.put("startingMileage", num1_1 + "-" + num2_1 + "公里(含" + num2_1 + "公里)"); |
| | | map.put("startingPrice", num3_1 + "元"); |
| | | list.add(map); |
| | | } |
| | | map1.put("data", list); |
| | | basePrice.add(map1); |
| | | |
| | | Map<String, Object> map2 = new HashMap<>(); |
| | | map2.put("time", num1 + "-" + num2); |
| | | map2.put("startingMileage", num7 + "-" + num8 + "公里"); |
| | | map2.put("startingPrice", num9 + "元"); |
| | | map2.put("exceedStartingPrice", num11 + "元/" + num10 + "公里"); |
| | | map2.put("time", ToolUtil.isEmpty(num1) ? "其他时段" : num1 + "-" + num2); |
| | | map2.put("startingMileage", num4 + "-" + num5 + "公里"); |
| | | map2.put("startingPrice", num6 + "元"); |
| | | map2.put("exceedStartingPrice", num7 + "元/" + num8 + "公里"); |
| | | longDistanceCharges.add(map2); |
| | | } |
| | | priceRulesWarpper.setBasePrice(JSON.toJSONString(basePrice)); |
| | |
| | | /** |
| | | * 高德key |
| | | */ |
| | | String key = "e0370a9a4d10739045fb0b8f4742a67e"; |
| | | String key = "588845b621c3c42d6d6c8f50ba00cb41"; |
| | | } |
| | |
| | | */ |
| | | public class OBSUtil { |
| | | |
| | | public static String endPoint = "https://obs.cn-south-1.myhuaweicloud.com"; |
| | | public static String ak = "N52IGR6DHOC3JAZFHZIW"; |
| | | public static String sk = "jq7Q7jnFS4Gxamwh3naN2sbNKwQQ7cZISPVumGBS"; |
| | | public static String bucketname = "csxdj"; |
| | | public static String endPoint = "https://obs.cn-southwest-2.myhuaweicloud.com"; |
| | | public static String ak = "YMBKC9LS6CDG9QHCIGUU"; |
| | | public static String sk = "kztanexutGzoGiYcIALCNhazfxoU6yecDOSBrFXu"; |
| | | public static String bucketname = "fanghuadaijia"; |
| | | |
| | | /** |
| | | * 上传文件 |
| | |
| | | // 待上传的本地文件路径,需要指定到具体的文件名 |
| | | PutObjectRequest request = new PutObjectRequest(); |
| | | request.setBucketName(bucketname); |
| | | request.setObjectKey(objectKey); |
| | | request.setObjectKey("img/" + objectKey); |
| | | request.setInput(inputStream); |
| | | PutObjectResult putObjectResult = obsClient.putObject(request); |
| | | return putObjectResult.getObjectUrl(); |
| | |
| | | |
| | | private final static String bad_weather = "[{\"wid\":\"03\",\"weather\":\"阵雨\"},{\"wid\":\"04\",\"weather\":\"雷阵雨\"},{\"wid\":\"05\",\"weather\":\"雷阵雨伴有冰雹\"},{\"wid\":\"06\",\"weather\":\"雨夹雪\"},{\"wid\":\"07\",\"weather\":\"小雨\"},{\"wid\":\"08\",\"weather\":\"中雨\"},{\"wid\":\"09\",\"weather\":\"大雨\"},{\"wid\":\"10\",\"weather\":\"暴雨\"},{\"wid\":\"11\",\"weather\":\"大暴雨\"},{\"wid\":\"12\",\"weather\":\"特大暴雨\"},{\"wid\":\"13\",\"weather\":\"阵雪\"},{\"wid\":\"14\",\"weather\":\"小雪\"},{\"wid\":\"15\",\"weather\":\"中雪\"},{\"wid\":\"16\",\"weather\":\"大雪\"},{\"wid\":\"17\",\"weather\":\"暴雪\"},{\"wid\":\"19\",\"weather\":\"冻雨\"},{\"wid\":\"20\",\"weather\":\"沙尘暴\"},{\"wid\":\"21\",\"weather\":\"小到中雨\"},{\"wid\":\"22\",\"weather\":\"中到大雨\"},{\"wid\":\"23\",\"weather\":\"大到暴雨\"},{\"wid\":\"24\",\"weather\":\"暴雨到大暴雨\"},{\"wid\":\"25\",\"weather\":\"大暴雨到特大暴雨\"},{\"wid\":\"26\",\"weather\":\"小到中雪\"},{\"wid\":\"27\",\"weather\":\"中到大雪\"},{\"wid\":\"28\",\"weather\":\"大到暴雪\"},{\"wid\":\"30\",\"weather\":\"扬沙\"},{\"wid\":\"31\",\"weather\":\"强沙尘暴\"},{\"wid\":\"53\",\"weather\":\"霾\"}]"; |
| | | |
| | | private final static String key = "aaebb3e5c18fd371257a2ab6b5670efe"; |
| | | private final static String key = "edc965edb129580401ed211eaa4ae8ab"; |
| | | |
| | | private static HttpClientUtil httpClientUtil = new HttpClientUtil(); |
| | | |
| | |
| | | application: |
| | | name: user-server |
| | | profiles: |
| | | active: dev |
| | | # active: produce |
| | | # active: dev |
| | | active: produce |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/fh_agent_driving?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | # password: PI_v6J5@dvHwGTqc |
| | | password: 123456 |
| | | password: PI_v6J5@dvHwGTqc |
| | | # password: 123456 |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | |
| | | grantType: authorization_code #填authorization_code |
| | | appid: 11 #应用唯一标识,在微信开放平台提交应用审核通过后获得 |
| | | appSecret: 11 #应用密钥AppSecret,在微信开放平台提交应用审核通过后获得 |
| | | appletsAppid: wx8ae6c610563f2fe6 #小程序APPid |
| | | appletsAppSecret: 8b2c93b0be4f017350050f1e660680fe # |
| | | appletsAppid: wxb7d7de754460c422 #小程序APPid |
| | | appletsAppSecret: 3aa63e3e8dc2e958f7e30bbed0865738 # |
| | | officialAccountAppid: 11111 |
| | | officialAccountAppSecret: 1111 |
| | | webAppId: 111 |
| | | webAppSecret: 11 |
| | | mchId: 1636941942 #微信支付分配的商户号 |
| | | key: Eri2GR2SB3b6iIhaoD7k3KQ8X0wf1Ybh #key为商户平台设置的密钥key: |
| | | apiv3: AKJ51Z4nhSqYBxmOXgUyCKA1vLP0J5Aj #key为商户平台设置的密钥key: |
| | | mchId: 1644659263 #微信支付分配的商户号 |
| | | key: KY7XYaJwnZPV4O5CvJ6CreywiUxxnUGM #key为商户平台设置的密钥key: |
| | | apiv3: mAhbxa2ez1GUNWIArATff4b630AH99yg #key为商户平台设置的密钥key: |
| | | |
| | | --- |
| | | |
| | | alipay: |
| | | appid: 2021001161600393 #应用程序唯一标识 |
| | | appPrivateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCEbTcG2wz+kaYDo2YxflpHE59MvKc3rbl6RlBgO6i5GzgphzeRTv5kRWUpSVkKCsbxFvAYLcgFPmm5nY2fz5hCTKiRcYfpUjH/OougUbzYU3ilUc9JqMbmvy7KN+Kv7+kQYCGLvMqlyYPiJ7LrmJLpE/FUcNLDwo6xUmwJSxaF7M4TbD3ZQZdddki1iJp9GihlqehZCMWOBeotEXvPKDEzSEkYlnvHPQaaspVgeesGmlHDuOiZUokENutxpjo7klWe97NA49hXEtI+xlczNGJKdBr0keBX/kSMsnx8kMxYDjh4QTySBaR6zlO4RYPFekWv9QZ2CrfiKCS7AHUpZYZ5AgMBAAECggEAXjCoUPIBHhhOcowIJe/vGlr0lUohzdJ8+GGGzcvhSDf6DF+mwG3lN0C8oU8QS7o6okRkZW46tLAd1u4fS6oGbDHGPBz6RJQ4B4eGxHMe1OcaCsxTmdq4DmuxRhfV3rnPldwqQA/6O01HxtXhxvzwkWOj5SGSZ7a8c5diTIHh9ULd6neUI/rIFC97mH1TeW0uDIxAtyvswz0pIfDhAR+lsOyTg/8qzsIXjpBFG4gAVxhUeUqQA5HzbsFglC08V7ViDk1OEoWi3yIj1CmNdtntJI4cxqLgTK7MNB9udhbN2I9YasuIpZvlAcvPi5R9cYT8vvFBCFGM+i22wtcsQmxdAQKBgQDaD9y6WNmsp+IaAUG3FqbJC8SqwreGIiEflWwVjrd+LuN6yhyr45CobOmhbTz0de8gRJEZKgJZEJcywL1ScrPIC4n1JaG688lk5aR+0Lik5fy1+L6G/CydJoJqlh6KKdwPJmDGpVu/geLJcLkWcYOwL56IL7GK2JI1p607R0x6iQKBgQCbd0n4xG9GkpvW4LDAJiMEhwPu9QcCKIT0mXVXCgMFdWel9bY3+8RSZoziWutaofm9tRHFAqwjbRyOZ+EdckkNsWVkkTnkKGtAhYKgM0GaOwdMFxmvME5WYJ74a5t1jiezDmR3obUBtS2nyQ8CFPUnlimoTR9F6APrth3h8uvwcQKBgFWaCn1AqdrEYNbyjViRVNHxg7fBDohiV3xtjOt9hfzL7VLjipPTlpL3hlNvbZFNxpx1LjyhqCBMif5LeUanbnnmRbbtmeqpDvNDzupVh1Z8TlMlHa4hymW6m1G6MqzsN83es/jnKvgnxd5sGMx9rUN5vhMaHekykVrswu1VVOl5AoGAMDljh7gfMEv/7TqLeT8bM6dR8AivoNrCy0Di5hnj8AiIGzHJ0TnWnxzSbNB5GwcNeew109/NV7vb1MyiRskRoh657eUiiQSEqGIBsAHWQqo2zEKKJA6e7ipQhYyTj3aGGAPJ5FYT2LDDtb0nW6T2ms34pA0wOzYKKU63nEQHLfECgYEAgbbpZJRtPxWB1M/Dg7loguT5O/VUsKefS0JrSD+tJIqYkumH5mejvYW5YEeDdelkvBhAEFUW9JOkzL+1w1g3wz2QQ2aPV/r55cJE3EfOzbwgw6GsO+8UuyiavbFhS3pFZNI0pR5M3u1+SIcLqQCnYLbO11vnEXglB6wjw9/oxPE= #开发者应用私钥 |
| | | alipayPublicKey: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhG03BtsM/pGmA6NmMX5aRxOfTLynN625ekZQYDuouRs4KYc3kU7+ZEVlKUlZCgrG8RbwGC3IBT5puZ2Nn8+YQkyokXGH6VIx/zqLoFG82FN4pVHPSajG5r8uyjfir+/pEGAhi7zKpcmD4iey65iS6RPxVHDSw8KOsVJsCUsWhezOE2w92UGXXXZItYiafRooZanoWQjFjgXqLRF7zygxM0hJGJZ7xz0GmrKVYHnrBppRw7jomVKJBDbrcaY6O5JVnvezQOPYVxLSPsZXMzRiSnQa9JHgV/5EjLJ8fJDMWA44eEE8kgWkes5TuEWDxXpFr/UGdgq34igkuwB1KWWGeQIDAQAB #应用公钥 |
| | | alipay_public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzmDrvcNvhexu3KkxVS9bemdSn6pyQUFmpyOGMDOirGR+RbmldpH2N9bPegzZynb5+bmRHii4ib31XeoXc7M7r6UsPhmPeLoSBNwpC+Uig0VxPa0hmvHjAl6StArhB3eMib6Zo40nM6eCYZLLZ1kKpI5Ad/APov9uLrbSnoeZsgeRibQix07arvTEsZq6pJavNlA+UBjp65o6Bv0+kfQ65pMTpbu+jRtTzkTj1hoW9PjwlWrY21F1FvN67zDWkTB2LjGFsqan0Qoe4/X8nK3VsDvkjIm/ZQsnQr8ZzfcuTzQPrcZpo3h9DPZoHeiToEfXtyk7E0bQHEmYVpmrvk/IJwIDAQAB #支付宝公钥 |
| | | appid: 1111 #应用程序唯一标识 |
| | | appPrivateKey: 1111 #开发者应用私钥 |
| | | alipayPublicKey: 1111 #应用公钥 |
| | | alipay_public_key: 1111 #支付宝公钥 |
| | | |
| | | --- |
| | | |
| | | juhe: #聚合数据 |
| | | appKey: 0d3fd83eddaa33e5563f548257648577 # |
| | | |
| | | |
| | | --- |
| | | |
| | | jiguang: |
| | | appKey-driver: 93204c35ded9ba377a14af19 #极光推送应用唯一标识 |
| | | masterSecret-driver: e4f6f435faefad29db6ba9b2 #用于服务器端 API 调用时与 AppKey 配合使用达到鉴权的目的 |
| | | appKey-dispatch: cc212ee6dcecb26625917f40 #极光推送应用唯一标识 |
| | | masterSecret-dispatch: 0d163a25a20647665c28639e #用于服务器端 API 调用时与 AppKey 配合使用达到鉴权的目的 |
| | | |
| | | |
| | | --- |
| | |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | # uri: mongodb://root:bv@_N36o+cTe1LpS@127.0.0.1:27017/admin |
| | | uri: mongodb://127.0.0.1:27017/admin |
| | | |
| | | |
| | | # mallbook 调起接口参数配置 |
| | | mallbook: |
| | | # pay_url:mallbook接口地址 测试环境: http://ld.mallbook.cn:12000/api 生产环境:https://cloudpay.mallbook.cn/api |
| | | pay_url: http://ld.mallbook.cn:12000/api |
| | | # merchant_no 业务系统商户平台编号,需替换为mallbook工作人员提供的商户编号 |
| | | merchant_no: 需要替换内容 |
| | | # version 接口版本号 |
| | | version: 1.0.0 |
| | | # channel_type 渠道类型 HF:汇付 |
| | | channel_type: HF |
| | | # merchant_private_key 商户平台私钥,需要替换成商户平台自己生成的私钥 |
| | | merchant_private_key: MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAIoGARvX6k6rVwuUW6HjAPkzXVntCtDI8q/niGZbeILc5T/noer+UNDECSy9f8T6ENw7tEKWaHOFcicrqgRv+wXeo2hPiJI2iYsUNs6I8ckd8i4uy/PBEDMW78GlnQLAatk0NC44HKjn8cuIHaETKNG2Vk3rwGBzNgDZ/God1L6JAgMBAAECgYBhCsOwzehBk5pJ2+9pLO+8Rm72EQGvtflb0BBI1zst1x2gBr4DOPedMJe6yymQVrmP/rJItvONdV/DRqHtKMZ2Wa4ul/U1mDnAtS/FkpRYBA5FaXV2hNEW11xBLhL5iGk35P23Bzaa0MJw9Vsd0vjeykridIw/PweDyTdeRBwC2QJBANS+iOaKRuf6BRwCKDmBSHOiZmc/kKnpx2f5BD3h+LWEX3JsNxObMbW1SxQIf2/qwqzIoEm/WbWaOyuwtRZkXQ8CQQCmFjTm5l+Ws2LoQgM+5+eLmPyMyRFOu4G8yqsUkhKuANHK/qrsS1GTbv6SN341NijjNYl05e0h6Jq1T9UZmtrnAkEAwTfzmn7H+3RmI5QJ+IBkzzEWFHv05X0/8DyID7QmcKWzEncaZqIzObdYYu983qa2/LqSaahyz68uQnYRYi7xHQJATr3SgPIRuaH8r360iTtrRHzYp2qgYQJ25On1KECEyKgszp/kqzieSVbjLLFQjavKwMXeEGT+AwiDaJibwJLxWwJAXZApORsqGqdxc9FTxt5iiqG2ZP5DTXxc6E+ihmlmoVl9KncgTf9ez0Q0Qz/4KUTPTHNVgzt1nyBxiLtnyzFavA== |
| | | # mall_book_public_key mallbook测试环境公钥 不需要替换 |
| | | mall_book_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD0L2DaHOO8ekhktB6RoHxIcki/0v7OUeOn9tX9VBE+jv6PRjqlZRWL3Qezxz5ADtHEyLv+RFFaceXSep6rWyoQ6DRlvLv5CySUAxAM42LLVe4DI3l/0ccEAIuU5NCpwAAj1zkm2X01DwUCZwymLjlqbDlBvQhpq+1fddtTtA/QLQIDAQAB |
| | | # mall_book_public_key mallbook生产环境公钥 不需要替换 |
| | | # mall_book_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq6OLZKgUHH5wOk9xSBgN7yC17r3PQwMlY9/IorqrOlaIqrU0eAVZ5+dWrJD/3bdu7Ctq8n8trTm/IUYs7wtMg5SKwyX4/N+KQc2N7LL4yCq4vNl41q9sYgrtA0QnZoucIZcq1mwyu7RTDC8Wp7LGddnlkJsmL8masgMxA6cc9NwIDAQAB |
| | | |
| | | uri: mongodb://root:PaWPtGG95APCMBEb@127.0.0.1:27017/admin |
| | | # uri: mongodb://127.0.0.1:27017/admin |
| | |
| | | # RedisÊý¾Ý¿âË÷Òý£¨Ä¬ÈÏΪ0£© |
| | | spring.redis.database=0 |
| | | |
| | | ## Redis·þÎñÆ÷µØÖ· |
| | | #spring.redis.host=127.0.0.1 |
| | | ## Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | #spring.redis.port=16379 |
| | | ## Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | #spring.redis.password=wuOT@8NLdZ*V09Jt |
| | | |
| | | # Redis·þÎñÆ÷µØÖ· |
| | | spring.redis.host=127.0.0.1 |
| | | # Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | spring.redis.port=6379 |
| | | spring.redis.port=16379 |
| | | # Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | spring.redis.password=123456 |
| | | spring.redis.password=wuOT@8NLdZ*V09Jt |
| | | |
| | | ## Redis·þÎñÆ÷µØÖ· |
| | | #spring.redis.host=127.0.0.1 |
| | | ## Redis·þÎñÆ÷Á¬½Ó¶Ë¿Ú |
| | | #spring.redis.port=6379 |
| | | ## Redis·þÎñÆ÷Á¬½ÓÃÜÂ루ĬÈÏΪ¿Õ£© |
| | | #spring.redis.password=123456 |
| | | |
| | | # Á¬½Ó³Ø×î´óÁ¬½ÓÊý£¨Ê¹ÓøºÖµ±íʾûÓÐÏÞÖÆ£© |
| | | spring.redis.jedis.pool.max-active=1024 |