|
@@ -33,7 +33,6 @@ import org.springblade.manager.entity.TextdictInfo;
|
|
|
import org.springblade.manager.entity.WbsTreePrivate;
|
|
|
import org.springblade.manager.mapper.TextdictInfoMapper;
|
|
|
import org.springblade.manager.mapper.WbsTreePrivateMapper;
|
|
|
-import org.springblade.manager.service.ISignConfigService;
|
|
|
import org.springblade.manager.service.ITextdictInfoService;
|
|
|
import org.springblade.manager.utils.FileUtils;
|
|
|
import org.springblade.manager.vo.TextdictBy345VO;
|
|
@@ -48,7 +47,6 @@ import java.io.FileInputStream;
|
|
|
import java.io.FileNotFoundException;
|
|
|
import java.io.InputStream;
|
|
|
import java.util.*;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 参数信息表 服务实现类
|
|
@@ -60,9 +58,6 @@ import java.util.stream.Collectors;
|
|
|
public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, TextdictInfo> implements ITextdictInfoService {
|
|
|
@Resource
|
|
|
private WbsTreePrivateMapper wbsTreePrivateMapper;
|
|
|
-
|
|
|
- @Resource
|
|
|
- private ISignConfigService iSignConfigService;
|
|
|
@Override
|
|
|
public IPage<TextdictInfoVO> selectTextdictInfoPage(IPage<TextdictInfoVO> page, TextdictInfoVO textdictInfo) {
|
|
|
List<TextdictInfoVO> textdict = new ArrayList<>();
|
|
@@ -74,47 +69,20 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
|
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
Document doc = Jsoup.parse(htmlString);
|
|
|
Elements table = doc.getElementsByAttribute("dqid");
|
|
|
- List<String> dqid = new ArrayList<>();
|
|
|
- List<String> keys = new ArrayList<>();
|
|
|
- for(Element ek:table){
|
|
|
- dqid.addAll(Func.toStrList("\\|\\|",ek.attr("dqid")));
|
|
|
- Elements keyNames = ek.getElementsByAttribute("keyname");
|
|
|
- if(Func.isNotEmpty(keyNames)){
|
|
|
- for(Element keyName:keyNames){
|
|
|
- keys.addAll(Func.toStrList("\\|\\|",keyName.attr("keyname")));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if(Func.isNotEmpty(textdictInfo.getShowType()) && textdictInfo.getShowType() == 1){
|
|
|
- if(Func.isNotEmpty(dqid) && dqid.size() > 0){
|
|
|
- textdict = baseMapper.selectTextdictBYIds(dqid,privateInfo.getProjectId());
|
|
|
- }else {
|
|
|
- textdict = new ArrayList<>();
|
|
|
- }
|
|
|
- }else{
|
|
|
- textdict = baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
|
|
|
- }
|
|
|
- if (textdict != null && !keys.isEmpty()) {
|
|
|
- for (TextdictInfoVO vo : textdict) {
|
|
|
- if (!(privateInfo.getPKeyId() + "").equals(vo.getTabId())) {
|
|
|
- vo.setIsSystem(1);
|
|
|
- }
|
|
|
- keys.remove(vo.getColKey());
|
|
|
+
|
|
|
+ List<String> dqid = new ArrayList<>();
|
|
|
+ for(Element ek:table){
|
|
|
+ dqid.addAll(Func.toStrList("\\|\\|",ek.attr("dqid")));
|
|
|
}
|
|
|
- if (Func.isNotEmpty(keys)) {
|
|
|
- // 查询系统级电签配置
|
|
|
- TextdictInfoVO temp = textdict.stream().findFirst().orElse(null);
|
|
|
- if (temp == null) {
|
|
|
- temp = new TextdictInfoVO();
|
|
|
- temp.setProjectId(privateInfo.getProjectId());
|
|
|
- temp.setExcelId(privateInfo.getExcelId() + "");
|
|
|
- temp.setTabId(privateInfo.getPKeyId() + "");
|
|
|
- temp.setType(2);
|
|
|
+ if(Func.isNotEmpty(textdictInfo.getShowType()) && textdictInfo.getShowType() == 1){
|
|
|
+ if(Func.isNotEmpty(dqid) && dqid.size() > 0){
|
|
|
+ textdict = baseMapper.selectTextdictBYIds(dqid,privateInfo.getProjectId());
|
|
|
+ }else {
|
|
|
+ textdict = new ArrayList<>();
|
|
|
}
|
|
|
- List<TextdictInfoVO> textdictList = iSignConfigService.hasSignConfig(privateInfo.getInitTableName(), keys, temp);
|
|
|
- textdict.addAll(textdictList);
|
|
|
+ }else{
|
|
|
+ textdict = baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
|
|
|
}
|
|
|
- }
|
|
|
} catch (Exception e) {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
@@ -222,12 +190,12 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public IPage<TextdictInfo> analysisHtmlDefault(String tabId) {
|
|
|
+ public IPage<TextdictInfoVO> analysisHtmlDefault(String tabId) {
|
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
|
|
|
|
|
|
WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(Long.parseLong(tabId));
|
|
|
- IPage<TextdictInfo> textdictInfoPage = new Page<TextdictInfo>();
|
|
|
+ IPage<TextdictInfoVO> textdictInfoPage = new Page<TextdictInfoVO>();
|
|
|
try {
|
|
|
File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
|
|
|
InputStream fileInputStream;
|
|
@@ -244,9 +212,9 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
|
|
|
Element table = doc.select("table").first();
|
|
|
Elements elements = table.select("[defText]");
|
|
|
|
|
|
- ArrayList<TextdictInfo> textdictInfos = new ArrayList<>();
|
|
|
+ ArrayList<TextdictInfoVO> textdictInfos = new ArrayList<>();
|
|
|
for (Element element : elements) {
|
|
|
- TextdictInfo textdictInfo = new TextdictInfo();
|
|
|
+ TextdictInfoVO textdictInfo = new TextdictInfoVO();
|
|
|
String keyname = element.attr("keyname");
|
|
|
String placeholder = element.attr("placeholder");
|
|
|
String defText = element.attr("defText");
|
|
@@ -254,6 +222,7 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
|
|
|
textdictInfo.setColName(placeholder);
|
|
|
textdictInfo.setSigRoleName(defText);
|
|
|
textdictInfo.setType(4);
|
|
|
+ textdictInfo.setId(-1L);
|
|
|
textdictInfos.add(textdictInfo);
|
|
|
}
|
|
|
textdictInfoPage.setRecords(textdictInfos);
|