fix(用例管理): 用例批量编辑日志操作类型记录错误&批量编辑调整

--bug=1035519 --user=王旭 【项目管理】日志-操作类型-批量编辑显示的是删除 https://www.tapd.cn/55049933/s/1464139
This commit is contained in:
WangXu10 2024-02-22 20:38:49 +08:00 committed by Craftsman
parent 32a4ed9448
commit 01da2bf54e
4 changed files with 22 additions and 2 deletions

View File

@ -17,4 +17,6 @@ public interface ExtFunctionalCaseCustomFieldMapper {
void batchUpdate(@Param("functionalCaseCustomField") FunctionalCaseCustomField functionalCaseCustomField, @Param("ids") List<String> ids);
List<FunctionalCaseCustomFieldDTO> getCustomFieldsByCaseIds(@Param("ids") List<String> ids);
void batchDelete(@Param("functionalCaseCustomField") FunctionalCaseCustomField functionalCaseCustomField, @Param("ids") List<String> ids);
}

View File

@ -36,4 +36,13 @@
</foreach>
</select>
<delete id="batchDelete">
delete from functional_case_custom_field
where field_id = #{functionalCaseCustomField.fieldId}
and case_id in
<foreach collection="ids" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -133,7 +133,16 @@ public class FunctionalCaseCustomFieldService {
FunctionalCaseCustomField functionalCaseCustomField = new FunctionalCaseCustomField();
functionalCaseCustomField.setFieldId(customField.getFieldId());
functionalCaseCustomField.setValue(customField.getValue());
extFunctionalCaseCustomFieldMapper.batchUpdate(functionalCaseCustomField, ids);
extFunctionalCaseCustomFieldMapper.batchDelete(functionalCaseCustomField, ids);
List<FunctionalCaseCustomField> list = new ArrayList<>();
ids.forEach(id -> {
FunctionalCaseCustomField field = new FunctionalCaseCustomField();
field.setCaseId(id);
field.setFieldId(customField.getFieldId());
field.setValue(customField.getValue());
list.add(field);
});
functionalCaseCustomFieldMapper.batchInsert(list);
}
public List<FunctionalCaseCustomFieldDTO> getCustomFieldsByCaseIds(List<String> ids) {

View File

@ -304,7 +304,7 @@ public class FunctionalCaseLogService {
null,
functionalCase.getId(),
null,
OperationLogType.DELETE.name(),
OperationLogType.UPDATE.name(),
OperationLogModule.FUNCTIONAL_CASE,
functionalCase.getName());
dto.setHistory(true);