|
@@ -6,7 +6,6 @@ import (
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/annualaudit"
|
|
"dashoo.cn/backend/api/business/oilsupplier/annualaudit"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/infochange"
|
|
"dashoo.cn/backend/api/business/oilsupplier/infochange"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/oilactivity"
|
|
"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/supplier"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/supplierapplytime"
|
|
"dashoo.cn/backend/api/business/oilsupplier/supplierapplytime"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercertappend"
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercertappend"
|
|
@@ -14,7 +13,6 @@ import (
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
|
|
"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
|
|
|
"dashoo.cn/backend/api/business/organize"
|
|
"dashoo.cn/backend/api/business/organize"
|
|
|
"dashoo.cn/backend/api/business/paymentinfo"
|
|
"dashoo.cn/backend/api/business/paymentinfo"
|
|
|
- "dashoo.cn/business2/parameter"
|
|
|
|
|
"encoding/json"
|
|
"encoding/json"
|
|
|
"fmt"
|
|
"fmt"
|
|
|
"strconv"
|
|
"strconv"
|
|
@@ -602,13 +600,14 @@ func (this *OilSupplierCertController) DeleteEntity() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// @Title 提交审批
|
|
|
|
|
-// @Description 提交审批
|
|
|
|
|
|
|
+// @Title 企业用户提交按钮 --启动工作流
|
|
|
|
|
+// @Description 企业用户提交按钮
|
|
|
// @Success 200 {object} controllers.Request
|
|
// @Success 200 {object} controllers.Request
|
|
|
// @router /first-audit/:id [post]
|
|
// @router /first-audit/:id [post]
|
|
|
-func (this *OilSupplierCertController) AuditEntity() {
|
|
|
|
|
|
|
+func (this *OilSupplierCertController) CompanyAuditEntity() {
|
|
|
certId := this.Ctx.Input.Param(":id")
|
|
certId := this.Ctx.Input.Param(":id")
|
|
|
unitId := this.GetString("UnitId")
|
|
unitId := this.GetString("UnitId")
|
|
|
|
|
+ // typeCode := this.GetString("TypeCode")
|
|
|
AuditRemark := this.GetString("AuditRemark")
|
|
AuditRemark := this.GetString("AuditRemark")
|
|
|
var errinfo ErrorDataInfo
|
|
var errinfo ErrorDataInfo
|
|
|
defer func() { //finally处理失败的异常
|
|
defer func() { //finally处理失败的异常
|
|
@@ -626,15 +625,20 @@ func (this *OilSupplierCertController) AuditEntity() {
|
|
|
}
|
|
}
|
|
|
}()
|
|
}()
|
|
|
|
|
|
|
|
- //取出审批列表
|
|
|
|
|
|
|
+ if this.User.IsCompanyUser == 1 {
|
|
|
|
|
+ panic("非企业用户,请用分办功能提交!")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //取出准入申请表
|
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
|
certSrv.GetEntityById(certId, &supplierCertEntity)
|
|
certSrv.GetEntityById(certId, &supplierCertEntity)
|
|
|
|
|
+
|
|
|
//取出企业主表
|
|
//取出企业主表
|
|
|
supplierSvc := supplier.GetOilSupplierService(utils.DBE)
|
|
supplierSvc := supplier.GetOilSupplierService(utils.DBE)
|
|
|
var supplierEntity supplier.OilSupplier
|
|
var supplierEntity supplier.OilSupplier
|
|
|
supplierSvc.GetEntityById(supplierCertEntity.SupplierId, &supplierEntity)
|
|
supplierSvc.GetEntityById(supplierCertEntity.SupplierId, &supplierEntity)
|
|
|
- result := strconv.Itoa(this.User.IsCompanyUser)
|
|
|
|
|
|
|
+
|
|
|
status, _ := strconv.Atoi(supplierCertEntity.Status)
|
|
status, _ := strconv.Atoi(supplierCertEntity.Status)
|
|
|
if status > 0 {
|
|
if status > 0 {
|
|
|
panic("工作流已经启动,请刷新重试!")
|
|
panic("工作流已经启动,请刷新重试!")
|
|
@@ -643,64 +647,60 @@ func (this *OilSupplierCertController) AuditEntity() {
|
|
|
svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
//启动工作流
|
|
//启动工作流
|
|
|
businessKey := certId + "-" + strconv.Itoa(supplierCertEntity.AuditIndex)
|
|
businessKey := certId + "-" + strconv.Itoa(supplierCertEntity.AuditIndex)
|
|
|
- processInstanceId := svcActiviti.StartProcess2(workflow.OIL_ENUSER_SUPPLIER_APPLY, businessKey, this.User.Id, result, supplierCertEntity.SupplierTypeCode, supplierEntity.SupplierName)
|
|
|
|
|
- //同时完成此步骤
|
|
|
|
|
- var ActiComplete workflow.ActiCompleteVM
|
|
|
|
|
- ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
|
|
|
|
|
- ActiComplete.BusinessKey = businessKey
|
|
|
|
|
- // ActiComplete.UserNames =
|
|
|
|
|
- ActiComplete.UserId = this.User.Id
|
|
|
|
|
- ActiComplete.Result = result
|
|
|
|
|
- ActiComplete.Remarks = AuditRemark
|
|
|
|
|
- ActiComplete.CallbackUrl = ""
|
|
|
|
|
- receiveVal := svcActiviti.TaskComplete(ActiComplete)
|
|
|
|
|
- if receiveVal != "true" {
|
|
|
|
|
- panic("工作流异常,请联系管理员!")
|
|
|
|
|
|
|
+ processInstanceId := svcActiviti.StartProcess2(workflow.OIL_ENUSER_SUPPLIER_APPLY, businessKey, this.User.Id, "1", supplierCertEntity.SupplierTypeCode, supplierEntity.SupplierName)
|
|
|
|
|
+ if len(processInstanceId) <= 0 {
|
|
|
|
|
+ panic("工作流启动失败!")
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- //记下workflowID(首次提交时才会记录,中间状态请忽略) 及审批状态
|
|
|
|
|
- supplierCertEntity.WorkflowId = processInstanceId
|
|
|
|
|
- if this.User.IsCompanyUser == 1 {
|
|
|
|
|
- supplierCertEntity.Status = suppliercert.FEN_TRIAL_STATUS //分办
|
|
|
|
|
- } else if this.User.IsCompanyUser == 0 {
|
|
|
|
|
- supplierCertEntity.Status = suppliercert.FIRST_TRIAL_STATUS //二级单位初审
|
|
|
|
|
- }
|
|
|
|
|
- supplierCertEntity.Step = 1
|
|
|
|
|
- supplierCertEntity.FirstAudit, _ = strconv.Atoi(this.User.Id)
|
|
|
|
|
- supplierCertEntity.AuditIndex = supplierCertEntity.AuditIndex + 1
|
|
|
|
|
- supplierCertEntity.BusinessKey = ActiComplete.BusinessKey
|
|
|
|
|
- supplierCertEntity.ProcessKey = ActiComplete.ProcessKey
|
|
|
|
|
- supplierCertEntity.CommitComId = unitId
|
|
|
|
|
|
|
+ // 将启动和工作流,选择的初审和复审人员保存下来
|
|
|
cols := []string{
|
|
cols := []string{
|
|
|
"Id",
|
|
"Id",
|
|
|
"WorkflowId",
|
|
"WorkflowId",
|
|
|
- "Status",
|
|
|
|
|
- "Step",
|
|
|
|
|
- "FirstAudit",
|
|
|
|
|
- "AuditIndex",
|
|
|
|
|
"BusinessKey",
|
|
"BusinessKey",
|
|
|
"ProcessKey",
|
|
"ProcessKey",
|
|
|
"CommitComId",
|
|
"CommitComId",
|
|
|
|
|
+ "AuditIndex",
|
|
|
}
|
|
}
|
|
|
|
|
+ supplierCertEntity.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
|
|
|
|
|
+ supplierCertEntity.BusinessKey = businessKey
|
|
|
|
|
+ supplierCertEntity.WorkflowId = processInstanceId
|
|
|
|
|
+ supplierCertEntity.CommitComId = unitId
|
|
|
|
|
+ supplierCertEntity.AuditIndex += 1
|
|
|
certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
|
|
+
|
|
|
|
|
+ var ActiComplete workflow.ActiCompleteVM
|
|
|
|
|
+ ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
|
|
|
|
|
+ ActiComplete.BusinessKey = businessKey
|
|
|
|
|
+ ActiComplete.UserId = this.User.Id
|
|
|
|
|
+ ActiComplete.Result = "1" //提交给二级单位分办
|
|
|
|
|
+ ActiComplete.Remarks = AuditRemark
|
|
|
|
|
+ ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
|
|
|
|
|
+ //取出下一步的审批人
|
|
|
|
|
+ /** stepCode := workflow.GetWorkFlowStepCode(typeCode)
|
|
|
|
|
+ auditSettingService := auditsetting.GetOilAuditSettingService(utils.DBE)
|
|
|
|
|
+ approverIds := auditSettingService.GetApproverIdsByStepCodeAndUnitId(stepCode, unitId)
|
|
|
|
|
+ ActiComplete.UserNames = approverIds */
|
|
|
|
|
+ receiveVal := svcActiviti.TaskComplete(ActiComplete)
|
|
|
|
|
+ if receiveVal != "true" {
|
|
|
|
|
+ panic("工作流异常,请联系管理员!" + receiveVal)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// @Title 分办审批
|
|
|
|
|
-// @Description 分办审批
|
|
|
|
|
|
|
+// @Title 二级单位提交审批 --启动工作流
|
|
|
|
|
+// @Description 二级单位提交审批
|
|
|
// @Success 200 {object} controllers.Request
|
|
// @Success 200 {object} controllers.Request
|
|
|
-// @router /audit/:id [post]
|
|
|
|
|
-func (this *OilSupplierCertController) SeparateAuditEntity() {
|
|
|
|
|
|
|
+// @router /unit-audit/:id [post]
|
|
|
|
|
+func (this *OilSupplierCertController) UnitAuditEntity() {
|
|
|
certId := this.Ctx.Input.Param(":id")
|
|
certId := this.Ctx.Input.Param(":id")
|
|
|
- firstAudit := this.GetString("FirstAuditName")
|
|
|
|
|
- AuditRemark := this.GetString("AuditRemark")
|
|
|
|
|
|
|
+ firstAudit := this.GetString("FirstAudit")
|
|
|
secondAudit := this.GetString("SecondAudit")
|
|
secondAudit := this.GetString("SecondAudit")
|
|
|
- thirdAudit := this.GetString("ThirdAudit")
|
|
|
|
|
- typeCode := this.GetString("TypeCode")
|
|
|
|
|
|
|
+ unitId := this.GetString("UnitId")
|
|
|
|
|
+ // typeCode := this.GetString("TypeCode")
|
|
|
|
|
+ AuditRemark := this.GetString("AuditRemark")
|
|
|
|
|
|
|
|
var errinfo ErrorDataInfo
|
|
var errinfo ErrorDataInfo
|
|
|
defer func() { //finally处理失败的异常
|
|
defer func() { //finally处理失败的异常
|
|
|
if err := recover(); err != nil {
|
|
if err := recover(); err != nil {
|
|
|
- errinfo.Message = "提交失败," + err.(string)
|
|
|
|
|
|
|
+ errinfo.Message = err.(string)
|
|
|
errinfo.Code = -1
|
|
errinfo.Code = -1
|
|
|
this.Data["json"] = &errinfo
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
@@ -713,35 +713,7 @@ func (this *OilSupplierCertController) SeparateAuditEntity() {
|
|
|
}
|
|
}
|
|
|
}()
|
|
}()
|
|
|
|
|
|
|
|
- var setting auditsetting.Base_OilAuditSetting
|
|
|
|
|
- var userlist []userRole.Base_User
|
|
|
|
|
- usvc := userRole.GetUserService(utils.DBE)
|
|
|
|
|
- where := ""
|
|
|
|
|
- if this.User.IsCompanyUser == 1 {
|
|
|
|
|
- if typeCode == "01" {
|
|
|
|
|
- where = "AuditStepCode='" + workflow.SUB_OFFICE_WZ + "'"
|
|
|
|
|
- } else if typeCode == "02" {
|
|
|
|
|
- where = "AuditStepCode='" + workflow.SUB_OFFICE_JS + "'"
|
|
|
|
|
-
|
|
|
|
|
- } else if typeCode == "03" {
|
|
|
|
|
- where = "AuditStepCode='" + workflow.SUB_OFFICE_JF + "'"
|
|
|
|
|
- }
|
|
|
|
|
- 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=" + firstAudit
|
|
|
|
|
- usvc.GetEntities(&userlist, where)
|
|
|
|
|
- }
|
|
|
|
|
- userIds := ""
|
|
|
|
|
- for _, tmpUser := range userlist {
|
|
|
|
|
- userIds += strconv.Itoa(tmpUser.Id) + ","
|
|
|
|
|
- }
|
|
|
|
|
- firstAudit = strings.Trim(userIds, ",")
|
|
|
|
|
- }
|
|
|
|
|
- //取出审批列表
|
|
|
|
|
|
|
+ //取出准入表信息
|
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
|
certSrv.GetEntityById(certId, &supplierCertEntity)
|
|
certSrv.GetEntityById(certId, &supplierCertEntity)
|
|
@@ -750,65 +722,60 @@ func (this *OilSupplierCertController) SeparateAuditEntity() {
|
|
|
var supplierEntity supplier.OilSupplier
|
|
var supplierEntity supplier.OilSupplier
|
|
|
supplierSvc.GetEntityById(supplierCertEntity.SupplierId, &supplierEntity)
|
|
supplierSvc.GetEntityById(supplierCertEntity.SupplierId, &supplierEntity)
|
|
|
|
|
|
|
|
|
|
+
|
|
|
svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
- processInstanceId := supplierCertEntity.WorkflowId
|
|
|
|
|
- businessKey := supplierCertEntity.BusinessKey
|
|
|
|
|
- result := "1" //分办默认向前走
|
|
|
|
|
|
|
+ //启动工作流
|
|
|
|
|
+ businessKey := certId + "-" + strconv.Itoa(supplierCertEntity.AuditIndex)
|
|
|
|
|
+ processInstanceId := svcActiviti.StartProcess2(workflow.OIL_ENUSER_SUPPLIER_APPLY, businessKey, this.User.Id, "1", supplierCertEntity.SupplierTypeCode, supplierEntity.SupplierName)
|
|
|
|
|
+ // 将启动和工作流,选择的初审和复审人员保存下来
|
|
|
|
|
+ cols := []string{
|
|
|
|
|
+ "Id",
|
|
|
|
|
+ "FirstAudit",
|
|
|
|
|
+ "SecondAudit",
|
|
|
|
|
+ "WorkflowId",
|
|
|
|
|
+ "BusinessKey",
|
|
|
|
|
+ "ProcessKey",
|
|
|
|
|
+ "CommitComId",
|
|
|
|
|
+ "AuditIndex",
|
|
|
|
|
+ }
|
|
|
|
|
+ supplierCertEntity.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
|
|
|
|
|
+ supplierCertEntity.BusinessKey = businessKey
|
|
|
|
|
+ supplierCertEntity.WorkflowId = processInstanceId
|
|
|
|
|
+ supplierCertEntity.FirstAudit, _ = strconv.Atoi(firstAudit)
|
|
|
|
|
+ supplierCertEntity.SecondAudit, _ = strconv.Atoi(secondAudit)
|
|
|
|
|
+ supplierCertEntity.CommitComId = unitId
|
|
|
|
|
+ supplierCertEntity.AuditIndex += 1
|
|
|
|
|
+ certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
|
|
|
|
|
var ActiComplete workflow.ActiCompleteVM
|
|
var ActiComplete workflow.ActiCompleteVM
|
|
|
ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
|
|
ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
|
|
|
- ActiComplete.BusinessKey = businessKey
|
|
|
|
|
- ActiComplete.UserNames = firstAudit
|
|
|
|
|
- ActiComplete.UserId = this.User.Id
|
|
|
|
|
- ActiComplete.Result = result
|
|
|
|
|
|
|
+ ActiComplete.BusinessKey = supplierCertEntity.BusinessKey
|
|
|
|
|
+ ActiComplete.UserId = this.User.Id // 当前审批操作人员
|
|
|
|
|
+ ActiComplete.UserNames = secondAudit // 当前审批操作人员
|
|
|
|
|
+ ActiComplete.Result = "2" //分办提交给二级单位初审
|
|
|
ActiComplete.Remarks = AuditRemark
|
|
ActiComplete.Remarks = AuditRemark
|
|
|
- ActiComplete.CallbackUrl = ""
|
|
|
|
|
|
|
+ ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
|
|
|
receiveVal := svcActiviti.TaskComplete(ActiComplete)
|
|
receiveVal := svcActiviti.TaskComplete(ActiComplete)
|
|
|
- if receiveVal == "true" {
|
|
|
|
|
- errinfo.Message = "提交成功!"
|
|
|
|
|
- errinfo.Code = 0
|
|
|
|
|
- this.Data["json"] = &errinfo
|
|
|
|
|
- this.ServeJSON()
|
|
|
|
|
- } else {
|
|
|
|
|
- errinfo.Message = "工作流异常,请联系管理员!"
|
|
|
|
|
- errinfo.Code = -1
|
|
|
|
|
- this.Data["json"] = &errinfo
|
|
|
|
|
- this.ServeJSON()
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //记下workflowID(首次提交时才会记录,中间状态请忽略) 及审批状态
|
|
|
|
|
- supplierCertEntity.WorkflowId = processInstanceId
|
|
|
|
|
- if this.User.IsCompanyUser == 1 {
|
|
|
|
|
- supplierCertEntity.Status = suppliercert.FEN_TRIAL_STATUS //分办
|
|
|
|
|
- } else if this.User.IsCompanyUser == 0 {
|
|
|
|
|
- supplierCertEntity.Status = suppliercert.FIRST_TRIAL_STATUS //二级单位初审
|
|
|
|
|
- }
|
|
|
|
|
- supplierCertEntity.Step = 2
|
|
|
|
|
- supplierCertEntity.AuditIndex = supplierCertEntity.AuditIndex + 1
|
|
|
|
|
- supplierCertEntity.SecondAudit, _ = strconv.Atoi(secondAudit)
|
|
|
|
|
- supplierCertEntity.ThirdAudit, _ = strconv.Atoi(thirdAudit)
|
|
|
|
|
- cols := []string{
|
|
|
|
|
- "Id",
|
|
|
|
|
- "Status",
|
|
|
|
|
- "Step",
|
|
|
|
|
- "AuditIndex",
|
|
|
|
|
- "SecondAudit",
|
|
|
|
|
- "ThirdAudit",
|
|
|
|
|
|
|
+ if receiveVal != "true" {
|
|
|
|
|
+ panic("工作流异常,请联系管理员!" + receiveVal)
|
|
|
}
|
|
}
|
|
|
- certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// @Title 专业审批
|
|
|
|
|
-// @Description 准入初审提交审批
|
|
|
|
|
|
|
+// @Title 二级单位分办 --审批
|
|
|
|
|
+// @Description 二级分办
|
|
|
// @Success 200 {object} controllers.Request
|
|
// @Success 200 {object} controllers.Request
|
|
|
-// @router /admission/:id [post]
|
|
|
|
|
-func (this *OilSupplierCertController) AuditEntityadmission() {
|
|
|
|
|
|
|
+// @router /audit/:id [post]
|
|
|
|
|
+func (this *OilSupplierCertController) SeparateAuditEntity() {
|
|
|
certId := this.Ctx.Input.Param(":id")
|
|
certId := this.Ctx.Input.Param(":id")
|
|
|
|
|
+ firstAudit := this.GetString("FirstAudit")
|
|
|
|
|
+ secondAudit := this.GetString("SecondAudit")
|
|
|
|
|
+ // typeCode := this.GetString("TypeCode")
|
|
|
|
|
+ AuditRemark := this.GetString("AuditRemark")
|
|
|
|
|
+
|
|
|
var errinfo ErrorDataInfo
|
|
var errinfo ErrorDataInfo
|
|
|
defer func() { //finally处理失败的异常
|
|
defer func() { //finally处理失败的异常
|
|
|
if err := recover(); err != nil {
|
|
if err := recover(); err != nil {
|
|
|
- errinfo.Message = "提交失败," + err.(string)
|
|
|
|
|
|
|
+ errinfo.Message = err.(string)
|
|
|
errinfo.Code = -1
|
|
errinfo.Code = -1
|
|
|
this.Data["json"] = &errinfo
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
@@ -820,51 +787,48 @@ func (this *OilSupplierCertController) AuditEntityadmission() {
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
|
}
|
|
}
|
|
|
}()
|
|
}()
|
|
|
- //取出审批列表
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 取出准入表信息
|
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
- certSrv.SubmitOrgAudit(certId, workflow.OIL_ENUSER_SUPPLIER_APPLY, workflow.PROF_AUDIT, this.User.Id, "1", "提交给专业科室审核", OilSupplierCertSubName, OilClassOrgSettingName, "", "")
|
|
|
|
|
- //记下workflowID(首次提交时才会记录,中间状态请忽略) 及审批状态
|
|
|
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
|
- certSrv.GetEntityById(certId, supplierCertEntity)
|
|
|
|
|
- supplierCertEntity.Status = suppliercert.PROF_AUDIT_STATUS //二级单位初审
|
|
|
|
|
|
|
+ certSrv.GetEntityById(certId, &supplierCertEntity)
|
|
|
|
|
+ // 将选择的初审和复审人员保存下来
|
|
|
cols := []string{
|
|
cols := []string{
|
|
|
- "Id",
|
|
|
|
|
- "Status",
|
|
|
|
|
|
|
+ "FirstAudit",
|
|
|
|
|
+ "SecondAudit",
|
|
|
}
|
|
}
|
|
|
|
|
+ supplierCertEntity.FirstAudit, _ = strconv.Atoi(firstAudit)
|
|
|
|
|
+ supplierCertEntity.SecondAudit, _ = strconv.Atoi(secondAudit)
|
|
|
certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
|
|
+
|
|
|
|
|
+ svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
|
|
+ var ActiComplete workflow.ActiCompleteVM
|
|
|
|
|
+ ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
|
|
|
|
|
+ ActiComplete.BusinessKey = supplierCertEntity.BusinessKey
|
|
|
|
|
+ ActiComplete.UserId = this.User.Id // 审批人员
|
|
|
|
|
+ // ActiComplete.UserNames = secondAudit // 初审人员
|
|
|
|
|
+ ActiComplete.Result = "1" //分办完成后只向前走
|
|
|
|
|
+ ActiComplete.Remarks = AuditRemark
|
|
|
|
|
+ ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
|
|
|
|
|
+ receiveVal := svcActiviti.TaskComplete(ActiComplete)
|
|
|
|
|
+ if receiveVal != "true" {
|
|
|
|
|
+ panic("工作流异常,请联系管理员!" + receiveVal)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// @Title 审批
|
|
|
|
|
-// @Description 审批
|
|
|
|
|
-// @Param body body suppliercert.OilSupplierCert
|
|
|
|
|
|
|
+// @Title 分办之后的各级审批 --审批
|
|
|
|
|
+// @Description 分办之后的各级审批
|
|
|
// @Success 200 {object} controllers.Request
|
|
// @Success 200 {object} controllers.Request
|
|
|
-// @router /auditEntityFir/:id [post]
|
|
|
|
|
-func (this *OilSupplierCertController) AuditEntityFir() {
|
|
|
|
|
- var dataother ShenHeModel
|
|
|
|
|
|
|
+// @router /audit/:id [post]
|
|
|
|
|
+func (this *OilSupplierCertController) CommonAuditEntity() {
|
|
|
certId := this.Ctx.Input.Param(":id")
|
|
certId := this.Ctx.Input.Param(":id")
|
|
|
- auditer := this.GetString("auditer")
|
|
|
|
|
- firstAudit := this.GetString("FirstAuditName")
|
|
|
|
|
|
|
+ result := this.Ctx.Input.Param("result")
|
|
|
AuditRemark := this.GetString("AuditRemark")
|
|
AuditRemark := this.GetString("AuditRemark")
|
|
|
- secondAudit := this.GetString("SecondAudit")
|
|
|
|
|
- thirdAudit := this.GetString("ThirdAudit")
|
|
|
|
|
- //majorDept := this.GetString("majorDept")
|
|
|
|
|
|
|
|
|
|
- //取出审批列表
|
|
|
|
|
- certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
|
|
- var supplierCertEntity suppliercert.OilSupplierCert
|
|
|
|
|
- var supplierEntity supplier.OilSupplier
|
|
|
|
|
- certSrv.GetEntityById(certId, &supplierCertEntity)
|
|
|
|
|
- wheresup := "Id=" + strconv.Itoa(supplierCertEntity.SupplierId)
|
|
|
|
|
- certSrv.GetEntity(&supplierEntity, wheresup)
|
|
|
|
|
- var jsonblob = this.Ctx.Input.RequestBody
|
|
|
|
|
- json.Unmarshal(jsonblob, &dataother)
|
|
|
|
|
- if AuditRemark != "" {
|
|
|
|
|
- dataother.AuditorRemark = AuditRemark
|
|
|
|
|
- }
|
|
|
|
|
var errinfo ErrorDataInfo
|
|
var errinfo ErrorDataInfo
|
|
|
defer func() { //finally处理失败的异常
|
|
defer func() { //finally处理失败的异常
|
|
|
if err := recover(); err != nil {
|
|
if err := recover(); err != nil {
|
|
|
- errinfo.Message = "提交失败," + err.(string)
|
|
|
|
|
|
|
+ errinfo.Message = err.(string)
|
|
|
errinfo.Code = -1
|
|
errinfo.Code = -1
|
|
|
this.Data["json"] = &errinfo
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
@@ -877,545 +841,23 @@ func (this *OilSupplierCertController) AuditEntityFir() {
|
|
|
}
|
|
}
|
|
|
}()
|
|
}()
|
|
|
|
|
|
|
|
- //remarks := ""
|
|
|
|
|
- step := 2
|
|
|
|
|
- status := ""
|
|
|
|
|
- backstatus := "0"
|
|
|
|
|
- var userIds string
|
|
|
|
|
-
|
|
|
|
|
- if supplierCertEntity.Status == suppliercert.FEN_TRIAL_STATUS {
|
|
|
|
|
- userIds = firstAudit
|
|
|
|
|
- status = suppliercert.FIRST_TRIAL_STATUS
|
|
|
|
|
- backstatus = suppliercert.NO_FEN_TRIAL_STATUS
|
|
|
|
|
- step = 2
|
|
|
|
|
- if dataother.SuccessStatus == 1 {
|
|
|
|
|
- supplierCertEntity.Step = 2
|
|
|
|
|
- supplierCertEntity.FirstAudit, _ = strconv.Atoi(firstAudit)
|
|
|
|
|
- supplierCertEntity.SecondAudit, _ = strconv.Atoi(secondAudit)
|
|
|
|
|
- supplierCertEntity.ThirdAudit, _ = strconv.Atoi(thirdAudit)
|
|
|
|
|
- cols := []string{
|
|
|
|
|
- "Id",
|
|
|
|
|
- "Step",
|
|
|
|
|
- "FirstAudit",
|
|
|
|
|
- "SecondAudit",
|
|
|
|
|
- "ThirdAudit",
|
|
|
|
|
- }
|
|
|
|
|
- certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if supplierCertEntity.Status == suppliercert.FIRST_TRIAL_STATUS {
|
|
|
|
|
- userIds = utils.ToStr(supplierCertEntity.SecondAudit)
|
|
|
|
|
- status = suppliercert.SECOND_TRIAL_STATUS
|
|
|
|
|
- backstatus = suppliercert.NOPASS_STATUS
|
|
|
|
|
- step = 2
|
|
|
|
|
- //supplierCertEntity.ThirdAudit,_ = strconv.Atoi(majorDept)
|
|
|
|
|
- //cols := []string{
|
|
|
|
|
- // "ThirdAudit",
|
|
|
|
|
- //}
|
|
|
|
|
- //certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
|
|
- } else if supplierCertEntity.Status == suppliercert.SECOND_TRIAL_STATUS {
|
|
|
|
|
- step = 2
|
|
|
|
|
- backstatus = suppliercert.NO_SECOND_TRIAL_STATUS
|
|
|
|
|
-
|
|
|
|
|
- svc := organize.GetOrganizeService(utils.DBE)
|
|
|
|
|
- unitId := svc.GetMyUnitDepartmentId(strconv.Itoa(supplierCertEntity.ThirdAudit))
|
|
|
|
|
- var userlist []userRole.Base_User
|
|
|
|
|
- var setting auditsetting.Base_OilAuditSetting
|
|
|
|
|
- usvc := userRole.GetUserService(utils.DBE)
|
|
|
|
|
-
|
|
|
|
|
- if supplierCertEntity.InStyle == "3" && supplierEntity.MgrUnit == supplier.MGRUNIT {
|
|
|
|
|
- status = suppliercert.THIRD_TRIAL_STATUS
|
|
|
|
|
- where := "AuditStepCode='" + workflow.PROF_RECE + "'"
|
|
|
|
|
- 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=" + strconv.Itoa(supplierCertEntity.ThirdAudit)
|
|
|
|
|
- usvc.GetEntities(&userlist, where)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- } else if supplierCertEntity.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 supplierCertEntity.InStyle == "2" || supplierCertEntity.InStyle == "4" || supplierCertEntity.InStyle == "6" {
|
|
|
|
|
- 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)
|
|
|
|
|
-
|
|
|
|
|
- //TODO: 改成交费步骤完成,到下一步
|
|
|
|
|
- //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 {
|
|
|
|
|
- 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)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //var users []userRole.Base_RoleList
|
|
|
|
|
- //certSrv.GetAuditUser(strconv.Itoa(supplierCertEntity.ThirdAudit), workflow.PROF_RECE, &users)
|
|
|
|
|
-
|
|
|
|
|
- for _, tmpUser := range userlist {
|
|
|
|
|
- userIds += strconv.Itoa(tmpUser.Id) + "," //strconv.FormatInt(tmpUser.Id, 10) + ","
|
|
|
|
|
- }
|
|
|
|
|
- userIds = strings.Trim(userIds, ",")
|
|
|
|
|
-
|
|
|
|
|
- //step = 2
|
|
|
|
|
- //backstatus = suppliercert.NO_SECOND_TRIAL_STATUS
|
|
|
|
|
-
|
|
|
|
|
- } else if supplierCertEntity.Status == suppliercert.THIRD_TRIAL_STATUS {
|
|
|
|
|
- userIds = auditer
|
|
|
|
|
- status = suppliercert.PROF_AUDIT_STATUS
|
|
|
|
|
- step = 2
|
|
|
|
|
- backstatus = suppliercert.NO_THIRD_TRIAL_STATUS
|
|
|
|
|
- } else if supplierCertEntity.Status == suppliercert.PROF_AUDIT_STATUS {
|
|
|
|
|
- if supplierCertEntity.InStyle == "3" {
|
|
|
|
|
- userIds = auditer
|
|
|
|
|
- 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, ",")
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- } else if supplierCertEntity.Status == suppliercert.CENT_AUDIT_STATUS {
|
|
|
|
|
- userIds = auditer
|
|
|
|
|
- status = suppliercert.PAYING_AUDIT_STATUS
|
|
|
|
|
- step = 3
|
|
|
|
|
- backstatus = suppliercert.NO_CENT_AUDIT_STATUS
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //取出准入表信息
|
|
|
|
|
+ certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
|
|
+ var supplierCertEntity suppliercert.OilSupplierCert
|
|
|
|
|
+ certSrv.GetEntityById(certId, &supplierCertEntity)
|
|
|
|
|
|
|
|
svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
svcActiviti := workflow.GetActivitiService(utils.DBE)
|
|
|
var ActiComplete workflow.ActiCompleteVM
|
|
var ActiComplete workflow.ActiCompleteVM
|
|
|
- ActiComplete.ProcessKey = supplierCertEntity.ProcessKey
|
|
|
|
|
|
|
+ ActiComplete.ProcessKey = workflow.OIL_ENUSER_SUPPLIER_APPLY
|
|
|
ActiComplete.BusinessKey = supplierCertEntity.BusinessKey
|
|
ActiComplete.BusinessKey = supplierCertEntity.BusinessKey
|
|
|
- ActiComplete.UserNames = userIds
|
|
|
|
|
- ActiComplete.UserId = this.User.Id
|
|
|
|
|
- ActiComplete.Remarks = dataother.AuditorRemark
|
|
|
|
|
- ActiComplete.CallbackUrl = ""
|
|
|
|
|
- if dataother.SuccessStatus == 1 {
|
|
|
|
|
- ActiComplete.Result = "1"
|
|
|
|
|
-
|
|
|
|
|
- receiveVal := svcActiviti.TaskComplete(ActiComplete)
|
|
|
|
|
-
|
|
|
|
|
- if receiveVal == "true" {
|
|
|
|
|
- if supplierCertEntity.Status == suppliercert.CENT_AUDIT_STATUS {
|
|
|
|
|
- if supplierCertEntity.InStyle == "1" && supplierCertEntity.IsPay == 0 {
|
|
|
|
|
- paysvc := paymentinfo.GetPaymentService(utils.DBE)
|
|
|
|
|
- var Amount float64
|
|
|
|
|
- asvc := oilcostmanage.GetOilCostManageService(utils.DBE)
|
|
|
|
|
- Amount = asvc.GetAmount("ZHUNRU", supplierCertEntity.SupplierTypeCode)
|
|
|
|
|
- var payinfo paymentinfo.OilPaymentInfo
|
|
|
|
|
- payinfo.SupplierId = supplierCertEntity.SupplierId
|
|
|
|
|
- payinfo.SrcId = supplierCertEntity.Id
|
|
|
|
|
- payinfo.SupplierCertId = supplierCertEntity.Id
|
|
|
|
|
- payinfo.USCCode = supplierEntity.CommercialNo
|
|
|
|
|
- payinfo.SupplierName = supplierEntity.SupplierName
|
|
|
|
|
- payinfo.PayType = "1"
|
|
|
|
|
- payinfo.Amount = strconv.FormatFloat(Amount, 'E', -1, 64)
|
|
|
|
|
- payinfo.IsPay = "0"
|
|
|
|
|
- payinfo.IsInvoice = "0"
|
|
|
|
|
- payinfo.CreateUserId = supplierCertEntity.CreateUserId
|
|
|
|
|
- payinfo.CreateBy = supplierCertEntity.CreateBy
|
|
|
|
|
- payinfo.CreateOn = time.Now()
|
|
|
|
|
-
|
|
|
|
|
- //wheresup := " SupplierCertId=" + strconv.Itoa(supplierCertEntity.Id)
|
|
|
|
|
- //var sup []suppliercertsub.OilSupplierCertSub
|
|
|
|
|
- //total := paysvc.GetPagingEntitiesWithOrder(1, 10, "Id", true, &sup, wheresup)
|
|
|
|
|
-
|
|
|
|
|
- //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)
|
|
|
|
|
- // //发短信
|
|
|
|
|
- // toMobile := supplierEntity.Mobile
|
|
|
|
|
- // msg := "您的" + supplierCertEntity.SupplierTypeName + "准入审核通过,请及时确认交费信息!"
|
|
|
|
|
- // msgService := msg2.GetMsgService(utils.DBE)
|
|
|
|
|
- // msgService.HandleMsg(toMobile, msg, "3-1", supplierCertEntity.CreateBy, supplierEntity.ContactName, strconv.Itoa(supplierCertEntity.CreateUserId), this.User.Username)
|
|
|
|
|
- //}
|
|
|
|
|
-
|
|
|
|
|
- paysvc.InsertEntity(&payinfo)
|
|
|
|
|
- //发短信
|
|
|
|
|
- toMobile := supplierEntity.Mobile
|
|
|
|
|
- msg := "您的" + supplierCertEntity.SupplierTypeName + "准入审核通过,请及时确认信息并交费!"
|
|
|
|
|
- msgService := msg2.GetMsgService(utils.DBE)
|
|
|
|
|
- msgService.HandleMsg(toMobile, msg, "3-1", supplierCertEntity.CreateBy, supplierEntity.ContactName, strconv.Itoa(supplierCertEntity.CreateUserId), this.User.Username)
|
|
|
|
|
-
|
|
|
|
|
- //paysvc.AddPaymentinfo(supplierCertEntity.SupplierId, supplierCertEntity.Id, Amount, "1")
|
|
|
|
|
- supplierCertEntity.Status = status
|
|
|
|
|
- supplierCertEntity.Step = step
|
|
|
|
|
- cols := []string{
|
|
|
|
|
- "Status",
|
|
|
|
|
- "Step",
|
|
|
|
|
- }
|
|
|
|
|
- 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)
|
|
|
|
|
-
|
|
|
|
|
- //TODO: 改成交费步骤完成,到下一步
|
|
|
|
|
- //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{
|
|
|
|
|
- "Status",
|
|
|
|
|
- "Step",
|
|
|
|
|
- }
|
|
|
|
|
- certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
|
|
- }
|
|
|
|
|
- } else if supplierCertEntity.Status == suppliercert.PROF_AUDIT_STATUS && supplierCertEntity.InStyle == "3" {
|
|
|
|
|
- //if supplierCertEntity.InStyle == "3" {
|
|
|
|
|
-
|
|
|
|
|
- /*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)
|
|
|
|
|
-
|
|
|
|
|
- //TODO: 改成交费步骤完成,到下一步
|
|
|
|
|
- //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",
|
|
|
|
|
- "Step",
|
|
|
|
|
- }
|
|
|
|
|
- certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
|
|
- } else {
|
|
|
|
|
- supplierCertEntity.Status = status
|
|
|
|
|
- supplierCertEntity.Step = step
|
|
|
|
|
- cols := []string{
|
|
|
|
|
- "Status",
|
|
|
|
|
- "Step",
|
|
|
|
|
- }
|
|
|
|
|
- certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
|
|
- }
|
|
|
|
|
- errinfo.Message = "提交成功!"
|
|
|
|
|
- errinfo.Code = 0
|
|
|
|
|
- this.Data["json"] = &errinfo
|
|
|
|
|
- this.ServeJSON()
|
|
|
|
|
- } else {
|
|
|
|
|
- errinfo.Message = "工作流异常,请联系管理员!"
|
|
|
|
|
- errinfo.Code = -1
|
|
|
|
|
- this.Data["json"] = &errinfo
|
|
|
|
|
- this.ServeJSON()
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
-
|
|
|
|
|
- ActiComplete.Result = "0"
|
|
|
|
|
- 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)
|
|
|
|
|
- if supplierCertEntity.Status == suppliercert.CENT_AUDIT_STATUS {
|
|
|
|
|
- supplierCertEntity.Status = suppliercert.NO_CENT_AUDIT_STATUS
|
|
|
|
|
- supplierCertEntity.BackReason = dataother.AuditorRemark
|
|
|
|
|
- cols := []string{
|
|
|
|
|
- "BackReason",
|
|
|
|
|
- }
|
|
|
|
|
- certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
|
|
- } else {
|
|
|
|
|
- supplierCertEntity.Status = backstatus
|
|
|
|
|
- }
|
|
|
|
|
- supplierCertEntity.Step = 1
|
|
|
|
|
- //supplierCertEntity.WorkflowId = ""
|
|
|
|
|
- cols := []string{
|
|
|
|
|
- "Status",
|
|
|
|
|
- "Step",
|
|
|
|
|
- //"WorkflowId",
|
|
|
|
|
- }
|
|
|
|
|
- certSrv.UpdateEntityByIdCols(certId, supplierCertEntity, cols)
|
|
|
|
|
-
|
|
|
|
|
- toMobile := supplierEntity.Mobile
|
|
|
|
|
- msg := "您的" + supplierCertEntity.SupplierTypeName + "准入审核未通过,请及时查看!"
|
|
|
|
|
- msgService := msg2.GetMsgService(utils.DBE)
|
|
|
|
|
- msgService.HandleMsg(toMobile, msg, "4-1", supplierCertEntity.CreateBy, supplierEntity.ContactName, strconv.Itoa(supplierCertEntity.CreateUserId), this.User.Username)
|
|
|
|
|
- errinfo.Message = "提交成功!"
|
|
|
|
|
- errinfo.Code = 0
|
|
|
|
|
- this.Data["json"] = &errinfo
|
|
|
|
|
- this.ServeJSON()
|
|
|
|
|
- } else {
|
|
|
|
|
- errinfo.Message = "工作流异常,请联系管理员!"
|
|
|
|
|
- errinfo.Code = -1
|
|
|
|
|
- this.Data["json"] = &errinfo
|
|
|
|
|
- this.ServeJSON()
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// @Title 审核
|
|
|
|
|
-// @Description 审核
|
|
|
|
|
-// @Success 200 {object} controllers.Request
|
|
|
|
|
-// @router /auditcallback [get]
|
|
|
|
|
-func (this *OilSupplierCertController) AuditCallback() {
|
|
|
|
|
- id := this.GetString("Id")
|
|
|
|
|
- status := this.GetString("status")
|
|
|
|
|
- step := this.GetString("step")
|
|
|
|
|
- var supplierCertEntity suppliercert.OilSupplierCert
|
|
|
|
|
- svc := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
|
|
- supplierCertEntity.Status = status
|
|
|
|
|
- supplierCertEntity.Step, _ = strconv.Atoi(step)
|
|
|
|
|
- cols := []string{
|
|
|
|
|
- "Id",
|
|
|
|
|
- "Status",
|
|
|
|
|
- "step",
|
|
|
|
|
|
|
+ ActiComplete.UserId = this.User.Id //审批人员
|
|
|
|
|
+ ActiComplete.Result = result //前台审批[同意、不同意]
|
|
|
|
|
+ ActiComplete.Remarks = AuditRemark
|
|
|
|
|
+ ActiComplete.CallbackUrl = utils.Cfg.MustValue("workflow", "callbackHost")
|
|
|
|
|
+ receiveVal := svcActiviti.TaskComplete(ActiComplete)
|
|
|
|
|
+ if receiveVal != "true" {
|
|
|
|
|
+ panic("工作流异常,请联系管理员!" + receiveVal)
|
|
|
}
|
|
}
|
|
|
- svc.UpdateEntityByIdCols(id, supplierCertEntity, cols)
|
|
|
|
|
- fmt.Println(id, status, step)
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// @Title 获取实体
|
|
// @Title 获取实体
|