|
|
|
@ -598,8 +598,12 @@ func (a *ApiMethod) SendUsNatureEvaluation(c *gin.Context) { |
|
|
|
reviewFlowCont.PeopleList = append(reviewFlowCont.PeopleList, receivedValue.UserKey) |
|
|
|
flowMap, _ := flowchart.SetUpWorkFlow(wechatOpenId, context.MainDeparment, reviewFlowCont, 1) |
|
|
|
|
|
|
|
var flowParticipants []string //流程参与人
|
|
|
|
userKeyStr := strconv.FormatInt(context.Key, 10) |
|
|
|
flowParticipants = append(flowParticipants, userKeyStr) |
|
|
|
var sendUserList []string //审批人列表
|
|
|
|
var sendTitle string //标题
|
|
|
|
var operatorKey []string //下一步执行人
|
|
|
|
//获取下一个节点审批人
|
|
|
|
for _, v := range flowMap { |
|
|
|
if v.Step == 2 { |
|
|
|
@ -609,6 +613,12 @@ func (a *ApiMethod) SendUsNatureEvaluation(c *gin.Context) { |
|
|
|
if publicmethod.IsInTrue[string](vu.Wechat, sendUserList) == false { |
|
|
|
sendUserList = append(sendUserList, vu.Wechat) |
|
|
|
} |
|
|
|
if publicmethod.IsInTrue[string](vu.Id, operatorKey) == false { |
|
|
|
operatorKey = append(operatorKey, vu.Id) |
|
|
|
} |
|
|
|
if publicmethod.IsInTrue[string](vu.Id, flowParticipants) == false { |
|
|
|
flowParticipants = append(flowParticipants, vu.Id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
@ -618,6 +628,7 @@ func (a *ApiMethod) SendUsNatureEvaluation(c *gin.Context) { |
|
|
|
flowCont.OrderId = uuId //审批单ID"`
|
|
|
|
flowCont.Step = 1 //当前执行到第几步"`
|
|
|
|
flowCont.NextStep = 2 //下一步执行哪个步骤"`
|
|
|
|
flowCont.NextExecutor = strings.Join(operatorKey, ",") |
|
|
|
sumStep := len(flowMap) |
|
|
|
if sumStep-1 > 0 { |
|
|
|
sumStep = sumStep - 1 |
|
|
|
@ -641,6 +652,7 @@ func (a *ApiMethod) SendUsNatureEvaluation(c *gin.Context) { |
|
|
|
flowCont.State = 3 //流程状态 1:草稿;2:驳回;3:审批中;4:归档;5:废弃;6:删除"`
|
|
|
|
flowCont.StartTime = time.Now().Unix() //流程开始时间"`
|
|
|
|
flowCont.Time = time.Now().Unix() //时间"`
|
|
|
|
flowCont.Participants = strings.Join(flowParticipants, ",") |
|
|
|
if len(receivedValue.Enclosure) > 0 { |
|
|
|
jsonFileList, _ := json.Marshal(receivedValue.Enclosure) |
|
|
|
flowCont.EnclosureFormat = string(jsonFileList) //附件"`
|
|
|
|
@ -1042,7 +1054,7 @@ func (a *ApiMethod) PostRectificationMeasures(c *gin.Context) { |
|
|
|
} |
|
|
|
//更新审批流状态
|
|
|
|
syncSeting.Add(1) |
|
|
|
go UpdateStateFlow(pwoCont.Id, nextStep, flowState) |
|
|
|
go UpdateStateFlow(pwoCont.Id, nextStep, flowState, flowMap) |
|
|
|
//更新审批工作流json内容
|
|
|
|
wechatName := context.Wechat |
|
|
|
if context.WorkWechat != "" { |
|
|
|
@ -1143,8 +1155,11 @@ func ApproveFlow(systemApp string, flowMap []publicmethod.FlowChartList, flowOne |
|
|
|
nextStep = flowOneCont.Step + 1 |
|
|
|
} |
|
|
|
//更新审批流状态
|
|
|
|
var pwoCont modelskpi.PostWorkflowOrders |
|
|
|
pwoCont.EiteCont(map[string]interface{}{"`order_id`": pwoContOld.OrderId}, map[string]interface{}{"`next_step`": nextStep, "`state`": flowState, "`time`": time.Now().Unix()}) //改变审批流状态
|
|
|
|
|
|
|
|
// var pwoCont modelskpi.PostWorkflowOrders
|
|
|
|
// pwoCont.EiteCont(map[string]interface{}{"`order_id`": pwoContOld.OrderId}, map[string]interface{}{"`next_step`": nextStep, "`state`": flowState, "`time`": time.Now().Unix()}) //改变审批流状态
|
|
|
|
syncSeting.Add(1) |
|
|
|
go UpdateStateFlow(pwoContOld.Id, nextStep, flowState, flowMap) |
|
|
|
|
|
|
|
//获取下一部操作
|
|
|
|
for _, fv := range flowMap { |
|
|
|
@ -1495,6 +1510,7 @@ func ApproveFlow(systemApp string, flowMap []publicmethod.FlowChartList, flowOne |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
syncSeting.Wait() |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
@ -1567,13 +1583,38 @@ func EidtPostFlowLog(pwoId int64, flowMap []publicmethod.FlowChartList, oneFlowC |
|
|
|
#pwoId 审批流ID |
|
|
|
#nextStep 下一步 |
|
|
|
#flowState 流程状态 |
|
|
|
#flowMap 流程结构体 |
|
|
|
|
|
|
|
@ 返回值 |
|
|
|
|
|
|
|
# |
|
|
|
*/ |
|
|
|
func UpdateStateFlow(pwoId int64, nextStep, flowState int) { |
|
|
|
func UpdateStateFlow(pwoId int64, nextStep, flowState int, flowMap []publicmethod.FlowChartList) { |
|
|
|
defer syncSeting.Done() |
|
|
|
var flowParticipants []string //流程参与人
|
|
|
|
//获取参与者
|
|
|
|
var pwoContInfo modelskpi.PostWorkflowOrders |
|
|
|
errPwo := pwoContInfo.GetCont(map[string]interface{}{"`id`": pwoId}, "'participants'") |
|
|
|
if errPwo == nil { |
|
|
|
powPartAry := strings.Split(pwoContInfo.Participants, ",") |
|
|
|
for _, vu := range powPartAry { |
|
|
|
if publicmethod.IsInTrue[string](vu, flowParticipants) == false { |
|
|
|
flowParticipants = append(flowParticipants, vu) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
nextUserKey, _ := flowchart.GetNodeOperator(flowMap, nextStep) |
|
|
|
for _, vuk := range nextUserKey { |
|
|
|
if publicmethod.IsInTrue[string](vuk, flowParticipants) == false { |
|
|
|
flowParticipants = append(flowParticipants, vuk) |
|
|
|
} |
|
|
|
} |
|
|
|
nextUserKeyStr := strings.Join(nextUserKey, ",") |
|
|
|
if nextStep == 0 { |
|
|
|
nextUserKeyStr = "" |
|
|
|
} |
|
|
|
flowUserKey := strings.Join(flowParticipants, ",") |
|
|
|
var pwoCont modelskpi.PostWorkflowOrders |
|
|
|
pwoCont.EiteCont(map[string]interface{}{"`id`": pwoId}, map[string]interface{}{"`next_step`": nextStep, "`state`": flowState, "`time`": time.Now().Unix()}) //改变审批流状态
|
|
|
|
pwoCont.EiteCont(map[string]interface{}{"`id`": pwoId}, map[string]interface{}{"`next_step`": nextStep, "`state`": flowState, "'next_executor'": nextUserKeyStr, "`participants`": flowUserKey, "`time`": time.Now().Unix()}) //改变审批流状态
|
|
|
|
} |
|
|
|
|