调整检测计划导入、导出功能
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package com.njcn.gather.system.cfg.pojo.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @data 2025-03-25
|
||||
*/
|
||||
@Getter
|
||||
public enum SceneEnum {
|
||||
/**
|
||||
* 省级平台
|
||||
*/
|
||||
PROVINCE_PLATFORM("0", "province_platform"),
|
||||
|
||||
/**
|
||||
* 设备出场
|
||||
*/
|
||||
LEAVE_FACTORY_TEST("1", "leave_factory_test"),
|
||||
|
||||
/**
|
||||
* 研发自测
|
||||
*/
|
||||
SELF_TEST("2", "self_test");
|
||||
|
||||
private String value;
|
||||
private String msg;
|
||||
|
||||
SceneEnum(String value, String msg) {
|
||||
this.value = value;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public static SceneEnum getSceneEnum(String value) {
|
||||
for (SceneEnum sceneEnum : SceneEnum.values()) {
|
||||
if (sceneEnum.getValue().equals(value)) {
|
||||
return sceneEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public class SysTestConfigServiceImpl extends ServiceImpl<SysTestConfigMapper, S
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean addTestConfig(String scene) {
|
||||
SysTestConfig sysTestConfig = new SysTestConfig();
|
||||
sysTestConfig.setAutoGenerate(1);
|
||||
@@ -46,7 +46,7 @@ public class SysTestConfigServiceImpl extends ServiceImpl<SysTestConfigMapper, S
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean updateTestConfig(SysTestConfigParam.UpdateParam param) {
|
||||
SysTestConfig sysTestConfig = new SysTestConfig();
|
||||
BeanUtils.copyProperties(param, sysTestConfig);
|
||||
|
||||
@@ -70,7 +70,7 @@ public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean addDictData(DictDataParam dictDataParam) {
|
||||
checkDicDataName(dictDataParam, false);
|
||||
DictData dictData = new DictData();
|
||||
@@ -82,7 +82,7 @@ public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> i
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean updateDictData(DictDataParam.UpdateParam updateParam) {
|
||||
checkDicDataName(updateParam, true);
|
||||
DictData dictData = new DictData();
|
||||
@@ -91,7 +91,7 @@ public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean deleteDictData(List<String> ids) {
|
||||
return this.lambdaUpdate()
|
||||
.set(DictData::getState, DataStateEnum.DELETED.getCode())
|
||||
@@ -154,7 +154,7 @@ public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public void exportDictData(DictDataParam.QueryParam queryParam) {
|
||||
QueryWrapper<DictData> queryWrapper = new QueryWrapper<>();
|
||||
if (ObjectUtil.isNotNull(queryParam)) {
|
||||
@@ -176,7 +176,7 @@ public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean deleteDictDataByDictTypeId(List<String> ids) {
|
||||
return this.lambdaUpdate().in(DictData::getTypeId, ids).set(DictData::getState, DataStateEnum.DELETED.getCode()).update();
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class DictPqServiceImpl extends ServiceImpl<DictPqMapper, DictPq> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean addDictPq(DictPqParam dictPqParam) {
|
||||
checkDicPqName(dictPqParam, false);
|
||||
DictPq dictPq = new DictPq();
|
||||
@@ -67,7 +67,7 @@ public class DictPqServiceImpl extends ServiceImpl<DictPqMapper, DictPq> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean updateDictPq(DictPqParam.UpdateParam updateParam) {
|
||||
checkDicPqName(updateParam, true);
|
||||
DictPq dictPq = new DictPq();
|
||||
@@ -76,7 +76,7 @@ public class DictPqServiceImpl extends ServiceImpl<DictPqMapper, DictPq> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean deleteDictPq(List<String> ids) {
|
||||
dictDataService.deleteDictDataByDictTypeId(ids);
|
||||
return this.lambdaUpdate()
|
||||
|
||||
@@ -67,7 +67,7 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean addDictTree(DictTreeParam dictTreeParam) {
|
||||
checkRepeat(dictTreeParam, false);
|
||||
boolean result;
|
||||
@@ -90,7 +90,7 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean updateDictTree(DictTreeParam.UpdateParam param) {
|
||||
DictTree dictTree = this.getById(param.getId());
|
||||
if("975f63baeb6f653c54fca226a9ae36ca".equals(param.getId()) || dictTree.getPids().contains("975f63baeb6f653c54fca226a9ae36ca")){
|
||||
@@ -106,7 +106,7 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean deleteDictTree(String id) {
|
||||
boolean result = false;
|
||||
DictTree dictTree = this.getById(id);
|
||||
|
||||
@@ -55,7 +55,7 @@ public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictType> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean addDictType(DictTypeParam dictTypeParam) {
|
||||
checkDicTypeName(dictTypeParam, false);
|
||||
DictType dictType = new DictType();
|
||||
@@ -66,7 +66,7 @@ public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictType> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean updateDictType(DictTypeParam.UpdateParam updateParam) {
|
||||
checkDicTypeName(updateParam, true);
|
||||
DictType dictType = new DictType();
|
||||
@@ -75,7 +75,7 @@ public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictType> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean deleteDictType(List<String> ids) {
|
||||
dictDataService.deleteDictDataByDictTypeId(ids);
|
||||
return this.lambdaUpdate()
|
||||
|
||||
@@ -93,7 +93,7 @@ public class SysRegResServiceImpl extends ServiceImpl<SysRegResMapper, SysRegRes
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean addRegRes(SysRegResParam sysRegResParam) {
|
||||
List<SysRegRes> regResList = new ArrayList<>();
|
||||
|
||||
@@ -155,7 +155,7 @@ public class SysRegResServiceImpl extends ServiceImpl<SysRegResMapper, SysRegRes
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
@Transactional
|
||||
public boolean updateRegRes(SysRegResParam.UpdateParam param) {
|
||||
SysRegRes sysRegRes = new SysRegRes();
|
||||
BeanUtil.copyProperties(param, sysRegRes);
|
||||
|
||||
Reference in New Issue
Block a user