| | |
| | | <name>guns-admin</name> |
| | | <description>guns 的spring boot版本</description> |
| | | |
| | | <packaging>jar</packaging> |
| | | <packaging>war</packaging> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | |
| | | <optional>true</optional> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-tomcat</artifactId> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>javax.servlet</groupId> |
| | | <artifactId>javax.servlet-api</artifactId> |
| | | <version>3.1.0</version> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | <!--<dependency>--> |
| | | <!--<groupId>org.springframework.boot</groupId>--> |
| | | <!--<artifactId>spring-boot-starter-tomcat</artifactId>--> |
| | | <!--<scope>provided</scope>--> |
| | | <!--</dependency>--> |
| | | <!--<dependency>--> |
| | | <!--<groupId>javax.servlet</groupId>--> |
| | | <!--<artifactId>javax.servlet-api</artifactId>--> |
| | | <!--<version>3.1.0</version>--> |
| | | <!--<scope>provided</scope>--> |
| | | <!--</dependency>--> |
| | | |
| | | <!--shiro依赖--> |
| | | <dependency> |
| | |
| | | <artifactId>geodesy</artifactId> |
| | | <version>1.1.3</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.jsoup</groupId> |
| | | <artifactId>jsoup</artifactId> |
| | | <version>1.13.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.cellulant</groupId> |
| | | <artifactId>CheckoutEncryption</artifactId> |
| | | <version>0.0.1</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | @ApiImplicitParam(value = "车辆颜色", name = "color", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "车牌号", name = "licensePlate", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "年审日期(需要格式化)", name = "time", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "行驶证号", name = "drivingLicenseNumber", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "行驶证照片", name = "drivingLicensePhoto", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "行驶证到期时间(yyyy-MM-dd)", name = "drivingLicenseEndTime", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "车辆照片", name = "carPhoto", required = true, dataType = "string"), |
| | |
| | | @ApiImplicitParam(value = "人车合影照片", name = "peopleAndCarsPhone", required = false, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = false, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil addCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicensePhoto, |
| | | public ResultUtil addCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicenseNumber, String drivingLicensePhoto, |
| | | String drivingLicenseEndTime, String carPhoto, String insurancePhoto, String commercialInsuranceTime, |
| | | String peopleAndCarsPhone, HttpServletRequest request,Integer id){ |
| | | try { |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return carService.addCar(modelId, color, licensePlate, time, drivingLicensePhoto, drivingLicenseEndTime, carPhoto, insurancePhoto |
| | | return carService.addCar(modelId, color, licensePlate, time, drivingLicenseNumber, drivingLicensePhoto, drivingLicenseEndTime, carPhoto, insurancePhoto |
| | | , commercialInsuranceTime, uid,id, peopleAndCarsPhone); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | @Value("${share.url}") |
| | | private String shareUrl; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "场景类型(1=身份验证,2=登录确认,3=用户注册,4=修改密码)", name = "type", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil queryCaptcha(String phone, Integer type){ |
| | | public ResultUtil queryCaptcha(String phone, Integer type, Integer language){ |
| | | if(ToolUtil.isNotEmpty(phone)){ |
| | | try { |
| | | return driverService.queryCaptcha(phone, type); |
| | | return driverService.queryCaptcha(phone, type, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "邮箱地址", name = "email", required = true, dataType = "String"), |
| | | }) |
| | | public ResultUtil queryEmailCaptcha(String email){ |
| | | public ResultUtil queryEmailCaptcha(String email, Integer language){ |
| | | if(ToolUtil.isNotEmpty(email)){ |
| | | try { |
| | | return driverService.queryEmailCaptcha(email); |
| | | return driverService.queryEmailCaptcha(email, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | public ResultUtil checkCaptcha(String email, String code){ |
| | | try { |
| | | boolean b = driverService.checkCaptcha(email, code); |
| | | // if(b){ |
| | | // Driver driver = driverService.queryByPhone(email); |
| | | // smsrecordService.saveData(null == driver ? 5 : 8, email, code, "验证码【" + code + "】已发到您的邮箱,验证码将在5分钟后失效!"); |
| | | // } |
| | | return b ? ResultUtil.success() : ResultUtil.error("验证码无效"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParam(value = "用户类型(1=用户,2=司机)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "注册类型(1=司机注册,2=用户注册)", name = "userType", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil registeredDriver(String phone, String code, String password, Integer uid, Integer type, Integer userType){ |
| | | public ResultUtil registeredDriver(String phone, String code, String password, Integer uid, Integer type, Integer userType, Integer language){ |
| | | try { |
| | | return driverService.registeredDriver(phone, code, password, uid, type, userType); |
| | | return driverService.registeredDriver(phone, code, password, uid, type, userType, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "用户类型(1=用户,2=司机)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "注册类型(1=司机注册,2=用户注册)", name = "userType", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil<LoginWarpper> registeredDriver_(String phone, String code, String password, Integer uid, Integer type, Integer userType){ |
| | | public ResultUtil<LoginWarpper> registeredDriver_(String phone, String code, String password, Integer uid, Integer type, Integer userType, Integer language){ |
| | | try { |
| | | return driverService.registeredDriver(phone, code, password, uid, type, userType); |
| | | return driverService.registeredDriver(phone, code, password, uid, type, userType, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/queryNeedCertificate") |
| | | @ApiOperation(value = "注册完善个人信息根据选择的从业地判断是否需要网约车资格证", tags = {"司机端-注册"}, notes = "0=城市未开通,1=是,2=否") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "城市行政编号", name = "code", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil queryNeedCertificate(String code){ |
| | | try { |
| | | Integer integer = driverService.queryNeedCertificate(code); |
| | | return ResultUtil.success(integer == null ? 0 : integer); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "司机id", name = "uid", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil updateDriver(RegisteredWarpper registeredWarpper, Integer uid){ |
| | | public ResultUtil updateDriver(RegisteredWarpper registeredWarpper, Integer uid, Integer language){ |
| | | try { |
| | | return driverService.updateDriver(registeredWarpper, uid); |
| | | return driverService.updateDriver(registeredWarpper, uid, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "车辆颜色", name = "color", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "车牌号", name = "licensePlate", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "年审日期(需要格式化)", name = "time", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "行驶证号", name = "drivingLicenseNumber", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "行驶证照片", name = "drivingLicensePhoto", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "行驶证到期时间(yyyy-MM-dd)", name = "drivingLicenseEndTime", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "车辆照片", name = "carPhoto", required = true, dataType = "string"), |
| | |
| | | @ApiImplicitParam(value = "司机id", name = "uid", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "车辆id", name = "carId", required = false, dataType = "int") |
| | | }) |
| | | public ResultUtil addDriverCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicensePhoto, String drivingLicenseEndTime, |
| | | public ResultUtil addDriverCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicenseNumber, String drivingLicensePhoto, String drivingLicenseEndTime, |
| | | String carPhoto, String insurancePhoto, String commercialInsuranceTime, Integer uid, Integer carId, String peopleAndCarsPhone){ |
| | | try { |
| | | return carService.addCar(modelId, color, licensePlate, time, drivingLicensePhoto, drivingLicenseEndTime, carPhoto, insurancePhoto, commercialInsuranceTime, uid,carId, peopleAndCarsPhone); |
| | | return carService.addCar(modelId, color, licensePlate, time, drivingLicenseNumber, drivingLicensePhoto, drivingLicenseEndTime, carPhoto, insurancePhoto, commercialInsuranceTime, uid,carId, peopleAndCarsPhone); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "验证码", name = "code", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "新密码", name = "password", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil resetPassword(String phone, String code, String password){ |
| | | public ResultUtil resetPassword(String phone, String code, String password, Integer language){ |
| | | try { |
| | | return driverService.resetPassword(phone, code, password); |
| | | return driverService.resetPassword(phone, code, password, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | Map<String, Object> map = driverService.queryInfo(uid); |
| | | map.put("qrCodeIsOpen",driverService.getAppOpenInfo(1)==1); |
| | | DriverInfoWarpper driverInfoWarpper = DriverInfoWarpper.getDriverInfoWarpper(map); |
| | | Double money = driverService.getThisWeekMoney(uid); |
| | | driverInfoWarpper.setLaveBusinessMoney(driverInfoWarpper.getLaveBusinessMoney()-(money==null?0d:money)); |
| | | driverInfoWarpper.setLaveBusinessNextWeekMoney(money==null?0d:money); |
| | | // Double money = driverService.getThisWeekMoney(uid); |
| | | // driverInfoWarpper.setLaveBusinessMoney(driverInfoWarpper.getLaveBusinessMoney()-(money==null?0d:money)); |
| | | driverInfoWarpper.setLaveBusinessNextWeekMoney(0D); |
| | | return ResultUtil.success(driverInfoWarpper); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParam(value = "新密码", name = "password", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil updatePassword(String password, HttpServletRequest request){ |
| | | public ResultUtil updatePassword(String password, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | driverService.updatePassword(password, uid); |
| | | driverService.updatePassword(password, uid, language); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | baseWarpper.setAmount(Double.valueOf(String.valueOf(null != map.get("money") ? map.get("money") : 0))); |
| | | switch (Integer.valueOf(String.valueOf(null != map.get("orderType") ? map.get("orderType") : 0))){ |
| | | case 1: |
| | | baseWarpper.setName("快车"); |
| | | baseWarpper.setName("专车"); |
| | | break; |
| | | case 2: |
| | | baseWarpper.setName("出租车"); |
| | |
| | | baseWarpper.setName("城际出行"); |
| | | break; |
| | | case 4: |
| | | baseWarpper.setName("同城小件物流"); |
| | | baseWarpper.setName("市内小件物流"); |
| | | break; |
| | | case 5: |
| | | baseWarpper.setName("跨城小件物流"); |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/queryShareLink") |
| | | @ApiOperation(value = "获取分享链接及分案", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "链接上的type", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "链接上的uid", name = "driverId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "语言", name = "language", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<Map<String, Object>> queryShareLink(Integer type, Integer driverId, Integer language){ |
| | | try { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("link", shareUrl + "?type=" + type + "&uid=" + driverId + "&language=" + (null == language ? 2 : language)); |
| | | return ResultUtil.success(map); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | } |
| | |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil sendVerificationCode(Integer orderId){ |
| | | public ResultUtil sendVerificationCode(Integer orderId, Integer language){ |
| | | try { |
| | | orderLogisticsService.sendVerificationCode(orderId); |
| | | orderLogisticsService.sendVerificationCode(orderId, language); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/payOrder") |
| | | @ApiOperation(value = "司机订单代付(现金收款)", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付方式(1=线上,2=余额)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil payOrder(Integer orderId, Integer orderType, Integer payType, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return orderService.payOrder(uid, orderId, orderType, payType, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | } |
| | |
| | | private IOrderPositionService orderPositionService; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | |
| | | @Autowired |
| | | private IOrderCancelService orderCancelService; |
| | | |
| | | @Value("${filePath}") |
| | | private String filePath; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | |
| | | select |
| | | a.id as id, |
| | | a.state as orderState, |
| | | if(a.type = 4, '同城小件物流订单', '跨城小件物流订单') as orderName, |
| | | if(a.type = 4, '市内小件物流订单', '跨城小件物流订单') as orderName, |
| | | DATE_FORMAT(a.travelTime, '%m月%d日 %H:%i') as travelTime, |
| | | a.startAddress as startAddress, |
| | | a.endAddress as endAddress, |
| | |
| | | c.remark as cancelRemark, |
| | | c.money as cancelPayMoney, |
| | | if(c.userType = 1, '用户取消', '平台取消') as cancelUser, |
| | | (select isSpecialCar from t_sys_reformist where companyId = a.companyId) as reassign |
| | | (select isSpecialCar from t_sys_reformist where companyId = a.companyId) as reassign, |
| | | a.driverPay |
| | | from t_order_logistics a |
| | | left join t_user b on (a.userId = b.id) |
| | | left join t_order_cancel c on (a.id = c.orderId and c.orderType = a.type and c.state = 2) |
| | |
| | | select |
| | | id as id, |
| | | type as type, |
| | | if(type = 4, '同城小件物流订单', '跨城小件物流订单') as `name`, |
| | | if(type = 4, '市内小件物流订单', '跨城小件物流订单') as `name`, |
| | | DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as `time`, |
| | | startAddress as startAddress, |
| | | endAddress as endAddress, |
| | |
| | | select |
| | | id as id, |
| | | type as type, |
| | | if(type = 4, '同城小件物流订单', '跨城小件物流订单') as `name`, |
| | | if(type = 4, '市内小件物流订单', '跨城小件物流订单') as `name`, |
| | | DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time, |
| | | startAddress as startAddress, |
| | | endAddress as endAddress, |
| | |
| | | orderMoney as orderMoney, |
| | | payManner as payManner, |
| | | UNIX_TIMESTAMP(travelTime) as travelTime, |
| | | remark as remark |
| | | remark as remark, |
| | | driverPay |
| | | from t_order_logistics where driverId = #{uid} |
| | | <if test="state == 1"> |
| | | and state not in (1, 7) |
| | |
| | | * @param orderId |
| | | * @throws Exception |
| | | */ |
| | | void sendVerificationCode(Integer orderId) throws Exception; |
| | | void sendVerificationCode(Integer orderId, Integer language) throws Exception; |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsSpreadService; |
| | | import com.stylefeng.guns.modular.system.dao.RegionMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserInfoMapper; |
| | | import com.stylefeng.guns.modular.system.model.Company; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.Region; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.ICompanyService; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IIncomeService; |
| | | import com.stylefeng.guns.modular.system.service.ISystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import org.jsoup.Jsoup; |
| | | import org.jsoup.nodes.Document; |
| | | import org.jsoup.nodes.Element; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.math.BigDecimal; |
| | | import java.math.MathContext; |
| | | import java.math.RoundingMode; |
| | |
| | | |
| | | @Autowired |
| | | private ALiSendSms aLiSendSms; |
| | | |
| | | @Resource |
| | | private UserInfoMapper userInfoMapper; |
| | | |
| | | @Value("${spring.mail.template-path}") |
| | | private String templatePath; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void sendVerificationCode(Integer orderId) throws Exception { |
| | | public void sendVerificationCode(Integer orderId, Integer language) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | String random = ""; |
| | | for(int i = 0; i < 6; i++){ |
| | | random += Double.valueOf(Math.random() * 10).intValue(); |
| | | } |
| | | orderLogistics.setPickUpCode("123456"); |
| | | orderLogistics.setPickUpCode(random); |
| | | this.updateById(orderLogistics); |
| | | //发送短信 |
| | | //aLiSendSms.sendSms(orderLogistics.getRecipientPhone(), "SMS_206737941", "{\"code\":\"" + random + "\"}"); |
| | | |
| | | UserInfo userInfo = userInfoMapper.selectById(orderLogistics.getUserId()); |
| | | if(ToolUtil.isNotEmpty(userInfo.getEmail())){ |
| | | String path = templatePath + "index.html"; |
| | | Document document = Jsoup.parse(new File(path), "UTF-8"); |
| | | if(1 == language){ |
| | | document.getElementById("english").attr("style", "display: none;"); |
| | | document.getElementById("french").attr("style", "display: none;"); |
| | | document.getElementById("invite").attr("style", "display: none;"); |
| | | document.getElementById("user").attr("style", "display: none;"); |
| | | document.getElementById("settle").attr("style", "display: none;"); |
| | | document.getElementById("pass").attr("style", "display: none;"); |
| | | document.getElementById("bill").attr("style", "display: none;"); |
| | | document.getElementById("reward").attr("style", "display: none;"); |
| | | document.getElementById("rewardToday").attr("style", "display: none;"); |
| | | document.getElementById("driverAudit").attr("style", "display: none;"); |
| | | document.getElementById("carAudit").attr("style", "display: none;"); |
| | | |
| | | Element email_user = document.getElementById("email_user"); |
| | | email_user.text("您好 ,"); |
| | | Element email_content = document.getElementById("email_content"); |
| | | email_content.text("邮件取件码是:" + random + ",请在5分钟内完成验证"); |
| | | } |
| | | if(2 == language){ |
| | | document.getElementById("chinese").attr("style", "display: none;"); |
| | | document.getElementById("french").attr("style", "display: none;"); |
| | | document.getElementById("invite1").attr("style", "display: none;"); |
| | | document.getElementById("user1").attr("style", "display: none;"); |
| | | document.getElementById("settle1").attr("style", "display: none;"); |
| | | document.getElementById("pass1").attr("style", "display: none;"); |
| | | document.getElementById("bill1").attr("style", "display: none;"); |
| | | document.getElementById("reward1").attr("style", "display: none;"); |
| | | document.getElementById("rewardToday1").attr("style", "display: none;"); |
| | | document.getElementById("driverAudit1").attr("style", "display: none;"); |
| | | document.getElementById("carAudit1").attr("style", "display: none;"); |
| | | |
| | | Element email1_user = document.getElementById("email1_user"); |
| | | email1_user.text("Hello ,"); |
| | | Element email1_content = document.getElementById("email1_content"); |
| | | email1_content.text("pickup code is " + random + ", please complete the verification within 5 minutes. If the request wasn't made by you, please ignore this email."); |
| | | } |
| | | if(3 == language){ |
| | | document.getElementById("chinese").attr("style", "display: none;"); |
| | | document.getElementById("english").attr("style", "display: none;"); |
| | | document.getElementById("invite2").attr("style", "display: none;"); |
| | | document.getElementById("user2").attr("style", "display: none;"); |
| | | document.getElementById("settle2").attr("style", "display: none;"); |
| | | document.getElementById("pass2").attr("style", "display: none;"); |
| | | document.getElementById("bill2").attr("style", "display: none;"); |
| | | document.getElementById("reward2").attr("style", "display: none;"); |
| | | document.getElementById("rewardToday2").attr("style", "display: none;"); |
| | | document.getElementById("driverAudit2").attr("style", "display: none;"); |
| | | document.getElementById("carAudit2").attr("style", "display: none;"); |
| | | |
| | | Element email2_user = document.getElementById("email2_user"); |
| | | email2_user.text("Bonjour ,"); |
| | | Element email2_content = document.getElementById("email2_content"); |
| | | email2_content.text("Vous êtes lié à une adresse e-mail. Le code de vérification e-mail pour cette demande est: " + random + ". Veuillez compléter la vérification dans les 5 minutes"); |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "取件码" : language == 2 ? "Pickup code" : "Code de prise en charge", document.html()); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | orderMoney as orderMoney, |
| | | payManner as payManner, |
| | | UNIX_TIMESTAMP(travelTime) as travelTime, |
| | | remark as remark |
| | | remark as remark, |
| | | driverPay |
| | | from t_order_private_car where driverId = #{driverId} |
| | | <if test="state == 1"> |
| | | and state != 1 |
| | |
| | | c.remark as cancelRemark, |
| | | c.money as cancelPayMoney, |
| | | if(c.userType = 1, '用户取消', '平台取消') as cancelUser, |
| | | (select isSpecialCar from t_sys_reformist where companyId = a.companyId) as reassign |
| | | (select isSpecialCar from t_sys_reformist where companyId = a.companyId) as reassign, |
| | | a.driverPay |
| | | from t_order_private_car a |
| | | left join t_user b on (a.userId = b.id) |
| | | left join t_order_cancel c on (a.id = c.orderId and c.orderType = 1 and c.state = 2) |
| | |
| | | private GDMapElectricFenceUtil gdMapElectricFenceUtil; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | |
| | | @Autowired |
| | | private IOrderTaxiService orderTaxiService; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | |
| | | @Resource |
| | |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得专车订单,请及时联系客户!", orderPrivateCar.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderPrivateCar.getUserId()); |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){ |
| | | //上传数据 |
| | | pushMinistryOfTransportUtil.orderCreate(orderId); |
| | | pushMinistryOfTransportUtil.orderMatch(orderId); |
| | | } |
| | | } |
| | | }).start(); |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | |
| | | pushUtil.pushDriverPosition(orderPrivateCar.getId(), 1);//主动推送司机定位 |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.operateDepart(orderId); |
| | | } |
| | | } |
| | | }).start(); |
| | | OrderPosition orderPosition = new OrderPosition(); |
| | | orderPosition.setOrderId(orderId); |
| | | orderPosition.setOrderType(1); |
| | |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState()); |
| | | } |
| | | }).start(); |
| | | |
| | | OrderPrivateCar finalOrderPrivateCar = orderPrivateCar; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传交通数据 |
| | | pushMinistryOfTransportUtil.baseInfoVehicleTotalMile(finalOrderPrivateCar.getCarId()); |
| | | pushMinistryOfTransportUtil.operateArrive(orderId); |
| | | } |
| | | } |
| | | }).start(); |
| | | |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 获取司机车辆 |
| | | * @param companyId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface DriverOnlineMapper extends BaseMapper<DriverOnline> { |
| | | |
| | |
| | | */ |
| | | Integer querySumTime(@Param("driverId") Integer driverId, @Param("assessment") Integer assessment, |
| | | @Param("start") Date start, @Param("end") Date end); |
| | | |
| | | |
| | | |
| | | List<DriverOnline> queryList(@Param("day") String day, @Param("duration") Long duration); |
| | | } |
| | |
| | | |
| | | |
| | | <select id="queryByType" resultType="java.lang.String"> |
| | | select content from t_agreement where `type` = #{type} and flag != 3 |
| | | select content from t_agreement where `type` = #{type} and flag != 3 and `language` = 1 |
| | | <if test="null != useType"> |
| | | and useType = #{useType} |
| | | </if> |
| | |
| | | from t_car a |
| | | left join t_car_model b on (a.carModelId = b.id) |
| | | left join t_car_brand c on (b.brandId = c.id) |
| | | where a.state = 1 |
| | | and a.driverId=#{driverId} |
| | | where a.state = 1 and authState != 4 and a.driverId=#{driverId} and a.id != (select carId from t_driver where id = #{driverId}) |
| | | </select> |
| | | |
| | | <select id="query" resultType="com.stylefeng.guns.modular.system.model.Car"> |
| | |
| | | a.sex as sex, |
| | | a.`name` as `name`, |
| | | a.phone as phone, |
| | | DATE_FORMAT(a.birthday, '%Y-%m-%d') as birthday, |
| | | a.email, |
| | | a.driverAddress, |
| | | a.qrCode, |
| | | a.language, |
| | | a.laveActivityMoney as balance, |
| | |
| | | DATE_FORMAT(a.getDriverLicenseDate, '%Y-%m-%d') as getDriverLicenseDate, |
| | | (select GROUP_CONCAT(type Separator ',') from t_driver_service where driverId = a.id) as `type`, |
| | | a.placeOfPractice as placeOfPractice, |
| | | a.driveCardImgUrl1 as driveCardImgUrl1, |
| | | a.driveCardImgUrl1 as driveCardImgUrl, |
| | | a.driveCardImgUrl2 as driveCardImgUrl2, |
| | | b.drivingLicensePhoto,b.carModelId,b.carBrandId,a.carId, |
| | | a.networkCarlssueImg as networkCarlssueImg, |
| | | a.placeOfEmployment as placeOfEmployment, |
| | | (select id from t_city where chineseName = a.placeOfPractice or englishName = a.placeOfPractice or frenchName = a.placeOfPractice)placeOfPracticeId, |
| | | (select `name` from t_company where 1 = 1 and if(a.companyId is null or a.companyId = 0, id = 1, if(a.franchiseeId is null or a.franchiseeId = 0, id = a.companyId, id = a.franchiseeId))) as company, |
| | | b.carLicensePlate as licensePlate, |
| | | b.carColor as carColor, |
| | |
| | | and `date` between #{start} and #{end} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="queryList" resultType="DriverOnline"> |
| | | select |
| | | id as id, |
| | | driverId as driverId, |
| | | `date` as `date`, |
| | | duration as duration, |
| | | assessment as assessment |
| | | from t_driver_online where DATE_FORMAT(`date`, '%Y-%m-%d') = #{day} and duration >= #{duration} |
| | | </select> |
| | | </mapper> |
| | |
| | | select |
| | | (money * -1) as money, |
| | | DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as time, |
| | | CONCAT(if(orderType = 1, '专车', if(orderType = 2, '出租车', if(orderType = 3, '跨城', if(orderType = 4, '同城小件物流', if(orderType = 5, '跨城小件物流', '包车'))))), '订单取消') as name, |
| | | CONCAT(if(orderType = 1, '专车', if(orderType = 2, '出租车', if(orderType = 3, '跨城', if(orderType = 4, '市内小件物流', if(orderType = 5, '跨城小件物流', '包车'))))), '订单取消') as name, |
| | | UNIX_TIMESTAMP(insertTime) as insertTime |
| | | from t_order_cancel where state = 2 and userType = 1 and money is not null and userId = #{uid} |
| | | <choose> |
| | |
| | | <result column="emergencyContact" property="emergencyContact"/> |
| | | <result column="emergencyContactNumber" property="emergencyContactNumber"/> |
| | | <result column="isAuth" property="isAuth"/> |
| | | <result column="name" property="name"/> |
| | | <result column="lastName" property="lastName"/> |
| | | <result column="firstName" property="firstName"/> |
| | | <result column="idCard" property="idCard"/> |
| | | <result column="idCardFront" property="idCardFront"/> |
| | | <result column="idCardReverse" property="idCardReverse"/> |
| | |
| | | emergencyContact as emergencyContact, |
| | | emergencyContactNumber as emergencyContactNumber, |
| | | isAuth as isAuth, |
| | | name as name, |
| | | CONCAT(firstName, ' ', lastName) as name, |
| | | idCard as idCard, |
| | | idCardFront as idCardFront, |
| | | idCardReverse as idCardReverse, |
| | |
| | | emergencyContact as emergencyContact, |
| | | emergencyContactNumber as emergencyContactNumber, |
| | | isAuth as isAuth, |
| | | name as name, |
| | | CONCAT(firstName, ' ', lastName) as name, |
| | | idCard as idCard, |
| | | idCardFront as idCardFront, |
| | | idCardReverse as idCardReverse, |
| | |
| | | emergencyContact as emergencyContact, |
| | | emergencyContactNumber as emergencyContactNumber, |
| | | isAuth as isAuth, |
| | | name as name, |
| | | CONCAT(firstName, ' ', lastName) as name, |
| | | idCard as idCard, |
| | | idCardFront as idCardFront, |
| | | idCardReverse as idCardReverse, |
| | |
| | | a.sex as sex, |
| | | a.isAuth as isAuth, |
| | | (select state from t_verified where userId = a.id order by insertTime desc limit 0,1) as verified, |
| | | a.name as name, |
| | | CONCAT(a.firstName, ' ', a.lastName) as name, |
| | | a.integral as integral, |
| | | a.emergencyContact as emergencyContact, |
| | | a.emergencyContactNumber as emergencyContactNumber, |
| | |
| | | select |
| | | id as id, |
| | | userId as userId, |
| | | name as name, |
| | | CONCAT(firstName, ' ', lastName) as name, |
| | | idcode as idcode, |
| | | img1 as img1, |
| | | img2 as img2, |
| | |
| | | select |
| | | id as id, |
| | | phone as phone, |
| | | IFNULL(name,nickName) as name, |
| | | IFNULL(lastName ,nickName) as name, |
| | | avatar as avatar, |
| | | DATE_FORMAT(insertTime,'%Y/%m/%d %H:%i') as insertTime |
| | | from t_user |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil addCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicensePhoto, String drivingLicenseEndTime, |
| | | ResultUtil addCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicenseNumber, String drivingLicensePhoto, String drivingLicenseEndTime, |
| | | String carPhoto, String insurancePhoto, String commercialInsuranceTime, Integer uid,Integer id, String peopleAndCarsPhone) throws Exception; |
| | | } |
| | |
| | | * @param phone |
| | | * @return |
| | | */ |
| | | ResultUtil queryCaptcha(String phone, Integer type) throws Exception; |
| | | ResultUtil queryCaptcha(String phone, Integer type, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil queryEmailCaptcha(String email) throws Exception; |
| | | ResultUtil queryEmailCaptcha(String email, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * 司机提交注册申请 |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil registeredDriver(String phone, String code, String password, Integer uid, Integer type, Integer userType) throws Exception; |
| | | ResultUtil registeredDriver(String phone, String code, String password, Integer uid, Integer type, Integer userType, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil updateDriver(RegisteredWarpper registeredWarpper, Integer uid) throws Exception; |
| | | ResultUtil updateDriver(RegisteredWarpper registeredWarpper, Integer uid, Integer language) throws Exception; |
| | | |
| | | |
| | | |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil resetPassword(String phone, String code, String password) throws Exception; |
| | | ResultUtil resetPassword(String phone, String code, String password, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @param uid |
| | | * @throws Exception |
| | | */ |
| | | void updatePassword(String password, Integer uid) throws Exception; |
| | | void updatePassword(String password, Integer uid, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | Map<String, Object> queryMoneyInfo(Integer orderId, Integer orderType) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 司机支付订单 |
| | | * @param uid |
| | | * @param orderId |
| | | * @param orderType |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil payOrder(Integer uid, Integer orderId, Integer orderType, Integer payType, Integer language) throws Exception; |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil addCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicensePhoto, String drivingLicenseEndTime, |
| | | public ResultUtil addCar(Integer modelId, String color, String licensePlate, Date time, String drivingLicenseNumber, String drivingLicensePhoto, String drivingLicenseEndTime, |
| | | String carPhoto, String insurancePhoto, String commercialInsuranceTime, Integer uid,Integer id, String peopleAndCarsPhone) throws Exception { |
| | | |
| | | Car query = carMapper.query(licensePlate); |
| | |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Car car = new Car(); |
| | | car.setDriverId(uid); |
| | | car = carMapper.selectOne(car); |
| | | if(car==null){ |
| | | car = new Car(); |
| | | car.setId(id); |
| | | } |
| | | car.setPeopleAndCarsPhone(peopleAndCarsPhone); |
| | | car.setCarModelId(modelId); |
| | | CarModel carModel = carModelMapper.selectById(modelId); |
| | |
| | | car.setCarColor(color); |
| | | car.setCarLicensePlate(licensePlate); |
| | | car.setAnnualInspectionTime(time); |
| | | car.setDrivingLicenseNumber(drivingLicenseNumber); |
| | | car.setDrivingLicensePhoto(drivingLicensePhoto); |
| | | if(ToolUtil.isNotEmpty(drivingLicenseEndTime)){ |
| | | car.setDrivingLicenseEndTime(sdf.parse(drivingLicenseEndTime)); |
| | |
| | | driverOnlineMapper.insert(query1); |
| | | } |
| | | } |
| | | |
| | | }else{ |
| | | DriverOnline driverOnline = new DriverOnline(); |
| | | driverOnline.setDriverId(driverId); |
| | |
| | | import org.apache.shiro.authc.credential.HashedCredentialsMatcher; |
| | | import org.apache.shiro.crypto.hash.Md5Hash; |
| | | import org.apache.shiro.util.ByteSource; |
| | | import org.jsoup.Jsoup; |
| | | import org.jsoup.nodes.Document; |
| | | import org.jsoup.nodes.Element; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | @Autowired |
| | | private IOrderTaxiService orderTaxiService; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | |
| | | @Resource |
| | | private CarServiceMapper carServiceMapper; |
| | | |
| | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | @Resource |
| | | private DriverOnlineMapper driverOnlineMapper; |
| | | |
| | | @Value("${spring.mail.template-path}") |
| | | private String templatePath; |
| | | |
| | | private String salt = "SA;d5#"; |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil queryCaptcha(String phone, Integer type) throws Exception { |
| | | public ResultUtil queryCaptcha(String phone, Integer type, Integer language) throws Exception { |
| | | Random random = new Random(); |
| | | StringBuffer sb = new StringBuffer(); |
| | | for(int i = 0; i < 4; i++){ |
| | | sb.append((int) (random.nextDouble() * 10)); |
| | | } |
| | | String authCode = sb.toString(); |
| | | String sms = "短信验证码【" + authCode + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!"; |
| | | String sms = "短信验证码【" + authCode + "】已发到您的手机,验证码将在5分钟后失效."; |
| | | |
| | | //发送验证码短信 |
| | | redisUtil.setStrValue(phone, authCode, 5 * 60);//设置五分钟过期 |
| | | String templateCode = ""; |
| | | switch (type){ |
| | | case 1: |
| | | templateCode = "SMS_207770039";//身份验证 |
| | | break; |
| | | case 2: |
| | | templateCode = "SMS_207770039";//登录确认 |
| | | break; |
| | | case 3: |
| | | templateCode = "SMS_207770039";//用户注册 |
| | | break; |
| | | case 4: |
| | | templateCode = "SMS_207770039";//修改密码 |
| | | break; |
| | | } |
| | | String sData = aLiSendSms.sendSms(phone, templateCode, "{\"code\":\"" + authCode + "\"}"); |
| | | JSONObject jsonObject = JSON.parseObject(sData); |
| | | String message = jsonObject.getString("Message"); |
| | | if(!"OK".equals(message)){ |
| | | return ResultUtil.error(""); |
| | | } |
| | | SMSUtil.send_huawei_sms("b793ae3d41a049059197bfe92cf8bc83", "+233" + phone, "[\"" + authCode + "\"]"); |
| | | System.out.println(sms); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public ResultUtil queryEmailCaptcha(String email) throws Exception { |
| | | public ResultUtil queryEmailCaptcha(String email, Integer language) throws Exception { |
| | | Random random = new Random(); |
| | | StringBuffer sb = new StringBuffer(); |
| | | for(int i = 0; i < 4; i++){ |
| | | sb.append((int) (random.nextDouble() * 10)); |
| | | } |
| | | String authCode = sb.toString(); |
| | | String sms = "您发送的验证码为【" + authCode + "】,验证码将在5分钟后失效!"; |
| | | |
| | | //发送验证码短信 |
| | | redisUtil.setStrValue(email, authCode, 5 * 60);//设置五分钟过期 |
| | | EmailUtil.getMimeMessage(email, "验证码", sms); |
| | | |
| | | String path = templatePath + "index.html"; |
| | | Document document = Jsoup.parse(new File(path), "UTF-8"); |
| | | if(1 == language){ |
| | | document.getElementById("english").attr("style", "display: none;"); |
| | | document.getElementById("french").attr("style", "display: none;"); |
| | | document.getElementById("invite").attr("style", "display: none;"); |
| | | document.getElementById("user").attr("style", "display: none;"); |
| | | document.getElementById("settle").attr("style", "display: none;"); |
| | | document.getElementById("pass").attr("style", "display: none;"); |
| | | document.getElementById("bill").attr("style", "display: none;"); |
| | | document.getElementById("reward").attr("style", "display: none;"); |
| | | document.getElementById("rewardToday").attr("style", "display: none;"); |
| | | document.getElementById("driverAudit").attr("style", "display: none;"); |
| | | document.getElementById("carAudit").attr("style", "display: none;"); |
| | | |
| | | Element email_user = document.getElementById("email_user"); |
| | | email_user.text("您好 ,"); |
| | | Element email_content = document.getElementById("email_content"); |
| | | email_content.text("邮件验证码是:" + authCode + ",请在5分钟内完成验证"); |
| | | } |
| | | if(2 == language){ |
| | | document.getElementById("chinese").attr("style", "display: none;"); |
| | | document.getElementById("french").attr("style", "display: none;"); |
| | | document.getElementById("invite1").attr("style", "display: none;"); |
| | | document.getElementById("user1").attr("style", "display: none;"); |
| | | document.getElementById("settle1").attr("style", "display: none;"); |
| | | document.getElementById("pass1").attr("style", "display: none;"); |
| | | document.getElementById("bill1").attr("style", "display: none;"); |
| | | document.getElementById("reward1").attr("style", "display: none;"); |
| | | document.getElementById("rewardToday1").attr("style", "display: none;"); |
| | | document.getElementById("driverAudit1").attr("style", "display: none;"); |
| | | document.getElementById("carAudit1").attr("style", "display: none;"); |
| | | |
| | | Element email1_user = document.getElementById("email1_user"); |
| | | email1_user.text("Hello ,"); |
| | | Element email1_content = document.getElementById("email1_content"); |
| | | email1_content.text("verification code is " + authCode + ", please complete the verification within 5 minutes. If the request wasn't made by you, please ignore this email."); |
| | | } |
| | | if(3 == language){ |
| | | document.getElementById("chinese").attr("style", "display: none;"); |
| | | document.getElementById("english").attr("style", "display: none;"); |
| | | document.getElementById("invite2").attr("style", "display: none;"); |
| | | document.getElementById("user2").attr("style", "display: none;"); |
| | | document.getElementById("settle2").attr("style", "display: none;"); |
| | | document.getElementById("pass2").attr("style", "display: none;"); |
| | | document.getElementById("bill2").attr("style", "display: none;"); |
| | | document.getElementById("reward2").attr("style", "display: none;"); |
| | | document.getElementById("rewardToday2").attr("style", "display: none;"); |
| | | document.getElementById("driverAudit2").attr("style", "display: none;"); |
| | | document.getElementById("carAudit2").attr("style", "display: none;"); |
| | | |
| | | Element email2_user = document.getElementById("email2_user"); |
| | | email2_user.text("Hello ,"); |
| | | Element email2_content = document.getElementById("email2_content"); |
| | | email2_content.text("Vous êtes lié à une adresse e-mail. Le code de vérification e-mail pour cette demande est: " + authCode + ". Veuillez compléter la vérification dans les 5 minutes"); |
| | | } |
| | | EmailUtil.send(email, language == 1 ? "验证码" : language == 2 ? "Verification code" : "Code de vérification", document.html()); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil registeredDriver(String phone, String code, String password, Integer uid, Integer type, Integer userType) throws Exception { |
| | | public ResultUtil registeredDriver(String phone, String code, String password, Integer uid, Integer type, Integer userType, Integer language) throws Exception { |
| | | ResultUtil<LoginWarpper> result = this.registeredDriver(phone, code, password,uid,type); |
| | | if(result.getCode() == 200 && null != uid){ |
| | | /*if(type == 2){ |
| | | if(type == 2){ |
| | | Driver driver = driverMapper.selectById(uid); |
| | | List<Map<String, Object>> query = driverActivityRegisteredMapper.query(userType, driver.getCompanyId()); |
| | | BigDecimal bigDecimal = new BigDecimal("0"); |
| | |
| | | driver.setLaveActivityMoney(bigDecimal.add(new BigDecimal(driver.getLaveActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(bigDecimal.add(new BigDecimal(driver.getBalance())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverMapper.updateById(driver); |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())){ |
| | | String path = templatePath + "index.html"; |
| | | Document document = Jsoup.parse(new File(path), "UTF-8"); |
| | | if(1 == language){ |
| | | document.getElementById("english").attr("style", "display: none;"); |
| | | document.getElementById("french").attr("style", "display: none;"); |
| | | document.getElementById("user").attr("style", "display: none;"); |
| | | document.getElementById("settle").attr("style", "display: none;"); |
| | | document.getElementById("pass").attr("style", "display: none;"); |
| | | document.getElementById("email").attr("style", "display: none;"); |
| | | document.getElementById("bill").attr("style", "display: none;"); |
| | | document.getElementById("reward").attr("style", "display: none;"); |
| | | document.getElementById("rewardToday").attr("style", "display: none;"); |
| | | document.getElementById("driverAudit").attr("style", "display: none;"); |
| | | document.getElementById("carAudit").attr("style", "display: none;"); |
| | | |
| | | Element invite_user = document.getElementById("invite_user"); |
| | | invite_user.text("您好 " + driver.getName() + ","); |
| | | Element invite_content = document.getElementById("invite_content"); |
| | | invite_content.text("您已成功邀请一位司机注册I-GO,获得奖励GHS " + bigDecimal.doubleValue() + ",请查收"); |
| | | } |
| | | if(2 == language){ |
| | | document.getElementById("chinese").attr("style", "display: none;"); |
| | | document.getElementById("french").attr("style", "display: none;"); |
| | | document.getElementById("user1").attr("style", "display: none;"); |
| | | document.getElementById("settle1").attr("style", "display: none;"); |
| | | document.getElementById("pass1").attr("style", "display: none;"); |
| | | document.getElementById("email1").attr("style", "display: none;"); |
| | | document.getElementById("bill1").attr("style", "display: none;"); |
| | | document.getElementById("reward1").attr("style", "display: none;"); |
| | | document.getElementById("rewardToday1").attr("style", "display: none;"); |
| | | document.getElementById("driverAudit1").attr("style", "display: none;"); |
| | | document.getElementById("carAudit1").attr("style", "display: none;"); |
| | | |
| | | Element invite1_user = document.getElementById("invite1_user"); |
| | | invite1_user.text("Hello " + driver.getName() + ","); |
| | | Element invite1_content = document.getElementById("invite1_content"); |
| | | invite1_content.text("You have succeeded to invite a driver to register with I-GO, so you received a GHS " + bigDecimal.doubleValue() + " bonus, please check your balance."); |
| | | } |
| | | if(3 == language){ |
| | | document.getElementById("chinese").attr("style", "display: none;"); |
| | | document.getElementById("english").attr("style", "display: none;"); |
| | | document.getElementById("user2").attr("style", "display: none;"); |
| | | document.getElementById("settle2").attr("style", "display: none;"); |
| | | document.getElementById("pass2").attr("style", "display: none;"); |
| | | document.getElementById("email2").attr("style", "display: none;"); |
| | | document.getElementById("bill2").attr("style", "display: none;"); |
| | | document.getElementById("reward2").attr("style", "display: none;"); |
| | | document.getElementById("rewardToday2").attr("style", "display: none;"); |
| | | document.getElementById("driverAudit2").attr("style", "display: none;"); |
| | | document.getElementById("carAudit2").attr("style", "display: none;"); |
| | | |
| | | Element invite2_user = document.getElementById("invite2_user"); |
| | | invite2_user.text("Bonjour " + driver.getName() + ","); |
| | | Element invite2_content = document.getElementById("invite2_content"); |
| | | invite2_content.text("Vous avez invité avec succès un conducteur à s’inscrire à i-go pour recevoir une récompense GHS " + bigDecimal.doubleValue() + ". Veuillez vérifier"); |
| | | } |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "邀请奖励" : language == 2 ? "invitation bonus" : "prime d'invitation", document.html()); |
| | | } |
| | | |
| | | } |
| | | if(type == 1){//用户分享 |
| | | UserInfo userInfo = userInfoMapper.selectById(uid); |
| | |
| | | userCouponRecordMapper.insert(userCouponRecord); |
| | | } |
| | | } |
| | | }*/ |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil updateDriver(RegisteredWarpper registeredWarpper, Integer uid) throws Exception { |
| | | public ResultUtil updateDriver(RegisteredWarpper registeredWarpper, Integer uid, Integer language) throws Exception { |
| | | Driver driver = this.selectById(uid); |
| | | driver.setName(registeredWarpper.getName()); |
| | | driver.setSex(registeredWarpper.getSex()); |
| | |
| | | driver.setHeadImgUrl(registeredWarpper.getHeadImgUrl()); |
| | | driver.setIdCardImgUrl1(registeredWarpper.getIdCardImgUrl1()); |
| | | driver.setIdCardImgUrl2(registeredWarpper.getIdCardImgUrl2()); |
| | | driver.setPlaceOfEmployment(city1.getEnglishName()); |
| | | driver.setPlaceOfEmployment(language == 1 ? city1.getChineseName() : language == 2 ? city1.getEnglishName() : city1.getFrenchName()); |
| | | driver.setDriverAddress(registeredWarpper.getDriverContactAddress()); |
| | | driver.setDriverContactAddress(registeredWarpper.getDriverContactAddress()); |
| | | driver.setDriverContactAddress_(registeredWarpper.getDriverContactAddress_()); |
| | | driver.setPlaceOfPractice(city1.getEnglishName()); |
| | | driver.setPlaceOfPractice(language == 1 ? city1.getChineseName() : language == 2 ? city1.getEnglishName() : city1.getFrenchName()); |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(registeredWarpper.getGetDriverLicenseDate()); |
| | |
| | | now.setTime(new Date()); |
| | | driver.setDriverAge(now.get(Calendar.YEAR) - calendar.get(Calendar.YEAR)); |
| | | driver.setGetDriverLicenseDate(registeredWarpper.getGetDriverLicenseDate()); |
| | | driver.setDriveCardImgUrl1(registeredWarpper.getDriveCardImgUrl1()); |
| | | driver.setDriveCardImgUrl1(registeredWarpper.getDriveCardImgUrl()); |
| | | driver.setDriveCardImgUrl2(registeredWarpper.getDriveCardImgUrl2()); |
| | | driver.setEmail(registeredWarpper.getEmail()); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())){ |
| | | String path1 = templatePath + "index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if(1 == language){ |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite").attr("style", "display: none;"); |
| | | document1.getElementById("user").attr("style", "display: none;"); |
| | | document1.getElementById("pass").attr("style", "display: none;"); |
| | | document1.getElementById("email").attr("style", "display: none;"); |
| | | document1.getElementById("bill").attr("style", "display: none;"); |
| | | document1.getElementById("reward").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit").attr("style", "display: none;"); |
| | | |
| | | Element settle_user = document1.getElementById("settle_user"); |
| | | settle_user.text("您好 " + driver.getName() + ","); |
| | | } |
| | | if(2 == language){ |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite1").attr("style", "display: none;"); |
| | | document1.getElementById("user1").attr("style", "display: none;"); |
| | | document1.getElementById("pass1").attr("style", "display: none;"); |
| | | document1.getElementById("email1").attr("style", "display: none;"); |
| | | document1.getElementById("bill1").attr("style", "display: none;"); |
| | | document1.getElementById("reward1").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday1").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit1").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit1").attr("style", "display: none;"); |
| | | |
| | | Element settle1_user = document1.getElementById("settle1_user"); |
| | | settle1_user.text("Hello " + driver.getName() + ","); |
| | | } |
| | | if(3 == language){ |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("invite2").attr("style", "display: none;"); |
| | | document1.getElementById("user2").attr("style", "display: none;"); |
| | | document1.getElementById("pass2").attr("style", "display: none;"); |
| | | document1.getElementById("email2").attr("style", "display: none;"); |
| | | document1.getElementById("bill2").attr("style", "display: none;"); |
| | | document1.getElementById("reward2").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday2").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit2").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit2").attr("style", "display: none;"); |
| | | |
| | | Element settle2_user = document1.getElementById("settle2_user"); |
| | | settle2_user.text("Bonjour " + driver.getName() + ","); |
| | | } |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "注册成功" : language == 2 ? "registration success" : "succès de l'inscription", document1.html()); |
| | | } |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil resetPassword(String phone, String code, String password) throws Exception { |
| | | public ResultUtil resetPassword(String phone, String code, String password, Integer language) throws Exception { |
| | | boolean b = this.checkCaptcha(phone, code); |
| | | if(!b){ |
| | | return ResultUtil.error("验证码无效"); |
| | |
| | | } |
| | | driver.setPassword(ShiroKit.md5(password, salt)); |
| | | driverMapper.updateById(driver); |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())){ |
| | | String path1 = templatePath + "index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if(1 == language){ |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite").attr("style", "display: none;"); |
| | | document1.getElementById("user").attr("style", "display: none;"); |
| | | document1.getElementById("settle").attr("style", "display: none;"); |
| | | document1.getElementById("email").attr("style", "display: none;"); |
| | | document1.getElementById("bill").attr("style", "display: none;"); |
| | | document1.getElementById("reward").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit").attr("style", "display: none;"); |
| | | |
| | | Element pass_user = document1.getElementById("pass_user"); |
| | | pass_user.text("您好 " + driver.getName() + ","); |
| | | } |
| | | if(2 == language){ |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite1").attr("style", "display: none;"); |
| | | document1.getElementById("user1").attr("style", "display: none;"); |
| | | document1.getElementById("settle1").attr("style", "display: none;"); |
| | | document1.getElementById("email1").attr("style", "display: none;"); |
| | | document1.getElementById("bill1").attr("style", "display: none;"); |
| | | document1.getElementById("reward1").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday1").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit1").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit1").attr("style", "display: none;"); |
| | | |
| | | Element pass1_user = document1.getElementById("pass1_user"); |
| | | pass1_user.text("Hello " + driver.getName() + ","); |
| | | } |
| | | if(3 == language){ |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("invite2").attr("style", "display: none;"); |
| | | document1.getElementById("user2").attr("style", "display: none;"); |
| | | document1.getElementById("settle2").attr("style", "display: none;"); |
| | | document1.getElementById("email2").attr("style", "display: none;"); |
| | | document1.getElementById("bill2").attr("style", "display: none;"); |
| | | document1.getElementById("reward2").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday2").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit2").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit2").attr("style", "display: none;"); |
| | | |
| | | Element pass2_user = document1.getElementById("pass2_user"); |
| | | pass2_user.text("Bonjour " + driver.getName() + ","); |
| | | } |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "重置密码" : language == 2 ? "reset Password" : "réinitialiser le mot de passe", document1.html()); |
| | | } |
| | | |
| | | smsrecordService.saveData(6, phone, code, "短信验证码【" + code + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!"); |
| | | return ResultUtil.success(); |
| | |
| | | if(null == driver){ |
| | | return ResultUtil.error("账号未注册"); |
| | | } |
| | | /*if(driver.getAuthState() == 1){ |
| | | if(driver.getAuthState() == 1){ |
| | | return ResultUtil.error("账号正在审核中,请耐心等待"); |
| | | }*/ |
| | | } |
| | | if(driver.getAuthState() == 3){ |
| | | return ResultUtil.error("账号已被冻结,请联系管理员"); |
| | | } |
| | |
| | | public void run() { |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarService.selectList(new EntityWrapper<OrderPrivateCar>().eq("driverId", uid).eq("payType", 4) |
| | | .eq("driverPay", 1).eq("isDelete", 1)); |
| | | for (OrderPrivateCar orderPrivateCar : orderPrivateCars) { |
| | | if(orderPrivateCars.size() > 0){ |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCars.get(0); |
| | | pushUtil.pushOfflinePayment(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1); |
| | | return; |
| | | } |
| | | List<OrderLogistics> orderLogistics = orderLogisticsService.selectList(new EntityWrapper<OrderLogistics>().eq("driverId", uid).eq("payType", 4) |
| | | .eq("isDelete", 1).eq("driverPay", 1)); |
| | | for (OrderLogistics orderLogistic : orderLogistics) { |
| | | pushUtil.pushOfflinePayment(2, orderLogistic.getDriverId(), orderLogistic.getId(), orderLogistic.getType()); |
| | | if(orderLogistics.size() > 0){ |
| | | OrderLogistics orderLogistics1 = orderLogistics.get(0); |
| | | pushUtil.pushOfflinePayment(2, orderLogistics1.getDriverId(), orderLogistics1.getId(), orderLogistics1.getType()); |
| | | } |
| | | } |
| | | }).start(); |
| | |
| | | driverWork.setState(2); |
| | | driverWorkMapper.updateById(driverWork); |
| | | driver.setState(1); |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.operateLogout(uid); |
| | | } |
| | | } |
| | | }).start(); |
| | | }else{ |
| | | LoginWarpper loginWarpper = new LoginWarpper(); |
| | | if(driver.getCompanyId()==null){ |
| | |
| | | driverWork.setType(type); |
| | | driverWorkMapper.insert(driverWork); |
| | | driver.setState(2); |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){ //上传数据 |
| | | pushMinistryOfTransportUtil.operateLogin(uid); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | this.updateById(driver); |
| | | return ResultUtil.success(); |
| | |
| | | driverWork.setState(2); |
| | | driverWorkMapper.updateById(driverWork); |
| | | driver.setState(1); |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.operateLogout(uid); |
| | | } |
| | | } |
| | | }).start(); |
| | | }else{ |
| | | LoginWarpper loginWarpper = new LoginWarpper(); |
| | | if(driver.getCompanyId()==null){ |
| | |
| | | driverOrdersMapper.insert(driverOrders); |
| | | } |
| | | } |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){ |
| | | //上传数据 |
| | | pushMinistryOfTransportUtil.operateLogin(uid); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | this.updateById(driver); |
| | | return ResultUtil.success(); |
| | |
| | | baseWarpper.setName("跨城出行"); |
| | | break; |
| | | case 4: |
| | | baseWarpper.setName("同城小件物流"); |
| | | baseWarpper.setName("市内小件物流"); |
| | | break; |
| | | case 5: |
| | | baseWarpper.setName("跨城小件物流"); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public void updatePassword(String password, Integer uid) throws Exception { |
| | | public void updatePassword(String password, Integer uid, Integer language) throws Exception { |
| | | Driver driver = this.selectById(uid); |
| | | driver.setPassword(ShiroKit.md5(password, salt)); |
| | | this.updateById(driver); |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())){ |
| | | String path1 = templatePath + "index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if(1 == language){ |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite").attr("style", "display: none;"); |
| | | document1.getElementById("user").attr("style", "display: none;"); |
| | | document1.getElementById("settle").attr("style", "display: none;"); |
| | | document1.getElementById("email").attr("style", "display: none;"); |
| | | document1.getElementById("bill").attr("style", "display: none;"); |
| | | document1.getElementById("reward").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit").attr("style", "display: none;"); |
| | | |
| | | Element pass_user = document1.getElementById("pass_user"); |
| | | pass_user.text("您好 " + driver.getName() + ","); |
| | | } |
| | | if(2 == language){ |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite1").attr("style", "display: none;"); |
| | | document1.getElementById("user1").attr("style", "display: none;"); |
| | | document1.getElementById("settle1").attr("style", "display: none;"); |
| | | document1.getElementById("email1").attr("style", "display: none;"); |
| | | document1.getElementById("bill1").attr("style", "display: none;"); |
| | | document1.getElementById("reward1").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday1").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit1").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit1").attr("style", "display: none;"); |
| | | |
| | | Element pass1_user = document1.getElementById("pass1_user"); |
| | | pass1_user.text("Hello " + driver.getName() + ","); |
| | | } |
| | | if(2 == language){ |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("invite2").attr("style", "display: none;"); |
| | | document1.getElementById("user2").attr("style", "display: none;"); |
| | | document1.getElementById("settle2").attr("style", "display: none;"); |
| | | document1.getElementById("email2").attr("style", "display: none;"); |
| | | document1.getElementById("bill2").attr("style", "display: none;"); |
| | | document1.getElementById("reward2").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday2").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit2").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit2").attr("style", "display: none;"); |
| | | |
| | | Element pass2_user = document1.getElementById("pass2_user"); |
| | | pass2_user.text("Bonjour " + driver.getName() + ","); |
| | | } |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "重置密码" : language == 2 ? "reset Password" : "réinitialiser le mot de passe", document1.html()); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | Driver driver = this.selectById(uid); |
| | | if(driver.getState() == 3){ |
| | | return ResultUtil.error("还在服务中,不能更换"); |
| | | } |
| | | Car car = carService.selectById(carId); |
| | | if(null == car){ |
| | | return ResultUtil.error("车辆无效"); |
| | | } |
| | | if(car.getAuthState() == 1){ |
| | | return ResultUtil.error("车辆正在审核中"); |
| | | } |
| | | if(car.getAuthState() == 3){ |
| | | return ResultUtil.error("车辆已冻结"); |
| | | } |
| | | boolean idle = carService.idle(carId); |
| | | if(!idle){ |
| | |
| | | @Override |
| | | public void addTodayActivity() throws Exception { |
| | | List<Company> companies = companyMapper.selectList(new EntityWrapper<Company>().eq("state", 0).ne("flag", 3)); |
| | | Integer language = 2; |
| | | //获取每个企业的活动数据 |
| | | for(Company company : companies){ |
| | | //企业下的所有司机 |
| | |
| | | driverActivityHistory.setMoney(Double.valueOf(String.valueOf(map.get("money")))); |
| | | driverActivityHistory.setInsertTime(new Date()); |
| | | driverActivityHistoryMapper.insert(driverActivityHistory); |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())) { |
| | | String path1 = templatePath + "index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if (1 == language) { |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite").attr("style", "display: none;"); |
| | | document1.getElementById("user").attr("style", "display: none;"); |
| | | document1.getElementById("settle").attr("style", "display: none;"); |
| | | document1.getElementById("pass").attr("style", "display: none;"); |
| | | document1.getElementById("email").attr("style", "display: none;"); |
| | | document1.getElementById("bill").attr("style", "display: none;"); |
| | | document1.getElementById("reward").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit").attr("style", "display: none;"); |
| | | |
| | | Element rewardToday_user = document1.getElementById("rewardToday_user"); |
| | | rewardToday_user.text("您好 " + driver.getName() + ","); |
| | | Element rewardToday_award = document1.getElementById("rewardToday_award"); |
| | | rewardToday_award.text("奖金 GHS" + driverActivityHistory.getMoney()); |
| | | Element rewardToday_content = document1.getElementById("rewardToday_content"); |
| | | rewardToday_content.text("邀请司机注册即可活动奖励。 注意此活动是有时间限制的,详情请查看I-GO平台。"); |
| | | } |
| | | if (2 == language) { |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite1").attr("style", "display: none;"); |
| | | document1.getElementById("user1").attr("style", "display: none;"); |
| | | document1.getElementById("settle1").attr("style", "display: none;"); |
| | | document1.getElementById("pass1").attr("style", "display: none;"); |
| | | document1.getElementById("email1").attr("style", "display: none;"); |
| | | document1.getElementById("bill1").attr("style", "display: none;"); |
| | | document1.getElementById("reward1").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit1").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit1").attr("style", "display: none;"); |
| | | |
| | | Element rewardToday1_user = document1.getElementById("rewardToday1_user"); |
| | | rewardToday1_user.text("Hello " + driver.getName() + ","); |
| | | Element rewardToday1_award = document1.getElementById("rewardToday1_award"); |
| | | rewardToday1_award.text("GHS " + driverActivityHistory.getMoney() + " BONUS"); |
| | | Element rewardToday1_content = document1.getElementById("rewardToday1_content"); |
| | | rewardToday1_content.text("Invite drivers to register and get event rewards. Note that this event is time-limited, please check the I-GO platform for details."); |
| | | } |
| | | if (3 == language) { |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite2").attr("style", "display: none;"); |
| | | document1.getElementById("user2").attr("style", "display: none;"); |
| | | document1.getElementById("settle2").attr("style", "display: none;"); |
| | | document1.getElementById("pass2").attr("style", "display: none;"); |
| | | document1.getElementById("email2").attr("style", "display: none;"); |
| | | document1.getElementById("bill2").attr("style", "display: none;"); |
| | | document1.getElementById("reward2").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit2").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit2").attr("style", "display: none;"); |
| | | |
| | | Element rewardToday2_user = document1.getElementById("rewardToday2_user"); |
| | | rewardToday2_user.text("Bonjour " + driver.getName() + ","); |
| | | Element rewardToday2_award = document1.getElementById("rewardToday2_award"); |
| | | rewardToday2_award.text("Bonus GHS " + driverActivityHistory.getMoney()); |
| | | Element rewardToday2_content = document1.getElementById("rewardToday2_content"); |
| | | rewardToday2_content.text("Invitez les conducteurs à s’inscrire et à recevoir des récompenses. Notez que cet événement est limité dans le temps, veuillez consulter la plateforme I-GO pour plus de détails."); |
| | | } |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "今日活动" : language == 2 ? "today's activity" : "l'événement d'aujourd'hui", document1.html()); |
| | | } |
| | | } |
| | | } |
| | | //邀请用户注册 |
| | |
| | | driverActivityHistory.setMoney(Double.valueOf(String.valueOf(map.get("money")))); |
| | | driverActivityHistory.setInsertTime(new Date()); |
| | | driverActivityHistoryMapper.insert(driverActivityHistory); |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())) { |
| | | String path1 = templatePath + "index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if (1 == language) { |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite").attr("style", "display: none;"); |
| | | document1.getElementById("user").attr("style", "display: none;"); |
| | | document1.getElementById("settle").attr("style", "display: none;"); |
| | | document1.getElementById("pass").attr("style", "display: none;"); |
| | | document1.getElementById("email").attr("style", "display: none;"); |
| | | document1.getElementById("bill").attr("style", "display: none;"); |
| | | document1.getElementById("reward").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit").attr("style", "display: none;"); |
| | | |
| | | Element rewardToday_user = document1.getElementById("rewardToday_user"); |
| | | rewardToday_user.text("您好 " + driver.getName() + ","); |
| | | Element rewardToday_award = document1.getElementById("rewardToday_award"); |
| | | rewardToday_award.text("奖金 GHS" + driverActivityHistory.getMoney()); |
| | | Element rewardToday_content = document1.getElementById("rewardToday_content"); |
| | | rewardToday_content.text("邀请用户注册即可活动奖励。 注意此活动是有时间限制的,详情请查看I-GO平台。"); |
| | | } |
| | | if (2 == language) { |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite1").attr("style", "display: none;"); |
| | | document1.getElementById("user1").attr("style", "display: none;"); |
| | | document1.getElementById("settle1").attr("style", "display: none;"); |
| | | document1.getElementById("pass1").attr("style", "display: none;"); |
| | | document1.getElementById("email1").attr("style", "display: none;"); |
| | | document1.getElementById("bill1").attr("style", "display: none;"); |
| | | document1.getElementById("reward1").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit1").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit1").attr("style", "display: none;"); |
| | | |
| | | Element rewardToday1_user = document1.getElementById("rewardToday1_user"); |
| | | rewardToday1_user.text("Hello " + driver.getName() + ","); |
| | | Element rewardToday1_award = document1.getElementById("rewardToday1_award"); |
| | | rewardToday1_award.text("GHS " + driverActivityHistory.getMoney() + " BONUS"); |
| | | Element rewardToday1_content = document1.getElementById("rewardToday1_content"); |
| | | rewardToday1_content.text("Invite users to register and get event rewards. Note that this event is time-limited, please check the I-GO platform for details."); |
| | | } |
| | | if (3 == language) { |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("invite2").attr("style", "display: none;"); |
| | | document1.getElementById("user2").attr("style", "display: none;"); |
| | | document1.getElementById("settle2").attr("style", "display: none;"); |
| | | document1.getElementById("pass2").attr("style", "display: none;"); |
| | | document1.getElementById("email2").attr("style", "display: none;"); |
| | | document1.getElementById("bill2").attr("style", "display: none;"); |
| | | document1.getElementById("reward2").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit2").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit2").attr("style", "display: none;"); |
| | | |
| | | Element rewardToday2_user = document1.getElementById("rewardToday2_user"); |
| | | rewardToday2_user.text("Bonjour " + driver.getName() + ","); |
| | | Element rewardToday2_award = document1.getElementById("rewardToday2_award"); |
| | | rewardToday2_award.text("Bonus GHS " + driverActivityHistory.getMoney()); |
| | | Element rewardToday2_content = document1.getElementById("rewardToday2_content"); |
| | | rewardToday2_content.text("Invitez les conducteurs à s’inscrire et à recevoir des récompenses. Notez que cet événement est limité dans le temps, veuillez consulter la plateforme I-GO pour plus de détails."); |
| | | } |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "今日活动" : language == 2 ? "today's activity" : "l'événement d'aujourd'hui", document1.html()); |
| | | } |
| | | } |
| | | } |
| | | //累计在线 |
| | | query = driverActivityOnlineMapper.query(company.getId()); |
| | | for(Map<String, Object> map : query){ |
| | | DriverActivityOnline driverActivityOnline = driverActivityOnlineMapper.selectById(Integer.valueOf(String.valueOf(map.get("id")))); |
| | | for(Driver driver : drivers){ |
| | | DriverActivityHistory driverActivityHistory = new DriverActivityHistory(); |
| | | driverActivityHistory.setActivityId(Integer.valueOf(String.valueOf(map.get("id")))); |
| | |
| | | driverActivityHistory.setMoney(Double.valueOf(String.valueOf(map.get("money")))); |
| | | driverActivityHistory.setInsertTime(new Date()); |
| | | driverActivityHistoryMapper.insert(driverActivityHistory); |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())) { |
| | | String path1 = templatePath + "index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if (1 == language) { |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite").attr("style", "display: none;"); |
| | | document1.getElementById("user").attr("style", "display: none;"); |
| | | document1.getElementById("settle").attr("style", "display: none;"); |
| | | document1.getElementById("pass").attr("style", "display: none;"); |
| | | document1.getElementById("email").attr("style", "display: none;"); |
| | | document1.getElementById("bill").attr("style", "display: none;"); |
| | | document1.getElementById("reward").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit").attr("style", "display: none;"); |
| | | |
| | | Element rewardToday_user = document1.getElementById("rewardToday_user"); |
| | | rewardToday_user.text("您好 " + driver.getName() + ","); |
| | | Element rewardToday_award = document1.getElementById("rewardToday_award"); |
| | | rewardToday_award.text("奖金 GHS" + driverActivityHistory.getMoney()); |
| | | Element rewardToday_content = document1.getElementById("rewardToday_content"); |
| | | rewardToday_content.text("今日累计在线" + driverActivityOnline.getOnline() + "小时即可活动奖励。 注意此活动是有时间限制的,详情请查看I-GO平台。"); |
| | | } |
| | | if (2 == language) { |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite1").attr("style", "display: none;"); |
| | | document1.getElementById("user1").attr("style", "display: none;"); |
| | | document1.getElementById("settle1").attr("style", "display: none;"); |
| | | document1.getElementById("pass1").attr("style", "display: none;"); |
| | | document1.getElementById("email1").attr("style", "display: none;"); |
| | | document1.getElementById("bill1").attr("style", "display: none;"); |
| | | document1.getElementById("reward1").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit1").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit1").attr("style", "display: none;"); |
| | | |
| | | Element rewardToday1_user = document1.getElementById("rewardToday1_user"); |
| | | rewardToday1_user.text("Hello " + driver.getName() + ","); |
| | | Element rewardToday1_award = document1.getElementById("rewardToday1_award"); |
| | | rewardToday1_award.text("GHS " + driverActivityHistory.getMoney() + " BONUS"); |
| | | Element rewardToday1_content = document1.getElementById("rewardToday1_content"); |
| | | rewardToday1_content.text("Accumulated online " + driverActivityOnline.getOnline() + " hours today to get event rewards. Note that this event is time-limited, please check the I-GO platform for details."); |
| | | } |
| | | if (3 == language) { |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("invite2").attr("style", "display: none;"); |
| | | document1.getElementById("user2").attr("style", "display: none;"); |
| | | document1.getElementById("settle2").attr("style", "display: none;"); |
| | | document1.getElementById("pass2").attr("style", "display: none;"); |
| | | document1.getElementById("email2").attr("style", "display: none;"); |
| | | document1.getElementById("bill2").attr("style", "display: none;"); |
| | | document1.getElementById("reward2").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit2").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit2").attr("style", "display: none;"); |
| | | |
| | | Element rewardToday2_user = document1.getElementById("rewardToday2_user"); |
| | | rewardToday2_user.text("Bonjour " + driver.getName() + ","); |
| | | Element rewardToday2_award = document1.getElementById("rewardToday2_award"); |
| | | rewardToday2_award.text("Bonus GHS " + driverActivityHistory.getMoney()); |
| | | Element rewardToday2_content = document1.getElementById("rewardToday2_content"); |
| | | rewardToday2_content.text("Accumulé en ligne " + driverActivityOnline.getOnline() + " heures aujourd’hui pour obtenir des récompenses d’événement. Notez que cet événement est limité dans le temps, veuillez consulter la plateforme I-GO pour plus de détails."); |
| | | } |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "今日活动" : language == 2 ? "today's activity" : "l'événement d'aujourd'hui", document1.html()); |
| | | } |
| | | } |
| | | } |
| | | //订单量 |
| | | query = driverActivityOrderMapper.query(company.getId()); |
| | | for(Map<String, Object> map : query){ |
| | | DriverActivityOrder driverActivityOrder = driverActivityOrderMapper.selectById(Integer.valueOf(String.valueOf(map.get("id")))); |
| | | for(Driver driver : drivers){ |
| | | DriverActivityHistory driverActivityHistory = new DriverActivityHistory(); |
| | | driverActivityHistory.setActivityId(Integer.valueOf(String.valueOf(map.get("id")))); |
| | |
| | | driverActivityHistory.setMoney(Double.valueOf(String.valueOf(map.get("money")))); |
| | | driverActivityHistory.setInsertTime(new Date()); |
| | | driverActivityHistoryMapper.insert(driverActivityHistory); |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())) { |
| | | String path1 = templatePath + "index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if (1 == language) { |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite").attr("style", "display: none;"); |
| | | document1.getElementById("user").attr("style", "display: none;"); |
| | | document1.getElementById("settle").attr("style", "display: none;"); |
| | | document1.getElementById("pass").attr("style", "display: none;"); |
| | | document1.getElementById("email").attr("style", "display: none;"); |
| | | document1.getElementById("bill").attr("style", "display: none;"); |
| | | document1.getElementById("reward").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit").attr("style", "display: none;"); |
| | | |
| | | Element rewardToday_user = document1.getElementById("rewardToday_user"); |
| | | rewardToday_user.text("您好 " + driver.getName() + ","); |
| | | Element rewardToday_award = document1.getElementById("rewardToday_award"); |
| | | rewardToday_award.text("奖金 GHS" + driverActivityHistory.getMoney()); |
| | | Element rewardToday_content = document1.getElementById("rewardToday_content"); |
| | | rewardToday_content.text("今日累计完成" + driverActivityOrder.getOrderNum() + "单即可活动奖励。 注意此活动是有时间限制的,详情请查看I-GO平台。"); |
| | | } |
| | | if (2 == language) { |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite1").attr("style", "display: none;"); |
| | | document1.getElementById("user1").attr("style", "display: none;"); |
| | | document1.getElementById("settle1").attr("style", "display: none;"); |
| | | document1.getElementById("pass1").attr("style", "display: none;"); |
| | | document1.getElementById("email1").attr("style", "display: none;"); |
| | | document1.getElementById("bill1").attr("style", "display: none;"); |
| | | document1.getElementById("reward1").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit1").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit1").attr("style", "display: none;"); |
| | | |
| | | Element rewardToday1_user = document1.getElementById("rewardToday1_user"); |
| | | rewardToday1_user.text("Hello " + driver.getName() + ","); |
| | | Element rewardToday1_award = document1.getElementById("rewardToday1_award"); |
| | | rewardToday1_award.text("GHS " + driverActivityHistory.getMoney() + " BONUS"); |
| | | Element rewardToday1_content = document1.getElementById("rewardToday1_content"); |
| | | rewardToday1_content.text("Complete " + driverActivityOrder.getOrderNum() + " orders in total today to get event rewards. Note that this event is time-limited, please check the I-GO platform for details."); |
| | | } |
| | | if (3 == language) { |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("invite2").attr("style", "display: none;"); |
| | | document1.getElementById("user2").attr("style", "display: none;"); |
| | | document1.getElementById("settle2").attr("style", "display: none;"); |
| | | document1.getElementById("pass2").attr("style", "display: none;"); |
| | | document1.getElementById("email2").attr("style", "display: none;"); |
| | | document1.getElementById("bill2").attr("style", "display: none;"); |
| | | document1.getElementById("reward2").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit2").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit2").attr("style", "display: none;"); |
| | | |
| | | Element rewardToday2_user = document1.getElementById("rewardToday2_user"); |
| | | rewardToday2_user.text("Bonjour " + driver.getName() + ","); |
| | | Element rewardToday2_award = document1.getElementById("rewardToday2_award"); |
| | | rewardToday2_award.text("Bonus GHS " + driverActivityHistory.getMoney()); |
| | | Element rewardToday2_content = document1.getElementById("rewardToday2_content"); |
| | | rewardToday2_content.text("Effectuez " + driverActivityOrder.getOrderNum() + " commandes au total aujourd’hui pour obtenir des récompenses d’événement. Notez que cet événement est limité dans le temps, veuillez consulter la plateforme I-GO pour plus de détails."); |
| | | } |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "今日活动" : language == 2 ? "today's activity" : "l'événement d'aujourd'hui", document1.html()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public void taskMinute() throws Exception { |
| | | Map<String, Date> date = dateUtil.getStartAndEndDate(new Date()); |
| | | Integer language = 1; |
| | | //在线时长 |
| | | List<DriverActivityHistory> list = driverActivityHistoryMapper.queryList(null, 3, 1, date.get("startTime"), date.get("endTime")); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | for(DriverActivityHistory dah : list){ |
| | | DriverActivityOnline dao = driverActivityOnlineMapper.selectById(dah.getActivityId()); |
| | | List<DriverWork> query = driverWorkMapper.query(dao.getType(), dao.getOnline());//满足活动条件的数据 |
| | | for(DriverWork dw : query){ |
| | | if(dah.getDriverId().compareTo(dw.getDriverId()) == 0){ |
| | | Long duration = Long.valueOf(dao.getOnline() * 60 * 60 * 1000); |
| | | List<DriverOnline> driverOnlines = driverOnlineMapper.queryList(sdf.format(new Date()), duration); |
| | | for (DriverOnline driverOnline : driverOnlines) { |
| | | if(dah.getDriverId().compareTo(driverOnline.getDriverId()) == 0){ |
| | | dah.setCarryOut(2);//完成状态 |
| | | driverActivityHistoryMapper.updateById(dah); |
| | | //修改余额 |
| | |
| | | this.updateById(driver); |
| | | |
| | | //添加收入记录 |
| | | incomeService.saveData(2, dw.getDriverId(), 1, dao.getId(), null, dah.getMoney()); |
| | | incomeService.saveData(2, driverOnline.getDriverId(), 1, dao.getId(), null, dah.getMoney()); |
| | | |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())) { |
| | | String path1 = templatePath + "index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if (1 == language) { |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite").attr("style", "display: none;"); |
| | | document1.getElementById("user").attr("style", "display: none;"); |
| | | document1.getElementById("settle").attr("style", "display: none;"); |
| | | document1.getElementById("pass").attr("style", "display: none;"); |
| | | document1.getElementById("email").attr("style", "display: none;"); |
| | | document1.getElementById("bill").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit").attr("style", "display: none;"); |
| | | |
| | | Element reward_user = document1.getElementById("reward_user"); |
| | | reward_user.text("您好 " + driver.getName() + ","); |
| | | Element reward_content = document1.getElementById("reward_content"); |
| | | reward_content.text("今日累计在线 " + dao.getOnline() + "小时,获得奖励GHS" + dah.getMoney() + ",请查收"); |
| | | } |
| | | if (2 == language) { |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite1").attr("style", "display: none;"); |
| | | document1.getElementById("user1").attr("style", "display: none;"); |
| | | document1.getElementById("settle1").attr("style", "display: none;"); |
| | | document1.getElementById("pass1").attr("style", "display: none;"); |
| | | document1.getElementById("email1").attr("style", "display: none;"); |
| | | document1.getElementById("bill1").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday1").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit1").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit1").attr("style", "display: none;"); |
| | | |
| | | Element reward1_user = document1.getElementById("reward1_user"); |
| | | reward1_user.text("Hello " + driver.getName() + ","); |
| | | Element reward1_content = document1.getElementById("reward1_content"); |
| | | reward1_content.text("accumulated online for " + dao.getOnline() + " hour today, get reward GHS" + dah.getMoney() + ", please check"); |
| | | } |
| | | if (3 == language) { |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("invite2").attr("style", "display: none;"); |
| | | document1.getElementById("user2").attr("style", "display: none;"); |
| | | document1.getElementById("settle2").attr("style", "display: none;"); |
| | | document1.getElementById("pass2").attr("style", "display: none;"); |
| | | document1.getElementById("email2").attr("style", "display: none;"); |
| | | document1.getElementById("bill2").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday2").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit2").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit2").attr("style", "display: none;"); |
| | | |
| | | Element reward2_user = document1.getElementById("reward2_user"); |
| | | reward2_user.text("Bonjour " + driver.getName() + ","); |
| | | Element reward2_content = document1.getElementById("reward2_content"); |
| | | reward2_content.text("Accumulé en ligne pendant " + dao.getOnline() + " heure aujourd’hui, obtenez la récompense GHS " + dah.getMoney() + ", s’il vous plaît vérifier"); |
| | | } |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "在线时长奖励" : language == 2 ? "Online Time Rewards" : "Récompenses de temps en ligne", document1.html()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | //添加收入记录 |
| | | incomeService.saveData(2, dah.getDriverId(), 1, dao.getId(), null, dah.getMoney()); |
| | | |
| | | if(ToolUtil.isNotEmpty(driver.getEmail())) { |
| | | String path1 = templatePath + "index.html"; |
| | | Document document1 = Jsoup.parse(new File(path1), "UTF-8"); |
| | | if (1 == language) { |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite").attr("style", "display: none;"); |
| | | document1.getElementById("user").attr("style", "display: none;"); |
| | | document1.getElementById("settle").attr("style", "display: none;"); |
| | | document1.getElementById("pass").attr("style", "display: none;"); |
| | | document1.getElementById("email").attr("style", "display: none;"); |
| | | document1.getElementById("bill").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit").attr("style", "display: none;"); |
| | | |
| | | Element reward_user = document1.getElementById("reward_user"); |
| | | reward_user.text("您好 " + driver.getName() + ","); |
| | | Element reward_content = document1.getElementById("reward_content"); |
| | | reward_content.text("今日累计接单 " + dao.getOrderNum() + "单,获得奖励GHS" + dah.getMoney() + ",请查收"); |
| | | } |
| | | if (2 == language) { |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("french").attr("style", "display: none;"); |
| | | document1.getElementById("invite1").attr("style", "display: none;"); |
| | | document1.getElementById("user1").attr("style", "display: none;"); |
| | | document1.getElementById("settle1").attr("style", "display: none;"); |
| | | document1.getElementById("pass1").attr("style", "display: none;"); |
| | | document1.getElementById("email1").attr("style", "display: none;"); |
| | | document1.getElementById("bill1").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday1").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit1").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit1").attr("style", "display: none;"); |
| | | |
| | | Element reward1_user = document1.getElementById("reward1_user"); |
| | | reward1_user.text("Hello " + driver.getName() + ","); |
| | | Element reward1_content = document1.getElementById("reward1_content"); |
| | | reward1_content.text("A total of " + dao.getOrderNum() + " orders have been received today, and the reward GHS" + dah.getMoney() + " will be awarded, please check"); |
| | | } |
| | | if (3 == language) { |
| | | document1.getElementById("chinese").attr("style", "display: none;"); |
| | | document1.getElementById("english").attr("style", "display: none;"); |
| | | document1.getElementById("invite2").attr("style", "display: none;"); |
| | | document1.getElementById("user2").attr("style", "display: none;"); |
| | | document1.getElementById("settle2").attr("style", "display: none;"); |
| | | document1.getElementById("pass2").attr("style", "display: none;"); |
| | | document1.getElementById("email2").attr("style", "display: none;"); |
| | | document1.getElementById("bill2").attr("style", "display: none;"); |
| | | document1.getElementById("rewardToday2").attr("style", "display: none;"); |
| | | document1.getElementById("driverAudit2").attr("style", "display: none;"); |
| | | document1.getElementById("carAudit2").attr("style", "display: none;"); |
| | | |
| | | Element reward2_user = document1.getElementById("reward2_user"); |
| | | reward2_user.text("Bonjour " + driver.getName() + ","); |
| | | Element reward2_content = document1.getElementById("reward2_content"); |
| | | reward2_content.text("Un total de " + dao.getOrderNum() + " commandes ont été reçues aujourd’hui, et la récompense GHS " + dah.getMoney() + " sera décernée, s’il vous plaît vérifier"); |
| | | } |
| | | EmailUtil.send(driver.getEmail(), language == 1 ? "累计接单奖励" : language == 2 ? "Cumulative Order Rewards" : "Récompenses de commande cumulées", document1.html()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | break; |
| | | case 3://城际 |
| | | break; |
| | | case 4://同城小件物流 |
| | | case 4://市内小件物流 |
| | | List<OrderLogistics> query2 = orderLogisticsService.query(null, 1);//待接订单 |
| | | for(OrderLogistics orderLogistics : query2){ |
| | | String order = orderLogistics.getStartLon() + "," + orderLogistics.getStartLat(); |
| | |
| | | @Autowired |
| | | private IOrderService orderService; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | |
| | | @Value("${filePath}") |
| | | private String filePath; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | |
| | | |
| | |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport && orderPosition.getOrderType() == 1){//上传数据 |
| | | pushMinistryOfTransportUtil.positionDriver(orderPosition.getOrderId()); |
| | | pushMinistryOfTransportUtil.positionVehicle(orderPosition.getOrderId()); |
| | | } |
| | | } |
| | | }).start(); |
| | | |
| | | } |
| | | |
| | |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IOrderService; |
| | | import com.stylefeng.guns.modular.system.service.ISystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.service.ITransactionDetailsService; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.warpper.OrderListWarpper; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | |
| | | |
| | | |
| | |
| | | Integer orderSource = Integer.valueOf(String.valueOf(map.get("orderSource"))); |
| | | if(orderSource == 1 || orderSource == 2 || orderSource == 3){ |
| | | if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 1 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | map.put("type", "乘客下单"); |
| | | map.put("type", "乘客创建"); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 1 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | map.put("type", "改派"); |
| | |
| | | } |
| | | if(orderSource == 5){ |
| | | if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 1 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | map.put("type", "调度下单"); |
| | | map.put("type", "调度创建"); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 1 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | map.put("type", "改派"); |
| | |
| | | // } |
| | | // } |
| | | break; |
| | | case 4://同城小件物流 |
| | | case 4://市内小件物流 |
| | | map = orderLogisticsService.queryPushOrder(orderId); |
| | | DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(Double.valueOf(map.get("startLat").toString()), Double.valueOf(map.get("startLon").toString()), Double.valueOf(lat), Double.valueOf(lon)); |
| | | map.put("startDistance", null != distancematrix1 ? distancematrix1.getDistance() / 1000 : 0); |
| | |
| | | Integer orderSource3 = Integer.valueOf(String.valueOf(map.get("orderSource"))); |
| | | if(orderSource3 == 1 || orderSource3 == 2 || orderSource3 == 3){ |
| | | if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | map.put("type", "乘客下单"); |
| | | map.put("type", "乘客创建"); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | map.put("type", "改派"); |
| | |
| | | } |
| | | if(orderSource3 == 5){ |
| | | if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 1){ |
| | | map.put("type", "调度下单"); |
| | | map.put("type", "调度创建"); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | map.put("type", "改派"); |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil process(Integer orderId, Integer orderType, Integer state, Integer uid, Double lon, Double lat,String phone) throws Exception { |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(String.valueOf(lon), String.valueOf(lat)); |
| | | String address = geocode.get("address"); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lon); |
| | | if(null == reverseGeocode){ |
| | | return ResultUtil.error("无效的经纬度"); |
| | | } |
| | | String address = reverseGeocode.getAddress(); |
| | | switch (orderType){ |
| | | case 1://专车 |
| | | return orderPrivateCarService.process(orderId, state, lon, lat, address,phone); |
| | |
| | | driverId = orderPrivateCar.getDriverId(); |
| | | state = orderPrivateCar.getState(); |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.operatePay(orderId); |
| | | } |
| | | } |
| | | }).start(); |
| | | break; |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | |
| | | orderPrivateCarService.updateBatchById(orderList); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public ResultUtil payOrder(Integer uid, Integer orderId, Integer orderType, Integer payType, Integer language) throws Exception { |
| | | Double money = 0D; |
| | | if(orderType == 1){//专车 |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | money = orderPrivateCar.getPayMoney(); |
| | | if(orderPrivateCar.getPayType() != 4){ |
| | | return ResultUtil.error(language == 1 ? "无法进行支付" : language == 2 ? "Unable to pay" : "Impossibilité de procéder au paiement"); |
| | | } |
| | | if(orderPrivateCar.getDriverPay() == 2){ |
| | | return ResultUtil.error(language == 1 ? "不能重复支付" : language == 2 ? "Non-repeatable payment" : "Aucun paiement en double"); |
| | | } |
| | | if(payType == 2){//余额支付 |
| | | Driver driver = driverService.selectById(uid); |
| | | if(driver.getBalance().compareTo(money) < 0){ |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient account balance" : "Solde insuffisant du compte"); |
| | | } |
| | | } |
| | | orderPrivateCar.setDriverPay(2); |
| | | orderPrivateCarService.updateById(orderPrivateCar); |
| | | } |
| | | if(orderType == 4){//小件 |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | money = orderLogistics.getPayMoney(); |
| | | if(orderLogistics.getPayType() != 4){ |
| | | return ResultUtil.error(language == 1 ? "无法进行支付" : language == 2 ? "Unable to pay" : "Impossibilité de procéder au paiement"); |
| | | } |
| | | if(orderLogistics.getDriverPay() == 2){ |
| | | return ResultUtil.error(language == 1 ? "不能重复支付" : language == 2 ? "Non-repeatable payment" : "Aucun paiement en double"); |
| | | } |
| | | if(payType == 2){//余额支付 |
| | | Driver driver = driverService.selectById(uid); |
| | | if(driver.getBalance().compareTo(money) < 0){ |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient account balance" : "Solde insuffisant du compte"); |
| | | } |
| | | } |
| | | orderLogistics.setDriverPay(2); |
| | | orderLogisticsService.updateById(orderLogistics); |
| | | } |
| | | |
| | | if(0 < money){ |
| | | if(payType == 1){//线上支付 |
| | | |
| | | } |
| | | if(payType == 2){//余额支付 |
| | | Driver driver = driverService.selectById(uid); |
| | | driver.setBalance(driver.getBalance() - money); |
| | | if(driver.getLaveBusinessMoney().compareTo(money) < 0){ |
| | | double b = money - driver.getLaveBusinessMoney(); |
| | | driver.setLaveBusinessMoney(0D); |
| | | driver.setLaveActivityMoney(driver.getLaveActivityMoney() - b); |
| | | driverService.updateById(driver); |
| | | }else{ |
| | | driver.setLaveBusinessMoney(driver.getLaveBusinessMoney() - money); |
| | | driverService.updateById(driver); |
| | | } |
| | | } |
| | | |
| | | transactionDetailsService.saveData(uid, "现金收款代付", money, 2, 1, 2, orderType, orderId); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil saveData(Reassign reassign, Integer uid, Integer type) throws Exception { |
| | | type = null == type ? 2 : type;//现目前微信只支持小程序支付 |
| | | String content = reassign.getRemark(); |
| | | if(ToolUtil.isNotEmpty(content)){ |
| | | List<SensitiveWords> sensitiveWords = sensitiveWordsMapper.selectList(null); |
| | |
| | | reassign.setRemark(content); |
| | | ResultUtil resultUtil = ResultUtil.success(); |
| | | Driver driver = driverService.selectById(uid); |
| | | // TODO: 2020/11/12 司机端不控制重复提交(如果重复提交且未支付,直接将之前的数据删除) |
| | | // Reassign query = reassignMapper.query(uid, null, null, null, 1); |
| | | // if(null != query){ |
| | | // return ResultUtil.error("有未完成支付的改派申请"); |
| | | // } |
| | | Reassign query = reassignMapper.query(uid, null, reassign.getOrderId(), reassign.getOrderType(), 1); |
| | | if(null != query){ |
| | | // return ResultUtil.error("不能重复提交申请"); |
| | | reassignMapper.deleteById(query.getId()); |
| | | } |
| | | query = reassignMapper.query(uid, null, reassign.getOrderId(), reassign.getOrderType(), 2); |
| | |
| | | } |
| | | |
| | | //获取支付金额 |
| | | Double aDouble = orderService.queryReassignMoney(reassign.getOrderId(), reassign.getOrderType()); |
| | | reassign.setMoney(aDouble); |
| | | reassign.setOriginalDriverId(uid); |
| | | reassign.setOriginalCarId(driver.getCarId()); |
| | | reassign.setInsertTime(new Date()); |
| | | this.insert(reassign); |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您的改派申请已成功提交,我们会尽快为你处理!", uid); |
| | | |
| | | //开始支付 |
| | | if(null != reassign.getPayType()){ |
| | | if(reassign.getPayType() == 1){//微信支付 |
| | | reassign.setState(1); |
| | | ResultUtil resultUtil1 = payMoneyUtil.weixinpay("改派订单",reassign.getId()+"",reassign.getId() + "_" + reassign.getOrderType(),aDouble+"","/base/wxReassign","APP"); |
| | | //Map<String, String> map = icbcPayUtil.placeAnOrder(reassign.getId() + "_" + reassign.getOrderType(), 9, 5, uid.toString(), "改派订单", aDouble, callbackPath + "/base/wxReassign", "", type, driver.getAppletsOpenId()); |
| | | if(resultUtil1.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, reassign.getOrderId(), reassign.getOrderType(), 1, aDouble, null, 1);//添加预支付数据 |
| | | resultUtil = resultUtil1; |
| | | }else{ |
| | | resultUtil = ResultUtil.error("获取支付信息失败", ""); |
| | | } |
| | | } |
| | | if(reassign.getPayType() == 2){//支付宝 |
| | | reassign.setState(1); |
| | | ResultUtil resultUtil1 = payMoneyUtil.alipay("改派订单","改派订单",reassign.getId() + "_" + reassign.getOrderType(),aDouble+"","/base/aliReassign"); |
| | | //Map<String, String> map = icbcPayUtil.placeAnOrder(reassign.getId() + "_" + reassign.getOrderType(), 10, 5, uid.toString(), "改派订单", aDouble, callbackPath + "/base/aliReassign", "", 2, ""); |
| | | if(resultUtil1.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, reassign.getOrderId(), reassign.getOrderType(), 2, aDouble, null, 1);//添加预支付数据 |
| | | resultUtil = resultUtil1; |
| | | }else{ |
| | | resultUtil = ResultUtil.error("获取支付信息失败", ""); |
| | | } |
| | | } |
| | | if(reassign.getPayType() == 3){//余额 |
| | | reassign.setState(2); |
| | | reassign.setPayTime(new Date()); |
| | | reassignMapper.updateById(reassign); |
| | | |
| | | Double balance = driver.getBalance(); |
| | | Double laveBusinessMoney = driver.getLaveBusinessMoney(); |
| | | Double laveActivityMoney = driver.getLaveActivityMoney(); |
| | | if(null == balance || balance < aDouble){ |
| | | throw new SystemException("账户余额不足"); |
| | | } |
| | | if(null != laveBusinessMoney && laveBusinessMoney.compareTo(aDouble) >= 0){ |
| | | driver.setLaveBusinessMoney(new BigDecimal(laveBusinessMoney).subtract(new BigDecimal(aDouble)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | }else if(null != laveActivityMoney && laveActivityMoney.compareTo(aDouble) >= 0){ |
| | | driver.setLaveActivityMoney(new BigDecimal(laveActivityMoney).subtract(new BigDecimal(aDouble)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | } |
| | | driver.setBalance(new BigDecimal(balance).subtract(new BigDecimal(aDouble)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "司机改派支付", aDouble, 2, 1, 2, reassign.getOrderType(), reassign.getOrderId()); |
| | | |
| | | this.insert(reassign); |
| | | |
| | | //修改改派通知状态 |
| | | switch (reassign.getOrderType()){ |
| | |
| | | orderPrivateCar.setState(11); |
| | | orderPrivateCar.setReassignNotice(2); |
| | | orderPrivateCarService.updateById(orderPrivateCar); |
| | | |
| | | //添加已收入明细 |
| | | incomeService.saveData(1, orderPrivateCar.getCompanyId(), 4, orderPrivateCar.getId(), 1, reassign.getMoney()); |
| | | break; |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(reassign.getOrderId()); |
| | |
| | | orderTaxi.setState(11); |
| | | orderTaxi.setReassignNotice(2); |
| | | orderTaxiService.updateById(orderTaxi); |
| | | |
| | | //添加已收入明细 |
| | | incomeService.saveData(1, orderTaxi.getCompanyId(), 4, orderTaxi.getId(), 2, reassign.getMoney()); |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(reassign.getOrderId()); |
| | |
| | | orderLogistics.setState(11); |
| | | orderLogistics.setReassignNotice(2); |
| | | orderLogisticsService.updateById(orderLogistics); |
| | | |
| | | //添加已收入明细 |
| | | incomeService.saveData(1, orderLogistics.getCompanyId(), 4, orderLogistics.getId(), orderLogistics.getType(), reassign.getMoney()); |
| | | break; |
| | | case 5: |
| | | OrderLogistics orderLogistics1 = orderLogisticsService.selectById(reassign.getOrderId()); |
| | |
| | | orderLogistics1.setState(11); |
| | | orderLogistics1.setReassignNotice(2); |
| | | orderLogisticsService.updateById(orderLogistics1); |
| | | |
| | | //添加已收入明细 |
| | | incomeService.saveData(1, orderLogistics1.getCompanyId(), 4, orderLogistics1.getId(), orderLogistics1.getType(), reassign.getMoney()); |
| | | break; |
| | | } |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您已使用余额成功支付改派申请费用!", uid); |
| | | //开始推送调度单 |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("orderId", reassign.getOrderId().toString()); |
| | |
| | | for(Dispatch dispatch : dispatches){ |
| | | jgPushUtil.push(2,"有新的改派订单需要处理,请及时处理!", "订单改派", map, "DISPATCH" + dispatch.getId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您的改派申请已成功提交,我们会尽快为你处理!", uid); |
| | | |
| | | return resultUtil; |
| | | } |
| | | |
| | |
| | | //withdrawal.setSerialNo(transfer.getData());//交易序列号 |
| | | withdrawal.setState(2); |
| | | this.updateById(withdrawal); |
| | | /*}else{ |
| | | return transfer; |
| | | }*/ |
| | | // }else{ |
| | | // return transfer; |
| | | // } |
| | | |
| | | |
| | | // TimerTask timerTask = new TimerTask() { |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import javax.mail.*; |
| | | import javax.mail.Authenticator; |
| | | import javax.mail.PasswordAuthentication; |
| | | import javax.mail.Session; |
| | | import javax.mail.Transport; |
| | | import javax.mail.internet.InternetAddress; |
| | | import javax.mail.internet.MimeBodyPart; |
| | | import javax.mail.internet.MimeMessage; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 创建邮件内容 需科学上网 |
| | | * 创建邮件内容 |
| | | * |
| | | * @param sentToEmail 接收人邮箱 |
| | | * @param subject 设置邮件主题 |
| | | * @param content 内容 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static boolean getMimeMessage(String sentToEmail, String subject, String content) throws Exception { |
| | | public static boolean send(String sentToEmail, String subject, String content) throws Exception { |
| | | //1.创建一封邮件的实例对象 |
| | | Properties props = new Properties(); |
| | | //选择ssl方式 |
| | | gmailssl(props); |
| | | |
| | | final String username = "southwindservice@gmail.com";// gmail 邮箱 |
| | | final String password = "irkgrsuzxgmwrxzy";// Google应用专用密码 |
| | | final String password = "ogsntijmguisoiuk";// Google应用专用密码 |
| | | // 当做多商户的时候需要使用getInstance, 如果只是一个邮箱发送的话就用getDefaultInstance |
| | | // Session.getDefaultInstance 会将username,password保存在session会话中 |
| | | // Session.getInstance 不进行保存 |
| | |
| | | |
| | | Transport.send(msg); |
| | | return true; |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | boolean mimeMessage = getMimeMessage("393733352@qq.com", "测试内容", "这是一段测试内容"); |
| | | System.out.println(mimeMessage); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | |
| | | import javax.net.ssl.*; |
| | | import java.io.*; |
| | | import java.net.URL; |
| | | import java.net.URLEncoder; |
| | | import java.security.MessageDigest; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.security.cert.CertificateException; |
| | | import java.security.cert.X509Certificate; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | public class SMSUtil { |
| | | |
| | | //无需修改,用于格式化鉴权头域,给"X-WSSE"参数赋值 |
| | | private static final String WSSE_HEADER_FORMAT = "UsernameToken Username=\"%s\",PasswordDigest=\"%s\",Nonce=\"%s\",Created=\"%s\""; |
| | | //无需修改,用于格式化鉴权头域,给"Authorization"参数赋值 |
| | | private static final String AUTH_HEADER_VALUE = "WSSE realm=\"SDP\",profile=\"UsernameToken\",type=\"Appkey\""; |
| | | |
| | | /** |
| | | * 发送短信(华为云) |
| | | * @param templateId 模板id |
| | | * @param receiver 必填,全局号码格式(包含国家码),示例:+8615123456789,多个号码之间用英文逗号分隔 |
| | | * @param templateParas 选填,使用无变量模板时请赋空值 String templateParas = "",双变量模板示例:模板内容为"您有${1}件快递请到${2}领取"时,templateParas可填写为"[\"3\",\"人民公园正门\"]" |
| | | * 模板变量,此处以单变量验证码短信为例,请客户自行生成6位验证码,并定义为字符串类型,以杜绝首位0丢失的问题(例如:002569变成了2569) |
| | | * @throws Exception |
| | | */ |
| | | public static void send_huawei_sms(String templateId, String receiver, String templateParas) throws Exception { |
| | | |
| | | //必填,请参考"开发准备"获取如下数据,替换为实际值 |
| | | String url = "https://smsapi.cn-south-1.myhuaweicloud.com:443"; //APP接入地址(在控制台"应用管理"页面获取)+接口访问URI |
| | | String appKey = "g3DW0G5Fbp3110UiGl5fkWcn799s"; //APP_Key |
| | | String appSecret = "LaT1NYvQKNkHO5KikniEueN8iTaz"; //APP_Secret |
| | | String sender = "ismsapp0000000103"; //国内短信签名通道号或国际/港澳台短信通道号 |
| | | |
| | | //条件必填,国内短信关注,当templateId指定的模板类型为通用模板时生效且必填,必须是已审核通过的,与模板类型一致的签名名称 |
| | | //国际/港澳台短信不用关注该参数 |
| | | String signature = "IGO"; //签名名称 |
| | | |
| | | //选填,短信状态报告接收地址,推荐使用域名,为空或者不填表示不接收状态报告 |
| | | String statusCallBack = ""; |
| | | |
| | | //请求Body,不携带签名名称时,signature请填null |
| | | String body = buildRequestBody(sender, receiver, templateId, templateParas, statusCallBack, signature); |
| | | if (null == body || body.isEmpty()) { |
| | | System.out.println("body is null."); |
| | | return; |
| | | } |
| | | |
| | | //请求Headers中的X-WSSE参数值 |
| | | String wsseHeader = buildWsseHeader(appKey, appSecret); |
| | | if (null == wsseHeader || wsseHeader.isEmpty()) { |
| | | System.out.println("wsse header is null."); |
| | | return; |
| | | } |
| | | |
| | | Writer out = null; |
| | | BufferedReader in = null; |
| | | StringBuffer result = new StringBuffer(); |
| | | HttpsURLConnection connection = null; |
| | | InputStream is = null; |
| | | |
| | | |
| | | HostnameVerifier hv = new HostnameVerifier() { |
| | | |
| | | @Override |
| | | public boolean verify(String hostname, SSLSession session) { |
| | | return true; |
| | | } |
| | | }; |
| | | trustAllHttpsCertificates(); |
| | | |
| | | try { |
| | | URL realUrl = new URL(url); |
| | | connection = (HttpsURLConnection) realUrl.openConnection(); |
| | | |
| | | connection.setHostnameVerifier(hv); |
| | | connection.setDoOutput(true); |
| | | connection.setDoInput(true); |
| | | connection.setUseCaches(true); |
| | | //请求方法 |
| | | connection.setRequestMethod("POST"); |
| | | //请求Headers参数 |
| | | connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); |
| | | connection.setRequestProperty("Authorization", AUTH_HEADER_VALUE); |
| | | connection.setRequestProperty("X-WSSE", wsseHeader); |
| | | |
| | | connection.connect(); |
| | | out = new OutputStreamWriter(connection.getOutputStream()); |
| | | out.write(body); //发送请求Body参数 |
| | | out.flush(); |
| | | out.close(); |
| | | |
| | | int status = connection.getResponseCode(); |
| | | if (200 == status) { //200 |
| | | is = connection.getInputStream(); |
| | | } else { //400/401 |
| | | is = connection.getErrorStream(); |
| | | } |
| | | in = new BufferedReader(new InputStreamReader(is, "UTF-8")); |
| | | String line = ""; |
| | | while ((line = in.readLine()) != null) { |
| | | result.append(line); |
| | | } |
| | | System.out.println(result.toString()); //打印响应消息实体 |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | if (null != out) { |
| | | out.close(); |
| | | } |
| | | if (null != is) { |
| | | is.close(); |
| | | } |
| | | if (null != in) { |
| | | in.close(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 构造请求Body体 |
| | | * @param sender |
| | | * @param receiver |
| | | * @param templateId |
| | | * @param templateParas |
| | | * @param statusCallBack |
| | | * @param signature | 签名名称,使用国内短信通用模板时填写 |
| | | * @return |
| | | */ |
| | | static String buildRequestBody(String sender, String receiver, String templateId, String templateParas, |
| | | String statusCallBack, String signature) { |
| | | if (null == sender || null == receiver || null == templateId || sender.isEmpty() || receiver.isEmpty() |
| | | || templateId.isEmpty()) { |
| | | System.out.println("buildRequestBody(): sender, receiver or templateId is null."); |
| | | return null; |
| | | } |
| | | Map<String, String> map = new HashMap<String, String>(); |
| | | |
| | | map.put("from", sender); |
| | | map.put("to", receiver); |
| | | map.put("templateId", templateId); |
| | | if (null != templateParas && !templateParas.isEmpty()) { |
| | | map.put("templateParas", templateParas); |
| | | } |
| | | if (null != statusCallBack && !statusCallBack.isEmpty()) { |
| | | map.put("statusCallback", statusCallBack); |
| | | } |
| | | if (null != signature && !signature.isEmpty()) { |
| | | map.put("signature", signature); |
| | | } |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | String temp = ""; |
| | | |
| | | for (String s : map.keySet()) { |
| | | try { |
| | | temp = URLEncoder.encode(map.get(s), "UTF-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | sb.append(s).append("=").append(temp).append("&"); |
| | | } |
| | | |
| | | return sb.deleteCharAt(sb.length()-1).toString(); |
| | | } |
| | | |
| | | /** |
| | | * 构造X-WSSE参数值 |
| | | * @param appKey |
| | | * @param appSecret |
| | | * @return |
| | | */ |
| | | static String buildWsseHeader(String appKey, String appSecret) { |
| | | if (null == appKey || null == appSecret || appKey.isEmpty() || appSecret.isEmpty()) { |
| | | System.out.println("buildWsseHeader(): appKey or appSecret is null."); |
| | | return null; |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); |
| | | String time = sdf.format(new Date()); //Created |
| | | String nonce = UUID.randomUUID().toString().replace("-", ""); //Nonce |
| | | |
| | | MessageDigest md; |
| | | byte[] passwordDigest = null; |
| | | |
| | | try { |
| | | md = MessageDigest.getInstance("SHA-256"); |
| | | md.update((nonce + time + appSecret).getBytes()); |
| | | passwordDigest = md.digest(); |
| | | } catch (NoSuchAlgorithmException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | //如果JDK版本是1.8,请加载原生Base64类,并使用如下代码 |
| | | String passwordDigestBase64Str = Base64.getEncoder().encodeToString(passwordDigest); //PasswordDigest |
| | | //如果JDK版本低于1.8,请加载三方库提供Base64类,并使用如下代码 |
| | | //String passwordDigestBase64Str = Base64.encodeBase64String(passwordDigest); //PasswordDigest |
| | | //若passwordDigestBase64Str中包含换行符,请执行如下代码进行修正 |
| | | //passwordDigestBase64Str = passwordDigestBase64Str.replaceAll("[\\s*\t\n\r]", ""); |
| | | return String.format(WSSE_HEADER_FORMAT, appKey, passwordDigestBase64Str, nonce, time); |
| | | } |
| | | |
| | | /*** @throws Exception |
| | | */ |
| | | static void trustAllHttpsCertificates() throws Exception { |
| | | TrustManager[] trustAllCerts = new TrustManager[] { |
| | | new X509TrustManager() { |
| | | public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { |
| | | return; |
| | | } |
| | | public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { |
| | | return; |
| | | } |
| | | public X509Certificate[] getAcceptedIssuers() { |
| | | return null; |
| | | } |
| | | } |
| | | }; |
| | | SSLContext sc = SSLContext.getInstance("SSL"); |
| | | sc.init(null, trustAllCerts, null); |
| | | HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.Tingg; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.Tingg.model.CheckoutRequest; |
| | | import io.cellulant.model.Payload; |
| | | import io.cellulant.service.CheckoutEncryption; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * Tingg支付工具类 |
| | | */ |
| | | public class TinggPayUtil { |
| | | |
| | | private static String accessKey = "KxjPP444jEE7K88E7juej4PKqqzKq7qKjKj84q744q9zj4Ej4zK47uj4KKj4"; |
| | | |
| | | private static String ivKey = "qsffKsCOJJdhSBCQ"; |
| | | |
| | | private static String secretKey = "9jjz4Ex74P8ue4qK"; |
| | | |
| | | |
| | | /** |
| | | * 获取支付数据 |
| | | * @param checkoutRequest |
| | | * @return |
| | | */ |
| | | public static ResultUtil checkoutRequest(CheckoutRequest checkoutRequest){ |
| | | try { |
| | | CheckoutEncryption checkoutEncrption = new CheckoutEncryption(ivKey, secretKey); |
| | | Payload payload = getPayload(checkoutRequest); |
| | | String param = checkoutEncrption.encrypt(payload); |
| | | System.out.println("Encrpted payload=" + param); |
| | | String url = "https://online.uat.tingg.africa/testing/express/checkout?encrypted_payload=" + param + "&access_key=" + accessKey; |
| | | return ResultUtil.success(url); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public static Payload getPayload(CheckoutRequest checkoutRequest) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String countryCode="GHA";//收取付款的国家的3位ISO代码 |
| | | String currencyCode = "GHS";//3位ISO代码的货币,商家正在开发票。 |
| | | String serviceCode="IGOGHANA";//服务代码 |
| | | String dueDate = sdf.format(new Date(System.currentTimeMillis() + 1800000));//到期时间 |
| | | String languageCode="EN"; |
| | | String paymentOptionCode = "";//支付选项码 |
| | | |
| | | Payload payload = new Payload(checkoutRequest.getMerchantTransactionId(), checkoutRequest.getCustomerFirstName(), checkoutRequest.getCustomerLastName(), checkoutRequest.getMsisdn(), checkoutRequest.getCustomerEmail(), |
| | | checkoutRequest.getRequestAmount(), currencyCode, checkoutRequest.getAccountNumber(), serviceCode, dueDate, checkoutRequest.getRequestDescription(), |
| | | countryCode, languageCode, paymentOptionCode, checkoutRequest.getSuccessRedirectUrl(), checkoutRequest.getFailRedirectUrl(), checkoutRequest.getPendingRedirectUrl(), checkoutRequest.getCallbackUrl()); |
| | | return payload; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] ages){ |
| | | CheckoutRequest checkoutRequest = new CheckoutRequest(); |
| | | checkoutRequest.setMsisdn(233240000000L); |
| | | checkoutRequest.setCustomerEmail("393733352@qq.com"); |
| | | checkoutRequest.setAccountNumber("4111111111111111"); |
| | | checkoutRequest.setCustomerFirstName("zhibing"); |
| | | checkoutRequest.setCustomerLastName("pu"); |
| | | checkoutRequest.setRequestAmount(1.00D); |
| | | checkoutRequest.setMerchantTransactionId("123456T"); |
| | | checkoutRequest.setRequestDescription("payment test"); |
| | | checkoutRequest.setCallbackUrl("https://10pz685243.zicp.fun"); |
| | | checkoutRequest.setPendingRedirectUrl("https://10pz685243.zicp.fun"); |
| | | checkoutRequest.setSuccessRedirectUrl("https://10pz685243.zicp.fun"); |
| | | checkoutRequest.setFailRedirectUrl("https://www.baidu.com"); |
| | | ResultUtil resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | System.err.println(JSON.toJSONString(resultUtil)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.Tingg.model; |
| | | |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 支付回调 |
| | | */ |
| | | public class CallbackRequest { |
| | | /** |
| | | * Cellulant末端的唯一标识符。 |
| | | */ |
| | | private Long checkout_request_id; |
| | | /** |
| | | * 商家单号 |
| | | */ |
| | | private String merchant_transaction_id; |
| | | /** |
| | | * 支付金额 |
| | | */ |
| | | private Double request_amount; |
| | | /** |
| | | * 由商家以发票货币提出的原始请求金额 |
| | | */ |
| | | private Double original_request_amount; |
| | | /** |
| | | * 为客户支付的请求转换的货币。 |
| | | */ |
| | | private String request_currency_code; |
| | | /** |
| | | * 商家在ISO代码中提出要求的货币代码。 |
| | | */ |
| | | private String original_request_currency_code; |
| | | /** |
| | | * 支付账户。 |
| | | */ |
| | | private String account_number; |
| | | /** |
| | | * 所支付的ISO货币代码 |
| | | */ |
| | | private String currency_code; |
| | | /** |
| | | * 客户为请求支付的金额。 |
| | | */ |
| | | private Double amount_paid; |
| | | /** |
| | | * 为发起的请求添加到服务中的费用。 |
| | | */ |
| | | private Double service_charge_amount; |
| | | /** |
| | | * 提出请求的日期。 |
| | | */ |
| | | private Date request_date; |
| | | /** |
| | | * 唯一的服务代码,用于标识引发支付请求的服务。 |
| | | */ |
| | | private String service_code; |
| | | /** |
| | | * 指示服务是否成功或付费的总体请求代码。。 |
| | | * 177-部分付费请求 |
| | | * 178-表明请求已全额支付 |
| | | * 179-表示请求已部分支付但已过期。 |
| | | * 129-请求已过期,未付款。 |
| | | * 180.商户拒绝请求 |
| | | * 183-商户接受请求,我们可以结算资金 |
| | | * 188-商户收到请求。 |
| | | */ |
| | | private String request_status_code; |
| | | /** |
| | | * webhook请求返回的状态描述。 |
| | | */ |
| | | private String request_status_description; |
| | | /** |
| | | * 电话号码 |
| | | */ |
| | | private String msisdn; |
| | | /** |
| | | * 对请求成功支付的数组。 |
| | | */ |
| | | private List<Payments> payments; |
| | | /** |
| | | * 已启动但未成功授权的任何支付的数组。 |
| | | */ |
| | | private List<Payments> failed_payments; |
| | | /** |
| | | * 元数据 |
| | | */ |
| | | private String extra_data; |
| | | /** |
| | | * 国家的缩写 |
| | | */ |
| | | private String country_abbrv; |
| | | |
| | | public Long getCheckout_request_id() { |
| | | return checkout_request_id; |
| | | } |
| | | |
| | | public void setCheckout_request_id(Long checkout_request_id) { |
| | | this.checkout_request_id = checkout_request_id; |
| | | } |
| | | |
| | | public String getMerchant_transaction_id() { |
| | | return merchant_transaction_id; |
| | | } |
| | | |
| | | public void setMerchant_transaction_id(String merchant_transaction_id) { |
| | | this.merchant_transaction_id = merchant_transaction_id; |
| | | } |
| | | |
| | | public Double getRequest_amount() { |
| | | return request_amount; |
| | | } |
| | | |
| | | public void setRequest_amount(Double request_amount) { |
| | | this.request_amount = request_amount; |
| | | } |
| | | |
| | | public Double getOriginal_request_amount() { |
| | | return original_request_amount; |
| | | } |
| | | |
| | | public void setOriginal_request_amount(Double original_request_amount) { |
| | | this.original_request_amount = original_request_amount; |
| | | } |
| | | |
| | | public String getRequest_currency_code() { |
| | | return request_currency_code; |
| | | } |
| | | |
| | | public void setRequest_currency_code(String request_currency_code) { |
| | | this.request_currency_code = request_currency_code; |
| | | } |
| | | |
| | | public String getOriginal_request_currency_code() { |
| | | return original_request_currency_code; |
| | | } |
| | | |
| | | public void setOriginal_request_currency_code(String original_request_currency_code) { |
| | | this.original_request_currency_code = original_request_currency_code; |
| | | } |
| | | |
| | | public String getAccount_number() { |
| | | return account_number; |
| | | } |
| | | |
| | | public void setAccount_number(String account_number) { |
| | | this.account_number = account_number; |
| | | } |
| | | |
| | | public String getCurrency_code() { |
| | | return currency_code; |
| | | } |
| | | |
| | | public void setCurrency_code(String currency_code) { |
| | | this.currency_code = currency_code; |
| | | } |
| | | |
| | | public Double getAmount_paid() { |
| | | return amount_paid; |
| | | } |
| | | |
| | | public void setAmount_paid(Double amount_paid) { |
| | | this.amount_paid = amount_paid; |
| | | } |
| | | |
| | | public Double getService_charge_amount() { |
| | | return service_charge_amount; |
| | | } |
| | | |
| | | public void setService_charge_amount(Double service_charge_amount) { |
| | | this.service_charge_amount = service_charge_amount; |
| | | } |
| | | |
| | | public Date getRequest_date() { |
| | | return request_date; |
| | | } |
| | | |
| | | public void setRequest_date(Date request_date) { |
| | | this.request_date = request_date; |
| | | } |
| | | |
| | | public String getService_code() { |
| | | return service_code; |
| | | } |
| | | |
| | | public void setService_code(String service_code) { |
| | | this.service_code = service_code; |
| | | } |
| | | |
| | | public String getRequest_status_code() { |
| | | return request_status_code; |
| | | } |
| | | |
| | | public void setRequest_status_code(String request_status_code) { |
| | | this.request_status_code = request_status_code; |
| | | } |
| | | |
| | | public String getRequest_status_description() { |
| | | return request_status_description; |
| | | } |
| | | |
| | | public void setRequest_status_description(String request_status_description) { |
| | | this.request_status_description = request_status_description; |
| | | } |
| | | |
| | | public String getMsisdn() { |
| | | return msisdn; |
| | | } |
| | | |
| | | public void setMsisdn(String msisdn) { |
| | | this.msisdn = msisdn; |
| | | } |
| | | |
| | | public List<Payments> getPayments() { |
| | | return payments; |
| | | } |
| | | |
| | | public void setPayments(List<Payments> payments) { |
| | | this.payments = payments; |
| | | } |
| | | |
| | | public List<Payments> getFailed_payments() { |
| | | return failed_payments; |
| | | } |
| | | |
| | | public void setFailed_payments(List<Payments> failed_payments) { |
| | | this.failed_payments = failed_payments; |
| | | } |
| | | |
| | | public String getExtra_data() { |
| | | return extra_data; |
| | | } |
| | | |
| | | public void setExtra_data(String extra_data) { |
| | | this.extra_data = extra_data; |
| | | } |
| | | |
| | | public String getCountry_abbrv() { |
| | | return country_abbrv; |
| | | } |
| | | |
| | | public void setCountry_abbrv(String country_abbrv) { |
| | | this.country_abbrv = country_abbrv; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.Tingg.model; |
| | | |
| | | /** |
| | | * 支付回调后的响应 |
| | | */ |
| | | public class CallbackResponse { |
| | | /** |
| | | * 数据库中唯一的纤维素ID |
| | | */ |
| | | private String checkout_request_id; |
| | | /** |
| | | * 商家为请求提出的唯一Id |
| | | */ |
| | | private String merchant_transaction_id; |
| | | /** |
| | | * 状态码,指示请求是否成功接收、失败或接受 |
| | | */ |
| | | private String status_code; |
| | | /** |
| | | * 状态码解释。 |
| | | * 183表示成功 |
| | | * 180表示拒绝付款。 |
| | | * 188表示收到的款项。 |
| | | */ |
| | | private String status_description; |
| | | /** |
| | | * 返回的确认响应的唯一标识符。 |
| | | */ |
| | | private String receipt_number; |
| | | |
| | | public String getCheckout_request_id() { |
| | | return checkout_request_id; |
| | | } |
| | | |
| | | public void setCheckout_request_id(String checkout_request_id) { |
| | | this.checkout_request_id = checkout_request_id; |
| | | } |
| | | |
| | | public String getMerchant_transaction_id() { |
| | | return merchant_transaction_id; |
| | | } |
| | | |
| | | public void setMerchant_transaction_id(String merchant_transaction_id) { |
| | | this.merchant_transaction_id = merchant_transaction_id; |
| | | } |
| | | |
| | | public String getStatus_code() { |
| | | return status_code; |
| | | } |
| | | |
| | | public void setStatus_code(String status_code) { |
| | | this.status_code = status_code; |
| | | } |
| | | |
| | | public String getStatus_description() { |
| | | return status_description; |
| | | } |
| | | |
| | | public void setStatus_description(String status_description) { |
| | | this.status_description = status_description; |
| | | } |
| | | |
| | | public String getReceipt_number() { |
| | | return receipt_number; |
| | | } |
| | | |
| | | public void setReceipt_number(String receipt_number) { |
| | | this.receipt_number = receipt_number; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.Tingg.model; |
| | | |
| | | |
| | | public class CheckoutRequest { |
| | | /** |
| | | * 电话号码 |
| | | */ |
| | | private Long msisdn; |
| | | /** |
| | | * 邮件地址 |
| | | */ |
| | | private String customerEmail; |
| | | /** |
| | | * 支付账户 |
| | | */ |
| | | private String accountNumber; |
| | | /** |
| | | * 名 |
| | | */ |
| | | private String customerFirstName; |
| | | /** |
| | | * 姓 |
| | | */ |
| | | private String customerLastName; |
| | | /** |
| | | * 支付金额 |
| | | */ |
| | | private Double requestAmount; |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | private String merchantTransactionId; |
| | | /** |
| | | * 描述 |
| | | */ |
| | | private String requestDescription; |
| | | /** |
| | | * 回调地址 |
| | | */ |
| | | private String callbackUrl; |
| | | /** |
| | | * 在客户点击回到商家后,我们将客户重定向到哪里 |
| | | */ |
| | | private String pendingRedirectUrl; |
| | | /** |
| | | * 成功付款后将客户重定向到那里 |
| | | */ |
| | | private String successRedirectUrl; |
| | | /** |
| | | * 付款超时后的重定向 |
| | | */ |
| | | private String failRedirectUrl; |
| | | |
| | | public Long getMsisdn() { |
| | | return msisdn; |
| | | } |
| | | |
| | | public void setMsisdn(Long msisdn) { |
| | | this.msisdn = msisdn; |
| | | } |
| | | |
| | | public String getCustomerEmail() { |
| | | return customerEmail; |
| | | } |
| | | |
| | | public void setCustomerEmail(String customerEmail) { |
| | | this.customerEmail = customerEmail; |
| | | } |
| | | |
| | | public String getAccountNumber() { |
| | | return accountNumber; |
| | | } |
| | | |
| | | public void setAccountNumber(String accountNumber) { |
| | | this.accountNumber = accountNumber; |
| | | } |
| | | |
| | | public String getCustomerFirstName() { |
| | | return customerFirstName; |
| | | } |
| | | |
| | | public void setCustomerFirstName(String customerFirstName) { |
| | | this.customerFirstName = customerFirstName; |
| | | } |
| | | |
| | | public String getCustomerLastName() { |
| | | return customerLastName; |
| | | } |
| | | |
| | | public void setCustomerLastName(String customerLastName) { |
| | | this.customerLastName = customerLastName; |
| | | } |
| | | |
| | | public Double getRequestAmount() { |
| | | return requestAmount; |
| | | } |
| | | |
| | | public void setRequestAmount(Double requestAmount) { |
| | | this.requestAmount = requestAmount; |
| | | } |
| | | |
| | | public String getMerchantTransactionId() { |
| | | return merchantTransactionId; |
| | | } |
| | | |
| | | public void setMerchantTransactionId(String merchantTransactionId) { |
| | | this.merchantTransactionId = merchantTransactionId; |
| | | } |
| | | |
| | | public String getRequestDescription() { |
| | | return requestDescription; |
| | | } |
| | | |
| | | public void setRequestDescription(String requestDescription) { |
| | | this.requestDescription = requestDescription; |
| | | } |
| | | |
| | | public String getCallbackUrl() { |
| | | return callbackUrl; |
| | | } |
| | | |
| | | public void setCallbackUrl(String callbackUrl) { |
| | | this.callbackUrl = callbackUrl; |
| | | } |
| | | |
| | | public String getPendingRedirectUrl() { |
| | | return pendingRedirectUrl; |
| | | } |
| | | |
| | | public void setPendingRedirectUrl(String pendingRedirectUrl) { |
| | | this.pendingRedirectUrl = pendingRedirectUrl; |
| | | } |
| | | |
| | | public String getSuccessRedirectUrl() { |
| | | return successRedirectUrl; |
| | | } |
| | | |
| | | public void setSuccessRedirectUrl(String successRedirectUrl) { |
| | | this.successRedirectUrl = successRedirectUrl; |
| | | } |
| | | |
| | | public String getFailRedirectUrl() { |
| | | return failRedirectUrl; |
| | | } |
| | | |
| | | public void setFailRedirectUrl(String failRedirectUrl) { |
| | | this.failRedirectUrl = failRedirectUrl; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.Tingg.model; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class Payments { |
| | | /** |
| | | * 付款人的客户姓名 |
| | | */ |
| | | private String customer_name; |
| | | /** |
| | | * 客户付费购买的商家推荐 |
| | | */ |
| | | private String account_number; |
| | | /** |
| | | * 独特的纤维素特性 |
| | | */ |
| | | private String cpg_transaction_id; |
| | | /** |
| | | * 所支付的ISO货币代码 |
| | | */ |
| | | private String currency_code; |
| | | /** |
| | | * 支付方式客户支付,如Airtel |
| | | */ |
| | | private String payer_client_code; |
| | | /** |
| | | * 付款选项客户名称 |
| | | */ |
| | | private String payer_client_name; |
| | | /** |
| | | * 客户支付的金额 |
| | | */ |
| | | private Double amount_paid; |
| | | /** |
| | | * 服务代码支付给 |
| | | */ |
| | | private String service_code; |
| | | /** |
| | | * 付款和收款的时间 |
| | | */ |
| | | private Date date_payment_received; |
| | | /** |
| | | * 用户付费的手机号码 |
| | | */ |
| | | private String msisdn; |
| | | /** |
| | | * 为交易生成的MNO或银行的唯一id |
| | | */ |
| | | private String payer_transaction_id; |
| | | /** |
| | | * 付款的整体状态如下表所示 |
| | | * 141 商户系统拒绝付款 |
| | | * 139 商户待付款确认 |
| | | * 140 商户接受的付款 |
| | | * 138 付款请求已启动但失败 |
| | | * 144 向商家交付但尚未确认成功的付款 |
| | | * 219 付款已上报 |
| | | */ |
| | | private String hub_overall_status; |
| | | /** |
| | | * 由MNO、银行或信用卡收款人提供的付款说明。 |
| | | */ |
| | | private String payer_narration; |
| | | |
| | | public String getCustomer_name() { |
| | | return customer_name; |
| | | } |
| | | |
| | | public void setCustomer_name(String customer_name) { |
| | | this.customer_name = customer_name; |
| | | } |
| | | |
| | | public String getAccount_number() { |
| | | return account_number; |
| | | } |
| | | |
| | | public void setAccount_number(String account_number) { |
| | | this.account_number = account_number; |
| | | } |
| | | |
| | | public String getCpg_transaction_id() { |
| | | return cpg_transaction_id; |
| | | } |
| | | |
| | | public void setCpg_transaction_id(String cpg_transaction_id) { |
| | | this.cpg_transaction_id = cpg_transaction_id; |
| | | } |
| | | |
| | | public String getCurrency_code() { |
| | | return currency_code; |
| | | } |
| | | |
| | | public void setCurrency_code(String currency_code) { |
| | | this.currency_code = currency_code; |
| | | } |
| | | |
| | | public String getPayer_client_code() { |
| | | return payer_client_code; |
| | | } |
| | | |
| | | public void setPayer_client_code(String payer_client_code) { |
| | | this.payer_client_code = payer_client_code; |
| | | } |
| | | |
| | | public String getPayer_client_name() { |
| | | return payer_client_name; |
| | | } |
| | | |
| | | public void setPayer_client_name(String payer_client_name) { |
| | | this.payer_client_name = payer_client_name; |
| | | } |
| | | |
| | | public Double getAmount_paid() { |
| | | return amount_paid; |
| | | } |
| | | |
| | | public void setAmount_paid(Double amount_paid) { |
| | | this.amount_paid = amount_paid; |
| | | } |
| | | |
| | | public String getService_code() { |
| | | return service_code; |
| | | } |
| | | |
| | | public void setService_code(String service_code) { |
| | | this.service_code = service_code; |
| | | } |
| | | |
| | | public Date getDate_payment_received() { |
| | | return date_payment_received; |
| | | } |
| | | |
| | | public void setDate_payment_received(Date date_payment_received) { |
| | | this.date_payment_received = date_payment_received; |
| | | } |
| | | |
| | | public String getMsisdn() { |
| | | return msisdn; |
| | | } |
| | | |
| | | public void setMsisdn(String msisdn) { |
| | | this.msisdn = msisdn; |
| | | } |
| | | |
| | | public String getPayer_transaction_id() { |
| | | return payer_transaction_id; |
| | | } |
| | | |
| | | public void setPayer_transaction_id(String payer_transaction_id) { |
| | | this.payer_transaction_id = payer_transaction_id; |
| | | } |
| | | |
| | | public String getHub_overall_status() { |
| | | return hub_overall_status; |
| | | } |
| | | |
| | | public void setHub_overall_status(String hub_overall_status) { |
| | | this.hub_overall_status = hub_overall_status; |
| | | } |
| | | |
| | | public String getPayer_narration() { |
| | | return payer_narration; |
| | | } |
| | | |
| | | public void setPayer_narration(String payer_narration) { |
| | | this.payer_narration = payer_narration; |
| | | } |
| | | } |
| | |
| | | private String type; |
| | | @ApiModelProperty("从业地(带分隔符)") |
| | | private String placeOfPractice; |
| | | @ApiModelProperty("从业地行政区域代码") |
| | | private String placeOfEmployment; |
| | | @ApiModelProperty("从业地id") |
| | | private String placeOfPracticeId; |
| | | @ApiModelProperty("驾驶证照片") |
| | | private String driveCardImgUrl1; |
| | | private String driveCardImgUrl; |
| | | @ApiModelProperty("驾驶证照片") |
| | | private String driveCardImgUrl2; |
| | | @ApiModelProperty("网约车资格证照片") |
| | |
| | | private String qrCode; |
| | | @ApiModelProperty("二维码是否打开 true打开,false关闭") |
| | | private Boolean qrCodeIsOpen; |
| | | @ApiModelProperty("生日") |
| | | private String birthday; |
| | | @ApiModelProperty("居住地") |
| | | private String driverAddress; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.placeOfPractice = placeOfPractice; |
| | | } |
| | | |
| | | public String getPlaceOfEmployment() { |
| | | return placeOfEmployment; |
| | | public String getPlaceOfPracticeId() { |
| | | return placeOfPracticeId; |
| | | } |
| | | |
| | | public void setPlaceOfEmployment(String placeOfEmployment) { |
| | | this.placeOfEmployment = placeOfEmployment; |
| | | public void setPlaceOfPracticeId(String placeOfPracticeId) { |
| | | this.placeOfPracticeId = placeOfPracticeId; |
| | | } |
| | | |
| | | public String getDriveCardImgUrl1() { |
| | | return driveCardImgUrl1; |
| | | public String getDriveCardImgUrl() { |
| | | return driveCardImgUrl; |
| | | } |
| | | |
| | | public void setDriveCardImgUrl1(String driveCardImgUrl1) { |
| | | this.driveCardImgUrl1 = driveCardImgUrl1; |
| | | public void setDriveCardImgUrl(String driveCardImgUrl) { |
| | | this.driveCardImgUrl = driveCardImgUrl; |
| | | } |
| | | |
| | | public String getDriveCardImgUrl2() { |
| | |
| | | this.qrCodeIsOpen = qrCodeIsOpen; |
| | | } |
| | | |
| | | public String getBirthday() { |
| | | return birthday; |
| | | } |
| | | |
| | | public void setBirthday(String birthday) { |
| | | this.birthday = birthday; |
| | | } |
| | | |
| | | public String getDriverAddress() { |
| | | return driverAddress; |
| | | } |
| | | |
| | | public void setDriverAddress(String driverAddress) { |
| | | this.driverAddress = driverAddress; |
| | | } |
| | | |
| | | public static DriverInfoWarpper getDriverInfoWarpper(Map<String, Object> map){ |
| | | DriverInfoWarpper driverInfoWarpper = new DriverInfoWarpper(); |
| | | if(null != map){ |
| | |
| | | driverInfoWarpper.setGetDriverLicenseDate(null != map.get("getDriverLicenseDate") ? String.valueOf(map.get("getDriverLicenseDate")) : ""); |
| | | driverInfoWarpper.setType(null != map.get("type") ? String.valueOf(map.get("type")) : ""); |
| | | driverInfoWarpper.setPlaceOfPractice(null != map.get("placeOfPractice") ? String.valueOf(map.get("placeOfPractice")) : ""); |
| | | driverInfoWarpper.setDriveCardImgUrl1(null != map.get("driveCardImgUrl1") ? String.valueOf(map.get("driveCardImgUrl1")) : ""); |
| | | driverInfoWarpper.setDriveCardImgUrl(null != map.get("driveCardImgUrl") ? String.valueOf(map.get("driveCardImgUrl")) : ""); |
| | | driverInfoWarpper.setDriveCardImgUrl2(null != map.get("driveCardImgUrl2") ? String.valueOf(map.get("driveCardImgUrl2")) : ""); |
| | | driverInfoWarpper.setNetworkCarlssueImg(null != map.get("networkCarlssueImg") ? String.valueOf(map.get("networkCarlssueImg")) : ""); |
| | | driverInfoWarpper.setPlaceOfEmployment(null != map.get("placeOfEmployment") ? String.valueOf(map.get("placeOfEmployment")) : ""); |
| | | driverInfoWarpper.setPlaceOfPracticeId(null != map.get("placeOfPracticeId") ? String.valueOf(map.get("placeOfPracticeId")) : ""); |
| | | driverInfoWarpper.setLaveActivityMoney(null != map.get("laveActivityMoney") ? Double.valueOf(String.valueOf(map.get("laveActivityMoney"))) : 0); |
| | | driverInfoWarpper.setLaveBusinessMoney(null != map.get("laveBusinessMoney") ? Double.valueOf(String.valueOf(map.get("laveBusinessMoney"))) : 0); |
| | | driverInfoWarpper.setLanguage(null != map.get("language") ? Integer.valueOf(String.valueOf(map.get("language"))) : 2); |
| | | driverInfoWarpper.setBirthday(null != map.get("birthday") ? String.valueOf(map.get("birthday")) : ""); |
| | | driverInfoWarpper.setDriverAddress(null != map.get("driverAddress") ? String.valueOf(map.get("driverAddress")) : ""); |
| | | } |
| | | return driverInfoWarpper; |
| | | } |
| | |
| | | private Integer urgent; |
| | | @ApiModelProperty("下单用户姓名") |
| | | private String userName; |
| | | @ApiModelProperty("司机支付状态【现金支付需要司机代支付】(1=待支付,2=已支付)") |
| | | private Integer driverPay; |
| | | |
| | | @ApiModelProperty("轨迹") |
| | | private String orderPositionList; |
| | |
| | | this.userName = userName; |
| | | } |
| | | |
| | | public Integer getDriverPay() { |
| | | return driverPay; |
| | | } |
| | | |
| | | public void setDriverPay(Integer driverPay) { |
| | | this.driverPay = driverPay; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderInfoWarpper{" + |
| | |
| | | orderInfoWarpper.setCargoType(null != map.get("cargoType") ? Integer.valueOf(map.get("cargoType").toString()) : 0); |
| | | orderInfoWarpper.setUrgent(null != map.get("urgent") ? Integer.valueOf(map.get("urgent").toString()) : 0); |
| | | orderInfoWarpper.setUserName(null != map.get("userName") ? String.valueOf(map.get("userName")) : ""); |
| | | orderInfoWarpper.setDriverPay(null != map.get("driverPay") ? Integer.valueOf(map.get("driverPay").toString()) : 0); |
| | | } |
| | | return orderInfoWarpper; |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.warpper; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | |
| | | @ApiModelProperty("支付方式(1=OK平台支付(线上支付),2=其他方式支付(线下支付))") |
| | | private Integer payManner; |
| | | private Long travelTime; |
| | | @ApiModelProperty("司机支付状态(现金支付司机代支付)1待支付 2已支付") |
| | | private Integer driverPay; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.cargoNumber = cargoNumber; |
| | | } |
| | | |
| | | public Integer getDriverPay() { |
| | | return driverPay; |
| | | } |
| | | |
| | | public void setDriverPay(Integer driverPay) { |
| | | this.driverPay = driverPay; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderListWarpper{" + |
| | |
| | | orderListWarpper.setRemark(null != map.get("remark") ? String.valueOf(map.get("remark")) : ""); |
| | | orderListWarpper.setPayManner(null != map.get("payManner") ? Integer.valueOf(String.valueOf(map.get("payManner"))) : 0); |
| | | orderListWarpper.setTravelTime(null != map.get("travelTime") ? Long.valueOf(String.valueOf(map.get("travelTime"))) : 0); |
| | | orderListWarpper.setDriverPay(null != map.get("driverPay") ? Integer.valueOf(map.get("driverPay").toString()) : 1); |
| | | list.add(orderListWarpper); |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty("头像") |
| | | private String headImgUrl; |
| | | @ApiModelProperty("驾驶证照片正面") |
| | | private String driveCardImgUrl1; |
| | | private String driveCardImgUrl; |
| | | @ApiModelProperty("驾驶证照片背面") |
| | | private String driveCardImgUrl2; |
| | | |
| | |
| | | this.headImgUrl = headImgUrl; |
| | | } |
| | | |
| | | public String getDriveCardImgUrl1() { |
| | | return driveCardImgUrl1; |
| | | public String getDriveCardImgUrl() { |
| | | return driveCardImgUrl; |
| | | } |
| | | |
| | | public void setDriveCardImgUrl1(String driveCardImgUrl1) { |
| | | this.driveCardImgUrl1 = driveCardImgUrl1; |
| | | public void setDriveCardImgUrl(String driveCardImgUrl) { |
| | | this.driveCardImgUrl = driveCardImgUrl; |
| | | } |
| | | |
| | | public String getDriveCardImgUrl2() { |
| | |
| | | ", email='" + email + '\'' + |
| | | ", placeOfPracticeId=" + placeOfPracticeId + |
| | | ", headImgUrl='" + headImgUrl + '\'' + |
| | | ", driveCardImgUrl1='" + driveCardImgUrl1 + '\'' + |
| | | ", driveCardImgUrl2='" + driveCardImgUrl2 + '\'' + |
| | | '}'; |
| | | } |
| | |
| | | application: |
| | | name: driver-server |
| | | profiles: |
| | | active: @spring.active@ |
| | | # active: dev |
| | | active: produce |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | |
| | | |
| | | mybatis-plus: |
| | | typeAliasesPackage: com.stylefeng.guns.modular |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl |
| | | |
| | | log: |
| | | path: guns-logs |
| | | |
| | | eureka: |
| | | client: |
| | |
| | | --- |
| | | |
| | | spring: |
| | | profiles: local |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | |
| | | |
| | | ################# 测试环境 ################### |
| | | #spring: |
| | | # profiles: local |
| | | # datasource: |
| | | # url: jdbc:mysql://127.0.0.1:3306/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | # username: root |
| | |
| | | - dataSourceGuns |
| | | - dataSourceBiz |
| | | |
| | | --- |
| | | |
| | | spring: |
| | | profiles: dev |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/guns?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: root |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | | --- |
| | | |
| | | spring: |
| | | profiles: test |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/guns?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: root |
| | | filters: wall,mergeStat |
| | | |
| | | --- |
| | | |
| | | spring: |
| | | profiles: produce |
| | | datasource: |
| | | url: jdbc:mysql://127.0.0.1:3306/guns?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: root |
| | | filters: wall,mergeStat |
| | | |
| | | --- |
| | | |
| | | wx: |
| | | grantType: authorization_code #填authorization_code |
| | |
| | | |
| | | --- |
| | | |
| | | #filePath: /usr/local/server/orderPostionFile/ #存储订单轨迹文件路径 |
| | | filePath: C:/orderPostionFile/ #存储订单轨迹文件路径 |
| | | filePath: /usr/local/server/orderPostionFile/ #存储订单轨迹文件路径 |
| | | #filePath: C:/orderPostionFile/ #存储订单轨迹文件路径 |
| | | |
| | | |
| | | |
| | |
| | | #正式环境 |
| | | #callbackPath: https://okyueche.com:443/driver |
| | | #正式测试环境 |
| | | callbackPath: http://39.108.37.243/driver |
| | | callbackPath: http://182.160.16.251/driver |
| | | |
| | | |
| | | --- |
| | | #交通部推送数据功能开关 |
| | | pushMinistryOfTransport: false |
| | | |
| | | spring: |
| | | mail: |
| | | host: smtp.gmail.com # 配置 smtp 服务器地址 |
| | | port: 465 # smtp 服务器的端口 |
| | | username: southwindservice@gmail.com # 配置邮箱用户名(你的邮箱地址) |
| | | password: ogsntijmguisoiuk # 配置申请到的授权码(刚让复制的授权码) |
| | | default-encoding: UTF-8 # 配置邮件编码 |
| | | properties: |
| | | mail: |
| | | smtp: |
| | | socketFactoryClass: javax.net.ssl.SSLSocketFactory # 配饰 SSL 加密工厂 |
| | | debug: true |
| | | from: southwindservice@gmail.com # 发送方邮件,配在yml中可方便更改 |
| | | template-path: /usr/local/nginx/html/mailbox/driver/ |
| | | |
| | | --- |
| | | |
| | | share: |
| | | url: http://182.160.16.251:81/share/share/pages/changeStyle/changeStyle.html |
| | |
| | | <?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/logs/driver"/> |
| | | |
| | | <!-- ****************************************************************************************** --> |
| | | <!-- ****************************** 本地开发只在控制台打印日志 ************************************ --> |
| | | <!-- ****************************************************************************************** --> |
| | | <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--> |
| | | <!--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>===%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger Line:%-3L - %msg%n</pattern> |
| | | <charset>utf-8</charset> |
| | | <Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
| | | <!-- 设置字符集 --> |
| | | <charset>UTF-8</charset> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <root level="info"> |
| | | <appender-ref ref="STDOUT"/> |
| | | </root> |
| | | |
| | | <logger name="com.stylefeng.guns" level="debug" additivity="false"> |
| | | <appender-ref ref="STDOUT"/> |
| | | </logger> |
| | | |
| | | </springProfile> |
| | | |
| | | <!-- ****************************************************************************************** --> |
| | | <!-- ********************** 放到服务器上不管在什么环境都只在文件记录日志 **************************** --> |
| | | <!-- ****************************************************************************************** --> |
| | | <springProfile name="!local"> |
| | | |
| | | <!-- 日志记录器,日期滚动记录 --> |
| | | <appender name="FILE_ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <!-- 正在记录的日志文件的路径及文件名 --> |
| | | <file>${gunsLogPath}/log_error.log</file> |
| | | <!--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"> |
| | | <!-- 归档的日志文件的路径,例如今天是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 --> |
| | | <!-- 日志归档 --> |
| | | <fileNamePattern>${log.path}/%d{yyyy-MM-dd}/debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>2MB</maxFileSize> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </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级别的 --> |
| | | <!-- 此日志文档只记录debug级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>error</level> |
| | | <level>debug</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> |
| | | <!-- 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"> |
| | | <!-- 归档的日志文件的路径,例如今天是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 --> |
| | | <!-- 每天日志归档路径以及格式 --> |
| | | <fileNamePattern>${log.path}/%d{yyyy-MM-dd}/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>2MB</maxFileSize> |
| | | <maxFileSize>100MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | <!--日志文档保留天数--> |
| | | <maxHistory>15</maxHistory> |
| | | </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> |
| | | <!-- 此日志文档只记录info级别的 --> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <level>info</level> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <root level="info"> |
| | | <appender-ref ref="FILE_ERROR"/> |
| | | <appender-ref ref="FILE_ALL"/> |
| | | </root> |
| | | <!-- 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="com.stylefeng.guns.modular.system.dao" level="error"/> |
| | | <logger name="business-log" level="warn"/> |
| | | </springProfile> |
| | | |
| | | <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="com.stylefeng.guns.modular.system.dao" level="error"/> |
| | | <logger name="business-log" level="warn"/> |
| | | </springProfile> |
| | | |
| | | <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="com.stylefeng.guns.modular.system.dao" level="error"/> |
| | | <logger name="business-log" level="warn"/> |
| | | </springProfile> |
| | | |
| | | </configuration> |
| | | |
| | | |