| | |
| | | <el-form-item label="送货日期" prop="dateInfo"> |
| | | <el-date-picker v-model="searchForm.dateInfo" value-format="yyyy-MM-dd" placeholder="请输入日期" @change="search"/> |
| | | </el-form-item> |
| | | <el-form-item label="所属主线路" prop="categoryId"> |
| | | <el-select v-model="searchForm.categoryId" clearable filterable placeholder="请选择所属主线路" @change="search"> |
| | | <el-option v-for="item in categoryList" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status" > |
| | | <el-select v-model="searchForm.status" placeholder="请选择" clearable @change="search"> |
| | | <el-option label="未优化" value="0"></el-option> |
| | |
| | | import OperaJkSketchLineListWindow from '@/components/business/OperaJkSketchLineListWindow' |
| | | import OperaJkSketchResultWindow from '@/components/business/OperaJkSketchResultWindow' |
| | | import OperaJkSketchImportWindow from '@/components/business/OperaJkSketchImportWindow' |
| | | import {fetchCateList} from "@/api/business/category"; |
| | | export default { |
| | | name: 'JkSketch', |
| | | extends: BaseTable, |
| | |
| | | // 搜索 |
| | | searchForm: { |
| | | status: '', |
| | | categoryId: '', |
| | | dateInfo: '' |
| | | }, |
| | | isWorking: { |
| | | export1: false, |
| | | export2: false |
| | | } |
| | | }, |
| | | categoryList: [] |
| | | } |
| | | }, |
| | | created () { |
| | |
| | | const day = now.getDate(); |
| | | this.searchForm.dateInfo = `${year}-${month}-${day}` |
| | | this.search() |
| | | this.loadCategory() |
| | | }, |
| | | methods: { |
| | | loadCategory () { |
| | | fetchCateList({ type: 4 }).then(res => { |
| | | this.categoryList = res || [] |
| | | }) |
| | | }, |
| | | exportExcel1 () { |
| | | if (!this.searchForm.dateInfo) { |
| | | this.$message.error('请选择指定日期进行该导出操作!') |
| | |
| | | Math.sin(dLon / 2) * Math.sin(dLon / 2); |
| | | double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); |
| | | |
| | | return (long) (EARTH_RADIUS * c ); |
| | | return (long) (EARTH_RADIUS * c * 1000); |
| | | } |
| | | } |
| | |
| | | RoutingSearchParameters searchParameters = |
| | | main.defaultRoutingSearchParameters() |
| | | .toBuilder() |
| | | .setTimeLimit(Duration.newBuilder().setSeconds(60*60).build())//最久1小时 |
| | | // .setTimeLimit(Duration.newBuilder().setSeconds(60*60).build())//最久1小时 |
| | | .setFirstSolutionStrategy(FirstSolutionStrategy.Value.PATH_CHEAPEST_ARC) |
| | | .build(); |
| | | |
| | |
| | | startmodel.setSteps(allList.get(0).getStartSteps()); |
| | | if(StringUtils.isBlank(startmodel.getSteps())){ |
| | | // (BigDecimal lat1, BigDecimal lon1, BigDecimal lat2, BigDecimal lon2) |
| | | startmodel.setDistance(DistanceCalculator.calculateDistanceDecinal(startmodel.getStartLatitude(),startmodel.getStartLogitude(),startmodel.getEndLatitude(),startmodel.getEndLatitude())); |
| | | startmodel.setDistance(DistanceCalculator.calculateDistanceDecinal(startmodel.getStartLatitude(),startmodel.getStartLogitude(),startmodel.getEndLatitude(),startmodel.getEndLogitude())); |
| | | startmodel.setSteps(comLocation +";"+allList.get(0).getLongitude()+","+allList.get(0).getLatitude()); |
| | | } |
| | | list.add(startmodel); |
| | |
| | | if(param!=null && param.getDistance()!=0){//如果之前已经获取过 |
| | | tt.setDistance(param.getDistance()); |
| | | }else{ |
| | | tt.setDistance(DistanceCalculator.calculateDistanceDecinal(tt.getStartLatitude(),tt.getStartLogitude(),tt.getEndLatitude(),tt.getEndLatitude())); |
| | | tt.setDistance(DistanceCalculator.calculateDistanceDecinal(tt.getStartLatitude(),tt.getStartLogitude(),tt.getEndLatitude(),tt.getEndLogitude())); |
| | | } |
| | | } |
| | | tt.setLocation(allList.get(i).getLocation()); |
| | |
| | | DistanceMapParam t = new DistanceMapParam(); |
| | | t.setId(cm.getCustomerId()); |
| | | DistanceMapParam param = getParamByCustomerIds( cm.getCustomerId(),distanceMapParamList); |
| | | if(param!=null){//如果之前已经获取过 |
| | | if(param!=null && t.getDistance()>0){//如果之前已经获取过 |
| | | t = param; |
| | | }else{ |
| | | //如果未规划,按照直线距离 |
| | |
| | | int index =0; |
| | | for(JkSketchCustomer c : customers){ |
| | | if(index ==0){ |
| | | lineDistance+= Constants.formatLongNum(c.getStartDistance()); |
| | | if(c.getStartDistance() >0){ |
| | | lineDistance+= Constants.formatLongNum(c.getStartDistance()); |
| | | }else{ |
| | | lineDistance += DistanceCalculator.calculateDistanceDecinal(c.getLatitude(),c.getLongitude(),cLatitude,cLongitude); |
| | | } |
| | | } |
| | | if(index == customers.size()-1){ |
| | | lineDistance+= Constants.formatLongNum(c.getEndDistance()); |
| | | if(c.getEndDistance() >0){ |
| | | lineDistance+= Constants.formatLongNum(c.getEndDistance()); |
| | | }else{ |
| | | lineDistance += DistanceCalculator.calculateDistanceDecinal(c.getLatitude(),c.getLongitude(),cLatitude,cLongitude); |
| | | } |
| | | break; |
| | | } |
| | | DistanceMapParam param = getParamByCustomerIds( customers.get(index+1).getCustomerId(),getListFromJsonStr(c.getDistanceJson())); |
| | | lineDistance += param.getDistance(); |
| | | JkSketchCustomer end = customers.get(index+1); |
| | | DistanceMapParam param1 = getParamByCustomerIds(end.getCustomerId(),getListFromJsonStr(c.getDistanceJson())); |
| | | if(param1 !=null && param1.getDistance()>0){ |
| | | lineDistance += param1.getDistance(); |
| | | }else{ |
| | | lineDistance += DistanceCalculator.calculateDistanceDecinal(c.getLatitude(),c.getLongitude(),end.getLatitude(),end.getLongitude()); |
| | | } |
| | | index++; |
| | | /* for(JkSketchCustomer cm : customers){ |
| | | DistanceMapParam param = getParamByCustomerIds( cm.getCustomerId(),getListFromJsonStr(c.getDistanceJson())); |