|
|
@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.modules.admin.model.SysUser;
|
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
|
-import com.ydtech.modules.fnc.entity.InsPlySettleHx;
|
|
|
import com.ydtech.modules.ser.dao.SerCarInfoMapper;
|
|
|
import com.ydtech.modules.ser.model.SerCarInfo;
|
|
|
import com.ydtech.modules.ser.service.SerCarInfoService;
|
|
|
@@ -35,7 +34,7 @@ public class SerCarInfoServiceImpl implements SerCarInfoService {
|
|
|
queryWrapper.eq("licenseno", serCarInfo.getLicenseNo());
|
|
|
boolean exist = serCarInfoMapper.exists(queryWrapper);
|
|
|
if (exist) {
|
|
|
- return HttpResult.error("该车已被人注册");
|
|
|
+ return HttpResult.error("该车已被其他用户添加,请检查");
|
|
|
}
|
|
|
SysUser user = BaseController.getUser();
|
|
|
serCarInfo.setId(IdGenerate.nextId());
|
|
|
@@ -43,12 +42,15 @@ public class SerCarInfoServiceImpl implements SerCarInfoService {
|
|
|
LocalDateTime date = LocalDateTime.now();
|
|
|
serCarInfo.setCreateTime(date);
|
|
|
serCarInfoMapper.insert(serCarInfo);
|
|
|
- return HttpResult.ok("新增成功", serCarInfo);
|
|
|
+ return HttpResult.ok("新增车辆信息成功", serCarInfo);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public HttpResult updateCarInfo(SerCarInfo serCarInfo) {
|
|
|
// 校验年检到期时间不可早于注册时间
|
|
|
+ if (serCarInfo.getRegisterTime() == null && serCarInfo.getExpireTime() == null) {
|
|
|
+ return HttpResult.error("注册时间与到期时间不可为空");
|
|
|
+ }
|
|
|
Instant registerInstant = serCarInfo.getRegisterTime().toInstant();
|
|
|
Instant expireInstant = serCarInfo.getExpireTime().toInstant();
|
|
|
if (expireInstant.isBefore(registerInstant)) {
|