feat: 条款导入标准

This commit is contained in:
yjz
2024-08-22 11:43:47 +08:00
parent 090ce628df
commit 5e4736dcd0
5 changed files with 46 additions and 13 deletions
@@ -60,5 +60,10 @@ public class ProcessStandardInterpretClause extends BaseEntity {
/**是否分发(1:是 0:否)*/
@ApiModelProperty(value = "是否分发(1:是 0:否)")
private String isDistribute;
// 标准id
@ApiModelProperty("标准id")
@TableField(exist = false)
private String standardId;
}
@@ -303,10 +303,12 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
lawsDocumentSplit.setStandardId(lawsDomesticStandard.getId());
lawsDocumentSplit.setFileType(
standardInterpretDTO.getProcessStandardInterpret().getDecompositionSource());
lawsDocumentSplit.setInfoId(processStandardInterpret.getSplitInfoId());
HashMap<String, Object> parameter = new HashMap<>();
parameter.put("standard_id", lawsDomesticStandard.getId());
parameter.put("file_type",
standardInterpretDTO.getProcessStandardInterpret().getDecompositionSource());
// parameter.put("file_type",
// standardInterpretDTO.getProcessStandardInterpret().getDecompositionSource());
parameter.put("info_id", processStandardInterpret.getSplitInfoId());
List<Map<String, Object>> maps = documentSplitService.queryDocumentSplitDetailByList(parameter);
if (CollectionUtils.isNotEmpty(maps)){
lawsDocumentSplit.setId(String.valueOf(maps.get(0).get("id")));
@@ -785,12 +787,18 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
list = documentSplitMapper.selectClauseList(lawsDocumentSplit);
// 添加标准数据
LawsDomesticStandard lawsDomesticStandard = lawsDomesticStandardService.getById(standardId);
ProcessStandardInterpretClause processStandardInterpretClause = new ProcessStandardInterpretClause();
processStandardInterpretClause.setClauseId(lawsDomesticStandard.getId());
processStandardInterpretClause.setItemNum(lawsDomesticStandard.getStandardNumber());
processStandardInterpretClause.setItemTitle(lawsDomesticStandard.getStandardName());
list.add(0, processStandardInterpretClause);
if (CollectionUtils.isNotEmpty(list)){
if (StringUtils.isNotBlank(list.get(0).getStandardId())) {
standardId = sarFileSplitInfoEO.getStandardId();
list.remove(0);
}
LawsDomesticStandard lawsDomesticStandard = lawsDomesticStandardService.getById(standardId);
ProcessStandardInterpretClause processStandardInterpretClause = new ProcessStandardInterpretClause();
processStandardInterpretClause.setClauseId(lawsDomesticStandard.getId());
processStandardInterpretClause.setItemNum(lawsDomesticStandard.getStandardNumber());
processStandardInterpretClause.setItemTitle(lawsDomesticStandard.getStandardName());
list.add(0, processStandardInterpretClause);
}
}
return list;
}
@@ -1669,7 +1677,6 @@ public class StandardInterpretFlowServiceImpl implements StandardInterpretFlowSe
processStandardInterpretClause.setClauseId(processStandardInterpret.getStandardId());
processStandardInterpretClause.setItemNum(processStandardInterpret.getStandardNumber());
processStandardInterpretClause.setItemTitle(processStandardInterpret.getStandardName());
processStandardInterpretClause.setItemTitle(processStandardInterpret.getStandardName());
processStandardInterpretClauseList.add(processStandardInterpretClause);
}else if (CollectionUtils.isEmpty(processStandardInterpretClauseList)){
// 如果没选择条款
@@ -50,11 +50,12 @@
<insert id="insertBatchLawsDocumentSplit">
INSERT INTO laws_document_split (id, create_by, create_time, update_by, update_time, sys_org_code,
is_same_as_prev_version, item_title, menu_id, item_content, translation, item_num, info_id)
is_same_as_prev_version, item_title, menu_id, item_content, translation, item_num, info_id, standard_id)
values
<foreach collection="entity" item="item" index="index" separator=",">
(#{item.id}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.sysOrgCode},
#{item.isSameAsPrevVersion}, #{item.itemTitle}, #{item.menuId}, #{item.itemContent}, #{item.translation}, #{item.itemNum}, #{item.infoId})
#{item.isSameAsPrevVersion}, #{item.itemTitle}, #{item.menuId}, #{item.itemContent}, #{item.translation},
#{item.itemNum}, #{item.infoId}, #{item.standardId})
</foreach>
</insert>
@@ -272,13 +273,14 @@
<select id="selectClauseList"
resultType="com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpretClause">
SELECT s.id clauseId,item_num,item_title,item_content
SELECT s.id clauseId,item_num,item_title,item_content,standard_id
FROM laws_document_split s
LEFT JOIN SAR_FILE_SPLIT_MENU m ON s.MENU_ID = m.id
WHERE del_flag = 0
<if test="lawsDocumentSplit.infoId != null and lawsDocumentSplit.infoId != ''">
AND s.info_id = #{lawsDocumentSplit.infoId}
</if>
ORDER BY display_seq ASC, sort_number IS NULL, sort_number ASC
</select>
<select id="selectClauseListScc"
@@ -1758,6 +1758,9 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
// 等值匹配
selectCondition.append(" and standard_id = '").append(parameter.get("standard_id")).append("'");
parameter.remove("standard_id");
}else {
// 默认不查询标准信息
selectCondition.append(" and standard_id is null");
}
if (parameter.containsKey("file_type")){
// 等值匹配
@@ -31,7 +31,9 @@ import com.jero.modules.laws.documenttool.mapper.DocumentSplitMapper;
import com.jero.modules.laws.documenttool.service.IDocumentSplitService;
import com.jero.modules.laws.labeldatabase.entity.LawsLabelDatabase;
import com.jero.modules.laws.labeldatabase.service.ILawsLabelDatabaseService;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.entity.PartName;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsPartNameService;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
@@ -161,6 +163,8 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
private DocumentSplitMapper documentSplitMapper;
@Autowired
private AsynService asynService;
@Autowired
private ILawsDomesticStandardService lawsDomesticStandardService;
@Value(value = "${jero.path.upload}")
private String uploadpath;
@@ -2003,7 +2007,16 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
}
long l = System.currentTimeMillis();
log.error("================插入条款详情耗时:" + (l - aa) + "ms");
boolean existStandard = false;
if (CollectionUtils.isNotEmpty(LawsDocumentSplit)){
// 判断第一条是否是标准
LawsDomesticStandard lawsDomesticStandard =
lawsDomesticStandardService.queryByStandardNumber(LawsDocumentSplit.get(0).getItemNum());
if (!Objects.isNull(lawsDomesticStandard)){
existStandard = true;
LawsDocumentSplit.get(0).setStandardId(lawsDomesticStandard.getId());
LawsDocumentSplit.get(0).setFileType(sarFileSplitInfoEO.getFileType());
}
batchSaveItems(LawsDocumentSplit);
}
long bb = System.currentTimeMillis();
@@ -2048,6 +2061,9 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
// sarFileSplitMenuEO.setModifyTime(new Date());
// sarFileSplitMenuEOMapper.insertSelective(sarFileSplitMenuEO);
if (existStandard && treeNode.getItemId().equals(LawsDocumentSplit.get(0).getId())){
continue;
}
SarFileSplitMenu sarFileSplitMenu = new SarFileSplitMenu();
sarFileSplitMenu.setId(treeNode.getId());
sarFileSplitMenu.setInfoId(infoId);
@@ -2067,7 +2083,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
}
long f = System.currentTimeMillis();
log.error("================插入菜单耗时:" + (f - e) + "ms");
log.error("================插入目录耗时:" + (f - e) + "ms");
String msg = "";
if(MessageUtils.getLanguage().getValue().equals(LanguageEnum.CN.getValue())){
msg = "成功导入" + countSuccess + "";