|
|
@@ -1,6 +1,7 @@
|
|
|
package oilsupplier
|
|
|
|
|
|
import (
|
|
|
+ "dashoo.cn/backend/api/business/audithistory"
|
|
|
"dashoo.cn/backend/api/business/paymentinfo"
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
@@ -540,9 +541,11 @@ func (this *OilSupplierCertController) AuditEntity() {
|
|
|
//users = rsvc.GetUserByRole(strconv.Itoa(auditWorkflow.RoleId), this.User.AccCode) //
|
|
|
|
|
|
processInstanceId := ""
|
|
|
+ businessKey := ""
|
|
|
if supplierCertEntity.WorkflowId == "0" || len(supplierCertEntity.WorkflowId) <= 0 {
|
|
|
//启动工作流
|
|
|
- processInstanceId = svcActiviti.StartProcess(workflow.OIL_SUPPLIER_APPLY, certId, this.User.Id)
|
|
|
+ businessKey = certId + "-" + strconv.Itoa(supplierCertEntity.AuditIndex)
|
|
|
+ processInstanceId = svcActiviti.StartProcess(workflow.OIL_SUPPLIER_APPLY, businessKey, this.User.Id)
|
|
|
} else {
|
|
|
processInstanceId = supplierCertEntity.WorkflowId
|
|
|
}
|
|
|
@@ -554,7 +557,7 @@ func (this *OilSupplierCertController) AuditEntity() {
|
|
|
//userIds = strings.Trim(userIds, ",")
|
|
|
var ActiComplete workflow.ActiCompleteVM
|
|
|
ActiComplete.ProcessKey = workflow.OIL_SUPPLIER_APPLY
|
|
|
- ActiComplete.BusinessKey = certId
|
|
|
+ ActiComplete.BusinessKey = businessKey
|
|
|
ActiComplete.UserNames = firstAudit
|
|
|
ActiComplete.UserId = this.User.Id
|
|
|
ActiComplete.Result = "1"
|
|
|
@@ -582,12 +585,16 @@ func (this *OilSupplierCertController) AuditEntity() {
|
|
|
supplierCertEntity.Status = suppliercert.FIRST_TRIAL_STATUS //二级单位初审
|
|
|
supplierCertEntity.Step = 2
|
|
|
supplierCertEntity.FirstAudit, _ = strconv.Atoi(firstAudit)
|
|
|
+ supplierCertEntity.AuditIndex = supplierCertEntity.AuditIndex + 1
|
|
|
+ supplierCertEntity.BusinessKey = ActiComplete.BusinessKey
|
|
|
cols := []string{
|
|
|
"Id",
|
|
|
"WorkflowId",
|
|
|
"Status",
|
|
|
"Step",
|
|
|
"FirstAudit",
|
|
|
+ "AuditIndex",
|
|
|
+ "BusinessKey",
|
|
|
}
|
|
|
certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
|
|
|
@@ -785,7 +792,7 @@ func (this *OilSupplierCertController) AuditEntityFir() {
|
|
|
svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
var ActiComplete workflow.ActiCompleteVM
|
|
|
ActiComplete.ProcessKey = workflow.OIL_SUPPLIER_APPLY
|
|
|
- ActiComplete.BusinessKey = certId
|
|
|
+ ActiComplete.BusinessKey = supplierCertEntity.BusinessKey
|
|
|
ActiComplete.UserNames = userIds
|
|
|
ActiComplete.UserId = this.User.Id
|
|
|
ActiComplete.Remarks = dataother.AuditorRemark
|
|
|
@@ -830,11 +837,28 @@ func (this *OilSupplierCertController) AuditEntityFir() {
|
|
|
receiveVal := svcActiviti.TaskComplete(ActiComplete)
|
|
|
|
|
|
if receiveVal == "true" {
|
|
|
+
|
|
|
+ // 审批历史
|
|
|
+ var audithistoryentity audithistory.Base_AuditHistory
|
|
|
+ audithistoryentity.EntityId = supplierCertEntity.Id
|
|
|
+ audithistoryentity.WorkflowId = supplierCertEntity.WorkflowId
|
|
|
+ audithistoryentity.Process = ActiComplete.ProcessKey
|
|
|
+ audithistoryentity.BusinessKey = ActiComplete.BusinessKey
|
|
|
+ audithistoryentity.Type = supplierCertEntity.SupplierTypeCode
|
|
|
+ audithistoryentity.BackStep = supplierCertEntity.Status
|
|
|
+ audithistoryentity.Index = supplierCertEntity.AuditIndex
|
|
|
+ audithistoryentity.CreateOn = time.Now()
|
|
|
+ audithistoryentity.CreateBy = this.User.Realname
|
|
|
+ audithistoryentity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
+ certSrv.InsertEntity(audithistoryentity)
|
|
|
+
|
|
|
supplierCertEntity.Status = "0"
|
|
|
supplierCertEntity.Step = 1
|
|
|
+ supplierCertEntity.WorkflowId = ""
|
|
|
cols := []string{
|
|
|
"Status",
|
|
|
"Step",
|
|
|
+ "WorkflowId",
|
|
|
}
|
|
|
certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
errinfo.Message = "提交成功!"
|