fix(项目设置): 缺陷模板覆盖复制时字段类型不一致值处理的问题

--bug=1015891 --user=宋昌昌 【项目设置】项目1自定义字段a类型是单选框,项目2自定义字段a类型是输入框,项目1复制缺陷模版选项目2,复制模式覆盖,复制完,项目2的自定义字段类型未覆盖成功 https://www.tapd.cn/55049933/s/1225341
This commit is contained in:
song-cc-rock 2022-08-17 16:00:46 +08:00 committed by 刘瑞斌
parent 237b45557d
commit 540028cdab
1 changed files with 5 additions and 1 deletions

View File

@ -393,7 +393,11 @@ public class IssueTemplateService extends TemplateBaseService {
tarCustomField.setCreateUser(SessionUtils.getUserId());
if (StringUtils.equals("1", request.getCopyModel())) {
// 覆盖模式
tarCustomField.setOptions(sourceCustomField.getOptions());
if (StringUtils.equals(sourceCustomField.getType(), tarCustomField.getType())) {
tarCustomField.setOptions(sourceCustomField.getOptions());
} else {
tarCustomField.setOptions("[]");
}
customFieldMapper.updateByPrimaryKeyWithBLOBs(tarCustomField);
} else {
//追加模式