|
|
@@ -1,14 +1,19 @@
|
|
|
package com.xjrsoft.module.personnel.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.google.gson.JsonArray;
|
|
|
import com.google.gson.JsonElement;
|
|
|
import com.google.gson.JsonObject;
|
|
|
import com.google.gson.JsonParser;
|
|
|
+import com.xjrsoft.common.enums.DeleteMark;
|
|
|
+import com.xjrsoft.common.exception.MyException;
|
|
|
import com.xjrsoft.module.hikvision.entity.HikvisionData;
|
|
|
import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
|
|
|
import com.xjrsoft.module.hikvision.util.ApiUtil;
|
|
|
+import com.xjrsoft.module.personnel.dto.AddCarMessageApplyDto;
|
|
|
+import com.xjrsoft.module.personnel.dto.UpdateCarMessageApplyDto;
|
|
|
import com.xjrsoft.module.personnel.entity.CarMessageApply;
|
|
|
import com.xjrsoft.module.personnel.mapper.CarMessageApplyMapper;
|
|
|
import com.xjrsoft.module.personnel.service.ICarMessageApplyService;
|
|
|
@@ -16,6 +21,7 @@ import lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.Collection;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
@@ -69,4 +75,17 @@ public class CarMessageApplyServiceImpl extends MPJBaseServiceImpl<CarMessageApp
|
|
|
// }
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Boolean add(AddCarMessageApplyDto dto) {
|
|
|
+ Integer countByCarNumber = this.baseMapper.getCountByCarNumber(dto.getCarNumber());
|
|
|
+ if(countByCarNumber > 0){
|
|
|
+ throw new MyException("已存在该车牌号");
|
|
|
+ }
|
|
|
+ CarMessageApply carMessageApply = BeanUtil.toBean(dto, CarMessageApply.class);
|
|
|
+ this.save(carMessageApply);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
}
|