| | |
| | | spring: |
| | | profiles: local |
| | | datasource: |
| | | url: jdbc:mysql://116.63.168.184:3306/feima?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://127.0.0.1:3306/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: root |
| | | password: 123456 |
| | | db-name: guns #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/queryByType") |
| | | @ApiOperation(value = "获取广告列表", tags = {"用户端-首页"}, notes = "") |
| | | @ApiOperation(value = "获取广告列表【1.0】", tags = {"用户端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "数据类型(1:弹窗广告,2:底部广告)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "当前定位城市code(510100)", name = "code", required = true, dataType = "string") |
| | | @ApiImplicitParam(value = "当前定位纬度", name = "lat", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "当前定位经度", name = "lnt", required = true, dataType = "double") |
| | | }) |
| | | public ResultUtil<List<AdvertisementWarpper>> queryAdvertisement(String code, Integer type){ |
| | | public ResultUtil<List<AdvertisementWarpper>> queryAdvertisement(Double lat, Double lnt, Integer type){ |
| | | try { |
| | | List<AdvertisementWarpper> advertisementWarpper = advertisementService.queryAdvertisement(code, type); |
| | | List<AdvertisementWarpper> advertisementWarpper = advertisementService.queryAdvertisement(lat, lnt, type); |
| | | return ResultUtil.success(advertisementWarpper); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @PostMapping("/queryByType") |
| | | @ApiOperation(value = "获取各种协议及H5页面【1.0】", tags = {"用户端-协议"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "数据类型(1:隐私协议,2:用户协议,3:用户指南,4:法律条款,5:关于我们,6=注册协议,7=取消订单说明,8=充值领券规则设置,9=司机注册协议,10=改派说明,11=跨城出行乘车须知,12:常见问题,13:计价规则,14:包车协议)", name = "type", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil<BaseWarpper> queryByType(Integer type, Integer language){ |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/queryIdleDriver") |
| | | @ApiOperation(value = "获取5公里范围内空闲司机数量", tags = {"用户端-首页"}, notes = "") |
| | | @ApiOperation(value = "获取5公里范围内空闲司机数量【1.0】", tags = {"用户端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "乘客当前定位经度", name = "lon", required = true, dataType = "double"), |
| | |
| | | |
| | | import com.stylefeng.guns.modular.system.service.IOpenCityBusinessService; |
| | | import com.stylefeng.guns.modular.system.service.IOpenCityService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @Autowired |
| | | private IOpenCityBusinessService openCityBusinessService; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取开通城市列表 |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryOpenCity") |
| | | @ApiOperation(value = "获取开通城市列表", tags = {"用户端-首页"}, notes = "") |
| | | @ApiOperation(value = "获取开通城市列表【1.0】", tags = {"用户端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "语言(1=中文,2=英文,3=法语)", name = "language", required = false, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = false, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<BaseWarpper>> queryOpenCity(){ |
| | | public ResultUtil<List<BaseWarpper>> queryOpenCity(Integer language, HttpServletRequest request){ |
| | | try { |
| | | List<BaseWarpper> list = openCityService.queryOpenCity(); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | List<BaseWarpper> list = openCityService.queryOpenCity(uid, language); |
| | | return ResultUtil.success(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据当前定位获取对应的业务类型 |
| | | * @param province |
| | | * @param city |
| | | * @param district |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryBusiness") |
| | | @ApiOperation(value = "根据当前定位获取业务类型", tags = {"用户端-首页"}, notes = "") |
| | | @ApiOperation(value = "根据当前定位获取业务类型【1.0】", tags = {"用户端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "省名称", name = "province", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "市名称", name = "city", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "区县名称", name = "district", required = true, dataType = "String") |
| | | @ApiImplicitParam(value = "纬度", name = "lat", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "经度", name = "lnt", required = true, dataType = "double"), |
| | | }) |
| | | public ResultUtil<List<BaseWarpper>> queryBusiness(String province, String city, String district){ |
| | | public ResultUtil<List<BaseWarpper>> queryBusiness(Double lat, Double lnt){ |
| | | try { |
| | | List<BaseWarpper> list = openCityBusinessService.queryBusiness(province, city, district); |
| | | List<BaseWarpper> list = openCityBusinessService.queryBusiness(lat, lnt); |
| | | return ResultUtil.success(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | |
| | | /** |
| | | * 判断开通城市 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/openCity") |
| | | @ApiOperation(value = "判断当前是否是开通城市", tags = {"用户端-首页"}, notes = "open=1(是),open=2(否)") |
| | | @ApiOperation(value = "判断当前是否是开通城市【1.0】", tags = {"用户端-首页"}, notes = "open=1(是),open=2(否)") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "当前定位城市code", name = "code", required = true, dataType = "String") |
| | | @ApiImplicitParam(value = "纬度", name = "lat", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "经度", name = "lnt", required = true, dataType = "String") |
| | | }) |
| | | public ResultUtil openCity(String code){ |
| | | public ResultUtil openCity(Double lat, Double lnt){ |
| | | try { |
| | | boolean b = openCityService.openCity(code); |
| | | boolean b = openCityService.openCity(lat, lnt); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("open", b ? 1 : 2); |
| | | return ResultUtil.success(map); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryOrderInfo") |
| | | @ApiOperation(value = "获取服务中的详情数据", tags = {"用户端-服务中"}, notes = "") |
| | | @ApiOperation(value = "获取服务中的详情数据【1.0】", tags = {"用户端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=同城小件,5=跨城小件)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<OrderInfoWarpper> queryOrderInfo(Integer orderId, Integer orderType){ |
| | |
| | | break; |
| | | case 3://跨城 |
| | | map = orderCrossCityService.queryOrderInfo(orderId); |
| | | break; |
| | | case 4://同城小件 |
| | | map = orderLogisticsService.queryOrderInfo(orderId); |
| | | break; |
| | | case 5://跨城小件 |
| | | map = orderLogisticsService.queryOrderInfo(orderId); |
| | | break; |
| | | } |
| | | if(map.get("telX") != null){ |
| | |
| | | orderInfoWarpper.setOrderPositionList(list); |
| | | } |
| | | return ResultUtil.success(orderInfoWarpper); |
| | | //return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/order/queryOrderInfo_") |
| | | @ApiOperation(value = "获取服务中的详情数据", tags = {"分享专用"}, notes = "") |
| | | @ApiOperation(value = "获取服务中的详情数据【1.0】", tags = {"分享专用"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=同城小件,5=跨城小件)", name = "orderType", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<OrderInfoWarpper> queryOrderInfo_(Integer orderId, Integer orderType){ |
| | | try { |
| | |
| | | break; |
| | | case 3://跨城 |
| | | map = orderCrossCityService.queryOrderInfo(orderId); |
| | | break; |
| | | case 4://同城小件 |
| | | map = orderLogisticsService.queryOrderInfo(orderId); |
| | | break; |
| | | case 5://跨城小件 |
| | | map = orderLogisticsService.queryOrderInfo(orderId); |
| | | break; |
| | | } |
| | | if(null != map.get("telX")){ |
| | |
| | | * 获取订单取消支付页面详情 |
| | | * @param orderId |
| | | * @param orderType |
| | | * @return |
| | | * @。,; |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryCancelPage") |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付方式(1=微信,2=支付宝,3=余额)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付方式(1=手机支付,2=银行卡支付,3=余额)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "取消单id(取消操作返回)", name = "cancleId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付端(1=用户APP端,2=司机APP端,3=用户小程序端)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | @ApiOperation(value = "支付页面获取可用优惠券数量和余额", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "balance=余额,coupon=优惠券") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=同城小件,5=跨城小件)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryBalance(Integer orderId, Integer orderType, HttpServletRequest request){ |
| | |
| | | case 3: |
| | | list = orderCrossCityService.queryCoupon(orderId, uid, pageNum, size); |
| | | break; |
| | | // case 4: |
| | | // list = orderLogisticsService.queryCoupon(orderId, uid, pageNum, size); |
| | | // break; |
| | | // case 5: |
| | | // list = orderLogisticsService.queryCoupon(orderId, uid, pageNum, size); |
| | | // break; |
| | | } |
| | | return ResultUtil.success(CouponWarpper.getCouponWarppers(list)); |
| | | }catch (Exception e){ |
| | |
| | | @PostMapping("/api/taxi/payTaxiOrder") |
| | | @ApiOperation(value = "订单完成支付订单操作", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "支付方式(1=微信,2=支付宝,3=余额)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付方式(1=手机支付,2=银行卡支付,3=余额,4=线下支付)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=小件物流)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=同城小件物流,5=跨城小件物流)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "优惠券id", name = "couponId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付端(1=用户APP端,2=司机APP端,3=用户小程序端)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryPhones") |
| | | @ApiOperation(value = "获取首页电话", tags = {"用户端-首页", "用户端-包车"}, notes = "type=1(报警电话),type=2(投诉电话),type=3(包车调度电话)") |
| | | @ApiOperation(value = "获取首页电话【1.0】", tags = {"用户端-首页", "用户端-包车"}, notes = "type=1(报警电话),type=2(投诉电话),type=3(包车调度电话)") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "当前定位行政区域编号", name = "code", required = true, dataType = "string") |
| | | @ApiImplicitParam(value = "定位经度", name = "lat", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "定位维度", name = "code", required = true, dataType = "double") |
| | | }) |
| | | public ResultUtil queryPhones(String code){ |
| | | public ResultUtil queryPhones(Double lat, Double lnt){ |
| | | try { |
| | | List<Phone> phones = phoneService.queryPhones(code); |
| | | List<Phone> phones = phoneService.queryPhones(lat, lnt); |
| | | return ResultUtil.success(phones); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | |
| | | /** |
| | | * 获取个人中心的客服电话 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryCustomerPhone") |
| | | @ApiOperation(value = "获取个人中心的客服电话", tags = {"用户端-个人中心"}, notes = "platform(平台电话),company(本地电话)") |
| | | @ApiOperation(value = "获取个人中心的客服电话【1.0】", tags = {"用户端-个人中心"}, notes = "platform(平台电话),company(本地电话)") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "当前定位行政区域编号", name = "code", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "定位经度", name = "lat", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "定位维度", name = "code", required = true, dataType = "double"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryCustomerPhone(String code){ |
| | | public ResultUtil queryCustomerPhone(Double lat, Double lnt){ |
| | | try { |
| | | Map<String, Object> map = phoneService.queryCustomerPhone(code); |
| | | Map<String, Object> map = phoneService.queryCustomerPhone(lat, lnt); |
| | | return ResultUtil.success(map); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | import com.stylefeng.guns.core.support.HttpKit; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.IReportLossService; |
| | | import com.stylefeng.guns.modular.system.service.ISmsrecordService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.service.IVerifiedService; |
| | |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Autowired |
| | | private IReportLossService reportLossService; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/user/editLanguage") |
| | | @ApiOperation(value = "修改多语言配置", tags = {"用户端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "1=中文,2=英文,3=法语", name = "language", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil editLanguage(Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | userInfo.setLanguage(language); |
| | | userInfoService.updateById(userInfo); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/user/addReportLoss") |
| | | @ApiOperation(value = "提交报失", tags = {"用户端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城出行,4=同城小件物流,5=跨城小件物流)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "提交内容", name = "remark", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "提交图片", name = "image", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil addReportLoss(Integer orderType, Integer orderId, String remark, String image){ |
| | | try { |
| | | reportLossService.addReportLoss(orderType, orderId, remark, image); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | } |
| | |
| | | ( |
| | | (select count(id) from t_order_private_car where driverId = a.driverId and state in (7, 8, 9)) + |
| | | (select count(id) from t_order_taxi where driverId = a.driverId and state in (7, 8, 9)) + |
| | | (select count(id) from t_order_cross_city where driverId = a.driverId and state in (6, 8, 9)) |
| | | (select count(id) from t_order_cross_city where driverId = a.driverId and state in (6, 8, 9)) + |
| | | (select count(id) from t_order_logistics where driverId = a.driverId and state in (6, 9)) |
| | | ) as orderNum, |
| | | b.phone as driverPhone, |
| | | if(a.state = 12, (select money from t_order_cancel where orderId = a.id and orderType = 3 and state = 1 order by insertTime desc limit 0, 1), if(a.state = 10, (select money from t_order_cancel where orderId = a.id and orderType = 3 and state = 2 order by insertTime desc limit 0, 1), 0)) as cancelPayMoney, |
| | |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.OrderServerWarpper; |
| | | import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper; |
| | |
| | | if(ToolUtil.isEmpty(serverCarModelIds)){ |
| | | return ResultUtil.error("请选择服务车型"); |
| | | } |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(startLon, startLat); |
| | | boolean b = openCityService.openCity(geocode.get("districtCode")); |
| | | boolean b = openCityService.openCity(Double.valueOf(startLat), Double.valueOf(startLon)); |
| | | if(!b){ |
| | | return ResultUtil.error("起点暂未开通"); |
| | | } |
| | |
| | | @PostMapping("/api/orderLogistics/payOrderLogisticsSpread") |
| | | @ApiOperation(value = "小件物流补差价支付", tags = {"用户端-小件物流"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "支付方式(1=微信,2=支付宝,3=余额)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付方式(1=手机支付,2=银行卡支付,3=余额,4=现金)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付端(1=用户APP端,2=司机APP端,3=用户小程序端)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | @Param("endMoney") Double endMoney, @Param("uid") Integer uid, |
| | | @Param("orderType") Integer orderType); |
| | | |
| | | |
| | | /** |
| | | * 获取订单详情 |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | Map<String, Object> queryOrderInfo(@Param("orderId") Integer orderId); |
| | | |
| | | } |
| | |
| | | <result column="pickUpCode" property="pickUpCode"/> |
| | | <result column="isReassign" property="isReassign"/> |
| | | <result column="reassignNotice" property="reassignNotice"/> |
| | | <result column="driverPay" property="driverPay"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | and `type` = #{orderType} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="queryOrderInfo" resultType="map"> |
| | | select |
| | | a.id as orderId, |
| | | a.state as state, |
| | | a.oldState as oldState, |
| | | DATE_FORMAT(a.insertTime, '%Y-%m-%d %H:%i:%s') as insertTime, |
| | | DATE_FORMAT(a.travelTime, '%m月%d日 %H:%i') as travelTime, |
| | | DATE_FORMAT(a.arriveTime, '%Y-%m-%d %H:%i:%s') as arriveTime, |
| | | DATE_FORMAT(a.travelTime, '%Y-%m-%d %H:%i:%s') as travelTime1, |
| | | a.startLon as startLon, |
| | | a.startLat as startLat, |
| | | a.startAddress as startAddress, |
| | | a.endLon as endLon, |
| | | a.endLat as endLat, |
| | | a.endAddress as endAddress, |
| | | a.driverId as driverId, |
| | | a.orderMoney as orderMoney, |
| | | a.redPacketMoney as redPacketMoney, |
| | | a.couponMoney as couponMoney, |
| | | a.discountMoney as discountMoney, |
| | | a.payMoney as payMoney, |
| | | a.remark as remark, |
| | | b.headImgUrl as driverAvatar, |
| | | b.`name` as driverName, |
| | | c.carLicensePlate as licensePlate, |
| | | c.carColor as carColor, |
| | | CONCAT(f.`name`, d.`name`) as brand, |
| | | ((select sum(fraction) from t_order_evaluate where driverId = a.driverId) / (select count(id) from t_order_evaluate where driverId = a.driverId)) as score, |
| | | ( |
| | | (select count(id) from t_order_private_car where driverId = a.driverId and state in (7, 8, 9)) + |
| | | (select count(id) from t_order_taxi where driverId = a.driverId and state in (7, 8, 9)) + |
| | | (select count(id) from t_order_cross_city where driverId = a.driverId and state in (6, 8, 9)) + |
| | | (select count(id) from t_order_logistics where driverId = a.driverId and state in (6, 9)) |
| | | ) as orderNum, |
| | | b.phone as driverPhone, |
| | | if(a.state = 10, (select money from t_order_cancel where orderId = a.id and orderType = a.type and state = 1 order by insertTime desc limit 0, 1), if(a.state = 10, (select money from t_order_cancel where orderId = a.id and orderType = a.type and state = 2 order by insertTime desc limit 0, 1), 0)) as cancelPayMoney, |
| | | if(a.state = 10, (select id from t_order_cancel where orderId = a.id and orderType = a.type and state = 1 order by insertTime desc limit 0, 1), 0) as cancelId, |
| | | g.fraction as orderScore, |
| | | g.content as evaluate, |
| | | a.telX as telX, |
| | | h.userType as cancelUserType, |
| | | h.money as cancelMoney, |
| | | h.reason as cancelReason, |
| | | h.remark as cancelRemark |
| | | from t_order_logistics a |
| | | left join t_driver b on (a.driverId = b.id) |
| | | left join t_car c on (a.carId = c.id) |
| | | left join t_car_model d on (c.carModelId = d.id) |
| | | left join t_car_brand f on (d.brandId = f.id) |
| | | left join t_order_evaluate g on (a.id = g.orderId and g.orderType = a.type) |
| | | left join t_order_cancel h on (a.id = h.orderId and h.orderType = a.type and h.state = 2) |
| | | where a.id = #{orderId} |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="payType" property="payType"/> |
| | | <result column="payTime" property="payTime"/> |
| | | <result column="payMoney" property="payMoney"/> |
| | | <result column="driverPay" property="driverPay"/> |
| | | </resultMap> |
| | | </mapper> |
| | |
| | | */ |
| | | @TableField("reassignNotice") |
| | | private Integer reassignNotice; |
| | | /** |
| | | * 司机支付状态(现金支付司机代支付)1待支付 2已支付 |
| | | * @return |
| | | */ |
| | | @TableField("driverPay") |
| | | private Integer driverPay; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.reassignNotice = reassignNotice; |
| | | } |
| | | |
| | | public Integer getDriverPay() { |
| | | return driverPay; |
| | | } |
| | | |
| | | public void setDriverPay(Integer driverPay) { |
| | | this.driverPay = driverPay; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderLogistics{" + |
| | |
| | | */ |
| | | @TableField("payMoney") |
| | | private Double payMoney; |
| | | /** |
| | | * 司机支付状态(现金支付司机代支付)1待支付 2已支付 |
| | | * @return |
| | | */ |
| | | @TableField("driverPay") |
| | | private Integer driverPay; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.payMoney = payMoney; |
| | | } |
| | | |
| | | public Integer getDriverPay() { |
| | | return driverPay; |
| | | } |
| | | |
| | | public void setDriverPay(Integer driverPay) { |
| | | this.driverPay = driverPay; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderLogisticsSpread{" + |
| | |
| | | * @throws Exception |
| | | */ |
| | | Map<String, Object> queryBalance(Integer orderId, Integer uid) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 获取订单详情 |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | Map<String, Object> queryOrderInfo(Integer orderId) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 获取优惠券列表 |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Map<String, Object>> queryCoupon(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception; |
| | | } |
| | |
| | | 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.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.smallLogistics.dao.OrderLogisticsMapper; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogisticsSpread; |
| | |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.*; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.taxi.model.PaymentRecord; |
| | | import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; |
| | |
| | | @Autowired |
| | | private GDMapElectricFenceUtil gdMapElectricFenceUtil; |
| | | |
| | | @Autowired |
| | | private IUserCouponRecordService userCouponRecordService; |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil queryLogisticsUnitPrice(Integer type, String startLonLat, String endAddress, Integer uid) throws Exception { |
| | | Company query = companyCityService.query(startLonLat.split(",")[0], startLonLat.split(",")[1]); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(startLonLat.split(",")[1]), Double.valueOf(startLonLat.split(",")[0])); |
| | | if(null == reverseGeocode){ |
| | | return ResultUtil.error("地理位置解析失败"); |
| | | } |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] city = new String[addressComponentsVos.length]; |
| | | for (int i = 0; i < addressComponentsVos.length; i++) { |
| | | city[i] = addressComponentsVos[i].getLongName(); |
| | | } |
| | | Company query = companyCityService.query(city); |
| | | if(null == query){ |
| | | return ResultUtil.error("预约取货点暂无企业服务"); |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | public ResultUtil queryPayMoney(Integer number, Integer type, String startLonLat, String endAddress) throws Exception{ |
| | | Map<String, Object> geocoding = gdMapGeocodingUtil.geocoding(endAddress); |
| | | if(Integer.valueOf(geocoding.get("status").toString()) != 0){ |
| | | FindPlaceFromTextVo findplacefromtext = GoogleMapUtil.findplacefromtext(endAddress); |
| | | if(null == findplacefromtext){ |
| | | return ResultUtil.error("收货地址有误,无法查询具体地址信息"); |
| | | } |
| | | String location = ((List<String>)geocoding.get("data")).get(0); |
| | | ResultUtil<Map<String, Double>> price = this.getPrice(type, startLonLat.split(",")[0], startLonLat.split(",")[1], location.split(",")[0], location.split(",")[1]); |
| | | Double lng = findplacefromtext.getLng(); |
| | | Double lat = findplacefromtext.getLat(); |
| | | ResultUtil<Map<String, Double>> price = this.getPrice1(type, startLonLat.split(",")[0], startLonLat.split(",")[1], lng.toString(), lat.toString()); |
| | | if(price.getCode() == 200 && type == 5){ |
| | | Map<String, Double> data = price.getData(); |
| | | data.put("ordinary", data.get("ordinary") * number); |
| | |
| | | endAddress = endAddress.replaceAll("& #40;", "("); |
| | | endAddress = endAddress.replaceAll("& #41;", ")"); |
| | | OrderLogistics orderLogistics = new OrderLogistics(); |
| | | Company query = companyCityService.query(placementLon, placementLat); |
| | | Company query = companyCityService.query1(placementLon, placementLat); |
| | | if(null == query){ |
| | | return ResultUtil.error("该地点暂无企业服务"); |
| | | } |
| | |
| | | orderLogistics.setRemark(remark); |
| | | orderLogistics.setPlacementLon(Double.valueOf(placementLon)); |
| | | orderLogistics.setPlacementLat(Double.valueOf(placementLat)); |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(placementLon, placementLat); |
| | | orderLogistics.setPlacementAddress(geocode.get("address")); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon)); |
| | | if(null == reverseGeocode){ |
| | | return ResultUtil.error("解析地址出错"); |
| | | } |
| | | |
| | | String address = reverseGeocode.getAddress(); |
| | | orderLogistics.setPlacementAddress(address); |
| | | orderLogistics.setStartLon(Double.valueOf(startLon)); |
| | | orderLogistics.setStartLat(Double.valueOf(startLat)); |
| | | orderLogistics.setStartAddress(startAddress); |
| | | Map<String, Object> geocoding = gdMapGeocodingUtil.geocoding(endAddress); |
| | | if(Integer.valueOf(geocoding.get("status").toString()) != 0){ |
| | | FindPlaceFromTextVo findplacefromtext = GoogleMapUtil.findplacefromtext(endAddress); |
| | | if(null == findplacefromtext){ |
| | | return ResultUtil.error("收货地址有误,无法查询具体地址信息"); |
| | | } |
| | | if(((List<String>)geocoding.get("data")).size() == 0){ |
| | | return ResultUtil.error("无法查询具体地址信息"); |
| | | } |
| | | String location = ((List<String>)geocoding.get("data")).get(0); |
| | | orderLogistics.setEndLon(Double.valueOf(location.split(",")[0])); |
| | | orderLogistics.setEndLat(Double.valueOf(location.split(",")[1])); |
| | | Double lng = findplacefromtext.getLng(); |
| | | Double lat = findplacefromtext.getLat(); |
| | | orderLogistics.setEndLon(lng); |
| | | orderLogistics.setEndLat(lat); |
| | | orderLogistics.setEndAddress(endAddress); |
| | | orderLogistics.setUrgent(urgent); |
| | | orderLogistics.setRecipient(recipient); |
| | |
| | | orderLogistics.setMileage(0D); |
| | | orderLogistics.setIsReassign(1); |
| | | orderLogistics.setReassignNotice(0); |
| | | ResultUtil<Map<String, Double>> price = this.getPrice(type, String.valueOf(startLon), String.valueOf(startLat), location.split(",")[0], location.split(",")[1]); |
| | | ResultUtil<Map<String, Double>> price = this.getPrice1(type, String.valueOf(startLon), String.valueOf(startLat), lng.toString(), lat.toString()); |
| | | if(price.getCode() != 200){ |
| | | return price; |
| | | } |
| | |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | String distance1 = distance.get("distance"); |
| | | Double dist = Double.valueOf(distance1) / 1000; |
| | | if(dist.compareTo(0D) >= 0 && dist.compareTo(jsonObject.getDouble("num1")) < 0){ |
| | | price1 = jsonObject.getDouble("num2"); |
| | | } |
| | | if(dist.compareTo(0D) >= 0 && dist.compareTo(jsonObject.getDouble("num12")) < 0){ |
| | | price2 = jsonObject.getDouble("num13"); |
| | | } |
| | | |
| | | if(dist.compareTo(jsonObject.getDouble("num3")) >= 0 && dist.compareTo(jsonObject.getDouble("num4")) < 0){ |
| | | price1 = jsonObject.getDouble("num5"); |
| | | } |
| | | if(dist.compareTo(jsonObject.getDouble("num14")) >= 0 && dist.compareTo(jsonObject.getDouble("num15")) < 0){ |
| | | price2 = jsonObject.getDouble("num16"); |
| | | } |
| | | |
| | | if(dist.compareTo(jsonObject.getDouble("num6")) >= 0 && dist.compareTo(jsonObject.getDouble("num7")) < 0){ |
| | | price1 = jsonObject.getDouble("num8"); |
| | | } |
| | | if(dist.compareTo(jsonObject.getDouble("num17")) >= 0 && dist.compareTo(jsonObject.getDouble("num18")) < 0){ |
| | | price2 = jsonObject.getDouble("num19"); |
| | | } |
| | | |
| | | if(dist.compareTo(jsonObject.getDouble("num9")) >= 0 && dist.compareTo(jsonObject.getDouble("num10")) < 0){ |
| | | price1 = jsonObject.getDouble("num11"); |
| | | } |
| | | if(dist.compareTo(jsonObject.getDouble("num20")) >= 0 && dist.compareTo(jsonObject.getDouble("num21")) < 0){ |
| | | price2 = jsonObject.getDouble("num22"); |
| | | } |
| | | }else{ |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null); |
| | | String content = String.valueOf(query1.get("content")); |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | price1 = jsonObject.getDouble("num1"); |
| | | price2 = jsonObject.getDouble("num2"); |
| | | } |
| | | Map<String, Double> map = new HashMap<>(); |
| | | map.put("ordinary", price1);//普通 |
| | | map.put("precious", price2);//贵重 |
| | | return ResultUtil.success(map); |
| | | } |
| | | |
| | | |
| | | |
| | | public ResultUtil<Map<String, Double>> getPrice1(Integer type, String startLon, String startLat, String endLon, String endLat) throws Exception{ |
| | | Company query = companyCityService.query1(startLon, startLat); |
| | | if(null == query){ |
| | | return ResultUtil.error("预约取货点暂无企业服务"); |
| | | } |
| | | Double price1 = 0D; |
| | | Double price2 = 0D; |
| | | if(type == 4){//同城 |
| | | Map<String, Object> query1 = systemPriceMapper.query(query.getId(), type, null); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(startLat), Double.valueOf(startLon), Double.valueOf(endLat), Double.valueOf(endLon)); |
| | | if(null == distancematrix){ |
| | | return ResultUtil.error("计算距离出错"); |
| | | } |
| | | String content = String.valueOf(query1.get("content")); |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | Long distance = distancematrix.getDistance(); |
| | | Double dist = Double.valueOf(distance) / 1000; |
| | | if(dist.compareTo(0D) >= 0 && dist.compareTo(jsonObject.getDouble("num1")) < 0){ |
| | | price1 = jsonObject.getDouble("num2"); |
| | | } |
| | |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | ResultUtil resultUtil = ResultUtil.success(new HashMap<>()); |
| | | |
| | | if(payType == 1){//微信支付 |
| | | if(payType == 1){//手机支付 |
| | | return payMoneyUtil.weixinpay("小件物流下单支付",orderId +"",orderId + "_" + orderLogistics.getType(),orderMoney+"","/base/wxPayOrderTaxi","JSAPI",userInfo.getAppletsOpenId()); |
| | | /* icbcPayUtil.placeAnOrder(orderId + "," + orderLogistics.getType(), 9, 5, uid.toString(), |
| | | "小件物流下单支付", orderMoney, callbackPath + "/base/wxPayOrderTaxi", "", |
| | |
| | | resultUtil = ResultUtil.error(map.get("msg"), ""); |
| | | }*/ |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | | if(payType == 2){//银行卡支付 |
| | | return payMoneyUtil.alipay("小件物流下单支付","小件物流下单支付",orderId + "," + orderLogistics.getType(),orderMoney+"","/base/aliPayOrderTaxi"); |
| | | /* Map<String, String> map = icbcPayUtil.placeAnOrder(orderId + "," + orderLogistics.getType(), 10, 5, uid.toString(), "小件物流下单支付", orderMoney, callbackPath + "/base/aliPayOrderTaxi", "", type, null); |
| | | if(map.get("code").equals("200")){ |
| | |
| | | this.pushOrder(orderLogistics);//推单 |
| | | } |
| | | |
| | | if(payType == 4){//现金支付 |
| | | SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "小件物流下单支付", orderMoney, 2, 1, 1, 4, orderId); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | orderLogistics.setState(1);//小件物流先支付后司机抢单 |
| | | orderLogistics.setDriverPay(1); |
| | | orderLogistics.setPayType(4); |
| | | orderLogistics.setPayMoney(orderMoney); |
| | | |
| | | // TODO: 2020/5/24 这里需要给司机和用户推送订单状态 |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0); |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(1, "您已使用现金成功完成小件物流订单支付,谢谢使用!", uid, 1); |
| | | |
| | | this.pushOrder(orderLogistics);//推单 |
| | | } |
| | | |
| | | this.updateById(orderLogistics); |
| | | return resultUtil; |
| | | } |
| | |
| | | Double orderMoney = orderLogisticsSpread.getPrice(); |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | ResultUtil resultUtil = ResultUtil.success(""); |
| | | |
| | | /*if(payType == 1){//微信支付 |
| | | Map<String, String> map = icbcPayUtil.placeAnOrder(orderId + "," + orderLogistics.getType(), 9, 5, uid.toString(), "小件物流补差价", orderMoney, callbackPath + "/base/wxPayOrderLogisticsSpread", "", type, userInfo.getAppletsOpenId()); |
| | | if(map.get("code").equals("200")){ |
| | | paymentRecordService.saveData(1, null, null, orderId, orderLogistics.getType(), 1, orderMoney, map.get("order_id"), 1);//添加预支付数据 |
| | | resultUtil = ResultUtil.success(map.get("data")); |
| | | }else{ |
| | | resultUtil = ResultUtil.error(map.get("msg"), ""); |
| | | } |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | | Map<String, String> map = icbcPayUtil.placeAnOrder(orderId + "," + orderLogistics.getType(), 10, 5, uid.toString(), "小件物流补差价", orderMoney, callbackPath + "/base/aliPayOrderLogisticsSpread", "", type, null); |
| | | if(map.get("code").equals("200")){ |
| | | paymentRecordService.saveData(1, null, null, orderId, orderLogistics.getType(), 2, orderMoney, map.get("order_id"), 1);//添加预支付数据 |
| | | resultUtil = ResultUtil.success(map.get("data")); |
| | | }else{ |
| | | resultUtil = ResultUtil.error(map.get("msg"), ""); |
| | | } |
| | | }*/ |
| | | if(payType == 1){//微信支付 |
| | | if(payType == 1){//手机支付 |
| | | return payMoneyUtil.weixinpay("小件物流下单支付",orderId +"",orderId + "_" + orderLogistics.getType(),orderMoney+"","/base/wxPayOrderTaxi","JSAPI",userInfo.getAppletsOpenId()); |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | | if(payType == 2){//银行卡支付 |
| | | return payMoneyUtil.alipay("小件物流下单支付","小件物流下单支付",orderId + "," + orderLogistics.getType(),orderMoney+"","/base/aliPayOrderTaxi"); |
| | | } |
| | | if(payType == 3){//余额支付 |
| | |
| | | |
| | | systemNoticeService.addSystemNotice(1, "您已使用余额成功完成小件物流订单差价支付,谢谢使用!", uid, 1); |
| | | } |
| | | |
| | | if(payType == 4){//现金支付 |
| | | if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){ |
| | | return ResultUtil.error("余额不足,无法完成支付", ""); |
| | | } |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "小件物流补差价", orderMoney, 2, 1, 1, 4, orderId); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | orderLogistics.setState(12);//已支付差价 |
| | | this.updateById(orderLogistics); |
| | | |
| | | orderLogisticsSpread.setPayMoney(orderMoney); |
| | | orderLogisticsSpread.setPayTime(new Date()); |
| | | orderLogisticsSpread.setPayType(4); |
| | | orderLogisticsSpread.setDriverPay(1); |
| | | orderLogisticsSpreadService.updateById(orderLogisticsSpread); |
| | | |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderLogistics.getCompanyId()); |
| | | Double speMoney = orderLogistics.getType() == 4 ? company.getSameLogisticsMoney() : company.getCrossLogisticsMoney(); |
| | | BigDecimal d = null; |
| | | BigDecimal c = null; |
| | | if(company.getIsSpeFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = new BigDecimal(orderMoney).subtract(d); |
| | | } |
| | | if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | d = new BigDecimal(orderMoney).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | c = new BigDecimal(orderMoney).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | |
| | | Income income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 1).eq("objectId", orderLogistics.getCompanyId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType())); |
| | | income.setMoney(income.getMoney() + d.doubleValue()); |
| | | incomeService.updateById(income); |
| | | income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 2).eq("objectId", orderLogistics.getCompanyId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType())); |
| | | income.setMoney(income.getMoney() + c.doubleValue()); |
| | | incomeService.updateById(income); |
| | | Driver driver = driverService.selectById(orderLogistics.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | |
| | | // TODO: 2020/5/24 这里需要给司机和用户推送订单状态 |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0); |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(1, "您已使用现金成功完成小件物流订单差价支付,谢谢使用!", uid, 1); |
| | | } |
| | | |
| | | |
| | | this.updateById(orderLogistics); |
| | | return resultUtil; |
| | |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> queryOrderInfo(Integer orderId) throws Exception { |
| | | Map<String, Object> map = orderLogisticsMapper.queryOrderInfo(orderId); |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | if(null != map.get("reassignNotice") && Integer.valueOf(String.valueOf(map.get("reassignNotice"))) == 2){//改派完成,重新获取了新的司机数据,开始修改数据防止继续调用 |
| | | orderLogistics.setReassignNotice(0); |
| | | this.updateById(orderLogistics); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("state"))) == 11){ |
| | | map.put("state", map.get("oldState")); |
| | | } |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(map.get("startLon").toString(), map.get("startLat").toString()); |
| | | map.put("startCity", geocode.get("city")); |
| | | geocode = gdMapGeocodingUtil.geocode(map.get("endLon").toString(), map.get("endLat").toString()); |
| | | map.put("endCity", geocode.get("city")); |
| | | |
| | | String driverId = redisUtil.getValue("DEVICE_" + map.get("driverId")); |
| | | map.put("device", ToolUtil.isNotEmpty(driverId) ? 2 : 1); |
| | | map.put("orderType", orderLogistics.getType()); |
| | | return map; |
| | | } |
| | | |
| | | public synchronized String getOrderNum() throws Exception{ |
| | | int size = this.selectCount(null); |
| | | return "LOGISTICS" + String.valueOf(1000000 + size + 1).substring(1); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryCoupon(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | List<Map<String, Object>> list = userCouponRecordService.queryCoupon(uid, orderLogistics.getCompanyId(), 1, 4, orderLogistics.getOrderMoney(), pageNum, size); |
| | | List<Map<String, Object>> list1 = userCouponRecordService.queryCoupon(uid, orderLogistics.getCompanyId(), 1, 0, orderLogistics.getOrderMoney(), pageNum, size); |
| | | list.addAll(list1); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | <result column="oldState" property="oldState"/> |
| | | <result column="telX" property="telX"/> |
| | | <result column="bindId" property="bindId"/> |
| | | <result column="driverPay" property="driverPay"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | a.couponMoney as couponMoney, |
| | | a.discount as discount, |
| | | a.discountMoney as discountMoney, |
| | | a.payType, |
| | | a.payMoney as payMoney, |
| | | a.reassignNotice as reassignNotice, |
| | | a.oldState as oldState, |
| | |
| | | ( |
| | | (select count(id) from t_order_private_car where driverId = a.driverId and state in (7, 8, 9)) + |
| | | (select count(id) from t_order_taxi where driverId = a.driverId and state in (7, 8, 9)) + |
| | | (select count(id) from t_order_cross_city where driverId = a.driverId and state in (6, 8, 9)) |
| | | (select count(id) from t_order_cross_city where driverId = a.driverId and state in (6, 8, 9)) + |
| | | (select count(id) from t_order_logistics where driverId = a.driverId and state in (6, 9)) |
| | | ) as orderNum, |
| | | b.phone as driverPhone, |
| | | if(a.state = 12, (select money from t_order_cancel where orderId = a.id and orderType = 1 and state = 1 order by insertTime desc limit 0, 1), if(a.state = 10, (select money from t_order_cancel where orderId = a.id and orderType = 1 and state = 2 order by insertTime desc limit 0, 1), 0)) as cancelPayMoney, |
| | |
| | | private BigDecimal freeMoney; |
| | | |
| | | private Integer isplatPay; |
| | | /** |
| | | * 司机支付状态(现金支付司机代支付)1待支付 2已支付 |
| | | * @return |
| | | */ |
| | | @TableField("driverPay") |
| | | private Integer driverPay; |
| | | |
| | | public Integer getIsplatPay() { |
| | | return isplatPay; |
| | |
| | | this.bindId = bindId; |
| | | } |
| | | |
| | | public Integer getDriverPay() { |
| | | return driverPay; |
| | | } |
| | | |
| | | public void setDriverPay(Integer driverPay) { |
| | | this.driverPay = driverPay; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderPrivateCar{" + |
| | |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.EndPushWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.OrderInfoWarpper; |
| | |
| | | orderPrivateCar.setOrderNum(this.getOrderNum()); |
| | | orderPrivateCar.setPlacementLon(Double.valueOf(placementLon)); |
| | | orderPrivateCar.setPlacementLat(Double.valueOf(placementLat)); |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(placementLon, placementLat); |
| | | orderPrivateCar.setPlacementAddress(geocode.get("address")); |
| | | |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon)); |
| | | orderPrivateCar.setPlacementAddress(reverseGeocode.getAddress()); |
| | | orderPrivateCar.setStartLon(Double.valueOf(startLon)); |
| | | orderPrivateCar.setStartLat(Double.valueOf(startLat)); |
| | | orderPrivateCar.setStartAddress(startAddress); |
| | |
| | | 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> geocode1 = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | Region region = regionMapper.query(geocode1.get("districtCode"));*/ |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), null); |
| | | 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(), null); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderPrivateCar.setTelX(map.get("telX")); |
| | | // orderPrivateCar.setBindId(map.get("bindId")); |
| | | // } |
| | | |
| | | driver.setState(3); |
| | | driverService.updateById(driver); |
| | |
| | | List<Driver> ds = new ArrayList<>();//存储直线距离最近的几个司机 |
| | | for(int i = 0; i < assignOrder.getPeople(); i++){ |
| | | Driver driver = null; |
| | | int m = 0; |
| | | long m = 0; |
| | | int index = 0; |
| | | for(int j = 0; j < drivers.size(); j++){ |
| | | String value = redisUtil.getValue("DRIVER" + drivers.get(j).getId()); |
| | | if(null != value){ |
| | | // Map<String, String> distance1 = gdMapElectricFenceUtil.getDistance(orderPrivateCar.getStartLon() + "," + orderPrivateCar.getStartLat(), value, 0);//计算距离 |
| | | // Integer d = Integer.valueOf(distance1.get("distance")); |
| | | String[] split = value.split(","); |
| | | double distance = GDMapGeocodingUtil.getDistance(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | int d = Double.valueOf(distance).intValue(); |
| | | if((0 == m && null == driver) || (d < m)){ |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | Long distance = distancematrix.getDistance(); |
| | | if((0 == m && null == driver) || (distance < m)){ |
| | | driver = drivers.get(j); |
| | | m = d; |
| | | m = distance; |
| | | index = j; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | //再根据直线距离最短的司机中找出行驶距离最短的司机 |
| | | Integer m = 0; |
| | | Long m = 0L; |
| | | for(Driver driver : ds){ |
| | | String value = redisUtil.getValue("DRIVER" + driver.getId()); |
| | | if(null != value){ |
| | | Map<String, String> distance1 = gdMapElectricFenceUtil.getDistance(orderPrivateCar.getStartLon() + "," + orderPrivateCar.getStartLat(), value, 1);//计算距离 |
| | | Integer d = Integer.valueOf(distance1.get("distance")); |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0])); |
| | | Long d = distancematrix.getDistance(); |
| | | if((0 == m && null == dr) || (d.intValue() < m.intValue())){ |
| | | dr = driver; |
| | | m = d; |
| | |
| | | orderPrivateCar.setSnatchOrderTime(new Date()); |
| | | |
| | | //调用高德创建轨迹 |
| | | String s = gdFalconUtil.selectTerminal(dr.getPhone()); |
| | | String track = gdFalconUtil.createTrack(s); |
| | | orderPrivateCar.setTrackId(track); |
| | | // String s = gdFalconUtil.selectTerminal(dr.getPhone()); |
| | | // String track = gdFalconUtil.createTrack(s); |
| | | // orderPrivateCar.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | /* Map<String, String> geocode1 = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | Region region = regionMapper.query(geocode1.get("districtCode"));*/ |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), dr.getPhone(), null); |
| | | 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(), dr.getPhone(), null); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderPrivateCar.setTelX(map.get("telX")); |
| | | // orderPrivateCar.setBindId(map.get("bindId")); |
| | | // } |
| | | |
| | | dr.setState(3); |
| | | driverService.updateById(dr); |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | //发送短信给司机 |
| | | aLiSendSms.sendSms(dr.getPhone(), "SMS_216832951", "{\"" + orderPrivateCar.getStartAddress() + "\"}"); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | |
| | | } |
| | | |
| | | if(payType == 1){//微信支付 |
| | | if(payType == 1){//手机支付 |
| | | //Map<String, String> map = icbcPayUtil.placeAnOrder(orderId + ",1", 9, 5, uid.toString(), "完成订单", orderMoney, callbackPath + "/base/wxPayOrderTaxi", "", type, userInfo.getAppletsOpenId()); |
| | | resultUtil = payMoneyUtil.weixinpay("完成订单",orderId +"",orderId + "_1_fei",orderMoney+"","/base/wxPayOrderTaxi","JSAPI",userInfo.getAppletsOpenId()); |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | if(payType == 2) {//支付宝支付 |
| | | if(payType == 2) {//银行卡支付 |
| | | resultUtil = payMoneyUtil.alipay("完成订单","完成订单",orderId + "_1_fei",orderMoney+"","/base/aliPayOrderTaxi"); |
| | | //Map<String, String> map = icbcPayUtil.placeAnOrder(orderId + ",1", 10, 5, uid.toString(), "完成订单", orderMoney, callbackPath + "/base/aliPayOrderTaxi", "", type, null); |
| | | if (resultUtil.getCode()==200) { |
| | |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(1, "您已使用余额成功完成出行订单支付,谢谢使用!", uid, 1); |
| | | } |
| | | |
| | | |
| | | if(payType == 4){//现金支付 |
| | | SysIntegral query1 = sysIntegralMapper.query(orderPrivateCar.getCompanyId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "完成订单", orderMoney, 2, 1, 1, 1, orderId); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | orderPrivateCar.setState(8); |
| | | orderPrivateCar.setPayType(4); |
| | | orderPrivateCar.setDriverPay(1); |
| | | orderPrivateCar.setPayMoney(orderMoney); |
| | | orderPrivateCar.setOrderMoney(orderPrivateCar.getOrderMoney()+orderPrivateCar.getFreeMoney().doubleValue()); |
| | | |
| | | //处理优惠券和红包 |
| | | if(null != userCouponRecord){ |
| | | userCouponRecord.setState(2); |
| | | userCouponRecord.setEndTime(new Date()); |
| | | userCouponRecordService.updateById(userCouponRecord); |
| | | } |
| | | if(null != query){ |
| | | query.setState(2); |
| | | query.setEndTime(new Date()); |
| | | userRedPacketRecordService.updateById(query); |
| | | } |
| | | if(orderPrivateCar.getIsplatPay()==1){ |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | Double speMoney = company.getSpeMoney(); |
| | | BigDecimal d = null;//企业收入 |
| | | BigDecimal c = null;//司机收入 |
| | | if(company.getIsSpeFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机 |
| | | } |
| | | if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | Double price = orderPrivateCar.getStartMoney() + orderPrivateCar.getMileageMoney() + orderPrivateCar.getWaitMoney() + orderPrivateCar.getDurationMoney() + orderPrivateCar.getLongDistanceMoney(); |
| | | d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue()); |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | } |
| | | |
| | | |
| | | // TODO: 2020/5/24 这里需要给司机和用户推送订单状态 |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0); |
| | | pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0); |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(1, "您已使用现金成功完成出行订单支付,谢谢使用!", uid, 1); |
| | | } |
| | | |
| | | this.updateAllColumnById(orderPrivateCar); |
| | |
| | | } |
| | | |
| | | } |
| | | Map<String, String> distance = gdMapElectricFenceUtil.getDistance(value, orderPrivateCar.getStartLon() + "," + orderPrivateCar.getStartLat(), 1); |
| | | String lnt = (null != value ? value.split(",")[0] : "0.0"); |
| | | String lat = (null != value ? value.split(",")[0] : "0.0"); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(lat), Double.valueOf(lnt)); |
| | | String d = "0"; |
| | | String t = "0"; |
| | | if(null == distance){ |
| | | if(null == distancematrix){ |
| | | System.err.println("查询距离出错了"); |
| | | }else{ |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | d = new BigDecimal(distancematrix.getDistance()).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distancematrix.getDuration()).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | } |
| | | OrderServerWarpper orderServerWarpper = new OrderServerWarpper(); |
| | | orderServerWarpper.setOrderId(orderPrivateCar.getId()); |
| | | orderServerWarpper.setOrderType(1); |
| | | orderServerWarpper.setState(orderPrivateCar.getState()); |
| | | orderServerWarpper.setLon(null != value ? value.split(",")[0] : "0.0"); |
| | | orderServerWarpper.setLat(null != value ? value.split(",")[1] : "0.0"); |
| | | orderServerWarpper.setLon(lnt); |
| | | orderServerWarpper.setLat(lat); |
| | | orderServerWarpper.setReassignNotice(orderPrivateCar.getReassignNotice()); |
| | | if(orderPrivateCar.getState() == 2 || orderPrivateCar.getState() == 3){//前往预约地 |
| | | orderServerWarpper.setReservationMileage(d); |
| | |
| | | orderServerWarpper.setLaveTime("0"); |
| | | } |
| | | if(orderPrivateCar.getState() == 5 || orderPrivateCar.getState() == 6){//服务中 |
| | | distance = gdMapElectricFenceUtil.getDistance(value, orderPrivateCar.getEndLon() + "," + orderPrivateCar.getEndLat(), 1); |
| | | if(null == distance){ |
| | | distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(lat), Double.valueOf(lnt), orderPrivateCar.getEndLat(), orderPrivateCar.getEndLon()); |
| | | if(null == distancematrix){ |
| | | System.err.println("查询距离出错了"); |
| | | }else{ |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | d = new BigDecimal(distancematrix.getDistance()).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distancematrix.getDuration()).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | } |
| | | orderServerWarpper.setReservationMileage("0"); |
| | | orderServerWarpper.setReservationTime("0"); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.Advertisement; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.warpper.AdvertisementWarpper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<AdvertisementWarpper> queryAdvertisement(@Param("code") String code, @Param("type") Integer type); |
| | | List<AdvertisementWarpper> queryAdvertisement(@Param("city") String[] city, @Param("type") Integer type); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.City; |
| | | |
| | | public interface CityMapper extends BaseMapper<City> { |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<Company> query(@Param("province") String province, @Param("city") String city, @Param("code") String code); |
| | | |
| | | |
| | | List<Company> queryList(@Param("city") String[] city, @Param("type") Integer type); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取业务类型 |
| | | * @param province 省名称 |
| | | * @param city 市名称 |
| | | * @param district 区县名称 |
| | | * @return |
| | | */ |
| | | List<OpenCityBusiness> queryBusiness(@Param("province") String province, @Param("city") String city, |
| | | @Param("district") String district); |
| | | List<OpenCityBusiness> queryBusiness(@Param("city") String[] city); |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 获取开通城市 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | List<OpenCity> queryByCode(@Param("code") String code); |
| | | List<OpenCity> queryByCode(@Param("city") String[] city); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 根据行政区域获取设置的电话 |
| | | * @param code |
| | | * @return |
| | | */ |
| | | List<Phone> queryPhones(@Param("province") String province, @Param("city") String city, @Param("code") String code); |
| | | List<Phone> queryPhones(@Param("city") String[] city); |
| | | |
| | | |
| | | /** |
| | | * 获取电话数据 |
| | | * @param type |
| | | * @param platform |
| | | * @param code |
| | | * @return |
| | | */ |
| | | Phone query(@Param("type") Integer type, @Param("platform") Integer platform, |
| | | @Param("province") String province, @Param("city") String city, |
| | | @Param("code") String code); |
| | | @Param("city") String[] city); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.ReportLoss; |
| | | |
| | | public interface ReportLossMapper extends BaseMapper<ReportLoss> { |
| | | } |
| | |
| | | <result column="name" property="name"/> |
| | | <result column="imgUrl" property="imgUrl"/> |
| | | <result column="type" property="type"/> |
| | | <result column="cityId" property="cityId"/> |
| | | <result column="isJump" property="isJump"/> |
| | | <result column="jumpType" property="jumpType"/> |
| | | <result column="jumpUrl" property="jumpUrl"/> |
| | |
| | | content as content, |
| | | state as state, |
| | | provinceId as provinceId |
| | | from t_advertisement where flag != 3 and state = 1 and provinceId in (select id from t_region where code = #{code}) |
| | | from t_advertisement where flag != 3 and state = 1 |
| | | <if test="null != type"> |
| | | and `type` = #{type} |
| | | </if> |
| | | <if test="null != city"> |
| | | and cityId in (select id from t_city where englishName in |
| | | <foreach collection="city" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | </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.CityMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.City"> |
| | | <id column="id" property="id"/> |
| | | <result column="chineseName" property="chineseName"/> |
| | | <result column="englishName" property="englishName"/> |
| | | <result column="frenchName" property="frenchName"/> |
| | | </resultMap> |
| | | </mapper> |
| | |
| | | <result column="provinceCode" property="provinceCode"/> |
| | | <result column="cityCode" property="cityCode"/> |
| | | <result column="areaCode" property="areaCode"/> |
| | | <result column="cityId" property="cityId"/> |
| | | <result column="state" property="state"/> |
| | | </resultMap> |
| | | |
| | |
| | | </if> |
| | | ) |
| | | </select> |
| | | |
| | | |
| | | <select id="queryList" resultType="Company"> |
| | | select |
| | | id as id, |
| | | isSpe as isSpe, |
| | | isTaxi as isTaxi, |
| | | isCross as isCross, |
| | | isCrossLogistics as isCrossLogistics, |
| | | isSameLogistics as isSameLogistics, |
| | | isCharter as isCharter, |
| | | isSpeFixedOrProportional as isSpeFixedOrProportional, |
| | | isTaxiFixedOrProportional as isTaxiFixedOrProportional, |
| | | isCrossLogisticsFixedOrProportional as isCrossLogisticsFixedOrProportional, |
| | | isSameLogisticsFixedOrProportional as isSameLogisticsFixedOrProportional, |
| | | speMoney as speMoney, |
| | | taxiMoney as taxiMoney, |
| | | crossLogisticsMoney as crossLogisticsMoney, |
| | | sameLogisticsMoney as sameLogisticsMoney, |
| | | isNeedFerry as isNeedFerry, |
| | | name as name, |
| | | type as type, |
| | | superiorId as superiorId, |
| | | principalName as principalName, |
| | | principalPhone as principalPhone, |
| | | adminName as adminName, |
| | | adminPhone as adminPhone, |
| | | urgentPhoen as urgentPhoen, |
| | | setupTime as setupTime, |
| | | identifier as identifier, |
| | | addressCode as addressCode, |
| | | businessScope as businessScope, |
| | | contactAddress as contactAddress, |
| | | documentAddress as documentAddress, |
| | | economicType as economicType, |
| | | regCapital as regCapital, |
| | | legalName as legalName, |
| | | legalId as legalId, |
| | | legalPhone as legalPhone, |
| | | legalPhotoUrl as legalPhotoUrl, |
| | | licensingAgency as licensingAgency, |
| | | licenseTime as licenseTime, |
| | | licenseStartTime as licenseStartTime, |
| | | licenseEndTime as licenseEndTime, |
| | | licenseNumber as licenseNumber, |
| | | carNum as carNum, |
| | | driverNum as driverNum, |
| | | mac as mac, |
| | | state as state, |
| | | flag as flag, |
| | | upload as upload, |
| | | insertTime as insertTime |
| | | from t_company where flag != 3 and state = 0 and id in ( |
| | | select companyId from t_company_city where state = 1 |
| | | <if test="null != city"> |
| | | and cityId in (select id from t_city where englishName in |
| | | <foreach collection="city" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | ) |
| | | <if test="null != type"> |
| | | and type = #{type} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | a.updateUser as updateUser |
| | | from t_open_city_business a |
| | | left join t_open_city b on (a.openCityId = b.id) |
| | | where a.flag != 3 and b.flag != 3 |
| | | <if test="null != district"> |
| | | and b.provinceName = #{district} |
| | | </if> |
| | | <if test="null != city"> |
| | | and b.cityName = #{city} |
| | | </if> |
| | | <if test="null != province"> |
| | | and b.areaName = #{province} |
| | | </if> |
| | | where a.flag != 3 and b.flag != 3 and b.cityId in ( |
| | | select id from t_city where englishName in |
| | | <foreach collection="city" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | order by a.sort |
| | | </select> |
| | | |
| | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.OpenCity"> |
| | | <id column="id" property="id"/> |
| | | <result column="code" property="code"/> |
| | | <result column="cityId" property="cityId"/> |
| | | <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"/> |
| | |
| | | <select id="queryOpenCity" resultType="OpenCity"> |
| | | select |
| | | id as id, |
| | | code as code, |
| | | cityId as cityId, |
| | | 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, |
| | |
| | | <select id="queryByCode" resultType="OpenCity"> |
| | | select |
| | | id as id, |
| | | code as code, |
| | | cityId as cityId, |
| | | 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} |
| | | from t_open_city where flag = 1 and cityId in |
| | | <foreach collection="city" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </select> |
| | | </mapper> |
| | |
| | | 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} |
| | | and cityId in ( |
| | | <foreach collection="city" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | ) |
| | | </select> |
| | |
| | | <if test="platform != 1"> |
| | | and 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} |
| | | and cityId in ( |
| | | <foreach collection="city" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | ) |
| | | </if> |
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.ReportLossMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.ReportLoss"> |
| | | <id column="id" property="id"/> |
| | | <result column="userId" property="userId"/> |
| | | <result column="orderType" property="orderType"/> |
| | | <result column="orderId" property="orderId"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="image" property="image"/> |
| | | <result column="state" property="state"/> |
| | | <result column="status" property="status"/> |
| | | <result column="handleTime" property="handleTime"/> |
| | | <result column="handleUserId" property="handleUserId"/> |
| | | <result column="insertTime" property="insertTime"/> |
| | | </resultMap> |
| | | </mapper> |
| | |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 城市id |
| | | */ |
| | | @TableField("cityId") |
| | | private Integer cityId; |
| | | /** |
| | | * 是否跳转(1:是,2:否) |
| | | */ |
| | | @TableField("isJump") |
| | |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getCityId() { |
| | | return cityId; |
| | | } |
| | | |
| | | public void setCityId(Integer cityId) { |
| | | this.cityId = cityId; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public Integer getProvinceId() { |
| | | return provinceId; |
| | | } |
| | | |
| | | public void setProvinceId(Integer provinceId) { |
| | | this.provinceId = provinceId; |
| | | } |
| | | |
| | | public Integer getIsJump() { |
| | | return isJump; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.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; |
| | | |
| | | /** |
| | | * 城市 |
| | | */ |
| | | @TableName("t_city") |
| | | public class City { |
| | | //主键 |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | //中文名称 |
| | | @TableField("chineseName") |
| | | private String chineseName; |
| | | //英文名称 |
| | | @TableField("englishName") |
| | | private String englishName; |
| | | //法文名称 |
| | | @TableField("frenchName") |
| | | private String frenchName; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getChineseName() { |
| | | return chineseName; |
| | | } |
| | | |
| | | public void setChineseName(String chineseName) { |
| | | this.chineseName = chineseName; |
| | | } |
| | | |
| | | public String getEnglishName() { |
| | | return englishName; |
| | | } |
| | | |
| | | public void setEnglishName(String englishName) { |
| | | this.englishName = englishName; |
| | | } |
| | | |
| | | public String getFrenchName() { |
| | | return frenchName; |
| | | } |
| | | |
| | | public void setFrenchName(String frenchName) { |
| | | this.frenchName = frenchName; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "City{" + |
| | | "id=" + id + |
| | | ", chineseName='" + chineseName + '\'' + |
| | | ", englishName='" + englishName + '\'' + |
| | | ", frenchName='" + frenchName + '\'' + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | @TableField("areaCode") |
| | | private String areaCode; |
| | | /** |
| | | * 城市id |
| | | */ |
| | | @TableField("cityId") |
| | | private Integer cityId; |
| | | /** |
| | | * 状态(1=正常,2=删除) |
| | | */ |
| | | @TableField("state") |
| | |
| | | this.areaCode = areaCode; |
| | | } |
| | | |
| | | public Integer getCityId() { |
| | | return cityId; |
| | | } |
| | | |
| | | public void setCityId(Integer cityId) { |
| | | this.cityId = cityId; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | |
| | | /** |
| | | * 城市编号(行政编号) |
| | | */ |
| | | @TableField("code") |
| | | private String code; |
| | | @TableField("cityId") |
| | | private Integer cityId; |
| | | /** |
| | | * 经度 |
| | | */ |
| | |
| | | */ |
| | | @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 Integer getCityId() { |
| | | return cityId; |
| | | } |
| | | |
| | | 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 void setCityId(Integer cityId) { |
| | | this.cityId = cityId; |
| | | } |
| | | |
| | | public Double getLon() { |
| | |
| | | this.lat = lat; |
| | | } |
| | | |
| | | public Integer getIsQualifications() { |
| | | return isQualifications; |
| | | } |
| | | |
| | | public void setIsQualifications(Integer isQualifications) { |
| | | this.isQualifications = isQualifications; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OpenCity{" + |
| | | "code='" + code + '\'' + |
| | | "cityId=" + cityId + |
| | | ", lon=" + lon + |
| | | ", lat=" + lat + |
| | | ", isQualifications=" + isQualifications + |
| | | ", areaName='" + areaName + '\'' + |
| | | ", cityName='" + cityName + '\'' + |
| | | ", provinceName='" + provinceName + '\'' + |
| | | '}'; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.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.util.Date; |
| | | |
| | | /** |
| | | * 报失 |
| | | */ |
| | | @TableName("t_report_loss") |
| | | public class ReportLoss { |
| | | //主键 |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | //用户id |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | //业务类型(1=专车,2=出租车,3=跨城出行,4=同城小件物流,5=跨城小件物流,6=包车) |
| | | @TableField("orderType") |
| | | private Integer orderType; |
| | | //订单id |
| | | @TableField("orderId") |
| | | private Integer orderId; |
| | | //备注 |
| | | @TableField("remark") |
| | | private String remark; |
| | | //备注 |
| | | @TableField("image") |
| | | private String image; |
| | | //状态(1=正常,2=冻结,3=删除) |
| | | @TableField("state") |
| | | private Integer state; |
| | | //处理状态(1=待处理,2=已处理) |
| | | @TableField("status") |
| | | private Integer status; |
| | | //处理时间 |
| | | @TableField("handleTime") |
| | | private Date handleTime; |
| | | //处理人id |
| | | @TableField("handleUserId") |
| | | private Integer handleUserId; |
| | | //添加时间 |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Integer getOrderType() { |
| | | return orderType; |
| | | } |
| | | |
| | | public void setOrderType(Integer orderType) { |
| | | this.orderType = orderType; |
| | | } |
| | | |
| | | public Integer getOrderId() { |
| | | return orderId; |
| | | } |
| | | |
| | | public void setOrderId(Integer orderId) { |
| | | this.orderId = orderId; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public String getImage() { |
| | | return image; |
| | | } |
| | | |
| | | public void setImage(String image) { |
| | | this.image = image; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public Date getHandleTime() { |
| | | return handleTime; |
| | | } |
| | | |
| | | public void setHandleTime(Date handleTime) { |
| | | this.handleTime = handleTime; |
| | | } |
| | | |
| | | public Integer getHandleUserId() { |
| | | return handleUserId; |
| | | } |
| | | |
| | | public void setHandleUserId(Integer handleUserId) { |
| | | this.handleUserId = handleUserId; |
| | | } |
| | | |
| | | public Date getInsertTime() { |
| | | return insertTime; |
| | | } |
| | | |
| | | public void setInsertTime(Date insertTime) { |
| | | this.insertTime = insertTime; |
| | | } |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<AdvertisementWarpper> queryAdvertisement(String code, Integer type) throws Exception; |
| | | List<AdvertisementWarpper> queryAdvertisement(Double lat, Double lnt, Integer type) throws Exception; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.City; |
| | | |
| | | public interface ICityService extends IService<City> { |
| | | } |
| | |
| | | Company query(String lon, String lat) throws Exception; |
| | | |
| | | |
| | | Company query1(String lon, String lat) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 根据行政编号获取所有企业 |
| | | * @param code |
| | |
| | | * @throws Exception |
| | | */ |
| | | Company query(String code) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 根据城市名称获取匹配的企业 |
| | | * @param city |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | Company query(String[] city) throws Exception; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取业务类型 |
| | | * @param province 省名 |
| | | * @param city 市名称 |
| | | * @param district 区县名称 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<BaseWarpper> queryBusiness(String province, String city, String district) throws Exception; |
| | | List<BaseWarpper> queryBusiness(Double lat, Double lnt) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<BaseWarpper> queryOpenCity() throws Exception; |
| | | List<BaseWarpper> queryOpenCity(Integer uid, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 判断是否是开通城市 |
| | | * @param code |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | boolean openCity(String code) throws Exception; |
| | | boolean openCity(Double lat, Double lnt) throws Exception; |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Phone> queryPhones(String code) throws Exception; |
| | | List<Phone> queryPhones(Double lat, Double lnt) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 获取客服电话(个人中心) |
| | | * @param code |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | Map<String, Object> queryCustomerPhone(String code) throws Exception; |
| | | Map<String, Object> queryCustomerPhone(Double lat, Double lnt) throws Exception; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.ReportLoss; |
| | | |
| | | public interface IReportLossService extends IService<ReportLoss> { |
| | | |
| | | |
| | | /** |
| | | * 提交报失申请 |
| | | * @param orderType |
| | | * @param orderId |
| | | * @param remark |
| | | * @param image |
| | | * @throws Exception |
| | | */ |
| | | void addReportLoss(Integer orderType, Integer orderId, String remark, String image) throws Exception; |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.dao.AdvertisementMapper; |
| | | import com.stylefeng.guns.modular.system.model.Advertisement; |
| | | import com.stylefeng.guns.modular.system.service.IAdvertisementService; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.warpper.AdvertisementWarpper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<AdvertisementWarpper> queryAdvertisement(String code, Integer type) throws Exception { |
| | | String province = code.substring(0, 2) + "0000"; |
| | | String city = code.substring(0, 4) + "00"; |
| | | List<AdvertisementWarpper> list = advertisementMapper.queryAdvertisement(code, type); |
| | | if(list.size() == 0){ |
| | | list = advertisementMapper.queryAdvertisement(city, type); |
| | | public List<AdvertisementWarpper> queryAdvertisement(Double lat, Double lnt, Integer type) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | if(null == reverseGeocode){ |
| | | return new ArrayList<>(); |
| | | } |
| | | if(list.size() == 0){ |
| | | list = advertisementMapper.queryAdvertisement(province, type); |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] city = new String[addressComponentsVos.length]; |
| | | for (int i = 0; i < addressComponentsVos.length; i++) { |
| | | city[i] = addressComponentsVos[i].getLongName(); |
| | | } |
| | | List<AdvertisementWarpper> list = advertisementMapper.queryAdvertisement(city, type); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public String queryByType(Integer type, Integer language) throws Exception { |
| | | if(null == language){ |
| | | language = 2; |
| | | } |
| | | String s = agreementMapper.queryByType(type, language, 1); |
| | | if(ToolUtil.isEmpty(s)){ |
| | | s = agreementMapper.queryByType(type, language, null); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.CityMapper; |
| | | import com.stylefeng.guns.modular.system.model.City; |
| | | import com.stylefeng.guns.modular.system.service.ICityService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class CityServiceImpl extends ServiceImpl<CityMapper, City> implements ICityService { |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.model.CompanyCity; |
| | | import com.stylefeng.guns.modular.system.service.ICompanyCityService; |
| | | import com.stylefeng.guns.modular.system.util.GDMapGeocodingUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Company query1(String lon, String lat) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(lat), Double.valueOf(lon)); |
| | | if(null == reverseGeocode){ |
| | | return null; |
| | | } |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] city = new String[addressComponentsVos.length]; |
| | | for (int i = 0; i < addressComponentsVos.length; i++) { |
| | | city[i] = addressComponentsVos[i].getLongName(); |
| | | } |
| | | Company query = this.query(city); |
| | | return query; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据行政编号获取所属企业 |
| | | * @param code |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Company query(String[] city) throws Exception { |
| | | List<Company> query = companyMapper.queryList(city, 3); |
| | | if(query.size() == 0){ |
| | | query = companyMapper.queryList(city, 2); |
| | | } |
| | | if(query.size() == 0){ |
| | | query = companyMapper.queryList(city, 1); |
| | | } |
| | | if(query.size() > 0){ |
| | | return query.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.GDMapGeocodingUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | if(null != value){ |
| | | /*Map<String, String> distance1 = gdMapElectricFenceUtil.getDistance(lon + "," + lat, value, 0);//计算距离 |
| | | double d = Double.valueOf(distance1.get("distance")).doubleValue();*/ |
| | | double d = GDMapGeocodingUtil.getDistance(lat,lon,Double.parseDouble(value.split(",")[1]),Double.parseDouble(value.split(",")[0])); |
| | | if(d < (distance * 1000)){ |
| | | // double d = GDMapGeocodingUtil.getDistance(lat,lon,Double.parseDouble(value.split(",")[1]),Double.parseDouble(value.split(",")[0])); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(lat, lon, Double.parseDouble(value.split(",")[1]), Double.parseDouble(value.split(",")[0])); |
| | | if(distancematrix.getDistance() < (distance * 1000)){ |
| | | list.add(driver); |
| | | } |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.dao.OpenCityBusinessMapper; |
| | | import com.stylefeng.guns.modular.system.model.OpenCityBusiness; |
| | | import com.stylefeng.guns.modular.system.service.IOpenCityBusinessService; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | /** |
| | | * 获取业务类型 |
| | | * @param province 省名 |
| | | * @param city 市名称 |
| | | * @param district 区县名称 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<BaseWarpper> queryBusiness(String province, String city, String district) throws Exception { |
| | | List<OpenCityBusiness> openCityBusinesses = openCityBusinessMapper.queryBusiness(province, city, district); |
| | | if(openCityBusinesses.size() == 0){ |
| | | openCityBusinesses = openCityBusinessMapper.queryBusiness(province, city, null); |
| | | public List<BaseWarpper> queryBusiness(Double lat, Double lnt) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | if(null == reverseGeocode){ |
| | | return new ArrayList<>(); |
| | | } |
| | | if(openCityBusinesses.size() == 0){ |
| | | openCityBusinesses = openCityBusinessMapper.queryBusiness(province, null, null); |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] city = new String[addressComponentsVos.length]; |
| | | for (int i = 0; i < addressComponentsVos.length; i++) { |
| | | city[i] = addressComponentsVos[i].getLongName(); |
| | | } |
| | | List<OpenCityBusiness> openCityBusinesses = openCityBusinessMapper.queryBusiness(city); |
| | | List<BaseWarpper> list = new ArrayList<>(); |
| | | for(OpenCityBusiness b : openCityBusinesses){ |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | |
| | | 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.City; |
| | | import com.stylefeng.guns.modular.system.model.OpenCity; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.ICityService; |
| | | import com.stylefeng.guns.modular.system.service.IOpenCityService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | private OpenCityMapper openCityMapper; |
| | | |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | |
| | | /** |
| | | * 获取开通城市列表 |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<BaseWarpper> queryOpenCity() throws Exception { |
| | | public List<BaseWarpper> queryOpenCity(Integer uid, Integer language) throws Exception { |
| | | if(null == language){ |
| | | language = 2; |
| | | } |
| | | if(null != uid){ |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | language = userInfo.getLanguage(); |
| | | } |
| | | 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()); |
| | | City city = cityService.selectById(c.getCityId()); |
| | | baseWarpper.setName(language == 1 ? city.getChineseName() : language == 2 ? city.getEnglishName() : language == 3 ? city.getFrenchName() : city.getEnglishName()); |
| | | baseWarpper.setLon(null != c.getLon() ? c.getLon() : 0); |
| | | baseWarpper.setLat(null != c.getLat() ? c.getLat() : 0); |
| | | baseWarpper.setContent(c.getCode()); |
| | | 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); |
| | | public boolean openCity(Double lat, Double lnt) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | if(null == reverseGeocode){ |
| | | return false; |
| | | } |
| | | if(openCities.size() == 0){ |
| | | openCities = openCityMapper.queryByCode(province); |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] city = new String[addressComponentsVos.length]; |
| | | for (int i = 0; i < addressComponentsVos.length; i++) { |
| | | city[i] = addressComponentsVos[i].getLongName(); |
| | | } |
| | | List<OpenCity> openCities = openCityMapper.queryByCode(city); |
| | | if(openCities.size() == 0){ |
| | | return false; |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.ChinaMobileUtil; |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil<BaseWarpper> queryExpectedTime(Double slon, Double slat, Double elon, Double elat) throws Exception { |
| | | Map<String, String> distance = gdMapElectricFenceUtil.getDistance(slon + "," + slat, elon + "," + elat, 1); |
| | | int duration = Integer.valueOf(distance.get("duration")) / 60; |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(slat, slon, elat, elon); |
| | | Long duration = distancematrix.getDuration() / 60; |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setMinute(duration); |
| | | baseWarpper.setMinute(duration.intValue()); |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | |
| | |
| | | import com.stylefeng.guns.modular.system.dao.PhoneMapper; |
| | | import com.stylefeng.guns.modular.system.model.Phone; |
| | | import com.stylefeng.guns.modular.system.service.IPhoneService; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | * @throws Exception |
| | | */ |
| | | @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); |
| | | public List<Phone> queryPhones(Double lat, Double lnt) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | if(null == reverseGeocode){ |
| | | return new ArrayList<>(); |
| | | } |
| | | if(list.size() == 0){ |
| | | list = phoneMapper.queryPhones(province, null, null); |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] city = new String[addressComponentsVos.length]; |
| | | for (int i = 0; i < addressComponentsVos.length; i++) { |
| | | city[i] = addressComponentsVos[i].getLongName(); |
| | | } |
| | | List<Phone> list = phoneMapper.queryPhones(city); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取客服电话(个人中心) |
| | | * @param code |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryCustomerPhone(String code) throws Exception { |
| | | String province = code.substring(0, 2) + "0000"; |
| | | String city = code.substring(0, 4) + "00"; |
| | | |
| | | public Map<String, Object> queryCustomerPhone(Double lat, Double lnt) throws Exception { |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(lat, lnt); |
| | | if(null == reverseGeocode){ |
| | | return new HashMap<>(); |
| | | } |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] city = new String[addressComponentsVos.length]; |
| | | for (int i = 0; i < addressComponentsVos.length; i++) { |
| | | city[i] = addressComponentsVos[i].getLongName(); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //平台电话 |
| | | Phone query = phoneMapper.query(2, 1, null, null, null); |
| | | Phone query = phoneMapper.query(2, 1, city); |
| | | 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); |
| | | } |
| | | query = phoneMapper.query(2, 2, city); |
| | | map.put("company", null != query ? query.getPhone() : ""); |
| | | return map; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.ReportLossMapper; |
| | | import com.stylefeng.guns.modular.system.model.ReportLoss; |
| | | import com.stylefeng.guns.modular.system.service.IReportLossService; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Service |
| | | public class ReportLossServiceImpl extends ServiceImpl<ReportLossMapper, ReportLoss> implements IReportLossService { |
| | | |
| | | @Autowired |
| | | private IOrderPrivateCarService orderPrivateCarService; |
| | | |
| | | @Autowired |
| | | private IOrderTaxiService orderTaxiService; |
| | | |
| | | @Autowired |
| | | private IOrderCrossCityService orderCrossCityService; |
| | | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Override |
| | | public void addReportLoss(Integer orderType, Integer orderId, String remark, String image) throws Exception { |
| | | ReportLoss reportLoss = new ReportLoss(); |
| | | reportLoss.setImage(image); |
| | | reportLoss.setInsertTime(new Date()); |
| | | reportLoss.setOrderId(orderId); |
| | | reportLoss.setOrderType(orderType); |
| | | reportLoss.setRemark(remark); |
| | | reportLoss.setState(1); |
| | | reportLoss.setStatus(1); |
| | | switch (orderType){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | reportLoss.setUserId(orderPrivateCar.getUserId()); |
| | | break; |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | | reportLoss.setUserId(orderTaxi.getUserId()); |
| | | break; |
| | | case 3: |
| | | OrderCrossCity orderCrossCity = orderCrossCityService.selectById(orderId); |
| | | reportLoss.setUserId(orderCrossCity.getUserId()); |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | reportLoss.setUserId(orderLogistics.getUserId()); |
| | | break; |
| | | case 5: |
| | | OrderLogistics orderLogistics1 = orderLogisticsService.selectById(orderId); |
| | | reportLoss.setUserId(orderLogistics1.getUserId()); |
| | | break; |
| | | } |
| | | this.insert(reportLoss); |
| | | } |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.service.IServerCarModelService; |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.GDMapGeocodingUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.AddressComponentsVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.DistancematrixVo; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.GoogleMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.ReverseGeocodeVo; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.ServerCarModelWarpper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Override |
| | | public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(String startLonLat, String endLonLat, Integer type) throws Exception { |
| | | //查找与起点匹配的企业(经营范围) |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(startLonLat.split(",")[0], startLonLat.split(",")[1]); |
| | | Company query = companyCityService.query(geocode.get("districtCode")); |
| | | ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(startLonLat.split(",")[1]), Double.valueOf(startLonLat.split(",")[0])); |
| | | if(null == reverseGeocode){ |
| | | return ResultUtil.error("获取地址信息失败"); |
| | | } |
| | | AddressComponentsVo[] addressComponentsVos = reverseGeocode.getAddressComponentsVos(); |
| | | String[] city = new String[addressComponentsVos.length]; |
| | | for (int i = 0; i < addressComponentsVos.length; i++) { |
| | | city[i] = addressComponentsVos[i].getLongName(); |
| | | } |
| | | Company query = companyCityService.query(city); |
| | | if(null == query){ |
| | | return ResultUtil.error("起点暂无企业提供服务", new ArrayList<>()); |
| | | } |
| | | Map<String, String> distance = gdMapElectricFenceUtil.getDistance(startLonLat, endLonLat, 1); |
| | | if(null == distance){ |
| | | Double slnt = Double.valueOf(startLonLat.split(",")[0]); |
| | | Double slat = Double.valueOf(startLonLat.split(",")[1]); |
| | | Double elnt = Double.valueOf(startLonLat.split(",")[0]); |
| | | Double elat = Double.valueOf(startLonLat.split(",")[1]); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(slat, slnt, elat, elnt); |
| | | if(null == distancematrix){ |
| | | return ResultUtil.error("获取预估距离出错", new ArrayList<>()); |
| | | } |
| | | String distance1 = distance.get("distance");//距离(米) |
| | | long distance1 = distancematrix.getDistance();//距离(米) |
| | | double distance1_ = Double.valueOf(distance1).doubleValue(); |
| | | String duration = distance.get("duration");//时间(秒) |
| | | long duration = distancematrix.getDuration();//时间(秒) |
| | | long duration_ = Long.valueOf(duration).longValue(); |
| | | |
| | | List<ServerCarModelWarpper> price = this.getPrice(query.getId(), distance1_, duration_, 0, 1); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.GoogleMap; |
| | | |
| | | public class AddressComponentsVo { |
| | | /** |
| | | * 长名称 |
| | | */ |
| | | private String longName; |
| | | /** |
| | | * 短名称 |
| | | */ |
| | | private String shortName; |
| | | |
| | | public String getLongName() { |
| | | return longName; |
| | | } |
| | | |
| | | public void setLongName(String longName) { |
| | | this.longName = longName; |
| | | } |
| | | |
| | | public String getShortName() { |
| | | return shortName; |
| | | } |
| | | |
| | | public void setShortName(String shortName) { |
| | | this.shortName = shortName; |
| | | } |
| | | } |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String getReverseGeocode(double lat, double lng) throws Exception{ |
| | | public static ReverseGeocodeVo getReverseGeocode(double lat, double lng) throws Exception{ |
| | | GeoApiContext context = new GeoApiContext.Builder() |
| | | .apiKey(key) |
| | | .build(); |
| | | GeocodingApiRequest request = GeocodingApi.reverseGeocode(context, new LatLng(lat, lng)); |
| | | GeocodingResult[] results = request.await(); |
| | | String address = null; |
| | | ReverseGeocodeVo vo = null; |
| | | if(results.length > 0){ |
| | | Gson gson = new GsonBuilder().setPrettyPrinting().create(); |
| | | System.out.println(gson.toJson(results[0].addressComponents)); |
| | | |
| | | address = results[0].formattedAddress; |
| | | |
| | | vo = new ReverseGeocodeVo(); |
| | | AddressComponent[] addressComponents = results[0].addressComponents; |
| | | AddressComponentsVo[] addressComponentsVos = new AddressComponentsVo[addressComponents.length]; |
| | | for (int i = 0; i < addressComponents.length; i++) { |
| | | addressComponentsVos[i].setLongName(addressComponents[i].longName); |
| | | addressComponentsVos[i].setShortName(addressComponents[i].shortName); |
| | | } |
| | | String address = results[0].formattedAddress; |
| | | vo.setAddressComponentsVos(addressComponentsVos); |
| | | vo.setAddress(address); |
| | | } |
| | | context.shutdown(); |
| | | return address; |
| | | return vo; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取两点之间的距离 |
| | | * @param sLat |
| | | * @param sLnt |
| | | * @param eLat |
| | | * @param eLnt |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static DistancematrixVo getDistancematrix(Double sLat, Double sLnt, Double eLat, Double eLnt) throws Exception{ |
| | | ReverseGeocodeVo reverseGeocode = getReverseGeocode(sLat, sLnt); |
| | | ReverseGeocodeVo reverseGeocode1 = getReverseGeocode(eLat, eLnt); |
| | | if(null != reverseGeocode && null != reverseGeocode1){ |
| | | String origin = reverseGeocode.getAddress(); |
| | | String destination = reverseGeocode1.getAddress(); |
| | | return getDistancematrix(origin, destination); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取两地点之间的线路规划 |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.GoogleMap; |
| | | |
| | | public class ReverseGeocodeVo { |
| | | /** |
| | | * 完整地址名称 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 分段地址名称数组 |
| | | */ |
| | | private AddressComponentsVo[] addressComponentsVos; |
| | | |
| | | |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public AddressComponentsVo[] getAddressComponentsVos() { |
| | | return addressComponentsVos; |
| | | } |
| | | |
| | | public void setAddressComponentsVos(AddressComponentsVo[] addressComponentsVos) { |
| | | this.addressComponentsVos = addressComponentsVos; |
| | | } |
| | | } |
| | |
| | | private Double discountMoney; |
| | | @ApiModelProperty("订单支付金额") |
| | | private Double payMoney; |
| | | @ApiModelProperty("订单支付方式(1=手机支付,2=银行卡支付,3=余额支付,4=现金支付)") |
| | | private Integer payType; |
| | | @ApiModelProperty("小费金额") |
| | | private Double tipMoney; |
| | | @ApiModelProperty("订单评分") |
| | |
| | | this.lineShiftTime = lineShiftTime; |
| | | } |
| | | |
| | | public Integer getPayType() { |
| | | return payType; |
| | | } |
| | | |
| | | public void setPayType(Integer payType) { |
| | | this.payType = payType; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderInfoWarpper{" + |
| | |
| | | orderInfoWarpper.setIsFree(null != map.get("isFree") ? map.get("isFree").toString() :"1"); |
| | | orderInfoWarpper.setMoneyType(null != map.get("moneyType") ? Integer.valueOf(map.get("moneyType").toString()) :1); |
| | | orderInfoWarpper.setMoneyTime(null != map.get("moneyTime") ? map.get("moneyTime").toString() :""); |
| | | orderInfoWarpper.setPayType(null != map.get("payType") ? Integer.valueOf(map.get("payType").toString()) : 4); |
| | | } |
| | | if(orderInfoWarpper.getState()==7){ |
| | | orderInfoWarpper.setOrderMoney(orderInfoWarpper.getOrderMoney()-orderInfoWarpper.getDiscountMoney()); |
| | |
| | | public class VerifiedWarpper { |
| | | @ApiModelProperty(value = "姓名", required = true, dataType = "String") |
| | | private String name; |
| | | @ApiModelProperty(value = "身份证号码", required = true, dataType = "String") |
| | | @ApiModelProperty(value = "身份证号码", required = false, dataType = "String") |
| | | private String idcode; |
| | | @ApiModelProperty(value = "身份证正面照", required = false, dataType = "String") |
| | | private String img1; |
| | |
| | | <result column="code" property="code"/> |
| | | <result column="state" property="state"/> |
| | | <result column="insertTime" property="insertTime"/> |
| | | <result column="replacePay" property="replacePay"/> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | /** |
| | | * 是否待支付(0否,1=是) |
| | | * @return |
| | | */ |
| | | @TableField("replacePay") |
| | | private Integer replacePay; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.insertTime = insertTime; |
| | | } |
| | | |
| | | public Integer getReplacePay() { |
| | | return replacePay; |
| | | } |
| | | |
| | | public void setReplacePay(Integer replacePay) { |
| | | this.replacePay = replacePay; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "PaymentRecord{" + |
| | |
| | | #spring: |
| | | # profiles: local |
| | | # datasource: |
| | | # url: jdbc:mysql://Rm-wz9rpe0t74ys3b1h8go.mysql.rds.aliyuncs.com:3306/oktravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | # url: jdbc:mysql://127.0.0.1:3306/igotravel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | # username: root |
| | | # password: Root2020! |
| | | # password: HjKbXilb9zajmXbl |
| | | # db-name: guns #用来搜集数据库的所有表 |
| | | # filters: wall,mergeStat |
| | | |