操作日志-部门显示修改
This commit is contained in:
+4
-4
@@ -132,11 +132,11 @@ public class ActSarItemsBussEOService {
|
||||
String sarStandAttrInfo = JSONObject.toJSONString(attrInfoMap);
|
||||
SarBussionessStand bussionessStand = new SarBussionessStand();
|
||||
bussionessStand.setId(standId);
|
||||
if("2".equals(reviewResults) || "3".equals(reviewResults)) { // 废止,有效时才修改文本状态
|
||||
bussionessStand.setTextStatusBuss(textStatus);
|
||||
}
|
||||
bussionessStand.setTextStatusBuss(textStatus);
|
||||
bussionessStand.setSarStandAttrEOStr(sarStandAttrInfo);
|
||||
iSarBussionessStandService.updateSarBussionessStand(bussionessStand);
|
||||
if("2".equals(reviewResults) || "3".equals(reviewResults)) { // 废止,有效时才修改文本状态
|
||||
iSarBussionessStandService.updateSarBussionessStand(bussionessStand);
|
||||
}
|
||||
|
||||
SarBussionessStandState state = new SarBussionessStandState();
|
||||
state.setStandId(standId);
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
*/
|
||||
public interface SysLogDao extends BaseMapper<SysLog> {
|
||||
|
||||
List<SysLogExcel> getSysLogExcelVOExcelData(@Param("sysLogReqDTO") SysLogReqExportDTO sysLogReqDTO);
|
||||
List<SysLog> getSysLogExcelVOExcelData(@Param("sysLogReqDTO") SysLogReqExportDTO sysLogReqDTO);
|
||||
|
||||
IPage<SysLog> queryAllLog(Page page,@Param("sysLogReqDTO") SysLogReqDTO sysLogReqDTO);
|
||||
}
|
||||
|
||||
@@ -72,6 +72,9 @@ public class SysLog extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private String dept;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String parentIds;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String accountName;
|
||||
|
||||
|
||||
+76
-1
@@ -1,17 +1,27 @@
|
||||
package com.adc.da.slrs.sysLog.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.adc.da.slrs.sarInstitution.dao.TsInstitutionDao;
|
||||
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
|
||||
import com.adc.da.slrs.sysLog.entity.SysLog;
|
||||
import com.adc.da.slrs.sysLog.dao.SysLogDao;
|
||||
import com.adc.da.slrs.sysLog.entity.SysLogExcel;
|
||||
import com.adc.da.slrs.sysLog.service.ISysLogService;
|
||||
import com.adc.da.slrs.sysLog.vo.SysLogReqDTO;
|
||||
import com.adc.da.slrs.sysLog.vo.SysLogReqExportDTO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -24,15 +34,80 @@ import java.util.List;
|
||||
@Service
|
||||
public class SysLogServiceImpl extends ServiceImpl<SysLogDao, SysLog> implements ISysLogService {
|
||||
|
||||
@Autowired
|
||||
private TsInstitutionDao tsInstitutionDao;
|
||||
|
||||
@Override
|
||||
public List<SysLogExcel> getSysLogExcelVOExcelData(SysLogReqExportDTO sysLogReqDTO) {
|
||||
return this.baseMapper.getSysLogExcelVOExcelData(sysLogReqDTO);
|
||||
List<SysLog> datas = this.baseMapper.getSysLogExcelVOExcelData(sysLogReqDTO);
|
||||
QueryWrapper<TsInstitution> queryWrapper = new QueryWrapper<>();
|
||||
List<TsInstitution> tsInstitutionList = tsInstitutionDao.selectList(queryWrapper);
|
||||
List<TsInstitution> tsInstitutions = new ArrayList<>();
|
||||
List<SysLogExcel> sysLogExcelList = new ArrayList<>();
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
// 处理部门字段
|
||||
for (SysLog sysLog : datas) {
|
||||
SysLogExcel sysLogExcel = new SysLogExcel();
|
||||
sysLogExcel.setAccount(sysLog.getAccount());
|
||||
sysLogExcel.setDept(sysLog.getDept());
|
||||
sysLogExcel.setOper(sysLog.getOper());
|
||||
sysLogExcel.setOperTime(simpleDateFormat.format(sysLog.getOperTime()));
|
||||
sysLogExcel.setSpecial(sysLog.getSpecial());
|
||||
|
||||
if (StringUtils.isNotEmpty(sysLog.getParentIds())) {
|
||||
String[] parentIds = sysLog.getParentIds().split(",");
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (int i = parentIds.length - 1; i >= 0; i--) {
|
||||
String parentId = parentIds[i];
|
||||
if ("30000000".equals(parentIds[i])) {
|
||||
continue;
|
||||
}
|
||||
tsInstitutions = tsInstitutionList.stream().filter(e -> parentId.equals(e.getId())).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(tsInstitutions)) {
|
||||
stringBuilder.append(tsInstitutions.get(0).getName()).append("-");
|
||||
}
|
||||
}
|
||||
stringBuilder.append(sysLog.getDept());
|
||||
if (StringUtils.isNotEmpty(stringBuilder.toString())) {
|
||||
sysLogExcel.setDept(stringBuilder.toString());
|
||||
}
|
||||
}
|
||||
|
||||
sysLogExcelList.add(sysLogExcel);
|
||||
}
|
||||
return sysLogExcelList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<SysLog> getAllLog(SysLogReqDTO sysLogReqDTO) {
|
||||
Page<SysLog> page = new Page<>(sysLogReqDTO.getPage(), sysLogReqDTO.getPageSize());
|
||||
IPage<SysLog> result = baseMapper.queryAllLog(page,sysLogReqDTO);
|
||||
List<SysLog> datas = result.getRecords();
|
||||
|
||||
QueryWrapper<TsInstitution> queryWrapper = new QueryWrapper<>();
|
||||
List<TsInstitution> tsInstitutionList = tsInstitutionDao.selectList(queryWrapper);
|
||||
List<TsInstitution> tsInstitutions = new ArrayList<>();
|
||||
for (SysLog sysLog : datas) {
|
||||
if (StringUtils.isNotEmpty(sysLog.getParentIds())) {
|
||||
String[] parentIds = sysLog.getParentIds().split(",");
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (int i = parentIds.length - 1; i >= 0; i--) {
|
||||
String parentId = parentIds[i];
|
||||
if ("30000000".equals(parentIds[i])) {
|
||||
continue;
|
||||
}
|
||||
tsInstitutions = tsInstitutionList.stream().filter(e -> parentId.equals(e.getId())).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(tsInstitutions)) {
|
||||
stringBuilder.append(tsInstitutions.get(0).getName()).append("-");
|
||||
}
|
||||
|
||||
}
|
||||
stringBuilder.append(sysLog.getDept());
|
||||
if (StringUtils.isNotEmpty(stringBuilder.toString())) {
|
||||
sysLog.setDept(stringBuilder.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.sysLog.dao.SysLogDao">
|
||||
|
||||
<select id="getSysLogExcelVOExcelData" parameterType="com.adc.da.slrs.sysLog.vo.SysLogReqExportDTO" resultType="com.adc.da.slrs.sysLog.entity.SysLogExcel">
|
||||
select CONCAT('(',ts_user.account,')',ts_user.UNAME) as account,ts_user.UNAME as accountName,ts_institution.name dept,sys_log.oper_time,sys_log.oper,sys_log.special from sys_log
|
||||
<select id="getSysLogExcelVOExcelData" parameterType="com.adc.da.slrs.sysLog.vo.SysLogReqExportDTO" resultType="com.adc.da.slrs.sysLog.entity.SysLog">
|
||||
select CONCAT('(',ts_user.account,')',ts_user.UNAME) as account,ts_user.UNAME as accountName,ts_institution.name dept,ts_institution.parent_ids,sys_log.oper_time,sys_log.oper,sys_log.special from sys_log
|
||||
left join ts_user on sys_log.user_id = ts_user.usid
|
||||
left join ts_institution on ts_user.institution_id = ts_institution.id
|
||||
WHERE 1=1 and sys_log.oper_time >= DATE_SUB(CURDATE(),INTERVAL 1 YEAR)
|
||||
@@ -26,7 +26,7 @@
|
||||
</select>
|
||||
|
||||
<select id="queryAllLog" parameterType="com.adc.da.slrs.sysLog.vo.SysLogReqDTO" resultType="com.adc.da.slrs.sysLog.entity.SysLog">
|
||||
select ts_user.account,ts_user.UNAME as accountName,ts_institution.name dept,sys_log.oper_time,sys_log.oper,sys_log.special from sys_log
|
||||
select ts_user.account,ts_user.UNAME as accountName,ts_institution.name dept,ts_institution.parent_ids,sys_log.oper_time,sys_log.oper,sys_log.special from sys_log
|
||||
left join ts_user on sys_log.user_id = ts_user.usid
|
||||
left join ts_institution on ts_user.institution_id = ts_institution.id
|
||||
WHERE 1=1
|
||||
|
||||
Reference in New Issue
Block a user