| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.utils.GaoDeMapUtil; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.entity.ChangeDispatch; |
| | | import com.ruoyi.order.api.entity.Order; |
| | |
| | | import com.ruoyi.system.api.model.LoginUserInfo; |
| | | import com.ruoyi.worker.entity.MasterWorker; |
| | | import com.ruoyi.worker.entity.RecoveryServe; |
| | | import com.ruoyi.worker.entity.ServeCoordinate; |
| | | import com.ruoyi.worker.vo.ServeCoordinate; |
| | | import com.ruoyi.worker.service.MasterWorkerService; |
| | | import com.ruoyi.worker.service.RecoveryServeService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import java.io.IOException; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private ExchangeDispatchClient dispatchClient; |
| | | @Resource |
| | | private RecoveryServeService recoveryServeService; |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | /** |
| | | * linux服务器保存订单轨迹文件夹 |
| | |
| | | List<Integer> ids = orderList.stream().map(Order::getServeId).collect(Collectors.toList()); |
| | | if (!ids.isEmpty()) { |
| | | List<RecoveryServe> serveList = recoveryServeService.lambdaQuery() |
| | | .in(RecoveryServe::getId, ids).eq(RecoveryServe::getIsDelete, 0).list(); |
| | | .in(RecoveryServe::getId, ids).list(); |
| | | Map<Integer, String> map = serveList.stream().collect(Collectors.toMap(RecoveryServe::getId, |
| | | mw -> Optional.ofNullable(mw.getCover()).orElse(""))); |
| | | for (Order order : orderList) { |
| | | order.setCover(map.get(order.getServeId())); |
| | | if (order.getAddress()!=null) { |
| | | order.setReservationAddress(order.getReservationAddress() + order.getAddress()); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(dataList); |
| | |
| | | changeDispatch.setWorkerName(masterWorker.getRealName()); |
| | | changeDispatch.setApplyReason(reason); |
| | | changeDispatch.setApplyTime(DateUtils.getNowDate()); |
| | | changeDispatch.setState(0); |
| | | changeDispatch.setState(Constants.ZERO); |
| | | Boolean result = orderClient.changeOrderState(orderId, Constants.SIX).getData(); |
| | | Order order = orderClient.detail(orderId).getData(); |
| | | if (null == order) { |
| | |
| | | // 上传时判断是否在下单位置附件,距离大于某个值则 不允许上传 |
| | | if (distance > Constants.THREE_THOUSAND) { |
| | | // throw new GlobalException("您当前手机定位超出当前订单预约地址范围 3km,无法提供回收服务!"); |
| | | return R.fail(Boolean.FALSE, "您当前手机定位超出当前订单预约地址范围 3km,无法提供回收服务!"); |
| | | return R.ok(Boolean.FALSE, "您当前手机定位超出当前订单预约地址范围 3km,无法提供回收服务!"); |
| | | } |
| | | return R.ok(true); |
| | | } |
| | |
| | | Integer serveId = data.getOrderInfo().getServeId(); |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() |
| | | .eq(RecoveryServe::getId, serveId).one(); |
| | | data.getOrderInfo().setCover(recoveryServe.getCover()); |
| | | if (null != recoveryServe) { |
| | | data.getOrderInfo().setCover(recoveryServe.getCover()); |
| | | } |
| | | return R.ok(data); |
| | | } |
| | | |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "上传经纬度", tags = {"师傅端-首页"}) |
| | | @GetMapping(value = "/putLocation") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "workId", name = "workId", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "师傅所在经度", name = "longitude", dataType = "String", required = true), |
| | | @ApiImplicitParam(value = "师傅所在纬度", name = "latitude", dataType = "String", required = true) |
| | | }) |
| | | public R<Object> orderNavigation(@RequestParam Integer workId, @RequestParam String longitude, |
| | | @RequestParam String latitude) { |
| | | Result<String> address = GaoDeMapUtil.getCityCode(longitude, latitude); |
| | | System.err.println(address.getDatas()); |
| | | Set<Integer> strings = new HashSet<>(); |
| | | strings.add(workId); |
| | | redisService.setCacheSet("workerLocation:"+address.getDatas()+":", strings); |
| | | redisService.setCacheObject("work:"+workId+":", longitude+","+latitude); |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | } |