fix(测试跟踪): 缺陷模板操作日志详情有误

--bug=1018579 --user=宋昌昌 【系统设置】操纵日志-更新缺陷模版的操作日志详情错误 https://www.tapd.cn/55049933/s/1274206
This commit is contained in:
song-cc-rock 2022-10-24 15:00:04 +08:00 committed by jianxing
parent 9111e8a6ef
commit 02f5c887cf
1 changed files with 15 additions and 6 deletions

View File

@ -493,13 +493,22 @@ public class IssueTemplateService extends TemplateBaseService {
for (CustomFieldTemplate customFieldTemplate : customFields) { for (CustomFieldTemplate customFieldTemplate : customFields) {
CustomField customField = customFieldMapper.selectByPrimaryKey(customFieldTemplate.getFieldId()); CustomField customField = customFieldMapper.selectByPrimaryKey(customFieldTemplate.getFieldId());
CustomFieldDao customFieldDao = new CustomFieldDao(); CustomFieldDao customFieldDao = new CustomFieldDao();
if (customField != null) {
BeanUtils.copyBean(customFieldDao, customField); BeanUtils.copyBean(customFieldDao, customField);
customFieldDao.setDefaultValue(customFieldTemplate.getDefaultValue()); customFieldDao.setDefaultValue(customFieldTemplate.getDefaultValue());
List<DetailColumn> columnsField = ReflexObjectUtil.getColumns(customFieldDao, SystemReference.issueFieldColumns); List<DetailColumn> columnsField = ReflexObjectUtil.getColumns(customFieldDao, SystemReference.issueFieldColumns);
columns.addAll(columnsField); columns.addAll(columnsField);
} else {
customFieldDao.setName(StringUtils.EMPTY);
customFieldDao.setScene(StringUtils.EMPTY);
customFieldDao.setType(StringUtils.EMPTY);
customFieldDao.setSystem(null);
customFieldDao.setRemark(StringUtils.EMPTY);
customFieldDao.setDefaultValue(StringUtils.EMPTY);
List<DetailColumn> columnsField = ReflexObjectUtil.getColumns(customFieldDao, SystemReference.issueFieldColumns);
columns.addAll(columnsField);
}
} }
List<DetailColumn> columnIssues = ReflexObjectUtil.getColumns(templateWithBLOBs, SystemReference.issueFieldColumns);
columns.addAll(columnIssues);
OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(templateWithBLOBs.getId()), OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(templateWithBLOBs.getId()),
templateWithBLOBs.getProjectId(), templateWithBLOBs.getName(), templateWithBLOBs.getCreateUser(), columns); templateWithBLOBs.getProjectId(), templateWithBLOBs.getName(), templateWithBLOBs.getCreateUser(), columns);
return JSON.toJSONString(details); return JSON.toJSONString(details);