文档库--处理已删除的标准
This commit is contained in:
+7
@@ -85,5 +85,12 @@ public interface BussDocumentLibraryEOMapper extends BaseMapper<BussDocumentLibr
|
|||||||
|
|
||||||
List<Map<String,Object>> getListInfo(@Param("condition") String condition);
|
List<Map<String,Object>> getListInfo(@Param("condition") String condition);
|
||||||
|
|
||||||
|
List<Map<String,Object>> selectMapsByDeleteIds(@Param("id") String id);
|
||||||
|
|
||||||
|
void updateByDeleteId(@Param("correspondingStandardStr") String correspondingStandardStr,
|
||||||
|
@Param("replaceStandardStr") String replaceStandardStr,
|
||||||
|
@Param("id") String id );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-29
@@ -3,35 +3,6 @@
|
|||||||
<mapper namespace="com.jero.modules.document.mapper.BussDocumentLibraryEOMapper">
|
<mapper namespace="com.jero.modules.document.mapper.BussDocumentLibraryEOMapper">
|
||||||
<resultMap id="BussDocumentLibraryEOResultMap" type="com.jero.modules.document.entity.BussDocumentLibraryEO">
|
<resultMap id="BussDocumentLibraryEOResultMap" type="com.jero.modules.document.entity.BussDocumentLibraryEO">
|
||||||
<id column="id" property="id" />
|
<id column="id" property="id" />
|
||||||
<result column="create_by" property="createBy" />
|
|
||||||
<result column="create_time" property="createTime" />
|
|
||||||
<result column="update_by" property="updateBy" />
|
|
||||||
<result column="update_time" property="updateTime" />
|
|
||||||
<result column="sys_org_code" property="sysOrgCode" />
|
|
||||||
<result column="region" property="region" />
|
|
||||||
<result column="type" property="type" />
|
|
||||||
<result column="standard_system" property="standardSystem" />
|
|
||||||
<result column="state" property="state" />
|
|
||||||
<result column="car_type" property="carType" />
|
|
||||||
<result column="energy_type" property="energyType" />
|
|
||||||
<result column="apply_scope" property="applyScope" />
|
|
||||||
<result column="function_territory" property="functionTerritory" />
|
|
||||||
<result column="technology_territory" property="technologyTerritory" />
|
|
||||||
<result column="serial_number" property="serialNumber" />
|
|
||||||
<result column="title" property="title" />
|
|
||||||
<result column="issue_time" property="issueTime" />
|
|
||||||
<result column="implement_time" property="implementTime" />
|
|
||||||
<result column="replace_standard" property="replaceStandard" />
|
|
||||||
<result column="replaced_standard" property="replacedStandard" />
|
|
||||||
<result column="description" property="description" />
|
|
||||||
<result column="corresponding_standard" property="correspondingStandard" />
|
|
||||||
<result column="test_program" property="testProgram" />
|
|
||||||
<result column="release_draft" property="releaseDraft" />
|
|
||||||
<result column="supplement" property="supplement" />
|
|
||||||
<result column="approval_draft" property="approvalDraft" />
|
|
||||||
<result column="exposure_draft" property="exposureDraft" />
|
|
||||||
<result column="datum" property="datum" />
|
|
||||||
<result column="warn_flag" property="warnFlag" />
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="insertInfo">
|
<insert id="insertInfo">
|
||||||
@@ -99,4 +70,16 @@
|
|||||||
where ${condition}
|
where ${condition}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMapsByDeleteIds" resultType="java.util.LinkedHashMap">
|
||||||
|
select * from buss_document_library
|
||||||
|
where corresponding_standard like concat(concat('%',#{id}),'%')
|
||||||
|
or replace_standard like concat(concat('%',#{id}),'%')
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateByDeleteId">
|
||||||
|
update buss_document_library set
|
||||||
|
corresponding_standard =#{correspondingStandardStr},replace_standard=#{replaceStandardStr}
|
||||||
|
where id=#{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
+44
@@ -191,6 +191,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
iOSSFileService.deleteByConnectIdList(connectIdList);
|
iOSSFileService.deleteByConnectIdList(connectIdList);
|
||||||
//删除文档库数据
|
//删除文档库数据
|
||||||
removeByIds(ids);
|
removeByIds(ids);
|
||||||
|
//修改对应标准,代替标准中已删除的标准
|
||||||
|
updateDeletedDate(ids);
|
||||||
//订阅用户发送消息
|
//订阅用户发送消息
|
||||||
//订阅的文档
|
//订阅的文档
|
||||||
LambdaQueryWrapper<OnlCgformSubscribe> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<OnlCgformSubscribe> wrapper = new LambdaQueryWrapper<>();
|
||||||
@@ -248,6 +250,48 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateDeletedDate(List<String> ids) {
|
||||||
|
List<Map<String, Object>> mapListTemp = new ArrayList<>();//
|
||||||
|
for (String id : ids) {
|
||||||
|
List<Map<String, Object>> mapTemp = bussDocumentLibraryEOMapper.selectMapsByDeleteIds(id);
|
||||||
|
mapListTemp.addAll(mapTemp);
|
||||||
|
}
|
||||||
|
for (Map<String, Object> objectMap : mapListTemp) {
|
||||||
|
String correspondingStandard = (String)objectMap.get("corresponding_standard");
|
||||||
|
String replaceStandard = (String)objectMap.get("replace_standard");
|
||||||
|
String id = (String) objectMap.get("id");
|
||||||
|
StringBuilder correspondingStandardSb = new StringBuilder();
|
||||||
|
StringBuilder replaceStandardSb = new StringBuilder();
|
||||||
|
String correspondingStandardStr = "";
|
||||||
|
String replaceStandardStr = "";
|
||||||
|
if(StringUtils.isNotBlank(correspondingStandard)){
|
||||||
|
for (String s : correspondingStandard.split(",")) {
|
||||||
|
if(!ids.contains(s)){
|
||||||
|
correspondingStandardSb.append(s+",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(correspondingStandardSb)){
|
||||||
|
correspondingStandardStr = correspondingStandardSb.substring(0, correspondingStandardSb.length() - 1);
|
||||||
|
}else{
|
||||||
|
correspondingStandardStr = correspondingStandard;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(replaceStandard)){
|
||||||
|
for (String s : replaceStandard.split(",")) {
|
||||||
|
if(!ids.contains(s)){
|
||||||
|
replaceStandardSb.append(s+",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(replaceStandardSb)){
|
||||||
|
replaceStandardStr = replaceStandardSb.substring(0, replaceStandardSb.length() - 1);
|
||||||
|
}else{
|
||||||
|
replaceStandardStr = replaceStandard;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bussDocumentLibraryEOMapper.updateByDeleteId(correspondingStandardStr,replaceStandardStr,id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user