Merge branch 'master' into SecondStage
# Conflicts: # db/update/测试阶段.sql
This commit is contained in:
+3
-3
@@ -157,9 +157,9 @@ public class ProcessStandardInterpretClauseSublist extends BaseEntity {
|
||||
@ApiModelProperty(value = "DVP模板")
|
||||
@Excel(name = "DVP模板", width = 15)
|
||||
private String dvpTemplate;
|
||||
/**DFEMA*/
|
||||
@ApiModelProperty(value = "DFEMA")
|
||||
@Excel(name = "DFEMA", width = 15)
|
||||
/**DEFMA*/
|
||||
@ApiModelProperty(value = "DEFMA")
|
||||
@Excel(name = "DEFMA", width = 15)
|
||||
private String dfema;
|
||||
/**关键技术分解表*/
|
||||
@ApiModelProperty(value = "关键技术分解表")
|
||||
|
||||
+14
-13
@@ -176,6 +176,7 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
||||
private final int TEXT_LENGTH = 50;
|
||||
private final int TEXT_LENGTH_2 = 200;
|
||||
private final int TEXT_DICT_LENGTH = 500;
|
||||
private final int TEXT_LENGTH_1000 = 1000;
|
||||
private final int TEXT_AREA_LENGTH = 2000;
|
||||
|
||||
@Override
|
||||
@@ -1149,37 +1150,37 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
||||
}
|
||||
|
||||
String technicalSpecificationDesignGuide = data.getTechnicalSpecificationDesignGuide();
|
||||
textLenghtCheck(technicalSpecificationDesignGuide, TEXT_LENGTH, errorList, "技术规范/设计指南");
|
||||
textLenghtCheck(technicalSpecificationDesignGuide, TEXT_DICT_LENGTH, errorList, "技术规范/设计指南");
|
||||
|
||||
String drawingTemplate = data.getDrawingTemplate();
|
||||
textLenghtCheck(drawingTemplate, TEXT_LENGTH, errorList, "图纸模板");
|
||||
textLenghtCheck(drawingTemplate, TEXT_DICT_LENGTH, errorList, "图纸模板");
|
||||
|
||||
String technicalAgreementTemplate = data.getTechnicalAgreementTemplate();
|
||||
textLenghtCheck(technicalAgreementTemplate, TEXT_LENGTH, errorList, "技术协议模板");
|
||||
textLenghtCheck(technicalAgreementTemplate, TEXT_AREA_LENGTH, errorList, "技术协议模板");
|
||||
|
||||
String verificationReportTemplateChecklist = data.getVerificationReportTemplateChecklist();
|
||||
textLenghtCheck(verificationReportTemplateChecklist, TEXT_LENGTH, errorList, "校验报告模块/checklist");
|
||||
textLenghtCheck(verificationReportTemplateChecklist, TEXT_AREA_LENGTH, errorList, "校验报告模块/checklist");
|
||||
|
||||
String dvpTemplate = data.getDvpTemplate();
|
||||
textLenghtCheck(dvpTemplate, TEXT_LENGTH, errorList, "DVP模板");
|
||||
textLenghtCheck(dvpTemplate, TEXT_AREA_LENGTH, errorList, "DVP模板");
|
||||
|
||||
String dfema = data.getDfema();
|
||||
textLenghtCheck(dfema, TEXT_LENGTH, errorList, "DFEMA");
|
||||
textLenghtCheck(dfema, TEXT_AREA_LENGTH, errorList, "DEFMA");
|
||||
|
||||
String keyTechnologyDecompositionTable = data.getKeyTechnologyDecompositionTable();
|
||||
textLenghtCheck(keyTechnologyDecompositionTable, TEXT_LENGTH, errorList, "关键技术分解表");
|
||||
textLenghtCheck(keyTechnologyDecompositionTable, TEXT_DICT_LENGTH, errorList, "关键技术分解表");
|
||||
|
||||
String otherDocumentsTemplates = data.getOtherDocumentsTemplates();
|
||||
textLenghtCheck(otherDocumentsTemplates, TEXT_LENGTH, errorList, "其他文件或模板");
|
||||
textLenghtCheck(otherDocumentsTemplates, TEXT_DICT_LENGTH, errorList, "其他文件或模板");
|
||||
|
||||
String p3 = data.getP3();
|
||||
textLenghtCheck(p3, TEXT_LENGTH_2, errorList, "P3证明符合性的交付物名称");
|
||||
textLenghtCheck(p3, TEXT_DICT_LENGTH, errorList, "P3证明符合性的交付物名称");
|
||||
|
||||
String p5 = data.getP5();
|
||||
textLenghtCheck(p5, TEXT_LENGTH_2, errorList, "P5证明符合性的交付物名称");
|
||||
textLenghtCheck(p5, TEXT_DICT_LENGTH, errorList, "P5证明符合性的交付物名称");
|
||||
|
||||
String remarks = data.getRemarks();
|
||||
textLenghtCheck(remarks, TEXT_AREA_LENGTH, errorList, "备注");
|
||||
textLenghtCheck(remarks, TEXT_DICT_LENGTH, errorList, "备注");
|
||||
|
||||
String investigationStage = data.getInvestigationStage();
|
||||
if (StringUtils.isNotBlank(investigationStage)){
|
||||
@@ -1444,10 +1445,10 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
|
||||
}
|
||||
|
||||
String changeDescription = data.getChangeDescription();
|
||||
textLenghtCheck(changeDescription, TEXT_LENGTH, errorList, "相对上一版变化点说明");
|
||||
textLenghtCheck(changeDescription, TEXT_AREA_LENGTH, errorList, "相对上一版变化点说明");
|
||||
|
||||
String regulatoryNotes = data.getRegulatoryNotes();
|
||||
textLenghtCheck(regulatoryNotes, TEXT_LENGTH_2, errorList, "法规注释");
|
||||
textLenghtCheck(regulatoryNotes, TEXT_LENGTH_1000, errorList, "法规注释");
|
||||
|
||||
String domainArea = data.getDomainArea();
|
||||
if (StringUtils.isNotBlank(domainArea)){
|
||||
|
||||
+2
-2
@@ -128,8 +128,8 @@ public class FlowImportExcel {
|
||||
@Excel(name = "DVP模板", width = 15)
|
||||
private String dvpTemplate;
|
||||
/**DFEMA*/
|
||||
@ApiModelProperty(value = "DFEMA")
|
||||
@Excel(name = "DFEMA", width = 15)
|
||||
@ApiModelProperty(value = "DEFMA")
|
||||
@Excel(name = "DEFMA", width = 15)
|
||||
private String dfema;
|
||||
/**关键技术分解表*/
|
||||
@ApiModelProperty(value = "关键技术分解表")
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ public class LawsDocumentSplit extends BaseEntity {
|
||||
@ApiModelProperty("DVP模板")
|
||||
private String dvpTemplate;
|
||||
// DFEMA
|
||||
@ApiModelProperty("DFEMA")
|
||||
@ApiModelProperty("DEFMA")
|
||||
private String dfema;
|
||||
// 关键技术分解表
|
||||
@ApiModelProperty("关键技术分解表")
|
||||
|
||||
+2
-2
@@ -406,6 +406,8 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> queryDocumentSplitDetailByList(Map<String, Object> parameter) {
|
||||
// 防止SQL注入
|
||||
this.checkForSQLInjection(parameter);
|
||||
// 查询全部字段列表
|
||||
List<LawsTag> fieldList = lawsCommonMapper.getFieldList(TableNameEnum.DOCUMENT_SPLIT.getTableName());
|
||||
// 列表展示字段
|
||||
@@ -1780,8 +1782,6 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
}
|
||||
|
||||
private String getSelectCondition(Map<String, Object> parameter, List<LawsTag> fieldListCondition) {
|
||||
// 防止SQL注入
|
||||
this.checkForSQLInjection(parameter);
|
||||
// 拼接查询条件
|
||||
StringBuilder selectCondition = new StringBuilder("where del_flag = 0");
|
||||
// 非动态查询条件
|
||||
|
||||
+2
-2
@@ -825,8 +825,8 @@ public class LawsHomeSearchServiceImpl implements ILawsHomeSearchService {
|
||||
}
|
||||
String implementationDate = "implementationDate";
|
||||
if(map.containsKey(implementationDate) && !Objects.isNull(map.get(implementationDate))){
|
||||
String date = new SimpleDateFormat(YYYY_MM_DD).format(Long.parseLong(map.get(implementationDate).toString()));
|
||||
map.put(implementationDate,!Objects.equals(date,"1900-01-01") ? date : "-");
|
||||
String date = map.get(implementationDate).toString();
|
||||
map.put(implementationDate, date);
|
||||
}
|
||||
String createTime = "createTime";
|
||||
if(map.containsKey(createTime) && !Objects.isNull(map.get(createTime))){
|
||||
|
||||
+2
-2
@@ -161,8 +161,8 @@ public class LawsHomeAdvancedSearchClauseExcelVO implements Serializable {
|
||||
/**
|
||||
* DFEMA
|
||||
*/
|
||||
@ApiModelProperty(value = "DFEMA")
|
||||
@Excel(name = "DFEMA", width = 30)
|
||||
@ApiModelProperty(value = "DEFMA")
|
||||
@Excel(name = "DEFMA", width = 30)
|
||||
private String dfema;
|
||||
|
||||
/**
|
||||
|
||||
+19
@@ -191,6 +191,7 @@ public class MarketStandardController {
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发布
|
||||
*
|
||||
@@ -209,6 +210,24 @@ public class MarketStandardController {
|
||||
return marketStandardService.checkPublish(map.get("id"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 直接发布
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "外部标准库-市场法规清单-直接发布")
|
||||
@ApiOperation(value = "外部标准库-市场法规清单-直接发布", notes = "外部标准库-市场法规清单-直接发布")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@PostMapping(value = "/directRelease")
|
||||
@RequiresPermissions("marketStandard:directRelease")
|
||||
public Result<?> directRelease(@RequestBody Map<String, String> map) {
|
||||
if (!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))) {
|
||||
return Result.error(ResultCommon.SELECT_DATA);
|
||||
}
|
||||
return marketStandardService.directRelease(map.get("ids"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询第一个版本
|
||||
*
|
||||
|
||||
+7
@@ -94,6 +94,13 @@ public interface ILawsMarketStandardService extends IService<LawsMarketStandard>
|
||||
*/
|
||||
Result<?> checkPublish(String id);
|
||||
|
||||
/**
|
||||
* 直接发布
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
Result<?> directRelease(String ids);
|
||||
|
||||
/**
|
||||
* 发布
|
||||
* @param id
|
||||
|
||||
+90
-14
@@ -32,6 +32,7 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
@@ -509,6 +510,82 @@ public class LawsMarketStandardServiceImpl extends ServiceImpl<LawsMarketStandar
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public Result<?> directRelease(String ids) {
|
||||
List<String> listIds = Arrays.asList(ids.split(","));
|
||||
List<LawsMarketStandard> lawsMarketStandardOldList = listByIds(listIds);
|
||||
if(listIds.size() != lawsMarketStandardOldList.size()){
|
||||
return Result.error(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
StringBuilder msg = new StringBuilder();
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
for (LawsMarketStandard lawsMarketStandard : lawsMarketStandardOldList) {
|
||||
// 已发布的清单所有人都可以查看,未发布的数据只能作者和管理管查看、编辑、删除
|
||||
if(!Arrays.asList(sysUser.getRoleIds().split(",")).contains(lawsAdmin)
|
||||
&& Arrays.stream(sysUser.getRoleIds().split(",")).noneMatch(otherAdmin::contains)
|
||||
&& !Arrays.asList(sysUser.getRoleIds().split(",")).contains(superAdmin)
|
||||
&& !Objects.equals(lawsMarketStandard.getAuthor(),sysUser.getId())){
|
||||
msg.append(lawsMarketStandard.getManifestNo())
|
||||
.append(Objects.equals(LocaleContextHolder.getLocale(),Locale.ENGLISH)
|
||||
? "No data operation permission," : "没有权限,");
|
||||
continue;
|
||||
}
|
||||
if(Objects.equals(lawsMarketStandard.getManifestStatus(),MarketStandardConstants.MANIFEST_STATUS_PUBLISH)){
|
||||
msg.append(lawsMarketStandard.getManifestNo())
|
||||
.append(Objects.equals(LocaleContextHolder.getLocale(),Locale.ENGLISH)
|
||||
? "Data published," : "数据已发布,");
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
processMarketStandardReleaseService.checkProcessStatus(lawsMarketStandard.getId());
|
||||
}catch (Exception e){
|
||||
msg.append(lawsMarketStandard.getManifestNo())
|
||||
.append("当前数据已发布的流程未结束,不可操作,");
|
||||
}
|
||||
|
||||
}
|
||||
if(!StringUtils.isEmpty(msg.toString())){
|
||||
return Result.error(msg.toString().substring(0,msg.toString().length() - 1));
|
||||
}
|
||||
for (LawsMarketStandard lawsMarketStandardOld : lawsMarketStandardOldList) {
|
||||
LambdaQueryWrapper<LawsMarketStandard> queryLawsMarketStandard = new LambdaQueryWrapper<>();
|
||||
queryLawsMarketStandard.eq(LawsMarketStandard::getVersionFlag,lawsMarketStandardOld.getVersionFlag());
|
||||
long l = count(queryLawsMarketStandard);
|
||||
// 更新状态
|
||||
LambdaUpdateWrapper<LawsMarketStandard> updateLawsMarketStandard = new LambdaUpdateWrapper<>();
|
||||
updateLawsMarketStandard.eq(LawsMarketStandard::getId, lawsMarketStandardOld.getId());
|
||||
updateLawsMarketStandard.set(LawsMarketStandard::getReleaseDate,new Date());
|
||||
updateLawsMarketStandard.set(LawsMarketStandard::getManifestVersion, "V" + l + ".0");
|
||||
updateLawsMarketStandard.set(LawsMarketStandard::getManifestStatus,MarketStandardConstants.MANIFEST_STATUS_PUBLISH);
|
||||
updateLawsMarketStandard.set(LawsMarketStandard::getUpdateTime,new Date());
|
||||
updateLawsMarketStandard.set(LawsMarketStandard::getUpdateBy,sysUser.getUsername());
|
||||
update(updateLawsMarketStandard);
|
||||
|
||||
// 更新标准的市场数据
|
||||
LambdaQueryWrapper<LawsMarketStandardDetail> queryLawsMarketStandardDetail = new LambdaQueryWrapper<>();
|
||||
queryLawsMarketStandardDetail.eq(LawsMarketStandardDetail::getManifestId,lawsMarketStandardOld.getId());
|
||||
List<LawsMarketStandardDetail> listLawsMarketStandardDetail = lawsMarketStandardDetailService
|
||||
.list(queryLawsMarketStandardDetail);
|
||||
if(!CollectionUtils.isEmpty(listLawsMarketStandardDetail)){
|
||||
List<LawsDomesticStandard> listLawsDomesticStandard = new ArrayList<>();
|
||||
String country = lawsMarketStandardOld.getCountry();
|
||||
for (LawsMarketStandardDetail lawsMarketStandardDetail : listLawsMarketStandardDetail) {
|
||||
String countryDetail = lawsMarketStandardDetail.getCountry();
|
||||
String dis = StringUtils.isEmpty(countryDetail) ? country : country + "," + countryDetail;
|
||||
List<String> data = Arrays.stream(dis.split(",")).distinct().collect(Collectors.toList());
|
||||
LawsDomesticStandard lawsDomesticStandard = new LawsDomesticStandard();
|
||||
lawsDomesticStandard.setId(lawsMarketStandardDetail.getStandardId());
|
||||
lawsDomesticStandard.setApplicableMarket(String.join(",",data));
|
||||
listLawsDomesticStandard.add(lawsDomesticStandard);
|
||||
}
|
||||
lawsDomesticStandardService.updateBatchById(listLawsDomesticStandard);
|
||||
}
|
||||
lawsStandardMasterPlanService.syncMarketRegulationListUpdate(lawsMarketStandardOld.getId(),lawsMarketStandardOld.getCountry());
|
||||
}
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public synchronized Result<?> publish(String id) {
|
||||
@@ -540,21 +617,20 @@ public class LawsMarketStandardServiceImpl extends ServiceImpl<LawsMarketStandar
|
||||
queryLawsMarketStandardDetail.eq(LawsMarketStandardDetail::getManifestId,id);
|
||||
List<LawsMarketStandardDetail> listLawsMarketStandardDetail = lawsMarketStandardDetailService
|
||||
.list(queryLawsMarketStandardDetail);
|
||||
if(CollectionUtils.isEmpty(listLawsMarketStandardDetail)){
|
||||
return Result.OK(ResultCommon.OK);
|
||||
if(!CollectionUtils.isEmpty(listLawsMarketStandardDetail)){
|
||||
List<LawsDomesticStandard> listLawsDomesticStandard = new ArrayList<>();
|
||||
String country = lawsMarketStandardOld.getCountry();
|
||||
for (LawsMarketStandardDetail lawsMarketStandardDetail : listLawsMarketStandardDetail) {
|
||||
String countryDetail = lawsMarketStandardDetail.getCountry();
|
||||
String dis = StringUtils.isEmpty(countryDetail) ? country : country + "," + countryDetail;
|
||||
List<String> data = Arrays.stream(dis.split(",")).distinct().collect(Collectors.toList());
|
||||
LawsDomesticStandard lawsDomesticStandard = new LawsDomesticStandard();
|
||||
lawsDomesticStandard.setId(lawsMarketStandardDetail.getStandardId());
|
||||
lawsDomesticStandard.setApplicableMarket(String.join(",",data));
|
||||
listLawsDomesticStandard.add(lawsDomesticStandard);
|
||||
}
|
||||
lawsDomesticStandardService.updateBatchById(listLawsDomesticStandard);
|
||||
}
|
||||
List<LawsDomesticStandard> listLawsDomesticStandard = new ArrayList<>();
|
||||
String country = lawsMarketStandardOld.getCountry();
|
||||
for (LawsMarketStandardDetail lawsMarketStandardDetail : listLawsMarketStandardDetail) {
|
||||
String countryDetail = lawsMarketStandardDetail.getCountry();
|
||||
String dis = StringUtils.isEmpty(countryDetail) ? country : country + "," + countryDetail;
|
||||
List<String> data = Arrays.stream(dis.split(",")).distinct().collect(Collectors.toList());
|
||||
LawsDomesticStandard lawsDomesticStandard = new LawsDomesticStandard();
|
||||
lawsDomesticStandard.setId(lawsMarketStandardDetail.getStandardId());
|
||||
lawsDomesticStandard.setApplicableMarket(String.join(",",data));
|
||||
listLawsDomesticStandard.add(lawsDomesticStandard);
|
||||
}
|
||||
lawsDomesticStandardService.updateBatchById(listLawsDomesticStandard);
|
||||
lawsStandardMasterPlanService.syncMarketRegulationListUpdate(id,lawsMarketStandardOld.getCountry());
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
+146
-24
@@ -2,6 +2,7 @@ package com.jero.modules.split.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -2679,7 +2680,9 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
// 树形字典
|
||||
List<SysDict> sysDictTreeList = sysDictService.list(new LambdaQueryWrapper<SysDict>().eq(SysDict::getAttributeType, "2"));
|
||||
// 组织结构
|
||||
List<SysDepart> sysDepartList = sysDepartService.list();
|
||||
List<SysDepart> departList = sysDepartService.list();
|
||||
Map<String, List<SysDepart>> departMap = departList.stream().collect(Collectors.groupingBy(SysDepart::getDepartName));
|
||||
Map<String, String> departPartMap = SysDepart.buildPaths(departList);
|
||||
// 适用零部件
|
||||
List<PartName> partNameList = new ArrayList<>();
|
||||
//存放数据验证结果信息
|
||||
@@ -3175,19 +3178,59 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
|
||||
if (StringUtils.isNotBlank(value)){
|
||||
for (String v : value.split(",")) {
|
||||
Optional<SysDepart> first = sysDepartList.stream().filter(o -> v.equals(o.getDepartName())).findFirst();
|
||||
if (!first.isPresent()) {
|
||||
String[] splitValue = v.split("/");
|
||||
List<SysDepart> sysDeparts = departMap.get(splitValue[splitValue.length - 1]);
|
||||
if (sysDeparts != null) {
|
||||
if (sysDeparts.size() > 1) {
|
||||
// 叶子节点名称重复,需要寻找全路径
|
||||
String nodeId = departPartMap.get(v);
|
||||
if (StrUtil.isBlank(nodeId)) {
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中组织机构" + v + "不存在;";
|
||||
} else {
|
||||
errorMsg += fieldName + " " + v + "Not exist;";
|
||||
}
|
||||
countError++;
|
||||
valueList = new ArrayList<>();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中组织机构" + v + "不存在;";
|
||||
} else {
|
||||
errorMsg += fieldName + " " + v + "Not exist;";
|
||||
}
|
||||
countError++;
|
||||
valueList = Collections.emptyList();
|
||||
continue;
|
||||
}else {
|
||||
valueList.add(first.get().getId());
|
||||
valueList = new ArrayList<>();
|
||||
break;
|
||||
}
|
||||
String cellValue = this.convertMultiOrgId(v, departMap, departPartMap);
|
||||
if(StringUtils.isEmpty(cellValue)){
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中组织机构" + v + "不存在;";
|
||||
} else {
|
||||
errorMsg += fieldName + " " + v + "Not exist;";
|
||||
}
|
||||
countError++;
|
||||
valueList = new ArrayList<>();
|
||||
break;
|
||||
}
|
||||
valueList.add(cellValue);
|
||||
|
||||
// Optional<SysDepart> first = sysDepartList.stream().filter(o -> v.equals(o.getDepartName())).findFirst();
|
||||
// if (!first.isPresent()) {
|
||||
// if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
// errorMsg += fieldName + "中组织机构" + v + "不存在;";
|
||||
// } else {
|
||||
// errorMsg += fieldName + " " + v + "Not exist;";
|
||||
// }
|
||||
// countError++;
|
||||
// valueList = new ArrayList<>();
|
||||
// break;
|
||||
// }else {
|
||||
// valueList.add(first.get().getId());
|
||||
// }
|
||||
}
|
||||
}
|
||||
}else if (FieldTypeEnum.TREE_BOX.getValue().equals(fieldShowType)) {
|
||||
@@ -3221,54 +3264,64 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
sysDictItemList.stream().filter(o -> treePath.equals(o.getLevelPath()))
|
||||
.collect(Collectors.toList());
|
||||
if(!pathOther.isEmpty()){
|
||||
if (path.size() > 1) {
|
||||
if (pathOther.size() > 1) {
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中" + treePath + "存在多个;";
|
||||
countError++;
|
||||
valueList = Collections.emptyList();
|
||||
valueList = new ArrayList<>();
|
||||
} else {
|
||||
errorMsg += fieldName + " " + treePath + "Exist in multiple;";
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
if(CollectionUtils.isEmpty(valueList)){
|
||||
valueList = new ArrayList<>();
|
||||
}
|
||||
valueList.add(pathOther.get(0).getItemValue());
|
||||
}else{
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中" + treePath + "存在多个;";
|
||||
countError++;
|
||||
valueList = Collections.emptyList();
|
||||
valueList = new ArrayList<>();
|
||||
} else {
|
||||
errorMsg += fieldName + " " + treePath + "Not exist;";
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(CollectionUtils.isEmpty(valueList)){
|
||||
valueList = new ArrayList<>();
|
||||
}
|
||||
valueList.add(path.get(0).getItemValue());
|
||||
}else {
|
||||
List<SysDictItem> sysDictItemList = getLevelPath(sysDictItemLists);
|
||||
List<SysDictItem> pathOther =
|
||||
sysDictItemList.stream().filter(o -> treePath.equals(o.getLevelPath()))
|
||||
.collect(Collectors.toList());
|
||||
if(!pathOther.isEmpty()){
|
||||
if (path.size() > 1) {
|
||||
if (pathOther.size() > 1) {
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中" + treePath + "存在多个;";
|
||||
countError++;
|
||||
valueList = Collections.emptyList();
|
||||
valueList = new ArrayList<>();
|
||||
} else {
|
||||
errorMsg += fieldName + " " + treePath + "Exist in multiple;";
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
if(CollectionUtils.isEmpty(valueList)){
|
||||
valueList = new ArrayList<>();
|
||||
}
|
||||
valueList.add(pathOther.get(0).getItemValue());
|
||||
}else{
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中" + treePath + "不存在;";
|
||||
countError++;
|
||||
valueList = Collections.emptyList();
|
||||
valueList = new ArrayList<>();
|
||||
} else {
|
||||
errorMsg += fieldName + " " + treePath + "Not exist;";
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3287,22 +3340,22 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中" + treePath + "存在多个;";
|
||||
countError++;
|
||||
valueList = Collections.emptyList();
|
||||
valueList = new ArrayList<>();
|
||||
} else {
|
||||
errorMsg += fieldName + " " + treePath + "Exist in multiple;";
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
valueList.add(path.get(0).getCode());
|
||||
}else {
|
||||
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())) {
|
||||
errorMsg += fieldName + "中" + treePath + "不存在;";
|
||||
countError++;
|
||||
valueList = Collections.emptyList();
|
||||
valueList = new ArrayList<>();
|
||||
} else {
|
||||
errorMsg += fieldName + " " + treePath + "Not exist;";
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3336,6 +3389,55 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
// 组织机构
|
||||
public boolean multiOrgValid(String cellValue, Map<String, List<SysDepart>> sysDepartMap, Map<String, String> sysDepartPathMap) {
|
||||
String[] cellValues = cellValue.split(",");
|
||||
for (String value : cellValues) {
|
||||
String[] splitValue = value.split("/");
|
||||
List<SysDepart> sysDeparts = sysDepartMap.get(splitValue[splitValue.length - 1]);
|
||||
if (sysDeparts != null) {
|
||||
if (sysDeparts.size() == 1) continue;
|
||||
if (sysDeparts.size() > 1) {
|
||||
// 叶子节点名称重复,需要寻找全路径
|
||||
String nodeId = sysDepartPathMap.get(value);
|
||||
if (StrUtil.isBlank(nodeId)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 多选部门转换
|
||||
public String convertMultiOrgId(String cellValue, Map<String, List<SysDepart>> sysDepartMap, Map<String, String> sysDepartPathMap) {
|
||||
if (StrUtil.isBlank(cellValue)) {
|
||||
return null;
|
||||
}
|
||||
StringBuilder result = new StringBuilder();
|
||||
String[] cellValues = cellValue.split(",");
|
||||
for (String value : cellValues) {
|
||||
String[] splitValue = value.split("/");
|
||||
List<SysDepart> sysDeparts = sysDepartMap.get(splitValue[splitValue.length - 1]);
|
||||
if (sysDeparts != null) {
|
||||
if (sysDeparts.size() == 1) {
|
||||
result.append(sysDeparts.get(0).getId()).append(",");
|
||||
}
|
||||
if (sysDeparts.size() > 1) {
|
||||
// 叶子节点名称重复,需要寻找全路径
|
||||
String nodeId = sysDepartPathMap.get(value);
|
||||
result.append(nodeId).append(",");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 去除掉最后的逗号
|
||||
return result.substring(0, result.length() - 1);
|
||||
}
|
||||
|
||||
private List<PartName> partNameGetLevelPath(List<PartName> partNames) {
|
||||
List<PartName> list = new ArrayList<>();
|
||||
// 一级节点
|
||||
@@ -3544,9 +3646,9 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
|
||||
List<SarFileSplitMenuTreeNode> treeNodeList = new ArrayList<>();
|
||||
String regex = "^[0-9]{0}([0-9]|[.])+$"; //TODO 待优化:数字和点必须交替
|
||||
String parentId = "";
|
||||
String parentId = menuId;
|
||||
for (Map<String, Object> itemEO : addItemsEOList) {
|
||||
String itemNum = itemEO.get("item_num").toString();
|
||||
String itemNum = itemEO.get("item_num").toString().trim();
|
||||
String itemTitle = itemEO.get("item_title").toString();
|
||||
// if(itemNum.matches(regex) || itemNum.contains("附录")) { // TODO 解除条款号格式限制
|
||||
SarFileSplitMenuTreeNode treeNode = new SarFileSplitMenuTreeNode();
|
||||
@@ -4625,11 +4727,31 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
bis.close(); // 先开后关
|
||||
}
|
||||
|
||||
private void checkForSQLInjection(Map<String, Object> parameterMap) {
|
||||
// 定义要检查的特殊字符
|
||||
String[] specialCharacters = {"'", "\"", "\\", "<", ">", "&", "*", ";"};
|
||||
|
||||
for (Map.Entry<String, Object> entry : parameterMap.entrySet()) {
|
||||
Object value = entry.getValue();
|
||||
|
||||
// 检查是否是字符串类型
|
||||
if (value instanceof String) {
|
||||
String strValue = (String) value;
|
||||
// 检查是否包含特殊字符
|
||||
for (String character : specialCharacters) {
|
||||
if (strValue.contains(character)) {
|
||||
throw new JeroBootException("输入字段中包含非法字符,请检查");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void exportSplitInfo(String cut, String idList, Map<String, Object> parameter,String exportName, HttpServletResponse response, HttpServletRequest request) {
|
||||
// 水平越权
|
||||
documentSplitService.isHorizontalOverstep(String.valueOf(parameter.get("info_id")));
|
||||
|
||||
// 防止SQL注入
|
||||
this.checkForSQLInjection(parameter);
|
||||
OutputStream os = null;
|
||||
OutputStream excelOS = null;
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
|
||||
+15
-48
@@ -379,13 +379,10 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
public void updateMenuLevel(String sourceIds, String parentId, Long displaySeq) {
|
||||
// 要移动到的节点信息
|
||||
SarFileSplitMenuEO parentMenu = baseMapper.findById(parentId);
|
||||
|
||||
List<String> sourceIdList = Arrays.asList(sourceIds.split(","));
|
||||
// 获取要移动到的层级的最后一个 的排序值
|
||||
List<SarFileSplitMenuEO> lastMenuList = getLastMenu(parentMenu.getId(),displaySeq,sourceIdList);
|
||||
if (CollectionUtil.isNotEmpty(lastMenuList)){
|
||||
displaySeq = lastMenuList.stream().map(SarFileSplitMenuEO::getDisplaySeq).min(Comparator.comparing(x -> x)).orElse(null);
|
||||
}
|
||||
// 要移动的节点所有子集(包括本身)
|
||||
|
||||
// 更新要移动的节点的父级id
|
||||
List<SarFileSplitMenuEO> sarFileSplitMenuEO1List = new ArrayList<>();
|
||||
for (String sourceId : sourceIdList) {
|
||||
// 要移动的节点信息
|
||||
@@ -393,54 +390,24 @@ public class SarFileSplitMenuEOServiceImpl extends ServiceImpl<SarFileSplitMenuE
|
||||
sarFileSplitMenuEO.setParentId(parentId);
|
||||
sarFileSplitMenuEO1List.add(sarFileSplitMenuEO);
|
||||
}
|
||||
List<SarFileSplitMenuEO> allList = new ArrayList<>();
|
||||
getChildren(allList, sarFileSplitMenuEO1List);
|
||||
//for (SarFileSplitMenuEO splitMenuEO : allList) {
|
||||
// splitMenuEO.setParentId(parentId);
|
||||
//}
|
||||
//排除
|
||||
getChildren(allList, lastMenuList);
|
||||
|
||||
List<SarFileSplitMenuEO> allList = new ArrayList<>();
|
||||
//获得子父级目录
|
||||
getChildren(allList, sarFileSplitMenuEO1List);
|
||||
//获得大于排序的所有目录,全部向下移动
|
||||
List<SarFileSplitMenuEO> sarFileSplitMenuEOS = baseMapper.queryByGTDisplaySeq(parentMenu.getInfoId(),displaySeq);
|
||||
for (int i = 0; i < sarFileSplitMenuEOS.size(); i++) {
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = sarFileSplitMenuEOS.get(i);
|
||||
sarFileSplitMenuEO.setDisplaySeq(displaySeq+allList.size()+i+1);
|
||||
baseMapper.updateByPrimaryKeySelective(sarFileSplitMenuEO);
|
||||
}
|
||||
|
||||
//移动要移动的子父级目录
|
||||
for (int i = 0; i < allList.size(); i++) {
|
||||
SarFileSplitMenuEO sarFileSplitMenuEO = allList.get(i);
|
||||
sarFileSplitMenuEO.setDisplaySeq(displaySeq+i+1);
|
||||
baseMapper.updateByPrimaryKeySelective(sarFileSplitMenuEO);
|
||||
}
|
||||
|
||||
//this.updateBatchById(updateList);
|
||||
// 要移动的节点所有子集(包括本身)
|
||||
//List<SarFileSplitMenuEO> sarFileSplitMenuEO1List = new ArrayList<>();
|
||||
//sarFileSplitMenuEO1List.add(sarFileSplitMenuEO1);
|
||||
//List<SarFileSplitMenuEO> allList = new ArrayList<>();
|
||||
//getChildren(allList, sarFileSplitMenuEO1List);
|
||||
//List<String> idlist = new ArrayList<>();
|
||||
//
|
||||
//// 更新要移动节点及其子集的排序
|
||||
//for (int i = 0; i <allList.size(); i++) {
|
||||
// SarFileSplitMenuEO sarFileSplitMenuEO = allList.get(i);
|
||||
// if (!Objects.equals(sarFileSplitMenuEO.getId(), lastMenu.getId())){
|
||||
// sarFileSplitMenuEO.setDisplaySeq(lastMenu.getDisplaySeq() + i + 1);
|
||||
// }
|
||||
// idlist.add(sarFileSplitMenuEO.getId());
|
||||
// baseMapper.updateByPrimaryKeySelective(sarFileSplitMenuEO);
|
||||
//}
|
||||
//Long displaySeq = allList.get(allList.size() - 1).getDisplaySeq();
|
||||
//
|
||||
//// 更新 大于 要移动到节点最后节点 的节点排序值
|
||||
//List<SarFileSplitMenuEO> sarFileSplitMenuEOList =
|
||||
// baseMapper.queryByGTDisplaySeq(sarFileSplitMenuEO1.getInfoId(), lastMenu.getDisplaySeq());
|
||||
//sarFileSplitMenuEOList = sarFileSplitMenuEOList.stream()
|
||||
// .filter(v -> !idlist.contains(v.getId())).collect(Collectors.toList());
|
||||
//for (int i = 0; i < sarFileSplitMenuEOList.size(); i++) {
|
||||
// // 更新排序
|
||||
// SarFileSplitMenuEO fileSplitMenuEO = sarFileSplitMenuEOList.get(i);
|
||||
// fileSplitMenuEO.setDisplaySeq(displaySeq + i + 1);
|
||||
// baseMapper.updateByPrimaryKeySelective(fileSplitMenuEO);
|
||||
//}
|
||||
//
|
||||
//// 更新要移动节点的parentId
|
||||
//sarFileSplitMenuEO1.setParentId(parentId);
|
||||
//baseMapper.updateByPrimaryKeySelective(sarFileSplitMenuEO1);
|
||||
}
|
||||
|
||||
private void getChildren(List<SarFileSplitMenuEO> allList, List<SarFileSplitMenuEO> sarFileSplitMenuEOList) {
|
||||
|
||||
Reference in New Issue
Block a user