| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.supersavedriving.user.core.common.annotion.ServiceLog; |
| | | import com.supersavedriving.user.core.util.ToolUtil; |
| | | import com.supersavedriving.user.modular.system.model.AppUser; |
| | | import com.supersavedriving.user.modular.system.model.Driver; |
| | | import com.supersavedriving.user.modular.system.model.Order; |
| | | import com.supersavedriving.user.modular.system.model.Revenue; |
| | | import com.supersavedriving.user.modular.system.model.*; |
| | | import com.supersavedriving.user.modular.system.service.*; |
| | | import com.supersavedriving.user.modular.system.util.GaoDe.MapUtil; |
| | | import com.supersavedriving.user.modular.system.util.GaoDe.model.District; |
| | | import com.supersavedriving.user.modular.system.util.MallBook.model.InterfaceResponse; |
| | | import com.supersavedriving.user.modular.system.util.MallBook.model.Receive; |
| | | import com.supersavedriving.user.modular.system.util.MallBook.model.ReceiveUser; |
| | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | |
| | | @Autowired |
| | | private IBranchOfficeService branchOfficeService; |
| | | |
| | | @Autowired |
| | | private ISystemConfigService systemConfigService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryServerPrice") |
| | | // @ServiceLog(name = "获取正在进行中的订单id", url = "/api/order/queryServerOrder") |
| | | @ApiOperation(value = "根据定位获取恶劣天气+节假日信息", tags = {"用户端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "纬度", name = "lat", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "经度", name = "lon", required = true, dataType = "String"), |
| | | }) |
| | | public ResponseWarpper<Integer> queryServerPrice(String lat,String lon){ |
| | | try { |
| | | Integer i =0; // 0为不能接单 1为恶劣天气 2为节假日 3为恶劣+节假日 |
| | | District geocode = MapUtil.geocode(lon, lat); |
| | | String districtCode = geocode.getDistrictCode(); |
| | | List<BranchOffice> districtCode1 = branchOfficeService.selectList(new EntityWrapper<BranchOffice>().eq("districtCode", districtCode)); |
| | | if(districtCode1.size()>0){ |
| | | BranchOffice branchOffice = districtCode1.get(0); |
| | | Integer id = branchOffice.getId(); |
| | | SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 8).eq("companyId", id)); |
| | | SystemConfig systemConfig9 = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 9).eq("companyId", id)); |
| | | if(systemConfig!=null && systemConfig9!=null){ |
| | | String content = systemConfig.getContent(); |
| | | JSONObject jsonObject = JSONObject.parseObject(content); |
| | | String num1 = jsonObject.get("num1").toString(); |
| | | String content9 = systemConfig9.getContent(); |
| | | JSONObject jsonObject9 = JSONObject.parseObject(content9); |
| | | String num9 = jsonObject9.get("num1").toString(); |
| | | if("1".equals(num1)){ |
| | | i=1; |
| | | } |
| | | if("1".equals(num9)){ |
| | | i=2; |
| | | } |
| | | if("1".equals(num1)&&"1".equals(num9)){ |
| | | i=3; |
| | | } |
| | | } |
| | | } |
| | | return ResponseWarpper.success(i); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/getEstimatedCosts") |
| | | // @ServiceLog(name = "获取预估费用", url = "/api/order/getEstimatedCosts") |