fix(文档拆分): 参数类型问题

This commit is contained in:
yjz
2023-10-16 10:25:41 +08:00
parent 76865779da
commit e6bc4ccd19
3 changed files with 46 additions and 24 deletions
@@ -72,6 +72,13 @@ public interface DocumentSplitMapper {
*/
List<SarFileSplitItemsValEO> queryItemsValByItemId(@Param("itemId") String itemId);
/**
* 条目删除根据itemId
* @param itemId
* @return
*/
int deleteItemsValByItemId(@Param("itemId") String itemId);
/**
* 目录删除根据menuId集合
* @param menuIdList
@@ -15,6 +15,11 @@
where #{updateCondition}
</delete>
<delete id="deleteItemsValByItemId">
delete from sar_file_split_items_val
where item_id = #{itemId}
</delete>
<select id="queryByPage" resultType="com.jero.modules.laws.documenttool.entity.DocumentSplitInfo">
select *
from (select i.id as id,
@@ -120,8 +120,8 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
.equals(String.valueOf(v.getIsQuery()))).collect(Collectors.toList());
// 分页参数
Integer pageNo = (Integer) parameter.get("pageNo");
Integer pageSize =(Integer) parameter.get("pageSize");
int pageNo = Integer.parseInt((String) parameter.get("pageNo"));
int pageSize = Integer.parseInt((String) parameter.get("pageSize"));
// sql查询列字段拼接
String selectColumn = getSelectColumn(fieldListSelect);
@@ -158,13 +158,17 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
fieldList = fieldList.stream().filter(v -> YesOrNoEnum.YES.getInteger()
.equals(v.getIsShowFormCreate())).collect(Collectors.toList());
List<LawsTag> finalFieldList = fieldList;
parameter.forEach((k, v) -> {
StringBuilder updateSet = new StringBuilder();
parameter.forEach((k, v) ->
// 修改字段
String updateSet = getUpdateValue(finalFieldList, k, (String) v);
// where条件
String updateCondition = (String) parameter.get("id");
documentSplitMapper.editDocumentSplitDetail(updateSet, updateCondition);
});
updateSet.append(getUpdateValue(finalFieldList, k, (String) v))
);
// 更新人和更新时间
String updateByAndUpdateTime = new UniversalImpl().getUpdateByAndUpdateTime();
updateSet.insert(0, updateByAndUpdateTime + ",");
// where条件
String updateCondition = "id = '" + parameter.get("id") + "'";
documentSplitMapper.editDocumentSplitDetail(updateSet.toString(), updateCondition);
}
@NotNull
@@ -182,9 +186,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
}
});
// 修改数据
String updateByAndUpdateTime = new UniversalImpl().getUpdateByAndUpdateTime();
String join = String.join(",", sqlList);
return updateByAndUpdateTime + "," + join;
return String.join(",", sqlList);
}
@Override
@@ -195,20 +197,28 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
fieldList = fieldList.stream().filter(v -> YesOrNoEnum.YES.getInteger()
.equals(v.getIsShowFormCreate())).collect(Collectors.toList());
List<LawsTag> finalFieldList = fieldList;
parameter.forEach((k, v) -> {
StringBuilder updateSet = new StringBuilder();
parameter.forEach((k, v) ->
// 修改字段
String updateSet = getUpdateValue(finalFieldList, k, (String) v);
// where条件
String updateCondition = "";
if (parameter.containsKey("id")){
String id = (String) parameter.get("id");
updateCondition = "id = " + "'" + id + "'";
}else {
String infoId = (String) parameter.get(INFO_ID);
updateCondition = "info_id = " + "'" + infoId + "'";
}
documentSplitMapper.editDocumentSplitDetail(updateSet, updateCondition);
});
updateSet.append(getUpdateValue(finalFieldList, k, (String) v))
);
// 更新人和更新时间
String updateByAndUpdateTime = new UniversalImpl().getUpdateByAndUpdateTime();
updateSet.insert(0, updateByAndUpdateTime + ",");
// where条件
String updateCondition = "";
if (parameter.containsKey("ids")){
String ids = (String) parameter.get("ids");
List<String> list = Arrays.asList(ids.split(","));
updateCondition = "id in " + "'" + String.join(",", list) + "'";
}else {
String infoId = (String) parameter.get(INFO_ID);
updateCondition = "info_id = " + "'" + infoId + "'";
}
documentSplitMapper.editDocumentSplitDetail(updateSet.toString(), updateCondition);
// 条目更新
// 删除旧数据
// documentSplitMapper.deleteItemsValByItemId();
}
@Override