Commit ee3060c2b8e36a6b9cab15af6d56d55cb8b4ea43
1 parent
38eec92a
电子联单bug 修复
Showing
3 changed files
with
54 additions
and
11 deletions
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrderMatchAsk.java
| @@ -204,6 +204,48 @@ public class GarOrderMatchAsk implements Serializable { | @@ -204,6 +204,48 @@ public class GarOrderMatchAsk implements Serializable { | ||
| 204 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 204 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| 205 | private Date createTime; | 205 | private Date createTime; |
| 206 | 206 | ||
| 207 | + /** | ||
| 208 | + * 装车经纬度 | ||
| 209 | + */ | ||
| 210 | + private String loadingLonLat; | ||
| 211 | + | ||
| 212 | + /** | ||
| 213 | + * 卸车经纬度 | ||
| 214 | + */ | ||
| 215 | + private String unloadingLonLat; | ||
| 216 | + | ||
| 217 | + public Date getUpdateTime() { | ||
| 218 | + return updateTime; | ||
| 219 | + } | ||
| 220 | + | ||
| 221 | + public void setUpdateTime(Date updateTime) { | ||
| 222 | + this.updateTime = updateTime; | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + public Date getCreateTime() { | ||
| 226 | + return createTime; | ||
| 227 | + } | ||
| 228 | + | ||
| 229 | + public void setCreateTime(Date createTime) { | ||
| 230 | + this.createTime = createTime; | ||
| 231 | + } | ||
| 232 | + | ||
| 233 | + public String getLoadingLonLat() { | ||
| 234 | + return loadingLonLat; | ||
| 235 | + } | ||
| 236 | + | ||
| 237 | + public void setLoadingLonLat(String loadingLonLat) { | ||
| 238 | + this.loadingLonLat = loadingLonLat; | ||
| 239 | + } | ||
| 240 | + | ||
| 241 | + public String getUnloadingLonLat() { | ||
| 242 | + return unloadingLonLat; | ||
| 243 | + } | ||
| 244 | + | ||
| 245 | + public void setUnloadingLonLat(String unloadingLonLat) { | ||
| 246 | + this.unloadingLonLat = unloadingLonLat; | ||
| 247 | + } | ||
| 248 | + | ||
| 207 | public Date getGarOrderTime() { | 249 | public Date getGarOrderTime() { |
| 208 | return garOrderTime; | 250 | return garOrderTime; |
| 209 | } | 251 | } |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderAssociationServiceAsync.java
| @@ -8,6 +8,7 @@ import com.trash.common.utils.RemoteServerUtils; | @@ -8,6 +8,7 @@ import com.trash.common.utils.RemoteServerUtils; | ||
| 8 | import com.trash.dropPointInfo.domain.DropPointInfo; | 8 | import com.trash.dropPointInfo.domain.DropPointInfo; |
| 9 | import com.trash.dropPointInfo.service.IDropPointInfoService; | 9 | import com.trash.dropPointInfo.service.IDropPointInfoService; |
| 10 | import com.trash.dropPointInfo.service.impl.DropPointInfoServiceImpl; | 10 | import com.trash.dropPointInfo.service.impl.DropPointInfoServiceImpl; |
| 11 | +import com.trash.garbage.pojo.domain.GarOrder; | ||
| 11 | import com.trash.garbage.pojo.domain.GarOrderMatchAsk; | 12 | import com.trash.garbage.pojo.domain.GarOrderMatchAsk; |
| 12 | import com.trash.garbage.pojo.dto.AskTransportDto; | 13 | import com.trash.garbage.pojo.dto.AskTransportDto; |
| 13 | import com.trash.garbage.pojo.dto.UploadDto; | 14 | import com.trash.garbage.pojo.dto.UploadDto; |
| @@ -48,18 +49,17 @@ public class GarOrderAssociationServiceAsync { | @@ -48,18 +49,17 @@ public class GarOrderAssociationServiceAsync { | ||
| 48 | * @param dto 上传对象 | 49 | * @param dto 上传对象 |
| 49 | */ | 50 | */ |
| 50 | @Async | 51 | @Async |
| 51 | - public void isWithinDropPointCoordinates(String carPlate, GarOrderMatchAsk garOrderMatchAsk, UploadDto dto) { | 52 | + public void isWithinDropPointCoordinates(String carPlate, GarOrderMatchAsk garOrderMatchAsk, UploadDto dto, GarOrder garOrder) { |
| 52 | try { | 53 | try { |
| 53 | log.info("开始判断车辆是否在投放点区域内"); | 54 | log.info("开始判断车辆是否在投放点区域内"); |
| 54 | - DropPointInfo dropPointInfo = dropPointInfoService.selectDropPointInfoById((long) garOrderMatchAsk.getDropPointId()); | 55 | + |
| 55 | // 上传装车照片的经纬度 | 56 | // 上传装车照片的经纬度 |
| 56 | double vehicleLat = dto.getLatitude(); | 57 | double vehicleLat = dto.getLatitude(); |
| 57 | double vehicleLon = dto.getLongitude(); | 58 | double vehicleLon = dto.getLongitude(); |
| 58 | // 获取投放点的经纬度 | 59 | // 获取投放点的经纬度 |
| 59 | - String[] coordinatePoint = dropPointInfo.getCoordinatePoint().split(","); | ||
| 60 | - double dropPointLat = Double.parseDouble(coordinatePoint[1]); | ||
| 61 | - double dropPointLon = Double.parseDouble(coordinatePoint[0]); | ||
| 62 | - | 60 | + double dropPointLat = garOrder.getGarLatitude(); |
| 61 | + double dropPointLon = garOrder.getGarLongitude(); | ||
| 62 | + garOrderMatchAsk.setLoadingLonLat(dto.getLongitude()+","+dto.getLatitude()); | ||
| 63 | // 计算距离 | 63 | // 计算距离 |
| 64 | double distance = calculateDistance(vehicleLat, vehicleLon, dropPointLat, dropPointLon); | 64 | double distance = calculateDistance(vehicleLat, vehicleLon, dropPointLat, dropPointLon); |
| 65 | log.info("车辆与投放点的距离为: {} 公里", distance); | 65 | log.info("车辆与投放点的距离为: {} 公里", distance); |
| @@ -68,8 +68,8 @@ public class GarOrderAssociationServiceAsync { | @@ -68,8 +68,8 @@ public class GarOrderAssociationServiceAsync { | ||
| 68 | garOrderMatchAsk.setGarOrderType("0"); | 68 | garOrderMatchAsk.setGarOrderType("0"); |
| 69 | }else{ | 69 | }else{ |
| 70 | garOrderMatchAsk.setGarOrderType("1"); | 70 | garOrderMatchAsk.setGarOrderType("1"); |
| 71 | - log.info("{}车辆装车地点与投放点{}距离大于2公里,距离:{}", carPlate, dropPointInfo.getDropPointName(),distance); | ||
| 72 | - garOrderMatchAsk.setGarRemark(carPlate+"车辆装车地点与投放点"+dropPointInfo.getDropPointName()+"距离大于2公里,距离:"+distance+"公里"); | 71 | + log.info("{}车辆装车地点与投放点{}距离大于2公里,距离:{}", carPlate, garOrder.getGarOrderAddress()+garOrder.getGarOrderAddressDetails(),distance); |
| 72 | + garOrderMatchAsk.setGarRemark(carPlate+"车辆装车地点与投放点<"+garOrder.getGarOrderAddress()+garOrder.getGarOrderAddressDetails()+">距离大于2公里,距离:"+distance+"公里"); | ||
| 73 | } | 73 | } |
| 74 | }catch (Exception e){ | 74 | }catch (Exception e){ |
| 75 | log.error("判断车辆是否在投放点区域内发生异常: ", e); | 75 | log.error("判断车辆是否在投放点区域内发生异常: ", e); |
| @@ -97,9 +97,10 @@ public class GarOrderAssociationServiceAsync { | @@ -97,9 +97,10 @@ public class GarOrderAssociationServiceAsync { | ||
| 97 | JSONObject result = disposalJson.getJSONObject("result"); | 97 | JSONObject result = disposalJson.getJSONObject("result"); |
| 98 | JSONObject site = result.getJSONObject("site"); | 98 | JSONObject site = result.getJSONObject("site"); |
| 99 | String coord = site.getString("coord"); | 99 | String coord = site.getString("coord"); |
| 100 | - // 上传装车照片的经纬度 | 100 | + // 上传卸车照片的经纬度 |
| 101 | double vehicleLat = dto.getLatitude(); | 101 | double vehicleLat = dto.getLatitude(); |
| 102 | double vehicleLon = dto.getLongitude(); | 102 | double vehicleLon = dto.getLongitude(); |
| 103 | + garOrderMatchAsk.setUnloadingLonLat(dto.getLongitude()+","+dto.getLatitude()); | ||
| 103 | // 获取处置场所的经纬度列表 | 104 | // 获取处置场所的经纬度列表 |
| 104 | List<double[]> coordinates = parseCoordinates(coord); | 105 | List<double[]> coordinates = parseCoordinates(coord); |
| 105 | 106 |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderServiceImpl.java
| @@ -661,9 +661,9 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | @@ -661,9 +661,9 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | ||
| 661 | List<GarOrderMatchAsk> askList = askService.list(qw); | 661 | List<GarOrderMatchAsk> askList = askService.list(qw); |
| 662 | for (GarOrderMatchAsk garOrderMatchAsk : askList) { | 662 | for (GarOrderMatchAsk garOrderMatchAsk : askList) { |
| 663 | //每次只判断一次 | 663 | //每次只判断一次 |
| 664 | - if(garOrderMatchAsk.getGarOrderType()==null && garOrderMatchAsk.getDropPointId() != 0){ | 664 | + if(garOrderMatchAsk.getGarOrderType()==null && garOrderMatchAsk.getLoadingLonLat()==null){ |
| 665 | //判断车辆上传装车图片时是否在投放点区域内 | 665 | //判断车辆上传装车图片时是否在投放点区域内 |
| 666 | - garOrderAssociationServiceAsync.isWithinDropPointCoordinates(dto.getCarPlate(), garOrderMatchAsk, dto); | 666 | + garOrderAssociationServiceAsync.isWithinDropPointCoordinates(dto.getCarPlate(), garOrderMatchAsk, dto, order); |
| 667 | break; | 667 | break; |
| 668 | } | 668 | } |
| 669 | } | 669 | } |