feat(文档拆分): 撤回
This commit is contained in:
+14
@@ -113,6 +113,20 @@ public class DocumentSplitController {
|
||||
return Result.OK("发布成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回
|
||||
*
|
||||
* @param parameter
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档拆分-撤回")
|
||||
@ApiOperation(value="文档拆分-撤回", notes="文档拆分-撤回")
|
||||
@PostMapping(value = "/revocation")
|
||||
public Result<T> revocation(@RequestBody Map<String, Object> parameter) {
|
||||
documentSplitService.revocation(parameter);
|
||||
return Result.OK("撤回成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
|
||||
+13
@@ -15,6 +15,9 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class DocumentSplitInfo extends BaseEntity {
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
/**标准号*/
|
||||
@Excel(name = "标准号", width = 15)
|
||||
@ApiModelProperty(value = "标准号")
|
||||
@@ -25,6 +28,11 @@ public class DocumentSplitInfo extends BaseEntity {
|
||||
@ApiModelProperty(value = "标准名称")
|
||||
private String title;
|
||||
|
||||
/**英文标题*/
|
||||
@Excel(name = "英文标题", width = 15)
|
||||
@ApiModelProperty(value = "英文标题")
|
||||
private String titleEn;
|
||||
|
||||
/**文件状态*/
|
||||
@Excel(name = "文件状态", width = 15, dicCode = "file_type")
|
||||
@Dict(dicCode = "process_manuscript")
|
||||
@@ -67,6 +75,11 @@ public class DocumentSplitInfo extends BaseEntity {
|
||||
@ApiModelProperty(value = "标准关联id")
|
||||
private String standardId;
|
||||
|
||||
/**发布前id*/
|
||||
@Excel(name = "发布前id", width = 15)
|
||||
@ApiModelProperty(value = "发布前id")
|
||||
private String publishBeforeId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String cut;
|
||||
|
||||
|
||||
+4
-4
@@ -130,7 +130,7 @@ public interface DocumentSplitMapper {
|
||||
* 文档拆分根据id查询
|
||||
* @param id
|
||||
*/
|
||||
DocumentSplitInfo queryDocumentSplitInfoById(String id);
|
||||
DocumentSplitInfo queryDocumentSplitInfoById(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* 文档拆分新增
|
||||
@@ -143,7 +143,7 @@ public interface DocumentSplitMapper {
|
||||
* @param infoId
|
||||
* @return
|
||||
*/
|
||||
List<SarFileSplitMenu> querySarFileSplitMenuByInfoId(String infoId);
|
||||
List<SarFileSplitMenu> querySarFileSplitMenuByInfoId(@Param("infoId") String infoId);
|
||||
|
||||
/**
|
||||
* 目录批量新增
|
||||
@@ -157,14 +157,14 @@ public interface DocumentSplitMapper {
|
||||
* @param infoId
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> queryLawsDocumentSplitByInfoId(String infoId);
|
||||
List<Map<String, Object>> queryLawsDocumentSplitByInfoId(@Param("infoId") String infoId);
|
||||
|
||||
/**
|
||||
* 条目信息根据itemId查询
|
||||
* @param itemId
|
||||
* @return
|
||||
*/
|
||||
List<SarFileSplitItemsVal> querySarFileSplitItemsValByItemId(String itemId);
|
||||
List<SarFileSplitItemsVal> querySarFileSplitItemsValByItemId(@Param("itemId") String itemId);
|
||||
|
||||
/**
|
||||
* 条目信息批量新增
|
||||
|
||||
+9
-8
@@ -24,23 +24,23 @@
|
||||
</insert>
|
||||
|
||||
<insert id="insertDocumentSplitInfo">
|
||||
insert into sar_file_split_info(create_by, create_time, update_by, update_time, sys_org_code, serial_number, title, file_type, file_name, split_result, file_id, connect_id, title_en, author, split_status, standard_id, del_flag)
|
||||
values (#{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{sysOrgCode}, #{serialNumber}, #{title}, #{fileType}, #{fileName}, #{splitResult}, #{fileId}, #{connectId}, #{titleEn}, #{author}, #{splitStatus}, #{standardId}, #{delFlag})
|
||||
insert into sar_file_split_info(id, create_by, create_time, update_by, update_time, sys_org_code, serial_number, title, file_type, file_name, split_result, file_id, connect_id, title_en, author, split_status, standard_id, del_flag)
|
||||
values (#{id}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{sysOrgCode}, #{serialNumber}, #{title}, #{fileType}, #{fileName}, #{splitResult}, #{fileId}, #{connectId}, #{titleEn}, #{author}, #{splitStatus}, #{standardId}, #{delFlag})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatchSarFileSplitMenuByInfoId">
|
||||
insert into sar_file_split_menu(sys_org_code, info_id, name, parent_id, display_seq, valid_flag, remarks, item_name, creation_user, creation_time, modify_user, modify_time)
|
||||
insert into sar_file_split_menu(id, sys_org_code, info_id, name, parent_id, display_seq, valid_flag, remarks, item_name, creation_user, creation_time, modify_user, modify_time)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.sysOrgCode}, #{entity.infoId}, #{entity.name}, #{entity.parentId}, #{entity.displaySeq}, #{entity.validFlag}, #{entity.remarks}, #{entity.itemName}, #{entity.creationUser}, #{entity.creationTime}, #{entity.modifyUser}, #{entity.modifyTime})
|
||||
(#{entity.id}, #{entity.sysOrgCode}, #{entity.infoId}, #{entity.name}, #{entity.parentId}, #{entity.displaySeq}, #{entity.validFlag}, #{entity.remarks}, #{entity.itemName}, #{entity.creationUser}, #{entity.creationTime}, #{entity.modifyUser}, #{entity.modifyTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertSarFileSplitItemsVal">
|
||||
insert into sar_file_split_items_val(sys_org_code, item_id, type, item_content, display_seq, valid_flag, img_name, index_item, creation_time, modify_user, modify_time, creation_user)
|
||||
insert into sar_file_split_items_val(id, sys_org_code, item_id, type, item_content, display_seq, valid_flag, img_name, index_item, creation_time, modify_user, modify_time, creation_user)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.sysOrgCode}, #{entity.itemId}, #{entity.type}, #{entity.itemContent}, #{entity.displaySeq}, #{entity.validFlag}, #{entity.imgName}, #{entity.indexItem}, #{entity.creationTime}, #{entity.modifyUser}, #{entity.modifyTime}, #{entity.creationUser})
|
||||
(#{entity.id}, #{entity.sysOrgCode}, #{entity.itemId}, #{entity.type}, #{entity.itemContent}, #{entity.displaySeq}, #{entity.validFlag}, #{entity.imgName}, #{entity.indexItem}, #{entity.creationTime}, #{entity.modifyUser}, #{entity.modifyTime}, #{entity.creationUser})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
i.create_by,
|
||||
i.standard_id,
|
||||
i.del_flag,
|
||||
publish_before_id,
|
||||
file_id,
|
||||
u.username as username
|
||||
from sar_file_split_info i
|
||||
@@ -177,7 +178,7 @@
|
||||
</select>
|
||||
|
||||
<select id="queryLawsDocumentSplitByInfoId" resultType="java.util.Map">
|
||||
select * from laws_document_split where del_flag = 0 and info_if = #{infoId}
|
||||
select * from laws_document_split where del_flag = 0 and info_id = #{infoId}
|
||||
</select>
|
||||
|
||||
<select id="querySarFileSplitItemsValByItemId"
|
||||
@@ -185,7 +186,7 @@
|
||||
select id, sys_org_code, item_id, type, item_content, display_seq, valid_flag,
|
||||
img_name, index_item, creation_time, modify_user, modify_time, creation_user
|
||||
from sar_file_split_items_val
|
||||
where valid_flag = 0 and item_id = #{infoId}
|
||||
where valid_flag = 0 and item_id = #{itemId}
|
||||
</select>
|
||||
|
||||
<update id="editDocumentSplitDetail">
|
||||
|
||||
+6
@@ -143,4 +143,10 @@ public interface IDocumentSplitService {
|
||||
* @return
|
||||
*/
|
||||
void publish(Map<String, Object> parameter);
|
||||
|
||||
/**
|
||||
* 文档拆分-撤回
|
||||
* @param parameter
|
||||
*/
|
||||
void revocation(Map<String, Object> parameter);
|
||||
}
|
||||
|
||||
+36
-9
@@ -288,7 +288,6 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
documentSplitMapper.addBatchItemsVal(articlesList);
|
||||
}
|
||||
|
||||
|
||||
// 条目信息更新
|
||||
// 删除旧数据
|
||||
documentSplitMapper.deleteItemsValByItemId((String) parameter.get(ID), "");
|
||||
@@ -629,6 +628,9 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
// 文档拆分信息
|
||||
DocumentSplitInfo documentSplitInfo = new DocumentSplitInfo();
|
||||
documentSplitInfo.setId(id);
|
||||
if (parameter.containsKey("publishBeforeId")){
|
||||
documentSplitInfo.setPublishBeforeId((String) parameter.get("publishBeforeId"));
|
||||
}
|
||||
List<DocumentSplitInfo> documentSplitInfos = queryByList(documentSplitInfo);
|
||||
lawsDocumentSplitView.setDocumentSplitInfo(documentSplitInfos.get(0));
|
||||
|
||||
@@ -664,6 +666,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
String uuId = UUID.randomUUID().toString().replace("-", "");
|
||||
newInfo.setId(uuId);
|
||||
newInfo.setSplitStatus(DocumentSplitCommon.SPLIT_STATUS2);
|
||||
newInfo.setPublishBeforeId(oldInfo.getId());
|
||||
// 新增数据
|
||||
documentSplitMapper.insertDocumentSplitInfo(newInfo);
|
||||
|
||||
@@ -681,7 +684,11 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
// 父子级关系处理
|
||||
oldMenuList.stream()
|
||||
.filter(v -> Objects.equals(sarFileSplitMenu.getId(), v.getParentId()))
|
||||
.peek(v -> v.setParentId(newId)).forEach(v -> log.info(v.getParentId()));
|
||||
.map(v -> {
|
||||
v.setParentId(newId);
|
||||
return v;
|
||||
})
|
||||
.forEach(v -> log.info(v.getParentId()));
|
||||
}
|
||||
// 新增数据
|
||||
documentSplitMapper.insertBatchSarFileSplitMenuByInfoId(oldMenuList);
|
||||
@@ -712,10 +719,10 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
});
|
||||
|
||||
List<String> keyList = new ArrayList<>(map.keySet());
|
||||
List<String> valueList = map.values().stream().map(o -> (String) o).collect(Collectors.toList());
|
||||
List<String> valueList = map.values().stream().map(o -> (o + "").replace("'", "\\'") ).collect(Collectors.toList());
|
||||
// 新增数据
|
||||
String insertField = "'" + String.join("','", keyList) + "'";
|
||||
String insertValue = "'" + String.join("','", valueList) + "'";
|
||||
String insertField = String.join(",", keyList);
|
||||
String insertValue = "'" + String.join("','", valueList)+ "'";
|
||||
documentSplitMapper.insertLawsDocumentSplit(insertField, insertValue);
|
||||
|
||||
// 条目信息(旧)
|
||||
@@ -725,10 +732,24 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
fileSplitItemsVal.setItemId(newId);
|
||||
}
|
||||
// 新增数据
|
||||
documentSplitMapper.insertSarFileSplitItemsVal(sarFileSplitItemsVal);
|
||||
if (!sarFileSplitItemsVal.isEmpty()){
|
||||
documentSplitMapper.insertSarFileSplitItemsVal(sarFileSplitItemsVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void revocation(Map<String, Object> parameter) {
|
||||
String id = (String) parameter.get(ID);
|
||||
// 文档拆分信息(旧)
|
||||
DocumentSplitInfo oldInfo = documentSplitMapper.queryDocumentSplitInfoById(id);
|
||||
// 修改发布状态
|
||||
LambdaUpdateWrapper<SarFileSplitInfoEO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(SarFileSplitInfoEO::getId, oldInfo.getId());
|
||||
updateWrapper.set(SarFileSplitInfoEO::getSplitStatus, DocumentSplitCommon.SPLIT_STATUS1);
|
||||
sarFileSplitInfoService.update(updateWrapper);
|
||||
}
|
||||
|
||||
private void manageData(Map<String, Object> resultMap, StringBuilder fieldsBuilder, StringBuilder valuesBuilder) {
|
||||
// 所有key(字段名)
|
||||
resultMap.forEach((k, v) -> {
|
||||
@@ -890,14 +911,20 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
.like("title", documentSplitInfo.getSerialNumberOrName()));
|
||||
}
|
||||
// 标准编号
|
||||
queryWrapper.eq(StringUtils.isNotBlank(documentSplitInfo.getSerialNumber()), "serial_number", StringUtils.isNotBlank(documentSplitInfo.getSerialNumber()));
|
||||
queryWrapper.eq(StringUtils.isNotBlank(documentSplitInfo.getSerialNumber()), "serial_number", documentSplitInfo.getSerialNumber());
|
||||
// 文本状态
|
||||
queryWrapper.eq(StringUtils.isNotBlank(documentSplitInfo.getFileType()), "file_type", StringUtils.isNotBlank(documentSplitInfo.getFileType()));
|
||||
queryWrapper.eq(StringUtils.isNotBlank(documentSplitInfo.getFileType()), "file_type", documentSplitInfo.getFileType());
|
||||
// 拆分状态
|
||||
queryWrapper.eq(StringUtils.isNotBlank(documentSplitInfo.getSplitStatus()), "split_status", documentSplitInfo.getSplitStatus());
|
||||
// 编辑人
|
||||
queryWrapper.eq(StringUtils.isNotBlank(documentSplitInfo.getAuthor()), "username", documentSplitInfo.getAuthor());
|
||||
// 逻辑删除
|
||||
// 发布前id
|
||||
if (StringUtils.isNotBlank(documentSplitInfo.getPublishBeforeId())){
|
||||
queryWrapper.eq("publish_before_id", documentSplitInfo.getPublishBeforeId());
|
||||
}else {
|
||||
queryWrapper.isNull("publish_before_id");
|
||||
}
|
||||
// 逻辑删除
|
||||
queryWrapper.eq("del_flag", 0);
|
||||
// 排序
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
|
||||
@@ -117,6 +117,11 @@ public class SarFileSplitInfoEO implements Serializable {
|
||||
@ApiModelProperty(value = "标准关联id")
|
||||
private String standardId;
|
||||
|
||||
/**发布前id*/
|
||||
@Excel(name = "发布前id", width = 15)
|
||||
@ApiModelProperty(value = "发布前id")
|
||||
private String publishBeforeId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String flag;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user