|
@@ -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("超出公司设置的维保工可维保电梯上限数量");
|
|
}
|
|
}
|
|
@@ -300,15 +302,15 @@ public class MaintenanceRecordService extends ServiceImpl<MaintenanceRecordMappe
|
|
} else {
|
|
} else {
|
|
return RestResponse.fail(MessageUtils.get("msg.add.fail"));
|
|
return RestResponse.fail(MessageUtils.get("msg.add.fail"));
|
|
}
|
|
}
|
|
- log.debug("根据公司和电梯id设置电梯状态为维保中");
|
|
|
|
- boolean update = platformCompanyLiftRelevanceService.update(Wrappers.<PlatformCompanyLiftRelevance>update().
|
|
|
|
- eq("mt_company_id", request.getMtCompanyId()).
|
|
|
|
- eq("lift_id", request.getRecord().getLiftId()).
|
|
|
|
- set("lift_company_status", CommonEnum.LiftStatus.MAINTENANCE.getCode()));
|
|
|
|
- if (!update) {
|
|
|
|
- rollback();
|
|
|
|
- return RestResponse.fail("无法转换电梯状态到维保中");
|
|
|
|
- }
|
|
|
|
|
|
+// log.debug("根据公司和电梯id设置电梯状态为维保中");
|
|
|
|
+// boolean update = platformCompanyLiftRelevanceService.update(Wrappers.<PlatformCompanyLiftRelevance>update().
|
|
|
|
+// eq("mt_company_id", request.getMtCompanyId()).
|
|
|
|
+// eq("lift_id", request.getRecord().getLiftId()).
|
|
|
|
+// set("lift_company_status", CommonEnum.LiftStatus.MAINTENANCE.getCode()));
|
|
|
|
+// if (!update) {
|
|
|
|
+// rollback();
|
|
|
|
+// return RestResponse.fail("无法转换电梯状态到维保中");
|
|
|
|
+// }
|
|
return RestResponse.success(record.getId(), MessageUtils.get("msg.add.success"));
|
|
return RestResponse.success(record.getId(), MessageUtils.get("msg.add.success"));
|
|
}
|
|
}
|
|
|
|
|