|
@@ -1,13 +1,14 @@
|
|
|
package oilsupplier
|
|
package oilsupplier
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
- msg2 "dashoo.cn/backend/api/business/msg"
|
|
|
|
|
"dashoo.cn/backend/api/business/audithistory"
|
|
"dashoo.cn/backend/api/business/audithistory"
|
|
|
"dashoo.cn/backend/api/business/auditsetting"
|
|
"dashoo.cn/backend/api/business/auditsetting"
|
|
|
|
|
+ msg2 "dashoo.cn/backend/api/business/msg"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/oilcostmanage"
|
|
"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/suppliercertsub"
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
|
|
|
"dashoo.cn/backend/api/business/organize"
|
|
"dashoo.cn/backend/api/business/organize"
|
|
|
|
|
+ "dashoo.cn/backend/api/business/paymentinfo"
|
|
|
"dashoo.cn/backend/api/business/register"
|
|
"dashoo.cn/backend/api/business/register"
|
|
|
"dashoo.cn/business2/parameter"
|
|
"dashoo.cn/business2/parameter"
|
|
|
"dashoo.cn/business2/userRole"
|
|
"dashoo.cn/business2/userRole"
|
|
@@ -18,7 +19,6 @@ import (
|
|
|
"time"
|
|
"time"
|
|
|
|
|
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
|
- "dashoo.cn/backend/api/business/paymentinfo"
|
|
|
|
|
"dashoo.cn/backend/api/business/workflow"
|
|
"dashoo.cn/backend/api/business/workflow"
|
|
|
"dashoo.cn/business2/permission"
|
|
"dashoo.cn/business2/permission"
|
|
|
|
|
|
|
@@ -494,6 +494,37 @@ func (this *OilSupplierCertAppendController) AuditEntity() {
|
|
|
SecondAudit := this.GetString("SecondAudit")
|
|
SecondAudit := this.GetString("SecondAudit")
|
|
|
ThirdAudit := this.GetString("ThirdAudit")
|
|
ThirdAudit := this.GetString("ThirdAudit")
|
|
|
AuditRemark := this.GetString("AuditRemark")
|
|
AuditRemark := this.GetString("AuditRemark")
|
|
|
|
|
+ typeCode := this.GetString("TypeCode")
|
|
|
|
|
+
|
|
|
|
|
+ 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 := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
|
|
certSrv := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
|
|
@@ -540,28 +571,6 @@ func (this *OilSupplierCertAppendController) AuditEntity() {
|
|
|
} else if supplierCertAppendEntity.InStyle == "1" || supplierCertAppendEntity.InStyle == "5" {
|
|
} else if supplierCertAppendEntity.InStyle == "1" || supplierCertAppendEntity.InStyle == "5" {
|
|
|
processInstanceId = svcActiviti.StartProcess2(workflow.OIL_ENUSER_APPEND_APPLY, businessKey, this.User.Id, result)
|
|
processInstanceId = svcActiviti.StartProcess2(workflow.OIL_ENUSER_APPEND_APPLY, businessKey, this.User.Id, result)
|
|
|
}
|
|
}
|
|
|
- //if this.User.IsCompanyUser == 1 {
|
|
|
|
|
- // if supplierCertAppendEntity.InStyle == "2" {
|
|
|
|
|
- // processInstanceId = svcActiviti.StartProcess(workflow.OIL_FIRST_ENUSER_APPEND_APPLY, businessKey, this.User.Id)
|
|
|
|
|
- // } else if supplierCertAppendEntity.InStyle == "3" {
|
|
|
|
|
- // processInstanceId = svcActiviti.StartProcess(workflow.OIL_SECOND_ENUSER_APPEND_APPLY, businessKey, this.User.Id)
|
|
|
|
|
- // } else if supplierCertAppendEntity.InStyle == "6" {
|
|
|
|
|
- // processInstanceId = svcActiviti.StartProcess(workflow.OIL_FIRST_ENUSER_APPEND_APPLY, businessKey, this.User.Id)
|
|
|
|
|
- // } else {
|
|
|
|
|
- // processInstanceId = svcActiviti.StartProcess(workflow.OIL_ENUSER_APPEND_APPLY, businessKey, this.User.Id)
|
|
|
|
|
- // }
|
|
|
|
|
- //}else if this.User.IsCompanyUser == 0 {
|
|
|
|
|
- // if supplierCertAppendEntity.InStyle == "2" {
|
|
|
|
|
- // processInstanceId = svcActiviti.StartProcess(workflow.OIL_FIRST_APPEND_APPLY, businessKey, this.User.Id)
|
|
|
|
|
- // }else if supplierCertAppendEntity.InStyle == "3" {
|
|
|
|
|
- // processInstanceId = svcActiviti.StartProcess(workflow.OIL_SECOND_APPEND_APPLY, businessKey, this.User.Id)
|
|
|
|
|
- // }else if supplierCertAppendEntity.InStyle == "6" {
|
|
|
|
|
- // processInstanceId = svcActiviti.StartProcess(workflow.OIL_FIRST_APPEND_APPLY, businessKey, this.User.Id)
|
|
|
|
|
- // }else {
|
|
|
|
|
- // processInstanceId = svcActiviti.StartProcess(workflow.OIL_ENUSER_APPEND_APPLY, businessKey, this.User.Id)
|
|
|
|
|
- // }
|
|
|
|
|
- //}
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
var ActiComplete workflow.ActiCompleteVM
|
|
var ActiComplete workflow.ActiCompleteVM
|
|
@@ -572,28 +581,6 @@ func (this *OilSupplierCertAppendController) AuditEntity() {
|
|
|
} else if supplierCertAppendEntity.InStyle == "1" || supplierCertAppendEntity.InStyle == "5" {
|
|
} else if supplierCertAppendEntity.InStyle == "1" || supplierCertAppendEntity.InStyle == "5" {
|
|
|
ActiComplete.ProcessKey = workflow.OIL_ENUSER_APPEND_APPLY
|
|
ActiComplete.ProcessKey = workflow.OIL_ENUSER_APPEND_APPLY
|
|
|
}
|
|
}
|
|
|
- //if this.User.IsCompanyUser == 1 {
|
|
|
|
|
- // if supplierCertAppendEntity.InStyle == "2" {
|
|
|
|
|
- // ActiComplete.ProcessKey = workflow.OIL_FIRST_ENUSER_APPEND_APPLY
|
|
|
|
|
- // } else if supplierCertAppendEntity.InStyle == "3" {
|
|
|
|
|
- // ActiComplete.ProcessKey = workflow.OIL_SECOND_ENUSER_APPEND_APPLY
|
|
|
|
|
- // } else if supplierCertAppendEntity.InStyle == "6" {
|
|
|
|
|
- // ActiComplete.ProcessKey = workflow.OIL_FIRST_ENUSER_APPEND_APPLY
|
|
|
|
|
- // } else {
|
|
|
|
|
- // ActiComplete.ProcessKey = workflow.OIL_ENUSER_APPEND_APPLY
|
|
|
|
|
- // }
|
|
|
|
|
- //}else if this.User.IsCompanyUser == 0 {
|
|
|
|
|
- // if supplierCertAppendEntity.InStyle == "2" {
|
|
|
|
|
- // ActiComplete.ProcessKey = workflow.OIL_FIRST_APPEND_APPLY
|
|
|
|
|
- // }else if supplierCertAppendEntity.InStyle == "3" {
|
|
|
|
|
- // ActiComplete.ProcessKey = workflow.OIL_SECOND_APPEND_APPLY
|
|
|
|
|
- // }else if supplierCertAppendEntity.InStyle == "6" {
|
|
|
|
|
- // ActiComplete.ProcessKey = workflow.OIL_FIRST_APPEND_APPLY
|
|
|
|
|
- // }else{
|
|
|
|
|
- // ActiComplete.ProcessKey = workflow.OIL_ENUSER_APPEND_APPLY
|
|
|
|
|
- // }
|
|
|
|
|
- //}
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
ActiComplete.BusinessKey = businessKey
|
|
ActiComplete.BusinessKey = businessKey
|
|
|
ActiComplete.UserNames = firstAudit
|
|
ActiComplete.UserNames = firstAudit
|
|
@@ -824,36 +811,47 @@ func (this *OilSupplierCertAppendController) AuditEntityFir() {
|
|
|
if receiveVal == "true" {
|
|
if receiveVal == "true" {
|
|
|
if supplierCertAppendEntity.Status == "5" {
|
|
if supplierCertAppendEntity.Status == "5" {
|
|
|
if supplierCertAppendEntity.InStyle == "1" {
|
|
if supplierCertAppendEntity.InStyle == "1" {
|
|
|
- paysvc := paymentinfo.GetPaymentService(utils.DBE)
|
|
|
|
|
- var Amount float64
|
|
|
|
|
- asvc := oilcostmanage.GetOilCostManageService(utils.DBE)
|
|
|
|
|
- Amount = asvc.GetAmount("APPEND",supplierCertAppendEntity.AppendType)
|
|
|
|
|
- var payinfo paymentinfo.OilPaymentInfo
|
|
|
|
|
- payinfo.SrcId = supplierCertAppendEntity.Id
|
|
|
|
|
- payinfo.SupplierId = supplierCertAppendEntity.SupplierId
|
|
|
|
|
- payinfo.SupplierCertId = supplierCertAppendEntity.SupplierCertId
|
|
|
|
|
- payinfo.USCCode = supplierEntity.CommercialNo
|
|
|
|
|
- payinfo.SupplierName = supplierEntity.SupplierName
|
|
|
|
|
- payinfo.PayType = "3"
|
|
|
|
|
- payinfo.IsPay = "0"
|
|
|
|
|
- payinfo.Amount = strconv.FormatFloat(Amount,'E',-1,64)
|
|
|
|
|
- payinfo.CreateUserId = supplierCertAppendEntity.CreateUserId
|
|
|
|
|
- payinfo.CreateBy = supplierCertAppendEntity.CreateBy
|
|
|
|
|
- payinfo.CreateOn = time.Now()
|
|
|
|
|
- paysvc.InsertEntity(&payinfo)
|
|
|
|
|
- //发短信
|
|
|
|
|
- toMobile := supplierEntity.Mobile
|
|
|
|
|
- bFlag:=""
|
|
|
|
|
- if supplierCertAppendEntity.AppendType == "01"{
|
|
|
|
|
- bFlag="物资类"
|
|
|
|
|
- }else if supplierCertAppendEntity.AppendType == "02"{
|
|
|
|
|
- bFlag="基建类"
|
|
|
|
|
- }else{
|
|
|
|
|
- bFlag="技术服务类"
|
|
|
|
|
|
|
+
|
|
|
|
|
+ wheresup := " SupplierCertAppendId=" + strconv.Itoa(supplierCertAppendEntity.Id) + " and Type='2'"
|
|
|
|
|
+ var sup []suppliercertsub.OilSupplierCertSub
|
|
|
|
|
+ total := svc.GetPagingEntitiesWithOrder(1,10,"Id",true,&sup,wheresup)
|
|
|
|
|
+
|
|
|
|
|
+ if supplierCertAppendEntity.AppendType == "01" && total <= 50 {
|
|
|
|
|
+ status = suppliercert.ALL_PASE_STATUS
|
|
|
|
|
+ } else {
|
|
|
|
|
+ paysvc := paymentinfo.GetPaymentService(utils.DBE)
|
|
|
|
|
+ var Amount float64
|
|
|
|
|
+ asvc := oilcostmanage.GetOilCostManageService(utils.DBE)
|
|
|
|
|
+ Amount = asvc.GetAmount("APPEND",supplierCertAppendEntity.AppendType)
|
|
|
|
|
+ var payinfo paymentinfo.OilPaymentInfo
|
|
|
|
|
+ payinfo.SrcId = supplierCertAppendEntity.Id
|
|
|
|
|
+ payinfo.SupplierId = supplierCertAppendEntity.SupplierId
|
|
|
|
|
+ payinfo.SupplierCertId = supplierCertAppendEntity.SupplierCertId
|
|
|
|
|
+ payinfo.USCCode = supplierEntity.CommercialNo
|
|
|
|
|
+ payinfo.SupplierName = supplierEntity.SupplierName
|
|
|
|
|
+ payinfo.PayType = "3"
|
|
|
|
|
+ payinfo.IsPay = "0"
|
|
|
|
|
+ payinfo.Amount = strconv.FormatFloat(Amount,'E',-1,64)
|
|
|
|
|
+ payinfo.CreateUserId = supplierCertAppendEntity.CreateUserId
|
|
|
|
|
+ payinfo.CreateBy = supplierCertAppendEntity.CreateBy
|
|
|
|
|
+ payinfo.CreateOn = time.Now()
|
|
|
|
|
+ paysvc.InsertEntity(&payinfo)
|
|
|
|
|
+ //发短信
|
|
|
|
|
+ toMobile := supplierEntity.Mobile
|
|
|
|
|
+ bFlag:=""
|
|
|
|
|
+ if supplierCertAppendEntity.AppendType == "01"{
|
|
|
|
|
+ bFlag="物资类"
|
|
|
|
|
+ }else if supplierCertAppendEntity.AppendType == "02"{
|
|
|
|
|
+ bFlag="基建类"
|
|
|
|
|
+ }else{
|
|
|
|
|
+ bFlag="技术服务类"
|
|
|
|
|
+ }
|
|
|
|
|
+ msg:= "您的"+ bFlag + "增项审核通过,请及时确认缴费信息!"
|
|
|
|
|
+ msgService := msg2.GetMsgService(utils.DBE)
|
|
|
|
|
+ msgService.HandleMsg(toMobile,msg,"4-1",supplierCertAppendEntity.CreateBy,supplierEntity.ContactName,strconv.Itoa(supplierCertAppendEntity.CreateUserId))
|
|
|
}
|
|
}
|
|
|
- msg:= "您的"+ bFlag + "增项审核通过,请及时确认缴费信息!"
|
|
|
|
|
- msgService := msg2.GetMsgService(utils.DBE)
|
|
|
|
|
- msgService.HandleMsg(toMobile,msg,"4-1",supplierCertAppendEntity.CreateBy,supplierEntity.ContactName,strconv.Itoa(supplierCertAppendEntity.CreateUserId))
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//paysvc.AddPaymentinfo(supplierCertAppendEntity.SupplierId, supplierCertAppendEntity.Id, Amount, "3")
|
|
//paysvc.AddPaymentinfo(supplierCertAppendEntity.SupplierId, supplierCertAppendEntity.Id, Amount, "3")
|
|
|
} else {
|
|
} else {
|
|
|
status = suppliercert.ALL_PASE_STATUS
|
|
status = suppliercert.ALL_PASE_STATUS
|