|
@@ -3,6 +3,7 @@ package com.ydtech.modules.esm.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
+import com.ydtech.exception.SystemException;
|
|
|
import com.ydtech.modules.esm.dao.EsmInsVehicleInspectionCodeMapper;
|
|
import com.ydtech.modules.esm.dao.EsmInsVehicleInspectionCodeMapper;
|
|
|
import com.ydtech.modules.esm.model.EsmInsCompany;
|
|
import com.ydtech.modules.esm.model.EsmInsCompany;
|
|
|
import com.ydtech.modules.esm.model.EsmInsVehicleInspectionCode;
|
|
import com.ydtech.modules.esm.model.EsmInsVehicleInspectionCode;
|
|
@@ -17,6 +18,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -49,14 +51,19 @@ public class EsmInsVehicleInspectionCodeServiceImpl extends ServiceImpl<EsmInsVe
|
|
|
public boolean submit(EsmInsVehicleInspectionCodeVo esmInsVehicleInspectionCodeVo) {
|
|
public boolean submit(EsmInsVehicleInspectionCodeVo esmInsVehicleInspectionCodeVo) {
|
|
|
EsmInsVehicleInspectionCode esmInsVehicleInspectionCode = lambdaQuery().eq(EsmInsVehicleInspectionCode::getCompanyId,
|
|
EsmInsVehicleInspectionCode esmInsVehicleInspectionCode = lambdaQuery().eq(EsmInsVehicleInspectionCode::getCompanyId,
|
|
|
esmInsVehicleInspectionCodeVo.getCompanyId()).one();
|
|
esmInsVehicleInspectionCodeVo.getCompanyId()).one();
|
|
|
- AssertionUtils.isSucceed(ObjectUtils.isEmpty(esmInsVehicleInspectionCode), "此保险公司已经录入验车码");
|
|
|
|
|
|
|
+ if(!ObjectUtils.isEmpty(esmInsVehicleInspectionCode)){
|
|
|
|
|
+ throw new SystemException("此保险公司已经录入验车码");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ esmInsVehicleInspectionCode = new EsmInsVehicleInspectionCode();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
EsmInsCompany esmInsCompany = esmInsCompanyService.getById(esmInsVehicleInspectionCodeVo.getCompanyId());
|
|
EsmInsCompany esmInsCompany = esmInsCompanyService.getById(esmInsVehicleInspectionCodeVo.getCompanyId());
|
|
|
AssertionUtils.isSucceed(!ObjectUtils.isEmpty(esmInsCompany), "录入的保险公司不存在");
|
|
AssertionUtils.isSucceed(!ObjectUtils.isEmpty(esmInsCompany), "录入的保险公司不存在");
|
|
|
|
|
|
|
|
esmInsVehicleInspectionCode.setCompanyId(esmInsCompany.getId());
|
|
esmInsVehicleInspectionCode.setCompanyId(esmInsCompany.getId());
|
|
|
esmInsVehicleInspectionCode.setName(esmInsCompany.getName());
|
|
esmInsVehicleInspectionCode.setName(esmInsCompany.getName());
|
|
|
- esmInsVehicleInspectionCode.setVehicleInspectionCode(esmInsVehicleInspectionCode.getVehicleInspectionCode());
|
|
|
|
|
|
|
+ esmInsVehicleInspectionCode.setVehicleInspectionCode(esmInsVehicleInspectionCodeVo.getVehicleInspectionCode());
|
|
|
|
|
+ esmInsVehicleInspectionCode.setValidTime(new Date());
|
|
|
return save(esmInsVehicleInspectionCode);
|
|
return save(esmInsVehicleInspectionCode);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -66,6 +73,7 @@ public class EsmInsVehicleInspectionCodeServiceImpl extends ServiceImpl<EsmInsVe
|
|
|
AssertionUtils.isEmpty(esmInsVehicleInspectionCode, "修改的编号不存在");
|
|
AssertionUtils.isEmpty(esmInsVehicleInspectionCode, "修改的编号不存在");
|
|
|
|
|
|
|
|
esmInsVehicleInspectionCode.setVehicleInspectionCode(code);
|
|
esmInsVehicleInspectionCode.setVehicleInspectionCode(code);
|
|
|
|
|
+ esmInsVehicleInspectionCode.setValidTime(new Date());
|
|
|
return updateById(esmInsVehicleInspectionCode);
|
|
return updateById(esmInsVehicleInspectionCode);
|
|
|
}
|
|
}
|
|
|
|
|
|