|
|
@@ -613,80 +613,131 @@ func (this *OilSupplierCertAppendController) AuditEntityFir() {
|
|
|
status := ""
|
|
|
backstatus := "0"
|
|
|
var userIds string
|
|
|
- if supplierCertAppendEntity.InStyle == "2" {
|
|
|
- if supplierCertAppendEntity.Status == suppliercert.SECOND_TRIAL_STATUS{
|
|
|
- supplierCertAppendEntity.Status = suppliercert.PROF_AUDIT_STATUS
|
|
|
- }
|
|
|
- }
|
|
|
if supplierCertAppendEntity.Status == suppliercert.FIRST_TRIAL_STATUS {
|
|
|
userIds = utils.ToStr(supplierCertAppendEntity.SecondAudit)
|
|
|
status = suppliercert.SECOND_TRIAL_STATUS
|
|
|
step = 2
|
|
|
backstatus = suppliercert.NOPASS_STATUS
|
|
|
} else if supplierCertAppendEntity.Status == suppliercert.SECOND_TRIAL_STATUS {
|
|
|
- status = suppliercert.THIRD_TRIAL_STATUS
|
|
|
- step = 2
|
|
|
- backstatus = suppliercert.NO_SECOND_TRIAL_STATUS
|
|
|
- //supsvc := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
- //var users []userRole.Base_RoleList
|
|
|
- //supsvc.GetAuditUser(strconv.Itoa(supplierCertAppendEntity.ThirdAudit), workflow.PROF_RECE, &users)
|
|
|
svc := organize.GetOrganizeService(utils.DBE)
|
|
|
unitId := svc.GetMyUnitDepartmentId(strconv.Itoa(supplierCertAppendEntity.ThirdAudit))
|
|
|
var userlist []userRole.Base_User
|
|
|
var setting auditsetting.Base_OilAuditSetting
|
|
|
usvc := userRole.GetUserService(utils.DBE)
|
|
|
- where := "AuditStepCode='" + workflow.PROF_RECE + "'"
|
|
|
- svc.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=" + unitId
|
|
|
- svc.GetEntities(&userlist, where)
|
|
|
+ if supplierCertAppendEntity.InStyle == "2" {
|
|
|
+ status = suppliercert.CENT_AUDIT_STATUS
|
|
|
+ where := "AuditStepCode='" + workflow.PROF_REGULATION + "'"
|
|
|
+ usvc.GetEntity(&setting, where)
|
|
|
+ paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
+ topid := paramSvc.GetBaseparameterMessage("", "paramset", "CENT_AUDIT")
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ status = suppliercert.THIRD_TRIAL_STATUS
|
|
|
+ where := "AuditStepCode='" + workflow.PROF_RECE + "'"
|
|
|
+ svc.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=" + unitId
|
|
|
+ svc.GetEntities(&userlist, where)
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
for _, tmpUser := range userlist {
|
|
|
- userIds += strconv.Itoa(tmpUser.Id) + ","
|
|
|
+ userIds += strconv.Itoa(tmpUser.Id) + "," //strconv.FormatInt(tmpUser.Id, 10) + ","
|
|
|
}
|
|
|
userIds = strings.Trim(userIds, ",")
|
|
|
+ step = 2
|
|
|
+ backstatus = suppliercert.NO_SECOND_TRIAL_STATUS
|
|
|
+ //svc := organize.GetOrganizeService(utils.DBE)
|
|
|
+ //unitId := svc.GetMyUnitDepartmentId(strconv.Itoa(supplierCertAppendEntity.ThirdAudit))
|
|
|
+ //var userlist []userRole.Base_User
|
|
|
+ //var setting auditsetting.Base_OilAuditSetting
|
|
|
+ //usvc := userRole.GetUserService(utils.DBE)
|
|
|
+ //where := "AuditStepCode='" + workflow.PROF_RECE + "'"
|
|
|
+ //svc.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=" + unitId
|
|
|
+ // svc.GetEntities(&userlist, where)
|
|
|
+ //}
|
|
|
+ //
|
|
|
+ //for _, tmpUser := range userlist {
|
|
|
+ // userIds += strconv.Itoa(tmpUser.Id) + ","
|
|
|
+ //}
|
|
|
+ //userIds = strings.Trim(userIds, ",")
|
|
|
} else if supplierCertAppendEntity.Status == suppliercert.THIRD_TRIAL_STATUS {
|
|
|
userIds = utils.ToStr(dataother.Auditer)
|
|
|
status = suppliercert.PROF_AUDIT_STATUS
|
|
|
step = 2
|
|
|
backstatus = suppliercert.NO_THIRD_TRIAL_STATUS
|
|
|
} else if supplierCertAppendEntity.Status == suppliercert.PROF_AUDIT_STATUS {
|
|
|
- status = suppliercert.CENT_AUDIT_STATUS
|
|
|
- step = 2
|
|
|
- backstatus = suppliercert.NO_PROF_AUDIT_STATUS
|
|
|
- //dictSvc := items.GetItemsService(utils.DBE)
|
|
|
- //deptIds := dictSvc.GetKeyValueItems("CENT_AUDIT")
|
|
|
- //var users []userRole.Base_RoleList
|
|
|
- //for _, dept := range deptIds {
|
|
|
- // certSrv.GetAuditUser(dept.Value, workflow.PROF_REGULATION, &users)
|
|
|
- // for _, tmpUser := range users {
|
|
|
- // userIds += strconv.FormatInt(tmpUser.Id, 10) + ","
|
|
|
- // }
|
|
|
- //}
|
|
|
- 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 + "'"
|
|
|
- svc.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
|
|
|
- svc.GetEntities(&userlist, where)
|
|
|
- }
|
|
|
- for _, tmpUser := range userlist {
|
|
|
- userIds += strconv.Itoa(tmpUser.Id) + ","
|
|
|
+ if supplierCertAppendEntity.InStyle == "3" {
|
|
|
+ status = suppliercert.PAYING_AUDIT_STATUS
|
|
|
+ step = 3
|
|
|
+ backstatus = suppliercert.NO_CENT_AUDIT_STATUS
|
|
|
+ } else {
|
|
|
+ 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, ",")
|
|
|
}
|
|
|
- userIds = strings.Trim(userIds, ",")
|
|
|
+ //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 + "'"
|
|
|
+ //svc.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
|
|
|
+ // svc.GetEntities(&userlist, where)
|
|
|
+ //}
|
|
|
+ //for _, tmpUser := range userlist {
|
|
|
+ // userIds += strconv.Itoa(tmpUser.Id) + ","
|
|
|
+ //}
|
|
|
+ //userIds = strings.Trim(userIds, ",")
|
|
|
} else if supplierCertAppendEntity.Status == suppliercert.CENT_AUDIT_STATUS {
|
|
|
userIds = utils.ToStr(dataother.Auditer)
|
|
|
status = suppliercert.PAYING_AUDIT_STATUS
|