| | |
| | | eureka: |
| | | client: |
| | | service-url: #注册中心地址 |
| | | defaultZone: http://sinata:sinata@192.168.110.106:8000/eureka #启用身份验证的方式连接 |
| | | defaultZone: http://sinata:sinata@127.0.0.1:8000/eureka #启用身份验证的方式连接 |
| | | register-with-eureka: true #在注册中心进行注册 |
| | | fetch-registry: true #从Eureka中获取注册信息。 |
| | | |
| | |
| | | public ResultUtil<List<LocationWarpper>> queryLocation(Integer siteId){ |
| | | try { |
| | | List<Map<String, Object>> list = lineSiteService.queryLocation(siteId); |
| | | return ResultUtil.success(LocationWarpper.getLocationWarppers(list)); |
| | | List<LocationWarpper> locationWarppers = LocationWarpper.getLocationWarppers(list); |
| | | return ResultUtil.success(locationWarppers); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | a.orderMoney as orderMoney, |
| | | a.peopleNumber as peopleNumber, |
| | | UNIX_TIMESTAMP(a.travelTime) as travelTime, |
| | | a.remark as remark |
| | | a.remark as remark, |
| | | a.orderMoney as payMoney |
| | | from t_order_cross_city a |
| | | left join t_line_shift_driver b on (a.lineShiftDriverId = b.id) |
| | | left join t_line_shift c on (b.lineShiftId = c.id) |
| | |
| | | <select id="querySite" resultType="map"> |
| | | select * from |
| | | ( |
| | | select id as id, `name` as `name`, provinceCode as cityCode, province as cityName from t_site where province like '%市' and state = 1 |
| | | select id as id, `name` as `name`, provinceCode as cityCode, province as cityName, lonLat from t_site where province like '%市' and state = 1 |
| | | UNION ALL |
| | | select id as id, `name` as `name`, cityCode as cityCode, city as cityName from t_site where province not like '%市' and state = 1 |
| | | select id as id, `name` as `name`, cityCode as cityCode, city as cityName, lonLat from t_site where province not like '%市' and state = 1 |
| | | ) as a where 1 = 1 |
| | | <if test="null != startSiteId"> |
| | | and a.id in(select siteId from t_line_site where lineId in(select lineId from t_line_site where siteId = #{startSiteId} and type = 1) and type = 2) |
| | |
| | | @TableField("districtCode") |
| | | private String districtCode; |
| | | /** |
| | | * 经纬度 |
| | | */ |
| | | @TableField("lonLat") |
| | | private String lonLat; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
| | |
| | | this.districtCode = districtCode; |
| | | } |
| | | |
| | | public String getLonLat() { |
| | | return lonLat; |
| | | } |
| | | |
| | | public void setLonLat(String lonLat) { |
| | | this.lonLat = lonLat; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.dao.*; |
| | | import com.stylefeng.guns.modular.crossCity.model.LineShift; |
| | | import com.stylefeng.guns.modular.crossCity.model.LineShiftDriver; |
| | | import com.stylefeng.guns.modular.crossCity.model.LineSite; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.model.*; |
| | | import com.stylefeng.guns.modular.crossCity.server.ILineSiteService; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.SiteWarpper; |
| | |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.GDMapGeocodingUtil; |
| | | import com.stylefeng.guns.modular.system.util.SystemException; |
| | | import com.stylefeng.guns.modular.system.util.model.GeoFencingPolygon; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | map.put("name", s.get("name").toString()); |
| | | name = s.get("cityName").toString(); |
| | | code = s.get("cityCode").toString(); |
| | | if(null == s.get("name")){ |
| | | String location = gdMapGeocodingUtil.geocoding(name + s.get("name").toString()); |
| | | map.put("lonLat", location); |
| | | Site site = new Site(); |
| | | site.setId(Integer.valueOf(s.get("id").toString())); |
| | | site.setLonLat(location); |
| | | siteMapper.updateById(site); |
| | | }else{ |
| | | map.put("lonLat", s.get("name").toString()); |
| | | } |
| | | data.add(map); |
| | | } |
| | | } |
| | |
| | | systemNoticeService.addSystemNotice(1, "您的跨城订单已下单成功!", orderCrossCity.getUserId(), 1); |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setId(orderCrossCity.getId()); |
| | | // baseWarpper.setContent(""); |
| | | // //生成小程序二维码,用于司机展示让用户跳转到小程序完成订单支付 |
| | | baseWarpper.setContent(""); |
| | | //生成小程序二维码,用于司机展示让用户跳转到小程序完成订单支付 |
| | | // String appletPath = "pages/home/home"; |
| | | // InputStream inputStream = weChatUtil.getwxacodeunlimit(appletPath, "", "release"); |
| | | // InputStream inputStream = weChatUtil.getwxacodeunlimit(appletPath, "driver_places", "release"); |
| | | // if (inputStream != null) { |
| | | // File file = FileUtil.writeFromStream(inputStream, new File(filePath + "/" + UUID.randomUUID().toString() + ".png")); |
| | | // HttpRequest post = HttpUtil.createPost(adminUrl + "/upload/image"); |
| | |
| | | // Integer code = jsonObject.getInteger("code"); |
| | | // if(200 == code){ |
| | | // baseWarpper.setContent(jsonObject.getString("data")); |
| | | // System.err.println(jsonObject.getString("data")); |
| | | // } |
| | | // } |
| | | |
| | |
| | | private String name; |
| | | @ApiModelProperty("所属地区编号") |
| | | private String code; |
| | | @ApiModelProperty("经纬度") |
| | | private String lonLat; |
| | | @ApiModelProperty("站点列表") |
| | | private List<Object> sites; |
| | | |
| | |
| | | JSONObject jsonObject = JSON.parseObject(forObject); |
| | | String status = jsonObject.getString("status"); |
| | | List<String> list = new ArrayList<>(); |
| | | |
| | | // gdInterfaceService.saveData("https://restapi.amap.com/v3/geocode/geo", "行政区域转经纬度"); |
| | | |
| | | if(status.equals("1")){ |
| | | JSONArray geocodes = jsonObject.getJSONArray("geocodes"); |
| | | for(int i = 0; i < geocodes.size(); i++){ |
| | |
| | | } |
| | | |
| | | |
| | | public String geocoding(String address){ |
| | | String url = "https://restapi.amap.com/v3/geocode/geo?key=" + key + "&output=JSON"; |
| | | url += "&address=" + address; |
| | | String forObject = restTemplate.getForObject(url, String.class); |
| | | JSONObject jsonObject = JSON.parseObject(forObject); |
| | | String status = jsonObject.getString("status"); |
| | | if(status.equals("1")){ |
| | | JSONArray geocodes = jsonObject.getJSONArray("geocodes"); |
| | | for(int i = 0; i < geocodes.size(); i++){ |
| | | String location = geocodes.getJSONObject(i).getString("location"); |
| | | return location; |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据经纬度获取行政区域信息 |
| | | * @param lon |
| | |
| | | String content = "jsapi_ticket=" + ticket + "&noncestr=" + noncestr + "×tamp=" + timestamp + "&url=" + url; |
| | | String signature = DigestUtils.sha1Hex(content); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("appId", "wx0e72f86394831b34"); |
| | | map.put("appId", wxAppletsAppid); |
| | | map.put("timestamp", timestamp); |
| | | map.put("nonceStr", noncestr); |
| | | map.put("signature", signature); |
| | |
| | | * @return |
| | | */ |
| | | public String getAccessToken(){ |
| | | String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx0e72f86394831b34&secret=930f857abc74f7bb5cbd89e1544c5669"; |
| | | String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + wxAppletsAppid + "&secret=" + wxAppletsAppSecret; |
| | | String backData = restTemplate.getForObject(url, String.class); |
| | | String accessToken = JSONObject.parseObject(backData).getString("access_token"); |
| | | return accessToken; |
| | |
| | | * @return |
| | | */ |
| | | public String getAccessToken2(){ |
| | | String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx6ef29d8e008781da&secret=657ca979dc7671da49c6eacfbbfc5f01"; |
| | | String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + wxAppletsAppid + "&secret=" + wxAppletsAppSecret; |
| | | String backData = restTemplate.getForObject(url, String.class); |
| | | String accessToken = JSONObject.parseObject(backData).getString("access_token"); |
| | | return accessToken; |
| | |
| | | private Double redMoney; |
| | | @ApiModelProperty("订单金额") |
| | | private Double orderMoney; |
| | | @ApiModelProperty("支付金额") |
| | | private Double payMoney; |
| | | @ApiModelProperty("订单状态(1=待接单,2=待出发,3=待到达预约地点,4=待乘客上车,5=服务中,6=完成服务,7=待支付,8=待评价,9=已完成,10=已取消,11=改派中)<br/>" + |
| | | "小件物流订单状态(1=待接单,2=待出发,3=待到达预约地点,4=待取货,5=送货中,6=已送达,7=待支付,8=需补差价,9=已取货,10=已取消,11=已支付差价)") |
| | | private Integer state; |
| | |
| | | this.driverImg = driverImg; |
| | | } |
| | | |
| | | public Double getPayMoney() { |
| | | return payMoney; |
| | | } |
| | | |
| | | public void setPayMoney(Double payMoney) { |
| | | this.payMoney = payMoney; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderListWarpper{" + |
| | |
| | | orderListWarpper.setState(null != map.get("state") ? Integer.valueOf(String.valueOf(map.get("state"))) : 0); |
| | | orderListWarpper.setRedMoney(null != map.get("redMoney") ? Double.valueOf(String.valueOf(map.get("redMoney"))) : 0); |
| | | orderListWarpper.setOrderMoney(null != map.get("orderMoney") ? Double.valueOf(String.valueOf(map.get("orderMoney"))) : 0); |
| | | orderListWarpper.setPayMoney(null != map.get("payMoney") ? Double.valueOf(String.valueOf(map.get("payMoney"))) : 0); |
| | | orderListWarpper.setType(null != map.get("type") ? Integer.valueOf(String.valueOf(map.get("type"))) : 0); |
| | | orderListWarpper.setPeopleNumber(null != map.get("peopleNumber") ? Integer.valueOf(String.valueOf(map.get("peopleNumber"))) : 0); |
| | | orderListWarpper.setUser(null != map.get("user") ? String.valueOf(map.get("user")) : ""); |
| | |
| | | eureka: |
| | | client: |
| | | service-url: #注册中心地址 |
| | | defaultZone: http://sinata:sinata@192.168.110.15:8000/eureka #启用身份验证的方式连接 |
| | | defaultZone: http://sinata:sinata@127.0.0.1:8000/eureka #启用身份验证的方式连接 |
| | | register-with-eureka: true #在注册中心进行注册 |
| | | fetch-registry: true #从Eureka中获取注册信息。 |
| | | |
| | |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.IdGenerator; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.TLocation; |
| | | import com.stylefeng.guns.modular.system.model.TRegion; |
| | | import com.stylefeng.guns.modular.system.model.TSite; |
| | |
| | | import com.stylefeng.guns.modular.system.service.ITRegionService; |
| | | import com.stylefeng.guns.modular.system.service.ITSiteService; |
| | | import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; |
| | | import com.stylefeng.guns.modular.system.util.GDMapGeocodingUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.model.GeoFencingPolygon; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private MongoTemplate mongoTemplate; |
| | | |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | |
| | | |
| | | /** |
| | |
| | | tSite.setInsertTime(new Date()); |
| | | tSite.setInsertUserId(shiroExtUtil.getUser().getId()); |
| | | tSite.setState(1); |
| | | String address = (ToolUtil.isNotEmpty(tSite.getProvince()) ? tSite.getProvince() : "") + |
| | | (ToolUtil.isNotEmpty(tSite.getCity()) ? tSite.getCity() : "") + |
| | | (ToolUtil.isNotEmpty(tSite.getDistrict()) ? tSite.getDistrict() : "") + |
| | | tSite.getName(); |
| | | String location = gdMapGeocodingUtil.geocoding1(address); |
| | | tSite.setLonLat(location); |
| | | tSite.setCompanyId(shiroExtUtil.getUser().getObjectId()); |
| | | tSiteService.insert(tSite); |
| | | |
| | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TSite tSite,@RequestParam String subArr) { |
| | | String address = (ToolUtil.isNotEmpty(tSite.getProvince()) ? tSite.getProvince() : "") + |
| | | (ToolUtil.isNotEmpty(tSite.getCity()) ? tSite.getCity() : "") + |
| | | (ToolUtil.isNotEmpty(tSite.getDistrict()) ? tSite.getDistrict() : "") + |
| | | tSite.getName(); |
| | | String location1 = gdMapGeocodingUtil.geocoding1(address); |
| | | tSite.setLonLat(location1); |
| | | tSiteService.updateById(tSite); |
| | | |
| | | //删除站点区域 |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | |
| | | * 区县编号 |
| | | */ |
| | | private String districtCode; |
| | | /** |
| | | * 经纬度 |
| | | */ |
| | | private String lonLat; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | |
| | | this.districtCode = districtCode; |
| | | } |
| | | |
| | | public String getLonLat() { |
| | | return lonLat; |
| | | } |
| | | |
| | | public void setLonLat(String lonLat) { |
| | | this.lonLat = lonLat; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | |
| | | String status = jsonObject.getString("status"); |
| | | List<String> list = new ArrayList<>(); |
| | | |
| | | gdInterfaceService.saveData("https://restapi.amap.com/v3/geocode/geo", "行政区域转经纬度"); |
| | | // gdInterfaceService.saveData("https://restapi.amap.com/v3/geocode/geo", "行政区域转经纬度"); |
| | | |
| | | if(status.equals("1")){ |
| | | JSONArray geocodes = jsonObject.getJSONArray("geocodes"); |
| | |
| | | |
| | | |
| | | |
| | | public String geocoding1(String address){ |
| | | String url = "https://restapi.amap.com/v3/geocode/geo?key=" + key + "&output=JSON"; |
| | | url += "&address=" + address; |
| | | String forObject = restTemplate.getForObject(url, String.class); |
| | | JSONObject jsonObject = JSON.parseObject(forObject); |
| | | String status = jsonObject.getString("status"); |
| | | if(status.equals("1")){ |
| | | JSONArray geocodes = jsonObject.getJSONArray("geocodes"); |
| | | for(int i = 0; i < geocodes.size(); i++){ |
| | | String location = geocodes.getJSONObject(i).getString("location"); |
| | | return location; |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据经纬度获取行政区域信息 |
| | | * @param lon |
| | |
| | | onconUUID = UserUtil.getOnconUUIDByMobile(phone); |
| | | } |
| | | |
| | | int i =0; |
| | | if(null == userInfo){ |
| | | userInfo = new UserInfo(); |
| | | userInfo.setAvatar("https://traffic.qytzt.cn/v1/AUTH_d8bef0a04db511f0b79d01a3e2b7587e/qyt20250702/imgs/management/d081e7a9-13d4-4eec-afb6-afd10885a664.png"); |
| | | if(ToolUtil.isEmpty(phone)){ |
| | | if(ToolUtil.isNotEmpty(phone)){ |
| | | List<UserInfo> phone1 = userInfoMapper.selectList(new EntityWrapper<UserInfo>().eq("phone", phone).eq("state",1).ne("flag",3)); |
| | | if(phone1.size()>0){ |
| | | userInfo = phone1.get(0); |
| | | userInfo.setUnionid(unionid); |
| | | userInfo.setAppletsOpenId(openid); |
| | | userInfoMapper.updateById(userInfo); |
| | | i=1; |
| | | }else { |
| | | userInfo.setPhone(phone); |
| | | } |
| | | }else { |
| | | userInfo.setPhone(phone); |
| | | } |
| | | userInfo.setPhone(phone); |
| | | |
| | | userInfo.setPassWord(ShiroKit.md5("", salt)); |
| | | userInfo.setRegistIp(registIp); |
| | |
| | | userInfo.setAvatar(avatar); |
| | | userInfo.setOnconUUID(onconUUID); |
| | | |
| | | if(type == 2){ |
| | | if(type == 2){ |
| | | userInfo.setAppletsOpenId(openid); |
| | | }else{ |
| | | }else{ |
| | | userInfo.setOpenId(openid); |
| | | } |
| | | } |
| | | userInfo.setUnionid(unionid); |
| | | userInfo.setIsAuth(1); |
| | | userInfo.setConsumption(0D); |
| | |
| | | }else { |
| | | userInfo.setCompanyId(1); |
| | | } |
| | | if(i==0){ |
| | | if(null == userInfo.getId()){ |
| | | userInfoMapper.updateById(userInfo); |
| | | }else{ |
| | | this.insert(userInfo); |
| | | this.addCoupon(userInfo);//添加优惠券 |
| | | UserInfo finalUserInfo = userInfo; |