Merge branch 'develop_master' into FOTON

This commit is contained in:
zyd
2022-10-26 22:47:10 +08:00
7 changed files with 141 additions and 16 deletions
@@ -132,11 +132,11 @@ public class ActSarItemsBussEOService {
String sarStandAttrInfo = JSONObject.toJSONString(attrInfoMap); String sarStandAttrInfo = JSONObject.toJSONString(attrInfoMap);
SarBussionessStand bussionessStand = new SarBussionessStand(); SarBussionessStand bussionessStand = new SarBussionessStand();
bussionessStand.setId(standId); bussionessStand.setId(standId);
if("2".equals(reviewResults) || "3".equals(reviewResults)) { // 废止,有效时才修改文本状态 bussionessStand.setTextStatusBuss(textStatus);
bussionessStand.setTextStatusBuss(textStatus);
}
bussionessStand.setSarStandAttrEOStr(sarStandAttrInfo); bussionessStand.setSarStandAttrEOStr(sarStandAttrInfo);
iSarBussionessStandService.updateSarBussionessStand(bussionessStand); if("2".equals(reviewResults) || "3".equals(reviewResults)) { // 废止,有效时才修改文本状态
iSarBussionessStandService.updateSarBussionessStand(bussionessStand);
}
SarBussionessStandState state = new SarBussionessStandState(); SarBussionessStandState state = new SarBussionessStandState();
state.setStandId(standId); state.setStandId(standId);
@@ -245,6 +245,9 @@ public class SarBussionessStand extends BaseEntity {
private String issueTimeEnd; private String issueTimeEnd;
@TableField(exist = false) @TableField(exist = false)
private String prcCreateUser; private String prcCreateUser;
//体系类别ID
@TableField(exist = false)
private String txlbId;
public static long getSerialVersionUID() { public static long getSerialVersionUID() {
return serialVersionUID; return serialVersionUID;
@@ -623,10 +623,9 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
} }
createStandAttrInfo(sarBussionessStandEO,true); createStandAttrInfo(sarBussionessStandEO,true);
//此处需要增加根据技术体系更新菜单数据关联得操作,之前是在点编辑得时候处理,但是前端没有处理好 //此处需要增加根据技术体系更新菜单数据关联得操作,之前是在点编辑得时候处理,但是前端没有处理好
if(StringUtils.isNotBlank(sarBussionessStandEO.getSarStandAttrEOStr())){ if(StringUtils.isNotBlank(sarBussionessStandEO.getTxlbId())){
String sarStandAttrEOStr = sarBussionessStandEO.getSarStandAttrEOStr(); SarMenuStandard sarMenuStandard = iSarMenuStandardService.selectMenuById(sarBussionessStandEO.getTxlbId());
Map<String,String> sarStandAttrMap = JSONObject.fromObject(sarStandAttrEOStr); if(sarMenuStandard!=null ){
if(sarStandAttrMap.containsKey("TXLBBUSS") && StringUtils.isNotBlank(sarStandAttrMap.get("TXLBBUSS"))){
QueryWrapper<SarBussStandMenu> menuQueryWrapper = new QueryWrapper<>(); QueryWrapper<SarBussStandMenu> menuQueryWrapper = new QueryWrapper<>();
menuQueryWrapper.eq("BUSS_STAND_ID",sarBussionessStandEO.getId()); menuQueryWrapper.eq("BUSS_STAND_ID",sarBussionessStandEO.getId());
// menuQueryWrapper.eq("MENU_ID",sarStandAttrMap.get("TXLBBUSS")); // menuQueryWrapper.eq("MENU_ID",sarStandAttrMap.get("TXLBBUSS"));
@@ -637,7 +636,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
boolean upFlag = true; boolean upFlag = true;
List<String> delIds = new ArrayList<>(); List<String> delIds = new ArrayList<>();
for(SarBussStandMenu m: sarBussStandMenus){ for(SarBussStandMenu m: sarBussStandMenus){
if(StringUtils.equals(m.getMenuId(),sarStandAttrMap.get("TXLBBUSS"))){ if(StringUtils.equals(m.getMenuId(),sarBussionessStandEO.getTxlbId())){
upFlag= false; upFlag= false;
}else{ }else{
delIds.add(m.getId()); delIds.add(m.getId());
@@ -645,7 +644,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
} }
if(upFlag){ if(upFlag){
SarBussStandMenu jsMenu = new SarBussStandMenu(); SarBussStandMenu jsMenu = new SarBussStandMenu();
jsMenu.setMenuId(sarStandAttrMap.get("TXLBBUSS")); jsMenu.setMenuId(sarBussionessStandEO.getTxlbId());
jsMenu.setValidFlag(0); jsMenu.setValidFlag(0);
jsMenu.setTreeType("sarMs"); jsMenu.setTreeType("sarMs");
jsMenu.setBussStandId(sarBussionessStandEO.getId()); jsMenu.setBussStandId(sarBussionessStandEO.getId());
@@ -657,7 +656,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
} }
}else{ }else{
SarBussStandMenu jsMenu = new SarBussStandMenu(); SarBussStandMenu jsMenu = new SarBussStandMenu();
jsMenu.setMenuId(sarStandAttrMap.get("TXLBBUSS")); jsMenu.setMenuId(sarBussionessStandEO.getTxlbId());
jsMenu.setValidFlag(0); jsMenu.setValidFlag(0);
jsMenu.setTreeType("sarMs"); jsMenu.setTreeType("sarMs");
jsMenu.setBussStandId(sarBussionessStandEO.getId()); jsMenu.setBussStandId(sarBussionessStandEO.getId());
@@ -666,6 +665,51 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
} }
} }
} }
// if(StringUtils.isNotBlank(sarBussionessStandEO.getSarStandAttrEOStr())){
// String sarStandAttrEOStr = sarBussionessStandEO.getSarStandAttrEOStr();
// Map<String,String> sarStandAttrMap = JSONObject.fromObject(sarStandAttrEOStr);
// //此处有BUG,因为前端传的参数中只有名称,没有ID,导致此处数据保存的时候直接保存了名字而不是ID,从而查不出来的BUG
// if(sarStandAttrMap.containsKey("TXLBBUSS") && StringUtils.isNotBlank(sarStandAttrMap.get("TXLBBUSS"))){
// QueryWrapper<SarBussStandMenu> menuQueryWrapper = new QueryWrapper<>();
// menuQueryWrapper.eq("BUSS_STAND_ID",sarBussionessStandEO.getId());
//// menuQueryWrapper.eq("MENU_ID",sarStandAttrMap.get("TXLBBUSS"));
// menuQueryWrapper.eq("VALID_FLAG",0);
// menuQueryWrapper.eq("TREE_TYPE","sarMs");
// List<SarBussStandMenu> sarBussStandMenus = sarBussStandMenuEODao.selectList(menuQueryWrapper);
// if(sarBussStandMenus !=null && !sarBussStandMenus.isEmpty()){
// boolean upFlag = true;
// List<String> delIds = new ArrayList<>();
// for(SarBussStandMenu m: sarBussStandMenus){
// if(StringUtils.equals(m.getMenuId(),sarStandAttrMap.get("TXLBBUSS"))){
// upFlag= false;
// }else{
// delIds.add(m.getId());
// }
// }
// if(upFlag){
// SarBussStandMenu jsMenu = new SarBussStandMenu();
// jsMenu.setMenuId(sarStandAttrMap.get("TXLBBUSS"));
// jsMenu.setValidFlag(0);
// jsMenu.setTreeType("sarMs");
// jsMenu.setBussStandId(sarBussionessStandEO.getId());
// jsMenu.setId(UUIDUtils.randomUUID(32));
// sarBussStandMenuEODao.insert(jsMenu);
// }
// if(!delIds.isEmpty()){
// sarBussStandMenuEODao.deleteBatchIds(delIds);
// }
// }else{
// SarBussStandMenu jsMenu = new SarBussStandMenu();
// jsMenu.setMenuId(sarStandAttrMap.get("TXLBBUSS"));
// jsMenu.setValidFlag(0);
// jsMenu.setTreeType("sarMs");
// jsMenu.setBussStandId(sarBussionessStandEO.getId());
// jsMenu.setId(UUIDUtils.randomUUID(32));
// sarBussStandMenuEODao.insert(jsMenu);
// }
// }
// }
//修改收藏分享编号名称 //修改收藏分享编号名称
updateCollectAndShare(sarBussionessStandEO); updateCollectAndShare(sarBussionessStandEO);
@@ -21,7 +21,7 @@ import java.util.List;
*/ */
public interface SysLogDao extends BaseMapper<SysLog> { 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); IPage<SysLog> queryAllLog(Page page,@Param("sysLogReqDTO") SysLogReqDTO sysLogReqDTO);
} }
@@ -72,6 +72,9 @@ public class SysLog extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private String dept; private String dept;
@TableField(exist = false)
private String parentIds;
@TableField(exist = false) @TableField(exist = false)
private String accountName; private String accountName;
@@ -1,17 +1,27 @@
package com.adc.da.slrs.sysLog.service.impl; 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.entity.SysLog;
import com.adc.da.slrs.sysLog.dao.SysLogDao; import com.adc.da.slrs.sysLog.dao.SysLogDao;
import com.adc.da.slrs.sysLog.entity.SysLogExcel; import com.adc.da.slrs.sysLog.entity.SysLogExcel;
import com.adc.da.slrs.sysLog.service.ISysLogService; import com.adc.da.slrs.sysLog.service.ISysLogService;
import com.adc.da.slrs.sysLog.vo.SysLogReqDTO; import com.adc.da.slrs.sysLog.vo.SysLogReqDTO;
import com.adc.da.slrs.sysLog.vo.SysLogReqExportDTO; 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.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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 org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* <p> * <p>
@@ -24,15 +34,80 @@ import java.util.List;
@Service @Service
public class SysLogServiceImpl extends ServiceImpl<SysLogDao, SysLog> implements ISysLogService { public class SysLogServiceImpl extends ServiceImpl<SysLogDao, SysLog> implements ISysLogService {
@Autowired
private TsInstitutionDao tsInstitutionDao;
@Override @Override
public List<SysLogExcel> getSysLogExcelVOExcelData(SysLogReqExportDTO sysLogReqDTO) { 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 @Override
public IPage<SysLog> getAllLog(SysLogReqDTO sysLogReqDTO) { public IPage<SysLog> getAllLog(SysLogReqDTO sysLogReqDTO) {
Page<SysLog> page = new Page<>(sysLogReqDTO.getPage(), sysLogReqDTO.getPageSize()); Page<SysLog> page = new Page<>(sysLogReqDTO.getPage(), sysLogReqDTO.getPageSize());
IPage<SysLog> result = baseMapper.queryAllLog(page,sysLogReqDTO); 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; return result;
} }
} }
@@ -2,8 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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"> <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 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,sys_log.oper_time,sys_log.oper,sys_log.special from sys_log 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_user on sys_log.user_id = ts_user.usid
left join ts_institution on ts_user.institution_id = ts_institution.id 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) WHERE 1=1 and sys_log.oper_time >= DATE_SUB(CURDATE(),INTERVAL 1 YEAR)
@@ -26,7 +26,7 @@
</select> </select>
<select id="queryAllLog" parameterType="com.adc.da.slrs.sysLog.vo.SysLogReqDTO" resultType="com.adc.da.slrs.sysLog.entity.SysLog"> <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_user on sys_log.user_id = ts_user.usid
left join ts_institution on ts_user.institution_id = ts_institution.id left join ts_institution on ts_user.institution_id = ts_institution.id
WHERE 1=1 WHERE 1=1