|
|
@@ -4,6 +4,7 @@ import (
|
|
|
"dashoo.cn/backend/api/business/audithistory"
|
|
|
"dashoo.cn/backend/api/business/codecsequence"
|
|
|
msg2 "dashoo.cn/backend/api/business/msg"
|
|
|
+ "dashoo.cn/backend/api/business/oilsupplier/oilactivity"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/oilcostmanage"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/supplier"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
|
|
|
@@ -497,6 +498,23 @@ func (this *OilSupplierCertController) UpdateStorage() {
|
|
|
}
|
|
|
err = svc.UpdateEntityBytbl(OilSupplierCertName, id, &model, cols)
|
|
|
} else {
|
|
|
+
|
|
|
+ var activity oilactivity.OilActivity
|
|
|
+ where := "EntityId=" + id + " and ActType='" + oilactivity.STORAGE + "'"
|
|
|
+ svc.GetEntity(&activity, where)
|
|
|
+
|
|
|
+ svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
+ var ActiComplete workflow.ActiCompleteVM
|
|
|
+ ActiComplete.ProcessKey = activity.ProcessKey
|
|
|
+ ActiComplete.BusinessKey = activity.BusinessKey
|
|
|
+ ActiComplete.UserId = this.User.Id
|
|
|
+ ActiComplete.Remarks =""
|
|
|
+ ActiComplete.Result = "1"
|
|
|
+
|
|
|
+ receiveVal := svcActiviti.TaskComplete(ActiComplete)
|
|
|
+
|
|
|
+ fmt.Println(receiveVal)
|
|
|
+
|
|
|
model.Status = suppliercert.STORE_STATUS
|
|
|
model.Step = 7
|
|
|
model.StorageOn = time.Now()
|
|
|
@@ -934,6 +952,59 @@ func (this *OilSupplierCertController) AuditEntityFir() {
|
|
|
usvc.GetEntities(&userlist, where)
|
|
|
}
|
|
|
} else if supplierCertEntity.InStyle == "2" || supplierCertEntity.InStyle == "4" || supplierCertEntity.InStyle == "6" {
|
|
|
+
|
|
|
+ svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
+ businessKey := strconv.Itoa(supplierCertEntity.Id)
|
|
|
+ result := "1"
|
|
|
+
|
|
|
+
|
|
|
+ userIds := ""
|
|
|
+ var userlist []userRole.Base_User
|
|
|
+ var setting auditsetting.Base_OilAuditSetting
|
|
|
+ usvc := userRole.GetUserService(utils.DBE)
|
|
|
+ where := "AuditStepCode='" + workflow.PROF_REGULATION + "'"
|
|
|
+ certSrv.GetEntity(&setting, where)
|
|
|
+ ids := usvc.GetUserIdsByRoleId(strconv.Itoa(setting.RoleId))
|
|
|
+ tempstr := strings.Join(ids, ",")
|
|
|
+ uids := strings.Replace(tempstr, "uid_", "", -1)
|
|
|
+ uids = strings.Trim(uids, ",")
|
|
|
+ paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
+ topid := paramSvc.GetBaseparameterMessage("", "paramset", "CENT_AUDIT")
|
|
|
+ if uids != "" {
|
|
|
+ where := "Id in (" + uids + ")" + " and UnitId=" + topid
|
|
|
+ paramSvc.GetEntities(&userlist, where)
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, tmpUser := range userlist {
|
|
|
+ userIds += strconv.Itoa(tmpUser.Id) + "," //strconv.FormatInt(tmpUser.Id, 10) + ","
|
|
|
+ }
|
|
|
+ userIds = strings.Trim(userIds, ",")
|
|
|
+
|
|
|
+ processInstanceId := svcActiviti.StartProcess2(workflow.OIL_SUPPLIER_INSTORE, businessKey, userIds, result, supplierCertEntity.SupplierTypeCode, supplierEntity.SupplierName)
|
|
|
+
|
|
|
+ //var ActiComplete workflow.ActiCompleteVM
|
|
|
+ //ActiComplete.ProcessKey = workflow.OIL_SUPPLIER_INSTORE
|
|
|
+ //ActiComplete.BusinessKey = businessKey
|
|
|
+ //ActiComplete.UserNames = userIds
|
|
|
+ //ActiComplete.UserId = this.User.Id
|
|
|
+ //ActiComplete.Result = "1"
|
|
|
+ //ActiComplete.Remarks = ""
|
|
|
+ //ActiComplete.CallbackUrl = ""
|
|
|
+ //
|
|
|
+ //res := svcActiviti.TaskComplete(ActiComplete)
|
|
|
+ //fmt.Println(res)
|
|
|
+
|
|
|
+ var activity oilactivity.OilActivity
|
|
|
+ activity.EntityId = supplierCertEntity.Id
|
|
|
+ activity.ActType = oilactivity.STORAGE
|
|
|
+ activity.WorkflowId = processInstanceId
|
|
|
+ activity.BusinessKey = businessKey
|
|
|
+ activity.ProcessKey = workflow.OIL_SUPPLIER_INSTORE
|
|
|
+ activity.CreateOn = time.Now()
|
|
|
+
|
|
|
+ certSrv.InsertEntityBytbl(OilActivityName, &activity)
|
|
|
+
|
|
|
+
|
|
|
status = suppliercert.STOREING_STATUS
|
|
|
step = 3
|
|
|
} else {
|
|
|
@@ -1047,8 +1118,62 @@ func (this *OilSupplierCertController) AuditEntityFir() {
|
|
|
var sup []suppliercertsub.OilSupplierCertSub
|
|
|
total := paysvc.GetPagingEntitiesWithOrder(1,10,"Id",true,&sup,wheresup)
|
|
|
|
|
|
- if supplierCertEntity.SupplierTypeCode == "01" && total <= 50 {
|
|
|
- status = suppliercert.STOREING_STATUS
|
|
|
+ if supplierCertEntity.SupplierTypeCode == "01" && total <= 50{
|
|
|
+ status = suppliercert.STOREING_STATUS
|
|
|
+
|
|
|
+
|
|
|
+ svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
+ businessKey := strconv.Itoa(supplierCertEntity.Id)
|
|
|
+ result := "1"
|
|
|
+
|
|
|
+ userIds := ""
|
|
|
+ var userlist []userRole.Base_User
|
|
|
+ var setting auditsetting.Base_OilAuditSetting
|
|
|
+ usvc := userRole.GetUserService(utils.DBE)
|
|
|
+ where := "AuditStepCode='" + workflow.PROF_REGULATION + "'"
|
|
|
+ paysvc.GetEntity(&setting, where)
|
|
|
+ ids := usvc.GetUserIdsByRoleId(strconv.Itoa(setting.RoleId))
|
|
|
+ tempstr := strings.Join(ids, ",")
|
|
|
+ uids := strings.Replace(tempstr, "uid_", "", -1)
|
|
|
+ uids = strings.Trim(uids, ",")
|
|
|
+ paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
+ topid := paramSvc.GetBaseparameterMessage("", "paramset", "CENT_AUDIT")
|
|
|
+ if uids != "" {
|
|
|
+ where := "Id in (" + uids + ")" + " and UnitId=" + topid
|
|
|
+ paramSvc.GetEntities(&userlist, where)
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, tmpUser := range userlist {
|
|
|
+ userIds += strconv.Itoa(tmpUser.Id) + "," //strconv.FormatInt(tmpUser.Id, 10) + ","
|
|
|
+ }
|
|
|
+ userIds = strings.Trim(userIds, ",")
|
|
|
+
|
|
|
+ processInstanceId := svcActiviti.StartProcess2(workflow.OIL_SUPPLIER_INSTORE, businessKey, userIds, result, supplierCertEntity.SupplierTypeCode, supplierEntity.SupplierName)
|
|
|
+
|
|
|
+ //var ActiComplete workflow.ActiCompleteVM
|
|
|
+ //ActiComplete.ProcessKey = workflow.OIL_SUPPLIER_INSTORE
|
|
|
+ //ActiComplete.BusinessKey = businessKey
|
|
|
+ //ActiComplete.UserNames = userIds
|
|
|
+ //ActiComplete.UserId = this.User.Id
|
|
|
+ //ActiComplete.Result = "1"
|
|
|
+ //ActiComplete.Remarks = ""
|
|
|
+ //ActiComplete.CallbackUrl = ""
|
|
|
+ //
|
|
|
+ //res := svcActiviti.TaskComplete(ActiComplete)
|
|
|
+ //fmt.Println(res)
|
|
|
+
|
|
|
+ var activity oilactivity.OilActivity
|
|
|
+ activity.EntityId = supplierCertEntity.Id
|
|
|
+ activity.ActType = oilactivity.STORAGE
|
|
|
+ activity.WorkflowId = processInstanceId
|
|
|
+ activity.BusinessKey = businessKey
|
|
|
+ activity.ProcessKey = workflow.OIL_SUPPLIER_INSTORE
|
|
|
+ activity.CreateOn = time.Now()
|
|
|
+
|
|
|
+ paysvc.InsertEntityBytbl(OilActivityName, &activity)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
} else {
|
|
|
paysvc.InsertEntity(&payinfo)
|
|
|
//发短信
|
|
|
@@ -1067,6 +1192,58 @@ func (this *OilSupplierCertController) AuditEntityFir() {
|
|
|
}
|
|
|
certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
} else {
|
|
|
+
|
|
|
+ svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
+ businessKey := strconv.Itoa(supplierCertEntity.Id)
|
|
|
+ result := "1"
|
|
|
+
|
|
|
+ userIds := ""
|
|
|
+ var userlist []userRole.Base_User
|
|
|
+ var setting auditsetting.Base_OilAuditSetting
|
|
|
+ usvc := userRole.GetUserService(utils.DBE)
|
|
|
+ where := "AuditStepCode='" + workflow.PROF_REGULATION + "'"
|
|
|
+ certSrv.GetEntity(&setting, where)
|
|
|
+ ids := usvc.GetUserIdsByRoleId(strconv.Itoa(setting.RoleId))
|
|
|
+ tempstr := strings.Join(ids, ",")
|
|
|
+ uids := strings.Replace(tempstr, "uid_", "", -1)
|
|
|
+ uids = strings.Trim(uids, ",")
|
|
|
+ paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
+ topid := paramSvc.GetBaseparameterMessage("", "paramset", "CENT_AUDIT")
|
|
|
+ if uids != "" {
|
|
|
+ where := "Id in (" + uids + ")" + " and UnitId=" + topid
|
|
|
+ paramSvc.GetEntities(&userlist, where)
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, tmpUser := range userlist {
|
|
|
+ userIds += strconv.Itoa(tmpUser.Id) + "," //strconv.FormatInt(tmpUser.Id, 10) + ","
|
|
|
+ }
|
|
|
+ userIds = strings.Trim(userIds, ",")
|
|
|
+ processInstanceId := svcActiviti.StartProcess2(workflow.OIL_SUPPLIER_INSTORE, businessKey, userIds, result, supplierCertEntity.SupplierTypeCode, supplierEntity.SupplierName)
|
|
|
+
|
|
|
+ //var ActiComplete workflow.ActiCompleteVM
|
|
|
+ //ActiComplete.ProcessKey = workflow.OIL_SUPPLIER_INSTORE
|
|
|
+ //ActiComplete.BusinessKey = businessKey
|
|
|
+ //ActiComplete.UserNames = userIds
|
|
|
+ //ActiComplete.UserId = this.User.Id
|
|
|
+ //ActiComplete.Result = "1"
|
|
|
+ //ActiComplete.Remarks = ""
|
|
|
+ //ActiComplete.CallbackUrl = ""
|
|
|
+ //
|
|
|
+ //res := svcActiviti.TaskComplete(ActiComplete)
|
|
|
+ //fmt.Println(res)
|
|
|
+
|
|
|
+ var activity oilactivity.OilActivity
|
|
|
+ activity.EntityId = supplierCertEntity.Id
|
|
|
+ activity.ActType = oilactivity.STORAGE
|
|
|
+ activity.WorkflowId = processInstanceId
|
|
|
+ activity.BusinessKey = businessKey
|
|
|
+ activity.ProcessKey = workflow.OIL_SUPPLIER_INSTORE
|
|
|
+ activity.CreateOn = time.Now()
|
|
|
+
|
|
|
+ certSrv.InsertEntityBytbl(OilActivityName, &activity)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
supplierCertEntity.Status = suppliercert.STOREING_STATUS
|
|
|
supplierCertEntity.Step = step
|
|
|
cols := []string{
|
|
|
@@ -1077,7 +1254,58 @@ func (this *OilSupplierCertController) AuditEntityFir() {
|
|
|
}
|
|
|
} else if supplierCertEntity.Status == suppliercert.PROF_AUDIT_STATUS && supplierCertEntity.InStyle == "3" {
|
|
|
//if supplierCertEntity.InStyle == "3" {
|
|
|
- supplierCertEntity.Status = suppliercert.STOREING_STATUS
|
|
|
+
|
|
|
+ svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
+ businessKey := strconv.Itoa(supplierCertEntity.Id)
|
|
|
+ result := "1"
|
|
|
+
|
|
|
+ userIds := ""
|
|
|
+ var userlist []userRole.Base_User
|
|
|
+ var setting auditsetting.Base_OilAuditSetting
|
|
|
+ usvc := userRole.GetUserService(utils.DBE)
|
|
|
+ where := "AuditStepCode='" + workflow.PROF_REGULATION + "'"
|
|
|
+ certSrv.GetEntity(&setting, where)
|
|
|
+ ids := usvc.GetUserIdsByRoleId(strconv.Itoa(setting.RoleId))
|
|
|
+ tempstr := strings.Join(ids, ",")
|
|
|
+ uids := strings.Replace(tempstr, "uid_", "", -1)
|
|
|
+ uids = strings.Trim(uids, ",")
|
|
|
+ paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
+ topid := paramSvc.GetBaseparameterMessage("", "paramset", "CENT_AUDIT")
|
|
|
+ if uids != "" {
|
|
|
+ where := "Id in (" + uids + ")" + " and UnitId=" + topid
|
|
|
+ paramSvc.GetEntities(&userlist, where)
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, tmpUser := range userlist {
|
|
|
+ userIds += strconv.Itoa(tmpUser.Id) + "," //strconv.FormatInt(tmpUser.Id, 10) + ","
|
|
|
+ }
|
|
|
+ userIds = strings.Trim(userIds, ",")
|
|
|
+ processInstanceId := svcActiviti.StartProcess2(workflow.OIL_SUPPLIER_INSTORE, businessKey, userIds, result, supplierCertEntity.SupplierTypeCode, supplierEntity.SupplierName)
|
|
|
+
|
|
|
+ //var ActiComplete workflow.ActiCompleteVM
|
|
|
+ //ActiComplete.ProcessKey = workflow.OIL_SUPPLIER_INSTORE
|
|
|
+ //ActiComplete.BusinessKey = businessKey
|
|
|
+ //ActiComplete.UserNames = userIds
|
|
|
+ //ActiComplete.UserId = this.User.Id
|
|
|
+ //ActiComplete.Result = "1"
|
|
|
+ //ActiComplete.Remarks = ""
|
|
|
+ //ActiComplete.CallbackUrl = ""
|
|
|
+ //
|
|
|
+ //res := svcActiviti.TaskComplete(ActiComplete)
|
|
|
+ //fmt.Println(res)
|
|
|
+
|
|
|
+ var activity oilactivity.OilActivity
|
|
|
+ activity.EntityId = supplierCertEntity.Id
|
|
|
+ activity.ActType = oilactivity.STORAGE
|
|
|
+ activity.WorkflowId = processInstanceId
|
|
|
+ activity.BusinessKey = businessKey
|
|
|
+ activity.ProcessKey = workflow.OIL_SUPPLIER_INSTORE
|
|
|
+ activity.CreateOn = time.Now()
|
|
|
+
|
|
|
+ certSrv.InsertEntityBytbl(OilActivityName, &activity)
|
|
|
+
|
|
|
+
|
|
|
+ supplierCertEntity.Status = suppliercert.STOREING_STATUS
|
|
|
supplierCertEntity.Step = 3
|
|
|
cols := []string{
|
|
|
"Status",
|