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