|
|
@@ -4,7 +4,9 @@ import (
|
|
|
"dashoo.cn/backend/api/business/audithistory"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
|
|
|
"dashoo.cn/business2/userRole"
|
|
|
+ "dashoo.cn/business2/items"
|
|
|
"encoding/json"
|
|
|
+ "fmt"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
@@ -396,7 +398,20 @@ func (this *OilSupplierCertAppendController) GetMyTaskEntityList() {
|
|
|
|
|
|
//找出待办任务
|
|
|
actisvc := workflow.GetActivitiService(utils.DBE)
|
|
|
- appendIdList := actisvc.GetMyTasks(workflow.OIL_APPEND_APPLY, this.User.Id)
|
|
|
+ var appendIdList string
|
|
|
+ if actisvc.GetMyTasks(workflow.OIL_APPEND_APPLY, this.User.Id) != "" {
|
|
|
+ appendIdList = actisvc.GetMyTasks(workflow.OIL_APPEND_APPLY, this.User.Id)
|
|
|
+ appendIdList = appendIdList + ","
|
|
|
+ }
|
|
|
+ if actisvc.GetMyTasks(workflow.OIL_FIRST_APPEND_APPLY, this.User.Id) != "" {
|
|
|
+ appendIdList = fmt.Sprintf("%s %s", appendIdList, actisvc.GetMyTasks(workflow.OIL_FIRST_APPEND_APPLY, this.User.Id))
|
|
|
+ appendIdList = appendIdList + ","
|
|
|
+ }
|
|
|
+ if actisvc.GetMyTasks(workflow.OIL_SECOND_APPEND_APPLY, this.User.Id) != "" {
|
|
|
+ appendIdList = fmt.Sprintf("%s %s", appendIdList, actisvc.GetMyTasks(workflow.OIL_SECOND_APPEND_APPLY, this.User.Id))
|
|
|
+ appendIdList = appendIdList + ","
|
|
|
+ }
|
|
|
+ appendIdList = strings.Trim(appendIdList, ",")
|
|
|
appendIdarr := strings.Split(appendIdList, ",")
|
|
|
for i, item := range appendIdarr {
|
|
|
idx := strings.Index(item,"-")
|
|
|
@@ -430,6 +445,8 @@ func (this *OilSupplierCertAppendController) GetMyTaskEntityList() {
|
|
|
func (this *OilSupplierCertAppendController) AuditEntity() {
|
|
|
certappendId := this.Ctx.Input.Param(":id")
|
|
|
firstAudit := this.GetString("FirstAuditName")
|
|
|
+ SecondAudit := this.GetString("SecondAudit")
|
|
|
+ ThirdAudit := this.GetString("ThirdAudit")
|
|
|
AuditRemark := this.GetString("AuditRemark")
|
|
|
|
|
|
//取出审批列表
|
|
|
@@ -526,6 +543,8 @@ func (this *OilSupplierCertAppendController) AuditEntity() {
|
|
|
model.WorkFlowId = processInstanceId
|
|
|
model.Status = suppliercert.FIRST_TRIAL_STATUS //二级单位初审
|
|
|
model.FirstAudit, _ = strconv.Atoi(firstAudit)
|
|
|
+ model.SecondAudit, _ = strconv.Atoi(SecondAudit)
|
|
|
+ model.ThirdAudit, _ = strconv.Atoi(ThirdAudit)
|
|
|
model.AuditIndex = supplierCertAppendEntity.AuditIndex
|
|
|
model.BusinessKey = businessKey
|
|
|
cols := []string{
|
|
|
@@ -533,6 +552,8 @@ func (this *OilSupplierCertAppendController) AuditEntity() {
|
|
|
"WorkFlowId",
|
|
|
"Status",
|
|
|
"FirstAudit",
|
|
|
+ "SecondAudit",
|
|
|
+ "ThirdAudit",
|
|
|
"AuditIndex",
|
|
|
"BusinessKey",
|
|
|
}
|
|
|
@@ -547,9 +568,10 @@ func (this *OilSupplierCertAppendController) AuditEntity() {
|
|
|
func (this *OilSupplierCertAppendController) AuditEntityFir() {
|
|
|
appendId := this.Ctx.Input.Param(":id")
|
|
|
//取出审批列表
|
|
|
- certSrv := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
|
|
|
+ certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
+ svc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
|
|
|
var supplierCertAppendEntity suppliercertappend.OilSupplierCertAppend
|
|
|
- certSrv.GetEntityById(appendId, &supplierCertAppendEntity)
|
|
|
+ svc.GetEntityById(appendId, &supplierCertAppendEntity)
|
|
|
|
|
|
var jsonblob = this.Ctx.Input.RequestBody
|
|
|
var dataother AppShenHeModel
|
|
|
@@ -576,26 +598,18 @@ func (this *OilSupplierCertAppendController) AuditEntityFir() {
|
|
|
var userIds string
|
|
|
if supplierCertAppendEntity.InStyle == "2" {
|
|
|
if supplierCertAppendEntity.Status == suppliercert.SECOND_TRIAL_STATUS{
|
|
|
- supplierCertAppendEntity.Status = "4"
|
|
|
+ supplierCertAppendEntity.Status = suppliercert.PROF_AUDIT_STATUS
|
|
|
}
|
|
|
}
|
|
|
- if supplierCertAppendEntity.Status == "1" {
|
|
|
- userIds = utils.ToStr(dataother.Auditer)
|
|
|
+ if supplierCertAppendEntity.Status == suppliercert.FIRST_TRIAL_STATUS {
|
|
|
+ userIds = utils.ToStr(supplierCertAppendEntity.SecondAudit)
|
|
|
status = suppliercert.SECOND_TRIAL_STATUS
|
|
|
step = 2
|
|
|
- backstatus = "-1"
|
|
|
- supplierCertAppendEntity.ThirdAudit = dataother.MajorDept
|
|
|
- cols := []string{
|
|
|
- "ThirdAudit",
|
|
|
- }
|
|
|
- certSrv.UpdateEntityByIdCols(appendId, supplierCertAppendEntity, cols)
|
|
|
- } else if supplierCertAppendEntity.Status == "2" {
|
|
|
+ backstatus = suppliercert.NOPASS_STATUS
|
|
|
+ } else if supplierCertAppendEntity.Status == suppliercert.SECOND_TRIAL_STATUS {
|
|
|
status = suppliercert.THIRD_TRIAL_STATUS
|
|
|
step = 2
|
|
|
- backstatus = "-2"
|
|
|
- //var users []suppliercert.UserList
|
|
|
- //where := "OrganizeId=" + strconv.Itoa(supplierCertAppendEntity.ThirdAudit) + " and AuditStepCode='" + workflow.PROF_RECE + "'"
|
|
|
- //certSrv.GetEntitysByWhere(OilAuditSettingName, where, &users)
|
|
|
+ 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)
|
|
|
@@ -603,31 +617,31 @@ func (this *OilSupplierCertAppendController) AuditEntityFir() {
|
|
|
userIds += strconv.FormatInt(tmpUser.Id, 10) + ","
|
|
|
}
|
|
|
userIds = strings.Trim(userIds, ",")
|
|
|
- } else if supplierCertAppendEntity.Status == "3" {
|
|
|
+ } else if supplierCertAppendEntity.Status == suppliercert.THIRD_TRIAL_STATUS {
|
|
|
userIds = utils.ToStr(dataother.Auditer)
|
|
|
status = suppliercert.PROF_AUDIT_STATUS
|
|
|
step = 2
|
|
|
- backstatus = "-3"
|
|
|
- } else if supplierCertAppendEntity.Status == "4" {
|
|
|
+ backstatus = suppliercert.NO_THIRD_TRIAL_STATUS
|
|
|
+ } else if supplierCertAppendEntity.Status == suppliercert.PROF_AUDIT_STATUS {
|
|
|
status = suppliercert.CENT_AUDIT_STATUS
|
|
|
step = 2
|
|
|
- backstatus = "-4"
|
|
|
- //var users []suppliercert.UserList
|
|
|
- //where := "OrganizeId=100000178 and AuditStepCode='" + workflow.PROF_REGULATION + "'"
|
|
|
- //certSrv.GetEntitysByWhere(OilAuditSettingName, where, &users)
|
|
|
- supsvc := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
+ backstatus = suppliercert.NO_PROF_AUDIT_STATUS
|
|
|
+ dictSvc := items.GetItemsService(utils.DBE)
|
|
|
+ deptIds := dictSvc.GetKeyValueItems("CENT_AUDIT")
|
|
|
var users []userRole.Base_RoleList
|
|
|
- supsvc.GetAuditUser("100000178", workflow.PROF_REGULATION, &users)
|
|
|
-
|
|
|
- for _, tmpUser := range users {
|
|
|
- userIds += strconv.FormatInt(tmpUser.Id, 10) + ","
|
|
|
+ for _, dept := range deptIds {
|
|
|
+ certSrv.GetAuditUser(dept.Value, workflow.PROF_REGULATION, &users)
|
|
|
+ for _, tmpUser := range users {
|
|
|
+ userIds += strconv.FormatInt(tmpUser.Id, 10) + ","
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
userIds = strings.Trim(userIds, ",")
|
|
|
- } else if supplierCertAppendEntity.Status == "5" {
|
|
|
+ } else if supplierCertAppendEntity.Status == suppliercert.CENT_AUDIT_STATUS {
|
|
|
userIds = utils.ToStr(dataother.Auditer)
|
|
|
status = suppliercert.PAYING_AUDIT_STATUS
|
|
|
step = 3
|
|
|
- backstatus = "-5"
|
|
|
+ backstatus = suppliercert.NO_CENT_AUDIT_STATUS
|
|
|
}
|
|
|
|
|
|
svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
@@ -656,7 +670,7 @@ func (this *OilSupplierCertAppendController) AuditEntityFir() {
|
|
|
"Status",
|
|
|
"Step",
|
|
|
}
|
|
|
- certSrv.UpdateEntityByIdCols(appendId, supplierCertAppendEntity, cols)
|
|
|
+ svc.UpdateEntityByIdCols(appendId, supplierCertAppendEntity, cols)
|
|
|
if supplierCertAppendEntity.Status == "5" {
|
|
|
if supplierCertAppendEntity.InStyle == "1" {
|
|
|
paysvc := paymentinfo.GetPaymentService(utils.DBE)
|
|
|
@@ -701,7 +715,7 @@ func (this *OilSupplierCertAppendController) AuditEntityFir() {
|
|
|
"Step",
|
|
|
"AuditIndex",
|
|
|
}
|
|
|
- _,err := certSrv.UpdateEntityByIdCols(appendId, supplierCertAppendEntity, cols)
|
|
|
+ _,err := svc.UpdateEntityByIdCols(appendId, supplierCertAppendEntity, cols)
|
|
|
if err == nil {
|
|
|
errinfo.Message = "提交成功!"
|
|
|
errinfo.Code = 0
|