Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/QianYunTong
# Conflicts:
# DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/zhenglian/SM4Util.java
74个文件已修改
5个文件已删除
10个文件已添加
| | |
| | | <artifactId>spring-boot-starter-data-redis</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.redisson</groupId> |
| | | <artifactId>redisson-spring-boot-starter</artifactId> |
| | | <version>3.16.8</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.lettuce</groupId> |
| | | <artifactId>lettuce-core</artifactId> |
| | | </dependency> |
| | |
| | | <version>1.0.0</version> |
| | | <scope>system</scope> |
| | | <systemPath>${pom.basedir}/lib/openApiClient-1.0.0.jar</systemPath> |
| | | </dependency> |
| | | <!--单点登录sdk--> |
| | | <dependency> |
| | | <groupId>com.cas</groupId> |
| | | <artifactId>cas-client-oncon</artifactId> |
| | | <version>3.0.5</version> |
| | | <scope>system</scope> |
| | | <systemPath>${pom.basedir}/lib/cas-client-oncon-3.0.5.jar</systemPath> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.cas</groupId> |
| | | <artifactId>cas-client-oncon-core</artifactId> |
| | | <version>1.2.2</version> |
| | | <scope>system</scope> |
| | | <systemPath>${pom.basedir}/lib/cas-client-oncon-core-1.2.2.jar</systemPath> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>commons-httpclient</groupId> |
| | |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.internal.util.file.IOUtils; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.vo.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ALiSendSms; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.WeChatUtil; |
| | | //import com.stylefeng.guns.modular.system.util.qianyuntong.NCOSSUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.NCOSSUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.QianYunTongConfig; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.http.*; |
| | | import org.springframework.util.Base64Utils; |
| | | import org.springframework.util.LinkedMultiValueMap; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static org.bouncycastle.cms.RecipientId.password; |
| | | |
| | | /** |
| | | * 司机控制器 |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/queryPhone") |
| | | @ApiOperation(value = "获取客服电话", tags = {"司机端-个人中心"}, notes = "车队=franchisee,分公司=branch,平台=platform") |
| | | @ApiOperation(value = "获取客服电话(黔云通)", tags = {"司机端-个人中心"}, notes = "车队=franchisee,分公司=branch,平台=platform") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "当前行政区划代码", name = "code", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryPhone(HttpServletRequest request){ |
| | | public ResultUtil queryPhone(String code, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Map<String, Object> map = driverService.queryPhone(uid); |
| | | Map<String, Object> map = driverService.queryPhone(uid, code); |
| | | return ResultUtil.success(map); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/base/driver/getDriverInfo") |
| | | public void getDriverInfo(String lsu, String ssologinid, String ticket, HttpSession session) { |
| | | try { |
| | | String onconParam = edu.yale.its.tp.cas.client.Util.getOnconParam(session); |
| | | onconParam = new String(Base64.getDecoder().decode(onconParam), "UTF-8"); |
| | | System.err.println("lsu: " + lsu + ",ticket: " + ticket + ",ssologinid: " + ssologinid); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | // @ResponseBody |
| | |
| | | |
| | | @Resource |
| | | private DriverWorkMapper driverWorkMapper; |
| | | @Autowired |
| | | private ISysTimeoutMoneyService sysTimeoutMoneyService; |
| | | @Autowired |
| | | private IOpenCityService openCityService; |
| | | |
| | | @Autowired |
| | | private ICarService carService; |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private ISysTimeoutMoneyService sysTimeoutMoneyService; |
| | | |
| | | |
| | | /** |
| | | * 获取服务中页面订单详情 |
| | |
| | | Map<String, Object> map = orderService.queryOrderInfo(uid, orderId, orderType); |
| | | |
| | | if (orderType == 4 || orderType == 5){ |
| | | |
| | | SysTimeoutMoney sysTimeoutMoney = sysTimeoutMoneyService.selectOne(null); |
| | | OpenCity openCity = openCityService.openCity1(map.get("startLon").toString(), map.get("startLat").toString()); |
| | | SysTimeoutMoney sysTimeoutMoney = sysTimeoutMoneyService.selectOne(new EntityWrapper<SysTimeoutMoney>().eq("openCityId", openCity.getId())); |
| | | map.put("timeOutMoney",Double.parseDouble(map.get("timeOutMoney").toString())); |
| | | map.put("note","配送超过" + sysTimeoutMoney.getTimeOut() + "分钟扣订单的" + sysTimeoutMoney.getDeductMoney() + "%费用"); |
| | | |
| | |
| | | } |
| | | } |
| | | return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map)); |
| | | //return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | Map<String, Object> map = orderService.queryOrderInfo(uid, orderId, 7); |
| | | |
| | | if (orderType == 4 || orderType == 5){ |
| | | |
| | | SysTimeoutMoney sysTimeoutMoney = sysTimeoutMoneyService.selectOne(null); |
| | | OpenCity openCity = openCityService.openCity1(map.get("startLon").toString(), map.get("startLat").toString()); |
| | | SysTimeoutMoney sysTimeoutMoney = sysTimeoutMoneyService.selectOne(new EntityWrapper<SysTimeoutMoney>().eq("openCityId", openCity.getId())); |
| | | map.put("timeOutMoney",Double.parseDouble(map.get("timeOutMoney").toString())); |
| | | map.put("note","配送超过" + sysTimeoutMoney.getTimeOut() + "分钟扣订单的" + sysTimeoutMoney.getDeductMoney() + "%费用"); |
| | | |
| | |
| | | |
| | | @Resource |
| | | private UserInfoMapper userInfoMapper; |
| | | @Autowired |
| | | private IOpenCityService openCityService; |
| | | |
| | | @Autowired |
| | | private DateUtil dateUtil; |
| | |
| | | map.put("orderNumber", orderCrossCity.getOrderNum()); |
| | | map.put("totalMoney", new BigDecimal(totalMoney).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | map.put("serverMoney", new BigDecimal(serverMoney).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | Phone phone = phoneMapper.queryInfo(orderCrossCity.getCompanyId(), 1); |
| | | OpenCity openCity = openCityService.openCity1(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString()); |
| | | Phone phone = phoneMapper.queryInfo(openCity.getId(), 1, 1); |
| | | map.put("emergencyCall", null != phone ? phone.getPhone() : "110"); |
| | | map.put("orders", JSON.toJSONString(order)); |
| | | |
| | |
| | | orderCrossCity.setIsReassign(1); |
| | | orderCrossCity.setLineShiftDriverId(orderCrossCityWarpper.getLineShiftDriverId()); |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderCrossCity.setTrackId(track); |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderCrossCity.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderCrossCity.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderCrossCity.setTelX(map.get("telX")); |
| | | orderCrossCity.setBindId(map.get("bindId")); |
| | | } |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderCrossCity.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderCrossCity.setTelX(map.get("telX")); |
| | | // orderCrossCity.setBindId(map.get("bindId")); |
| | | // } |
| | | if(orderCrossCityWarpper.getTravelMode() == 2){//包车 |
| | | // orderCrossCity.setSeatNumber(lineShiftDriver.getLaveSeatNumber()); |
| | | // orderCrossCity.setPeopleNumber(lineShiftDriver.getLaveSeat()); |
| | |
| | | |
| | | |
| | | UserInfo userInfo = userInfoMapper.selectById(orderCrossCity.getUserId()); |
| | | SysIntegral query1 = sysIntegralMapper.query(orderCrossCity.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | userInfoMapper.updateById(userInfo); |
| | | System.out.println("==============userInfo修改完毕==================="+userInfo); |
| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.dao.UserInfoMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | |
| | | public class NewlyAddedController { |
| | | |
| | | |
| | | @Autowired |
| | | private IOpenCityService openCityService; |
| | | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/newlyAdded/getShowModular") |
| | | @ApiOperation(value = "获取显示模块设置", tags = {"司机端-2.0新增"}, notes = "") |
| | | @ApiOperation(value = "获取显示模块设置(黔云通)", tags = {"司机端-2.0新增"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "当前经度", name = "lon", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "当前纬度", name = "lon", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<TbShowModular>> getShowModular(HttpServletRequest request){ |
| | | public ResultUtil<List<TbShowModular>> getShowModular(String lon, String lat, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(showModularService.selectList(null)); |
| | | OpenCity openCity = openCityService.openCity1(lon, lat); |
| | | return ResultUtil.success(showModularService.selectList(new EntityWrapper<TbShowModular>().eq("openCityId",openCity.getId()))); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | orderLogistics.setSnatchOrderTime(new Date()); |
| | | |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderLogistics.setTrackId(track); |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderLogistics.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderLogistics.getRecipientPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderLogistics.setTelX(map.get("telX")); |
| | | orderLogistics.setBindId(map.get("bindId")); |
| | | } |
| | | UserInfo userInfo = userInfoMapper.selectById(orderLogistics.getUserId()); |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderLogistics.getRecipientPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderLogistics.setTelX(map.get("telX")); |
| | | // orderLogistics.setBindId(map.get("bindId")); |
| | | // } |
| | | // UserInfo userInfo = userInfoMapper.selectById(orderLogistics.getUserId()); |
| | | |
| | | Map<String, String> map1 = chinaMobileUtil.midAxbBindSend(userInfo.getPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | System.out.println("二次绑定信息:"+map1); |
| | | if(String.valueOf(map1.get("code")).equals("200")){ |
| | | orderLogistics.setTelXOne(map1.get("telX")); |
| | | orderLogistics.setBindIdOne(map1.get("bindId")); |
| | | } |
| | | // Map<String, String> map1 = chinaMobileUtil.midAxbBindSend(userInfo.getPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | // System.out.println("二次绑定信息:"+map1); |
| | | // if(String.valueOf(map1.get("code")).equals("200")){ |
| | | // orderLogistics.setTelXOne(map1.get("telX")); |
| | | // orderLogistics.setBindIdOne(map1.get("bindId")); |
| | | // } |
| | | |
| | | this.updateById(orderLogistics); |
| | | |
| | |
| | | } |
| | | |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderLogistics.setTrackId(track); |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderLogistics.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 TODO 车载端使用真实号码 |
| | | // Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public synchronized ResultUtil grabOrder(Integer orderId, Integer uid) throws Exception { |
| | | public ResultUtil grabOrder(Integer orderId, Integer uid) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | if(null == orderPrivateCar){ |
| | | return ResultUtil.error("订单已被抢了"); |
| | |
| | | orderPrivateCar.setSnatchOrderTime(new Date()); |
| | | |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderPrivateCar.setTrackId(track); |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderPrivateCar.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderPrivateCar.setTelX(map.get("telX")); |
| | | orderPrivateCar.setBindId(map.get("bindId")); |
| | | } |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderPrivateCar.setTelX(map.get("telX")); |
| | | // orderPrivateCar.setBindId(map.get("bindId")); |
| | | // } |
| | | |
| | | this.updateById(orderPrivateCar); |
| | | |
| | |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得快车订单,请及时联系客户!", orderPrivateCar.getDriverId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderPrivateCar.getUserId(), 1); |
| | | |
| | | if(pushMinistryOfTransport){ |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){ |
| | | //上传数据 |
| | | pushMinistryOfTransportUtil.orderCreate(orderId); |
| | | pushMinistryOfTransportUtil.orderMatch(orderId); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | |
| | | |
| | | return ResultUtil.success(orderPrivateCar.getId()); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.OpenCity; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface OpenCityMapper extends BaseMapper<OpenCity> { |
| | | |
| | | |
| | | /** |
| | | * 获取开通城市列表(有效的) |
| | | * @return |
| | | */ |
| | | List<OpenCity> queryOpenCity(); |
| | | |
| | | |
| | | /** |
| | | * 获取开通城市 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | List<OpenCity> queryByCode(@Param("code") String code); |
| | | } |
| | |
| | | * @param code |
| | | * @return |
| | | */ |
| | | List<Phone> queryPhones(@Param("province") String province, @Param("city") String city, @Param("code") String code); |
| | | List<Phone> queryPhones(@Param("openCityId") Integer openCityId); |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 获取电话 |
| | | * @param companyId |
| | | * @param openCityId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | Phone queryInfo(@Param("companyId") Integer companyId, @Param("type") Integer type); |
| | | Phone queryInfo(@Param("openCityId") Integer openCityId, @Param("type") Integer type, @Param("platform") Integer platform); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<PushOrder> querys(@Param("type") Integer type, @Param("pushType") Integer pushType, |
| | | @Param("companyId") Integer companyId); |
| | | @Param("openCityId") Integer openCityId); |
| | | } |
| | |
| | | |
| | | public interface SysIntegralMapper extends BaseMapper<SysIntegral> { |
| | | |
| | | SysIntegral query(@Param("companyId") Integer companyId); |
| | | SysIntegral query(@Param("openCityId") Integer openCityId); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取改派金额 |
| | | * @param companyId |
| | | * @param openCityId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | Double queryMoney(@Param("companyId") Integer companyId) throws Exception; |
| | | Double queryMoney(@Param("openCityId") Integer openCityId) throws Exception; |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.OpenCityMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.OpenCity"> |
| | | <id column="id" property="id"/> |
| | | <result column="code" property="code"/> |
| | | <result column="lon" property="lon"/> |
| | | <result column="lat" property="lat"/> |
| | | <result column="isQualifications" property="isQualifications"/> |
| | | <result column="areaName" property="areaName"/> |
| | | <result column="cityName" property="cityName"/> |
| | | <result column="provinceName" property="provinceName"/> |
| | | |
| | | <result column="flag" property="flag"/> |
| | | <result column="insertTime" property="insertTime"/> |
| | | <result column="insertUser" property="insertUser"/> |
| | | <result column="updateTime" property="updateTime"/> |
| | | <result column="updateUser" property="updateUser"/> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <select id="queryOpenCity" resultType="OpenCity"> |
| | | select |
| | | id as id, |
| | | code as code, |
| | | lon as lon, |
| | | lat as lat, |
| | | isQualifications as isQualifications, |
| | | areaName as areaName, |
| | | cityName as cityName, |
| | | provinceName as provinceName, |
| | | flag as flag, |
| | | insertTime as insertTime, |
| | | insertUser as insertUser, |
| | | updateTime as updateTime, |
| | | updateUser as updateUser |
| | | from t_open_city where flag = 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="queryByCode" resultType="OpenCity"> |
| | | select |
| | | id as id, |
| | | code as code, |
| | | lon as lon, |
| | | lat as lat, |
| | | isQualifications as isQualifications, |
| | | areaName as areaName, |
| | | cityName as cityName, |
| | | provinceName as provinceName, |
| | | flag as flag, |
| | | insertTime as insertTime, |
| | | insertUser as insertUser, |
| | | updateTime as updateTime, |
| | | updateUser as updateUser |
| | | from t_open_city where flag = 1 and code = #{code} |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="platform" property="platform"/> |
| | | <result column="phone" property="phone" /> |
| | | <result column="companyId" property="companyId"/> |
| | | <result column="openCityId" property="openCityId"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | type as type, |
| | | platform as platform, |
| | | phone as phone, |
| | | companyId as companyId |
| | | from t_phone where companyId in ( |
| | | select companyId from t_company_city where state = 1 |
| | | <if test="null != province"> |
| | | and provinceCode = #{province} |
| | | </if> |
| | | <if test="null != city"> |
| | | and cityCode = #{city} |
| | | </if> |
| | | <if test="null != code"> |
| | | and areaCode = #{code} |
| | | </if> |
| | | ) |
| | | companyId as companyId, |
| | | openCityId as openCityId |
| | | from t_phone where openCityId = #{openCityId} |
| | | </select> |
| | | |
| | | |
| | |
| | | <if test="null != type"> |
| | | and type = #{type} |
| | | </if> |
| | | <if test="null != companyId"> |
| | | and companyId = #{companyId} |
| | | <if test="null != platform"> |
| | | and platform = #{platform} |
| | | </if> |
| | | <if test="null != openCityId"> |
| | | and openCityId = #{openCityId} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.PushOrder"> |
| | | <id column="id" property="id"/> |
| | | <result column="companyId" property="companyId"/> |
| | | <result column="openCityId" property="openCityId"/> |
| | | <result column="pushDistance" property="pushDistance"/> |
| | | <result column="pushTime" property="pushTime"/> |
| | | <result column="driverProportion" property="driverProportion"/> |
| | |
| | | select |
| | | id as id, |
| | | companyId as companyId, |
| | | openCityId as openCityId, |
| | | pushDistance as pushDistance, |
| | | pushTime as pushTime, |
| | | driverProportion as driverProportion, |
| | | `type` as `type`, |
| | | pushType as pushType |
| | | from t_sys_push_order where companyId = #{companyId} |
| | | from t_sys_push_order where openCityId = #{openCityId} |
| | | <if test="null != type"> |
| | | and `type` = #{type} |
| | | </if> |
| | |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.SysIntegral"> |
| | | <id column="id" property="id" /> |
| | | <result column="companyId" property="companyId" /> |
| | | <result column="openCityId" property="openCityId" /> |
| | | <result column="integral" property="integral" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <select id="query" resultType="SysIntegral"> |
| | | select * from t_sys_integral where companyId = #{companyId} |
| | | select * from t_sys_integral where openCityId = #{openCityId} |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="money" property="money"/> |
| | | <result column="isSpecialCar" property="isSpecialCar"/> |
| | | <result column="isTaxiCar" property="isTaxiCar"/> |
| | | <result column="openCityId" property="openCityId"/> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <select id="queryMoney" resultType="double"> |
| | | select money from t_sys_reformist where companyId = #{companyId} |
| | | select money from t_sys_reformist where openCityId = #{openCityId} |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | |
| | | /** |
| | | * 开通城市 |
| | | */ |
| | | @TableName("t_open_city") |
| | | public class OpenCity extends BaseBean { |
| | | /** |
| | | * 城市编号(行政编号) |
| | | */ |
| | | @TableField("code") |
| | | private String code; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | @TableField("lon") |
| | | private Double lon; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @TableField("lat") |
| | | private Double lat; |
| | | /** |
| | | * 是否需要网约车资格(1:是,2:否) |
| | | */ |
| | | @TableField("isQualifications") |
| | | private Integer isQualifications; |
| | | /** |
| | | * 省名称 |
| | | */ |
| | | @TableField("areaName") |
| | | private String areaName; |
| | | /** |
| | | * 市名称 |
| | | */ |
| | | @TableField("cityName") |
| | | private String cityName; |
| | | /** |
| | | * 区县名称 |
| | | */ |
| | | @TableField("provinceName") |
| | | private String provinceName; |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public Integer getIsQualifications() { |
| | | return isQualifications; |
| | | } |
| | | |
| | | public void setIsQualifications(Integer isQualifications) { |
| | | this.isQualifications = isQualifications; |
| | | } |
| | | |
| | | public String getAreaName() { |
| | | return areaName; |
| | | } |
| | | |
| | | public void setAreaName(String areaName) { |
| | | this.areaName = areaName; |
| | | } |
| | | |
| | | public String getCityName() { |
| | | return cityName; |
| | | } |
| | | |
| | | public void setCityName(String cityName) { |
| | | this.cityName = cityName; |
| | | } |
| | | |
| | | public String getProvinceName() { |
| | | return provinceName; |
| | | } |
| | | |
| | | public void setProvinceName(String provinceName) { |
| | | this.provinceName = provinceName; |
| | | } |
| | | |
| | | public Double getLon() { |
| | | return lon; |
| | | } |
| | | |
| | | public void setLon(Double lon) { |
| | | this.lon = lon; |
| | | } |
| | | |
| | | public Double getLat() { |
| | | return lat; |
| | | } |
| | | |
| | | public void setLat(Double lat) { |
| | | this.lat = lat; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OpenCity{" + |
| | | "code='" + code + '\'' + |
| | | ", lon=" + lon + |
| | | ", lat=" + lat + |
| | | ", isQualifications=" + isQualifications + |
| | | ", areaName='" + areaName + '\'' + |
| | | ", cityName='" + cityName + '\'' + |
| | | ", provinceName='" + provinceName + '\'' + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | */ |
| | | @TableField("companyId") |
| | | private Integer companyId; |
| | | /** |
| | | * 开通城市id |
| | | */ |
| | | @TableField("openCityId") |
| | | private Integer openCityId; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public Integer getOpenCityId() { |
| | | return openCityId; |
| | | } |
| | | |
| | | public void setOpenCityId(Integer openCityId) { |
| | | this.openCityId = openCityId; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Phone{" + |
| | |
| | | @TableField("companyId") |
| | | private Integer companyId; |
| | | /** |
| | | * 开通城市id |
| | | */ |
| | | @TableField("openCityId") |
| | | private Integer openCityId; |
| | | /** |
| | | * 推单距离(公里) |
| | | */ |
| | | @TableField("pushDistance") |
| | |
| | | @TableField("companyId") |
| | | private Integer companyId; |
| | | /** |
| | | * 开通城市id |
| | | */ |
| | | @TableField("openCityId") |
| | | private Integer openCityId; |
| | | /** |
| | | * 积分 |
| | | */ |
| | | @TableField("integral") |
| | |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public Integer getOpenCityId() { |
| | | return openCityId; |
| | | } |
| | | |
| | | public void setOpenCityId(Integer openCityId) { |
| | | this.openCityId = openCityId; |
| | | } |
| | | |
| | | public Integer getIntegral() { |
| | | return integral; |
| | | } |
| | |
| | | @TableField("companyId") |
| | | private Integer companyId; |
| | | /** |
| | | * 开通城市id |
| | | */ |
| | | @TableField("openCityId") |
| | | private Integer openCityId; |
| | | /** |
| | | * 金额 |
| | | */ |
| | | @TableField("money") |
| | |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public Integer getOpenCityId() { |
| | | return openCityId; |
| | | } |
| | | |
| | | public void setOpenCityId(Integer openCityId) { |
| | | this.openCityId = openCityId; |
| | | } |
| | | |
| | | public Double getMoney() { |
| | | return money; |
| | | } |
| | |
| | | */ |
| | | @TableField("deductMoney") |
| | | private Double deductMoney; |
| | | /** |
| | | * 开通城市id |
| | | */ |
| | | @TableField("openCityId") |
| | | private Integer openCityId; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.deductMoney = deductMoney; |
| | | } |
| | | |
| | | public Integer getOpenCityId() { |
| | | return openCityId; |
| | | } |
| | | |
| | | public void setOpenCityId(Integer openCityId) { |
| | | this.openCityId = openCityId; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | |
| | | */ |
| | | @ApiModelProperty("用户是否显示(1=是,2=否)") |
| | | private Integer userShow; |
| | | /** |
| | | * 开通城市id |
| | | */ |
| | | @TableField("openCityId") |
| | | private Integer openCityId; |
| | | |
| | | |
| | | public Integer getId() { |
| | |
| | | this.userShow = userShow; |
| | | } |
| | | |
| | | public Integer getOpenCityId() { |
| | | return openCityId; |
| | | } |
| | | |
| | | public void setOpenCityId(Integer openCityId) { |
| | | this.openCityId = openCityId; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | Map<String, Object> queryPhone(Integer uid) throws Exception; |
| | | Map<String, Object> queryPhone(Integer uid, String code) throws Exception; |
| | | |
| | | |
| | | /** |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.OpenCity; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IOpenCityService extends IService<OpenCity> { |
| | | |
| | | |
| | | /** |
| | | * 获取开通城市列表 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<BaseWarpper> queryOpenCity() throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 判断是否是开通城市 |
| | | * @param code |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | boolean openCity(String code) throws Exception; |
| | | |
| | | |
| | | OpenCity openCity1(String code) throws Exception; |
| | | |
| | | |
| | | OpenCity openCity1(String lon, String lat) throws Exception; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<PushOrder> querys(Integer type, Integer pushType, Integer companyId) throws Exception; |
| | | List<PushOrder> querys(Integer type, Integer pushType, Integer openCityId) throws Exception; |
| | | } |
| | |
| | | |
| | | @Autowired |
| | | private ICompanyCityService companyCityService; |
| | | @Autowired |
| | | private IOpenCityService openCityService; |
| | | |
| | | @Autowired |
| | | private GDFalconUtil gdFalconUtil; |
| | |
| | | private CarServiceMapper carServiceMapper; |
| | | |
| | | @Autowired |
| | | private PushUtil pushUtil; |
| | | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | |
| | | |
| | | private String salt = "SA;d5#"; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private OrderPrivateCarMapper orderPrivateCarMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private OrderCrossCityMapper orderCrossCityMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private OrderTaxiMapper orderTaxiMapper; |
| | | |
| | | @Autowired |
| | |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryPhone(String code) throws Exception { |
| | | Company query = companyCityService.query(code); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(null == query){ |
| | | map.put("phone", ""); |
| | | }else{ |
| | | Phone phone = phoneMapper.queryInfo(query.getId(), 2); |
| | | OpenCity openCity = openCityService.openCity1(code); |
| | | Phone phone = phoneMapper.queryInfo(openCity.getId(), 2, 2); |
| | | map.put("phone", null != phone ? phone.getPhone() : ""); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | |
| | | loginWarpper.setRongYunToken(token1.getToken()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(phone); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(phone); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryPhone(Integer uid) throws Exception { |
| | | public Map<String, Object> queryPhone(Integer uid, String code) throws Exception { |
| | | Driver driver = this.selectById(uid); |
| | | Company company = companyMapper.selectById(driver.getFranchiseeId() != null && driver.getFranchiseeId() != 0 ? driver.getFranchiseeId() : ( |
| | | driver.getCompanyId() != null && driver.getCompanyId() != 0 ? driver.getCompanyId() : 1)); |
| | | OpenCity openCity = openCityService.openCity1(code); |
| | | Company company = companyMapper.selectById(driver.getCompanyId()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(company.getType() == 3){//加盟商 |
| | | Phone phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | map.put("franchisee", null != phone ? phone.getPhone() : ""); |
| | | company = companyMapper.selectById(company.getSuperiorId()); |
| | | if(null != company){ |
| | | phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | map.put("branch", null != phone ? phone.getPhone() : ""); |
| | | }else{ |
| | | map.put("branch", ""); |
| | | } |
| | | company = companyMapper.selectById(company.getSuperiorId()); |
| | | if(null != company){ |
| | | phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | Phone phone = phoneMapper.queryInfo(openCity.getId(), 2, 2); |
| | | map.put("franchisee", null != phone ? phone.getPhone() : ""); |
| | | phone = phoneMapper.queryInfo(openCity.getId(), 2, 1); |
| | | map.put("platform", null != phone ? phone.getPhone() : ""); |
| | | }else{ |
| | | map.put("platform", ""); |
| | | } |
| | | return map; |
| | | } |
| | | if(company.getType() == 2){//分公司 |
| | | map.put("franchisee", ""); |
| | | Phone phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | Phone phone = phoneMapper.queryInfo(openCity.getId(), 2, 2); |
| | | map.put("branch", null != phone ? phone.getPhone() : ""); |
| | | company = companyMapper.selectById(company.getSuperiorId()); |
| | | if(null != company){ |
| | | phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | phone = phoneMapper.queryInfo(openCity.getId(), 2, 1); |
| | | map.put("platform",null != phone ? phone.getPhone() : ""); |
| | | }else{ |
| | | map.put("platform", ""); |
| | | } |
| | | return map; |
| | | } |
| | | if(company.getType() == 1){//平台 |
| | | map.put("franchisee", ""); |
| | | map.put("branch", ""); |
| | | Phone phone = phoneMapper.queryInfo(company.getId(), 2); |
| | | Phone phone = phoneMapper.queryInfo(company.getId(), 2, 1); |
| | | map.put("platform", null != phone ? phone.getPhone() : ""); |
| | | return map; |
| | | } |
| | |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | loginWarpper.setTerminalId(tid); |
| | | // String tid = gdFalconUtil.createTerminal(driver.getPhone()); |
| | | // loginWarpper.setServerId(gdFalconUtil.getServerId()); |
| | | // loginWarpper.setTerminalId(tid); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.dao.OpenCityMapper; |
| | | import com.stylefeng.guns.modular.system.model.OpenCity; |
| | | import com.stylefeng.guns.modular.system.service.IOpenCityService; |
| | | import com.stylefeng.guns.modular.system.util.GDMapGeocodingUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Service |
| | | public class OpenCityServiceImpl extends ServiceImpl<OpenCityMapper, OpenCity> implements IOpenCityService { |
| | | |
| | | @Resource |
| | | private OpenCityMapper openCityMapper; |
| | | |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | |
| | | |
| | | /** |
| | | * 获取开通城市列表 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<BaseWarpper> queryOpenCity() throws Exception { |
| | | List<OpenCity> openCities = openCityMapper.queryOpenCity(); |
| | | List<BaseWarpper> list = new ArrayList<>(); |
| | | for(OpenCity c : openCities){ |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setId(c.getId()); |
| | | baseWarpper.setName(ToolUtil.isEmpty(c.getProvinceName()) ? |
| | | (ToolUtil.isEmpty(c.getCityName()) ? (ToolUtil.isEmpty(c.getAreaName()) ? "" : c.getAreaName()) : c.getCityName()) : c.getProvinceName()); |
| | | baseWarpper.setLon(null != c.getLon() ? c.getLon() : 0); |
| | | baseWarpper.setLat(null != c.getLat() ? c.getLat() : 0); |
| | | baseWarpper.setContent(c.getCode()); |
| | | baseWarpper.setName(baseWarpper.getName().replaceAll("市辖区", "")); |
| | | list.add(baseWarpper); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断是否是开通城市 |
| | | * @param code |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public boolean openCity(String code) throws Exception { |
| | | String province = code.substring(0, 2) + "0000"; |
| | | String city = code.substring(0, 4) + "00"; |
| | | List<OpenCity> openCities = openCityMapper.queryByCode(code); |
| | | if(openCities.size() == 0){ |
| | | openCities = openCityMapper.queryByCode(city); |
| | | } |
| | | if(openCities.size() == 0){ |
| | | openCities = openCityMapper.queryByCode(province); |
| | | } |
| | | if(openCities.size() == 0){ |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public OpenCity openCity1(String code) throws Exception { |
| | | String province = code.substring(0, 2) + "0000"; |
| | | String city = code.substring(0, 4) + "00"; |
| | | List<OpenCity> openCities = openCityMapper.queryByCode(code); |
| | | if(openCities.size() == 0){ |
| | | openCities = openCityMapper.queryByCode(city); |
| | | } |
| | | if(openCities.size() == 0){ |
| | | openCities = openCityMapper.queryByCode(province); |
| | | } |
| | | if(openCities.size() == 0){ |
| | | return null; |
| | | } |
| | | return openCities.get(0); |
| | | } |
| | | |
| | | @Override |
| | | public OpenCity openCity1(String lon, String lat) throws Exception { |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(lon, lat); |
| | | String districtCode = geocode.get("districtCode"); |
| | | return openCity1(districtCode); |
| | | } |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.service.IAdditionalFeeService; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IOpenCityService; |
| | | import com.stylefeng.guns.modular.system.service.IOrderService; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.OrderListWarpper; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import org.redisson.api.RLock; |
| | | import org.redisson.api.RedissonClient; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | |
| | | @Autowired |
| | | private IAdditionalFeeService additionalFeeService; |
| | | |
| | | @Autowired |
| | | private RedissonClient redissonClient; |
| | | @Autowired |
| | | private IOpenCityService openCityService; |
| | | |
| | | |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public synchronized ResultUtil grabOrder(Integer orderId, Integer orderType, Integer uid) throws Exception { |
| | | switch (orderType){ |
| | | case 1://专车 |
| | | public ResultUtil grabOrder(Integer orderId, Integer orderType, Integer uid) throws Exception { |
| | | //专车和出租是批量下单,所以这里需要将两种类型的抢单操作通过一个锁来一起控制 |
| | | if(1 == orderType || 2 == orderType){ |
| | | RLock lock = redissonClient.getLock("grabOrder:" + orderId); |
| | | if(!lock.tryLock()){ |
| | | return ResultUtil.error("抢单失败,请稍后重试"); |
| | | } |
| | | try { |
| | | if(1 == orderType){ |
| | | return orderPrivateCarService.grabOrder(orderId, uid); |
| | | case 2://出租 |
| | | } |
| | | if(2 == orderType){ |
| | | return orderTaxiService.grabOrder(orderId, uid); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | lock.unlock(); |
| | | } |
| | | } |
| | | switch (orderType){ |
| | | case 3://城际 |
| | | return ResultUtil.success();//不作任何操作,跨城默认选择的司机 |
| | | case 4://同城小件 |
| | |
| | | */ |
| | | @Override |
| | | public Double queryReassignMoney(Integer orderId, Integer orderType) throws Exception { |
| | | Integer companyId = null; |
| | | Integer openCityId = null; |
| | | switch (orderType){ |
| | | case 1://专车 |
| | | companyId = orderPrivateCarService.selectById(orderId).getCompanyId(); |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | openCityId = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()).getId(); |
| | | break; |
| | | case 2://出租 |
| | | companyId = orderTaxiService.selectById(orderId).getCompanyId(); |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | | openCityId = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()).getId(); |
| | | break; |
| | | case 3://城际 |
| | | companyId = orderCrossCityService.selectById(orderId).getCompanyId(); |
| | | OrderCrossCity orderCrossCity = orderCrossCityService.selectById(orderId); |
| | | openCityId = openCityService.openCity1(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString()).getId(); |
| | | break; |
| | | case 4://同城小件 |
| | | companyId = orderLogisticsService.selectById(orderId).getCompanyId(); |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | openCityId = openCityService.openCity1(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()).getId(); |
| | | break; |
| | | case 5://跨城小件 |
| | | companyId = orderLogisticsService.selectById(orderId).getCompanyId(); |
| | | OrderLogistics orderLogistics1 = orderLogisticsService.selectById(orderId); |
| | | openCityId = openCityService.openCity1(orderLogistics1.getStartLon().toString(), orderLogistics1.getStartLat().toString()).getId(); |
| | | |
| | | break; |
| | | case 6: |
| | | break; |
| | | } |
| | | return sysReformistMapper.queryMoney(companyId); |
| | | return sysReformistMapper.queryMoney(openCityId); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | //调用移动的小号接口 |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderPrivateCar.setTelX(map.get("telX")); |
| | | orderPrivateCar.setBindId(map.get("bindId")); |
| | | } |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderPrivateCar.setTelX(map.get("telX")); |
| | | // orderPrivateCar.setBindId(map.get("bindId")); |
| | | // } |
| | | orderPrivateCarService.updateById(orderPrivateCar); |
| | | } |
| | | break; |
| | |
| | | } |
| | | //调用移动的小号接口 |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderTaxi.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderTaxi.setTelX(map.get("telX")); |
| | | orderTaxi.setBindId(map.get("bindId")); |
| | | } |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderTaxi.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderTaxi.setTelX(map.get("telX")); |
| | | // orderTaxi.setBindId(map.get("bindId")); |
| | | // } |
| | | orderTaxiService.updateById(orderTaxi); |
| | | } |
| | | break; |
| | |
| | | } |
| | | //调用移动的小号接口 |
| | | Driver driver = driverService.selectById(orderCrossCity.getDriverId()); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderCrossCity.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderCrossCity.setTelX(map.get("telX")); |
| | | orderCrossCity.setBindId(map.get("bindId")); |
| | | } |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderCrossCity.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderCrossCity.setTelX(map.get("telX")); |
| | | // orderCrossCity.setBindId(map.get("bindId")); |
| | | // } |
| | | orderCrossCityService.updateById(orderCrossCity); |
| | | } |
| | | break; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.PhoneMapper; |
| | | import com.stylefeng.guns.modular.system.model.OpenCity; |
| | | import com.stylefeng.guns.modular.system.model.Phone; |
| | | import com.stylefeng.guns.modular.system.service.IOpenCityService; |
| | | import com.stylefeng.guns.modular.system.service.IPhoneService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | @Resource |
| | | private PhoneMapper phoneMapper; |
| | | @Autowired |
| | | private IOpenCityService openCityService; |
| | | |
| | | /** |
| | | * 获取所有系统电话 |
| | |
| | | */ |
| | | @Override |
| | | public List<Phone> queryPhones(String code) throws Exception { |
| | | String province = code.substring(0, 2) + "0000"; |
| | | String city = code.substring(0, 4) + "00"; |
| | | |
| | | List<Phone> list = phoneMapper.queryPhones(province, city, code); |
| | | if(list.size() == 0){ |
| | | list = phoneMapper.queryPhones(province, city, null); |
| | | } |
| | | if(list.size() == 0){ |
| | | list = phoneMapper.queryPhones(province, null, null); |
| | | } |
| | | OpenCity openCity = openCityService.openCity1(code); |
| | | List<Phone> list = phoneMapper.queryPhones(openCity.getId()); |
| | | return list; |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryCustomerPhone(String code) throws Exception { |
| | | String province = code.substring(0, 2) + "0000"; |
| | | String city = code.substring(0, 4) + "00"; |
| | | OpenCity openCity = openCityService.openCity1(code); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //平台电话 |
| | | Phone query = phoneMapper.query(2, 1, null, null, null); |
| | | Phone query = phoneMapper.queryInfo(openCity.getId(), 2, 1); |
| | | map.put("platform", null != query ? query.getPhone() : ""); |
| | | |
| | | //公司 |
| | | query = phoneMapper.query(2, null, province, city, code); |
| | | if(query == null){ |
| | | query = phoneMapper.query(2, null, province, city, null); |
| | | } |
| | | if(query == null){ |
| | | query = phoneMapper.query(2, null, province, null, null); |
| | | } |
| | | query = phoneMapper.queryInfo(openCity.getId(), 2, 2); |
| | | map.put("company", null != query ? query.getPhone() : ""); |
| | | |
| | | //调度电话 |
| | | query = phoneMapper.query(3, null, province, city, code); |
| | | if(query == null){ |
| | | query = phoneMapper.query(3, null, province, city, null); |
| | | } |
| | | if(query == null){ |
| | | query = phoneMapper.query(3, null, province, null, null); |
| | | } |
| | | query = phoneMapper.queryInfo(openCity.getId(), 3, null); |
| | | map.put("scheduling", null != query ? query.getPhone() : ""); |
| | | return map; |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<PushOrder> querys(Integer type, Integer pushType, Integer companyId) throws Exception { |
| | | return pushOrderMapper.querys(type, pushType, companyId); |
| | | public List<PushOrder> querys(Integer type, Integer pushType, Integer openCityId) throws Exception { |
| | | return pushOrderMapper.querys(type, pushType, openCityId); |
| | | } |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import com.stylefeng.guns.modular.taxi.service.impl.OrderTaxiServiceImpl; |
| | | import org.apache.commons.lang.time.DateFormatUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | private IPushOrderService pushOrderService; |
| | | |
| | | @Autowired |
| | | private IOpenCityService openCityService; |
| | | |
| | | @Autowired |
| | | private PushUtil pushUtil; |
| | | |
| | | /** |
| | |
| | | if (ToolUtil.isNotEmpty(vehicle)) { |
| | | integers = JSON.parseArray(vehicle).toJavaList(Integer.class); |
| | | } |
| | | Company query = companyCityService.query(String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, query.getId());//获取需要推送的次数 |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, openCity.getId());//获取需要推送的次数 |
| | | for (int i = 1; i <=6; i++) { |
| | | PushOrder pushOrder = pushOrderService.querys(i, 2, query.getId()).get(0); |
| | | int finalI = i; |
| | | PushOrder pushOrder = querys.stream().filter(s -> s.getType() == (finalI <= 3 ? finalI : 3)).findFirst().orElse(null); |
| | | System.out.println("pushOrder:" + pushOrder); |
| | | //获取空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(2, orderTaxi.getStartLon(), orderTaxi.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | integers = JSON.parseArray(vehicle).toJavaList(Integer.class); |
| | | } |
| | | Company query = companyCityService.query(String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//获取需要推送的次数 |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, openCity.getId());//获取需要推送的次数 |
| | | for(int i = 1; i <= 6; i++){ |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(id); |
| | | if (null == orderPrivateCar || orderPrivateCar.getState() > 1) { |
| | | break; |
| | | } |
| | | PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0); |
| | | int finalI = i; |
| | | PushOrder pushOrder = querys.stream().filter(s -> s.getType() == (finalI <= 3 ? finalI : 3)).findFirst().orElse(null); |
| | | System.out.println("pushOrder:"+pushOrder); |
| | | int i2 = pushOrder.getPushTime() / 10; |
| | | if(i2==0){ |
| | |
| | | public QianYunTongConfig getQianYunTongConfig() { |
| | | if("dev".equals(activeProfile)){ |
| | | this.appkey = "10001104"; |
| | | this.privateKeyPath = "C:\\Users\\Admin\\Desktop\\private_key_test.pem"; |
| | | this.privateKeyPath = "C:\\Users\\Administrator\\Desktop\\private_key_test.pem"; |
| | | this.userName = "xiaofei"; |
| | | this.status = "1"; |
| | | this.setApiUrl("https://test-zhongtai.stqcloud.com:10070"); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public synchronized ResultUtil grabOrder(Integer orderId, Integer uid) throws Exception { |
| | | public ResultUtil grabOrder(Integer orderId, Integer uid) throws Exception { |
| | | OrderPrivateCar orderPrivateCar1 = orderPrivateCarService.selectById(orderId); |
| | | if(null != orderPrivateCar1 && orderPrivateCar1.getType() == 3 && orderPrivateCar1.getState() != 1&& orderPrivateCar1.getState() != 11){ |
| | | return ResultUtil.error("订单已被抢了"); |
| | |
| | | orderTaxi.setSnatchOrderTime(new Date()); |
| | | |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderTaxi.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderTaxi.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderTaxi.setTelX(map.get("telX")); |
| | | orderTaxi.setBindId(map.get("bindId")); |
| | | } |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderTaxi.setTrackId(track); |
| | | // |
| | | // //调用移动的小号接口 |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderTaxi.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderTaxi.setTelX(map.get("telX")); |
| | | // orderTaxi.setBindId(map.get("bindId")); |
| | | // } |
| | | |
| | | this.updateById(orderTaxi); |
| | | |
| | |
| | | } |
| | | |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderTaxi.setTrackId(track); |
| | | // String s = gdFalconUtil.selectTerminal(driver.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderTaxi.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 TODO 车载端使用真实号码 |
| | | // Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | |
| | | max-request-size: 100MB |
| | | max-file-size: 100MB |
| | | redis: |
| | | host: 127.0.0.1 |
| | | host: 192.168.110.80 |
| | | port: 6379 |
| | | password: 123456 |
| | | database: 0 |
| | |
| | | appletsAppSecret: 5610fc6126255ca5f7bd9fa4330338b6 # |
| | | mchId: 111 #微信支付分配的商户号 |
| | | key: 111 #key为商户平台设置的密钥key: |
| | | url: https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={0}&secret={1} |
| | | |
| | | --- |
| | | |
| | |
| | | server: |
| | | port: 8007 |
| | | |
| | | guns: |
| | | swagger-open: true #是否开启swagger (true/false) |
| | | kaptcha-open: false #是否开启登录时验证码 (true/false) |
| | | file-upload-path: d:/tmp #文件上传目录(不配置的话为java.io.tmpdir目录) |
| | | picture-server-address: http://192.168.0.43/resources/ #图片服务器地址 |
| | | spring-session-open: false #是否开启spring session,如果是多机环境需要开启(true/false) |
| | | session-invalidate-time: 1800 #session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒 |
| | | session-validation-interval: 900 #多久检测一次失效的session(只在单机环境下生效) 单位:秒 |
| | | |
| | | spring: |
| | | application: |
| | | name: driver-server |
| | | profiles: |
| | | active: dev |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | | prefix: /WEB-INF/view |
| | | devtools: |
| | | restart: |
| | | enabled: false |
| | | additional-paths: src/main/java |
| | | exclude: static/**,WEB-INF/view/** |
| | | servlet: |
| | | multipart: |
| | | max-request-size: 100MB |
| | | max-file-size: 100MB |
| | | redis: |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: 123456 |
| | | database: 0 |
| | | timeout: 1000 |
| | | # cluster: |
| | | # nodes: 172.21.35.151:6512,172.21.35.152:6512,172.21.35.153:6512,172.21.35.151:6513,172.21.35.152:6513,172.21.35.153:6513 |
| | | |
| | | mybatis-plus: |
| | | typeAliasesPackage: com.stylefeng.guns.modular |
| | | global-config: |
| | | id-type: 0 #0:数据库ID自增 1:用户输入id 2:全局唯一id(IdWorker) 3:全局唯一ID(uuid) |
| | | db-column-underline: false |
| | | configuration: |
| | | configuration.map-underscore-to-camel-case: true #是否开启自动驼峰命名规则(camel case)映射 |
| | | log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl #输出Sql,如需打印Sql注释该配置 |
| | | |
| | | |
| | | eureka: |
| | | client: |
| | | service-url: #注册中心地址 |
| | | defaultZone: http://sinata:sinata@127.0.0.1:8000/eureka #启用身份验证的方式连接 |
| | | register-with-eureka: true #在注册中心进行注册 |
| | | fetch-registry: true #从Eureka中获取注册信息。 |
| | | |
| | | --- |
| | | |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://172.21.35.140:8066/traffic_scdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: traffic_scusr |
| | | password: QYT_sc@20#25 |
| | | db-name: traffic_scdb #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | | --- |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://qyt_jtcx:qyt_jtcx2025@172.21.35.195:27017,172.21.35.196:27017/traveling_track |
| | | |
| | | --- |
| | | |
| | | wx: |
| | | grantType: authorization_code #填authorization_code |
| | | appid: 111 #应用唯一标识,在微信开放平台提交应用审核通过后获得 |
| | | appSecret: 111 #应用密钥AppSecret,在微信开放平台提交应用审核通过后获得 |
| | | appletsAppid: wxcc3c9058e2b294db #小程序APPid |
| | | appletsAppSecret: 5610fc6126255ca5f7bd9fa4330338b6 # |
| | | mchId: 111 #微信支付分配的商户号 |
| | | key: 111 #key为商户平台设置的密钥key: |
| | | url: https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={0}&secret={1} |
| | | rongyun: |
| | | app_key: bmdehs6pbnozs |
| | | app_secret: RovVwtABN1 |
| | | --- |
| | | |
| | | alipay: |
| | | appid: 111 #应用程序唯一标识 |
| | | appPrivateKey: 111 #开发者应用私钥 |
| | | alipayPublicKey: 1 #应用公钥 |
| | | alipay_public_key: 111 #支付宝公钥 |
| | | |
| | | --- |
| | | |
| | | juhe: #聚合数据 |
| | | appKey: 111 # |
| | | |
| | | |
| | | --- |
| | | |
| | | jiguang: |
| | | appKey-driver: 111 #极光推送应用唯一标识 |
| | | masterSecret-driver: 111 #用于服务器端 API 调用时与 AppKey 配合使用达到鉴权的目的 |
| | | appKey-dispatch: 111 #极光推送应用唯一标识 |
| | | masterSecret-dispatch: 111 #用于服务器端 API 调用时与 AppKey 配合使用达到鉴权的目的 |
| | | |
| | | |
| | | --- |
| | | |
| | | #支付回调地址 |
| | | #正式环境 |
| | | callbackPath: https://traffic.qytzt.cn/driver |
| | | |
| | | --- |
| | | #交通部推送数据功能开关 |
| | | pushMinistryOfTransport: false |
| | | |
| | | active: "@spring.active@" |
| | |
| | | max-request-size: 500MB |
| | | max-file-size: 500MB |
| | | redis: |
| | | host: 127.0.0.1 |
| | | host: 192.168.110.80 |
| | | port: 6379 |
| | | password: 123456 |
| | | |
| | |
| | | <div> |
| | | <div style="float: left;"> |
| | | <label class="lab checked" onclick="checkedLable(this)" tag="pushOrderSettings">推单设置</label> |
| | | <!-- <label class="lab" onclick="checkedLable(this)" tag="driverPayDays">司机分账账期设置</label>--> |
| | | <label class="lab" onclick="checkedLable(this)" tag="driverPayDays">司机分账账期设置</label> |
| | | <label class="lab" onclick="checkedLable(this)" tag="cancelOrderSettings">取消订单设置</label> |
| | | <label class="lab" onclick="checkedLable(this)" tag="cancelTheReservationOrderSetting">预约单取消设置</label> |
| | | <!-- <label class="lab" onclick="checkedLable(this)" tag="spellOrderSetting">拼单派单设置</label>--> |
| | | <!-- <label class="lab" onclick="checkedLable(this)" tag="timeoutDeductionSettings">超时扣款设置</label>--> |
| | | <label class="lab" onclick="checkedLable(this)" tag="spellOrderSetting">拼单派单设置</label> |
| | | <label class="lab" onclick="checkedLable(this)" tag="timeoutDeductionSettings">超时扣款设置</label> |
| | | <label class="lab" onclick="checkedLable(this)" tag="reassigningSet">改派设置</label> |
| | | <!-- <label class="lab" onclick="checkedLable(this)" tag="faceRecognitionSettings">人脸识别设置</label>--> |
| | | <label class="lab" onclick="checkedLable(this)" tag="faceRecognitionSettings">人脸识别设置</label> |
| | | <label class="lab" onclick="checkedLable(this)" tag="integralSet">积分设置</label> |
| | | <!-- <label class="lab" onclick="checkedLable(this)" tag="withdrawalFeeSetting">提现手续费设置</label>--> |
| | | <label class="lab" onclick="checkedLable(this)" tag="withdrawalFeeSetting">提现手续费设置</label> |
| | | <label class="lab" onclick="checkedLable(this)" tag="phoneSettings">电话设置</label> |
| | | <label class="lab" onclick="checkedLable(this)" tag="holidayServiceFeeSetting">节假日服务费设置</label> |
| | | <!-- <label class="lab" onclick="checkedLable(this)" tag="95128TheOnCall">95128电召</label>--> |
| | | <label class="lab" onclick="checkedLable(this)" tag="95128TheOnCall">95128电召</label> |
| | | <label class="lab" onclick="checkedLable(this)" tag="moduleManagement">模块管理</label> |
| | | </div> |
| | | <div style="float: left;width: 1200px;margin-left: 50px;"> |
| | |
| | | port: 6000 |
| | | spring: |
| | | profiles: |
| | | # active: dev |
| | | active: prod |
| | | active: dev |
| | | # active: prod |
| | | application: |
| | | name: message #服务名称 |
| | | servlet: |
| | |
| | | max-request-size: 100MB |
| | | max-file-size: 100MB |
| | | redis: |
| | | host: 172.21.35.151 |
| | | port: 6512 |
| | | password: SC_cache@20#25 |
| | | database: 0 |
| | | timeout: 1000 |
| | | cluster: |
| | | nodes: 172.21.35.151:6512,172.21.35.152:6512,172.21.35.153:6512,172.21.35.151:6513,172.21.35.152:6513,172.21.35.153:6513 |
| | | host: 192.168.110.80 |
| | | port: 6379 |
| | | password: 123456 |
| | | # host: 172.21.35.151 |
| | | # port: 6512 |
| | | # password: SC_cache@20#25 |
| | | # database: 0 |
| | | # timeout: 1000 |
| | | # cluster: |
| | | # nodes: 172.21.35.151:6512,172.21.35.152:6512,172.21.35.153:6512,172.21.35.151:6513,172.21.35.152:6513,172.21.35.153:6513 |
| | | |
| | |
| | | <scope>system</scope> |
| | | <systemPath>${pom.basedir}/lib/openApiClient-1.0.0.jar</systemPath> |
| | | </dependency> |
| | | <!--单点登录sdk--> |
| | | <dependency> |
| | | <groupId>com.cas</groupId> |
| | | <artifactId>cas-client-oncon</artifactId> |
| | | <version>3.0.5</version> |
| | | <scope>system</scope> |
| | | <systemPath>${pom.basedir}/lib/cas-client-oncon-3.0.5.jar</systemPath> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.cas</groupId> |
| | | <artifactId>cas-client-oncon-core</artifactId> |
| | | <version>1.2.2</version> |
| | | <scope>system</scope> |
| | | <systemPath>${pom.basedir}/lib/cas-client-oncon-core-1.2.2.jar</systemPath> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>commons-httpclient</groupId> |
| | | <artifactId>commons-httpclient</artifactId> |
| | |
| | | package com.stylefeng.guns.modular.CharteredCar.server.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.CharteredCar.dao.OrderCharteredCarMapper; |
| | | import com.stylefeng.guns.modular.CharteredCar.model.OrderCharteredCar; |
| | | import com.stylefeng.guns.modular.CharteredCar.server.IOrderCharteredCarService; |
| | | import com.stylefeng.guns.modular.account.controller.AppOrderController; |
| | | import com.stylefeng.guns.modular.api.OrderController; |
| | | import com.stylefeng.guns.modular.crossCity.dao.OrderCrossCityMapper; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.system.dao.SensitiveWordsMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.Company; |
| | | import com.stylefeng.guns.modular.system.model.OrderCancel; |
| | | import com.stylefeng.guns.modular.system.model.SensitiveWords; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.util.PayMoneyUtil; |
| | |
| | | |
| | | @Autowired |
| | | private IPaymentRecordService paymentRecordService; |
| | | @Autowired |
| | | private IOpenCityService openCityService; |
| | | |
| | | @Autowired |
| | | private IIncomeService incomeService; |
| | |
| | | } |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralService.selectOne(new EntityWrapper<SysIntegral>().eq("companyId", orderCharteredCar.getCompanyId())); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分 |
| | | // OpenCity openCity = openCityService.openCity1(orderCharteredCar.getStartLon().toString(), orderCharteredCar.getStartLat().toString()); |
| | | // SysIntegral query1 = sysIntegralService.selectOne(new EntityWrapper<SysIntegral>().eq("openCityId", openCity.getId())); |
| | | // userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "包车-感谢费", money, 2, 1, 1, 6, orderId); |
| | |
| | | paymentRecordService.updateById(query); |
| | | |
| | | UserInfo userInfo = userInfoService.selectById(orderCharteredCar.getUserId()); |
| | | SysIntegral query1 = sysIntegralService.selectOne(new EntityWrapper<SysIntegral>().eq("companyId", orderCharteredCar.getCompanyId())); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | // OpenCity openCity = openCityService.openCity1(orderCharteredCar.getStartLon().toString(), orderCharteredCar.getStartLat().toString()); |
| | | // SysIntegral query1 = sysIntegralService.selectOne(new EntityWrapper<SysIntegral>().eq("openCityId", openCity.getId())); |
| | | // userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(userInfo.getId(), "包车-感谢费", query.getAmount(), 2, 1, 1, 6, orderId); |
| | | userInfoService.updateById(userInfo); |
| | |
| | | private IOrderPrivateCarService orderPrivateCarService; |
| | | |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | |
| | | @Autowired |
| | | private IComplaintService complaintService; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Resource |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | @Resource |
| | | private ISystemPriceCityService systemPriceCityService; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | if(orderPrivateCar.getState()>1){ |
| | | Map<String, Object> query1 = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId()); |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | String provinceCode = geocode.get("provinceCode"); |
| | | String cityCode = geocode.get("cityCode"); |
| | | String districtCode = geocode.get("districtCode"); |
| | | //获取匹配的城市价格配置 |
| | | SystemPriceCity systemPriceCity = systemPriceCityService.queryOne(provinceCode, cityCode, districtCode); |
| | | if (null == systemPriceCity) { |
| | | return ResultUtil.error("请先配置价格规则"); |
| | | } |
| | | Map<String, Object> query1 = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId(), systemPriceCity.getId()); |
| | | System.out.println("参数:"+orderPrivateCar.getCompanyId()+"|"+orderPrivateCar.getServerCarModelId()); |
| | | System.out.println("query1:"+query1); |
| | | //开始根据不同的方式计算金额 |
| | |
| | | import com.stylefeng.guns.modular.call.dao.OrderCallMapper; |
| | | import com.stylefeng.guns.modular.call.model.OrderCall; |
| | | import com.stylefeng.guns.modular.call.server.IOrderCallService; |
| | | import com.stylefeng.guns.modular.system.model.OpenCity; |
| | | import com.stylefeng.guns.modular.system.model.SysIntegral; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.IIncomeService; |
| | | import com.stylefeng.guns.modular.system.service.ISysIntegralService; |
| | | import com.stylefeng.guns.modular.system.service.ISystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.PayMoneyUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.UUIDUtil; |
| | |
| | | |
| | | @Autowired |
| | | private ISysIntegralService sysIntegralService; |
| | | @Autowired |
| | | private IOpenCityService openCityService; |
| | | |
| | | @Autowired |
| | | private IIncomeService incomeService; |
| | |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralService.selectOne(new EntityWrapper<SysIntegral>().eq("companyId", orderCall.getCompanyId())); |
| | | OpenCity openCity = openCityService.openCity1(orderCall.getStartLon().toString(), orderCall.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralService.selectOne(new EntityWrapper<SysIntegral>().eq("openCityId", openCity.getId())); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | |
| | | paymentRecordService.updateById(query); |
| | | |
| | | UserInfo userInfo = userInfoService.selectById(orderCall.getUserId()); |
| | | SysIntegral query1 = sysIntegralService.selectOne(new EntityWrapper<SysIntegral>().eq("companyId", orderCall.getCompanyId())); |
| | | OpenCity openCity = openCityService.openCity1(orderCall.getStartLon().toString(), orderCall.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralService.selectOne(new EntityWrapper<SysIntegral>().eq("openCityId", openCity.getId())); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(userInfo.getId(), "助老模式-感谢费", query.getAmount(), 2, 1, 1, 7, orderId); |
| | |
| | | public static Map<Integer, Boolean> pushEndMap = new HashMap<>(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 计算支付金额 |
| | | * |
| | | * @param startLonLat |
| | | * @param endLonLat |
| | | * @param peopleNumber |
| | |
| | | |
| | | /** |
| | | * 获取用户余额和可用优惠券数量 |
| | | * |
| | | * @param orderId |
| | | * @param uid |
| | | * @return |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取支付页面的优惠券列表 |
| | | * |
| | | * @param orderId |
| | | * @param uid |
| | | * @param pageNum |
| | |
| | | |
| | | /** |
| | | * 订单支付 |
| | | * |
| | | * @param payType |
| | | * @param orderId |
| | | * @param couponId |
| | |
| | | } |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderCrossCity.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | |
| | | |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderCrossCity.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | |
| | | |
| | | @Autowired |
| | | private AppOrderController appOrderController; |
| | | |
| | | /** |
| | | * 支付成功后的回调操作 |
| | | * |
| | | * @param id 订单=id |
| | | * @param order_id 工行支付单号 |
| | | * @param type 1=微信,2=支付宝 |
| | |
| | | this.updateById(orderCrossCity); |
| | | |
| | | UserInfo userInfo = userInfoService.selectById(orderCrossCity.getUserId()); |
| | | SysIntegral query1 = sysIntegralMapper.query(orderCrossCity.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | userInfoService.updateById(userInfo); |
| | | |
| | |
| | | |
| | | /** |
| | | * 跨城下单操作 |
| | | * |
| | | * @param orderCrossCityWarpper |
| | | * @param uid |
| | | * @return |
| | |
| | | } |
| | | |
| | | //调用移动的小号接口 |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderCrossCity.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderCrossCity.setTelX(map.get("telX")); |
| | | orderCrossCity.setBindId(map.get("bindId")); |
| | | } |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderCrossCity.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderCrossCity.setTelX(map.get("telX")); |
| | | // orderCrossCity.setBindId(map.get("bindId")); |
| | | // } |
| | | this.insert(orderCrossCity); |
| | | |
| | | if(driver.getState() == 2){ |
| | |
| | | |
| | | /** |
| | | * 获取订单 |
| | | * |
| | | * @param uid |
| | | * @param state |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取订单详情 |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取取消订单的支付费用 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | if(null == orderCrossCity){ |
| | | return ResultUtil.error("获取数据失败,订单信息有误"); |
| | | } |
| | | OpenCity openCity = openCityService.openCity1(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString()); |
| | | double amount = 0; |
| | | CancleOrder query = cancleOrderService.query(1, 3, orderCrossCity.getCompanyId()); |
| | | CancleOrder query = cancleOrderService.query(1, 3, openCity.getId()); |
| | | if(null != orderCrossCity.getDriverId() && |
| | | (orderCrossCity.getSnatchOrderTime().getTime() + query.getMinuteNum() * 60 * 1000) < new Date().getTime()){//收费的情况 |
| | | if(null != query){ |
| | |
| | | |
| | | /** |
| | | * 取消订单操作 |
| | | * |
| | | * @param id |
| | | * @param payType |
| | | * @param cancleId |
| | |
| | | }else{ |
| | | orderCancel = orderCancelService.selectById(cancleId); |
| | | } |
| | | |
| | | CancleOrder query = cancleOrderService.query(1, 3, orderCrossCity.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString()); |
| | | CancleOrder query = cancleOrderService.query(1, 3, openCity.getId()); |
| | | if(null != query){ |
| | | if(payType == 1){//微信支付 |
| | | String value = (String) redisTemplate.opsForValue().get("appletOpenId"); |
| | |
| | | |
| | | /** |
| | | * 计算价格 |
| | | * |
| | | * @param distance |
| | | * @param peopleNumber |
| | | * @param travelMode |
| | |
| | | |
| | | /** |
| | | * 删除定时任务 |
| | | * |
| | | * @param orderId |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 获取红包 |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 分享成功后添加红包 |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 取消订单支付后的处理 |
| | | * |
| | | * @param id 订单=id |
| | | * @param order_id 工行支付单号 |
| | | * @param type 1=微信,2=支付宝 |
| | |
| | | |
| | | /** |
| | | * 获取个人中心订单列表 |
| | | * |
| | | * @param uid |
| | | * @param pageNum |
| | | * @param size |
| | |
| | | |
| | | /** |
| | | * 获取红包使用记录 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 添加跨城取消(直接取消不需要支付费用,退款) |
| | | * |
| | | * @param id |
| | | * @param reason |
| | | * @param remark |
| | |
| | | } |
| | | |
| | | //还原座位 |
| | | CancleOrder query1 = cancleOrderService.query(1, 3, orderCrossCity.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString()); |
| | | CancleOrder query1 = cancleOrderService.query(1, 3, openCity.getId()); |
| | | if (null != query1) { |
| | | if((orderCrossCity.getSnatchOrderTime().getTime() + query1.getMinuteNum() * 60 * 1000) < new Date().getTime() && query1.getMoney().compareTo(0D) > 0){//需要付费的情况 |
| | | integer = orderCancelService.saveData(id, 3, reason, remark, null, query1.getMoney(), 1, 1, uid); |
| | |
| | | |
| | | /** |
| | | * 获取服务中的订单数据 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 摆渡下单 |
| | | * |
| | | * @param serverCarModelIds |
| | | * @param travelTime |
| | | * @param placementLon |
| | |
| | | |
| | | /** |
| | | * 出租车摆渡单 |
| | | * |
| | | * @param travelTime |
| | | * @param placementLon |
| | | * @param placementLat |
| | |
| | | |
| | | /** |
| | | * 专车摆渡单 |
| | | * |
| | | * @param serverCarModelId |
| | | * @param travelTime |
| | | * @param placementLon |
| | |
| | | |
| | | /** |
| | | * 摆渡车推单操作 |
| | | * |
| | | * @param list |
| | | * @throws Exception |
| | | */ |
| | |
| | | if(orderType == 1){//专车 |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarMapper.selectById(orderId); |
| | | OrderPrivateCarServiceImpl.orderIds.add(orderPrivateCar.getId());//添加记录,防止调用接口重复提醒无人接单 |
| | | Company query = companyCityService.query(String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//获取需要推送的次数 |
| | | for(int i = 1; i <= querys.size(); i++){ |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, openCity.getId());//获取需要推送的次数 |
| | | for (int i = 1; i <= querys.size() + 5; i++) { |
| | | //订单被抢后的处理 |
| | | Integer state = orderPrivateCarMapper.selectById(orderId).getState(); |
| | | if(state != 1){ |
| | |
| | | } |
| | | |
| | | //开始进行推送的处理 |
| | | PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0); |
| | | int finalI = i; |
| | | PushOrder pushOrder = querys.stream().filter(s -> s.getType() == (finalI <= 3 ? finalI : 3)).findFirst().orElse(null); |
| | | //获取空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | if(list.size() > 0){ |
| | |
| | | |
| | | //所有推送完后的处理 |
| | | Boolean b = pushEndMap.get(orderPrivateCar.getCrossCityOrderId()); |
| | | if(i == querys.size() && state == 1 && (null != b && !b.booleanValue())){ |
| | | if (i == querys.size() + 5 && state == 1 && (null != b && !b.booleanValue())) { |
| | | pushUtil.pushEndPush(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1); |
| | | OrderPrivateCarServiceImpl.orderIds.remove(orderPrivateCar.getId()); |
| | | pushEndMap.put(orderPrivateCar.getCrossCityOrderId(), Boolean.TRUE);//推送后添加标识 |
| | |
| | | if(orderType == 2){//出租车 |
| | | OrderTaxi orderTaxi = orderTaxiMapper.selectById(orderId); |
| | | OrderTaxiServiceImpl.orderIds.add(orderTaxi.getId());//添加记录,防止调用接口重复提醒无人接单 |
| | | Company query = companyCityService.query(String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, query.getId());//获取需要推送的次数 |
| | | for(int i = 1; i <= querys.size(); i++){ |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, openCity.getId());//获取需要推送的次数 |
| | | for (int i = 1; i <= querys.size() + 5; i++) { |
| | | //处理订单被抢 |
| | | Integer state = orderTaxiMapper.selectById(orderId).getState(); |
| | | if(state != 1){ |
| | |
| | | } |
| | | |
| | | //开始进行推送 |
| | | PushOrder pushOrder = pushOrderService.querys(i, 2, query.getId()).get(0); |
| | | int finalI = i; |
| | | PushOrder pushOrder = querys.stream().filter(s -> s.getType() == (finalI <= 3 ? finalI : 3)).findFirst().orElse(null); |
| | | //获取空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(2, orderTaxi.getStartLon(), orderTaxi.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | | if(list.size() > 0){ |
| | |
| | | |
| | | //所有推送完后的处理 |
| | | Boolean b = pushEndMap.get(orderTaxi.getCrossCityOrderId()); |
| | | if(i == querys.size() && state == 1 && (null != b && !b.booleanValue())){ |
| | | if (i == querys.size() + 5 && state == 1 && (null != b && !b.booleanValue())) { |
| | | pushUtil.pushEndPush(1, orderTaxi.getUserId(), orderTaxi.getId(), 2); |
| | | OrderTaxiServiceImpl.orderIds.remove(orderTaxi.getId()); |
| | | pushEndMap.put(orderTaxi.getCrossCityOrderId(), Boolean.TRUE);//推送后添加标识 |
| | |
| | | |
| | | /** |
| | | * 获取订单编号 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | // } |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderCrossCity.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | |
| | | query.setCode(order_id); |
| | | paymentRecordService.updateById(query); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderCrossCity.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | |
| | | //添加司机信息 |
| | | DriverInfoWarpper driverInfoWarpper = new DriverInfoWarpper(); |
| | | Driver driver = driverService.selectById(orderCrossCity.getDriverId()); |
| | | BeanUtils.copyProperties(driver, driverInfoWarpper); unPayOrderVO.setDriverInfoWarpper(driverInfoWarpper); |
| | | BeanUtils.copyProperties(driver, driverInfoWarpper); |
| | | unPayOrderVO.setDriverInfoWarpper(driverInfoWarpper); |
| | | //其余信息 |
| | | BeanUtils.copyProperties(orderCrossCity, unPayOrderVO); |
| | | unPayOrderVOList.add(unPayOrderVO); |
| | |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.CouponWarpper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Api("新增2.0") |
| | | @RestController |
| | |
| | | |
| | | @Autowired |
| | | private ICompanyService companyService; |
| | | |
| | | @Autowired |
| | | private IOpenCityService openCityService; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/newlyAdded/getShowModular") |
| | | @ApiOperation(value = "获取显示模块设置", tags = {"用户端-2.0新增"}, notes = "") |
| | | @ApiOperation(value = "获取显示模块设置(黔云通)", tags = {"用户端-2.0新增"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "当前经度", name = "lon", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "当前纬度", name = "lon", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<TbShowModular>> getShowModular(HttpServletRequest request){ |
| | | public ResultUtil<List<TbShowModular>> getShowModular(String lon, String lat, HttpServletRequest request){ |
| | | try { |
| | | // Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | // if(null == uid){ |
| | | // return ResultUtil.tokenErr(); |
| | | // } |
| | | return ResultUtil.success(showModularService.selectList(null)); |
| | | OpenCity openCity = openCityService.openCity1(lon, lat); |
| | | return ResultUtil.success(showModularService.selectList(new EntityWrapper<TbShowModular>().eq("openCityId",openCity.getId()))); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | Double price1 = 0D; |
| | | Double price2 = 0D; |
| | | if(type == 4){//同城 |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null); |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null, null); |
| | | if(null == query1){ |
| | | return ResultUtil.error("请先完善价格设定"); |
| | | } |
| | |
| | | price1 = jsonObject.getDouble("num2"); |
| | | price2 = jsonObject.getDouble("num13"); |
| | | }else{ |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null); |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null, null); |
| | | if(null == query1){ |
| | | return ResultUtil.error("请先完善价格设定"); |
| | | } |
| | |
| | | // TODO: 2023/11/4 无法修改 |
| | | Map<String, String> distance = gdMapElectricFenceUtil.getDistance(startLon + "," + startLat, location, 1); |
| | | double distance1 = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null); |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null, null); |
| | | if(null != query1){ |
| | | if(type == 4){ |
| | | JSONObject jsonObject = JSON.parseObject(query1.get("content").toString()); |
| | |
| | | Double price1 = 0D; |
| | | Double price2 = 0D; |
| | | if(type == 4){//同城 |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null); |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null, null); |
| | | // TODO: 2023/11/4 已优化 |
| | | if(null == dist){ |
| | | Map<String, String> distance = gdMapElectricFenceUtil.getDistance(startLon + "," + startLat, endLon + "," + endLat, 1); |
| | |
| | | price2 = jsonObject.getDouble("num22"); |
| | | } |
| | | }else{ |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null); |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null, null); |
| | | String content = String.valueOf(query1.get("content")); |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | price1 = jsonObject.getDouble("num1"); |
| | |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | integers = JSON.parseArray(vehicle).toJavaList(Integer.class); |
| | | } |
| | | Company query = companyCityService.query(String.valueOf(orderLogistics.getStartLon()), String.valueOf(orderLogistics.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//用专车的推单配置 |
| | | for(int i = 1; i <= querys.size(); i++){ |
| | | OpenCity openCity = openCityService.openCity1(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, openCity.getId());//用专车的推单配置 |
| | | for(int i = 1; i <= querys.size() + 5; i++){ |
| | | // OrderLogistics orderLogistics = orderLogisticsMapper.selectById(id); |
| | | // if (null == orderLogistics || orderLogistics.getState() > 1) { |
| | | // break; |
| | | // } |
| | | PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0); |
| | | int finalI = i; |
| | | PushOrder pushOrder = querys.stream().filter(s -> s.getType() == (finalI <= 3 ? finalI : 3)).findFirst().orElse(null); |
| | | |
| | | int i2 = pushOrder.getPushTime() / 10; |
| | | if(i2==0){ |
| | |
| | | orderIds.remove(orderLogistics.getId()); |
| | | return; |
| | | } |
| | | if (i == querys.size() && state == 1) { |
| | | if (i == querys.size() + 5 && state == 1) { |
| | | orderIds.remove(orderLogistics.getId()); |
| | | } |
| | | } |
| | |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | |
| | | // } |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | |
| | | this.updateById(orderLogistics); |
| | | |
| | | UserInfo userInfo = userInfoService.selectById(orderLogistics.getUserId()); |
| | | SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | userInfoService.updateById(userInfo); |
| | | |
| | |
| | | orderLogisticsSpreadService.updateById(orderLogisticsSpread); |
| | | |
| | | UserInfo userInfo = userInfoService.selectById(orderLogistics.getUserId()); |
| | | SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | userInfoService.updateById(userInfo); |
| | | |
| | |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | |
| | | query.setCode(order_id); |
| | | paymentRecordService.updateById(query); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.aliyun.oss.ServiceException; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | |
| | | import java.math.RoundingMode; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.concurrent.locks.Lock; |
| | | import java.util.concurrent.locks.ReentrantLock; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Service |
| | | public class OrderPrivateCarServiceImpl extends ServiceImpl<OrderPrivateCarMapper, OrderPrivateCar> implements IOrderPrivateCarService { |
| | | |
| | | public static List<Integer> orderIds = new ArrayList<>(); |
| | | @Resource |
| | | private OrderPrivateCarMapper orderPrivateCarMapper; |
| | | |
| | | @Resource |
| | | private CarServiceMapper carServiceMapper; |
| | | |
| | | @Resource |
| | | private OrderTaxiMapper orderTaxiMapper; |
| | | |
| | | @Resource |
| | | private SensitiveWordsMapper sensitiveWordsMapper; |
| | | |
| | | @Resource |
| | | private UserActivityDiscount1Mapper userActivityDiscount1Mapper; |
| | | |
| | | @Resource |
| | | private SysIntegralMapper sysIntegralMapper; |
| | | |
| | | @Resource |
| | | private OrderCrossCityMapper orderCrossCityMapper; |
| | | |
| | | @Resource |
| | | private RegionMapper regionMapper; |
| | | |
| | | @Autowired |
| | | private DateUtil dateUtil; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | |
| | | @Autowired |
| | | private IDriverServiceService driverServiceService; |
| | | |
| | | @Autowired |
| | | private PushUtil pushUtil; |
| | | |
| | | @Autowired |
| | | private ICompanyCityService companyCityService; |
| | | |
| | | @Autowired |
| | | private IPushOrderService pushOrderService; |
| | | |
| | | @Autowired |
| | | private ISystemNoticeService systemNoticeService; |
| | | |
| | | @Autowired |
| | | private ICancleOrderService cancleOrderService; |
| | | |
| | | @Autowired |
| | | private IOrderCancelService orderCancelService; |
| | | |
| | | @Autowired |
| | | private RestTemplate internalRestTemplate; |
| | | |
| | | @Autowired |
| | | private IPaymentRecordService paymentRecordService; |
| | | |
| | | @Autowired |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | |
| | | @Autowired |
| | | private ChinaMobileUtil chinaMobileUtil; |
| | | |
| | | @Autowired |
| | | private IIncomeService incomeService; |
| | | |
| | | @Autowired |
| | | private IUserCouponRecordService userCouponRecordService; |
| | | |
| | | @Autowired |
| | | private IUserRedPacketRecordService userRedPacketRecordService; |
| | | |
| | | @Autowired |
| | | private ICompanyService companyService; |
| | | |
| | | @Autowired |
| | | private IUserActivityRedenvelopeService userActivityRedenvelopeService; |
| | | |
| | | @Resource |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | @Autowired |
| | | private GDFalconUtil gdFalconUtil; |
| | | |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | |
| | | @Autowired |
| | | private GDMapElectricFenceUtil gdMapElectricFenceUtil; |
| | | |
| | | @Autowired |
| | | private IOrderPositionService orderPositionService; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | |
| | | @Autowired |
| | | private IOrderCrossCityService orderCrossCityService; |
| | | |
| | | @Autowired |
| | | private IOrderTaxiService orderTaxiService; |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Autowired |
| | | private ITaxiCardPaymentService taxiCardPaymentService; |
| | | |
| | | @Autowired |
| | | private ITaxiCardService taxiCardService; |
| | | |
| | | @Autowired |
| | | private IOpenCityService openCityService; |
| | | |
| | | @Autowired |
| | | private IUserUserService userUserService; |
| | | |
| | | @Autowired |
| | | private IUserTaxiCardService userTaxiCardService; |
| | | |
| | | @Autowired |
| | | private IRegionService regionService; |
| | | |
| | | public static List<Integer> orderIds = new ArrayList<>(); |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | | |
| | |
| | | private GeodesyUtil geodesyUtil; |
| | | |
| | | private Lock lock = new ReentrantLock(); |
| | | @Autowired |
| | | private AppOrderController appOrderController; |
| | | |
| | | /** |
| | | * 专车下单操作 |
| | | * |
| | | * @param serverCarModelId 服务车型id |
| | | * @param travelTime 出行时间 |
| | | * @param reservation 是否预约(1=否,2=是) |
| | |
| | | return ResultUtil.error("有未完成的订单"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | startAddress = startAddress.replaceAll("& #40;", "("); |
| | |
| | | // orderPrivateCar.setTrackId(track); |
| | | // |
| | | //调用移动的小号接口 |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderPrivateCar.setTelX(map.get("telX")); |
| | | orderPrivateCar.setBindId(map.get("bindId")); |
| | | } |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | // if (String.valueOf(map.get("code")).equals("200")) { |
| | | // orderPrivateCar.setTelX(map.get("telX")); |
| | | // orderPrivateCar.setBindId(map.get("bindId")); |
| | | // } |
| | | |
| | | driver.setState(3); |
| | | driverService.updateById(driver); |
| | |
| | | } |
| | | }else{ |
| | | OrderPrivateCar orderPrivateCar1 = null; |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | //判断是否有相同线路的拼车-有直接拼成功,或者推送拼车订单 |
| | | List<OrderPrivateCar> orderList = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("rideType",3).in("state","2,3,4").le("totalPeopleNum",4-peopleNum)); |
| | | for(OrderPrivateCar order:orderList){ |
| | | TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("companyId",order.getCompanyId())); |
| | | |
| | | TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("openCityId", openCity.getId())); |
| | | if(spellOrderRule!=null){ |
| | | JSONObject jsonObject = JSONObject.parseObject(spellOrderRule.getContent()); |
| | | //判断时间 |
| | |
| | | if(orderPrivateCar1==null){ |
| | | orderList = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("rideType",3).eq("state",5).le("totalPeopleNum",4-peopleNum)); |
| | | for(OrderPrivateCar order:orderList){ |
| | | TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("companyId",order.getCompanyId())); |
| | | TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("openCityId", openCity.getId())); |
| | | if(spellOrderRule!=null){ |
| | | JSONObject jsonObject = JSONObject.parseObject(spellOrderRule.getContent()); |
| | | //判断时间 |
| | |
| | | this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("id",orderPrivateCar1.getPid()==null?orderPrivateCar1.getId():orderPrivateCar1.getPid()).lt("state",6)); |
| | | // |
| | | //调用移动的小号接口 |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderPrivateCar.setTelX(map.get("telX")); |
| | | orderPrivateCar.setBindId(map.get("bindId")); |
| | | } |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | // if (String.valueOf(map.get("code")).equals("200")) { |
| | | // orderPrivateCar.setTelX(map.get("telX")); |
| | | // orderPrivateCar.setBindId(map.get("bindId")); |
| | | // } |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 批量订单 |
| | | * |
| | |
| | | public ResultUtil<BaseWarpper> saveOrderPrivateCars(String serverCarModel, Date travelTime, Integer reservation, Integer instead, String placementLon, String placementLat, String startLon, String startLat, String startAddress, String endLon, |
| | | String endLat, String endAddress, String name, String phone, Integer orderSource, Integer driverId, Integer uid, Integer peopleNum) throws Exception { |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | if (lock.tryLock()) { |
| | | String key = "saveOrderPrivateCar:" + uid; |
| | | Boolean hasKey = redisTemplate.hasKey(key); |
| | | if (!hasKey) { |
| | | redisTemplate.opsForValue().set(key, uid, 30, TimeUnit.SECONDS); |
| | | try { |
| | | //如果出行时间大于当前10分钟则默认为预约单 |
| | | if (travelTime.getTime() > (System.currentTimeMillis() + 600000)) { |
| | |
| | | this.pushOrder(orderPrivateCar.getId(), rideType, serverCarModelId, orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat()); |
| | | }else{ |
| | | OrderPrivateCar orderPrivateCar1 = null; |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | //判断是否有相同线路的拼车-有直接拼成功,或者推送拼车订单 |
| | | List<OrderPrivateCar> orderList = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("rideType",3).in("state","2,3,4").le("totalPeopleNum",4-peopleNum)); |
| | | for(OrderPrivateCar order:orderList){ |
| | | TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("companyId",order.getCompanyId())); |
| | | TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("openCityId", openCity.getId())); |
| | | if(spellOrderRule!=null){ |
| | | JSONObject jsonObject = JSONObject.parseObject(spellOrderRule.getContent()); |
| | | //判断时间 |
| | |
| | | if(orderPrivateCar1==null){ |
| | | orderList = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("rideType",3).eq("state",5).le("totalPeopleNum",4-peopleNum)); |
| | | for(OrderPrivateCar order:orderList){ |
| | | TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("companyId",order.getCompanyId())); |
| | | TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("openCityId", openCity.getId())); |
| | | if(spellOrderRule!=null){ |
| | | JSONObject jsonObject = JSONObject.parseObject(spellOrderRule.getContent()); |
| | | //判断时间 |
| | |
| | | this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("id",orderPrivateCar1.getPid()==null?orderPrivateCar1.getId():orderPrivateCar1.getPid()).lt("state",6)); |
| | | // |
| | | //调用移动的小号接口 |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderPrivateCar.setTelX(map.get("telX")); |
| | | orderPrivateCar.setBindId(map.get("bindId")); |
| | | } |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | // if (String.valueOf(map.get("code")).equals("200")) { |
| | | // orderPrivateCar.setTelX(map.get("telX")); |
| | | // orderPrivateCar.setBindId(map.get("bindId")); |
| | | // } |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | lock.unlock(); |
| | | redisTemplate.delete(key); |
| | | } |
| | | }else { |
| | | return ResultUtil.error("系统繁忙,请稍后再试!"); |
| | |
| | | |
| | | /** |
| | | * 下单后继续等待 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | this.pushOrder(orderPrivateCar); |
| | | }else{ |
| | | OrderPrivateCar orderPrivateCar1 = null; |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | //判断是否有相同线路的拼车-有直接拼成功,或者推送拼车订单 |
| | | List<OrderPrivateCar> orderList = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("rideType",3).in("state","2,3,4").le("totalPeopleNum",4-orderPrivateCar.getPeopleNum())); |
| | | for(OrderPrivateCar order:orderList){ |
| | | TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("companyId",order.getCompanyId())); |
| | | TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("openCityId", openCity.getId())); |
| | | if(spellOrderRule!=null){ |
| | | JSONObject jsonObject = JSONObject.parseObject(spellOrderRule.getContent()); |
| | | //判断时间 |
| | |
| | | if(orderPrivateCar1==null){ |
| | | orderList = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("rideType",3).eq("state",5).le("totalPeopleNum",4-orderPrivateCar.getPeopleNum())); |
| | | for(OrderPrivateCar order:orderList){ |
| | | TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("companyId",order.getCompanyId())); |
| | | TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("openCityId", openCity.getId())); |
| | | if(spellOrderRule!=null){ |
| | | JSONObject jsonObject = JSONObject.parseObject(spellOrderRule.getContent()); |
| | | //判断时间 |
| | |
| | | this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar1.getPid()==null?orderPrivateCar1.getId():orderPrivateCar1.getPid()).lt("state",6)); |
| | | this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("id",orderPrivateCar1.getPid()==null?orderPrivateCar1.getId():orderPrivateCar1.getPid()).lt("state",6)); |
| | | //调用移动的小号接口 |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderPrivateCar.setTelX(map.get("telX")); |
| | | orderPrivateCar.setBindId(map.get("bindId")); |
| | | } |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | // if (String.valueOf(map.get("code")).equals("200")) { |
| | | // orderPrivateCar.setTelX(map.get("telX")); |
| | | // orderPrivateCar.setBindId(map.get("bindId")); |
| | | // } |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | if(null == orderPrivateCar){ |
| | | return ResultUtil.error("获取数据失败,订单信息有误"); |
| | | } |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | double amount = 0; |
| | | CancleOrder query = cancleOrderService.query(orderPrivateCar.getOrderType(), 1, orderPrivateCar.getCompanyId()); |
| | | CancleOrder query = cancleOrderService.query(orderPrivateCar.getOrderType(), 1, openCity.getId()); |
| | | if(null != orderPrivateCar.getDriverId() && |
| | | (orderPrivateCar.getSnatchOrderTime().getTime() + query.getMinuteNum() * 60 * 1000) < new Date().getTime()){//收费的情况 |
| | | if(null != query){ |
| | |
| | | this.updateById(orderPrivateCar); |
| | | } |
| | | }else { |
| | | CancleOrder query = cancleOrderService.query(orderPrivateCar.getOrderType(), 1, orderPrivateCar.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | CancleOrder query = cancleOrderService.query(orderPrivateCar.getOrderType(), 1, openCity.getId()); |
| | | if (null != query) { |
| | | if ((orderPrivateCar.getSnatchOrderTime().getTime() + query.getMinuteNum() * 60 * 1000) < System.currentTimeMillis() && query.getMoney().compareTo(0D) > 0) {//收费的情况 |
| | | orderPrivateCar.setState(12); |
| | |
| | | return ResultUtil.success(map); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 取消订单操作 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | }else{ |
| | | orderCancel = orderCancelService.selectById(cancleId); |
| | | } |
| | | |
| | | CancleOrder query = cancleOrderService.query(orderPrivateCar.getOrderType(), 1, orderPrivateCar.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | CancleOrder query = cancleOrderService.query(orderPrivateCar.getOrderType(), 1, openCity.getId()); |
| | | if(null != query){ |
| | | if(payType == 1){//微信支付 |
| | | String value = (String) redisTemplate.opsForValue().get("appletOpenId"); |
| | |
| | | } |
| | | return resultUtil; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Map<String, Object> queryOrderInfo(Integer uid, Integer orderId) throws Exception { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public synchronized String getOrderNum() throws Exception{ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | |
| | | |
| | | /** |
| | | * 删除定时任务 |
| | | * |
| | | * @param orderId |
| | | */ |
| | | @Override |
| | |
| | | return preferentialDataVo; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取最优打车卡数据 |
| | | * |
| | | * @param orderPrivateCar |
| | | * @param price |
| | | * @param id |
| | |
| | | map.put("type", type); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryCoupon(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception { |
| | |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderPrivateCar.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | |
| | | this.updateAllColumnById(orderPrivateCar); |
| | | return resultUtil; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | |
| | | // } |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderPrivateCar.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | if(null != query1){ |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | } |
| | |
| | | this.updateAllColumnById(orderPrivateCar); |
| | | return resultUtil; |
| | | } |
| | | @Autowired |
| | | private AppOrderController appOrderController; |
| | | |
| | | @Override |
| | | public synchronized ResultUtil<BaseWarpper> queryRedMoney(Integer orderId) throws Exception { |
| | |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public synchronized ResultUtil shareRedEnvelope(Integer orderId) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 取消订单支付后的处理 |
| | | * |
| | | * @param id 订单=id |
| | | * @param order_id 工行支付单号 |
| | | * @param type 1=微信,2=支付宝 |
| | |
| | | orderPrivateCar.setPayMoney(query.getAmount()); |
| | | |
| | | UserInfo userInfo = userInfoService.selectById(orderPrivateCar.getUserId()); |
| | | SysIntegral query1 = sysIntegralMapper.query(orderPrivateCar.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | userInfoService.updateById(userInfo); |
| | | |
| | |
| | | return orderPrivateCarMapper.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryMyTravelRecord(Integer uid) throws Exception { |
| | | return orderPrivateCarMapper.queryMyTravelRecord(uid); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取下单推送完后没有司机接单的提醒 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public EndPushWarpper queryEndPush(Integer uid) throws Exception { |
| | | List<OrderPrivateCar> list = orderPrivateCarMapper.queryByState(uid, null, null, 1); |
| | | EndPushWarpper endPushWarpper = new EndPushWarpper(); |
| | | if (list.size() > 0) { |
| | | OrderPrivateCar orderPrivateCar = list.get(0); |
| | | if (!orderIds.contains(orderPrivateCar.getId())) { |
| | | endPushWarpper.setOrderId(orderPrivateCar.getId()); |
| | | endPushWarpper.setOrderType(1); |
| | | endPushWarpper.setState(1); |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, openCity.getId());//获取需要推送的次数 |
| | | int time = 0; |
| | | for (int i = 1; i <= querys.size() + 5; i++) { |
| | | int finalI = i; |
| | | PushOrder pushOrder = querys.stream().filter(s -> s.getType() == (finalI <= 3 ? finalI : 3)).findFirst().orElse(null); |
| | | time += pushOrder.getPushTime() * 1000; |
| | | } |
| | | //当前时间减去推单总时间大于下单时间 |
| | | if ((System.currentTimeMillis() - time) > orderPrivateCar.getInsertTime().getTime()) { |
| | | endPushWarpper.setState(2); |
| | | } |
| | | } |
| | | } |
| | | return endPushWarpper; |
| | | } |
| | | |
| | | /** |
| | | * 获取红包使用记录 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryRedEnvelope(Integer uid) throws Exception { |
| | | return orderPrivateCarMapper.queryRedEnvelope(uid); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | | public ResultUtil payThankYouFee(Integer uid, Integer orderId, Double money, Integer payType, Integer type) throws Exception { |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | ResultUtil resultUtil = ResultUtil.success(); |
| | | if (payType == 1) {//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | resultUtil = payMoneyUtil.weixinpay("感谢费", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/wxPayThankYouFee", app, userInfo.getAppletsOpenId()); |
| | | paymentRecordService.saveData(3, uid, 1, orderId, 1, 1, money, "", 1);//添加预支付数据 |
| | | } |
| | | if (payType == 2) {//支付宝支付 |
| | | resultUtil = payMoneyUtil.alipay("感谢费", "感谢费", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/aliPayThankYouFee"); |
| | | paymentRecordService.saveData(3, uid, 1, orderId, 1, 2, money, "", 1);//添加预支付数据 |
| | | } |
| | | if (payType == 3) {//余额支付 |
| | | if (userInfo.getBalance() == null || userInfo.getBalance() < money) { |
| | | return ResultUtil.error("余额不足,无法完成支付"); |
| | | } |
| | | // resultUtil= appOrderController.moneyPay(orderId,userInfo.getId(),money); |
| | | // if(resultUtil.getCode()==500){ |
| | | // return ResultUtil.error("电子余额不足,无法完成支付"); |
| | | // } |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "快车订单-感谢费", money, 2, 1, 1, 1, orderId); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | orderPrivateCar.setThankYouFee(money); |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | //添加已收入明细 |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 6, orderPrivateCar.getId(), 1, money); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | systemNoticeService.addSystemNotice(1, "您已使用余额成功完成感谢费支付,谢谢使用!", uid, 1); |
| | | |
| | | } |
| | | if (payType == 4) { |
| | | Double payMoney = orderPrivateCar.getThankYouFee(); |
| | | Integer integer = paymentRecordService.saveData(3, uid, 1, orderId, 1, 4, money, "", 1); |
| | | resultUtil = appOrderController.placeAnOrder(new BigDecimal(money), 4, orderId, 11, integer); |
| | | } |
| | | return resultUtil; |
| | | } |
| | | |
| | | @Override |
| | | public void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception { |
| | | System.out.println(orderId + "_" + order_id + "_" + payType); |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | UserInfo userInfo = userInfoService.selectById(orderPrivateCar.getUserId()); |
| | | System.out.println("用户" + userInfo); |
| | | PaymentRecord query = paymentRecordService.query(3, userInfo.getId(), 1, orderId, 1, payType, 1); |
| | | System.out.println("query:" + query); |
| | | query.setState(2); |
| | | query.setCode(order_id); |
| | | paymentRecordService.updateById(query); |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | System.out.println("query1:" + query1); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(userInfo.getId(), "快车订单-感谢费", query.getAmount(), 2, 1, 1, 1, orderId); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | orderPrivateCar.setThankYouFee(query.getAmount()); |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | //添加已收入明细 |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 6, orderPrivateCar.getId(), 1, query.getAmount()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | systemNoticeService.addSystemNotice(1, "您已使用" + (payType == 1 ? "微信" : (payType == 2 ? "支付宝" : "云闪付")) + "成功完成感谢费支付,谢谢使用!", userInfo.getId(), 1); |
| | | System.out.println("出租车感谢费ok"); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryOrderInfo2(Integer orderId, Integer state, String lon, String lat) { |
| | | return this.baseMapper.queryOrderInfo2(orderId, state, lon, lat); |
| | | } |
| | | |
| | | /** |
| | | * 获取专车未支付订单 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<UnPayOrderVO> getUnpayPrivateOrders(Integer uid) { |
| | | EntityWrapper<OrderPrivateCar> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("userId", uid); |
| | | wrapper.eq("state", 7); |
| | | //查出未支付订单 |
| | | List<OrderPrivateCar> orderPrivateCars = this.selectList(wrapper); |
| | | List<UnPayOrderVO> unPayOrderVOList = new ArrayList<>(); |
| | | for (OrderPrivateCar order : orderPrivateCars) { |
| | | UnPayOrderVO vo = new UnPayOrderVO(); |
| | | // 复制属性 |
| | | //添加司机信息 |
| | | DriverInfoWarpper driverInfoWarpper = new DriverInfoWarpper(); |
| | | Driver driver = driverService.selectById(order.getDriverId()); |
| | | BeanUtils.copyProperties(driver, driverInfoWarpper); |
| | | vo.setDriverInfoWarpper(driverInfoWarpper); |
| | | //其余信息 |
| | | BeanUtils.copyProperties(order, vo); |
| | | unPayOrderVOList.add(vo); |
| | | } |
| | | |
| | | return unPayOrderVOList; |
| | | } |
| | | |
| | | public void pushOrder(Integer id, Integer rideType, Integer serverCarModelId, Double startLon, Double startLat) throws Exception{ |
| | | new Thread(new Runnable() { |
| | | @Override |
| | |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | integers = JSON.parseArray(vehicle).toJavaList(Integer.class); |
| | | } |
| | | Company query = companyCityService.query(startLon.toString(), startLat.toString());//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//获取需要推送的次数 |
| | | for(int i = 1; i <= querys.size(); i++){ |
| | | OpenCity openCity = openCityService.openCity1(startLon.toString(), startLat.toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, openCity.getId());//获取需要推送的次数 |
| | | //整轮派单结束,若无司机接单,系统自动增加派单5轮,若增加5轮后任无司机接单,则系统结束派单,乘客端显示无司机接单、是否再次打车 |
| | | for (int i = 1; i <= querys.size() + 5; i++) { |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarMapper.selectById(id); |
| | | if (null == orderPrivateCar || orderPrivateCar.getState() > 1) { |
| | | break; |
| | | } |
| | | PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0); |
| | | int finalI = i; |
| | | PushOrder pushOrder = querys.stream().filter(s -> s.getType() == (finalI <= 3 ? finalI : 3)).findFirst().orElse(null); |
| | | System.out.println("pushOrder:"+pushOrder); |
| | | int i2 = pushOrder.getPushTime() / 10; |
| | | if(i2==0){ |
| | |
| | | orderIds.remove(orderPrivateCar.getId()); |
| | | break; |
| | | } |
| | | if (i == querys.size()) { |
| | | if (i == querys.size() + 5) { |
| | | pushUtil.pushEndPush(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1); |
| | | orderIds.remove(orderPrivateCar.getId()); |
| | | } |
| | |
| | | }).start(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryMyTravelRecord(Integer uid) throws Exception { |
| | | return orderPrivateCarMapper.queryMyTravelRecord(uid); |
| | | } |
| | | |
| | | /** |
| | | * 推送抢单数据 |
| | | * |
| | | * @param orderPrivateCar |
| | | * @throws Exception |
| | | */ |
| | |
| | | if(ToolUtil.isNotEmpty(vehicle)){ |
| | | integers = JSON.parseArray(vehicle).toJavaList(Integer.class); |
| | | } |
| | | Company query = companyCityService.query(String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//获取需要推送的次数 |
| | | OpenCity openCity = openCityService.openCity1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 1, openCity.getId());//获取需要推送的次数 |
| | | for(int i = 1; i <= querys.size()+5; i++){ |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarMapper.selectById(id); |
| | | if (null == orderPrivateCar || orderPrivateCar.getState() > 1) { |
| | | break; |
| | | } |
| | | PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0); |
| | | int finalI = i; |
| | | PushOrder pushOrder = querys.stream().filter(s -> s.getType() == (finalI <= 3 ? finalI : 3)).findFirst().orElse(null); |
| | | System.out.println("pushOrder:"+pushOrder); |
| | | int i2 = pushOrder.getPushTime() / 10; |
| | | if(i2==0){ |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取红包使用记录 |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryRedEnvelope(Integer uid) throws Exception { |
| | | return orderPrivateCarMapper.queryRedEnvelope(uid); |
| | | } |
| | | |
| | | /** |
| | | * 获取下单推送完后没有司机接单的提醒 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public EndPushWarpper queryEndPush(Integer uid) throws Exception { |
| | | List<OrderPrivateCar> list = orderPrivateCarMapper.queryByState(uid, null, null, 1); |
| | | EndPushWarpper endPushWarpper = new EndPushWarpper(); |
| | | if(list.size() > 0){ |
| | | OrderPrivateCar orderPrivateCar = list.get(0); |
| | | if(!orderIds.contains(orderPrivateCar.getId())){ |
| | | endPushWarpper.setOrderId(orderPrivateCar.getId()); |
| | | endPushWarpper.setOrderType(1); |
| | | endPushWarpper.setState(1); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, orderPrivateCar.getCompanyId());//获取需要推送的次数 |
| | | int time = 0; |
| | | for(int i = 1; i <= querys.size()+5; i++){ |
| | | PushOrder pushOrder = pushOrderService.querys(i, 2, orderPrivateCar.getCompanyId()).get(0); |
| | | time += pushOrder.getPushTime() * 1000; |
| | | } |
| | | //当前时间减去推单总时间大于下单时间 |
| | | if((System.currentTimeMillis() - time) > orderPrivateCar.getInsertTime().getTime()){ |
| | | endPushWarpper.setState(2); |
| | | } |
| | | } |
| | | } |
| | | return endPushWarpper; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | | public ResultUtil payThankYouFee(Integer uid, Integer orderId, Double money, Integer payType, Integer type) throws Exception { |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | ResultUtil resultUtil = ResultUtil.success(); |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | resultUtil = payMoneyUtil.weixinpay("感谢费", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/wxPayThankYouFee", app, userInfo.getAppletsOpenId()); |
| | | paymentRecordService.saveData(3, uid, 1, orderId, 1, 1, money, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | | resultUtil = payMoneyUtil.alipay("感谢费", "感谢费", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/aliPayThankYouFee"); |
| | | paymentRecordService.saveData(3, uid, 1, orderId, 1, 2, money, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 3) {//余额支付 |
| | | if (userInfo.getBalance() == null || userInfo.getBalance() < money) { |
| | | return ResultUtil.error("余额不足,无法完成支付"); |
| | | } |
| | | // resultUtil= appOrderController.moneyPay(orderId,userInfo.getId(),money); |
| | | // if(resultUtil.getCode()==500){ |
| | | // return ResultUtil.error("电子余额不足,无法完成支付"); |
| | | // } |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderPrivateCar.getCompanyId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "快车订单-感谢费", money, 2, 1, 1, 1, orderId); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | orderPrivateCar.setThankYouFee(money); |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | //添加已收入明细 |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 6, orderPrivateCar.getId(), 1, money); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | systemNoticeService.addSystemNotice(1, "您已使用余额成功完成感谢费支付,谢谢使用!", uid, 1); |
| | | |
| | | } |
| | | if(payType==4){ |
| | | Double payMoney = orderPrivateCar.getThankYouFee(); |
| | | Integer integer = paymentRecordService.saveData(3, uid, 1, orderId, 1, 4, money, "", 1); |
| | | resultUtil = appOrderController.placeAnOrder(new BigDecimal(money), 4,orderId,11,integer); |
| | | } |
| | | return resultUtil; |
| | | } |
| | | |
| | | @Override |
| | | public void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception { |
| | | System.out.println(orderId+"_"+order_id+"_"+payType); |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | UserInfo userInfo = userInfoService.selectById(orderPrivateCar.getUserId()); |
| | | System.out.println("用户"+userInfo); |
| | | PaymentRecord query = paymentRecordService.query(3, userInfo.getId(), 1, orderId, 1, payType, 1); |
| | | System.out.println("query:"+query); |
| | | query.setState(2); |
| | | query.setCode(order_id); |
| | | paymentRecordService.updateById(query); |
| | | System.out.println(orderPrivateCar.getCompanyId()); |
| | | SysIntegral query1 = sysIntegralMapper.query(orderPrivateCar.getCompanyId()); |
| | | System.out.println("query1:"+query1); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(userInfo.getId(), "快车订单-感谢费", query.getAmount(), 2, 1, 1, 1, orderId); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | orderPrivateCar.setThankYouFee(query.getAmount()); |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | //添加已收入明细 |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 6, orderPrivateCar.getId(), 1, query.getAmount()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | systemNoticeService.addSystemNotice(1, "您已使用" + (payType == 1 ? "微信" : (payType==2?"支付宝":"云闪付")) + "成功完成感谢费支付,谢谢使用!", userInfo.getId(), 1); |
| | | System.out.println("出租车感谢费ok"); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryOrderInfo2(Integer orderId, Integer state, String lon, String lat) { |
| | | return this.baseMapper.queryOrderInfo2(orderId,state,lon,lat); |
| | | } |
| | | |
| | | /** |
| | | * 获取专车未支付订单 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<UnPayOrderVO> getUnpayPrivateOrders(Integer uid) { |
| | | EntityWrapper<OrderPrivateCar> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("userId", uid); |
| | | wrapper.eq("state", 7); |
| | | //查出未支付订单 |
| | | List<OrderPrivateCar> orderPrivateCars = this.selectList(wrapper); |
| | | List<UnPayOrderVO> unPayOrderVOList = new ArrayList<>(); |
| | | for (OrderPrivateCar order : orderPrivateCars) { |
| | | UnPayOrderVO vo = new UnPayOrderVO(); |
| | | // 复制属性 |
| | | //添加司机信息 |
| | | DriverInfoWarpper driverInfoWarpper = new DriverInfoWarpper(); |
| | | Driver driver = driverService.selectById(order.getDriverId()); |
| | | BeanUtils.copyProperties(driver, driverInfoWarpper); |
| | | vo.setDriverInfoWarpper(driverInfoWarpper); |
| | | //其余信息 |
| | | BeanUtils.copyProperties(order, vo); |
| | | unPayOrderVOList.add(vo); |
| | | } |
| | | |
| | | return unPayOrderVOList; |
| | | } |
| | | |
| | | @Override |
| | | public void addAppeal(Integer uid, Integer orderId,String abnormalIntro, String abnormalImg) { |
| | |
| | | * @return |
| | | */ |
| | | CancleOrder query(@Param("type") Integer type, @Param("orderType") Integer orderType, |
| | | @Param("companyId") Integer companyId); |
| | | @Param("openCityId") Integer openCityId); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<PushOrder> querys(@Param("type") Integer type, @Param("pushType") Integer pushType, |
| | | @Param("companyId") Integer companyId); |
| | | @Param("openCityId") Integer openCityId); |
| | | } |
| | |
| | | |
| | | public interface SysIntegralMapper extends BaseMapper<SysIntegral> { |
| | | |
| | | SysIntegral query(@Param("companyId") Integer companyId); |
| | | SysIntegral query(@Param("openCityId") Integer openCityId); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.SystemPriceCity; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/26 9:24 |
| | | */ |
| | | public interface SystemPriceCityMapper extends BaseMapper<SystemPriceCity> { |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取价格 |
| | | * |
| | | * @param companyId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | Map<String, Object> query(@Param("companyId") Integer companyId, @Param("type") Integer type, |
| | | @Param("serverCarModelId") Integer serverCarModelId); |
| | | @Param("serverCarModelId") Integer serverCarModelId, @Param("systemPriceCityId") Integer systemPriceCityId); |
| | | } |
| | |
| | | money as money, |
| | | `type` as `type`, |
| | | orderType as orderType |
| | | from t_sys_cancle_order where `type` = #{type} and orderType = #{orderType} and companyId = #{companyId} |
| | | from t_sys_cancle_order where `type` = #{type} and orderType = #{orderType} and openCityId = #{openCityId} |
| | | </select> |
| | | </mapper> |
| | |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.PushOrder"> |
| | | <id column="id" property="id"/> |
| | | <result column="companyId" property="companyId"/> |
| | | <result column="openCityId" property="openCityId"/> |
| | | <result column="pushDistance" property="pushDistance"/> |
| | | <result column="pushTime" property="pushTime"/> |
| | | <result column="driverProportion" property="driverProportion"/> |
| | |
| | | select |
| | | id as id, |
| | | companyId as companyId, |
| | | openCityId as openCityId, |
| | | pushDistance as pushDistance, |
| | | pushTime as pushTime, |
| | | driverProportion as driverProportion, |
| | | `type` as `type`, |
| | | pushType as pushType |
| | | from t_sys_push_order where companyId = #{companyId} |
| | | from t_sys_push_order where openCityId = #{openCityId} |
| | | <if test="null != type"> |
| | | and `type` = #{type} |
| | | </if> |
| | |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.SysIntegral"> |
| | | <id column="id" property="id" /> |
| | | <result column="companyId" property="companyId" /> |
| | | <result column="openCityId" property="openCityId" /> |
| | | <result column="integral" property="integral" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <select id="query" resultType="SysIntegral"> |
| | | select * from t_sys_integral where companyId = #{companyId} |
| | | select * from t_sys_integral where openCityId = #{openCityId} |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.SystemPriceCityMapper"> |
| | | |
| | | </mapper> |
| | |
| | | <if test="null != serverCarModelId"> |
| | | and serverCarModelId = #{serverCarModelId} |
| | | </if> |
| | | <if test="null != systemPriceCityId"> |
| | | and systemPriceCityId = #{systemPriceCityId} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | @TableField("companyId") |
| | | private Integer companyId; |
| | | /** |
| | | * 开通城市id |
| | | */ |
| | | @TableField("openCityId") |
| | | private Integer openCityId; |
| | | /** |
| | | * 时间(分钟) |
| | | */ |
| | | @TableField("minuteNum") |
| | |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public Integer getOpenCityId() { |
| | | return openCityId; |
| | | } |
| | | |
| | | public void setOpenCityId(Integer openCityId) { |
| | | this.openCityId = openCityId; |
| | | } |
| | | |
| | | public Integer getMinuteNum() { |
| | | return minuteNum; |
| | | } |
| | |
| | | */ |
| | | @TableField("companyId") |
| | | private Integer companyId; |
| | | /** |
| | | * 开通城市id |
| | | */ |
| | | @TableField("openCityId") |
| | | private Integer openCityId; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public Integer getOpenCityId() { |
| | | return openCityId; |
| | | } |
| | | |
| | | public void setOpenCityId(Integer openCityId) { |
| | | this.openCityId = openCityId; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Phone{" + |
| | |
| | | @TableField("companyId") |
| | | private Integer companyId; |
| | | /** |
| | | * 开通城市id |
| | | */ |
| | | @TableField("openCityId") |
| | | private Integer openCityId; |
| | | /** |
| | | * 推单距离(公里) |
| | | */ |
| | | @TableField("pushDistance") |
| | |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public Integer getOpenCityId() { |
| | | return openCityId; |
| | | } |
| | | |
| | | public void setOpenCityId(Integer openCityId) { |
| | | this.openCityId = openCityId; |
| | | } |
| | | |
| | | public Double getPushDistance() { |
| | | return pushDistance; |
| | | } |
| | |
| | | @TableField("companyId") |
| | | private Integer companyId; |
| | | /** |
| | | * 开通城市id |
| | | */ |
| | | @TableField("openCityId") |
| | | private Integer openCityId; |
| | | /** |
| | | * 积分 |
| | | */ |
| | | @TableField("integral") |
| | |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public Integer getOpenCityId() { |
| | | return openCityId; |
| | | } |
| | | |
| | | public void setOpenCityId(Integer openCityId) { |
| | | this.openCityId = openCityId; |
| | | } |
| | | |
| | | public Integer getIntegral() { |
| | | return integral; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 服务价格规则 |
| | | */ |
| | | @Data |
| | | @TableName("t_system_price") |
| | | public class SystemPrice { |
| | | /** |
| | |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 价格城市id |
| | | */ |
| | | @TableField("systemPriceCityId") |
| | | private Integer systemPriceCityId; |
| | | /** |
| | | * 业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车) |
| | | */ |
| | | @TableField("type") |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import lombok.Data; /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/26 9:16 |
| | | */ |
| | | @Data |
| | | @TableName("t_system_price_city") |
| | | public class SystemPriceCity extends BaseBean { |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | @TableField("areaCode") |
| | | private String areaCode; |
| | | /** |
| | | * 省名称 |
| | | */ |
| | | @TableField("areaName") |
| | | private String areaName; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | /** |
| | | * 市名称 |
| | | */ |
| | | @TableField("cityName") |
| | | private String cityName; |
| | | /** |
| | | * 区县编号 |
| | | */ |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | /** |
| | | * 区县名称 |
| | | */ |
| | | @TableField("provinceName") |
| | | private String provinceName; |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | */ |
| | | @ApiModelProperty("用户是否显示(1=是,2=否)") |
| | | private Integer userShow; |
| | | /** |
| | | * 开通城市id |
| | | */ |
| | | @TableField("openCityId") |
| | | private Integer openCityId; |
| | | |
| | | |
| | | public Integer getId() { |
| | |
| | | this.userShow = userShow; |
| | | } |
| | | |
| | | public Integer getOpenCityId() { |
| | | return openCityId; |
| | | } |
| | | |
| | | public void setOpenCityId(Integer openCityId) { |
| | | this.openCityId = openCityId; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | |
| | | * 规则每个输入框为一个参数{"num1":1,"num2":2.3} |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 开通城市id |
| | | */ |
| | | @TableField("openCityId") |
| | | private Integer openCityId; |
| | | |
| | | |
| | | public Integer getId() { |
| | |
| | | this.content = content; |
| | | } |
| | | |
| | | public Integer getOpenCityId() { |
| | | return openCityId; |
| | | } |
| | | |
| | | public void setOpenCityId(Integer openCityId) { |
| | | this.openCityId = openCityId; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | CancleOrder query(Integer type, Integer orderType, Integer companyId) throws Exception; |
| | | CancleOrder query(Integer type, Integer orderType, Integer openCityId) throws Exception; |
| | | } |
| | |
| | | |
| | | |
| | | OpenCity openCity1(String code) throws Exception; |
| | | |
| | | |
| | | OpenCity openCity1(String lon, String lat) throws Exception; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<PushOrder> querys(Integer type, Integer pushType, Integer companyId) throws Exception; |
| | | List<PushOrder> querys(Integer type, Integer pushType, Integer openCityId) throws Exception; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.SystemPriceCity; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/26 9:24 |
| | | */ |
| | | public interface ISystemPriceCityService extends IService<SystemPriceCity> { |
| | | |
| | | |
| | | /** |
| | | * 查询匹配的数据 |
| | | * @param provinceCode |
| | | * @param cityCode |
| | | * @param districtCode |
| | | * @return |
| | | */ |
| | | SystemPriceCity queryOne(String provinceCode, String cityCode, String districtCode); |
| | | |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public CancleOrder query(Integer type, Integer orderType, Integer companyId) throws Exception { |
| | | return cancleOrderMapper.query(type, orderType, companyId); |
| | | public CancleOrder query(Integer type, Integer orderType, Integer openCityId) throws Exception { |
| | | return cancleOrderMapper.query(type, orderType, openCityId); |
| | | } |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.dao.OpenCityMapper; |
| | | import com.stylefeng.guns.modular.system.model.OpenCity; |
| | | import com.stylefeng.guns.modular.system.service.IOpenCityService; |
| | | import com.stylefeng.guns.modular.system.util.GDMapGeocodingUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Service |
| | |
| | | |
| | | @Resource |
| | | private OpenCityMapper openCityMapper; |
| | | |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | return openCities.get(0); |
| | | } |
| | | |
| | | @Override |
| | | public OpenCity openCity1(String lon, String lat) throws Exception { |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(lon, lat); |
| | | String districtCode = geocode.get("districtCode"); |
| | | return openCity1(districtCode); |
| | | } |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.dao.PhoneMapper; |
| | | import com.stylefeng.guns.modular.system.model.OpenCity; |
| | | import com.stylefeng.guns.modular.system.model.Phone; |
| | | import com.stylefeng.guns.modular.system.service.IOpenCityService; |
| | | import com.stylefeng.guns.modular.system.service.IPhoneService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @Resource |
| | | private PhoneMapper phoneMapper; |
| | | |
| | | @Autowired |
| | | private IOpenCityService openCityService; |
| | | |
| | | /** |
| | | * 获取所有系统电话 |
| | | * @return |
| | |
| | | */ |
| | | @Override |
| | | public List<Phone> queryPhones(String code) throws Exception { |
| | | List<Phone> list = new ArrayList<>(); |
| | | if(ToolUtil.isNotEmpty(code)){ |
| | | String province = code.substring(0, 2) + "0000"; |
| | | String city = code.substring(0, 4) + "00"; |
| | | |
| | | list = phoneMapper.queryPhones(province, city, code); |
| | | if(list.size() == 0){ |
| | | list = phoneMapper.queryPhones(province, city, null); |
| | | } |
| | | if(list.size() == 0){ |
| | | list = phoneMapper.queryPhones(province, null, null); |
| | | } |
| | | } |
| | | return list; |
| | | OpenCity openCity = openCityService.openCity1(code); |
| | | return phoneMapper.selectList(new EntityWrapper<Phone>().eq("openCityId", openCity)); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryCustomerPhone(String code) throws Exception { |
| | | String province = code.substring(0, 2) + "0000"; |
| | | String city = code.substring(0, 4) + "00"; |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //平台电话 |
| | | Phone query = phoneMapper.query(2, 1, null, null, null); |
| | | map.put("platform", null != query ? query.getPhone() : ""); |
| | | |
| | | //公司 |
| | | query = phoneMapper.query(2, 2, province, city, code); |
| | | if(query == null){ |
| | | query = phoneMapper.query(2, 2, province, city, null); |
| | | } |
| | | if(query == null){ |
| | | query = phoneMapper.query(2, 2, province, null, null); |
| | | } |
| | | map.put("company", null != query ? query.getPhone() : ""); |
| | | OpenCity openCity = openCityService.openCity1(code); |
| | | Phone phone = this.selectOne(new EntityWrapper<Phone>().eq("openCityId", openCity).eq("type", 2).eq("platform", 1)); |
| | | map.put("platform", null != phone ? phone.getPhone() : ""); |
| | | phone = this.selectOne(new EntityWrapper<Phone>().eq("openCityId", openCity).eq("type", 2).eq("platform", 2)); |
| | | map.put("company", null != phone ? phone.getPhone() : ""); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<PushOrder> querys(Integer type, Integer pushType, Integer companyId) throws Exception { |
| | | return pushOrderMapper.querys(type, pushType, companyId); |
| | | public List<PushOrder> querys(Integer type, Integer pushType, Integer openCityId) throws Exception { |
| | | return pushOrderMapper.querys(type, pushType, openCityId); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.ServerCarModelMapper; |
| | | import com.stylefeng.guns.modular.system.dao.SystemPriceMapper; |
| | | import com.stylefeng.guns.modular.system.model.Company; |
| | | import com.stylefeng.guns.modular.system.model.OpenCity; |
| | | import com.stylefeng.guns.modular.system.model.OpenCityBusiness; |
| | | import com.stylefeng.guns.modular.system.model.ServerCarModel; |
| | | import com.stylefeng.guns.modular.system.service.ICompanyCityService; |
| | | import com.stylefeng.guns.modular.system.service.IOpenCityBusinessService; |
| | | import com.stylefeng.guns.modular.system.service.IOpenCityService; |
| | | import com.stylefeng.guns.modular.system.service.IServerCarModelService; |
| | | import com.stylefeng.guns.modular.system.model.SystemPriceCity; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.GDMapGeocodingUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | |
| | | @Resource |
| | | private ServerCarModelMapper serverCarModelMapper; |
| | | |
| | | @Resource |
| | | private ISystemPriceCityService systemPriceCityService; |
| | | |
| | | @Resource |
| | | private SystemPriceMapper systemPriceMapper; |
| | |
| | | |
| | | @Autowired |
| | | private IOpenCityBusinessService openCityBusinessService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | double distance1_ = Double.valueOf(distance1).doubleValue(); |
| | | String duration = distance.get("duration");//时间(秒) |
| | | long duration_ = Long.valueOf(duration).longValue(); |
| | | |
| | | List<ServerCarModelWarpper> price = this.getPrice(query.getId(), distance1_, duration_, 0, 1); |
| | | List<ServerCarModelWarpper> price = this.getPrice(query.getId(), distance1_, duration_, 0, 1, geocode); |
| | | //添加出租车车型和价格 |
| | | ServerCarModelWarpper serverCarModelWarpper = this.getTextPrice(query.getId(), distance1_, duration_, 0, 2); |
| | | ServerCarModelWarpper serverCarModelWarpper = this.getTextPrice(query.getId(), distance1_, duration_, 0, 2, geocode); |
| | | price.add(serverCarModelWarpper); |
| | | return ResultUtil.success(price); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取业务类型对应的所有服务车型 |
| | | * |
| | | * @param type |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 计算价格 |
| | | * |
| | | * @param companyId |
| | | * @param distance |
| | | * @param duration |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public List<ServerCarModelWarpper> getPrice(Integer companyId, double distance, long duration, long wait, Integer type) throws Exception { |
| | | public List<ServerCarModelWarpper> getPrice(Integer companyId, double distance, long duration, long wait, Integer type, Map<String, String> geocode) throws Exception { |
| | | String provinceCode = geocode.get("provinceCode"); |
| | | String cityCode = geocode.get("cityCode"); |
| | | String districtCode = geocode.get("districtCode"); |
| | | //获取匹配的城市价格配置 |
| | | SystemPriceCity systemPriceCity = systemPriceCityService.queryOne(provinceCode, cityCode, districtCode); |
| | | if (null == systemPriceCity) { |
| | | return new ArrayList<>(); |
| | | } |
| | | List<Map<String, Object>> list = serverCarModelMapper.queryServerCarModel(type); |
| | | List<ServerCarModelWarpper> data = new ArrayList<>(); |
| | | for(Map<String, Object> map : list){ |
| | | Map<String, Object> query1 = systemPriceMapper.query(companyId, type, Integer.valueOf(map.get("id").toString())); |
| | | Map<String, Object> query1 = systemPriceMapper.query(companyId, type, Integer.valueOf(map.get("id").toString()), systemPriceCity.getId()); |
| | | if(null == query1){//排除没有设置价格的车型 |
| | | continue; |
| | | } |
| | | //开始根据不同的方式计算金额 |
| | | double amount = 0; |
| | | if(type == 1){//专车 |
| | | |
| | | double d = distance / 1000;//实际公里 |
| | | double t = duration / 60;//实际时间 |
| | | JSONObject jsonObject = JSON.parseObject(query1.get("content").toString());//等待费 |
| | |
| | | serverCarModelWarpper.setContentExclusive(contentExclusive); |
| | | serverCarModelWarpper.setContentPrice(contentPrice); |
| | | |
| | | serverCarModelWarpper.setAmount(new BigDecimal(this.calculationPrice(contentExclusive,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue()); |
| | | serverCarModelWarpper.setBuyNowAmount(new BigDecimal(this.calculationPrice(contentPrice,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue()); |
| | | serverCarModelWarpper.setPutTogetherOneAmount(new BigDecimal(this.calculationPrice(contentPutOne,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue()); |
| | | serverCarModelWarpper.setNotAssembledOneAmount(new BigDecimal(this.calculationPrice(contentNotOne,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue()); |
| | | serverCarModelWarpper.setPutTogetherTwoAmount(new BigDecimal(this.calculationPrice(contentPutTwo,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue()); |
| | | serverCarModelWarpper.setNotAssembledTwoAmount(new BigDecimal(this.calculationPrice(contentNotTwo,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue()); |
| | | serverCarModelWarpper.setPutTogetherThreeAmount(new BigDecimal(this.calculationPrice(contentPutThree,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue()); |
| | | serverCarModelWarpper.setNotAssembledThreeAmount(new BigDecimal(this.calculationPrice(contentNotThree,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue()); |
| | | serverCarModelWarpper.setAmount(this.calculationPrice(contentExclusive, distance, duration, wait, waitMoney)); |
| | | serverCarModelWarpper.setBuyNowAmount(this.calculationPrice(contentPrice, distance, duration, wait, waitMoney)); |
| | | serverCarModelWarpper.setPutTogetherOneAmount(this.calculationPrice(contentPutOne, distance, duration, wait, waitMoney)); |
| | | serverCarModelWarpper.setNotAssembledOneAmount(this.calculationPrice(contentNotOne, distance, duration, wait, waitMoney)); |
| | | serverCarModelWarpper.setPutTogetherTwoAmount(this.calculationPrice(contentPutTwo, distance, duration, wait, waitMoney)); |
| | | serverCarModelWarpper.setNotAssembledTwoAmount(this.calculationPrice(contentNotTwo, distance, duration, wait, waitMoney)); |
| | | serverCarModelWarpper.setPutTogetherThreeAmount(this.calculationPrice(contentPutThree, distance, duration, wait, waitMoney)); |
| | | serverCarModelWarpper.setNotAssembledThreeAmount(this.calculationPrice(contentNotThree, distance, duration, wait, waitMoney)); |
| | | serverCarModelWarpper.setMileage(d); |
| | | serverCarModelWarpper.setDuration(t); |
| | | serverCarModelWarpper.setIsOpen(Integer.parseInt(query1.get("isOpen").toString())); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public ServerCarModelWarpper getTextPrice(Integer companyId, double distance, long duration, long wait, Integer type) throws Exception { |
| | | Map<String, Object> query1 = systemPriceMapper.query(companyId, type, null); |
| | | public ServerCarModelWarpper getTextPrice(Integer companyId, double distance, long duration, long wait, Integer type, Map<String, String> geocode) throws Exception { |
| | | String provinceCode = geocode.get("provinceCode"); |
| | | String cityCode = geocode.get("cityCode"); |
| | | String districtCode = geocode.get("districtCode"); |
| | | //获取匹配的城市价格配置 |
| | | SystemPriceCity systemPriceCity = systemPriceCityService.queryOne(provinceCode, cityCode, districtCode); |
| | | if (null == systemPriceCity) { |
| | | return null; |
| | | } |
| | | Map<String, Object> query1 = systemPriceMapper.query(companyId, type, null, systemPriceCity.getId()); |
| | | if(null == query1){//排除没有设置价格的车型 |
| | | return null; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | double d = distance / 1000;//实际公里 |
| | | double t = duration / 60;//实际时间 |
| | | JSONObject jsonObject = JSON.parseObject(query1.get("content").toString());//等待费 |
| | |
| | | Double amount = 0D; |
| | | if(System.currentTimeMillis() > start_date && System.currentTimeMillis() <= end_date){ |
| | | amount = num7; |
| | | BigDecimal multiply = BigDecimal.ZERO; |
| | | BigDecimal yt = BigDecimal.ZERO; |
| | | if(d > num8){ |
| | | BigDecimal multiply = new BigDecimal(d).subtract(new BigDecimal(num8)).multiply(new BigDecimal(num9)); |
| | | multiply = new BigDecimal(d).subtract(new BigDecimal(num8)).multiply(new BigDecimal(num9)); |
| | | if(d > num4){ |
| | | multiply = new BigDecimal(d).subtract(new BigDecimal(num4)).multiply(new BigDecimal(num5)).add(multiply); |
| | | yt = new BigDecimal(d).subtract(new BigDecimal(num4)).multiply(new BigDecimal(num5)); |
| | | } |
| | | amount = new BigDecimal(num7).add(multiply).setScale(2, BigDecimal.ROUND_DOWN).doubleValue(); |
| | | amount = new BigDecimal(num7).add(multiply).add(yt).setScale(2, BigDecimal.ROUND_DOWN).doubleValue(); |
| | | } |
| | | map.put("qibujia", num7); |
| | | map.put("lichengfei", multiply.doubleValue()); |
| | | map.put("yuantufei", yt.doubleValue()); |
| | | map.put("zongfeiyong", amount); |
| | | }else{ |
| | | amount = num1; |
| | | BigDecimal multiply = BigDecimal.ZERO; |
| | | BigDecimal yt = BigDecimal.ZERO; |
| | | if(d > num2){ |
| | | BigDecimal multiply = new BigDecimal(d).subtract(new BigDecimal(num2)).multiply(new BigDecimal(num3)); |
| | | multiply = new BigDecimal(d).subtract(new BigDecimal(num2)).multiply(new BigDecimal(num3)); |
| | | if(d > num4){ |
| | | multiply = new BigDecimal(d).subtract(new BigDecimal(num4)).multiply(new BigDecimal(num5)).add(multiply); |
| | | yt = new BigDecimal(d).subtract(new BigDecimal(num4)).multiply(new BigDecimal(num5)); |
| | | } |
| | | amount = new BigDecimal(num1).add(multiply).setScale(2, BigDecimal.ROUND_DOWN).doubleValue(); |
| | | amount = new BigDecimal(num1).add(multiply).add(yt).setScale(2, BigDecimal.ROUND_DOWN).doubleValue(); |
| | | } |
| | | map.put("qibujia", num1); |
| | | map.put("lichengfei", multiply.doubleValue()); |
| | | map.put("yuantufei", yt.doubleValue()); |
| | | map.put("zongfeiyong", amount); |
| | | } |
| | | List<Map<String, Object>> list = serverCarModelMapper.queryServerCarModel(4); |
| | | String isCheck = "0"; |
| | |
| | | ServerCarModelWarpper serverCarModelWarpper = new ServerCarModelWarpper(); |
| | | serverCarModelWarpper.setId(0); |
| | | serverCarModelWarpper.setName("出租车"); |
| | | serverCarModelWarpper.setAmount(amount); |
| | | serverCarModelWarpper.setAmount(map); |
| | | serverCarModelWarpper.setDx_check(Integer.valueOf(isCheck)); |
| | | serverCarModelWarpper.setContentPutOne(new JSONObject()); |
| | | serverCarModelWarpper.setContentNotOne(new JSONObject()); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public Double calculationPrice(JSONObject rule, double distance, long duration, long wait,Double waitMoney) throws Exception { |
| | | double amount = 0; |
| | | public Map<String, Object> calculationPrice(JSONObject rule, double distance, long duration, long wait, Double waitMoney) throws Exception { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //等待费 |
| | | Date date = new Date(); |
| | | double d = distance / 1000;//实际公里 |
| | |
| | | if(d > rule.getDouble("num12")){ |
| | | yt3 = rule.getDouble("num20") * (d - rule.getDouble("num12")); |
| | | } |
| | | amount = rule.getDouble("num15") + (d1 * rule.getDouble("num16")) + (t1 * rule.getDouble("num17")) + (wait * waitMoney) + yt1 + yt2 + yt3; |
| | | double amount = rule.getDouble("num15") + (d1 * rule.getDouble("num16")) + (t1 * rule.getDouble("num17")) + (wait * waitMoney) + yt1 + yt2 + yt3; |
| | | map.put("qibujia", rule.getDouble("num15")); |
| | | map.put("lichengfei", d1 * rule.getDouble("num16")); |
| | | map.put("shichangfei", t1 * rule.getDouble("num17")); |
| | | map.put("dengdaifei", wait * waitMoney); |
| | | map.put("yuantufei", yt1 + yt2 + yt3); |
| | | map.put("zongfeiyong", amount); |
| | | }else{ |
| | | Calendar s1 = Calendar.getInstance(); |
| | | s1.setTime(date); |
| | |
| | | if(d > rule.getDouble("num12")){ |
| | | yt3 = rule.getDouble("num28") * (d - rule.getDouble("num12")); |
| | | } |
| | | amount = rule.getDouble("num23") + (d1 * rule.getDouble("num24")) + (t1 * rule.getDouble("num25")) + (wait * waitMoney) + yt1 + yt2 + yt3; |
| | | double amount = rule.getDouble("num23") + (d1 * rule.getDouble("num24")) + (t1 * rule.getDouble("num25")) + (wait * waitMoney) + yt1 + yt2 + yt3; |
| | | map.put("qibujia", rule.getDouble("num23")); |
| | | map.put("lichengfei", d1 * rule.getDouble("num24")); |
| | | map.put("shichangfei", t1 * rule.getDouble("num25")); |
| | | map.put("dengdaifei", wait * waitMoney); |
| | | map.put("yuantufei", yt1 + yt2 + yt3); |
| | | map.put("zongfeiyong", amount); |
| | | }else{ |
| | | //其他时间段的计算 |
| | | if(d > rule.getDouble("num6")){ |
| | |
| | | if(d > rule.getDouble("num12")){ |
| | | yt3 = rule.getDouble("num13") * (d - rule.getDouble("num12")); |
| | | } |
| | | amount = rule.getDouble("num1") + (d1 * rule.getDouble("num4")) + (t1 * rule.getDouble("num5")) + (wait * waitMoney) + yt1 + yt2 + yt3; |
| | | double amount = rule.getDouble("num1") + (d1 * rule.getDouble("num4")) + (t1 * rule.getDouble("num5")) + (wait * waitMoney) + yt1 + yt2 + yt3; |
| | | map.put("qibujia", rule.getDouble("num1")); |
| | | map.put("lichengfei", d1 * rule.getDouble("num4")); |
| | | map.put("shichangfei", t1 * rule.getDouble("num5")); |
| | | map.put("dengdaifei", wait * waitMoney); |
| | | map.put("yuantufei", yt1 + yt2 + yt3); |
| | | map.put("zongfeiyong", amount); |
| | | } |
| | | } |
| | | return amount; |
| | | return map; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.SystemPriceCityMapper; |
| | | import com.stylefeng.guns.modular.system.model.SystemPriceCity; |
| | | import com.stylefeng.guns.modular.system.service.ISystemPriceCityService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/26 9:25 |
| | | */ |
| | | @Service |
| | | public class SystemPriceCityServiceImpl extends ServiceImpl<SystemPriceCityMapper, SystemPriceCity> implements ISystemPriceCityService { |
| | | |
| | | |
| | | /** |
| | | * 查询匹配数据 |
| | | * @param provinceCode |
| | | * @param cityCode |
| | | * @param districtCode |
| | | * @return |
| | | */ |
| | | @Override |
| | | public SystemPriceCity queryOne(String provinceCode, String cityCode, String districtCode) { |
| | | SystemPriceCity systemPriceCity = this.selectOne(new EntityWrapper<SystemPriceCity>().eq("areaCode", provinceCode).eq("cityCode", cityCode).eq("provinceCode", districtCode)); |
| | | if(null == systemPriceCity){ |
| | | systemPriceCity = this.selectOne(new EntityWrapper<SystemPriceCity>().eq("areaCode", provinceCode).eq("cityCode", cityCode)); |
| | | if(null == systemPriceCity){ |
| | | systemPriceCity = this.selectOne(new EntityWrapper<SystemPriceCity>().eq("areaCode", provinceCode)); |
| | | } |
| | | } |
| | | return systemPriceCity; |
| | | }} |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.common.constant.state.Order; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.CarMapper; |
| | |
| | | import com.stylefeng.guns.modular.system.dao.SystemPriceMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.taxi.model.TransactionDetails; |
| | | import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | public void operatePay(Integer orderId){ |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | Map<String, Object> query = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId()); |
| | | Map<String, Object> query = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId(), null); |
| | | Car car = carMapper.selectById(orderPrivateCar.getCarId()); |
| | | ServerCarModel serverCarModel = serverCarModelMapper.selectById(orderPrivateCar.getServerCarModelId()); |
| | | // TransactionDetails transactionDetails = transactionDetailsService.selectById(new EntityWrapper<TransactionDetails>().eq("orderId", orderId).eq("orderType", 1)); |
| | |
| | | * @throws Exception |
| | | */ |
| | | private Map<String, Double> setMoney(OrderPrivateCar orderPrivateCar) { |
| | | Map<String, Object> query1 = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId()); |
| | | Map<String, Object> query1 = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId(), null); |
| | | Map<String, Double> map = new HashMap<>(); |
| | | //开始根据不同的方式计算金额 |
| | | double amount1 = 0; |
| | |
| | | // CreateTravelItineraryRequest request = new CreateTravelItineraryRequest(); |
| | | // request.setScene("TRAFFIC"); |
| | | // request.setPartnerId("522700"); |
| | | // request.setOrderNo("123456"); |
| | | // request.setOrderNo("0123456"); |
| | | // request.setCustomerId("11448156"); |
| | | // request.setDriverId("11448158"); |
| | | // request.setSupplierShopId("981100006005951"); |
| | | // request.setServiceType(1); |
| | | // String travelItinerary = createTravelItinerary(request); |
| | | // System.err.println(travelItinerary);//1948565171253956608 |
| | | // System.err.println(travelItinerary);//1948685426689200128 |
| | | |
| | | //修改行程状态 |
| | | // ModifyTravelItineraryRequest request = new ModifyTravelItineraryRequest(); |
| | | // request.setScene("TRAFFIC"); |
| | | // request.setPartnerId("522700"); |
| | | // request.setOrderId("1948565171253956608"); |
| | | // request.setOrderId("1948685426689200128"); |
| | | // request.setStatus(7); |
| | | // request.setDriverId("11448158"); |
| | | // request.setSupplierShopId("981100006005951"); |
| | |
| | | // tradeOrderCreateData.setField1("{\"profitSharing\":\"1\",\"isPromote\":\"0\"}"); |
| | | // tradeOrderCreateData.setCharge(new BigDecimal("0.01")); |
| | | // tradeOrderCreateData.setChannelSource("GRJYCXWXXCX"); |
| | | // tradeOrderCreateData.setOrderId("1948565171253956608"); |
| | | // tradeOrderCreateData.setOrderNo("123456"); |
| | | // tradeOrderCreateData.setOrderId("1948685426689200128"); |
| | | // tradeOrderCreateData.setOrderNo("0123456"); |
| | | // tradeOrderCreateData.setCustomerId("11448156"); |
| | | // tradeOrderCreateData.setPayPartnerId("5400004"); |
| | | // tradeOrderCreateData.setPartnerPayId("1948565171253956608"); |
| | | // tradeOrderCreateData.setPartnerPayId("1948685426689200128"); |
| | | // tradeOrderCreateData.setCurrency("RMB"); |
| | | // tradeOrderCreateData.setTotalFee("1"); |
| | | // tradeOrderCreateData.setRetUrl("/home/"); |
| | |
| | | // |
| | | // List<GoodsInfoRequest> goodsInfo = new ArrayList<>(); |
| | | // GoodsInfoRequest goodsInfoRequest = new GoodsInfoRequest(); |
| | | // goodsInfoRequest.setId("1"); |
| | | // goodsInfoRequest.setSubAppId(QianYunTongProperties.appId); |
| | | // goodsInfoRequest.setId("981100006005901"); |
| | | // goodsInfoRequest.setSubAppId("wxcbad113185a243e1"); |
| | | // goodsInfoRequest.setSubOpenId("oVLur6yFtED8ruXBWUFKXjzXJ_BQ"); |
| | | // goodsInfoRequest.setProfitSharing("1"); |
| | | // goodsInfoRequest.setAreaInfo("520100"); |
| | | // goodsInfoRequest.setPayType("0"); |
| | | // goodsInfoRequest.setBusinessType("10408"); |
| | | // goodsInfo.add(goodsInfoRequest); |
| | | // tradeOrderCreateData.setGoodsInfo(goodsInfo); |
| | | // TradeOrderCreate tradeOrderCreate = tradeOrderCreate1(tradeOrderCreateData); |
| | | // System.err.println(tradeOrderCreate); |
| | | // //TradeOrderCreate(orderInfo=OrderInfo(orderId=1948565171253956608, status=null), payInfo=PayInfo(retCode=000000, retMsg=success, success=true, data=PayInfoData(redirectUrl=https://qhsctest.qytzt.cn/gray/mobile/index.html?f=allCashDesk&accessToken=5nUBXayFpfZz%2FXUZiMu9LyWg15VM5hbmhIjUt0hdmws%3D, payId=540000420250725000135518, status=null, payTime=null, payFee=null, paymentInfos=null), sign=ea01f3b186be02e43367b856fd2ec699)) |
| | | // //TradeOrderCreate(orderInfo=OrderInfo(orderId=1948685426689200128, status=null), payInfo=PayInfo(retCode=000000, retMsg=success, success=true, data=PayInfoData(redirectUrl=https://qhsctest.qytzt.cn/gray/mobile/index.html?f=allCashDesk&accessToken=5nUBXayFpfZz%2FXUZiMu9L61szNy2MhjTJ938TeNnX0U%3D, payId=540000420250725000135548, status=null, payTime=null, payFee=null, paymentInfos=null), sign=c9d849ee21dcc401cee968d4d31de04f)) |
| | | |
| | | //查询支付单信息 |
| | | // GetPaymentInfoDataRequest getPaymentInfoDataRequest = new GetPaymentInfoDataRequest(); |
| | | // getPaymentInfoDataRequest.setPartnerId("5400004"); |
| | | // getPaymentInfoDataRequest.setPartnerPayId("1948565171253956608"); |
| | | // getPaymentInfoDataRequest.setPartnerPayId("1948685426689200128"); |
| | | // GetPaymentInfo getPaymentInfo = paymentInfo(getPaymentInfoDataRequest); |
| | | // System.err.println(getPaymentInfo); |
| | | |
| | | //拉起支付 |
| | | TradePayOff1Data tradePayOff1Data = new TradePayOff1Data(); |
| | | tradePayOff1Data.setPartnerId("5400004"); |
| | | tradePayOff1Data.setScene("TRAFFIC"); |
| | | tradePayOff1Data.setPartnerPayId("1948565171253956608"); |
| | | tradePayOff1Data.setCurrency("RMB"); |
| | | tradePayOff1Data.setTotalFee("1"); |
| | | tradePayOff1Data.setRetUrl("/home/"); |
| | | tradePayOff1Data.setClientIp("127.0.0.1"); |
| | | tradePayOff1Data.setNeedLoginFlag("N"); |
| | | tradePayOff1Data.setOrderDesc("出行订单支付"); |
| | | tradePayOff1Data.setAccessMode("H5"); |
| | | List<GoodsInfoRequest> goodsInfo = new ArrayList<>(); |
| | | GoodsInfoRequest goodsInfoRequest = new GoodsInfoRequest(); |
| | | goodsInfoRequest.setId("1"); |
| | | goodsInfoRequest.setSubAppId(QianYunTongProperties.appId); |
| | | goodsInfoRequest.setSubOpenId("oVLur6yFtED8ruXBWUFKXjzXJ_BQ"); |
| | | goodsInfoRequest.setProfitSharing("1"); |
| | | goodsInfo.add(goodsInfoRequest); |
| | | tradePayOff1Data.setGoodsInfo(goodsInfo); |
| | | PayInfo payInfo = tradePayOff1(tradePayOff1Data); |
| | | System.err.println(payInfo); |
| | | // TradePayOff1Data tradePayOff1Data = new TradePayOff1Data(); |
| | | // tradePayOff1Data.setPartnerId("5400004"); |
| | | // tradePayOff1Data.setScene("TRAFFIC"); |
| | | // tradePayOff1Data.setPartnerPayId("1948685426689200128"); |
| | | // tradePayOff1Data.setCurrency("RMB"); |
| | | // tradePayOff1Data.setTotalFee("1"); |
| | | // tradePayOff1Data.setRetUrl("/home/"); |
| | | // tradePayOff1Data.setClientIp("127.0.0.1"); |
| | | // tradePayOff1Data.setNeedLoginFlag("N"); |
| | | // tradePayOff1Data.setOrderDesc("出行订单支付"); |
| | | // tradePayOff1Data.setAccessMode("APP"); |
| | | // List<GoodsInfoRequest> goodsInfo = new ArrayList<>(); |
| | | // GoodsInfoRequest goodsInfoRequest = new GoodsInfoRequest(); |
| | | // goodsInfoRequest.setId("981100006005901"); |
| | | // goodsInfoRequest.setSubAppId("wxcbad113185a243e1"); |
| | | // goodsInfoRequest.setSubOpenId("oVLur6yFtED8ruXBWUFKXjzXJ_BQ"); |
| | | // goodsInfoRequest.setProfitSharing("1"); |
| | | // goodsInfoRequest.setAreaInfo("520100"); |
| | | // goodsInfoRequest.setPayType("0"); |
| | | // goodsInfoRequest.setBusinessType("10408"); |
| | | // goodsInfo.add(goodsInfoRequest); |
| | | // tradePayOff1Data.setGoodsInfo(goodsInfo); |
| | | // PayInfo payInfo = tradePayOff1(tradePayOff1Data); |
| | | // System.err.println(payInfo); |
| | | //PayInfo(retCode=000000, retMsg=success, success=true, data=PayInfoData(redirectUrl=https://qhsctest.qytzt.cn/gray/mobile/index.html?f=allCashDesk&accessToken=5nUBXayFpfZz%2FXUZiMu9LzeRXmqmlqaCS%2BHfu5udIt4%3D, payId=540000420250725000135549, status=null, payTime=null, payFee=null, paymentInfos=null), sign=8154ba2728280900b122c56352c1c7fe) |
| | | |
| | | |
| | | // (补偿单)拉起支付 |
| | | // TradePayOffData tradePayOffData = new TradePayOffData(); |
| | | // tradePayOffData.setPartnerId("5400004"); |
| | | // tradePayOffData.setScene("TRAFFIC"); |
| | | // tradePayOffData.setPartnerPayId("1948685426689200128"); |
| | | // tradePayOffData.setCurrency("RMB"); |
| | | // tradePayOffData.setTotalFee("1"); |
| | | // tradePayOffData.setRetUrl("/home/"); |
| | | // tradePayOffData.setClientIp("127.0.0.1"); |
| | | // tradePayOffData.setNeedLoginFlag("N"); |
| | | // tradePayOffData.setOrderDesc("出行订单支付"); |
| | | // tradePayOffData.setAccessMode("APP"); |
| | | // List<PaymentInfoRequest> paymentInfoRequests = new ArrayList<>(); |
| | | // PaymentInfoRequest paymentInfoRequest = new PaymentInfoRequest(); |
| | | // paymentInfoRequest.setPayModeId("501212"); |
| | | // paymentInfoRequests.add(paymentInfoRequest); |
| | | // tradePayOffData.setPaymentInfos(paymentInfoRequests); |
| | | // List<GoodsInfo> goodsInfo = new ArrayList<>(); |
| | | // GoodsInfo goodsInfo1 = new GoodsInfo(); |
| | | // goodsInfo1.setMerchantCode(""); |
| | | // goodsInfo1.setCustId(""); |
| | | // goodsInfo1.setCustName(""); |
| | | // goodsInfo1.setProfitSharing("1"); |
| | | // goodsInfo.add(goodsInfo1); |
| | | // tradePayOffData.setGoodsInfo(goodsInfo); |
| | | // PayInfo payInfo1 = tradePayOff(tradePayOffData); |
| | | // System.err.println(payInfo1); |
| | | |
| | | //订单创建 |
| | | // CreateOrderRequest createOrderRequest = new CreateOrderRequest(); |
| | | // createOrderRequest.setTreatShopId(""); |
| | | // createOrderRequest.setTreatShopId("11448158"); |
| | | // createOrderRequest.setOrderAppId("52270015"); |
| | | // createOrderRequest.setScene("TRAFFIC"); |
| | | // createOrderRequest.setPartnerId("522700"); |
| | | // createOrderRequest.setField1("{\"profitSharing\":\"0\",\"isPromote\":\"0\"}"); |
| | | // createOrderRequest.setField1("{\"profitSharing\":\"1\",\"isPromote\":\"0\"}"); |
| | | // createOrderRequest.setCharge(new BigDecimal("0.01")); |
| | | // createOrderRequest.setChannelSource("GRJYCXWXXCX"); |
| | | // createOrderRequest.setOrderId(""); |
| | | // createOrderRequest.setOrderNo(""); |
| | | // createOrderRequest.setCustomerId(""); |
| | | // createOrderRequest.setOrderId("1948685426689200128"); |
| | | // createOrderRequest.setOrderNo("0123456"); |
| | | // createOrderRequest.setCustomerId("11448156"); |
| | | // OrderInfo orderInfo = tradeOrderCreate(createOrderRequest); |
| | | // System.err.println(orderInfo); |
| | | |
| | | //行程单列表查询 |
| | | // GetTravelItineraryListRequest request = new GetTravelItineraryListRequest(); |
| | | // request.setScene("TRAFFIC"); |
| | | // request.setPartnerId("522700"); |
| | | // request.setCustomerId("11448156"); |
| | | // request.setOrderNo("0123456"); |
| | | // request.setDriverId("11448158"); |
| | | // ListPage<TravelItinerary> travelItineraryList = getTravelItineraryList(request); |
| | | // System.err.println(travelItineraryList); |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | public static PayInfo tradePayOff(TradePayOffData tradePayOffData) { |
| | | TradeRequest request = new TradeRequest<TradePayOffData>(); |
| | | request.setSceneId(QianYunTongProperties.sceneId); |
| | | request.setSceneId("1774717104844095488"); |
| | | request.setAppId(QianYunTongProperties.appkey); |
| | | request.setConfigVersion(1); |
| | | request.setRequestId(UUIDUtil.getRandomCode()); |
| | |
| | | /** |
| | | * 私钥地址 |
| | | */ |
| | | String privateKeyPath = "C:\\Users\\39373\\Desktop\\黔云通\\private_key_test.pem"; |
| | | String privateKeyPath = "C:\\Users\\Administrator\\Desktop\\private_key_test.pem"; |
| | | /** |
| | | * 私钥地址 |
| | | */ |
| | |
| | | * 分账标识。0:不分账,1:分账 |
| | | */ |
| | | private String profitSharing; |
| | | /** |
| | | * 地区标识,默认传520100 |
| | | */ |
| | | private String areaInfo; |
| | | /** |
| | | * 是否匿名。默认传0 |
| | | */ |
| | | private String payType; |
| | | /** |
| | | * 业务类型,默认传10408 |
| | | */ |
| | | private String businessType; |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.warpper; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @ApiModelProperty("车型照片") |
| | | private String img; |
| | | @ApiModelProperty("预估金额-专车对应独享") |
| | | private Double amount; |
| | | private Map<String, Object> amount; |
| | | @ApiModelProperty("包车的价格") |
| | | private String price; |
| | | @ApiModelProperty("预估里程(公里)") |
| | |
| | | private Double duration; |
| | | |
| | | @ApiModelProperty("预估金额-专车对应一口价") |
| | | private Double buyNowAmount; |
| | | private Map<String, Object> buyNowAmount; |
| | | @ApiModelProperty("预估金额-专车对应一人拼成价格") |
| | | private Double putTogetherOneAmount; |
| | | private Map<String, Object> putTogetherOneAmount; |
| | | @ApiModelProperty("预估金额-专车对应一人未拼成价格") |
| | | private Double notAssembledOneAmount; |
| | | private Map<String, Object> notAssembledOneAmount; |
| | | @ApiModelProperty("预估金额-专车对应两人拼成价格") |
| | | private Double putTogetherTwoAmount; |
| | | private Map<String, Object> putTogetherTwoAmount; |
| | | @ApiModelProperty("预估金额-专车对应两人未拼成价格") |
| | | private Double notAssembledTwoAmount; |
| | | private Map<String, Object> notAssembledTwoAmount; |
| | | @ApiModelProperty("预估金额-专车对应三人拼成价格") |
| | | private Double putTogetherThreeAmount; |
| | | private Map<String, Object> putTogetherThreeAmount; |
| | | @ApiModelProperty("预估金额-专车对应三人未拼成价格") |
| | | private Double notAssembledThreeAmount; |
| | | private Map<String, Object> notAssembledThreeAmount; |
| | | @ApiModelProperty("是否开启拼车(1=是,2=否)") |
| | | private Integer isOpen; |
| | | |
| | |
| | | this.isOpenPrice = isOpenPrice; |
| | | } |
| | | |
| | | public Double getBuyNowAmount() { |
| | | public Map<String, Object> getBuyNowAmount() { |
| | | return buyNowAmount; |
| | | } |
| | | |
| | | public void setBuyNowAmount(Double buyNowAmount) { |
| | | public void setBuyNowAmount(Map<String, Object> buyNowAmount) { |
| | | this.buyNowAmount = buyNowAmount; |
| | | } |
| | | |
| | | public Double getPutTogetherOneAmount() { |
| | | public Map<String, Object> getPutTogetherOneAmount() { |
| | | return putTogetherOneAmount; |
| | | } |
| | | |
| | | public void setPutTogetherOneAmount(Double putTogetherOneAmount) { |
| | | public void setPutTogetherOneAmount(Map<String, Object> putTogetherOneAmount) { |
| | | this.putTogetherOneAmount = putTogetherOneAmount; |
| | | } |
| | | |
| | | public Double getNotAssembledOneAmount() { |
| | | public Map<String, Object> getNotAssembledOneAmount() { |
| | | return notAssembledOneAmount; |
| | | } |
| | | |
| | | public void setNotAssembledOneAmount(Double notAssembledOneAmount) { |
| | | public void setNotAssembledOneAmount(Map<String, Object> notAssembledOneAmount) { |
| | | this.notAssembledOneAmount = notAssembledOneAmount; |
| | | } |
| | | |
| | | public Double getPutTogetherTwoAmount() { |
| | | public Map<String, Object> getPutTogetherTwoAmount() { |
| | | return putTogetherTwoAmount; |
| | | } |
| | | |
| | | public void setPutTogetherTwoAmount(Double putTogetherTwoAmount) { |
| | | public void setPutTogetherTwoAmount(Map<String, Object> putTogetherTwoAmount) { |
| | | this.putTogetherTwoAmount = putTogetherTwoAmount; |
| | | } |
| | | |
| | | public Double getNotAssembledTwoAmount() { |
| | | public Map<String, Object> getNotAssembledTwoAmount() { |
| | | return notAssembledTwoAmount; |
| | | } |
| | | |
| | | public void setNotAssembledTwoAmount(Double notAssembledTwoAmount) { |
| | | public void setNotAssembledTwoAmount(Map<String, Object> notAssembledTwoAmount) { |
| | | this.notAssembledTwoAmount = notAssembledTwoAmount; |
| | | } |
| | | |
| | | public Double getPutTogetherThreeAmount() { |
| | | public Map<String, Object> getPutTogetherThreeAmount() { |
| | | return putTogetherThreeAmount; |
| | | } |
| | | |
| | | public void setPutTogetherThreeAmount(Double putTogetherThreeAmount) { |
| | | public void setPutTogetherThreeAmount(Map<String, Object> putTogetherThreeAmount) { |
| | | this.putTogetherThreeAmount = putTogetherThreeAmount; |
| | | } |
| | | |
| | | public Double getNotAssembledThreeAmount() { |
| | | public Map<String, Object> getNotAssembledThreeAmount() { |
| | | return notAssembledThreeAmount; |
| | | } |
| | | |
| | | public void setNotAssembledThreeAmount(Double notAssembledThreeAmount) { |
| | | public void setNotAssembledThreeAmount(Map<String, Object> notAssembledThreeAmount) { |
| | | this.notAssembledThreeAmount = notAssembledThreeAmount; |
| | | } |
| | | |
| | |
| | | this.img = img; |
| | | } |
| | | |
| | | public Double getAmount() { |
| | | public Map<String, Object> getAmount() { |
| | | return amount; |
| | | } |
| | | |
| | | public void setAmount(Double amount) { |
| | | public void setAmount(Map<String, Object> amount) { |
| | | this.amount = amount; |
| | | } |
| | | |
| | |
| | | serverCarModelWarpper.setId(null != map.get("id") ? Integer.valueOf(map.get("id").toString()) : 0); |
| | | serverCarModelWarpper.setName(null != map.get("name") ? map.get("name").toString() : ""); |
| | | serverCarModelWarpper.setImg(null != map.get("img") ? map.get("img").toString() : ""); |
| | | serverCarModelWarpper.setAmount(null != map.get("amount") ? Double.valueOf(map.get("amount").toString()) : 0); |
| | | serverCarModelWarpper.setPrice(null != map.get("price") ? map.get("price").toString() : ""); |
| | | serverCarModelWarpper.setMileage(null != map.get("mileage") ? Double.valueOf(map.get("mileage").toString()) : 0); |
| | | serverCarModelWarpper.setDuration(null != map.get("duration") ? Double.valueOf(map.get("duration").toString()) : 0); |
| | |
| | | private String callbackPath; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 出租车下单操作 |
| | | * |
| | | * @param orderTaxi |
| | | * @param uid |
| | | * @return |
| | |
| | | // orderTaxi.setTrackId(track); |
| | | // |
| | | //调用移动的小号接口 |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderTaxi.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderTaxi.setTelX(map.get("telX")); |
| | | orderTaxi.setBindId(map.get("bindId")); |
| | | } |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderTaxi.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | // if (String.valueOf(map.get("code")).equals("200")) { |
| | | // orderTaxi.setTelX(map.get("telX")); |
| | | // orderTaxi.setBindId(map.get("bindId")); |
| | | // } |
| | | |
| | | driver.setState(3); |
| | | driverService.updateById(driver); |
| | |
| | | |
| | | /** |
| | | * 继续执行推动等待操作 |
| | | * |
| | | * @param id |
| | | * @throws Exception |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取取消订单需要支付的金额(包含小费) |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | return ResultUtil.error("获取数据失败,订单信息有误"); |
| | | } |
| | | double amount = 0; |
| | | CancleOrder query = cancleOrderService.query(orderTaxi.getOrderType(), 2, orderTaxi.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | CancleOrder query = cancleOrderService.query(orderTaxi.getOrderType(), 2, openCity.getId()); |
| | | if(null == query){ |
| | | return ResultUtil.error("请先完善取消规则"); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 添加订单取消 |
| | | * |
| | | * @param id |
| | | * @param reason |
| | | * @param remark |
| | |
| | | this.updateById(orderTaxi); |
| | | } |
| | | }else { |
| | | CancleOrder query = cancleOrderService.query(orderTaxi.getOrderType(), 2, orderTaxi.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | CancleOrder query = cancleOrderService.query(orderTaxi.getOrderType(), 2, openCity.getId()); |
| | | if (null != query) { |
| | | if ((orderTaxi.getSnatchOrderTime().getTime() + query.getMinuteNum() * 60 * 1000) < System.currentTimeMillis() && query.getMoney().compareTo(0D) > 0) {//收费的情况 |
| | | orderTaxi.setState(12); |
| | |
| | | |
| | | /** |
| | | * 取消订单操作 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | orderCancel = orderCancelService.selectById(cancleId); |
| | | } |
| | | |
| | | CancleOrder query = cancleOrderService.query(orderTaxi.getOrderType(), 2, orderTaxi.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | CancleOrder query = cancleOrderService.query(orderTaxi.getOrderType(), 2, openCity.getId()); |
| | | System.out.println("取消订单:"+query); |
| | | if(null != query){ |
| | | if(payType == 1){//微信支付 |
| | |
| | | |
| | | /** |
| | | * 删除定时任务 |
| | | * |
| | | * @param orderId |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 获取用户余额和可用优惠券数量 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取最优数据 |
| | | * |
| | | * @param orderTaxi |
| | | * @param price |
| | | * @param id |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取优惠券列表 |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 订单完成支付订单操作 |
| | | * |
| | | * @param payType 1=微信,2=支付宝,3=余额 |
| | | * @param orderId |
| | | * @return |
| | |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderTaxi.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderTaxi.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | if(null != query1){ |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | } |
| | |
| | | this.updateAllColumnById(orderTaxi); |
| | | return resultUtil; |
| | | } |
| | | |
| | | @Autowired |
| | | private AppOrderController appOrderController; |
| | | |
| | | /** |
| | | * 手动完成订单操作 |
| | | * |
| | | * @param orderId |
| | | * @param orderType |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取用户的订单列表 |
| | | * |
| | | * @param uid |
| | | * @param pageNum |
| | | * @param size |
| | |
| | | |
| | | /** |
| | | * 获取历史消费记录 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取红包使用记录 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取用户单发票页面的订单列表 |
| | | * |
| | | * @param type 开票状态(1=未开票,2=已开票) |
| | | * @param startTime 订单开始时间 |
| | | * @param endTime 订单结束时间 |
| | |
| | | |
| | | /** |
| | | * 获取订单详情 |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | |
| | | if(map.get("abnormalIntro")!=null){ |
| | | map.put("appealStatus", 1); |
| | | } |
| | | |
| | | String driverId = (String) redisTemplate.opsForValue().get("DEVICE_" + map.get("driverId")); |
| | | map.put("device", ToolUtil.isNotEmpty(driverId) ? 2 : 1); |
| | | map.put("orderType", 2); |
| | |
| | | |
| | | /** |
| | | * 获取下单推送完后没有司机下单的提醒 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | endPushWarpper.setOrderId(orderTaxi.getId()); |
| | | endPushWarpper.setOrderType(2); |
| | | endPushWarpper.setState(1); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, orderTaxi.getCompanyId());//获取需要推送的次数 |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, openCity.getId());//获取需要推送的次数 |
| | | int time = 0; |
| | | for(int i = 1; i <= querys.size()+5; i++){ |
| | | PushOrder pushOrder = pushOrderService.querys(i, 2, orderTaxi.getCompanyId()).get(0); |
| | | int finalI = i; |
| | | PushOrder pushOrder = querys.stream().filter(s -> s.getType() == (finalI <= 3 ? finalI : 3)).findFirst().orElse(null); |
| | | time += pushOrder.getPushTime() * 1000; |
| | | } |
| | | //当前时间减去推单总时间大于下单时间 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取服务中的订单数据 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 评论成功后获取红包金额 |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 分享成功后添加红包 |
| | | * |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取订单数据 |
| | | * |
| | | * @param uid |
| | | * @param state |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 订单支付完成后的处理 |
| | | * |
| | | * @param id 订单=id |
| | | * @param order_id 工行支付单号 |
| | | * @param type 1=微信,2=支付宝 |
| | |
| | | orderTaxi.setPayMoney(query.getAmount()); |
| | | |
| | | UserInfo userInfo = userInfoService.selectById(orderTaxi.getUserId()); |
| | | SysIntegral query1 = sysIntegralMapper.query(orderTaxi.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | userInfoService.updateById(userInfo); |
| | | |
| | |
| | | |
| | | /** |
| | | * 取消订单支付后的处理 |
| | | * |
| | | * @param id 订单=id |
| | | * @param order_id 工行支付单号 |
| | | * @param type 1=微信,2=支付宝 |
| | |
| | | |
| | | /** |
| | | * 推送订单给司机抢单 |
| | | * |
| | | * @param orderTaxi |
| | | * @throws Exception |
| | | */ |
| | |
| | | if (ToolUtil.isNotEmpty(vehicle)) { |
| | | integers = JSON.parseArray(vehicle).toJavaList(Integer.class); |
| | | } |
| | | Company query = companyCityService.query(String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat()));//获取起点所属分公司 |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, query.getId());//获取需要推送的次数 |
| | | |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | List<PushOrder> querys = pushOrderService.querys(null, 2, openCity.getId());//获取需要推送的次数 |
| | | //整轮派单结束,若无司机接单,系统自动增加派单5轮,若增加5轮后任无司机接单,则系统结束派单,乘客端显示无司机接单、是否再次打车 |
| | | for (int i = 1; i <= querys.size()+5; i++) { |
| | | PushOrder pushOrder = pushOrderService.querys(i, 2, query.getId()).get(0); |
| | | int finalI = i; |
| | | PushOrder pushOrder = querys.stream().filter(s -> s.getType() == (finalI <= 3 ? finalI : 3)).findFirst().orElse(null); |
| | | System.out.println("pushOrder:" + pushOrder); |
| | | //获取空闲司机 |
| | | List<Driver> list = driverService.queryIdleDriver(2, orderTaxi.getStartLon(), orderTaxi.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public synchronized String getOrderNum() throws Exception{ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | |
| | | // } |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderTaxi.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | |
| | | query.setCode(order_id); |
| | | paymentRecordService.updateById(query); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderTaxi.getCompanyId()); |
| | | OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | |
| | | application: |
| | | name: user-server |
| | | profiles: |
| | | # active: dev |
| | | active: prod |
| | | active: dev |
| | | # active: prod |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | |
| | | max-request-size: 100MB |
| | | max-file-size: 100MB |
| | | redis: |
| | | host: 172.21.35.151 |
| | | port: 6512 |
| | | password: SC_cache@20#25 |
| | | database: 0 |
| | | timeout: 1000 |
| | | cluster: |
| | | nodes: 172.21.35.151:6512,172.21.35.152:6512,172.21.35.153:6512,172.21.35.151:6513,172.21.35.152:6513,172.21.35.153:6513 |
| | | host: 192.168.110.80 |
| | | port: 6379 |
| | | password: 123456 |
| | | # redis: |
| | | # host: 172.21.35.151 |
| | | # port: 6512 |
| | | # password: SC_cache@20#25 |
| | | # database: 0 |
| | | # timeout: 1000 |
| | | # cluster: |
| | | # nodes: 172.21.35.151:6512,172.21.35.152:6512,172.21.35.153:6512,172.21.35.151:6513,172.21.35.152:6513,172.21.35.153:6513 |
| | | |
| | | mybatis-plus: |
| | | typeAliasesPackage: com.stylefeng.guns.modular |
| | |
| | | swagger: |
| | | base-package: com.stylefeng.guns.modular |
| | | |
| | | |
| | | spring: |
| | | datasource: |
| | | url: jdbc:mysql://172.21.35.140:8066/traffic_scdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: traffic_scusr |
| | | password: QYT_sc@20#25 |
| | | db-name: traffic_scdb #用来搜集数据库的所有表 |
| | | url: jdbc:mysql://192.168.110.80:3306/qyttravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: 123456 |
| | | db-name: qyttravel #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | | |
| | | #spring: |
| | | # datasource: |
| | | # url: jdbc:mysql://172.21.35.140:8066/traffic_scdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | # username: traffic_scusr |
| | | # password: QYT_sc@20#25 |
| | | # db-name: traffic_scdb #用来搜集数据库的所有表 |
| | | # filters: wall,mergeStat |
| | | |
| | | |
| | | --- |
| | | spring: |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://qyt_jtcx:qyt_jtcx2025@172.21.35.195:27017,172.21.35.196:27017/traveling_track |
| | | uri: mongodb://192.168.110.80:27017/traveling_track |
| | | # uri: mongodb://qyt_jtcx:qyt_jtcx2025@172.21.35.195:27017,172.21.35.196:27017/traveling_track |
| | | |
| | | |
| | | --- |