2 Incheckningar 525946e354 ... 9eea80ff34

Upphovsman SHA1 Meddelande Datum
  wanghaicheng 9eea80ff34 Merge branch 'master' of http://111.47.6.224:3000/udream-cxs/lift-server 4 år sedan
  wanghaicheng c91d64d29f update->维保工签到保养时,扩大可签到范围到2000米 4 år sedan

+ 6 - 4
lift-business-service/src/main/java/cn/com/ty/lift/business/maintenance/service/MaintenanceRecordService.java

@@ -134,11 +134,11 @@ public class MaintenanceRecordService extends ServiceImpl<MaintenanceRecordMappe
     /**
      * @param coordinate 维保工经纬度
      * @return 是否在范围内
-     * @description 计算维保工开始保养时,是否在电梯200米范围内
+     * @description 计算维保工开始保养时,是否在电梯2000米范围内
      * @date 2020/1/13 11:30 上午
      */
     public boolean calc(String liftCoordinate, String coordinate) {
-        double expected = 500;
+        double expected = 2000;
         double result = MapHelper.GetPointDistance(liftCoordinate, coordinate);
         return (result * 1000) > expected;
     }
@@ -233,10 +233,12 @@ public class MaintenanceRecordService extends ServiceImpl<MaintenanceRecordMappe
         //维保工是否在电梯附近
         String coordinate = request.getCoordinate();
         boolean result = calc(liftCoordinate, coordinate);
-        if (result)
+        if (result) {
+            log.info("用户签到位置大于2千米");
             return RestResponse.fail(MessageUtils.get("msg.error.person.scope"));
+        }
         log.debug("根据全局设置判断当前维保工是否可以继续维保电梯");
-        boolean maintainable = maintenancePlanService.getBaseMapper().selectLiftMaintainableBy(request.getUserId(), request.getMtCompanyId(),DateTimeFormatter.ofPattern("yyyy-MM-dd").format(LocalDate.now()));
+        boolean maintainable = maintenancePlanService.getBaseMapper().selectLiftMaintainableBy(request.getUserId(), request.getMtCompanyId(), DateTimeFormatter.ofPattern("yyyy-MM-dd").format(LocalDate.now()));
         if (!maintainable) {
             return RestResponse.fail("超出公司设置的维保工可维保电梯上限数量");
         }