|
@@ -104,10 +104,11 @@ public class MaintenanceRecordService extends ServiceImpl<MaintenanceRecordMappe
|
|
|
* @description 根据计划id和公司id查询是否有保养记录
|
|
|
* @date 2020/1/20 2:41 下午
|
|
|
*/
|
|
|
- public boolean count(Long planId, Long mtCompanyId) {
|
|
|
+ public boolean count(Long planId, Long mtCompanyId, Long workerId) {
|
|
|
LambdaQueryWrapper<MaintenanceRecord> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
|
|
lambdaQueryWrapper.eq(MaintenanceRecord::getMtPlanId, planId);
|
|
|
lambdaQueryWrapper.eq(MaintenanceRecord::getMtCompanyId, mtCompanyId);
|
|
|
+ lambdaQueryWrapper.eq(MaintenanceRecord::getWorkerId, workerId);
|
|
|
return count(lambdaQueryWrapper) > 0;
|
|
|
}
|
|
|
|
|
@@ -121,10 +122,11 @@ public class MaintenanceRecordService extends ServiceImpl<MaintenanceRecordMappe
|
|
|
MaintenanceRecord record = request.getRecord();
|
|
|
Long planId = record.getMtPlanId();
|
|
|
Long mtCompanyId = record.getMtCompanyId();
|
|
|
+ Long workerId = record.getWorkerId();
|
|
|
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 count = count(planId, mtCompanyId, workerId);
|
|
|
+ if (count) return RestResponse.fail(MessageUtils.get("msg.exist.record"));
|
|
|
boolean result = calc(liftCoordinate, request.getCoordinate());
|
|
|
if (result) return RestResponse.fail(MessageUtils.get("msg.error.person.scope"));
|
|
|
Long liftId = record.getLiftId();
|