Skip to content

Commit

Permalink
[IMP] 修复项目面板拖动issue自定义流转报错
Browse files Browse the repository at this point in the history
  • Loading branch information
phyear committed Sep 1, 2020
1 parent 39824df commit 41f4c8a
Showing 1 changed file with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public class StatusFieldSettingServiceImpl implements StatusFieldSettingService
FIELD_CODE.put(FieldCode.EPIC, "epicId");
FIELD_CODE.put(FieldCode.CREATION_DATE, "creationDate");
FIELD_CODE.put(FieldCode.LAST_UPDATE_DATE, "lastUpdateDate");
FIELD_CODE.put(FieldCode.ESTIMATED_END_TIME, "estimatedEndTime");
FIELD_CODE.put(FieldCode.ESTIMATED_START_TIME, "estimatedStartTime");
}
@Override
public List<StatusFieldSettingVO> createOrUpdate(Long project, Long issueType, Long statusId, Long objectVersionNumber, String applyType, List<StatusFieldSettingVO> list) {
Expand Down Expand Up @@ -263,7 +265,9 @@ private void handlerFieldName(IssueUpdateVO issueUpdateVO, List<StatusFieldValue
break;
case FieldCode.CREATION_DATE:
case FieldCode.LAST_UPDATE_DATE:
field.set(issueUpdateVO, handlerTimeField(fieldValueSettingDTO));
case FieldCode.ESTIMATED_START_TIME:
case FieldCode.ESTIMATED_END_TIME:
field.set(issueUpdateVO, handlerPredefinedTimeField(fieldValueSettingDTO));
break;
case FieldCode.EPIC:
case FieldCode.PRIORITY:
Expand Down Expand Up @@ -301,6 +305,21 @@ private void handlerFieldName(IssueUpdateVO issueUpdateVO, List<StatusFieldValue
}
}

private Date handlerPredefinedTimeField(StatusFieldValueSettingDTO fieldValueSettingDTO) {
Date date = null;
if ("add".equals(fieldValueSettingDTO.getOperateType())) {
BigDecimal dateAddValue = fieldValueSettingDTO.getDateAddValue();
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH, dateAddValue.intValue());
date = cal.getTime();
} else if ("current_time".equals(fieldValueSettingDTO.getOperateType())) {
date = new Date();
} else {
date = fieldValueSettingDTO.getDateValue();
}
return date;
}

private BigDecimal handlerPredefinedNumber(StatusFieldValueSettingDTO statusFieldValueSettingDTO, BigDecimal oldValue) {
BigDecimal bigDecimal = null;
if ("add".equals(statusFieldValueSettingDTO.getOperateType())) {
Expand Down

0 comments on commit 41f4c8a

Please sign in to comment.