|
@@ -82,8 +82,7 @@ public class MaintenanceRecordService extends ServiceImpl<MaintenanceRecordMappe
|
|
|
* @description 计算维保工开始保养时,是否在电梯200米范围内
|
|
|
* @date 2020/1/13 11:30 上午
|
|
|
*/
|
|
|
- public boolean calc(Long id, String coordinate) {
|
|
|
- String liftCoordinate = getCoordinate(id);
|
|
|
+ public boolean calc(String liftCoordinate, String coordinate) {
|
|
|
double expected = 200;
|
|
|
double result = MapHelper.GetPointDistance(liftCoordinate, coordinate);
|
|
|
return (result * 1000) > expected;
|
|
@@ -113,9 +112,11 @@ public class MaintenanceRecordService extends ServiceImpl<MaintenanceRecordMappe
|
|
|
MaintenanceRecord record = request.getRecord();
|
|
|
Long planId = record.getMtPlanId();
|
|
|
Long mtCompanyId = record.getMtCompanyId();
|
|
|
+ String liftCoordinate = getCoordinate(record.getLiftId());
|
|
|
+ if (StrUtil.isEmpty(liftCoordinate)) return RestResponse.fail(MessageUtils.get("msg.lift.not.position"));
|
|
|
boolean count = count(planId,mtCompanyId);
|
|
|
if (count) return RestResponse.fail(MessageUtils.get("msg.exist.record"));
|
|
|
- boolean result = calc(record.getLiftId(), request.getCoordinate());
|
|
|
+ boolean result = calc(liftCoordinate, request.getCoordinate());
|
|
|
if (result) return RestResponse.fail(MessageUtils.get("msg.error.person.scope"));
|
|
|
Long liftId = record.getLiftId();
|
|
|
Optional<Lift> lift = liftService.getOne(null, liftId);
|