切换mysql为达梦数据库-代码审查
1.systemboot模块
This commit is contained in:
4
pom.xml
4
pom.xml
@@ -54,8 +54,8 @@
|
||||
<nacos.password>nacos</nacos.password>
|
||||
<!--服务器发布内容为空-->
|
||||
<!-- <nacos.namespace></nacos.namespace>-->
|
||||
<!-- <nacos.namespace>1dd11af6-e668-41fd-a663-02a05705304d</nacos.namespace>-->
|
||||
<nacos.namespace>fd74182b-1fce-4dba-afa7-2623b0376205</nacos.namespace>
|
||||
<nacos.namespace>30c701c4-2a94-49d9-82e1-76aa9456573f</nacos.namespace>
|
||||
<!-- <nacos.namespace>fd74182b-1fce-4dba-afa7-2623b0376205</nacos.namespace>-->
|
||||
<!-- <nacos.namespace>910d0d69-2254-481b-b9f7-7ecf9cb881b0</nacos.namespace>-->
|
||||
<!-- sentinel:port-->
|
||||
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
||||
|
||||
@@ -17,4 +17,9 @@ public interface BizParamConstant {
|
||||
String STAT_BIZ_WEEK = "4";
|
||||
String STAT_BIZ_DAY = "5";
|
||||
|
||||
|
||||
/**
|
||||
* 顶级父ID
|
||||
*/
|
||||
String PARENT_ID = "0";
|
||||
}
|
||||
|
||||
@@ -83,6 +83,11 @@ public interface PatternRegex {
|
||||
*/
|
||||
String DIC_REGEX = "^[\\w\\u4E00-\\u9FA5()()_/、/, /,\\- ]+\\.?[\\w\\u4E00-\\u9FA5()()I II III IV V /]{0,125}$";
|
||||
|
||||
/**
|
||||
* 中文正则
|
||||
*/
|
||||
String CHINESE_REGEX = "^[\\u4e00-\\u9fa5]+$";
|
||||
|
||||
/**
|
||||
* 密码有效期(月)1-3月
|
||||
*/
|
||||
|
||||
@@ -21,9 +21,7 @@ public interface ServerInfo {
|
||||
String REPORT = "report-boot";
|
||||
String SYSTEM = "system-boot";
|
||||
String ENERGY = "energy-boot";
|
||||
String JOB_ADMIN = "job-admin";
|
||||
String USER = "user-boot";
|
||||
String JOB = "job-admin";
|
||||
String QUALITY = "quality-boot";
|
||||
String PROCESS = "process-boot";
|
||||
String PREPARE_BOOT = "prepare-boot";
|
||||
|
||||
@@ -134,10 +134,6 @@ public class FileStorageUtil {
|
||||
/**
|
||||
* 上传InputStream流,并指定文件的名称
|
||||
* @author xuyang
|
||||
* @param inputStream
|
||||
* @param dir
|
||||
* @param fileName
|
||||
* @return
|
||||
*/
|
||||
public String uploadStreamSpecifyName(InputStream inputStream, String dir, String fileName) {
|
||||
String filePath;
|
||||
@@ -243,26 +239,6 @@ public class FileStorageUtil {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下载文件流
|
||||
*
|
||||
* @param filePath
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public InputStream downloadStream(String filePath) {
|
||||
InputStream inputStream;
|
||||
try {
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
inputStream = obsUtil.downloadStream(filePath);
|
||||
} else {
|
||||
inputStream = minIoUtils.downloadStream(minIossProperties.getBucket(), filePath);
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
throw new BusinessException(OssResponseEnum.DOWNLOAD_FILE_STREAM_ERROR);
|
||||
}
|
||||
return inputStream;
|
||||
}
|
||||
|
||||
/***
|
||||
* 根据文件路径删除指定文件对象
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: zbj
|
||||
* @date: 2023/04/10
|
||||
*/
|
||||
@Data
|
||||
public class DataScaleVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 月份
|
||||
*/
|
||||
@ApiModelProperty("月份")
|
||||
private String timeId;
|
||||
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
@ApiModelProperty("数据")
|
||||
private Float dataStatis;
|
||||
|
||||
}
|
||||
@@ -428,8 +428,8 @@ public class TransientServiceImpl implements TransientService {
|
||||
datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT;
|
||||
System.out.println("波形路径-------------------" + cfgPath);
|
||||
|
||||
cfgStream = fileStorageUtil.downloadStream(cfgPath);
|
||||
datStream = fileStorageUtil.downloadStream(datPath);
|
||||
cfgStream = fileStorageUtil.getFileStream(cfgPath);
|
||||
datStream = fileStorageUtil.getFileStream(datPath);
|
||||
|
||||
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||
|
||||
@@ -17,7 +17,6 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.njcn.system.pojo.constant.DicDataConstant.NAME_KEY;
|
||||
import static com.njcn.system.pojo.constant.DicDataConstant.SPLIT_SIGN;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.prepare.harmonic.service.mysql.Impl.area;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
@@ -24,7 +25,6 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.njcn.system.pojo.constant.DicDataConstant.NAME_KEY;
|
||||
import static com.njcn.system.pojo.constant.DicDataConstant.SPLIT_SIGN;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -54,17 +54,13 @@ public class PmsMonitorPOServiceImpl extends ServiceImpl<PmsMonitorPOMapper, Mon
|
||||
*/
|
||||
@Override
|
||||
public List<Monitor> qurymeasurementRunPoints(String orgid) {
|
||||
|
||||
LambdaQueryWrapper<Monitor> monitorPOLambdaQueryWrapper = new LambdaQueryWrapper ( );
|
||||
/*获取当前部门及子部门*/
|
||||
List<String> deptIds = deptFeignClient.getDepSonSelfCodetByDeptId(orgid).getData();
|
||||
|
||||
monitorPOLambdaQueryWrapper.in (Monitor::getOrgId, deptIds);
|
||||
// List<DictData> data = dicDataFeignClient.getDicDataByTypeCode (DicDataTypeEnum.LINE_STATE.getCode ( )).getData ( );
|
||||
// List<DictData> collect = data.stream ( ).filter (temp -> Objects.equals (temp.getCode ( ), DicDataEnum.RUN.getCode ())).collect (Collectors.toList ( ));
|
||||
String state = redisUtil.getStringByKey (NAME_KEY+
|
||||
SPLIT_SIGN+ DicDataTypeEnum.LINE_STATE.getCode ( )+
|
||||
SPLIT_SIGN+ DicDataEnum.RUN.getCode ( ));
|
||||
StrUtil.DASHED + DicDataTypeEnum.LINE_STATE.getCode ( )+
|
||||
StrUtil.DASHED+ DicDataEnum.RUN.getCode ( ));
|
||||
if(StringUtils.isEmpty (state)){
|
||||
throw new BusinessException (PqsPrepareExceptionEnum.REDIS_NULL_EXCEPTION);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.prepare.harmonic.service.mysql.Impl.area;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
@@ -39,7 +40,6 @@ import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.njcn.system.pojo.constant.DicDataConstant.NAME_KEY;
|
||||
import static com.njcn.system.pojo.constant.DicDataConstant.SPLIT_SIGN;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
@@ -122,8 +122,8 @@ public class PrimaryGridDataServiceImpl implements PrimaryGridDataService {
|
||||
/*获取终端下的监测点集合*/
|
||||
QueryWrapper<Monitor> queryWrapper = new QueryWrapper<>();
|
||||
String state = redisUtil.getStringByKey(NAME_KEY +
|
||||
SPLIT_SIGN + DicDataTypeEnum.LINE_STATE.getCode() +
|
||||
SPLIT_SIGN + DicDataEnum.RUN.getCode());
|
||||
StrUtil.DASHED + DicDataTypeEnum.LINE_STATE.getCode() +
|
||||
StrUtil.DASHED + DicDataEnum.RUN.getCode());
|
||||
if (StringUtils.isEmpty(state)) {
|
||||
throw new BusinessException(PqsPrepareExceptionEnum.REDIS_NULL_EXCEPTION);
|
||||
}
|
||||
@@ -375,8 +375,8 @@ public class PrimaryGridDataServiceImpl implements PrimaryGridDataService {
|
||||
|
||||
/*在运监测终端个数 online_measurement_count*/
|
||||
String state = redisUtil.getStringByKey(NAME_KEY +
|
||||
SPLIT_SIGN + DicDataTypeEnum.DEV_STATUS.getCode() +
|
||||
SPLIT_SIGN + DicDataEnum.RUNNING.getCode());
|
||||
StrUtil.DASHED + DicDataTypeEnum.DEV_STATUS.getCode() +
|
||||
StrUtil.DASHED + DicDataEnum.RUNNING.getCode());
|
||||
Integer online_measurement_count = Integer.valueOf(pmsTerminalPOS.stream().filter(temp -> Objects.equals(temp.getTerminalState(), state)).count() + "");
|
||||
|
||||
/*主网单位数据完整率 data_integrity_rate*/
|
||||
|
||||
@@ -109,7 +109,7 @@ public class SupvProblemServiceImpl extends ServiceImpl<SupvProblemMapper, SupvP
|
||||
LambdaQueryWrapper<SupvFile> fileLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
fileLambdaQueryWrapper.in(SupvFile::getBusiId, problemIds);
|
||||
List<SupvFile> supvFileList = supvFileMapper.selectList(fileLambdaQueryWrapper);
|
||||
supvFileList.forEach(item-> fileStorageUtil.downloadStream(item.getFileUrl()));
|
||||
supvFileList.forEach(item-> fileStorageUtil.getFileStream(item.getFileUrl()));
|
||||
supvFileMapper.delete(fileLambdaQueryWrapper);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -863,7 +863,7 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
|
||||
PmsMonitorParam pmsMonitorParam = new PmsMonitorParam();
|
||||
pmsMonitorParam.setMonitorIds(Collections.singletonList(runLog.getLineIndex()));
|
||||
HttpResult<List<PmsMonitorDTO>> monitorInfoListByCond = monitorClient.getMonitorInfoListByCond(pmsMonitorParam);
|
||||
InputStream inputStream = fileStorageUtil.downloadStream(entry.getValue());
|
||||
InputStream inputStream = fileStorageUtil.getFileStream(entry.getValue());
|
||||
// 对于每一个要被存放到压缩包的文件,都必须调用ZipOutputStream对象的putNextEntry()方法,确保压缩包里面文件不同名
|
||||
zos.putNextEntry(new ZipEntry(monitorInfoListByCond.getData().get(0).getName() + ticketTypeEnum.getMessage() + entry.getValue().substring(entry.getValue().lastIndexOf("."))));
|
||||
int bytesRead = 0;
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.njcn.system.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/1/10
|
||||
* A00500~A00520 行政区域枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum AreaEnum {
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.njcn.system.enums;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: chenchao
|
||||
* @date: 2022/07/15 16:21
|
||||
*/
|
||||
@Getter
|
||||
public enum AuditLogEnum {
|
||||
|
||||
/**
|
||||
* 审计日志模块异常响应码
|
||||
*/
|
||||
NOT_FIND_FILE("A0300", "文件未备份或者备份文件为空,请先备份文件"),
|
||||
LOG_EXCEPTION("A0301", "导入旧日志文件异常"),
|
||||
LOG_EXCEPTIONTIME("A0302", "导入旧日志文件异常:缺少时间范围"),
|
||||
DELETE_DATA("A0303", "导入旧日志文件异常:删除数据失败"),
|
||||
MULTIPLE_CLICKS_LOGFILEWRITER("A0304", "当前文件备份数据未结束,请勿多次点击"),
|
||||
MULTIPLE_CLICKS_RECOVERLOGFILE("A0303", "当前文件恢复数据未结束,请勿多次点击")
|
||||
;
|
||||
|
||||
|
||||
private final String code;
|
||||
|
||||
private final String message;
|
||||
|
||||
AuditLogEnum(String code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -51,7 +51,17 @@ public enum SystemResponseEnum {
|
||||
* 定时任务执行类不存在
|
||||
*/
|
||||
TIMER_NOT_EXISTED("A00361", "定时任务执行类不存在"),
|
||||
EXE_EMPTY_PARAM("A00361", "请检查定时器的id,定时器cron表达式,定时任务是否为空!")
|
||||
EXE_EMPTY_PARAM("A00361", "请检查定时器的id,定时器cron表达式,定时任务是否为空!"),
|
||||
|
||||
/**
|
||||
* 审计日志模块异常响应
|
||||
*/
|
||||
NOT_FIND_FILE("A0300", "文件未备份或者备份文件为空,请先备份文件"),
|
||||
LOG_EXCEPTION("A0301", "导入旧日志文件异常"),
|
||||
LOG_EXCEPTION_TIME("A0302", "导入旧日志文件异常:缺少时间范围"),
|
||||
DELETE_DATA("A0303", "导入旧日志文件异常:删除数据失败"),
|
||||
MULTIPLE_CLICKS_LOG_FILE_WRITER("A0304", "当前文件备份数据未结束,请勿多次点击"),
|
||||
MULTIPLE_CLICKS_RECOVER_LOG_FILE("A0303", "当前文件恢复数据未结束,请勿多次点击")
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.njcn.system.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author hany
|
||||
* @date 2022/09/21
|
||||
*/
|
||||
|
||||
public interface TemplateTreeEnum {
|
||||
|
||||
/**
|
||||
* 权限资源状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
int DELETE = 0;
|
||||
|
||||
int ENABLE = 1;
|
||||
|
||||
/**
|
||||
* 顶层父类的pid
|
||||
*/
|
||||
String FATHER_PID = "0";
|
||||
}
|
||||
@@ -15,6 +15,5 @@ public interface DicDataConstant {
|
||||
|
||||
|
||||
String NAME_KEY = "DicCache:";
|
||||
String SPLIT_SIGN = "-";
|
||||
|
||||
}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.njcn.system.pojo.param;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class MxGraphParam {
|
||||
|
||||
@ApiModelProperty(name = "title",value = "组态标题",required = true)
|
||||
@NotBlank(message = "组态标题不可为空")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(name = "mxContent",value = "组态内容",required = true)
|
||||
@NotBlank(message = "内容不可为空")
|
||||
private String mxContent;
|
||||
|
||||
@ApiModelProperty(name = "bgImage",value = "组态背景图")
|
||||
private String bgImage;
|
||||
|
||||
@ApiModelProperty(name = "sort",value = "排序",required = true)
|
||||
@NotNull(message = "排序不可为空")
|
||||
private Integer sort;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.njcn.system.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
* 组态表
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_mxgraph")
|
||||
public class MxGraph extends BaseEntity {
|
||||
private String id;
|
||||
|
||||
private String title;
|
||||
|
||||
private String mxContent;
|
||||
|
||||
private String bgImage;
|
||||
|
||||
private Integer sort;
|
||||
|
||||
private Integer state;
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.njcn.system.component;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.service.IDictDataService;
|
||||
@@ -16,7 +17,6 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.njcn.system.pojo.constant.DicDataConstant.NAME_KEY;
|
||||
import static com.njcn.system.pojo.constant.DicDataConstant.SPLIT_SIGN;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
@@ -29,49 +29,43 @@ import static com.njcn.system.pojo.constant.DicDataConstant.SPLIT_SIGN;
|
||||
public class DictCacheRedis {
|
||||
|
||||
|
||||
|
||||
private @Autowired
|
||||
IDictDataService dictDataService;
|
||||
|
||||
private @Autowired
|
||||
RedisUtil redisUtil;
|
||||
|
||||
private @Autowired
|
||||
RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
@PostConstruct
|
||||
public void init(){
|
||||
public void init() {
|
||||
log.info("系统启动中。。。加载dictDataMap");
|
||||
/*todo 后续将字典表全部加载*/
|
||||
List<DictData> data = dictDataService.getDicDataByTypeCode (DicDataTypeEnum.LINE_STATE.getCode ( ));
|
||||
List<DictData> data2 = dictDataService.getDicDataByTypeCode (DicDataTypeEnum.DEV_STATUS.getCode ( ));
|
||||
List<DictData> data3 = dictDataService.getDicDataByTypeCode (DicDataTypeEnum.LINE_SORT.getCode ( ));
|
||||
List<DicDataTypeEnum> dicDataTypeEnums = CollectionUtil.newArrayList(
|
||||
DicDataTypeEnum.LINE_STATE,
|
||||
DicDataTypeEnum.DEV_STATUS,
|
||||
DicDataTypeEnum.LINE_SORT);
|
||||
|
||||
for (DicDataTypeEnum dicDataTypeEnum : dicDataTypeEnums) {
|
||||
List<DictData> data = dictDataService.getDicDataByTypeCode(dicDataTypeEnum.getCode());
|
||||
/*
|
||||
* key:NAME_KEY前缀(清缓存使用)+SPLIT_SIGN(拼接符号)+DicDataTypeEnum+SPLIT_SIGN(拼接符号)+Code
|
||||
* Value:id
|
||||
* */
|
||||
data.forEach (temp->{
|
||||
redisUtil.saveByKey (NAME_KEY+ SPLIT_SIGN+DicDataTypeEnum.LINE_STATE.getCode ( )+SPLIT_SIGN+temp.getCode (),temp.getId ());
|
||||
data.forEach(temp -> {
|
||||
redisUtil.saveByKey(NAME_KEY + StrUtil.DASHED + dicDataTypeEnum.getCode() + StrUtil.DASHED + temp.getCode(), temp.getId());
|
||||
});
|
||||
|
||||
data2.forEach (temp->{
|
||||
redisUtil.saveByKey (NAME_KEY+SPLIT_SIGN+DicDataTypeEnum.DEV_STATUS.getCode ( )+SPLIT_SIGN+temp.getCode (),temp.getId ());
|
||||
});
|
||||
|
||||
data3.forEach (temp->{
|
||||
redisUtil.saveByKey (NAME_KEY+SPLIT_SIGN+DicDataTypeEnum.LINE_SORT.getCode ( )+SPLIT_SIGN+temp.getCode (),temp.getId ());
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
public void destroy(){
|
||||
public void destroy() {
|
||||
log.info("系统运行结束");
|
||||
Set<String> keys = redisTemplate.keys(NAME_KEY + "*");
|
||||
|
||||
if (keys != null) {
|
||||
redisTemplate.delete(keys);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.system.pojo.dto.AreaTreeDTO;
|
||||
import com.njcn.system.pojo.param.AreaParam;
|
||||
import com.njcn.system.pojo.po.Area;
|
||||
@@ -41,8 +40,6 @@ public class AreaController extends BaseController {
|
||||
|
||||
private final IAreaService areaService;
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
|
||||
/**
|
||||
* 分页查询行政区域
|
||||
*/
|
||||
@@ -169,7 +166,7 @@ public class AreaController extends BaseController {
|
||||
String methodDescribe = getMethodDescribe("selectPid");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, ids);
|
||||
List<Area> result = areaService.selectPid(ids);
|
||||
if (result.size() > 0) {
|
||||
if (!result.isEmpty()) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.DELETE_PID_EXIST, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.DELETE_PID_UNEXIST, null, methodDescribe);
|
||||
@@ -202,7 +199,7 @@ public class AreaController extends BaseController {
|
||||
@PostMapping("/areaDeptTree")
|
||||
@ApiOperation("获取新增部门区域树")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "区域id", required = false),
|
||||
@ApiImplicitParam(name = "id", value = "区域id"),
|
||||
@ApiImplicitParam(name = "type", value = "区域类型", required = true)
|
||||
})
|
||||
public HttpResult<List<AreaTreeDTO>> areaDeptTree(@RequestParam(required = false) @ApiParam("id") String id, @RequestParam("type") Integer type) {
|
||||
@@ -220,7 +217,7 @@ public class AreaController extends BaseController {
|
||||
@PostMapping("/areaPro")
|
||||
@ApiOperation("根据区域id获取省份")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "区域id", required = false),
|
||||
@ApiImplicitParam(name = "id", value = "区域id"),
|
||||
@ApiImplicitParam(name = "type", value = "区域类型", required = true)
|
||||
})
|
||||
public HttpResult<Area> areaPro(@RequestParam(required = false) @ApiParam("id") String id, @RequestParam("type") Integer type) {
|
||||
@@ -264,7 +261,7 @@ public class AreaController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/areaDeptPro")
|
||||
@ApiOperation("根据区域id获取省份")
|
||||
@ApiImplicitParam(name = "id", value = "部门id", required = false)
|
||||
@ApiImplicitParam(name = "id", value = "部门id")
|
||||
public HttpResult<Area> areaDeptPro(@RequestParam(required = false) @ApiParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("areaDeptTree");
|
||||
Area result = areaService.areaDeptPro(id);
|
||||
@@ -272,9 +269,9 @@ public class AreaController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 获取省市区下拉框
|
||||
* @author: clam
|
||||
* @Date: 2023/4/11
|
||||
* @description 获取省市区下拉框
|
||||
* @author clam
|
||||
* @date 2023/4/11
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/areaSelect")
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.util.List;
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: chenchao
|
||||
* @date: 2022/07/11 19:00
|
||||
* @date 2022/07/11 19:00
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@@ -57,7 +57,7 @@ public class AuditController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/logFileWriter")
|
||||
@ApiOperation("日志文件备份")
|
||||
public HttpResult logFileWriter(){
|
||||
public HttpResult<Object> logFileWriter(){
|
||||
String methodDescribe = getMethodDescribe("logFileWriter");
|
||||
auditService.logFileWriter();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,null,methodDescribe);
|
||||
@@ -66,7 +66,7 @@ public class AuditController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/recoverLogFile")
|
||||
@ApiOperation("日志文件恢复")
|
||||
public HttpResult recoverLogFile() {
|
||||
public HttpResult<Object> recoverLogFile() {
|
||||
String methodDescribe = getMethodDescribe("recoverLogFile");
|
||||
auditService.recoverLogFile();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,null,methodDescribe);
|
||||
@@ -85,7 +85,7 @@ public class AuditController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/clearHistoryLog")
|
||||
@ApiOperation("清空历史日志")
|
||||
public HttpResult clearHistoryLog() {
|
||||
public HttpResult<Object> clearHistoryLog() {
|
||||
String methodDescribe = getMethodDescribe("clearHistoryLog");
|
||||
auditService.clearHistoryLog();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
@@ -93,7 +93,6 @@ public class AuditController extends BaseController {
|
||||
|
||||
/**
|
||||
* 这个接口有毒,千万被调用
|
||||
* @return
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/saveLogParam")
|
||||
|
||||
@@ -143,7 +143,7 @@ public class ConfigController extends BaseController {
|
||||
@PostMapping("/addSysConfig")
|
||||
@ApiOperation("新增系统配置")
|
||||
@ApiImplicitParam(name = "configParam", value = "新增配置实体", required = true)
|
||||
public HttpResult addSysConfig(@RequestBody @Validated ConfigParam configParam) {
|
||||
public HttpResult<Object> addSysConfig(@RequestBody @Validated ConfigParam configParam) {
|
||||
String methodDescribe = getMethodDescribe("addSysConfig");
|
||||
LogUtil.njcnDebug(log, "{}", methodDescribe, configParam);
|
||||
boolean res = iConfigService.addSysConfig(configParam);
|
||||
@@ -159,7 +159,7 @@ public class ConfigController extends BaseController {
|
||||
@PostMapping("/updateSysConfig")
|
||||
@ApiOperation("修改系统配置")
|
||||
@ApiImplicitParam(name = "configUpdateParam", value = "更新配置实体", required = true)
|
||||
public HttpResult updateSysConfig(@RequestBody @Validated ConfigParam.ConfigUpdateParam configUpdateParam) {
|
||||
public HttpResult<Object> updateSysConfig(@RequestBody @Validated ConfigParam.ConfigUpdateParam configUpdateParam) {
|
||||
String methodDescribe = getMethodDescribe("updateSysConfig");
|
||||
LogUtil.njcnDebug(log, "{}", methodDescribe, configUpdateParam);
|
||||
boolean res = iConfigService.updateSysConfig(configUpdateParam);
|
||||
@@ -175,7 +175,7 @@ public class ConfigController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/系统扩容操作")
|
||||
@ApiOperation("系统扩容操作")
|
||||
public HttpResult addMemory(@RequestParam("size")Integer sizeInMB) {
|
||||
public HttpResult<Object> addMemory(@RequestParam("size")Integer sizeInMB) {
|
||||
String methodDescribe = getMethodDescribe("addMemory");
|
||||
|
||||
try {
|
||||
@@ -188,7 +188,8 @@ public class ConfigController extends BaseController {
|
||||
// 为了确保JVM不会优化掉这个内存分配(因为它可能认为这个变量未使用),
|
||||
// 我们可以对数组进行简单的操作,比如填充数据
|
||||
for (int i = 0; i < memory.length; i++) {
|
||||
memory[i] = (byte) (i % 256); // 简单的数据填充
|
||||
// 简单的数据填充
|
||||
memory[i] = (byte) (i % 256);
|
||||
}
|
||||
|
||||
// 实际上,你可能不需要对数组进行填充,因为仅仅是分配就足以占用内存。
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
@@ -16,17 +15,13 @@ import com.njcn.system.service.CsStatisticalSetPOService;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
||||
@@ -86,7 +86,7 @@ public class DeptMapController extends BaseController {
|
||||
@PostMapping("/addDeptMapConfig")
|
||||
@ApiOperation("新增地图与部门关联配置")
|
||||
@ApiImplicitParam(name = "deptConfigParam", value = "新增配置实体", required = true)
|
||||
public HttpResult addDeptMapConfig(@RequestBody @Validated DeptConfigParam deptConfigParam) {
|
||||
public HttpResult<Object> addDeptMapConfig(@RequestBody @Validated DeptConfigParam deptConfigParam) {
|
||||
String methodDescribe = getMethodDescribe("addDeptMapConfig");
|
||||
LogUtil.njcnDebug(log, "{}", methodDescribe, deptConfigParam);
|
||||
boolean res = deptMapService.addDeptMapConfig(deptConfigParam);
|
||||
@@ -101,7 +101,7 @@ public class DeptMapController extends BaseController {
|
||||
@PostMapping("/updateDeptMapConfigById")
|
||||
@ApiOperation("修改地图与部门关联配置")
|
||||
@ApiImplicitParam(name = "deptConfigUpdateParam", value = "修改配置实体", required = true)
|
||||
public HttpResult updateDeptMapConfigById(@RequestBody @Validated DeptConfigParam.DeptConfigUpdateParam deptConfigUpdateParam) {
|
||||
public HttpResult<Object> updateDeptMapConfigById(@RequestBody @Validated DeptConfigParam.DeptConfigUpdateParam deptConfigUpdateParam) {
|
||||
String methodDescribe = getMethodDescribe("updateDeptMapConfigById");
|
||||
LogUtil.njcnDebug(log, "{}", methodDescribe, deptConfigUpdateParam);
|
||||
boolean res = deptMapService.updateDeptMapConfigById(deptConfigUpdateParam);
|
||||
@@ -116,7 +116,7 @@ public class DeptMapController extends BaseController {
|
||||
@GetMapping("/removeDeptMapConfigById")
|
||||
@ApiOperation("根据id删除地图与部门关联配置")
|
||||
@ApiImplicitParam(name = "id", value = "参数id", required = true)
|
||||
public HttpResult removeDeptMapConfigById(@RequestParam("id") String id) {
|
||||
public HttpResult<Object> removeDeptMapConfigById(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("removeDeptMapConfigById");
|
||||
LogUtil.njcnDebug(log, "{}", methodDescribe, id);
|
||||
boolean res = deptMapService.removeDeptMapConfigById(id);
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.param.DictDataParam;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.DictType;
|
||||
import com.njcn.system.pojo.vo.DictDataVO;
|
||||
import com.njcn.system.service.IDictDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -27,7 +26,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
@@ -10,24 +8,18 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.param.DictDataParam;
|
||||
import com.njcn.system.pojo.param.DictTreeParam;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||
import com.njcn.system.pojo.vo.DictDataVO;
|
||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||
import com.njcn.system.service.IDictDataService;
|
||||
import com.njcn.system.service.SysDicTreePOService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -49,21 +41,6 @@ public class DictTreeController extends BaseController {
|
||||
|
||||
private final SysDicTreePOService sysDicTreePOService;
|
||||
|
||||
/**
|
||||
* 分页查询字典类型数据
|
||||
*/
|
||||
// @OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
// @PostMapping("/list")
|
||||
// @ApiOperation("查询字典数据")
|
||||
// @ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
// public HttpResult<Page<DictDataVO>> list(@RequestBody @Validated DictDataParam.DictDataQueryParam queryParam) {
|
||||
// String methodDescribe = getMethodDescribe("list");
|
||||
// LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, queryParam);
|
||||
// Page<DictDataVO> result = dictDataService.listDictData(queryParam);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
// }
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增字典树数据")
|
||||
@@ -83,8 +60,7 @@ public class DictTreeController extends BaseController {
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param dicParam
|
||||
* @return
|
||||
* @param dicParam 修改参数
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PutMapping("/update")
|
||||
@@ -103,8 +79,7 @@ public class DictTreeController extends BaseController {
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
* @return
|
||||
* @param id id
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||
@DeleteMapping("/delete")
|
||||
@@ -121,7 +96,7 @@ public class DictTreeController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/query")
|
||||
@ApiOperation("根据pid查询字典树")
|
||||
public HttpResult<List<DictTreeVO>> query(@RequestParam("pid") String pid) {
|
||||
@@ -142,7 +117,7 @@ public class DictTreeController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/queryByCode")
|
||||
@ApiOperation("根据Code查询字典树")
|
||||
public HttpResult<DictTreeVO> queryByCode(@RequestParam("code") String code) {
|
||||
@@ -152,18 +127,18 @@ public class DictTreeController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
|
||||
}
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/queryByid")
|
||||
@ApiOperation("根据id查询字典树最底层")
|
||||
public HttpResult<List<DictTreeVO>> queryByid(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("queryByid");
|
||||
public HttpResult<List<DictTreeVO>> queryLastLevelById(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("queryLastLevelById");
|
||||
LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, id);
|
||||
List<DictTreeVO> result = sysDicTreePOService.queryByid(id);
|
||||
List<DictTreeVO> result = sysDicTreePOService.queryLastLevelById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/queryById")
|
||||
@ApiOperation("根据id查询数据")
|
||||
public HttpResult<SysDicTreePO> queryById(@RequestParam("id") String id) {
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.dto.SimpleTreeDTO;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
|
||||
@@ -141,7 +141,6 @@ public class EleEpdPqdController extends BaseController {
|
||||
EleEpdPqd eleEpdPqd = eleEpdPqdService.selectById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqd, methodDescribe);
|
||||
}
|
||||
/*查询指标库,按datatype分类*/
|
||||
@PostMapping("/selectAll")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("查询指标库,按datatype分类")
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.param.EleEpdPqdParam;
|
||||
import com.njcn.system.pojo.param.EleEvtParam;
|
||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||
import com.njcn.system.pojo.po.EleEvtParm;
|
||||
@@ -38,7 +37,7 @@ import java.util.List;
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "事件字典录入")
|
||||
@Validated
|
||||
public class EleEvtParmController extends BaseController {
|
||||
public class EleEvtParamController extends BaseController {
|
||||
|
||||
private final IEleEvtParmService eleEvtParmService;
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "波形字典录入")
|
||||
@Validated
|
||||
public class EleWaveParmController extends BaseController {
|
||||
public class EleWaveParamController extends BaseController {
|
||||
|
||||
private final IEleWaveParmService waveParamService;
|
||||
|
||||
@@ -39,8 +39,7 @@ public class EventDictController extends BaseController {
|
||||
|
||||
/**
|
||||
* 新增字典
|
||||
* @param eventDictParam
|
||||
* @return
|
||||
* @param eventDictParam 参数
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/addDict")
|
||||
@@ -59,8 +58,7 @@ public class EventDictController extends BaseController {
|
||||
|
||||
/**
|
||||
* 修改字典
|
||||
* @param dictUpdateParam
|
||||
* @return
|
||||
* @param dictUpdateParam 参数
|
||||
*/
|
||||
@PutMapping("/updateDict")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@@ -79,8 +77,7 @@ public class EventDictController extends BaseController {
|
||||
|
||||
/**
|
||||
* 删除字典
|
||||
* @param id
|
||||
* @return
|
||||
* @param id id
|
||||
*/
|
||||
@DeleteMapping("/deleteDict")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@@ -99,8 +96,7 @@ public class EventDictController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询字典列表
|
||||
* @param dictQueryParam
|
||||
* @return
|
||||
* @param dictQueryParam 参数
|
||||
*/
|
||||
@PostMapping("/getList")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@@ -115,8 +111,7 @@ public class EventDictController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询字典列表_新
|
||||
* @param dictQueryParam
|
||||
* @return
|
||||
* @param dictQueryParam 参数
|
||||
*/
|
||||
@PostMapping("/getReportDictList")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@@ -130,8 +125,7 @@ public class EventDictController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询字典
|
||||
* @param id
|
||||
* @return
|
||||
* @param id id
|
||||
*/
|
||||
@PostMapping("/getDictById")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@@ -148,9 +142,6 @@ public class EventDictController extends BaseController {
|
||||
|
||||
/**
|
||||
* 字典树
|
||||
* @param
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperateInfo
|
||||
@PostMapping("/DictTree")
|
||||
|
||||
@@ -46,7 +46,6 @@ public class EventTemplateController extends BaseController{
|
||||
* 查询所有模板
|
||||
* @author hany
|
||||
* @date 2022/09/09
|
||||
* @return
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getList")
|
||||
@@ -139,8 +138,7 @@ public class EventTemplateController extends BaseController{
|
||||
|
||||
/**
|
||||
* 根据模板id查询关系
|
||||
* @param ids
|
||||
* @return
|
||||
* @param ids id集合
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/selectRelevance")
|
||||
@@ -161,17 +159,16 @@ public class EventTemplateController extends BaseController{
|
||||
|
||||
/**
|
||||
* 根据模板id查询关系
|
||||
* @param id
|
||||
* @return
|
||||
* @param id id
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/selectReleation")
|
||||
@ApiOperation("根据模板id查询关系")
|
||||
@ApiImplicitParam(name = "id", value = "角色索引", required = true)
|
||||
public HttpResult<List<EventReportDictVO>> selectReleation(@RequestParam @Validated String id) {
|
||||
String methodDescribe = getMethodDescribe("selectReleation");
|
||||
public HttpResult<List<EventReportDictVO>> selectRelation(@RequestParam @Validated String id) {
|
||||
String methodDescribe = getMethodDescribe("selectRelation");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, id);
|
||||
List<EventReportDictVO> res = iEventTemplateService.selectReleation(id);
|
||||
List<EventReportDictVO> res = iEventTemplateService.selectRelation(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@@ -32,8 +32,7 @@ public class EventTreeController extends BaseController {
|
||||
|
||||
/**
|
||||
* 根据模板id查询绑定的树节点
|
||||
* @param idList
|
||||
* @return
|
||||
* @param idList id集合
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@PostMapping("/selectEventTree")
|
||||
@@ -52,8 +51,7 @@ public class EventTreeController extends BaseController {
|
||||
|
||||
/**
|
||||
* 为模板分配字典节点
|
||||
* @param templateRelevancy
|
||||
* @return
|
||||
* @param templateRelevancy 模板信息
|
||||
*/
|
||||
@OperateInfo(operateType = OperateType.UPDATE)
|
||||
@PostMapping("/assignTemplate")
|
||||
|
||||
@@ -29,65 +29,16 @@ import java.io.*;
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/image")
|
||||
public class ImageToStreamController extends BaseController {
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
|
||||
/**
|
||||
* 数据规模
|
||||
* 下载图片
|
||||
*/
|
||||
@GetMapping("/toStream")
|
||||
@ApiImplicitParam(name = "bgImage", value = "图片路径", required = true)
|
||||
public void toStream(@RequestParam("bgImage") String bgImage,HttpServletResponse response) {
|
||||
|
||||
byte[] buffer = new byte[1024];
|
||||
FileInputStream fis = null;
|
||||
BufferedInputStream bis = null;
|
||||
try {
|
||||
//获取部分参数,用于从minIO上将文件下载到tmp(此步骤不是必须)
|
||||
InputStream fileStream = fileStorageUtil.getFileStream(bgImage);
|
||||
//获取文件格式
|
||||
String format = bgImage.substring(bgImage.lastIndexOf('.') + 1);
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("content-type", "image/"+getFileFormat(format));
|
||||
response.setHeader("Content-Disposition", "inline;fileName=download" +System.currentTimeMillis() + "");// 设置文件名
|
||||
//返回流处理
|
||||
bis = new BufferedInputStream(fileStream);
|
||||
OutputStream os = response.getOutputStream();
|
||||
int i = bis.read(buffer);
|
||||
while (i != -1) {
|
||||
os.write(buffer, 0, i);
|
||||
i = bis.read(buffer);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
|
||||
}finally {
|
||||
if (bis != null) {
|
||||
try {
|
||||
bis.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
if (fis != null) {
|
||||
try {
|
||||
fis.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
fileStorageUtil.downloadStream(response, bgImage);
|
||||
}
|
||||
|
||||
private String getFileFormat(String format){
|
||||
switch (format) {
|
||||
case "png":
|
||||
return "png";
|
||||
case "svg":
|
||||
return "svg+xml";
|
||||
case "jpg":
|
||||
return "jpeg";
|
||||
case "gif":
|
||||
return "gif";
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return format;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.param.LargeScreenParam;
|
||||
import com.njcn.device.pq.pojo.vo.DataScaleVO;
|
||||
import com.njcn.system.service.LargeScreenService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: zbj
|
||||
* @date: 2023/04/10
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "大屏")
|
||||
@RestController
|
||||
@RequestMapping("/largeScreen")
|
||||
@RequiredArgsConstructor
|
||||
public class LargeScreenController extends BaseController {
|
||||
|
||||
private final LargeScreenService largeScreenService;
|
||||
|
||||
/**
|
||||
* 数据规模
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getDataScale")
|
||||
@ApiOperation("数据规模")
|
||||
@ApiImplicitParam(name = "largeScreenParam", value = "数据规模", required = true)
|
||||
public HttpResult<List<DataScaleVO>> getDataScale(@RequestBody @Validated LargeScreenParam largeScreenParam) {
|
||||
String methodDescribe = getMethodDescribe("getDataScale");
|
||||
List<DataScaleVO> result = largeScreenService.getDataScale(largeScreenParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.param.MxGraphParam;
|
||||
import com.njcn.system.pojo.po.MxGraph;
|
||||
import com.njcn.system.service.IMxGraphService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
* 组态管理
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
@RestController
|
||||
@Slf4j
|
||||
@Api(tags = "组态管理")
|
||||
@RequestMapping("/king")
|
||||
@AllArgsConstructor
|
||||
public class MxGraphController extends BaseController {
|
||||
|
||||
private final IMxGraphService iMxGraphService;
|
||||
|
||||
/**
|
||||
* 新增组态
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_MEDIUM)
|
||||
@PostMapping("/addKingView")
|
||||
@ApiOperation("新增组态")
|
||||
@ApiImplicitParam(name = "mxGraphParam", value = "组件实体", required = true)
|
||||
HttpResult addKingView(@RequestBody @Validated MxGraphParam mxGraphParam){
|
||||
String methodDescribe = getMethodDescribe("addKingView");
|
||||
boolean result = iMxGraphService.addKingView(mxGraphParam);
|
||||
LogUtil.njcnDebug(log, "{},组态实体:{}", methodDescribe, mxGraphParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_MEDIUM)
|
||||
@GetMapping("/getKingViewList")
|
||||
@ApiOperation("查询组态")
|
||||
HttpResult<Object> getKingViewList(){
|
||||
String methodDescribe = getMethodDescribe("getKingViewList");
|
||||
List<MxGraph> result = iMxGraphService.getKingViewList();
|
||||
if (CollectionUtil.isNotEmpty(result)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_MEDIUM)
|
||||
@GetMapping("/getKingViewById")
|
||||
@ApiOperation("查询组态")
|
||||
HttpResult<Object> getKingViewById(@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("getKingViewById");
|
||||
MxGraph result = iMxGraphService.getKingViewById(id);
|
||||
if (Objects.nonNull(result)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
|
||||
@@ -8,17 +8,14 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.system.pojo.po.Resinformation;
|
||||
import com.njcn.system.service.IResourceAdministrationService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -46,7 +43,7 @@ public class ResourceAdministrationController extends BaseController {
|
||||
@ApiParam(value = "资源名称", required = true) String name,
|
||||
@ApiParam(value = "资源类型", required = true) String type,
|
||||
@ApiParam(value = "资源描述", required = true) String description,
|
||||
@ApiParam(value = "系统类型Guid", required = false) String systemType) {
|
||||
@ApiParam(value = "系统类型Guid") String systemType) {
|
||||
String methodDescribe = getMethodDescribe("uploadFile");
|
||||
Boolean flag = iResourceAdministrationService.uploadFile(multipartFile, name, type, description, systemType);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
@@ -71,12 +68,12 @@ public class ResourceAdministrationController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateFile")
|
||||
@ApiOperation("修改资源")
|
||||
public HttpResult<Boolean> updateFile(@ApiParam(value = "文件", required = false) MultipartFile multipartFile,
|
||||
public HttpResult<Boolean> updateFile(@ApiParam(value = "文件") MultipartFile multipartFile,
|
||||
@ApiParam(value = "id", required = true) String id,
|
||||
@ApiParam(value = "资源名称", required = true) String name,
|
||||
@ApiParam(value = "资源类型", required = true) String type,
|
||||
@ApiParam(value = "资源描述", required = true) String description,
|
||||
@ApiParam(value = "系统类型Guid", required = false) String systemType) {
|
||||
@ApiParam(value = "系统类型Guid") String systemType) {
|
||||
String methodDescribe = getMethodDescribe("updateFile");
|
||||
Boolean flag = iResourceAdministrationService.updateFile(multipartFile, id, name, type, description, systemType);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
@@ -108,15 +105,4 @@ public class ResourceAdministrationController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "下载成功", methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
/*@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/exportData")
|
||||
@ApiOperation("导出数据")
|
||||
public HttpResult<Object> exportData() {
|
||||
String methodDescribe = getMethodDescribe("exportData");
|
||||
iResourceAdministrationService.exportData();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "成功", methodDescribe);
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -8,14 +8,12 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.param.DictDataParam;
|
||||
import com.njcn.system.pojo.po.RocketmqMsgErrorLog;
|
||||
import com.njcn.system.service.IRocketmqMsgErrorLogService;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@@ -14,18 +14,13 @@ import com.njcn.system.service.IThemeService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
||||
@@ -55,7 +55,7 @@ public class UserLogController extends BaseController {
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("插入审计日志")
|
||||
@ApiImplicitParam(name = "logInfoDTO", value = "插入日志参数", required = true)
|
||||
public HttpResult addUserLog(@RequestBody LogInfoDTO logInfoDTO) {
|
||||
public HttpResult<Object> addUserLog(@RequestBody LogInfoDTO logInfoDTO) {
|
||||
String methodDescribe = getMethodDescribe("addUserLog");
|
||||
userLogService.addUserLog(logInfoDTO);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
package com.njcn.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.system.pojo.dto.AreaTreeDTO;
|
||||
import com.njcn.system.pojo.po.Area;
|
||||
import com.njcn.system.pojo.vo.AreaTreeVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -48,13 +45,6 @@ public interface AreaMapper extends BaseMapper<Area> {
|
||||
*/
|
||||
List<Area> selectPid(@Param("ids")List<String> ids,@Param("state")Integer state);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ids id
|
||||
* @param state 状态
|
||||
* @return 返回的结果
|
||||
*/
|
||||
List<String> getPid(@Param("ids")List<String> ids,@Param("state")Integer state);
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.njcn.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.system.pojo.po.CsStatisticalSetPO;
|
||||
|
||||
|
||||
@@ -25,6 +25,6 @@ public interface DeptMapMapper extends BaseMapper<DeptMap> {
|
||||
/**
|
||||
* 查询部门名称返回集合
|
||||
*/
|
||||
List<Dept> selectDeptListName(@Param("deptIndexes") List<String> deptIndexes);
|
||||
List<Dept> selectDeptListName(@Param("deptIndexList") List<String> deptIndexList);
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.system.pojo.po.EventTemplate;
|
||||
import com.njcn.system.pojo.vo.EventTemplateVO;
|
||||
import com.njcn.user.pojo.vo.RoleVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -18,16 +17,11 @@ public interface EventTemplateMapper extends BaseMapper<EventTemplate> {
|
||||
|
||||
/**
|
||||
* 分页查询模板数据
|
||||
* @param page
|
||||
* @param queryWrapper
|
||||
* @return
|
||||
*/
|
||||
Page<EventTemplateVO> page(@Param("page")Page<EventTemplateVO> page, @Param("ew") QueryWrapper<EventTemplateVO> queryWrapper);
|
||||
|
||||
/**
|
||||
* 删除模板和字典关系
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteRelevancy(@Param("ids")List<String> ids);
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.njcn.system.mapper;
|
||||
|
||||
|
||||
import com.njcn.device.pq.pojo.param.LargeScreenParam;
|
||||
import com.njcn.device.pq.pojo.vo.DataScaleVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: zbj
|
||||
* @date: 2023/04/10
|
||||
*/
|
||||
public interface LargeScreenMapper {
|
||||
|
||||
List<DataScaleVO> getDataScale (LargeScreenParam largeScreenParam);
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.njcn.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.system.pojo.po.MxGraph;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
public interface MxGraphMapper extends BaseMapper<MxGraph> {
|
||||
}
|
||||
@@ -15,5 +15,4 @@ import java.util.List;
|
||||
*/
|
||||
@Mapper
|
||||
public interface ResourceAdministrationMapper extends BaseMapper<Resinformation> {
|
||||
List<ResinformationParam> listAll();
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ import java.util.List;
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface SysDicTreePOMapper extends BaseMapper<SysDicTreePO> {
|
||||
List<DictTreeVO> queryByid(@Param("id") String id);
|
||||
List<DictTreeVO> queryLastLevelById(@Param("id") String id);
|
||||
}
|
||||
@@ -16,8 +16,7 @@ public interface TemplateRelMapper extends BaseMapper<TemplateRel> {
|
||||
|
||||
/**
|
||||
* 根据模板id查询绑定关系
|
||||
* @param ids
|
||||
* @return
|
||||
* @param ids ID集合
|
||||
*/
|
||||
List<TemplateRel> selectRelevance (@Param("ids") List<String> ids);
|
||||
|
||||
|
||||
@@ -21,21 +21,19 @@ public interface UserLogMapper extends BatchBaseMapper<UserLog> {
|
||||
|
||||
/**
|
||||
* 日志批量插入
|
||||
* @param userLogs
|
||||
* @param userLogs 日志集合
|
||||
*/
|
||||
void insertBatch(@Param("list") List<UserLogExcel> userLogs);
|
||||
|
||||
/**
|
||||
* 根据id查询数据库是否存在
|
||||
* @param idList
|
||||
* @return
|
||||
* @param idList ID集合
|
||||
*/
|
||||
List<String> ids(@Param("ids")List<String> idList);
|
||||
|
||||
/**
|
||||
* 查询表空间大小
|
||||
* @param schema
|
||||
* @return
|
||||
*/
|
||||
Float getMemoInfo(@Param("schema") String schema);
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
sys_config sys_config
|
||||
LEFT JOIN sys_user sys_usera ON sys_config.create_by = sys_usera.id
|
||||
LEFT JOIN sys_user sys_userb ON sys_config.update_by = sys_userb.id
|
||||
|
||||
ORDER BY
|
||||
sys_config.create_time DESC
|
||||
</select>
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
</select>
|
||||
|
||||
<select id="selectDeptListName" resultType="Dept">
|
||||
SELECT `Id` deptId, `Name` deptName
|
||||
SELECT Id deptId, Name deptName
|
||||
FROM sys_dept
|
||||
WHERE State = 1 AND Id IN
|
||||
<foreach item="item" collection="deptIndexes" open="(" separator="," close=")">
|
||||
<foreach item="item" collection="deptIndexList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
@@ -75,13 +75,14 @@
|
||||
and sys_dict_data.state = 1
|
||||
order by sort
|
||||
</select>
|
||||
|
||||
<select id="getDicDataByCodeAndType" resultType="com.njcn.system.pojo.po.DictData">
|
||||
SELECT sys_dict_data.*
|
||||
FROM sys_dict_data sys_dict_data
|
||||
LEFT JOIN sys_dict_type sdt ON sdt.Id = sys_dict_data.Type_Id
|
||||
WHERE sys_dict_data.code = #{dicCode}
|
||||
and sys_dict_data.state = 1
|
||||
and sdt.`code`= #{typeCode}
|
||||
and sdt.code= #{typeCode}
|
||||
order by sys_dict_data.sort
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
ele_epd_pqd.Other_Name otherName,
|
||||
ele_epd_pqd.Show_Name showName,
|
||||
ele_epd_pqd.Sort,
|
||||
ele_epd_pqd.`Type` ,
|
||||
ele_epd_pqd.Type ,
|
||||
ele_epd_pqd.Phase ,
|
||||
ele_epd_pqd.Unit ,
|
||||
case when ele_epd_pqd.Harm_Start = 1 then 0.5 else ele_epd_pqd.Harm_Start end harmStart,
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.system.mapper.LargeScreenMapper">
|
||||
|
||||
<select id="getDataScale" resultType="com.njcn.device.pq.pojo.vo.DataScaleVO">
|
||||
SELECT DATE(pd.TIMEID) as "timeId", round(sum(DATASTATIS),2) as "dataStatis"
|
||||
FROM pqs_datastatis pd
|
||||
<where>
|
||||
<if test="searchBeginTime != null and searchBeginTime != ''">
|
||||
and date_format(pd.TIMEID,'%y%m%d') >= date_format(#{searchBeginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="searchEndTime != null and searchEndTime != ''">
|
||||
and date_format(pd.TIMEID,'%y%m%d') <= date_format(#{searchEndTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY DATE(pd.TIMEID);
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -2,9 +2,4 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.system.mapper.ResourceAdministrationMapper">
|
||||
|
||||
<select id="listAll" resultType="com.njcn.system.pojo.po.ResinformationParam">
|
||||
SELECT pr.`NAME` "name", sdd.`Name` "type", pr.DESCRIPTION "description", pr.UPDATETIME "time"
|
||||
FROM pqs_resinformation pr
|
||||
left join sys_dict_data sdd on sdd.Id = pr.TYPE
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -1,29 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.system.mapper.SysDicTreePOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.system.pojo.po.SysDicTreePO">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table sys_dic_tree-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="pid" jdbcType="VARCHAR" property="pid" />
|
||||
<result column="pids" jdbcType="LONGVARCHAR" property="pids" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="code" jdbcType="VARCHAR" property="code" />
|
||||
<result column="sort" jdbcType="INTEGER" property="sort" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="status" jdbcType="TINYINT" property="status" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, pid, pids, `name`, code, sort, remark, `status`, create_time, create_by, update_time,
|
||||
update_by
|
||||
</sql>
|
||||
|
||||
<select id="queryByid" resultType="com.njcn.system.pojo.vo.DictTreeVO">
|
||||
<select id="queryLastLevelById" resultType="com.njcn.system.pojo.vo.DictTreeVO">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
@@ -37,6 +15,5 @@
|
||||
sys_dic_tree b
|
||||
WHERE
|
||||
b.pids LIKE concat('%',#{id},'%') and a.id = b.pid)
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -25,6 +25,7 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectReleation" resultType="java.lang.String">
|
||||
SELECT
|
||||
rd.Name
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
public interface AuditService extends IService<UserLog> {
|
||||
/**
|
||||
* 分页获取审计日志列表
|
||||
* @param auditParam
|
||||
* @param auditParam 查询参数
|
||||
*/
|
||||
Page<AuditLogVO> getAuditLog(AuditParam auditParam);
|
||||
|
||||
@@ -42,7 +42,7 @@ public interface AuditService extends IService<UserLog> {
|
||||
|
||||
/**
|
||||
* 分页获取审计日志统计列表
|
||||
* @param auditParam
|
||||
* @param auditParam 查询参数
|
||||
*/
|
||||
Page<AuditLogCusVO> censusAuditLog(AuditParam auditParam);
|
||||
|
||||
@@ -58,7 +58,7 @@ public interface AuditService extends IService<UserLog> {
|
||||
|
||||
/**
|
||||
* 获取表空间大小
|
||||
* @return
|
||||
* @return Float
|
||||
*/
|
||||
Float getMemoInfo();
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.njcn.system.pojo.vo.CsStatisticalSetVO;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/6/9 16:17【需求编号】
|
||||
*
|
||||
|
||||
@@ -104,10 +104,9 @@ public interface IAreaService extends IService<Area> {
|
||||
* @return 行政区域详情
|
||||
*/
|
||||
Area selectAreaByName(String name);
|
||||
|
||||
/**
|
||||
* @Description: areaSelect
|
||||
* @Param: []
|
||||
* @return: java.util.List<com.njcn.system.pojo.vo.AreaTreeVO>
|
||||
* @Author: clam
|
||||
* @Date: 2023/4/11
|
||||
*/
|
||||
|
||||
@@ -18,14 +18,12 @@ public interface IConfigService extends IService<Config> {
|
||||
|
||||
/**
|
||||
* 新增系统配置
|
||||
* @param configParam
|
||||
* @return
|
||||
* @param configParam 配置参数
|
||||
*/
|
||||
boolean addSysConfig(ConfigParam configParam);
|
||||
/**
|
||||
* 修改系统配置
|
||||
* @param configUpdateParam
|
||||
* @return
|
||||
* @param configUpdateParam 配置参数
|
||||
*/
|
||||
boolean updateSysConfig(ConfigParam.ConfigUpdateParam configUpdateParam);
|
||||
|
||||
|
||||
@@ -2,13 +2,9 @@ package com.njcn.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.system.pojo.param.DictDataParam;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.DictType;
|
||||
import com.njcn.system.pojo.vo.DictDataVO;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.njcn.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.dto.SimpleTreeDTO;
|
||||
import com.njcn.system.pojo.param.DictTypeParam;
|
||||
import com.njcn.system.pojo.po.DictType;
|
||||
|
||||
@@ -29,56 +29,52 @@ public interface IEleEpdPqdService extends IService<EleEpdPqd> {
|
||||
|
||||
/**
|
||||
* 存储模板的字典数据
|
||||
* @param eleEpdPqdParam
|
||||
* @param eleEpdPqdParam 参数
|
||||
*/
|
||||
void saveData(List<EleEpdPqdParam> eleEpdPqdParam);
|
||||
|
||||
/**
|
||||
* 存储字典数据
|
||||
* @param eleEpdPqdParam
|
||||
* @param eleEpdPqdParam 参数
|
||||
*/
|
||||
EleEpdPqd add(EleEpdPqdParam eleEpdPqdParam);
|
||||
|
||||
/**
|
||||
* 删除字典数据
|
||||
* @param id
|
||||
* @param id id
|
||||
*/
|
||||
void delete(String id);
|
||||
|
||||
/**
|
||||
* 更新字典数据
|
||||
* @param updateParam
|
||||
* @param updateParam 参数
|
||||
*/
|
||||
void update(EleEpdPqdParam.EleEpdPqdUpdateParam updateParam);
|
||||
|
||||
/**
|
||||
* 查询字典分页
|
||||
* @param queryParam
|
||||
* @return
|
||||
* @param queryParam 参数
|
||||
*/
|
||||
Page<EleEpdPqdVO> eleEpdPqdList(EleEpdPqdParam.EleEpdPqdQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 查询所有字典数据组成唯一标识,用于验证字典是否重复
|
||||
* @return
|
||||
*/
|
||||
List<EleEpdPqd> dictMarkByDataType(String dataType);
|
||||
|
||||
/**
|
||||
* 存储事件的字典数据
|
||||
* @param eleEpdPqdParam
|
||||
* @param eleEpdPqdParam 参数
|
||||
*/
|
||||
Map<String,String> saveEvt(List<EleEpdPqdParam> eleEpdPqdParam);
|
||||
|
||||
/**
|
||||
* 存储事件的字典数据
|
||||
* @param id
|
||||
* @param id id
|
||||
*/
|
||||
EleEpdPqd selectById(String id);
|
||||
/**
|
||||
* @Description: 查询指标库,按datatype分类
|
||||
* @Param:
|
||||
* @return: java.util.List<com.njcn.system.pojo.vo.EleEpdPqdListVO>
|
||||
* @Author: clam
|
||||
* @Date: 2023/6/12
|
||||
*/
|
||||
@@ -86,31 +82,27 @@ public interface IEleEpdPqdService extends IService<EleEpdPqd> {
|
||||
|
||||
/**
|
||||
* 根据集合查询字典数据
|
||||
* @param ids
|
||||
* @return
|
||||
* @param ids id集合
|
||||
*/
|
||||
List<EleEpdPqd> selectByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 校验字典是否存在
|
||||
* @param name
|
||||
* @param dataType
|
||||
* @return
|
||||
* @param name 名称
|
||||
* @param dataType 数据类型
|
||||
*/
|
||||
List<EleEpdPqd> judgeExist(String name, String dataType);
|
||||
|
||||
/**
|
||||
* 根据条件查询字典数据
|
||||
* @param name
|
||||
* @param dataType
|
||||
* @param phase
|
||||
* @return
|
||||
* @param name 名称
|
||||
* @param dataType 数据类型
|
||||
* @param phase 相别
|
||||
*/
|
||||
EleEpdPqd findByParam(String name, String dataType, String phase);
|
||||
|
||||
/**
|
||||
* 查询指标和influxDB表关系
|
||||
* @return
|
||||
*/
|
||||
List<EpdDTO> findAll();
|
||||
|
||||
|
||||
@@ -14,29 +14,25 @@ import java.util.List;
|
||||
public interface IEventDictService {
|
||||
/**
|
||||
* 新增字典
|
||||
* @param eventDictParam
|
||||
* @return
|
||||
* @param eventDictParam 参数
|
||||
*/
|
||||
boolean addDict(EventDictParam eventDictParam);
|
||||
|
||||
/**
|
||||
* 修改字典
|
||||
* @param dictUpdateParam
|
||||
* @return
|
||||
* @param dictUpdateParam 参数
|
||||
*/
|
||||
boolean updateDict(EventDictParam.DictUpdateParam dictUpdateParam);
|
||||
|
||||
/**
|
||||
* 删除字典
|
||||
* @param id
|
||||
* @return
|
||||
* @param id id
|
||||
*/
|
||||
boolean delete(String id);
|
||||
|
||||
/**
|
||||
* 查询字典列表
|
||||
* @param dictQueryParam
|
||||
* @return
|
||||
* @param dictQueryParam 参数
|
||||
*/
|
||||
Page<ReportDict> getList(EventDictParam.DictQueryParam dictQueryParam);
|
||||
|
||||
@@ -44,15 +40,13 @@ public interface IEventDictService {
|
||||
|
||||
/**
|
||||
* 查询字典
|
||||
* @param id
|
||||
* @return
|
||||
* @param id id
|
||||
*/
|
||||
ReportDict getDictById(String id);
|
||||
|
||||
/**
|
||||
* 获取字典树
|
||||
* @return
|
||||
* @param type
|
||||
* @param type 类型
|
||||
*/
|
||||
List<EventReportDictVO> getDictTree(String type);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public interface IEventTemplateService extends IService<EventTemplate> {
|
||||
|
||||
/**
|
||||
* 修改模板
|
||||
* @param eventDataUpdateParam
|
||||
* @param eventDataUpdateParam 参数
|
||||
*/
|
||||
boolean update(EventTemplateParam.EventTemplateUpdateParam eventDataUpdateParam);
|
||||
|
||||
@@ -48,10 +48,9 @@ public interface IEventTemplateService extends IService<EventTemplate> {
|
||||
|
||||
/**
|
||||
* 根据模板id查询关系
|
||||
* @param ids
|
||||
* @return
|
||||
* @param ids id集合
|
||||
*/
|
||||
Boolean selectRelevance(List<String> ids);
|
||||
|
||||
List<EventReportDictVO> selectReleation (String id);
|
||||
List<EventReportDictVO> selectRelation (String id);
|
||||
}
|
||||
|
||||
@@ -22,8 +22,7 @@ public interface IEventTreeService extends IService<TemplateRel> {
|
||||
|
||||
/**
|
||||
* 分配节点数据
|
||||
* @param templateRelevancy
|
||||
* @return
|
||||
* @param templateRelevancy 模板数据
|
||||
*/
|
||||
boolean updateTemplate(EventTemplateParam.TemplateRelevancy templateRelevancy);
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.njcn.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.system.pojo.param.MxGraphParam;
|
||||
import com.njcn.system.pojo.po.MxGraph;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
public interface IMxGraphService extends IService<MxGraph> {
|
||||
|
||||
/**
|
||||
* 新增组态
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
boolean addKingView(MxGraphParam mxGraphParam);
|
||||
|
||||
/**
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
List<MxGraph> getKingViewList();
|
||||
|
||||
|
||||
MxGraph getKingViewById(String id);
|
||||
}
|
||||
@@ -28,5 +28,4 @@ public interface IResourceAdministrationService extends IService<Resinformation>
|
||||
|
||||
void downloadFile(String id,HttpServletResponse response) throws IOException;
|
||||
|
||||
void exportData();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.njcn.system.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.system.pojo.param.ThemeParam;
|
||||
import com.njcn.system.pojo.po.Theme;
|
||||
import com.sun.org.apache.xpath.internal.operations.Bool;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -20,9 +18,8 @@ public interface IThemeService extends IService<Theme> {
|
||||
|
||||
/**
|
||||
* 功能描述: 新增主题
|
||||
* TODO
|
||||
*
|
||||
* @param themeParam
|
||||
* @param themeParam 新增參數
|
||||
* @return java.lang.Boolean
|
||||
* @author xy
|
||||
* @date 2022/1/12 14:13
|
||||
@@ -31,9 +28,8 @@ public interface IThemeService extends IService<Theme> {
|
||||
|
||||
/**
|
||||
* 功能描述: 修改主题
|
||||
* TODO
|
||||
*
|
||||
* @param themeParam
|
||||
* @param themeParam 修改參數
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/13 11:30
|
||||
@@ -42,9 +38,6 @@ public interface IThemeService extends IService<Theme> {
|
||||
|
||||
/**
|
||||
* 功能描述: 获取所有主题
|
||||
* TODO
|
||||
*
|
||||
* @param
|
||||
* @return java.util.List<com.njcn.system.pojo.po.Theme>
|
||||
* @author xy
|
||||
* @date 2022/1/12 15:38
|
||||
@@ -53,9 +46,7 @@ public interface IThemeService extends IService<Theme> {
|
||||
|
||||
/**
|
||||
* 功能描述: 获取当前主题
|
||||
* TODO
|
||||
*
|
||||
* @param
|
||||
* @return com.njcn.system.pojo.po.Theme
|
||||
* @author xy
|
||||
* @date 2022/1/12 15:39
|
||||
@@ -64,9 +55,8 @@ public interface IThemeService extends IService<Theme> {
|
||||
|
||||
/**
|
||||
* 功能描述: 删除主题
|
||||
* TODO
|
||||
*
|
||||
* @param id
|
||||
* @param id 主题id
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/12 16:48
|
||||
@@ -77,7 +67,7 @@ public interface IThemeService extends IService<Theme> {
|
||||
* 功能描述: 激活主题
|
||||
* TODO
|
||||
*
|
||||
* @param id
|
||||
* @param id 主题id
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/12 16:48
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.njcn.system.service;
|
||||
|
||||
import com.njcn.device.pq.pojo.param.LargeScreenParam;
|
||||
import com.njcn.device.pq.pojo.vo.DataScaleVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: zbj
|
||||
* @date: 2023/04/10
|
||||
*/
|
||||
public interface LargeScreenService {
|
||||
|
||||
List<DataScaleVO> getDataScale(LargeScreenParam largeScreenParam);
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.njcn.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.system.pojo.param.ReportTemplateParam;
|
||||
import com.njcn.system.pojo.po.ReportTemplate;
|
||||
|
||||
|
||||
@@ -27,13 +27,12 @@ public interface SysDicTreePOService extends IService<SysDicTreePO> {
|
||||
|
||||
DictTreeVO queryByCode(String code);
|
||||
|
||||
List<DictTreeVO> queryByid(String id);
|
||||
List<DictTreeVO> queryLastLevelById(String id);
|
||||
|
||||
/**
|
||||
* 根据id查询字典数据
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
* @param id id
|
||||
*/
|
||||
SysDicTreePO queryById(String id);
|
||||
|
||||
@@ -57,8 +56,7 @@ public interface SysDicTreePOService extends IService<SysDicTreePO> {
|
||||
|
||||
/**
|
||||
* 根据code查询自动树
|
||||
* @param code
|
||||
* @return
|
||||
* @param code code
|
||||
*/
|
||||
List<SysDicTreePO> queryByCodeList(String code);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
@@ -77,47 +78,41 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
|
||||
|
||||
@Override
|
||||
public List<AreaTreeVO> areaTree(String id, Integer type) {
|
||||
List<AreaTreeVO> areaTreeVOList = new ArrayList<>();
|
||||
if (id.equals("") || id == null) {
|
||||
/**
|
||||
List<AreaTreeVO> areaTreeVOList;
|
||||
if (StrUtil.isBlank(id)) {
|
||||
/*
|
||||
* 用于首次访问区域。此处需要获取当前用户所绑定的部门下的行政区域id
|
||||
* 现在默认为0
|
||||
*/
|
||||
id = deptFeignClient.getAreaIdByDeptId(RequestUtil.getDeptIndex()).getData();
|
||||
}
|
||||
List<AreaTreeVO> areaTreeVOS = new ArrayList<>();
|
||||
List<AreaTreeVO> areaTreeVOS;
|
||||
if (type == 1) {
|
||||
areaTreeVOList = this.baseMapper.getAreaIdTree(type, DataStateEnum.ENABLE.getCode());
|
||||
List<AreaTreeVO> finalAreaTreeVOList = areaTreeVOList;
|
||||
areaTreeVOS = areaTreeVOList.stream().filter(deptTreeVO ->
|
||||
deptTreeVO.getPid().equals("0")
|
||||
).map((deptFirst) -> {
|
||||
//map映射方法改变结果,调用getChildrens()方法,把一级部门deptFirst和所有数据allDept作为参数传递,查询所有下级部门
|
||||
deptFirst.setChildren(getChildrens(deptFirst, finalAreaTreeVOList));
|
||||
return deptFirst;
|
||||
BizParamConstant.PARENT_ID.equals(deptTreeVO.getPid())
|
||||
).peek((deptFirst) -> {
|
||||
//map映射方法改变结果,调用getChildren()方法,把一级部门deptFirst和所有数据allDept作为参数传递,查询所有下级部门
|
||||
deptFirst.setChildren(getChildren(deptFirst, finalAreaTreeVOList));
|
||||
}).collect(Collectors.toList());
|
||||
} else {
|
||||
areaTreeVOS = this.baseMapper.getAreaTree(id, type, DataStateEnum.ENABLE.getCode());
|
||||
;
|
||||
}
|
||||
return areaTreeVOS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归查找所有企业的下级
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private List<AreaTreeVO> getChildrens(AreaTreeVO areaTreeVO, List<AreaTreeVO> allArea) {
|
||||
List<AreaTreeVO> chilrdenList = allArea.stream().filter(area -> {
|
||||
private List<AreaTreeVO> getChildren(AreaTreeVO areaTreeVO, List<AreaTreeVO> allArea) {
|
||||
return allArea.stream().filter(area -> {
|
||||
//在全部数据中,找到和一级部门deptFirst的valueId相等的parentId
|
||||
return area.getPid().equals(areaTreeVO.getId());
|
||||
}).map(deptId -> {
|
||||
}).peek(deptId -> {
|
||||
//递归查询找到下级部门
|
||||
deptId.setChildren(getChildrens(deptId, allArea));
|
||||
return deptId;
|
||||
deptId.setChildren(getChildren(deptId, allArea));
|
||||
}).collect(Collectors.toList());
|
||||
return chilrdenList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -125,11 +120,11 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
|
||||
checkAreaCode(areaParam, false);
|
||||
Area area = new Area();
|
||||
BeanUtil.copyProperties(areaParam, area);
|
||||
if (areaParam.getPid().equals("0")) {
|
||||
if (BizParamConstant.PARENT_ID.equals(areaParam.getPid())) {
|
||||
//上层节点
|
||||
area.setPids("0");
|
||||
area.setPids(BizParamConstant.PARENT_ID);
|
||||
} else {
|
||||
String pids = "," + areaParam.getPid();
|
||||
String pids = StrUtil.COMMA + areaParam.getPid();
|
||||
String pid = this.baseMapper.getIdString(area.getPid());
|
||||
//上层节点
|
||||
area.setPids(pid + pids);
|
||||
@@ -143,11 +138,11 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
|
||||
public boolean updateArea(AreaParam.AreaUpdateParam updateParam) {
|
||||
checkAreaCode(updateParam, true);
|
||||
Area area = new Area();
|
||||
if (updateParam.getPid().equals("0")) {
|
||||
if (BizParamConstant.PARENT_ID.equals(updateParam.getPid())) {
|
||||
//上层节点
|
||||
area.setPids("0");
|
||||
area.setPids(BizParamConstant.PARENT_ID);
|
||||
} else {
|
||||
String pids = "," + updateParam.getPid();
|
||||
String pids = StrUtil.COMMA + updateParam.getPid();
|
||||
String pid = this.baseMapper.getIdString(area.getPid());
|
||||
//上层节点
|
||||
area.setPids(pid + pids);
|
||||
@@ -158,14 +153,14 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
|
||||
|
||||
@Override
|
||||
public boolean deleteArea(List<String> ids) {
|
||||
/**
|
||||
/*
|
||||
* 查询子节点
|
||||
*/
|
||||
List<Area> list = this.baseMapper.selectPid(ids, DataStateEnum.ENABLE.getCode());
|
||||
/**
|
||||
/*
|
||||
* 将子节点叶添加到需要删除中
|
||||
*/
|
||||
if (list.size() > 0) {
|
||||
if (!list.isEmpty()) {
|
||||
for (Area area : list) {
|
||||
ids.add(area.getId());
|
||||
}
|
||||
@@ -175,14 +170,13 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
|
||||
|
||||
@Override
|
||||
public List<AreaTreeDTO> areaDeptTree(String id, Integer type) {
|
||||
List<AreaTreeDTO> areaTreeVOList = new ArrayList<>();
|
||||
List<AreaTreeDTO> areaTreeVOS = new ArrayList<>();
|
||||
if (id.equals("") || id == null) {
|
||||
/**
|
||||
List<AreaTreeDTO> areaTreeVOList;
|
||||
List<AreaTreeDTO> areaTreeVOS;
|
||||
if (StrUtil.isBlank(id)) {
|
||||
/*
|
||||
* 用于首次访问区域。此处需要获取当前用户所绑定的部门下的行政区域id
|
||||
* 现在默认为0
|
||||
*/
|
||||
|
||||
id = deptFeignClient.getAreaIdByDeptId(RequestUtil.getDeptIndex()).getData();
|
||||
}
|
||||
areaTreeVOList = this.baseMapper.getAreaDeptTree(id,type, DataStateEnum.ENABLE.getCode());
|
||||
@@ -190,10 +184,9 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
|
||||
String finalId = id;
|
||||
areaTreeVOS = areaTreeVOList.stream().filter(deptTreeVO ->
|
||||
deptTreeVO.getPid().equals(finalId)
|
||||
).map((deptFirst) -> {
|
||||
//map映射方法改变结果,调用getChildrens()方法,把一级部门deptFirst和所有数据allDept作为参数传递,查询所有下级部门
|
||||
deptFirst.setChildren(getChildrens(deptFirst, finalAreaTreeVOList));
|
||||
return deptFirst;
|
||||
).peek((deptFirst) -> {
|
||||
//map映射方法改变结果,调用getChildren()方法,把一级部门deptFirst和所有数据allDept作为参数传递,查询所有下级部门
|
||||
deptFirst.setChildren(getChildren(deptFirst, finalAreaTreeVOList));
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return areaTreeVOS;
|
||||
@@ -206,10 +199,9 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
|
||||
areaQueryWrapper.eq("sys_area.type", type);
|
||||
areaQueryWrapper.eq("sys_area.state", DataStateEnum.ENABLE.getCode());
|
||||
Area area = this.baseMapper.selectOne(areaQueryWrapper);
|
||||
if (area.getPid().equals("-1")) {
|
||||
if (BizParamConstant.PARENT_ID.equals(area.getId()) || BizParamConstant.PARENT_ID.equals(area.getPid())) {
|
||||
return area;
|
||||
}
|
||||
if (!area.getPid().equals("0")) {
|
||||
}else{
|
||||
id = area.getPid();
|
||||
area = areaPro(id, type);
|
||||
}
|
||||
@@ -219,8 +211,7 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
|
||||
@Override
|
||||
public Area areaDeptPro(String id) {
|
||||
Area areaDetail = this.baseMapper.areaDeptProDetail(id);
|
||||
Area area = areaPro(areaDetail.getId(),areaDetail.getType());
|
||||
return area;
|
||||
return areaPro(areaDetail.getId(),areaDetail.getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -229,14 +220,12 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
|
||||
//获取当前系统登录的部门信息
|
||||
String areaId = deptFeignClient.getAreaIdByDeptId(RequestUtil.getDeptIndex()).getData();
|
||||
List<AreaTreeVO> areaTreeVOS = this.baseMapper.getAreaAll();
|
||||
List<AreaTreeVO> areaTreeVOLists = areaTreeVOS.stream().filter(areaTreeVO ->
|
||||
return areaTreeVOS.stream().filter(areaTreeVO ->
|
||||
areaTreeVO.getId().equals(areaId)
|
||||
).map((areaFirst) -> {
|
||||
//map映射方法改变结果,调用getChildrens()方法,把一级部门deptFirst和所有数据allDept作为参数传递,查询所有下级部门
|
||||
areaFirst.setChildren(getChildrens(areaFirst, areaTreeVOS));
|
||||
return areaFirst;
|
||||
).peek((areaFirst) -> {
|
||||
//map映射方法改变结果,调用getChildren()方法,把一级部门deptFirst和所有数据allDept作为参数传递,查询所有下级部门
|
||||
areaFirst.setChildren(getChildren(areaFirst, areaTreeVOS));
|
||||
}).collect(Collectors.toList());
|
||||
return areaTreeVOLists;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -249,18 +238,15 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
|
||||
/**
|
||||
* 递归查找所有企业的下级
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private List<AreaTreeDTO> getChildrens(AreaTreeDTO areaTreeVO, List<AreaTreeDTO> allArea) {
|
||||
List<AreaTreeDTO> chilrdenList = allArea.stream().filter(area -> {
|
||||
private List<AreaTreeDTO> getChildren(AreaTreeDTO areaTreeVO, List<AreaTreeDTO> allArea) {
|
||||
return allArea.stream().filter(area -> {
|
||||
//在全部数据中,找到和一级部门deptFirst的valueId相等的parentId
|
||||
return area.getPid().equals(areaTreeVO.getId());
|
||||
}).map(deptId -> {
|
||||
}).peek(deptId -> {
|
||||
//递归查询找到下级部门
|
||||
deptId.setChildren(getChildrens(deptId, allArea));
|
||||
return deptId;
|
||||
deptId.setChildren(getChildren(deptId, allArea));
|
||||
}).collect(Collectors.toList());
|
||||
return chilrdenList;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -287,13 +273,11 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
|
||||
@Override
|
||||
public List<AreaTreeVO> areaSelect() {
|
||||
List<AreaTreeVO> areaTreeVOS = this.baseMapper.getAreaAll();
|
||||
List<AreaTreeVO> collect = areaTreeVOS.stream ( ).filter (temp ->"0".equals(temp.getPid()))
|
||||
.map ((areaFirst) -> {
|
||||
//map映射方法改变结果,调用getChildrens()方法,把一级部门deptFirst和所有数据allDept作为参数传递,查询所有下级部门
|
||||
areaFirst.setChildren (getChildrens (areaFirst, areaTreeVOS));
|
||||
return areaFirst;
|
||||
return areaTreeVOS.stream ( ).filter (temp ->BizParamConstant.PARENT_ID.equals(temp.getPid()))
|
||||
.peek((areaFirst) -> {
|
||||
//map映射方法改变结果,调用getChildren()方法,把一级部门deptFirst和所有数据allDept作为参数传递,查询所有下级部门
|
||||
areaFirst.setChildren (getChildren (areaFirst, areaTreeVOS));
|
||||
}).collect (Collectors.toList ( ));
|
||||
return collect;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -303,7 +287,7 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
|
||||
if(Objects.isNull(area)){
|
||||
return result;
|
||||
}
|
||||
if(area.getPid().equals("-1")){
|
||||
if(BizParamConstant.PARENT_ID.equals(area.getId())){
|
||||
result.add(area);
|
||||
}else {
|
||||
LambdaQueryWrapper<Area> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import cn.afterturn.easypoi.exception.excel.ExcelImportException;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.TimeInterval;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
@@ -24,10 +24,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
||||
import com.nimbusds.jose.JWSObject;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.common.pojo.constant.LogInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.constant.SecurityConstants;
|
||||
import com.njcn.common.pojo.dto.DeviceLogDTO;
|
||||
import com.njcn.common.pojo.dto.LogInfoDTO;
|
||||
import com.njcn.common.pojo.dto.UserTokenInfo;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
@@ -35,10 +33,10 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.common.utils.ReflectCommonUtil;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.enums.AuditLogEnum;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
import com.njcn.system.excel.UserLogExcel;
|
||||
import com.njcn.system.mapper.AuditMapper;
|
||||
import com.njcn.system.mapper.UserLogMapper;
|
||||
@@ -50,27 +48,18 @@ import com.njcn.system.service.AuditService;
|
||||
import com.njcn.system.service.IConfigService;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.po.User;
|
||||
import com.njcn.web.advice.DeviceLog;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.compress.utils.IOUtils;
|
||||
import org.apache.commons.fileupload.FileItem;
|
||||
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.text.ParseException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
@@ -92,6 +81,7 @@ public class AuditServiceImpl extends ServiceImpl<UserLogMapper, UserLog> implem
|
||||
|
||||
@Value("${spring.datasource.druid.url}")
|
||||
private String urls;
|
||||
|
||||
private final GeneralInfo generalInfo;
|
||||
|
||||
private final RedisUtil redisUtil;
|
||||
@@ -127,7 +117,7 @@ public class AuditServiceImpl extends ServiceImpl<UserLogMapper, UserLog> implem
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(auditParam.getSortBy()) && StrUtil.isNotBlank(auditParam.getOrderBy())) {
|
||||
if (auditParam.getOrderBy().equalsIgnoreCase("desc")) {
|
||||
if (DbConstant.DESC.equalsIgnoreCase(auditParam.getOrderBy())) {
|
||||
queryWrapper.orderByDesc("sys_user_log." + auditParam.getSortBy());
|
||||
} else {
|
||||
queryWrapper.orderByAsc("sys_user_log." + auditParam.getSortBy());
|
||||
@@ -194,16 +184,16 @@ public class AuditServiceImpl extends ServiceImpl<UserLogMapper, UserLog> implem
|
||||
Integer severity = levelStringToNumber(level);
|
||||
if (auditParam.isExport()) {
|
||||
methodDescribe = "审计日志列表导出";
|
||||
LogInfoDTO logInfoDTO = new LogInfoDTO(loginName, userName, ip, methodDescribe, operateType, result.equalsIgnoreCase("失败") ? 0 : 1, "", severity, type.equalsIgnoreCase("业务事件") ? 0 : 1, generalInfo.getMicroServiceName(), userIndex, LocalDateTime.now());
|
||||
LogInfoDTO logInfoDTO = new LogInfoDTO(loginName, userName, ip, methodDescribe, operateType, "失败".equalsIgnoreCase(result) ? 0 : 1, "", severity, "业务事件".equalsIgnoreCase(type) ? 0 : 1, generalInfo.getMicroServiceName(), userIndex, LocalDateTime.now());
|
||||
publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||
}else {
|
||||
} else {
|
||||
if (StrUtil.isNotBlank(auditParam.getSortBy()) && StrUtil.isNotBlank(auditParam.getOrderBy())) {
|
||||
methodDescribe = methodDescribe.concat("并以")
|
||||
.concat(auditParam.getSortName())
|
||||
.concat("进行")
|
||||
.concat(auditParam.getOrderBy().equalsIgnoreCase("desc") ? "降序" : "升序")
|
||||
.concat(DbConstant.DESC.equalsIgnoreCase(auditParam.getOrderBy()) ? "降序" : "升序")
|
||||
.concat("查询");
|
||||
LogInfoDTO logInfoDTO = new LogInfoDTO(loginName, userName, ip, methodDescribe, operateType, result.equalsIgnoreCase("失败") ? 0 : 1, "", severity, type.equalsIgnoreCase("业务事件") ? 0 : 1, generalInfo.getMicroServiceName(), userIndex, LocalDateTime.now());
|
||||
LogInfoDTO logInfoDTO = new LogInfoDTO(loginName, userName, ip, methodDescribe, operateType, "失败".equalsIgnoreCase(result) ? 0 : 1, "", severity, "业务事件".equalsIgnoreCase(type) ? 0 : 1, generalInfo.getMicroServiceName(), userIndex, LocalDateTime.now());
|
||||
publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||
|
||||
}
|
||||
@@ -218,11 +208,9 @@ public class AuditServiceImpl extends ServiceImpl<UserLogMapper, UserLog> implem
|
||||
//限制多次点击
|
||||
String logFileWriter = redisUtil.getStringByKey("logFileWriter");
|
||||
if (StrUtil.isNotBlank(logFileWriter) || ObjectUtil.equals(logFileWriter, "1")) {
|
||||
throw new BusinessException(AuditLogEnum.MULTIPLE_CLICKS_LOGFILEWRITER);
|
||||
throw new BusinessException(SystemResponseEnum.MULTIPLE_CLICKS_LOG_FILE_WRITER);
|
||||
}
|
||||
redisUtil.saveByKeyWithExpire("logFileWriter", "1", 600L);
|
||||
|
||||
|
||||
Config config = iConfigService.getOne(new LambdaQueryWrapper<Config>().eq(Config::getState, DataStateEnum.ENABLE.getCode()));
|
||||
LocalDateTime nowDate = LocalDateTime.now();
|
||||
LocalDateTime agoDate = nowDate.minusMonths(config.getLogTime()).with(TemporalAdjusters.firstDayOfMonth());
|
||||
@@ -240,23 +228,20 @@ public class AuditServiceImpl extends ServiceImpl<UserLogMapper, UserLog> implem
|
||||
file.mkdir();
|
||||
}
|
||||
//必须放到循环外,否则会刷新流
|
||||
ExcelWriter excelWriter = EasyExcel.write(generalInfo.getBusinessTempPath() + File.separator + OssPath.LOGBAK + nowTime + ExcelTypeEnum.XLSX.getValue(), UserLogExcel.class)
|
||||
// .excelType(ExcelTypeEnum.CSV)
|
||||
.build();
|
||||
|
||||
ExcelWriter excelWriter = EasyExcel.write(generalInfo.getBusinessTempPath() + File.separator + OssPath.LOGBAK + nowTime + ExcelTypeEnum.XLSX.getValue(), UserLogExcel.class).build();
|
||||
try {
|
||||
//记录总数:实际中需要根据查询条件进行统计即可:一共多少条
|
||||
int totalCount = this.count(aa);
|
||||
//每一个Sheet存放100w条数据
|
||||
Integer sheetDataRows = 1000000;
|
||||
int sheetDataRows = 1000000;
|
||||
//每次写入的数据量20w,每页查询20W
|
||||
Integer writeDataRows = 200000;
|
||||
int writeDataRows = 200000;
|
||||
//计算需要的Sheet总数量
|
||||
Integer sheetNum = totalCount % sheetDataRows == 0 ? (totalCount / sheetDataRows) : (totalCount / sheetDataRows + 1);
|
||||
int sheetNum = totalCount % sheetDataRows == 0 ? (totalCount / sheetDataRows) : (totalCount / sheetDataRows + 1);
|
||||
//计算一般情况下每一个Sheet需要写入的次数(一般情况不包含最后一个sheet,因为最后一个sheet不确定会写入多少条数据)
|
||||
Integer oneSheetWriteCount = sheetDataRows / writeDataRows;
|
||||
int oneSheetWriteCount = sheetDataRows / writeDataRows;
|
||||
//计算最后一个sheet需要写入的次数
|
||||
Integer lastSheetWriteCount = 0;
|
||||
int lastSheetWriteCount;
|
||||
if (totalCount > sheetDataRows) {
|
||||
lastSheetWriteCount = totalCount % sheetDataRows == 0 ? oneSheetWriteCount : (totalCount % sheetDataRows % writeDataRows == 0 ? (totalCount / sheetDataRows / writeDataRows) : (totalCount / sheetDataRows / writeDataRows + 1));
|
||||
} else {
|
||||
@@ -289,33 +274,17 @@ public class AuditServiceImpl extends ServiceImpl<UserLogMapper, UserLog> implem
|
||||
System.out.println("日志备份结束,共花费时间" + timeInterval.intervalSecond() + "S");
|
||||
}
|
||||
|
||||
|
||||
public static MultipartFile getMultipartFile(File file) {
|
||||
FileItem item = new DiskFileItemFactory().createItem("file"
|
||||
, MediaType.MULTIPART_FORM_DATA_VALUE
|
||||
, true
|
||||
, file.getName());
|
||||
try (InputStream input = new FileInputStream(file);
|
||||
OutputStream os = item.getOutputStream()) {
|
||||
// 流转移
|
||||
IOUtils.copy(input, os);
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException("Invalid file: " + e, e);
|
||||
}
|
||||
return new CommonsMultipartFile(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public void recoverLogFile() {
|
||||
String logFileWriter = redisUtil.getStringByKey("recoverLogFile");
|
||||
if (StrUtil.isNotBlank(logFileWriter) || ObjectUtil.equals(logFileWriter, "1")) {
|
||||
throw new BusinessException(AuditLogEnum.MULTIPLE_CLICKS_LOGFILEWRITER);
|
||||
throw new BusinessException(SystemResponseEnum.MULTIPLE_CLICKS_LOG_FILE_WRITER);
|
||||
}
|
||||
redisUtil.saveByKeyWithExpire("recoverLogFile", "1", 600L);
|
||||
File newFile = getLastFile();
|
||||
if (FileUtil.isEmpty(newFile)) {
|
||||
throw new BusinessException(AuditLogEnum.NOT_FIND_FILE);
|
||||
throw new BusinessException(SystemResponseEnum.NOT_FIND_FILE);
|
||||
}
|
||||
FileInputStream in = null;
|
||||
try {
|
||||
@@ -341,8 +310,7 @@ public class AuditServiceImpl extends ServiceImpl<UserLogMapper, UserLog> implem
|
||||
}
|
||||
} catch (Exception e) {
|
||||
redisUtil.delete("recoverLogFile");
|
||||
e.printStackTrace();
|
||||
throw new ExcelImportException(e.getMessage(), e);
|
||||
throw new BusinessException(SystemResponseEnum.LOG_EXCEPTION);
|
||||
} finally {
|
||||
IOUtils.closeQuietly(in);
|
||||
}
|
||||
@@ -390,8 +358,7 @@ public class AuditServiceImpl extends ServiceImpl<UserLogMapper, UserLog> implem
|
||||
auditParam.setSearchBeginTime(DateUtil.beginOfDay(DateUtil.parse(auditParam.getSearchBeginTime())).toString());
|
||||
auditParam.setSearchEndTime(DateUtil.endOfDay(DateUtil.parse(auditParam.getSearchEndTime())).toString());
|
||||
//待分页数据总量
|
||||
Page<AuditLogCusVO> page = auditMapper.selectCensusAuditLog(new Page<>(auditParam.getPageNum(), auditParam.getPageSize()), auditParam);
|
||||
return page;
|
||||
return auditMapper.selectCensusAuditLog(new Page<>(auditParam.getPageNum(), auditParam.getPageSize()), auditParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -460,21 +427,6 @@ public class AuditServiceImpl extends ServiceImpl<UserLogMapper, UserLog> implem
|
||||
valuePO.setValue(temp);
|
||||
return valuePO;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// List<ValuePO> loginNameList = new ArrayList<>();
|
||||
// List<ValuePO> operateTypeList = new ArrayList<>();
|
||||
// for (int i = 0; i < loginName.size(); i++) {
|
||||
// ValuePO valuePO = new ValuePO();
|
||||
// valuePO.setName("选项" + (i + 1));
|
||||
// valuePO.setValue(loginName.get(i));
|
||||
// loginNameList.add(valuePO);
|
||||
// }
|
||||
// for (int i = 0; i < operateType.size(); i++) {
|
||||
// ValuePO valuePO = new ValuePO();
|
||||
// valuePO.setName("选项" + (i + 1));
|
||||
// valuePO.setValue(operateType.get(i));
|
||||
// operateTypeList.add(valuePO);
|
||||
// }
|
||||
logParamVO.setLoginName(loginNameList);
|
||||
logParamVO.setOperateType(operateTypeList);
|
||||
return logParamVO;
|
||||
@@ -485,15 +437,15 @@ public class AuditServiceImpl extends ServiceImpl<UserLogMapper, UserLog> implem
|
||||
*/
|
||||
public File getLastFile() {
|
||||
File parentFile = new File(generalInfo.getBusinessTempPath() + File.separator + OssPath.LOGBAK);
|
||||
|
||||
//文件夹下的所有子文件数组
|
||||
File[] files = parentFile.listFiles();
|
||||
List<Date> list = Arrays.stream(files).map(tempFile -> FileUtil.lastModifiedTime(tempFile)).collect(Collectors.toList());
|
||||
//Date集合排序
|
||||
Collections.sort(list, Comparator.reverseOrder());
|
||||
File newFile = Arrays.stream(files).filter(tempFile -> FileUtil.lastModifiedTime(tempFile).equals(list.get(0))).collect(Collectors.toList()).get(0);
|
||||
|
||||
return newFile;
|
||||
List<Date> list;
|
||||
if (ArrayUtil.isNotEmpty(files)) {
|
||||
list = Arrays.stream(files).map(FileUtil::lastModifiedTime).collect(Collectors.toList());
|
||||
list.sort(Comparator.reverseOrder());
|
||||
return Arrays.stream(files).filter(tempFile -> FileUtil.lastModifiedTime(tempFile).equals(list.get(0))).collect(Collectors.toList()).get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
import com.njcn.system.mapper.ConfigMapper;
|
||||
@@ -37,17 +38,17 @@ public class ConfigServiceImpl extends ServiceImpl<ConfigMapper, Config> impleme
|
||||
config.setCreateTime(LocalDateTime.now());
|
||||
config.setUpdateBy(RequestUtil.getUserIndex());
|
||||
config.setUpdateTime(LocalDateTime.now());
|
||||
config.setState(0);
|
||||
config.setState(DataStateEnum.ENABLE.getCode());
|
||||
this.baseMapper.insert(config);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updateSysConfig(ConfigParam.ConfigUpdateParam configUpdateParam) {
|
||||
Config config = this.baseMapper.selectById(configUpdateParam.getId());
|
||||
if (!Objects.isNull(config)) {
|
||||
if (config.getState() == 1) {
|
||||
if (config.getState().equals(DataStateEnum.ENABLE.getCode())) {
|
||||
if (Objects.equals(configUpdateParam.getState(), config.getState())) {
|
||||
BeanUtils.copyProperties(configUpdateParam, config);
|
||||
config.setUpdateBy(RequestUtil.getUserIndex());
|
||||
@@ -55,26 +56,21 @@ public class ConfigServiceImpl extends ServiceImpl<ConfigMapper, Config> impleme
|
||||
this.baseMapper.updateById(config);
|
||||
return true;
|
||||
} else {
|
||||
//不可更改当前激活状态,必须保留一个激活系统
|
||||
// 不可更改当前激活状态,必须保留一个激活系统
|
||||
throw new BusinessException(SystemResponseEnum.ACTIVATED_STATE);
|
||||
}
|
||||
} else {
|
||||
if (configUpdateParam.getState() == 1) {
|
||||
if (configUpdateParam.getState().equals(DataStateEnum.ENABLE.getCode())) {
|
||||
// 先将所有的都置为非激活状态
|
||||
LambdaUpdateWrapper<Config> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.set(Config::getState, 0);
|
||||
updateWrapper.set(Config::getState, DataStateEnum.DELETED.getCode());
|
||||
this.baseMapper.update(null, updateWrapper);
|
||||
BeanUtils.copyProperties(configUpdateParam, config);
|
||||
config.setUpdateBy(RequestUtil.getUserIndex());
|
||||
config.setUpdateTime(LocalDateTime.now());
|
||||
this.baseMapper.updateById(config);
|
||||
return true;
|
||||
} else {
|
||||
BeanUtils.copyProperties(configUpdateParam, config);
|
||||
config.setUpdateBy(RequestUtil.getUserIndex());
|
||||
config.setUpdateTime(LocalDateTime.now());
|
||||
this.baseMapper.updateById(config);
|
||||
return true;
|
||||
}
|
||||
BeanUtils.copyProperties(configUpdateParam, config);
|
||||
config.setUpdateBy(RequestUtil.getUserIndex());
|
||||
config.setUpdateTime(LocalDateTime.now());
|
||||
this.baseMapper.updateById(config);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -82,8 +78,7 @@ public class ConfigServiceImpl extends ServiceImpl<ConfigMapper, Config> impleme
|
||||
|
||||
@Override
|
||||
public List<Config> getList() {
|
||||
List<Config> list = this.baseMapper.getList();
|
||||
return list;
|
||||
return this.baseMapper.getList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/6/9 16:17【需求编号】
|
||||
*
|
||||
@@ -34,15 +33,16 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CsStatisticalSetPOServiceImpl extends MppServiceImpl<CsStatisticalSetPOMapper, CsStatisticalSetPO> implements CsStatisticalSetPOService{
|
||||
public class CsStatisticalSetPOServiceImpl extends MppServiceImpl<CsStatisticalSetPOMapper, CsStatisticalSetPO> implements CsStatisticalSetPOService {
|
||||
|
||||
private final IEleEpdPqdService epdPqdService;
|
||||
|
||||
private final SysDicTreePOService sysDicTreePOService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public Boolean saveData(List<CsStatisticalSetAddParam> csStatisticalSetAddParams) {
|
||||
csStatisticalSetAddParams.forEach(temp->{
|
||||
csStatisticalSetAddParams.forEach(temp -> {
|
||||
List<CsStatisticalSetPO> csStatisticalSetPOList = new ArrayList<>();
|
||||
QueryWrapper<CsStatisticalSetPO> queryWrap = new QueryWrapper<>();
|
||||
queryWrap.lambda().eq(CsStatisticalSetPO::getStatisicalId, temp.getId());
|
||||
@@ -53,7 +53,7 @@ public class CsStatisticalSetPOServiceImpl extends MppServiceImpl<CsStatisticalS
|
||||
csStatisticalSetPO.setTargetId(tempId);
|
||||
csStatisticalSetPOList.add(csStatisticalSetPO);
|
||||
});
|
||||
boolean b = this.saveBatch(csStatisticalSetPOList);
|
||||
this.saveBatch(csStatisticalSetPOList);
|
||||
});
|
||||
|
||||
return true;
|
||||
@@ -67,27 +67,20 @@ public class CsStatisticalSetPOServiceImpl extends MppServiceImpl<CsStatisticalS
|
||||
List<EleEpdPqdListVO> selectedList = new ArrayList<>();
|
||||
List<EleEpdPqdListVO> unSelectedList = new ArrayList<>();
|
||||
List<DictTreeVO> dictTreeVOS = sysDicTreePOService.queryByPid(id);
|
||||
// SysDicTreePO sysDicTreePO = sysDicTreePOService.queryById(id);
|
||||
// DictTreeVO dictTreeVO = new DictTreeVO();
|
||||
// BeanUtils.copyProperties(sysDicTreePO,dictTreeVO);
|
||||
// dictTreeVOS.add(dictTreeVO);
|
||||
List<String> collect;
|
||||
if(!CollectionUtils.isEmpty(dictTreeVOS)){
|
||||
if (!CollectionUtils.isEmpty(dictTreeVOS)) {
|
||||
List<String> collect3 = dictTreeVOS.stream().map(DictTreeVO::getId).collect(Collectors.toList());
|
||||
collect3.add(id);
|
||||
QueryWrapper<CsStatisticalSetPO> queryWrap = new QueryWrapper<>();
|
||||
queryWrap.lambda().in(CsStatisticalSetPO::getStatisicalId, collect3);
|
||||
List<CsStatisticalSetPO> result = this.baseMapper.selectList(queryWrap);
|
||||
collect = result.stream().map(CsStatisticalSetPO::getTargetId).collect(Collectors.toList());
|
||||
|
||||
|
||||
Map<String, List<CsStatisticalSetPO>> collect1 = result.stream().collect(Collectors.groupingBy(CsStatisticalSetPO::getStatisicalId));
|
||||
dictTreeVOS.forEach(temp->{
|
||||
dictTreeVOS.forEach(temp -> {
|
||||
EleEpdPqdListVO vo = new EleEpdPqdListVO();
|
||||
vo.setDataType(temp.getId());
|
||||
List<CsStatisticalSetPO> collect2 = result.stream().filter(csStatisticalSetPO -> Objects.equals(csStatisticalSetPO.getStatisicalId(), temp.getId())).collect(Collectors.toList());
|
||||
List<EleEpdPqd> eleEpdPqds = new ArrayList<>();
|
||||
if(!CollectionUtil.isEmpty(collect2)){
|
||||
if (!CollectionUtil.isEmpty(collect2)) {
|
||||
List<String> collect4 = collect2.stream().map(CsStatisticalSetPO::getTargetId).collect(Collectors.toList());
|
||||
eleEpdPqds = epdPqdService.getBaseMapper().selectBatchIds(collect4);
|
||||
}
|
||||
@@ -99,30 +92,19 @@ public class CsStatisticalSetPOServiceImpl extends MppServiceImpl<CsStatisticalS
|
||||
} else {
|
||||
collect = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
for (EleEpdPqdListVO temp :allList){
|
||||
// EleEpdPqdListVO selected = new EleEpdPqdListVO();
|
||||
for (EleEpdPqdListVO temp : allList) {
|
||||
EleEpdPqdListVO unSelected = new EleEpdPqdListVO();
|
||||
List<EleEpdPqd> all = temp.getEleEpdPqdVOS();
|
||||
|
||||
// List<EleEpdPqd> selectedELe = all.stream().filter(tempEleEpdPqd -> collect.contains(tempEleEpdPqd.getId())).collect(Collectors.toList());
|
||||
List<EleEpdPqd> unSelectedELe = all.stream().filter(tempEleEpdPqd -> !collect.contains(tempEleEpdPqd.getId())).collect(Collectors.toList());
|
||||
|
||||
// selected.setDataTypeName(temp.getDataTypeName());
|
||||
// selected.setDataType(temp.getDataTypeName());
|
||||
// selected.setEleEpdPqdVOS(selectedELe);
|
||||
unSelected.setDataTypeName(temp.getDataTypeName());
|
||||
unSelected.setDataType(temp.getDataType());
|
||||
unSelected.setEleEpdPqdVOS(unSelectedELe);
|
||||
// selectedList.add(selected);
|
||||
unSelectedList.add(unSelected);
|
||||
}
|
||||
csStatisticalSetVO.setUnSelectedList(unSelectedList);
|
||||
csStatisticalSetVO.setSelectedList(selectedList);
|
||||
|
||||
|
||||
|
||||
return csStatisticalSetVO;
|
||||
}
|
||||
|
||||
@@ -132,11 +114,10 @@ public class CsStatisticalSetPOServiceImpl extends MppServiceImpl<CsStatisticalS
|
||||
queryWrap.lambda().eq(CsStatisticalSetPO::getStatisicalId, id);
|
||||
List<CsStatisticalSetPO> result = this.baseMapper.selectList(queryWrap);
|
||||
List<String> collect = result.stream().map(CsStatisticalSetPO::getTargetId).collect(Collectors.toList());
|
||||
if(CollectionUtils.isEmpty(collect)){
|
||||
if (CollectionUtils.isEmpty(collect)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<EleEpdPqd> eleEpdPqds = epdPqdService.listByIds(collect);
|
||||
return eleEpdPqds;
|
||||
return epdPqdService.listByIds(collect);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
@@ -29,7 +28,6 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -145,13 +143,13 @@ public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public DictData getDicDataByNameAndType(String dicName,String typeName) {
|
||||
return this.baseMapper.getDicDataByNameAndType(dicName,typeName);
|
||||
public DictData getDicDataByNameAndType(String dicName, String typeName) {
|
||||
return this.baseMapper.getDicDataByNameAndType(dicName, typeName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DictData getDicDataByCodeAndType(String dicCode, String typeCode) {
|
||||
return this.baseMapper.getDicDataByCodeAndType(dicCode,typeCode);
|
||||
return this.baseMapper.getDicDataByCodeAndType(dicCode, typeCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -161,7 +159,7 @@ public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> i
|
||||
|
||||
@Override
|
||||
public List<DictData> getLoadTypeBySys() {
|
||||
List<DictData> list = new ArrayList<>();
|
||||
List<DictData> list;
|
||||
Config config = iConfigService.lambdaQuery()
|
||||
.eq(Config::getState, DataStateEnum.ENABLE.getCode())
|
||||
.one();
|
||||
@@ -176,7 +174,7 @@ public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> i
|
||||
|
||||
@Override
|
||||
public DictData getDicDataByNameAndTypeName(String dicTypeName, String dicDataName) {
|
||||
return this.baseMapper.getDicDataByNameAndTypeName(dicTypeName,dicDataName);
|
||||
return this.baseMapper.getDicDataByNameAndTypeName(dicTypeName, dicDataName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,7 +14,6 @@ import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
import com.njcn.system.mapper.DictTypeMapper;
|
||||
import com.njcn.system.pojo.param.DictTypeParam;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.DictType;
|
||||
import com.njcn.system.pojo.vo.DictDataCache;
|
||||
import com.njcn.system.service.IDictTypeService;
|
||||
@@ -22,9 +21,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -93,11 +90,11 @@ public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictType> i
|
||||
public List<SimpleTreeDTO> dictDataCache() {
|
||||
List<DictDataCache> allDictData = this.baseMapper.dictDataCache();
|
||||
Map<Object, List<DictDataCache>> dictDataCacheMap = allDictData.stream()
|
||||
.collect(Collectors.groupingBy(dictDataCache -> dictDataCache.getTypeId()));
|
||||
List<SimpleTreeDTO> dictTypeList = dictDataCacheMap.keySet().stream().map(typeId -> {
|
||||
.collect(Collectors.groupingBy(DictDataCache::getTypeId));
|
||||
return dictDataCacheMap.keySet().stream().map(typeId -> {
|
||||
SimpleTreeDTO simpleTreeDTO = new SimpleTreeDTO();
|
||||
List<DictDataCache> dictDataCaches = dictDataCacheMap.get(typeId);
|
||||
List<SimpleDTO> simpleDTOs = dictDataCaches.stream().map(dictDataCache -> {
|
||||
List<SimpleDTO> simpleDTOList = dictDataCaches.stream().map(dictDataCache -> {
|
||||
simpleTreeDTO.setCode(dictDataCache.getTypeCode());
|
||||
simpleTreeDTO.setId(dictDataCache.getTypeId());
|
||||
simpleTreeDTO.setName(dictDataCache.getTypeName());
|
||||
@@ -109,11 +106,9 @@ public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictType> i
|
||||
simpleDTO.setValue(dictDataCache.getValue());
|
||||
return simpleDTO;
|
||||
}).sorted(Comparator.comparing(SimpleDTO::getSort)).collect(Collectors.toList());
|
||||
|
||||
simpleTreeDTO.setChildren(simpleDTOs);
|
||||
simpleTreeDTO.setChildren(simpleDTOList);
|
||||
return simpleTreeDTO;
|
||||
}).collect(Collectors.toList());
|
||||
return dictTypeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -49,7 +49,7 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
||||
|
||||
@Override
|
||||
public void refreshEpdPqdDataCache() {
|
||||
Map<String,String> map = new HashMap<>();
|
||||
Map<String,String> map = new HashMap<>(16);
|
||||
List<EpdDTO> list = findAll();
|
||||
list.forEach(item->{
|
||||
map.put(item.getDictName(),item.getTableName());
|
||||
@@ -128,7 +128,7 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
||||
|
||||
@Override
|
||||
public Page<EleEpdPqdVO> eleEpdPqdList(EleEpdPqdParam.EleEpdPqdQueryParam queryParam) {
|
||||
QueryWrapper<EleEpdPqdVO> queryWrapper = new QueryWrapper<EleEpdPqdVO>();
|
||||
QueryWrapper<EleEpdPqdVO> queryWrapper = new QueryWrapper<>();
|
||||
if (ObjectUtil.isNotNull(queryParam)) {
|
||||
//查询参数不为空,进行条件填充
|
||||
if (StrUtil.isNotBlank(queryParam.getSearchValue())) {
|
||||
@@ -176,7 +176,7 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
||||
this.saveBatch(list,1000);
|
||||
List<String> nameList = eleEpdPqdParam.stream().map(EleEpdPqdParam::getName).collect(Collectors.toList());
|
||||
List<EleEpdPqd> list1 = this.lambdaQuery().in(EleEpdPqd::getName,nameList).list();
|
||||
Map<String,String> map = new HashMap<>();
|
||||
Map<String,String> map = new HashMap<>(16);
|
||||
list1.forEach(item->{
|
||||
map.put(item.getName(),item.getId());
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -8,11 +9,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.system.enums.EventResponseEnum;
|
||||
import com.njcn.system.enums.TemplateTreeEnum;
|
||||
import com.njcn.system.mapper.EventDictMapper;
|
||||
import com.njcn.system.pojo.dto.EventReportDictDTO;
|
||||
import com.njcn.system.pojo.param.EventDictParam;
|
||||
@@ -39,36 +40,29 @@ import java.util.stream.Collectors;
|
||||
public class EventDictServiceImpl extends ServiceImpl<EventDictMapper, ReportDict> implements IEventDictService {
|
||||
|
||||
private final EventDictMapper eventDictMapper;
|
||||
/**
|
||||
* 新增字典数据
|
||||
* @param eventDictParam
|
||||
* @return
|
||||
*/
|
||||
|
||||
|
||||
@Override
|
||||
public boolean addDict (EventDictParam eventDictParam) {
|
||||
checkName(eventDictParam,false);
|
||||
ReportDict rptDict = new ReportDict();
|
||||
BeanUtils.copyProperties(eventDictParam,rptDict);
|
||||
rptDict.setState(DataStateEnum.ENABLE.getCode());
|
||||
if (Objects.equals(eventDictParam.getPid(), TemplateTreeEnum.FATHER_PID)){
|
||||
rptDict.setPids(TemplateTreeEnum.FATHER_PID);
|
||||
if (Objects.equals(eventDictParam.getPid(), BizParamConstant.PARENT_ID)){
|
||||
rptDict.setPids(BizParamConstant.PARENT_ID);
|
||||
}else{
|
||||
ReportDict fatherPid = this.lambdaQuery().eq(ReportDict::getId, eventDictParam.getPid()).one();
|
||||
if (Objects.equals(fatherPid.getPid(), TemplateTreeEnum.FATHER_PID)) {
|
||||
if (Objects.equals(fatherPid.getPid(), BizParamConstant.PARENT_ID)) {
|
||||
rptDict.setPids(eventDictParam.getPid());
|
||||
} else {
|
||||
String pidS = fatherPid.getPids();
|
||||
rptDict.setPids(pidS + "," + eventDictParam.getPid());
|
||||
rptDict.setPids(pidS + StrPool.COMMA + eventDictParam.getPid());
|
||||
}
|
||||
}
|
||||
return this.save(rptDict);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典数据
|
||||
* @param dictUpdateParam
|
||||
* @return
|
||||
*/
|
||||
|
||||
@Override
|
||||
public boolean updateDict (EventDictParam.DictUpdateParam dictUpdateParam){
|
||||
checkName(dictUpdateParam,true);
|
||||
@@ -78,11 +72,6 @@ public class EventDictServiceImpl extends ServiceImpl<EventDictMapper, ReportDic
|
||||
return this.updateById(rptDict);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean delete (String id){
|
||||
LambdaQueryWrapper<ReportDict> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -96,11 +85,6 @@ public class EventDictServiceImpl extends ServiceImpl<EventDictMapper, ReportDic
|
||||
return this.update(updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典列表
|
||||
* @param dictQueryParam
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<ReportDict> getList (EventDictParam.DictQueryParam dictQueryParam) {
|
||||
QueryWrapper<ReportDict> queryWrapper = new QueryWrapper<>();
|
||||
@@ -125,6 +109,7 @@ public class EventDictServiceImpl extends ServiceImpl<EventDictMapper, ReportDic
|
||||
return this.baseMapper.selectPage(new Page<>(PageFactory.getPageNum(dictQueryParam),PageFactory.getPageSize(dictQueryParam)),queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EventReportDictVO> getReportDictList (EventDictParam.DictQueryParam dictQueryParam) {
|
||||
QueryWrapper<ReportDict> queryWrapper = new QueryWrapper<>();
|
||||
if (Objects.nonNull(dictQueryParam)) {
|
||||
@@ -170,21 +155,13 @@ public class EventDictServiceImpl extends ServiceImpl<EventDictMapper, ReportDic
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
||||
@Override
|
||||
public ReportDict getDictById(String id){
|
||||
return this.getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典树
|
||||
* @return
|
||||
* @param type
|
||||
*/
|
||||
|
||||
@Override
|
||||
public List<EventReportDictVO> getDictTree(String type) {
|
||||
List<EventReportDictVO> list = new ArrayList<>();
|
||||
@@ -195,7 +172,7 @@ public class EventDictServiceImpl extends ServiceImpl<EventDictMapper, ReportDic
|
||||
list.add(dictVO);
|
||||
});
|
||||
return list.stream()
|
||||
.filter(fun -> Objects.equals(TemplateTreeEnum.FATHER_PID, fun.getPid()))
|
||||
.filter(fun -> Objects.equals(BizParamConstant.PARENT_ID, fun.getPid()))
|
||||
.peek(funS -> funS.setChildren(getChildList(funS, list)))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.system.enums.EventResponseEnum;
|
||||
@@ -15,7 +16,6 @@ import com.njcn.system.mapper.EventTemplateMapper;
|
||||
import com.njcn.system.mapper.TemplateRelMapper;
|
||||
import com.njcn.system.pojo.param.EventTemplateParam;
|
||||
import com.njcn.system.pojo.po.EventTemplate;
|
||||
import com.njcn.system.pojo.po.ReportTemplate;
|
||||
import com.njcn.system.pojo.po.TemplateRel;
|
||||
import com.njcn.system.pojo.vo.EventReportDictVO;
|
||||
import com.njcn.system.pojo.vo.EventTemplateVO;
|
||||
@@ -30,6 +30,8 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.util.regex.Pattern.*;
|
||||
|
||||
/**
|
||||
* @author: hany
|
||||
* @date: 2022/09/07
|
||||
@@ -40,11 +42,12 @@ import java.util.stream.Collectors;
|
||||
public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, EventTemplate> implements IEventTemplateService {
|
||||
|
||||
private final TemplateRelMapper templateRelMapper;
|
||||
|
||||
/**
|
||||
* 查询所有模板
|
||||
*
|
||||
* @author hany
|
||||
* @date 2022/09/13
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<EventTemplateVO> getList(EventTemplateParam.EventTemplateQueryParam queryParam) {
|
||||
@@ -58,20 +61,19 @@ public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, E
|
||||
}
|
||||
}
|
||||
queryWrapper.ne("report_template.state", DataStateEnum.DELETED.getCode());
|
||||
if (queryParam.getType().equals(0)){
|
||||
queryWrapper.in("report_template.type",0);
|
||||
}else if(queryParam.getType().equals(1)){
|
||||
queryWrapper.eq("report_template.type",1);
|
||||
if (queryParam.getType().equals(0)) {
|
||||
queryWrapper.in("report_template.type", 0);
|
||||
} else if (queryParam.getType().equals(1)) {
|
||||
queryWrapper.eq("report_template.type", 1);
|
||||
}
|
||||
//初始化分页数据
|
||||
Page<EventTemplateVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), queryWrapper);
|
||||
List<String> list = page.getRecords().stream().map(EventTemplateVO::getId).collect(Collectors.toList());
|
||||
if(CollectionUtil.isEmpty(list)){
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
throw new BusinessException("查询模板为空");
|
||||
}
|
||||
List<TemplateRel> templateRels = templateRelMapper.selectRelevance(list);
|
||||
if (CollectionUtil.isNotEmpty(templateRels)) {
|
||||
// Map<String, String> map = templateRels.stream().collect(Collectors.toMap(TemplateRel::getRdId, TemplateRel::getRtId));
|
||||
Map<String, List<TemplateRel>> temMap = templateRels.stream().collect(Collectors.groupingBy(TemplateRel::getRtId));
|
||||
for (EventTemplateVO record : page.getRecords()) {
|
||||
if (Objects.nonNull(temMap.get(record.getId()))) {
|
||||
@@ -86,6 +88,7 @@ public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, E
|
||||
|
||||
/**
|
||||
* 根据id查询模板数据
|
||||
*
|
||||
* @author hany
|
||||
* @date 2022/09/26
|
||||
*/
|
||||
@@ -96,21 +99,20 @@ public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, E
|
||||
|
||||
/**
|
||||
* 新增模板
|
||||
*
|
||||
* @author hany
|
||||
* @date 2022/09/08
|
||||
*/
|
||||
@Override
|
||||
public boolean add(EventTemplateParam eventTemplateParam) {
|
||||
checkName(eventTemplateParam,true);
|
||||
checkName(eventTemplateParam, true);
|
||||
EventTemplate eventTemplate = new EventTemplate();
|
||||
BeanUtils.copyProperties(eventTemplateParam,eventTemplate);
|
||||
BeanUtils.copyProperties(eventTemplateParam, eventTemplate);
|
||||
//设为正常状态
|
||||
eventTemplate.setState(DataStateEnum.ENABLE.getCode());
|
||||
boolean flag= this.save(eventTemplate);
|
||||
this.save(eventTemplate);
|
||||
String id = eventTemplate.getId();
|
||||
|
||||
List<TemplateRel> list = new ArrayList<>();
|
||||
|
||||
eventTemplateParam.getIds().forEach(rdId -> {
|
||||
TemplateRel relevancy = new TemplateRel();
|
||||
// 字典表id
|
||||
@@ -118,22 +120,22 @@ public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, E
|
||||
relevancy.setRdId(rdId);
|
||||
list.add(relevancy);
|
||||
});
|
||||
flag = templateRelMapper.batchInsert(list);
|
||||
return flag;
|
||||
return templateRelMapper.batchInsert(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改模板
|
||||
*/
|
||||
@Override
|
||||
public boolean update(EventTemplateParam.EventTemplateUpdateParam eventTemplateUpdateParam) {
|
||||
checkName(eventTemplateUpdateParam,false);
|
||||
checkName(eventTemplateUpdateParam, false);
|
||||
String id = eventTemplateUpdateParam.getId();
|
||||
EventTemplate eventTemplate = new EventTemplate();
|
||||
BeanUtils.copyProperties(eventTemplateUpdateParam,eventTemplate);
|
||||
BeanUtils.copyProperties(eventTemplateUpdateParam, eventTemplate);
|
||||
boolean flag = this.updateById(eventTemplate);
|
||||
// 先删除字典表
|
||||
templateRelMapper.deleteByRtId(id);
|
||||
if(CollUtil.isNotEmpty(eventTemplateUpdateParam.getIds())){
|
||||
if (CollUtil.isNotEmpty(eventTemplateUpdateParam.getIds())) {
|
||||
List<TemplateRel> list = new ArrayList<>();
|
||||
eventTemplateUpdateParam.getIds().forEach(rdId -> {
|
||||
TemplateRel relevancy = new TemplateRel();
|
||||
@@ -142,7 +144,7 @@ public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, E
|
||||
relevancy.setRdId(rdId);
|
||||
list.add(relevancy);
|
||||
});
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
flag = templateRelMapper.batchInsert(list);
|
||||
}
|
||||
}
|
||||
@@ -151,10 +153,7 @@ public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, E
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除模板
|
||||
* @param ids
|
||||
*/
|
||||
|
||||
@Override
|
||||
public boolean delete(List<String> ids) {
|
||||
//删除模板与字典的关系
|
||||
@@ -162,25 +161,16 @@ public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, E
|
||||
return this.lambdaUpdate().set(EventTemplate::getState, DataStateEnum.DELETED.getCode()).in(EventTemplate::getId, ids).update();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据模板id查询关系
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
|
||||
@Override
|
||||
public Boolean selectRelevance(List<String> ids) {
|
||||
//判断模板是否和字典绑定
|
||||
List<TemplateRel> templateRel = this.templateRelMapper.selectRelevance(ids);
|
||||
|
||||
if (templateRel.size() > 0){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
return !templateRel.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EventReportDictVO> selectReleation(String id) {
|
||||
public List<EventReportDictVO> selectRelation(String id) {
|
||||
List<EventReportDictVO> list = new ArrayList<>();
|
||||
List<String> configs = templateRelMapper.selectReleation(id);
|
||||
configs = configs.stream().filter(t -> !isContainChinese(t)).collect(Collectors.toList());
|
||||
@@ -200,11 +190,7 @@ public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, E
|
||||
* @return true 包含中文字符 false 不包含中文字符
|
||||
*/
|
||||
public static boolean isContainChinese(String str) {
|
||||
|
||||
// if (StringUtils.isEmpty(str)) {
|
||||
// throw new EmptyException("sms context is empty!");
|
||||
// }
|
||||
Pattern p = Pattern.compile("[\u4E00-\u9FA5|\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:|\\;|\\【|\\】]");
|
||||
Pattern p = compile(PatternRegex.CHINESE_REGEX);
|
||||
Matcher m = p.matcher(str);
|
||||
return m.find();
|
||||
}
|
||||
@@ -212,14 +198,14 @@ public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, E
|
||||
/**
|
||||
* 名称重复校验
|
||||
*/
|
||||
private void checkName(EventTemplateParam eventTemplateParam,boolean flag) {
|
||||
private void checkName(EventTemplateParam eventTemplateParam, boolean flag) {
|
||||
LambdaQueryWrapper<EventTemplate> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(EventTemplate::getName,eventTemplateParam.getName())
|
||||
.eq(EventTemplate::getType,eventTemplateParam.getType());
|
||||
lambdaQueryWrapper.eq(EventTemplate::getName, eventTemplateParam.getName())
|
||||
.eq(EventTemplate::getType, eventTemplateParam.getType());
|
||||
//修改
|
||||
if(!flag){
|
||||
if(eventTemplateParam instanceof EventTemplateParam.EventTemplateUpdateParam ){
|
||||
lambdaQueryWrapper.ne(EventTemplate::getId,((EventTemplateParam.EventTemplateUpdateParam)eventTemplateParam).getId());
|
||||
if (!flag) {
|
||||
if (eventTemplateParam instanceof EventTemplateParam.EventTemplateUpdateParam) {
|
||||
lambdaQueryWrapper.ne(EventTemplate::getId, ((EventTemplateParam.EventTemplateUpdateParam) eventTemplateParam).getId());
|
||||
}
|
||||
}
|
||||
int result = this.count(lambdaQueryWrapper);
|
||||
|
||||
@@ -39,11 +39,7 @@ public class EventTreeServiceImpl extends ServiceImpl<TemplateRelMapper, Templat
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
*根据模板删除
|
||||
* @param temIndex
|
||||
* @return
|
||||
*/
|
||||
|
||||
public boolean deleteTemplate(String temIndex) {
|
||||
QueryWrapper<TemplateRel> templateRelQueryWrapper = new QueryWrapper<>();
|
||||
templateRelQueryWrapper.eq("report_relevancy.Rt_Id",temIndex);
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import com.njcn.device.pq.pojo.param.LargeScreenParam;
|
||||
import com.njcn.device.pq.pojo.vo.DataScaleVO;
|
||||
import com.njcn.system.mapper.LargeScreenMapper;
|
||||
import com.njcn.system.service.LargeScreenService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: zbj
|
||||
* @date: 2023/04/10
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class LargeScreenServiceImpl implements LargeScreenService {
|
||||
|
||||
private final LargeScreenMapper largeScreenMapper;
|
||||
|
||||
/**
|
||||
* 数据规模
|
||||
*/
|
||||
@Override
|
||||
public List<DataScaleVO> getDataScale(LargeScreenParam largeScreenParam) {
|
||||
//创建返回VO
|
||||
List<DataScaleVO> result = new ArrayList<>();
|
||||
//创建模板
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
//获取当前日期
|
||||
LocalDate today = LocalDate.now();
|
||||
String endTime = today.format(formatter);
|
||||
String startTime = "";
|
||||
//获取30天前的日期
|
||||
try {
|
||||
startTime = getDate(endTime);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
largeScreenParam.setSearchBeginTime(startTime);
|
||||
largeScreenParam.setSearchEndTime(endTime);
|
||||
List<DataScaleVO> list = largeScreenMapper.getDataScale(largeScreenParam);
|
||||
//获取区间中所有日期
|
||||
List<String> days = null;
|
||||
try {
|
||||
days = selectDate(startTime, endTime);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//加上今天
|
||||
days.add(endTime);
|
||||
for (String s : days) {
|
||||
DataScaleVO vo = new DataScaleVO();
|
||||
vo.setTimeId(s);
|
||||
result.add(vo);
|
||||
}
|
||||
//集合不为空
|
||||
if (list.size() > 0) {
|
||||
for (DataScaleVO dataScaleVO : result) {
|
||||
for (DataScaleVO scaleVO : list) {
|
||||
if (Objects.equals(scaleVO.getTimeId(), dataScaleVO.getTimeId())) {
|
||||
dataScaleVO.setDataStatis(scaleVO.getDataStatis());
|
||||
}
|
||||
}
|
||||
}
|
||||
for (DataScaleVO vo : result) {
|
||||
if (vo.getDataStatis() == null) {
|
||||
vo.setDataStatis(0.0f);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 传入字符串日期获取当前日期30天日期
|
||||
*
|
||||
* @param stringDate
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String getDate(String stringDate) throws Exception {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date date = sdf.parse(stringDate); // 将字符串日期转换为Date对象
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -30); // 计算30天前的日期
|
||||
Date newDate = calendar.getTime(); // 获取新日期
|
||||
String newDateStr = sdf.format(newDate); // 将新日期转换为字符串日期
|
||||
return newDateStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取传入起始月结束月中所有天
|
||||
*
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
public List<String> selectDate(String startTime, String endTime) throws Exception {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
Date startDate = sdf.parse(startTime);
|
||||
Date endDate = sdf.parse(endTime);
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(startDate);
|
||||
|
||||
List<String> dates = new ArrayList<>();
|
||||
while (calendar.getTime().before(endDate)) {
|
||||
Date date = calendar.getTime();
|
||||
String dateStr = sdf.format(date);
|
||||
dates.add(dateStr);
|
||||
calendar.add(Calendar.DATE, 1);
|
||||
}
|
||||
return dates;
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.system.mapper.MxGraphMapper;
|
||||
import com.njcn.system.pojo.param.MxGraphParam;
|
||||
import com.njcn.system.pojo.po.MxGraph;
|
||||
import com.njcn.system.service.IMxGraphService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MxGraphServiceImpl extends ServiceImpl<MxGraphMapper, MxGraph> implements IMxGraphService {
|
||||
|
||||
private final MxGraphMapper mxGraphMapper;
|
||||
|
||||
@Override
|
||||
public boolean addKingView(MxGraphParam mxGraphParam) {
|
||||
MxGraph mxGraph = new MxGraph();
|
||||
BeanUtils.copyProperties(mxGraphParam,mxGraph);
|
||||
mxGraph.setState(DataStateEnum.ENABLE.getCode());
|
||||
return this.save(mxGraph);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MxGraph> getKingViewList() {
|
||||
LambdaQueryWrapper<MxGraph> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.orderByAsc(MxGraph::getSort);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MxGraph getKingViewById(String id) {
|
||||
return this.getById(id);
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,21 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
import com.njcn.system.mapper.ReportTemplateMapper;
|
||||
import com.njcn.system.pojo.param.ReportTemplateParam;
|
||||
import com.njcn.system.pojo.po.ReportTemplate;
|
||||
import com.njcn.system.service.ReportTemplateService;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* pqs-event
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
import com.njcn.system.mapper.ResourceAdministrationMapper;
|
||||
import com.njcn.system.pojo.po.Resinformation;
|
||||
import com.njcn.system.pojo.po.ResinformationParam;
|
||||
import com.njcn.system.service.IResourceAdministrationService;
|
||||
import com.njcn.user.pojo.dto.excel.UserExcel;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -21,12 +16,8 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
@@ -42,8 +33,6 @@ public class ResourceAdministrationServiceImpl extends ServiceImpl<ResourceAdmin
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
|
||||
//private final GeneralInfo generalInfo;
|
||||
|
||||
@Override
|
||||
public Boolean uploadFile(MultipartFile multipartFile, String name, String type, String description, String systemType) {
|
||||
//通过封装好的文件工具类来传入文件和文件夹名称来获取文件路径
|
||||
@@ -55,10 +44,9 @@ public class ResourceAdministrationServiceImpl extends ServiceImpl<ResourceAdmin
|
||||
resinformation.setUrl(url);
|
||||
//获取用户id
|
||||
String userIndex = RequestUtil.getUserIndex();
|
||||
//String userIndex = "123456";
|
||||
resinformation.setUpdateUser(userIndex);
|
||||
resinformation.setUpdateTime(LocalDateTime.now());
|
||||
resinformation.setState(1);
|
||||
resinformation.setState(DataStateEnum.ENABLE.getCode());
|
||||
resinformation.setFileName(multipartFile.getOriginalFilename());
|
||||
if (StringUtils.isNotBlank(systemType)) {
|
||||
resinformation.setSystemType(systemType);
|
||||
@@ -69,27 +57,19 @@ public class ResourceAdministrationServiceImpl extends ServiceImpl<ResourceAdmin
|
||||
|
||||
@Override
|
||||
public List<Resinformation> queryData(Resinformation resinformation) {
|
||||
|
||||
if (StringUtils.isNotBlank(resinformation.getType()) && StringUtils.isNotBlank(resinformation.getSystemType())) {
|
||||
LambdaQueryWrapper<Resinformation> wrapper = new LambdaQueryWrapper<>();
|
||||
//type
|
||||
wrapper.eq(Resinformation::getType, resinformation.getType());
|
||||
//sysType
|
||||
wrapper.eq(Resinformation::getSystemType, resinformation.getSystemType());
|
||||
wrapper.eq(Resinformation::getType, resinformation.getType())
|
||||
.eq(Resinformation::getSystemType, resinformation.getSystemType());
|
||||
return resourceAdministrationMapper.selectList(wrapper);
|
||||
|
||||
} else if (StringUtils.isBlank(resinformation.getType()) && StringUtils.isBlank(resinformation.getSystemType())) {
|
||||
|
||||
return this.list();
|
||||
|
||||
} else if (StringUtils.isNotBlank(resinformation.getType()) && StringUtils.isBlank(resinformation.getSystemType())) {
|
||||
LambdaQueryWrapper<Resinformation> wrapper = new LambdaQueryWrapper<>();
|
||||
//type
|
||||
wrapper.eq(Resinformation::getType, resinformation.getType());
|
||||
return resourceAdministrationMapper.selectList(wrapper);
|
||||
} else {
|
||||
LambdaQueryWrapper<Resinformation> wrapper = new LambdaQueryWrapper<>();
|
||||
//sysType
|
||||
wrapper.eq(Resinformation::getSystemType, resinformation.getSystemType());
|
||||
return resourceAdministrationMapper.selectList(wrapper);
|
||||
}
|
||||
@@ -110,7 +90,6 @@ public class ResourceAdministrationServiceImpl extends ServiceImpl<ResourceAdmin
|
||||
resinformation.setDescription(description);
|
||||
//获取用户id
|
||||
String userIndex = RequestUtil.getUserIndex();
|
||||
//String userIndex = "123456";
|
||||
resinformation.setUpdateUser(userIndex);
|
||||
resinformation.setUpdateTime(LocalDateTime.now());
|
||||
resinformation.setState(1);
|
||||
@@ -133,19 +112,9 @@ public class ResourceAdministrationServiceImpl extends ServiceImpl<ResourceAdmin
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadFile(String id, HttpServletResponse response) throws IOException {
|
||||
public void downloadFile(String id, HttpServletResponse response) {
|
||||
Resinformation resinformation = resourceAdministrationMapper.selectById(id);
|
||||
//下载文件
|
||||
fileStorageUtil.downloadStream(response, resinformation.getUrl());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportData() {
|
||||
String fileName = "资源列表.csv";
|
||||
//String targetDir = generalInfo.getBusinessTempPath() + File.separator + RequestUtil.getUserIndex();
|
||||
String targetDir = "C:\\Users\\User\\Desktop\\1";
|
||||
File excel = new File(targetDir, fileName);
|
||||
List<ResinformationParam> list = resourceAdministrationMapper.listAll();
|
||||
ExcelUtil.exportExcelWithTargetFile(excel, ResinformationParam.class, list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.constant.DicState;
|
||||
import com.njcn.system.pojo.param.DictTreeParam;
|
||||
import com.njcn.system.pojo.vo.DictTreeVO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -37,22 +38,20 @@ public class SysDicTreePOServiceImpl extends ServiceImpl<SysDicTreePOMapper, Sys
|
||||
public boolean addDictTree(DictTreeParam dictTreeParam) {
|
||||
SysDicTreePO sysDicTreePO = new SysDicTreePO();
|
||||
BeanUtils.copyProperties(dictTreeParam, sysDicTreePO);
|
||||
if (!Objects.equals(sysDicTreePO.getPid(), "0")) {
|
||||
if (!Objects.equals(sysDicTreePO.getPid(), BizParamConstant.PARENT_ID)) {
|
||||
QueryWrapper<SysDicTreePO> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.eq("id", sysDicTreePO.getPid());
|
||||
SysDicTreePO instance = this.baseMapper.selectOne(queryWrapper);
|
||||
|
||||
|
||||
sysDicTreePO.setPids(instance.getPids() + "," + instance.getId());
|
||||
sysDicTreePO.setPids(instance.getPids() + StrPool.COMMA + instance.getId());
|
||||
|
||||
} else {
|
||||
sysDicTreePO.setPids("0");
|
||||
sysDicTreePO.setPids(BizParamConstant.PARENT_ID);
|
||||
}
|
||||
sysDicTreePO.setStatus(0);
|
||||
boolean save = this.save(sysDicTreePO);
|
||||
|
||||
return save;
|
||||
return this.save(sysDicTreePO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,9 +103,8 @@ public class SysDicTreePOServiceImpl extends ServiceImpl<SysDicTreePOMapper, Sys
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictTreeVO> queryByid(String id) {
|
||||
List<DictTreeVO> dictTreeVOS = this.baseMapper.queryByid(id);
|
||||
return dictTreeVOS;
|
||||
public List<DictTreeVO> queryLastLevelById(String id) {
|
||||
return this.baseMapper.queryLastLevelById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -133,21 +131,19 @@ public class SysDicTreePOServiceImpl extends ServiceImpl<SysDicTreePOMapper, Sys
|
||||
LambdaQueryWrapper<SysDicTreePO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SysDicTreePO::getStatus, 0);
|
||||
List<SysDicTreePO> sysDicTreePOList = this.list(lambdaQueryWrapper);
|
||||
List<SysDicTreePO> parent = sysDicTreePOList.stream().filter(item -> item.getPid().equals("0") && !item.getCode().equals("Device_Unit")).peek(item -> {
|
||||
return sysDicTreePOList.stream().filter(item -> BizParamConstant.PARENT_ID.equals(item.getPid()) && !item.getCode().equals(DicDataTypeEnum.DEVICE_UNIT.getCode())).peek(item -> {
|
||||
item.setLevel(0);
|
||||
item.setChildren(getChildren(item, sysDicTreePOList));
|
||||
}).collect(Collectors.toList());
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDicTreePO> queryByCodeList(String code) {
|
||||
List<SysDicTreePO> sysDicTreePOList = this.list(new LambdaQueryWrapper<SysDicTreePO>().eq(SysDicTreePO::getStatus, 0));
|
||||
List<SysDicTreePO> parent = sysDicTreePOList.stream().filter(item -> item.getCode().equals(code)).peek(item -> {
|
||||
return sysDicTreePOList.stream().filter(item -> item.getCode().equals(code)).peek(item -> {
|
||||
item.setLevel(0);
|
||||
item.setChildren(getChildren(item, sysDicTreePOList));
|
||||
}).collect(Collectors.toList());
|
||||
return parent;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,17 +3,13 @@ package com.njcn.system.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
import com.njcn.system.enums.ThemeEnum;
|
||||
import com.njcn.system.mapper.ThemeMapper;
|
||||
import com.njcn.system.pojo.constant.ThemeState;
|
||||
import com.njcn.system.pojo.param.DictDataParam;
|
||||
import com.njcn.system.pojo.param.ThemeParam;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.Theme;
|
||||
import com.njcn.system.service.IThemeService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -25,7 +21,6 @@ import sun.misc.BASE64Encoder;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -163,7 +158,7 @@ public class ThemeServiceImpl extends ServiceImpl<ThemeMapper, Theme> implements
|
||||
String base64EncoderImg= null;
|
||||
try {
|
||||
BASE64Encoder bEncoder=new BASE64Encoder();
|
||||
String[] suffixArra=file.getOriginalFilename().split("\\.");
|
||||
String[] suffixArra= Objects.requireNonNull(file.getOriginalFilename()).split("\\.");
|
||||
String preffix="data:image/jpg;base64,".replace("jpg", suffixArra[suffixArra.length - 1]);
|
||||
base64EncoderImg = preffix + bEncoder.encode(file.getBytes()).replaceAll("[\\s*\t\n\r]", "");
|
||||
} catch (IOException e) {
|
||||
|
||||
@@ -11,14 +11,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
import com.njcn.system.mapper.TimersMapper;
|
||||
import com.njcn.system.pojo.enums.TimerJobStatusEnum;
|
||||
import com.njcn.system.pojo.param.TimersParam;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.Timers;
|
||||
import com.njcn.system.pojo.vo.DictDataVO;
|
||||
import com.njcn.system.pojo.vo.TimersVO;
|
||||
import com.njcn.system.service.ITimersService;
|
||||
import com.njcn.system.timer.TimerExeService;
|
||||
@@ -51,6 +48,7 @@ public class TimersServiceImpl extends ServiceImpl<TimersMapper, Timers> impleme
|
||||
|
||||
@Value("${runTake.maxRetryCount}")
|
||||
private Integer maxRetryCount;
|
||||
|
||||
@Value("${runTake.delayTime}")
|
||||
private Integer delayTime;
|
||||
|
||||
@@ -163,7 +161,8 @@ public class TimersServiceImpl extends ServiceImpl<TimersMapper, Timers> impleme
|
||||
}
|
||||
|
||||
public void runTaskWithRetryAndDelay(TimerTaskRunner timerTaskRunner,String date) throws InterruptedException {
|
||||
int retryCount = 0; // 重试次数计数器
|
||||
// 重试次数计数器
|
||||
int retryCount = 0;
|
||||
while (retryCount < maxRetryCount) {
|
||||
try {
|
||||
System.out.println("重试机制:"+(retryCount+1));
|
||||
@@ -172,14 +171,12 @@ public class TimersServiceImpl extends ServiceImpl<TimersMapper, Timers> impleme
|
||||
return; // 任务执行成功,跳出循环
|
||||
} catch (Exception e) {
|
||||
// 处理异常
|
||||
retryCount++; // 增加重试次数
|
||||
Thread.sleep(delayTime); // 等待一段时间
|
||||
// 增加重试次数
|
||||
retryCount++;
|
||||
// 等待一段时间
|
||||
Thread.sleep(delayTime);
|
||||
}
|
||||
}
|
||||
if (retryCount >= maxRetryCount) {
|
||||
// 达到最大重试次数,终止任务
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,32 +35,4 @@ public class UserLogServiceImpl extends ServiceImpl<UserLogMapper, UserLog> impl
|
||||
this.baseMapper.insert(userLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 严重度 文字 转 数字
|
||||
*/
|
||||
private Integer levelStringToNumber(String level) {
|
||||
switch (level) {
|
||||
case "中等":
|
||||
return 1;
|
||||
case "严重":
|
||||
return 2;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 严重度 数字 转 文字
|
||||
*/
|
||||
private String levelNumberToString(Integer level) {
|
||||
switch (level) {
|
||||
case 1:
|
||||
return "中等";
|
||||
case 2:
|
||||
return "严重";
|
||||
default:
|
||||
return "普通";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
import com.njcn.system.timer.TimerExeService;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -19,9 +20,9 @@ import org.springframework.stereotype.Service;
|
||||
* @author hongawen
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class HutoolTimerExeServiceImpl implements TimerExeService {
|
||||
|
||||
private static final Log log = Log.get();
|
||||
@Value("${runTake.maxRetryCount}")
|
||||
private Integer maxRetryCount;
|
||||
@Value("${runTake.delayTime}")
|
||||
@@ -62,7 +63,8 @@ public class HutoolTimerExeServiceImpl implements TimerExeService {
|
||||
}
|
||||
|
||||
public void runTaskWithRetryAndDelay(TimerTaskRunner timerTaskRunner) throws InterruptedException {
|
||||
int retryCount = 0; // 重试次数计数器
|
||||
// 重试次数计数器
|
||||
int retryCount = 0;
|
||||
while (retryCount < maxRetryCount) {
|
||||
try {
|
||||
System.out.println("重试机制:"+(retryCount+1));
|
||||
@@ -70,13 +72,11 @@ public class HutoolTimerExeServiceImpl implements TimerExeService {
|
||||
return; // 任务执行成功,跳出循环
|
||||
} catch (Exception e) {
|
||||
// 处理异常
|
||||
retryCount++; // 增加重试次数
|
||||
Thread.sleep(delayTime); // 等待一段时间
|
||||
// 增加重试次数
|
||||
retryCount++;
|
||||
// 等待一段时间
|
||||
Thread.sleep(delayTime);
|
||||
}
|
||||
}
|
||||
if (retryCount >= maxRetryCount) {
|
||||
// 达到最大重试次数,终止任务
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn;
|
||||
|
||||
import com.njcn.supervision.api.TempLineRunTestFeignClient;
|
||||
import com.njcn.system.service.IAreaService;
|
||||
import com.njcn.system.service.IDictTypeService;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -16,13 +17,13 @@ public class DictDataTest extends BaseJunitTest{
|
||||
private IDictTypeService dictTypeService;
|
||||
|
||||
@Autowired
|
||||
private TempLineRunTestFeignClient tempLineRunTestFeignClient;
|
||||
private IAreaService areaService;
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
tempLineRunTestFeignClient.isTestRunStartOrEnd();
|
||||
System.out.println(areaService.areaPro("110105000000", 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
||||
//判断是否满足锁定时间
|
||||
if (nowTime.isBefore(lockTime)) {
|
||||
CommonResponseEnum testEnum = CommonResponseEnum.DYNAMIC_RESPONSE_ENUM;
|
||||
testEnum.setMessage("账号已被锁定:锁定剩余时长"+ ChronoUnit.MINUTES.between(nowTime, lockTime)+"分钟");
|
||||
testEnum.setMessage("账号已被锁定:锁定剩余时长" + ChronoUnit.MINUTES.between(nowTime, lockTime) + "分钟");
|
||||
throw new BusinessException(testEnum);
|
||||
}
|
||||
break;
|
||||
@@ -237,7 +237,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
||||
public boolean deleteUser(String id) {
|
||||
return this.lambdaUpdate()
|
||||
.set(User::getState, UserState.DELETE)
|
||||
.set(User::getPhone,null)
|
||||
.set(User::getPhone, null)
|
||||
.in(User::getId, id)
|
||||
.update();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user