Merge remote-tracking branch 'origin/master'

This commit is contained in:
wangzhijiang
2022-03-11 10:55:54 +08:00
9 changed files with 188 additions and 133 deletions
@@ -16,7 +16,6 @@ import com.jero.common.constant.enums.MessageTypeEnum;
import com.jero.common.constant.enums.ModuleEnum;
import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.DateUtils;
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
@@ -135,8 +134,6 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
@Autowired
private SysCategoryServiceImpl sysCategoryService;
@Autowired
private ISysBaseAPI sysBaseAPI;
@Autowired
private ISysUserService sysUserService;
@Resource
private WebSocket webSocket;
@@ -171,8 +168,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<OnlCgformField> fieldFileList = fieldList.stream().filter(e -> FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType())).collect(Collectors.toList());
//删除文件
List<Map<String, Object>> mapList = bussDocumentLibraryEOMapper.selectMapsAll(StringUtils.join(ids,","));
List<Map<String, Object>> mapList = bussDocumentLibraryEOMapper.selectMapsAll(StringUtils.join(ids, ","));
List<String> connectIdList = new ArrayList<>();
@@ -198,7 +194,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<String> serialNumberList = new ArrayList<>();
StringBuilder sb = new StringBuilder();
for (Map<String, Object> map : mapList) {
if(documentIds.size() != 0 && documentIds.contains((String) map.get("id"))){
if (documentIds.size() != 0 && documentIds.contains((String) map.get("id"))) {
String id = (String) map.get("id");
String serialNumber = (String) map.get("serial_number");
String title = (String) map.get("title");
@@ -223,12 +219,12 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<SysUser> userList = sysUserMapper.getUserListByNames(StringUtils.join(userNameList, ","));
List<String> userIdList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
String content = sysUser.getRealname() + "删除了" + StringUtils.join(serialNumberList,",") + "请知晓";
String content = sysUser.getRealname() + "删除了" + StringUtils.join(serialNumberList, ",") + "请知晓";
String contentInfo = sysUser.getRealname() + "删除了" + sbStr + "请知晓";
//封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, content, contentInfo);
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
sendWebsocket(StringUtils.join(serialNumberList,","), StringUtils.join(serialNumberList,","));
sendWebsocket(StringUtils.join(serialNumberList, ","), StringUtils.join(serialNumberList, ","));
}
}
@@ -394,7 +390,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
LambdaQueryWrapper<BussDocumentLibraryEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BussDocumentLibraryEO::getId, id);
//通过id查询数据
List<Map<String, Object>> dataList = bussDocumentLibraryEOMapper.selectMapsAll(id);;
List<Map<String, Object>> dataList = bussDocumentLibraryEOMapper.selectMapsAll(id);
;
//查询所有
List<Map<String, Object>> mapList = bussDocumentLibraryEOMapper.selectMapsAll(null);
//对应标准id
@@ -409,9 +406,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//对应标准处理
if (StringUtils.isNotBlank(correspondingStandard) && correspondingStandard.contains((String) map.get("id"))) {
for (String s : correspondingStandard.split(",")) {
if(s.equals((String) map.get("id"))){
if (s.equals((String) map.get("id"))) {
correspondingStandardNameList.add((String) map.get("serial_number"));
}else{
} else {
correspondingStandardNameList.add(s);
}
}
@@ -419,9 +416,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//代替标准
if (StringUtils.isNotBlank(replaceStandardTemp) && replaceStandardTemp.contains((String) map.get("id"))) {
for (String s : replaceStandardTemp.split(",")) {
if(s.equals((String) map.get("id"))){
if (s.equals((String) map.get("id"))) {
replaceStandardNameList.add((String) map.get("serial_number"));
}else{
} else {
replaceStandardNameList.add(s);
}
}
@@ -646,7 +643,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//对应标准
map.put("value", StringUtils.join(correspondingStandardNameList, ","));
map.put("list", listCorrespondingStandard);
}else if(FieldTypeEnum.DATE_SINGLE.getValue().equals(onlCgformField.getFieldShowType())){
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(onlCgformField.getFieldShowType())) {
map.put("value", finalValue);
} else {
map.put("value", entry.getValue());
@@ -701,11 +698,11 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
public void addInfo(Map<String, Object> map) {
try {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String implementTime = (String)map.get("implement_time");
String issueTime = (String)map.get("issue_time");
Date implementTimeDate=df.parse(implementTime);
Date issueTimeDate=df.parse(issueTime);
if(issueTimeDate.after(implementTimeDate)){
String implementTime = (String) map.get("implement_time");
String issueTime = (String) map.get("issue_time");
Date implementTimeDate = df.parse(implementTime);
Date issueTimeDate = df.parse(issueTime);
if (issueTimeDate.after(implementTimeDate)) {
throw new JeroBootException("发布日期不能大于标准实施日期");
}
} catch (ParseException e) {
@@ -800,15 +797,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
public void updateInfo(Map<String, Object> map) {
try {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String implementTime = (String)map.get("implement_time");
String issueTime = (String)map.get("issue_time");
Date implementTimeDate=df.parse(implementTime);
Date issueTimeDate=df.parse(issueTime);
if(issueTimeDate.after(implementTimeDate)){
throw new JeroBootException("发布日期不能大于标准实施日期") ;
String implementTime = (String) map.get("implement_time");
String issueTime = (String) map.get("issue_time");
Date implementTimeDate = df.parse(implementTime);
Date issueTimeDate = df.parse(issueTime);
if (issueTimeDate.after(implementTimeDate)) {
throw new JeroBootException("发布日期不能大于标准实施日期");
}
} catch (ParseException e) {
throw new JeroBootException("编辑失败") ;
throw new JeroBootException("编辑失败");
}
String cut = (String) map.get("cut");
if (ObjectUtils.isNotEmpty(map.get("replace_standard_id"))) {
@@ -881,7 +878,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//判断文件是否修改
if ((ObjectUtils.isNotEmpty(dataList.get(0).get(key)) && !dataList.get(0).get(key).equals(value))
||(ObjectUtils.isEmpty(dataList.get(0).get(key)) && ObjectUtils.isNotEmpty(value))) {
|| (ObjectUtils.isEmpty(dataList.get(0).get(key)) && ObjectUtils.isNotEmpty(value))) {
String valueTemp = UUID.randomUUID().toString().replace("-", "");
//修改文件表关联信息connect_id
List<OSSFile> oSSFileList = new ArrayList<>();
@@ -893,7 +890,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
}
iOSSFileService.updateFileInfo(oSSFileList);
valuesBuilder.append("'" + valueTemp + "'" + ",");
}else{
} else {
valuesBuilder.append("'" + value + "'" + ",");
}
// //判断文件是否修改
@@ -1015,7 +1012,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//字段中文名
List<OnlCgformField> fields = fieldList.stream().filter(e -> e.getDbFieldName().equals(key)).collect(Collectors.toList());
if(fields.size() != 0){
if (fields.size() != 0) {
String dbFieldTxt = fields.get(0).getDbFieldTxt();
if (value == null) {
value = "";
@@ -1147,32 +1144,37 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String serialNumber = (String) dataList.get(0).get("serial_number");
//只要修改了标准,就需要向订阅用户发送消息(内容为-->XXX对“GB 7258 进行了修改请及时查看”)
//项订阅领域管理中订阅了该技术领域的人和文档库中订阅了该条文档的人发送消息
Map<String, Object> mapTemp = new HashMap<>();
mapTemp.put("domainId", map.get("technology_territory"));
mapTemp.put("documentId", map.get("id"));
List<String> userIdList = domainUserRelService.queryDomainUserRelInfo(mapTemp);
//1.先判断是否订阅
LambdaQueryWrapper<OnlCgformSubscribe> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(OnlCgformSubscribe::getDocumentId, (String) map.get("id"));
List<OnlCgformSubscribe> onlCgformSubscribeList = iOnlCgformSubscribeService.list(lambdaQueryWrapper);
List<String> userNameList = new ArrayList<>();
if (onlCgformSubscribeList.size() != 0) {
for (OnlCgformSubscribe onlCgformSubscribe : onlCgformSubscribeList) {
userNameList.add(onlCgformSubscribe.getCreateBy());
}
List<SysUser> userList = sysUserMapper.getUserListByNames(StringUtils.join(userNameList, ","));
List<String> userIdList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
// LambdaQueryWrapper<OnlCgformSubscribe> lambdaQueryWrapper = new LambdaQueryWrapper<>();
// lambdaQueryWrapper.in(OnlCgformSubscribe::getDocumentId, (String) map.get("id"));
// List<OnlCgformSubscribe> onlCgformSubscribeList = iOnlCgformSubscribeService.list(lambdaQueryWrapper);
// List<String> userNameList = new ArrayList<>();
// if (onlCgformSubscribeList.size() != 0) {
// for (OnlCgformSubscribe onlCgformSubscribe : onlCgformSubscribeList) {
// userNameList.add(onlCgformSubscribe.getCreateBy());
// }
// List<SysUser> userList = sysUserMapper.getUserListByNames(StringUtils.join(userNameList, ","));
// List<String> userIdList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
String id = (String) map.get("id");
String title = (String) map.get("title");
String href = "<a href='/docManage/library?id:" + id +
"&title:" + title +
"&serial_number:" + serialNumber + "'" + " target='_blank'>" + serialNumber + "</a>";
String id = (String) map.get("id");
String title = (String) map.get("title");
String href = "<a href='/docManage/library?id:" + id +
"&title:" + title +
"&serial_number:" + serialNumber + "'" + " target='_blank'>" + serialNumber + "</a>";
String content = sysUser.getRealname() + "" + serialNumber + "进行了修改请及时查看";
String contentInfo = sysUser.getRealname() + "修改标准" + href + "" + sbStr.toString();
//封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, content, contentInfo);
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
sendWebsocket((String) map.get("id"), (String) map.get("id"));
}
//2. 处理修改代替标准的发送消息
String content = sysUser.getRealname() + "" + serialNumber + "进行了修改请及时查看";
String contentInfo = sysUser.getRealname() + "修改标准" + href + "" + sbStr.toString();
//封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, content, contentInfo);
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
sendWebsocket((String) map.get("id"), (String) map.get("id"));
// }
//2. 处理修改代替标准的发送消息(法规负责人)
//处理修改代替标准,发送通知
//修改时前端传参
String replaceStandard = (String) map.get("replace_standard");
@@ -1644,7 +1646,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//订阅 先删后加
QueryWrapper<OnlCgformSubscribe> deleteSubscribe = new QueryWrapper<>();
deleteSubscribe.lambda().eq(OnlCgformSubscribe::getDocumentId,id);
deleteSubscribe.lambda().eq(OnlCgformSubscribe::getDocumentId, id);
iOnlCgformSubscribeService.remove(deleteSubscribe);
//订阅表中添加数据
@@ -2398,9 +2400,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String filenameorg = file.getOriginalFilename().substring(0, pos);
//判断上传文件必须是zip
if (!str.equals("zip") && !str.equals("rar")) {
throw new JeroBootException("请上传zip格式的文件或rar格式的文件") ;
throw new JeroBootException("请上传zip格式的文件或rar格式的文件");
}
String path = uploadpath + File.separator+"modal"+File.separator + filenameorg;
String path = uploadpath + File.separator + "modal" + File.separator + filenameorg;
File saveDirectory = new File(path);
if (!saveDirectory.isDirectory()) {
saveDirectory.mkdir();
@@ -2408,9 +2410,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(path + File.separator + file.getOriginalFilename()));
//解压缩
String zipEntryName = "";
if(str.equals("zip")){
if (str.equals("zip")) {
zipEntryName = FileUnZip.unZipFiles(path + File.separator + file.getOriginalFilename(), path);
}else{
} else {
// zipEntryName = FileRarUtils.rarUnCompress(path + File.separator + file.getOriginalFilename(), path);
}
@@ -2418,7 +2420,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//判断压缩包下是否只有一个文件夹
File fileTemp = new File(path);
int length = fileTemp.listFiles().length;
if(length > 2){
if (length > 2) {
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
throw new JeroBootException("压缩包中必须有且仅有一个文件夹,请重新上传");
@@ -2426,18 +2428,18 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
File fileNew = new File(zipEntryName);
List<File> fileList = new ArrayList<>();
for (File file1 : fileNew.listFiles()) {
if(file1.getName().contains(".xls") || file1.getName().contains(".xlsx")){
if (file1.getName().contains(".xls") || file1.getName().contains(".xlsx")) {
fileList.add(file1);
}
}
if(fileList.size() ==0 ){
if (fileList.size() == 0) {
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
throw new JeroBootException("压缩包根目录下没有excel作为导入数据,请重新上传");
}else if(fileList.size() > 1){
} else if (fileList.size() > 1) {
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
throw new JeroBootException("压缩包根目录下仅能存在一个excel为导入数据,请重新上传") ;
throw new JeroBootException("压缩包根目录下仅能存在一个excel为导入数据,请重新上传");
}
// 数据相关处理,
@@ -2447,7 +2449,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (excelfilelist.size() < 1) {
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
throw new JeroBootException( "压缩包内没有上传Excel数据");
throw new JeroBootException("压缩包内没有上传Excel数据");
} else if (excelfilelist.size() > 1) {
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
@@ -2491,7 +2493,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
if (StringUtils.isNotBlank(stringCellValue)) {
String replace = stringCellValue.replace("", ",");
rowList.put(headerCell.getStringCellValue(), replace);
}else{
} else {
rowList.put(headerCell.getStringCellValue(), "");
}
}
@@ -2507,7 +2509,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
}
}
}
if(dataList.size() == 0){
if (dataList.size() == 0) {
//删除原上传文件
FileUnZip.deleteDir(saveDirectory);
throw new JeroBootException("请填写必填字段内容,带*的为必填");
@@ -2537,17 +2539,17 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
}
private void exportDatas(List<Map<String, String>> dataList,
List<Map<String, Object>> fieldList,
List<SysCategory> categoryList,
List<SysDictItem> dictItemList,
String zipEntryName) {
List<Map<String, Object>> fieldList,
List<SysCategory> categoryList,
List<SysDictItem> dictItemList,
String zipEntryName) {
//树形数据字典
List<String> treeNameList = categoryList.stream().map(SysCategory::getName).collect(Collectors.toList());
//普通数据字典
List<String> itemNameList = dictItemList.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
int i = 2;
List<String> msgList = new ArrayList<>();
List<Map<String,Object>> mapList = new ArrayList<>();
List<Map<String, Object>> mapList = new ArrayList<>();
for (Map<String, String> stringStringMap : dataList) {
Map<String, Object> mapResult = new HashMap<>();
i++;
@@ -2663,7 +2665,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
countError++;
}
//下拉多选
if(StringUtils.isNotBlank(value)){
if (StringUtils.isNotBlank(value)) {
for (String valueTemp : value.split(",")) {
if (!itemNameList.contains(valueTemp)) {
errorMsg += key + "中的" + valueTemp + "与数据字典不匹配";
@@ -2681,8 +2683,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
valueId += collect.get(0).getItemValue() + ",";
}
}
if(StringUtils.isNotBlank(valueId)){
value = valueId.substring(0,valueId.length()-1);
if (StringUtils.isNotBlank(valueId)) {
value = valueId.substring(0, valueId.length() - 1);
}
}
@@ -2745,15 +2747,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
new MockMultipartFile(nowFileList.get(0).getName(), nowFileList.get(0).getName(), "text/plain", input);
//文件存入文件表
OSSFile ossFile = iOSSFileService.uploadLocal(multipartFile, "");
if(ObjectUtils.isNotEmpty(ossFile)){
sb.append(ossFile.getId()+",");
if (ObjectUtils.isNotEmpty(ossFile)) {
sb.append(ossFile.getId() + ",");
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
if(StringUtils.isNotBlank(sb)){
if (StringUtils.isNotBlank(sb)) {
String substring = sb.substring(0, sb.length() - 1);
value = substring;
}
@@ -2780,7 +2782,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
sb.append((String) stringObjectMap.get("id") + ",");
list.add((String) stringObjectMap.get("serial_number"));
}
if(StringUtils.isNotBlank(value)){
if (StringUtils.isNotBlank(value)) {
for (String s : value.split(",")) {
if (!list.contains(s)) {
sb.append(s);
@@ -2808,9 +2810,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
for (String s : msgList) {
html += s + "</br>";
}
throw new JeroBootException(html) ;
throw new JeroBootException(html);
} else {
if(mapList.size() != 0){
if (mapList.size() != 0) {
for (Map<String, Object> map : mapList) {
this.addInfo(map);
}
@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.api.vo.Result;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.oConvertUtils;
import com.jero.modules.domain.entity.DomainUserRel;
import com.jero.modules.domain.mapper.DomainUserRelMapper;
import com.jero.modules.domain.service.DomainUserRelService;
@@ -21,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -95,7 +95,7 @@ public class DomainManageServiceImpl extends ServiceImpl<DomainUserRelMapper, Do
//获取订阅该领域的所有用户信息
if(StringUtils.isNotEmpty(domainId)){
QueryWrapper<DomainUserRel> queryDomain = new QueryWrapper<>();
queryDomain.lambda().eq(DomainUserRel::getDomainId,domainId);
queryDomain.lambda().in(DomainUserRel::getDomainId, Arrays.asList(domainId.split(",")));
List<DomainUserRel> domainUserRelList = super.baseMapper.selectList(queryDomain);
if(CollectionUtils.isNotEmpty(domainUserRelList)){
result = domainUserRelList.stream().map(DomainUserRel::getUserId).distinct().collect(Collectors.toList());
@@ -11,6 +11,7 @@ import com.jero.modules.tag.service.IOnlCgformTagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -88,7 +89,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
@AutoLog(value = "区域管理表-添加")
@ApiOperation(value="区域管理表-添加", notes="区域管理表-添加")
@PostMapping(value = "/add")
//@RequiresPermissions("area:add")
@RequiresPermissions("area:add")
public Result<?> add(@Validated @RequestBody OnlCgformArea onlCgformArea) {
onlCgformAreaService.add(onlCgformArea);
return Result.OK("添加成功!");
@@ -103,7 +104,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
@AutoLog(value = "区域管理表-编辑")
@ApiOperation(value="区域管理表-编辑", notes="区域管理表-编辑")
@PutMapping(value = "/edit")
//@RequiresPermissions("area:edit")
@RequiresPermissions("area:edit")
public Result<?> edit(@Validated @RequestBody OnlCgformArea onlCgformArea) {
onlCgformAreaService.editById(onlCgformArea);
return Result.OK("编辑成功!");
@@ -118,7 +119,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
@AutoLog(value = "区域管理表-通过id删除")
@ApiOperation(value="区域管理表-通过id删除", notes="区域管理表-通过id删除")
@DeleteMapping(value = "/delete")
//@RequiresPermissions("area:delete")
@RequiresPermissions("area:delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
OnlCgformArea onlCgformArea = onlCgformAreaService.queryById(id);
int count=onlCgformTagService.queryExitArea(onlCgformArea);
@@ -3,9 +3,11 @@ package com.jero.modules.tag.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.CommonConstant;
import com.jero.common.system.base.controller.JeroController;
import com.jero.generater.modules.online.cgform.controller.OnlCgformApiController;
import com.jero.modules.enums.FixedFieldEnum;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.tag.entity.OnlCgformArea;
import com.jero.modules.tag.entity.OnlCgformTag;
@@ -15,6 +17,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -82,7 +85,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@AutoLog(value = "标签管理-添加")
@ApiOperation(value="标签管理-添加", notes="标签管理-添加")
@PostMapping(value = "/add")
//@RequiresPermissions("tag:add")
@RequiresPermissions("tag:add")
public Result<?> add(@Validated @RequestBody OnlCgformTag onlCgformTag) {
onlCgformTagService.add(onlCgformTag);
onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID),"normal");
@@ -98,7 +101,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@AutoLog(value = "标签管理-编辑")
@ApiOperation(value="标签管理-编辑", notes="标签管理-编辑")
@PutMapping(value = "/edit")
//@RequiresPermissions("tag:edit")
@RequiresPermissions("tag:edit")
public Result<?> edit(@Validated @RequestBody OnlCgformTag onlCgformTag) {
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) {
return Result.error("固定字段,不可修改");
@@ -118,7 +121,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@AutoLog(value = "标签管理-通过id删除")
@ApiOperation(value="标签管理-通过id删除", notes="标签管理-通过id删除")
@DeleteMapping(value = "/delete")
//@RequiresPermissions("tag:delete")
@RequiresPermissions("tag:delete")
public Result<OnlCgformTag> delete(@RequestParam(name="id",required=true) String id) {
Result<OnlCgformTag> result = new Result<>();
OnlCgformTag onlCgformTag = onlCgformTagService.queryById(id);
@@ -134,6 +137,30 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
return result;
}
/**
* 逻辑删除
*(0非固定字段 1固定字段 2字段固定,内部可配)
* @param id
* @return
*/
@AutoLog(value = "标签管理-通过id删除")
@ApiOperation(value="标签管理-通过id删除", notes="标签管理-通过id删除")
@DeleteMapping(value = "/logicDelete")
@RequiresPermissions("tag:logicDelete")
public Result<OnlCgformTag> logicDelete(@RequestParam(name="id",required=true) String id) {
Result<OnlCgformTag> result = new Result<>();
OnlCgformTag onlCgformTag = onlCgformTagService.queryById(id);
if(StringUtils.isNotBlank(String.valueOf(onlCgformTag.getIsReadOnly()))) {
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) {
result.error500("固定字段,不可删除");
} else {
onlCgformTag.setIsDelete(CommonConstant.DEL_FLAG_1);
//onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID),"normal");//逻辑删除-->要处理同步数据库问题!!!!
result.OK("删除成功!");
}
}
return result;
}
/**
* 批量删除
*
@@ -143,7 +170,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@AutoLog(value = "标签管理-批量删除")
@ApiOperation(value="标签管理-批量删除", notes="标签管理-批量删除")
@DeleteMapping(value = "/deleteBatch")
//@RequiresPermissions("tag:deleteBatch")
@RequiresPermissions("tag:deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
OnlCgformTag onlCgformTag = onlCgformTagService.queryById(ids);
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) {
@@ -155,6 +182,38 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
}
}
/**
* 批量逻辑删除
*
* @param ids
* @return
*/
@AutoLog(value = "标签管理-批量删除")
@ApiOperation(value="标签管理-批量删除", notes="标签管理-批量删除")
@DeleteMapping(value = "/logicDeleteBatch")
@RequiresPermissions("tag:logicDeleteBatch")
public Result<?> logicDeleteBatch(@RequestParam(name="ids",required=true) String ids) {
Result<SysCategory> result = new Result<SysCategory>();
OnlCgformTag onlCgformTag = onlCgformTagService.queryById(ids);
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) {
return Result.error("包含固定字段,不可删除");
}else {
List<String> idList = Arrays.asList(ids.split(","));
for(String list:idList){
OnlCgformTag midTag=onlCgformTagService.getById(list);
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(midTag.getIsReadOnly()))) {
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(midTag.getIsReadOnly())) {
result.error500("包含固定字段,不可删除");
} else {
midTag.setIsDelete(CommonConstant.DEL_FLAG_1);
//onlCgformApiController.h(String.valueOf(FileTableIdEnum.FILE_TABLE_ID),"normal");//逻辑删除-->要处理同步数据库问题!!!!
result.success("批量删除成功!");
}
}
}
}
return result;
}
/**
* 通过id查询
*
+8 -25
View File
@@ -45,7 +45,7 @@
export default {
name: 'HeaderNotice',
components: {
DynamicNotice,
DynamicNotice
},
data() {
return {
@@ -54,14 +54,14 @@
listCementByUser: '/sys/sysAnnouncementSend/getMessageUnreadList',
editCementSend: '/sys/sysAnnouncementSend/editByAnntIdAndUserId',
queryById: '/sys/annountCement/queryById',
readAllMsg:'sys/sysAnnouncementSend/read',
readAllMsg: 'sys/sysAnnouncementSend/read'
},
hovered: false,
announcement1: [],
announcement2: [],
msg1Count: '0',
msg2Count: '0',
msg1Title: this.$t('MessageNotification')+'(0)',
msg1Title: this.$t('MessageNotification') + '(0)',
msg2Title: '',
stopTimer: false,
websock: null,
@@ -86,17 +86,6 @@
this.websocketOnclose()
},
methods: {
timerFun() {
this.stopTimer = false
let myTimer = setInterval(() => {
// 停止定时器
if (this.stopTimer == true) {
clearInterval(myTimer)
return
}
this.loadData()
}, 6000)
},
loadData() {
try {
// 获取系统消息
@@ -104,7 +93,7 @@
if (res.success) {
this.announcement1 = res.result
this.msg1Count = res.result.length
this.msg1Title = this.$t('MessageNotification')+'(' + res.result.length + ')'
this.msg1Title = this.$t('MessageNotification') + '(' + res.result.length + ')'
}
}).catch(error => {
this.stopTimer = true
@@ -158,16 +147,9 @@
this.reconnect()
},
websocketOnmessage: function(e) {
console.log(e)
console.log('-----接收消息-------', e.data)
var data = eval('(' + e.data + ')') //解析对象
if (data.cmd == 'topic') {
//系统通知
this.loadData()
} else if (data.cmd == 'user') {
//用户消息
this.loadData()
}
console.log('-----接收消息-------', e)
//系统通知
this.loadData()
},
websocketOnclose: function(e) {
console.log('connection closed (' + e + ')')
@@ -198,6 +180,7 @@
heartCheckFun() {
var that = this
//心跳检测,每20s心跳一次
console.log(123)
that.heartCheck = {
timeout: 20000,
timeoutObj: null,
@@ -34,7 +34,7 @@
</div>
</div>
<div class="imports-table-detail">
<a-table bordered :data-source="tableSource" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table" :pagination="false" >
<a-table :data-source="tableSource" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table" :pagination="false" >
</a-table>
<div class="page" v-if="tableSource.length > 0">
<a-pagination
@@ -138,7 +138,7 @@
{
serialNumber:'001',
serialName:'条款001',
serialContent:'12. 附加光反射器,可以是贴纸,具有以下规格: a) 正面左右两侧呈白色或淡黄色; b) 背面左右两侧呈红色; c) 防护板下面是白色;和 d) 高至少400(四百)毫米和宽至少100(一百)毫米;',
serialContent:'12. 附加光反射器,可以是贴纸,具有以下规格: a) 正面左右两侧呈白色或淡黄色; b) 背面左右两侧呈红色; c) 防护板下面是白色;和 d) 高至少400(四百)毫米和宽至少100(一百)毫米; 附加光反射器,可以是贴纸,具有以下规格: a) 正面左右两侧呈白色或淡黄色; b) 背面左右两侧呈红色; c) 防护板下面是白色;和 d) 高至少400(四百)毫米和宽至少100(一百)毫米;',
functionArea:'aaa',
tecArea:'bbb'
}
@@ -194,8 +194,7 @@
dataIndex: 'serialContent',
key: 'serialContent',
align: "center",
width: 200,
ellipsis: true,
},
{
title: this.$t('functionalAreas'),
@@ -279,9 +279,10 @@
},
//跳转详情
onDetail(item) {
let newUrl = this.$router.resolve({
path: '/docManage/library/detail',
query: item
query: { id:item.documentId }
})
window.open(newUrl.href, '_blank')
}
@@ -46,10 +46,12 @@
selectedKeys: [],
expandedKeys: [],
autoExpandParent: true,
treeData1: [],
treeData: [],
dataList:[],
searchValue:'',
data:[]
data:[],
parentItem:[]
}
},
props:{
@@ -70,13 +72,15 @@
//获取数据
loadData(){
let params = {
title:this.searchValue
}
getAction(`sys/category/getSysCategoryTree`,params).then(res=> {
if(res.success){
console.log('result',res.result)
this.data=[...res.result]
this.treeData=[...this.addAttr(this.data)]
this.treeData1=[...this.addAttr(this.data)]
this.treeData=[...this.treeData1]
// console.log('treeData',this.treeData)
}
})
@@ -84,6 +88,7 @@
onSearch(){
// this.treeData=[]
// this.treeData=this.getSearch(this.data)
// this.getSearch(this.searchValue,this.treeData1)
},
//获取用户的订阅
getSubscribtion(){
@@ -111,21 +116,26 @@
// console.log('dataI',dataI)
return dataI
},
getSearch(dataI){
getSearch(key,tree){
let dataSearch=[]
console.log('tree',this.treeData,this.data)
if((Array.isArray(dataI)) && dataI.length>0){
dataI.forEach((item,index)=>{
this.$set(item,'key',item.id)
if(item.title.indexOf(this.searchValue)>-1){
dataSearch.push(item)
let parentKey;
for (let i = 0; i < tree.length; i++) {
const node = tree[i];
if (node.children) {
if (node.children.some(item => item.title.indexOf(key)>-1)) {
console.log('titel',node)
parentKey = node.key;
this.parentItem.push(node)
} else if (this.getParentKey(key, node.children)) {
parentKey = this.getParentKey(key, node.children);
}
let arr = [];
this.addAttr(item.children,arr);
});
}
}
console.log('dataSearch',dataSearch)
return dataSearch
console.log('dataSearch',this.parentItem)
return this.parentItem
// return dataSearch
},
afterVisibleChange(val) {
// console.log('visible', val);