Compare commits
No commits in common. "d6d624e705c5638ac3d3dd70b315df4e6eb96e85" and "442cd50d21d0835af012a41a02fa6e7f0ad7f362" have entirely different histories.
d6d624e705
...
442cd50d21
|
|
@ -16,7 +16,6 @@ public interface BusinessConstant {
|
|||
String DEVICE_FIRMWARE_BUCKET = "device-firmware";//设备固件桶
|
||||
String SPEAKER_AUDIO_BUCKET = "speaker-audio";//喊话器音频桶
|
||||
String GEO_MARK_BUCKET = "geo-mark";//地图标注文件桶
|
||||
String DICT_IMAGE_BUCKET = "source-material";//字典图片桶
|
||||
|
||||
//********************************* route action *********************************//
|
||||
String DEFAULT_ACTION_TRIGGER_TYPE = "reachPoint";//默认动作触发器类型 到达航点执行
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
package com.multictrl.common.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum DJIImage {
|
||||
DJI("DJI", "source-material/dji.png"),
|
||||
DOCK1("DJI Dock1", "source-material/dock1.png"),
|
||||
DOCK2("DJI Dock2", "source-material/dock2.png"),
|
||||
DOCK3("DJI Dock3", "source-material/dock3.png");
|
||||
|
||||
private final String name;
|
||||
private final String imageUrl;
|
||||
|
||||
//根据名称获取图片地址
|
||||
public static String getImageUrlByName(String name) {
|
||||
for (DJIImage djiImage : DJIImage.values()) {
|
||||
if (djiImage.getName().equals(name)) {
|
||||
return djiImage.getImageUrl();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -55,15 +55,4 @@ public class MinioController {
|
|||
|
||||
return new Result<String>().ok(minioService.uploadGeoMark(dockSn, file));
|
||||
}
|
||||
|
||||
@Operation(summary = "上传字典图片")
|
||||
@PostMapping("/uploadDictImage")
|
||||
public Result<String> uploadDictImage(
|
||||
@RequestParam("file") MultipartFile file) {
|
||||
if (file.isEmpty()) {
|
||||
return new Result<String>().error(ErrorCode.UPLOAD_FILE_EMPTY);
|
||||
}
|
||||
|
||||
return new Result<String>().ok(minioService.uploadDictImage( file));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
package com.multictrl.modules.business.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.multictrl.common.validator.group.AddGroup;
|
||||
import com.multictrl.common.validator.group.UpdateGroup;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.AssertTrue;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Null;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
|
@ -49,8 +46,8 @@ public class DockDTO implements Serializable {
|
|||
@Schema(description = "机库类型")
|
||||
private String dockType;
|
||||
|
||||
// @NotBlank(message = "{dock.model.require}", groups = {AddGroup.class, UpdateGroup.class})
|
||||
// @JsonProperty(required = true)
|
||||
@NotBlank(message = "{dock.model.require}", groups = {AddGroup.class, UpdateGroup.class})
|
||||
@JsonProperty(required = true)
|
||||
@Schema(description = "机库型号")
|
||||
private String dockModel;
|
||||
|
||||
|
|
@ -105,15 +102,4 @@ public class DockDTO implements Serializable {
|
|||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||
@Schema(description = "机库模式")
|
||||
private String dockMode;
|
||||
|
||||
@JsonIgnore
|
||||
@Schema(hidden = true)
|
||||
@AssertTrue(message = "机库型号不能为空", groups = {AddGroup.class, UpdateGroup.class})
|
||||
public boolean isDockModelValid() {
|
||||
if (!"DJI".equals(dockType)) {
|
||||
return StringUtils.isNotBlank(dockModel);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,4 @@ public interface MinioService {
|
|||
|
||||
//上传地图标注文件
|
||||
String uploadGeoMark(String dockSn, MultipartFile file);
|
||||
|
||||
//上传字典图片
|
||||
String uploadDictImage(MultipartFile file);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
|||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.multictrl.common.annotation.DataFilter;
|
||||
import com.multictrl.common.constant.BusinessConstant;
|
||||
import com.multictrl.common.constant.DJIImage;
|
||||
import com.multictrl.common.constant.DockMode;
|
||||
import com.multictrl.common.page.PageData;
|
||||
import com.multictrl.common.service.impl.CrudServiceImpl;
|
||||
|
|
@ -21,7 +18,6 @@ import com.multictrl.modules.business.entity.DockEntity;
|
|||
import com.multictrl.modules.business.service.DJIBaseService;
|
||||
import com.multictrl.modules.business.service.DockService;
|
||||
import com.multictrl.modules.security.service.ShiroService;
|
||||
import com.multictrl.modules.sys.service.SysDictDataService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -42,7 +38,6 @@ public class DockServiceImpl extends CrudServiceImpl<DockDao, DockEntity, DockDT
|
|||
private final DockDeviceDao dockDeviceDao;
|
||||
private final DeviceDicDao deviceDicDao;
|
||||
private final ShiroService shiroService;
|
||||
private final SysDictDataService sysDictDataService;
|
||||
|
||||
@Override
|
||||
public QueryWrapper<DockEntity> getWrapper(Map<String, Object> params) {
|
||||
|
|
@ -80,7 +75,6 @@ public class DockServiceImpl extends CrudServiceImpl<DockDao, DockEntity, DockDT
|
|||
}
|
||||
|
||||
@Override
|
||||
@DataFilter
|
||||
public PageData<DockDTO> pageList(Map<String, Object> params) {
|
||||
PageData<DockDTO> page = page(params);
|
||||
for (DockDTO dockDTO : page.getList()) {
|
||||
|
|
@ -100,10 +94,6 @@ public class DockServiceImpl extends CrudServiceImpl<DockDao, DockEntity, DockDT
|
|||
}
|
||||
}
|
||||
}
|
||||
String dockType = dockDTO.getDockType();
|
||||
if("DJI".equals(dockType)){
|
||||
// dockDTO.setImgUrl(BusinessConstant.IMAGE_PATH+ DJIImage.);
|
||||
}
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
|
@ -112,7 +102,7 @@ public class DockServiceImpl extends CrudServiceImpl<DockDao, DockEntity, DockDT
|
|||
public List<DockDTO> getUserDockList(Long userId) {
|
||||
List<Long> dataScopeList = shiroService.getDataScopeList(userId);
|
||||
List<DockEntity> list = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(dataScopeList)) {
|
||||
if(CollUtil.isNotEmpty(dataScopeList)){
|
||||
list = baseDao.selectList(new QueryWrapper<DockEntity>().in("dept_id", dataScopeList));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -197,20 +197,6 @@ public class MinioServiceImpl implements MinioService {
|
|||
return BusinessConstant.GEO_MARK_BUCKET + "/" + path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String uploadDictImage(MultipartFile file) {
|
||||
//文件路径
|
||||
String path = DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_COMPACT) + "." + FileNameUtil.extName(file.getOriginalFilename());
|
||||
try {
|
||||
uploadFile(file.getInputStream(), BusinessConstant.DICT_IMAGE_BUCKET, path);
|
||||
} catch (Exception e) {
|
||||
log.error(ExceptionUtils.getErrorStackTrace(e));
|
||||
throw new RenException(ErrorCode.OSS_UPLOAD_FILE_ERROR, file.getOriginalFilename());
|
||||
}
|
||||
|
||||
return BusinessConstant.DICT_IMAGE_BUCKET + "/" + path;
|
||||
}
|
||||
|
||||
private String getMimeType(String fileName) {
|
||||
if (fileName == null) return "application/octet-stream";
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import lombok.AllArgsConstructor;
|
|||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -33,8 +32,6 @@ import java.util.Map;
|
|||
@AllArgsConstructor
|
||||
public class SysDictDataController {
|
||||
private final SysDictDataService sysDictDataService;
|
||||
private final static String DOCK_TYPE = "dockType";
|
||||
private final static String DOCK_MODEL = "dockModel";
|
||||
|
||||
@GetMapping("page")
|
||||
@Operation(summary = "字典数据")
|
||||
|
|
@ -102,20 +99,4 @@ public class SysDictDataController {
|
|||
return new Result<Object>();
|
||||
}
|
||||
|
||||
@GetMapping("/getDockType")
|
||||
@Operation(summary = "获取机库类型")
|
||||
public Result<List<SysDictDataDTO>> getDockType() {
|
||||
List<SysDictDataDTO> list = sysDictDataService.getDictDataByType(DOCK_TYPE);
|
||||
|
||||
return new Result<List<SysDictDataDTO>>().ok(list);
|
||||
}
|
||||
|
||||
@GetMapping("/getDockModel")
|
||||
@Operation(summary = "获取机库型号")
|
||||
public Result<List<SysDictDataDTO>> getDockModel() {
|
||||
List<SysDictDataDTO> list = sysDictDataService.getDictDataByType(DOCK_MODEL);
|
||||
|
||||
return new Result<List<SysDictDataDTO>>().ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,42 +21,39 @@ import java.util.Date;
|
|||
* @author Sdy
|
||||
*/
|
||||
@Data
|
||||
@Schema(name = "字典数据")
|
||||
@Schema(title = "字典数据")
|
||||
public class SysDictDataDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "id")
|
||||
@Null(message = "{id.null}", groups = AddGroup.class)
|
||||
@NotNull(message = "{id.require}", groups = UpdateGroup.class)
|
||||
private Long id;
|
||||
@Schema(title = "id")
|
||||
@Null(message="{id.null}", groups = AddGroup.class)
|
||||
@NotNull(message="{id.require}", groups = UpdateGroup.class)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "字典类型ID")
|
||||
@NotNull(message = "{sysdict.type.require}", groups = DefaultGroup.class)
|
||||
private Long dictTypeId;
|
||||
@Schema(title = "字典类型ID")
|
||||
@NotNull(message="{sysdict.type.require}", groups = DefaultGroup.class)
|
||||
private Long dictTypeId;
|
||||
|
||||
@Schema(description = "字典标签")
|
||||
@NotBlank(message = "{sysdict.label.require}", groups = DefaultGroup.class)
|
||||
private String dictLabel;
|
||||
@Schema(title = "字典标签")
|
||||
@NotBlank(message="{sysdict.label.require}", groups = DefaultGroup.class)
|
||||
private String dictLabel;
|
||||
|
||||
@Schema(description = "字典值")
|
||||
private String dictValue;
|
||||
@Schema(title = "字典值")
|
||||
private String dictValue;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
@Schema(title = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class)
|
||||
private Integer sort;
|
||||
@Schema(title = "排序")
|
||||
@Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class)
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||
private Date createDate;
|
||||
@Schema(title = "创建时间")
|
||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||
private Date createDate;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||
private Date updateDate;
|
||||
|
||||
@Schema(description = "图片地址")
|
||||
private String imageUrl;
|
||||
@Schema(title = "更新时间")
|
||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||
private Date updateDate;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,43 +16,39 @@ import java.util.Date;
|
|||
* @author Sdy
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@TableName("sys_dict_data")
|
||||
public class SysDictDataEntity extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 字典类型ID
|
||||
*/
|
||||
private Long dictTypeId;
|
||||
/**
|
||||
* 字典标签
|
||||
*/
|
||||
private String dictLabel;
|
||||
/**
|
||||
* 字典值
|
||||
*/
|
||||
private String dictValue;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long updater;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateDate;
|
||||
/**
|
||||
* 图片地址
|
||||
*/
|
||||
private String imageUrl;
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 字典类型ID
|
||||
*/
|
||||
private Long dictTypeId;
|
||||
/**
|
||||
* 字典标签
|
||||
*/
|
||||
private String dictLabel;
|
||||
/**
|
||||
* 字典值
|
||||
*/
|
||||
private String dictValue;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long updater;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateDate;
|
||||
}
|
||||
|
|
@ -5,7 +5,6 @@ import com.multictrl.common.service.BaseService;
|
|||
import com.multictrl.modules.sys.dto.SysDictDataDTO;
|
||||
import com.multictrl.modules.sys.entity.SysDictDataEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -25,7 +24,4 @@ public interface SysDictDataService extends BaseService<SysDictDataEntity> {
|
|||
|
||||
void delete(Long[] ids);
|
||||
|
||||
//获取指定类型
|
||||
List<SysDictDataDTO> getDictDataByType(String type);
|
||||
|
||||
}
|
||||
|
|
@ -2,24 +2,18 @@ package com.multictrl.modules.sys.service.impl;
|
|||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.multictrl.common.constant.BusinessConstant;
|
||||
import com.multictrl.common.constant.DJIImage;
|
||||
import com.multictrl.common.page.PageData;
|
||||
import com.multictrl.common.service.impl.BaseServiceImpl;
|
||||
import com.multictrl.common.utils.ConvertUtils;
|
||||
import com.multictrl.modules.sys.dao.SysDictDataDao;
|
||||
import com.multictrl.modules.sys.dao.SysDictTypeDao;
|
||||
import com.multictrl.modules.sys.dto.SysDictDataDTO;
|
||||
import com.multictrl.modules.sys.entity.SysDictDataEntity;
|
||||
import com.multictrl.modules.sys.entity.SysDictTypeEntity;
|
||||
import com.multictrl.modules.sys.service.SysDictDataService;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -28,21 +22,19 @@ import java.util.Map;
|
|||
* @author Sdy
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class SysDictDataServiceImpl extends BaseServiceImpl<SysDictDataDao, SysDictDataEntity> implements SysDictDataService {
|
||||
private final SysDictTypeDao sysDictTypeDao;
|
||||
|
||||
@Override
|
||||
public PageData<SysDictDataDTO> page(Map<String, Object> params) {
|
||||
IPage<SysDictDataEntity> page = baseDao.selectPage(
|
||||
getPage(params, "sort", true),
|
||||
getWrapper(params)
|
||||
getPage(params, "sort", true),
|
||||
getWrapper(params)
|
||||
);
|
||||
|
||||
return getPageData(page, SysDictDataDTO.class);
|
||||
}
|
||||
|
||||
private QueryWrapper<SysDictDataEntity> getWrapper(Map<String, Object> params) {
|
||||
private QueryWrapper<SysDictDataEntity> getWrapper(Map<String, Object> params){
|
||||
Long dictTypeId = Long.parseLong((String) params.get("dictTypeId"));
|
||||
String dictLabel = (String) params.get("dictLabel");
|
||||
String dictValue = (String) params.get("dictValue");
|
||||
|
|
@ -85,27 +77,4 @@ public class SysDictDataServiceImpl extends BaseServiceImpl<SysDictDataDao, SysD
|
|||
deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDictDataDTO> getDictDataByType(String type) {
|
||||
SysDictTypeEntity typeEntity = sysDictTypeDao.selectOne(new QueryWrapper<SysDictTypeEntity>().eq("dict_type", type));
|
||||
if (typeEntity != null) {
|
||||
List<SysDictDataEntity> dataList = baseDao.selectList(new QueryWrapper<SysDictDataEntity>()
|
||||
.eq("dict_type_id", typeEntity.getId()).orderByAsc("sort"));
|
||||
for (SysDictDataEntity dictDataEntity : dataList) {
|
||||
String dictValue = dictDataEntity.getDictValue();
|
||||
if ("DJI".equals(dictValue)) {
|
||||
String imageUrl = DJIImage.getImageUrlByName("DJI");
|
||||
dictDataEntity.setImageUrl(BusinessConstant.IMAGE_PATH + imageUrl);
|
||||
} else {
|
||||
String imageUrl = dictDataEntity.getImageUrl();
|
||||
if (StrUtil.isNotBlank(imageUrl)) {
|
||||
dictDataEntity.setImageUrl(BusinessConstant.IMAGE_PATH + imageUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ConvertUtils.sourceToTarget(dataList, SysDictDataDTO.class);
|
||||
}
|
||||
|
||||
return List.of();
|
||||
}
|
||||
}
|
||||
|
|
@ -3,8 +3,6 @@ package com.multictrl.modules.sys.service.impl;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.multictrl.common.exception.ErrorCode;
|
||||
import com.multictrl.common.exception.RenException;
|
||||
import com.multictrl.common.page.PageData;
|
||||
import com.multictrl.common.service.impl.BaseServiceImpl;
|
||||
import com.multictrl.common.utils.ConvertUtils;
|
||||
|
|
@ -15,11 +13,11 @@ import com.multictrl.modules.sys.entity.DictData;
|
|||
import com.multictrl.modules.sys.entity.DictType;
|
||||
import com.multictrl.modules.sys.entity.SysDictTypeEntity;
|
||||
import com.multictrl.modules.sys.service.SysDictTypeService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -29,13 +27,9 @@ import java.util.Map;
|
|||
* @author Sdy
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SysDictTypeServiceImpl extends BaseServiceImpl<SysDictTypeDao, SysDictTypeEntity> implements SysDictTypeService {
|
||||
private final SysDictDataDao sysDictDataDao;
|
||||
private final static List<String> DICT_TYPE_LIST = new ArrayList<>() {{
|
||||
add("dockTyp");
|
||||
add("dockModel");
|
||||
}};
|
||||
|
||||
@Override
|
||||
public PageData<SysDictTypeDTO> page(Map<String, Object> params) {
|
||||
|
|
@ -76,10 +70,6 @@ public class SysDictTypeServiceImpl extends BaseServiceImpl<SysDictTypeDao, SysD
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(SysDictTypeDTO dto) {
|
||||
SysDictTypeEntity typeEntity = selectById(dto.getId());
|
||||
if (DICT_TYPE_LIST.contains(typeEntity.getDictType())) {
|
||||
dto.setDictType(typeEntity.getDictType());
|
||||
}
|
||||
SysDictTypeEntity entity = ConvertUtils.sourceToTarget(dto, SysDictTypeEntity.class);
|
||||
|
||||
updateById(entity);
|
||||
|
|
@ -88,21 +78,8 @@ public class SysDictTypeServiceImpl extends BaseServiceImpl<SysDictTypeDao, SysD
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long[] ids) {
|
||||
List<Long> idList = new ArrayList<>();
|
||||
for (Long id : ids) {
|
||||
SysDictTypeEntity typeEntity = selectById(id);
|
||||
if (typeEntity != null) {
|
||||
String dictType = typeEntity.getDictType();
|
||||
if (!DICT_TYPE_LIST.contains(dictType)) {
|
||||
idList.add(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (idList.isEmpty()) {
|
||||
throw new RenException(ErrorCode.DICT_NOT_DELETE, "[机库类型、机库型号]");
|
||||
}
|
||||
//删除
|
||||
deleteBatchIds(idList);
|
||||
deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -65,5 +65,4 @@ public interface ErrorCode {
|
|||
int SPEAKER_NAME_EXIST = 20024;
|
||||
int FILE_NOT_EXIST = 20025;
|
||||
int UAV_LIGHT_INDEX_NOT_EXIST = 20026;
|
||||
int DICT_NOT_DELETE = 20027;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,5 +53,4 @@
|
|||
20023=\u65E0\u4EBA\u673A\u672A\u6CE8\u518C\uFF0C\u8BF7\u98DE\u673A\u5F00\u673A\u540E\u8FDB\u884C\u673A\u573A\u91CD\u65B0\u6CE8\u518C
|
||||
20024=\u558A\u8BDD\u5668\u6A21\u7248\u540D\u79F0\u5DF2\u5B58\u5728
|
||||
20025={0}\u6587\u4EF6\u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5\u6587\u4EF6\u8DEF\u5F84\u662F\u5426\u6B63\u786E
|
||||
20026=\u98DE\u673A\u63A2\u7167\u706F\u8D1F\u8F7D\u4F4D\u7F6E\u672A\u83B7\u53D6\uFF0C\u8BF7\u68C0\u67E5\u98DE\u673A\u662F\u5426\u5F00\u673A
|
||||
20027={0}\u5B57\u5178\u7981\u6B62\u5220\u9664
|
||||
20026=\u98DE\u673A\u63A2\u7167\u706F\u8D1F\u8F7D\u4F4D\u7F6E\u672A\u83B7\u53D6\uFF0C\u8BF7\u68C0\u67E5\u98DE\u673A\u662F\u5426\u5F00\u673A
|
||||
|
|
@ -2116,14 +2116,4 @@ ON TABLE "public"."bus_geo_mark" IS '地图标注';
|
|||
ALTER TABLE public.bus_route
|
||||
ADD COLUMN q20_route_id varchar(50);
|
||||
COMMENT
|
||||
ON COLUMN "public"."bus_route"."q20_route_id" IS 'q20航线id';
|
||||
|
||||
--20260529
|
||||
INSERT INTO "public"."sys_dict_type" ("id", "dict_type", "dict_name", "remark", "sort", "creator", "create_date",
|
||||
"updater", "update_date")
|
||||
VALUES (2060252437705494529, 'dockType', '机库类型', '', 1, 1067246875800000001, '2026-05-29 14:50:33.446',
|
||||
1067246875800000001, '2026-05-29 14:50:33.446');
|
||||
INSERT INTO "public"."sys_dict_type" ("id", "dict_type", "dict_name", "remark", "sort", "creator", "create_date",
|
||||
"updater", "update_date")
|
||||
VALUES (2060253239434121218, 'dockModel', '机库型号', '', 2, 1067246875800000001, '2026-05-29 14:53:44.593',
|
||||
1067246875800000001, '2026-05-29 14:53:44.593');
|
||||
ON COLUMN "public"."bus_route"."q20_route_id" IS 'q20航线id';
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 634 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 528 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 451 KiB |
Loading…
Reference in New Issue