feat(文档拆分): 批量删除
This commit is contained in:
+3
@@ -48,4 +48,7 @@ public class DocumentSplitCommon {
|
||||
* <=
|
||||
*/
|
||||
public static final String LT = " <= ";
|
||||
|
||||
public static final String MEG_DEL = "删除成功!";
|
||||
public static final String MEG_DEL_BATCH = "批量删除成功!";
|
||||
}
|
||||
|
||||
+16
-2
@@ -3,6 +3,7 @@ package com.jero.modules.laws.documenttool.controller;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.modules.laws.documenttool.common.DocumentSplitCommon;
|
||||
import com.jero.modules.laws.documenttool.entity.DocumentSplitInfo;
|
||||
import com.jero.modules.laws.documenttool.service.IDocumentSplitService;
|
||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
@@ -91,7 +92,7 @@ public class DocumentSplitController {
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<T> delete(@RequestParam(name="id",required=true) String id) {
|
||||
sarFileSplitInfoService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
return Result.OK(DocumentSplitCommon.MEG_DEL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,7 +105,7 @@ public class DocumentSplitController {
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<T> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.sarFileSplitInfoService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
return Result.OK(DocumentSplitCommon.MEG_DEL_BATCH);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,6 +143,19 @@ public class DocumentSplitController {
|
||||
@PostMapping("/editBatchDocumentSplitDetail")
|
||||
public Result<T> editBatchDocumentSplitDetail(@RequestBody Map<String, Object> parameter) {
|
||||
documentSplitService.editBatchDocumentSplitDetail(parameter);
|
||||
return Result.OK(DocumentSplitCommon.MEG_DEL_BATCH);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文档拆分详情-批量删除
|
||||
*
|
||||
* @return Result<T>
|
||||
*/
|
||||
@AutoLog(value = "文档拆分详情-批量删除")
|
||||
@ApiOperation(value="文档拆分详情-批量删除", notes="文档拆分详情-批量删除")
|
||||
@PostMapping(value = "/deleteBatchBatchDocumentSplitDetail")
|
||||
public Result<T> deleteBatchBatchDocumentSplitDetail(@RequestBody Map<String, Object> parameter) {
|
||||
documentSplitService.deleteBatchBatchDocumentSplitDetail(parameter);
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
|
||||
+6
@@ -77,4 +77,10 @@ public interface DocumentSplitMapper {
|
||||
* @param menuIdList
|
||||
*/
|
||||
int sarFileSplitMenudeleteByIdList(@Param("menuIdList") List<String> menuIdList);
|
||||
|
||||
/**
|
||||
* 文档拆分详情-批量删除
|
||||
* @param updateCondition
|
||||
*/
|
||||
int deleteBatchBatchDocumentSplitDetail(@Param("updateCondition") String updateCondition);
|
||||
}
|
||||
|
||||
+5
@@ -10,6 +10,11 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBatchBatchDocumentSplitDetail">
|
||||
delete from laws_document_split
|
||||
where #{updateCondition}
|
||||
</delete>
|
||||
|
||||
<select id="queryByPage" resultType="com.jero.modules.laws.documenttool.entity.DocumentSplitInfo">
|
||||
select *
|
||||
from (select i.id as id,
|
||||
|
||||
+6
@@ -66,4 +66,10 @@ public interface IDocumentSplitService {
|
||||
* @param parameter
|
||||
*/
|
||||
void mergeDocumentSplitDetail(Map<String, Object> parameter);
|
||||
|
||||
/**
|
||||
* 文档拆分详情-批量删除
|
||||
* @param parameter
|
||||
*/
|
||||
void deleteBatchBatchDocumentSplitDetail(Map<String, Object> parameter);
|
||||
}
|
||||
|
||||
+16
@@ -274,6 +274,22 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBatchBatchDocumentSplitDetail(Map<String, Object> parameter) {
|
||||
// where条件
|
||||
String updateCondition = "";
|
||||
if (parameter.containsKey(ID)){
|
||||
String id = (String) parameter.get(ID);
|
||||
List<String> list = Arrays.asList(id.split(","));
|
||||
updateCondition = "id in " + "'" + String.join(",", list) + "'";
|
||||
}else {
|
||||
String infoId = (String) parameter.get(INFO_ID);
|
||||
updateCondition = "info_id = " + "'" + infoId + "'";
|
||||
}
|
||||
// 删除数据
|
||||
documentSplitMapper.deleteBatchBatchDocumentSplitDetail(updateCondition);
|
||||
}
|
||||
|
||||
private String mergeData(List<Map<String, Object>> listMap) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
// 合并数据(合并每个key对应的value)
|
||||
|
||||
Reference in New Issue
Block a user