|
@@ -1,15 +1,16 @@
|
|
package org.springblade.manager.controller;
|
|
package org.springblade.manager.controller;
|
|
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
-import com.mixsmart.utils.FormulaUtils;
|
|
|
|
-import io.swagger.annotations.*;
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
|
+import io.swagger.annotations.*;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
-import org.hibernate.validator.internal.engine.messageinterpolation.InterpolationTermType;
|
|
|
|
|
|
+import org.springblade.business.feign.OperationLogClient;
|
|
import org.springblade.common.utils.CommonUtil;
|
|
import org.springblade.common.utils.CommonUtil;
|
|
import org.springblade.common.utils.SystemUtils;
|
|
import org.springblade.common.utils.SystemUtils;
|
|
|
|
+import org.springblade.core.boot.ctrl.BladeController;
|
|
import org.springblade.core.cache.utils.CacheUtil;
|
|
import org.springblade.core.cache.utils.CacheUtil;
|
|
import org.springblade.core.excel.util.ExcelUtil;
|
|
import org.springblade.core.excel.util.ExcelUtil;
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
@@ -21,14 +22,19 @@ import org.springblade.core.tool.support.Kv;
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
-import org.springblade.manager.dto.*;
|
|
|
|
|
|
+import org.springblade.manager.dto.FormElementDTO;
|
|
|
|
+import org.springblade.manager.dto.WbsTreeDTO;
|
|
|
|
+import org.springblade.manager.dto.WbsTreeDTO2;
|
|
import org.springblade.manager.entity.*;
|
|
import org.springblade.manager.entity.*;
|
|
import org.springblade.manager.excel.WbsFormElementBatchExcel;
|
|
import org.springblade.manager.excel.WbsFormElementBatchExcel;
|
|
import org.springblade.manager.excel.WbsTreeExcel;
|
|
import org.springblade.manager.excel.WbsTreeExcel;
|
|
import org.springblade.manager.mapper.WbsInfoMapper;
|
|
import org.springblade.manager.mapper.WbsInfoMapper;
|
|
import org.springblade.manager.mapper.WbsTreeContractMapper;
|
|
import org.springblade.manager.mapper.WbsTreeContractMapper;
|
|
import org.springblade.manager.mapper.WbsTreePrivateMapper;
|
|
import org.springblade.manager.mapper.WbsTreePrivateMapper;
|
|
-import org.springblade.manager.service.*;
|
|
|
|
|
|
+import org.springblade.manager.service.IContractInfoService;
|
|
|
|
+import org.springblade.manager.service.IProjectInfoService;
|
|
|
|
+import org.springblade.manager.service.IWbsFormElementService;
|
|
|
|
+import org.springblade.manager.service.IWbsTreeService;
|
|
import org.springblade.manager.vo.*;
|
|
import org.springblade.manager.vo.*;
|
|
import org.springblade.system.cache.DictCache;
|
|
import org.springblade.system.cache.DictCache;
|
|
import org.springblade.system.entity.Role;
|
|
import org.springblade.system.entity.Role;
|
|
@@ -39,8 +45,6 @@ import org.springblade.system.user.feign.IUserClient;
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
-import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@@ -48,7 +52,6 @@ import javax.validation.Valid;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.net.URL;
|
|
import java.net.URL;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
-import java.util.function.Predicate;
|
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
|
|
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
|
|
@@ -69,6 +72,7 @@ public class WbsTreeController extends BladeController {
|
|
private final JdbcTemplate jdbcTemplate;
|
|
private final JdbcTemplate jdbcTemplate;
|
|
private final IUserClient iUserClient;
|
|
private final IUserClient iUserClient;
|
|
private final ISysClient iSysClient;
|
|
private final ISysClient iSysClient;
|
|
|
|
+ private final OperationLogClient operationLogClient;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 详情
|
|
* 详情
|
|
@@ -205,6 +209,14 @@ public class WbsTreeController extends BladeController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //校验当前系统级表单是否已经被项目级关联
|
|
|
|
+ List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda()
|
|
|
|
+ .select(WbsTreePrivate::getPKeyId).eq(WbsTreePrivate::getType, 2).eq(WbsTreePrivate::getId, id));
|
|
|
|
+ List<WbsTreeContract> wbsTreeContracts = wbsTreeContractMapper.selectList(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
|
+ .select(WbsTreeContract::getPKeyId).eq(WbsTreeContract::getType, 2).and(obj -> obj.eq(WbsTreeContract::getId, id).or().eq(WbsTreeContract::getOldId, id)));
|
|
|
|
+ if(ObjectUtil.isNotEmpty(wbsTreePrivates) || ObjectUtil.isNotEmpty(wbsTreeContracts)){
|
|
|
|
+ throw new ServiceException("当前表单已被项目引用,删除失败");
|
|
|
|
+ }
|
|
|
|
|
|
if (var) {
|
|
if (var) {
|
|
if (wbsTreeService.removeTableById(id)) {
|
|
if (wbsTreeService.removeTableById(id)) {
|
|
@@ -220,6 +232,11 @@ public class WbsTreeController extends BladeController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //保存操作记录
|
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
|
+ json.put("operationObjIds",id);
|
|
|
|
+ json.put("operationObjName", "删除系统级表单");
|
|
|
|
+ this.operationLogClient.saveUserOperationLog(4, "后台管理", "系统表单", json);
|
|
|
|
|
|
//删除对应到项目合同段的表
|
|
//删除对应到项目合同段的表
|
|
List<String> projectPKeyIds = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda()
|
|
List<String> projectPKeyIds = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda()
|