|
|
@@ -531,6 +531,8 @@ func (this *OilSupplierCertAppendController) AuditEntity() {
|
|
|
certSrv := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
|
|
|
var supplierCertAppendEntity suppliercertappend.OilSupplierCertAppend
|
|
|
certSrv.GetEntityById(certappendId, &supplierCertAppendEntity)
|
|
|
+ var supplierEntity supplier.OilSupplier
|
|
|
+ certSrv.GetEntityById(supplierCertAppendEntity.SupplierId, &supplierEntity)
|
|
|
var historworkflowid string
|
|
|
historworkflowid = supplierCertAppendEntity.WorkFlowId
|
|
|
var errinfo ErrorDataInfo
|
|
|
@@ -567,20 +569,25 @@ func (this *OilSupplierCertAppendController) AuditEntity() {
|
|
|
businessKey = certappendId + "-" + strconv.Itoa(supplierCertAppendEntity.AuditIndex)
|
|
|
if supplierCertAppendEntity.InStyle == "2" || supplierCertAppendEntity.InStyle == "4" || supplierCertAppendEntity.InStyle == "6" {
|
|
|
processInstanceId = svcActiviti.StartProcess2(workflow.OIL_FIRST_ENUSER_APPEND_APPLY, businessKey, this.User.Id, result, supplierCertAppendEntity.AppendType, supplierCertAppendEntity.SupplierName)
|
|
|
- } else if supplierCertAppendEntity.InStyle == "3" {
|
|
|
+ } else if supplierCertAppendEntity.InStyle == "3" && supplierEntity.MgrUnit == supplier.MGRUNIT {
|
|
|
processInstanceId = svcActiviti.StartProcess2(workflow.OIL_SECOND_ENUSER_APPEND_APPLY, businessKey, this.User.Id, result, supplierCertAppendEntity.AppendType, supplierCertAppendEntity.SupplierName)
|
|
|
} else if supplierCertAppendEntity.InStyle == "1" || supplierCertAppendEntity.InStyle == "5" {
|
|
|
processInstanceId = svcActiviti.StartProcess2(workflow.OIL_ENUSER_APPEND_APPLY, businessKey, this.User.Id, result, supplierCertAppendEntity.AppendType, supplierCertAppendEntity.SupplierName)
|
|
|
+ } else if supplierCertAppendEntity.InStyle == "3" && supplierEntity.MgrUnit != supplier.MGRUNIT {
|
|
|
+ // 二级物资准入(除大港油田外的其他公司)
|
|
|
+ processInstanceId = svcActiviti.StartProcess2(workflow.OIL_SECOND_OTHER_APPEND_APPLY, businessKey, this.User.Id, result, supplierCertAppendEntity.AppendType, supplierCertAppendEntity.SupplierName)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
var ActiComplete workflow.ActiCompleteVM
|
|
|
if supplierCertAppendEntity.InStyle == "2" || supplierCertAppendEntity.InStyle == "4" || supplierCertAppendEntity.InStyle == "6" {
|
|
|
ActiComplete.ProcessKey = workflow.OIL_FIRST_ENUSER_APPEND_APPLY
|
|
|
- } else if supplierCertAppendEntity.InStyle == "3" {
|
|
|
+ } else if supplierCertAppendEntity.InStyle == "3" && supplierEntity.MgrUnit == supplier.MGRUNIT {
|
|
|
ActiComplete.ProcessKey = workflow.OIL_SECOND_ENUSER_APPEND_APPLY
|
|
|
} else if supplierCertAppendEntity.InStyle == "1" || supplierCertAppendEntity.InStyle == "5" {
|
|
|
ActiComplete.ProcessKey = workflow.OIL_ENUSER_APPEND_APPLY
|
|
|
+ } else if supplierCertAppendEntity.InStyle == "3" && supplierEntity.MgrUnit != supplier.MGRUNIT {
|
|
|
+ ActiComplete.ProcessKey = workflow.OIL_SECOND_OTHER_APPEND_APPLY
|
|
|
}
|
|
|
|
|
|
ActiComplete.BusinessKey = businessKey
|
|
|
@@ -718,7 +725,7 @@ func (this *OilSupplierCertAppendController) AuditEntityFir() {
|
|
|
var userlist []userRole.Base_User
|
|
|
var setting auditsetting.Base_OilAuditSetting
|
|
|
usvc := userRole.GetUserService(utils.DBE)
|
|
|
- if supplierCertAppendEntity.InStyle == "3" {
|
|
|
+ if supplierCertAppendEntity.InStyle == "3" && supplierEntity.MgrUnit == supplier.MGRUNIT {
|
|
|
status = suppliercert.CENT_AUDIT_STATUS
|
|
|
where := "AuditStepCode='" + workflow.PROF_REGULATION + "'"
|
|
|
usvc.GetEntity(&setting, where)
|
|
|
@@ -732,6 +739,33 @@ func (this *OilSupplierCertAppendController) AuditEntityFir() {
|
|
|
where := "Id in (" + uids + ")" + " and UnitId=" + topid
|
|
|
usvc.GetEntities(&userlist, where)
|
|
|
}
|
|
|
+ } else if supplierCertAppendEntity.InStyle == "3" && supplierEntity.MgrUnit != supplier.MGRUNIT {
|
|
|
+ status = suppliercert.CENT_AUDIT_STATUS
|
|
|
+ step = 2
|
|
|
+ backstatus = suppliercert.NO_PROF_AUDIT_STATUS
|
|
|
+
|
|
|
+ paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
+ topid := paramSvc.GetBaseparameterMessage("", "paramset", "CENT_AUDIT")
|
|
|
+
|
|
|
+ var userlist []userRole.Base_User
|
|
|
+ var setting auditsetting.Base_OilAuditSetting
|
|
|
+ usvc := userRole.GetUserService(utils.DBE)
|
|
|
+ where := "AuditStepCode='" + workflow.PROF_REGULATION + "'"
|
|
|
+ usvc.GetEntity(&setting, where)
|
|
|
+
|
|
|
+ ids := usvc.GetUserIdsByRoleId(strconv.Itoa(setting.RoleId))
|
|
|
+ tempstr := strings.Join(ids, ",")
|
|
|
+ uids := strings.Replace(tempstr, "uid_", "", -1)
|
|
|
+ uids = strings.Trim(uids, ",")
|
|
|
+ if uids != "" {
|
|
|
+ where := "Id in (" + uids + ")" + " and UnitId=" + topid
|
|
|
+ usvc.GetEntities(&userlist, where)
|
|
|
+ }
|
|
|
+ for _, tmpUser := range userlist {
|
|
|
+ userIds += strconv.Itoa(tmpUser.Id) + ","
|
|
|
+ }
|
|
|
+
|
|
|
+ userIds = strings.Trim(userIds, ",")
|
|
|
} else if supplierCertAppendEntity.InStyle == "2" || supplierCertAppendEntity.InStyle == "4" || supplierCertAppendEntity.InStyle == "6" {
|
|
|
step = 2
|
|
|
status = suppliercert.ALL_PASE_STATUS
|