|
@@ -82,6 +82,16 @@ func (l *SopTaskCopyLogic) SopTaskCopy(req *types.CopyReq) (resp *types.BaseMsgR
|
|
|
c.LabelIdList = newLabels
|
|
|
newConditionList = append(newConditionList, c)
|
|
|
}
|
|
|
+ newLabelAdd, err := CreateLabels(tx, s.ActionLabelAdd, targetOrganizationId, l.ctx, l.Logger)
|
|
|
+ if err != nil {
|
|
|
+ _ = tx.Rollback()
|
|
|
+ return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
|
|
|
+ }
|
|
|
+ newLabelDel, err := CreateLabels(tx, s.ActionLabelDel, targetOrganizationId, l.ctx, l.Logger)
|
|
|
+ if err != nil {
|
|
|
+ _ = tx.Rollback()
|
|
|
+ return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
|
|
|
+ }
|
|
|
newStage, err := tx.SopStage.Create().
|
|
|
SetTaskID(newTask.ID).
|
|
|
SetName(s.Name).
|
|
@@ -89,8 +99,8 @@ func (l *SopTaskCopyLogic) SopTaskCopy(req *types.CopyReq) (resp *types.BaseMsgR
|
|
|
SetConditionOperator(s.ConditionOperator).
|
|
|
SetConditionList(newConditionList).
|
|
|
SetNotNilActionMessage(s.ActionMessage).
|
|
|
- SetNotNilActionLabelAdd(s.ActionLabelAdd).
|
|
|
- SetNotNilActionLabelDel(s.ActionLabelDel).
|
|
|
+ SetNotNilActionLabelAdd(newLabelAdd).
|
|
|
+ SetNotNilActionLabelDel(newLabelDel).
|
|
|
SetNotNilActionForward(&s.ActionForward).
|
|
|
SetIndexSort(s.IndexSort).
|
|
|
Save(l.ctx)
|