|
@@ -1,25 +1,36 @@
|
|
|
package oilsupplier
|
|
package oilsupplier
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
|
+ "encoding/json"
|
|
|
|
|
+ "strconv"
|
|
|
|
|
+ "strings"
|
|
|
|
|
+
|
|
|
"dashoo.cn/backend/api/business/auditsetting"
|
|
"dashoo.cn/backend/api/business/auditsetting"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
|
"dashoo.cn/backend/api/business/workflow"
|
|
"dashoo.cn/backend/api/business/workflow"
|
|
|
. "dashoo.cn/backend/api/controllers"
|
|
. "dashoo.cn/backend/api/controllers"
|
|
|
"dashoo.cn/utils"
|
|
"dashoo.cn/utils"
|
|
|
- "strings"
|
|
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
type OilSupplierCertListenerController struct {
|
|
type OilSupplierCertListenerController struct {
|
|
|
BaseController
|
|
BaseController
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+type ListenerApproveInfo struct {
|
|
|
|
|
+ Users string `json:"users"`
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+type ListenerApproveParams struct {
|
|
|
|
|
+ BusinessKey string `json:"businessKey"`
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// @Title 获取二级单位分办人员列表 --回调
|
|
// @Title 获取二级单位分办人员列表 --回调
|
|
|
// @Description get user by token
|
|
// @Description get user by token
|
|
|
// @Success 200 {string} string
|
|
// @Success 200 {string} string
|
|
|
// @router /pre-fen-trail [get]
|
|
// @router /pre-fen-trail [get]
|
|
|
-func (this *OilSupplierCertListenerController) PreFenTrialStatus () {
|
|
|
|
|
|
|
+func (this *OilSupplierCertListenerController) PreFenTrialStatus() {
|
|
|
businessKey := this.GetString("businessKey")
|
|
businessKey := this.GetString("businessKey")
|
|
|
- supplierCertId := strings.Split(businessKey, "_")[0]
|
|
|
|
|
|
|
+ supplierCertId := strings.Split(businessKey, "-")[0]
|
|
|
|
|
|
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
@@ -40,14 +51,13 @@ func (this *OilSupplierCertListenerController) PreFenTrialStatus () {
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// @Title 获取二级单位初审人员列表--回调
|
|
// @Title 获取二级单位初审人员列表--回调
|
|
|
// @Description get user by token
|
|
// @Description get user by token
|
|
|
// @Success 200 {string} string
|
|
// @Success 200 {string} string
|
|
|
// @router /pre-first-trail [get]
|
|
// @router /pre-first-trail [get]
|
|
|
func (this *OilSupplierCertListenerController) PreFirstTrail() {
|
|
func (this *OilSupplierCertListenerController) PreFirstTrail() {
|
|
|
businessKey := this.GetString("businessKey")
|
|
businessKey := this.GetString("businessKey")
|
|
|
- supplierCertId := strings.Split(businessKey, "_")[0]
|
|
|
|
|
|
|
+ supplierCertId := strings.Split(businessKey, "-")[0]
|
|
|
|
|
|
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
@@ -94,10 +104,12 @@ func (this *OilSupplierCertListenerController) PreSecondTrail() {
|
|
|
// @Title 获取业务处室接收分办人员列表 --回调
|
|
// @Title 获取业务处室接收分办人员列表 --回调
|
|
|
// @Description get user by token
|
|
// @Description get user by token
|
|
|
// @Success 200 {string} string
|
|
// @Success 200 {string} string
|
|
|
-// @router /pre-third-trail [get]
|
|
|
|
|
-func (this *OilSupplierCertListenerController) PreThirdTrialStatus () {
|
|
|
|
|
- businessKey := this.GetString("businessKey")
|
|
|
|
|
- supplierCertId := strings.Split(businessKey, "_")[0]
|
|
|
|
|
|
|
+// @router /pre-third-trail [post]
|
|
|
|
|
+func (this *OilSupplierCertListenerController) PreThirdTrialStatus() {
|
|
|
|
|
+ var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
|
|
+ var listenerApprove ListenerApproveParams
|
|
|
|
|
+ json.Unmarshal(jsonBlob, &listenerApprove)
|
|
|
|
|
+ supplierCertId := strings.Split(listenerApprove.BusinessKey, "-")[0]
|
|
|
|
|
|
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
@@ -113,8 +125,10 @@ func (this *OilSupplierCertListenerController) PreThirdTrialStatus () {
|
|
|
//查出业务处室接收分办的人员
|
|
//查出业务处室接收分办的人员
|
|
|
stepCode := workflow.PROF_RECE //专业处室接收
|
|
stepCode := workflow.PROF_RECE //专业处室接收
|
|
|
auditSettingService := auditsetting.GetOilAuditSettingService(utils.DBE)
|
|
auditSettingService := auditsetting.GetOilAuditSettingService(utils.DBE)
|
|
|
- approverIds := auditSettingService.GetApproverIdsByStepCodeAndUnitId(stepCode, supplierCertEntity.CommitComId)
|
|
|
|
|
- this.Data["json"] = approverIds
|
|
|
|
|
|
|
+ approverIds := auditSettingService.GetApproverIdsByStepCodeAndUnitId(stepCode, strconv.Itoa(supplierCertEntity.ThirdAudit))
|
|
|
|
|
+ var approveInfo ListenerApproveInfo
|
|
|
|
|
+ approveInfo.Users = approverIds
|
|
|
|
|
+ this.Data["json"] = &approveInfo
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -124,7 +138,7 @@ func (this *OilSupplierCertListenerController) PreThirdTrialStatus () {
|
|
|
// @router /pre-prof-audit [get]
|
|
// @router /pre-prof-audit [get]
|
|
|
func (this *OilSupplierCertListenerController) PreProfAudit() {
|
|
func (this *OilSupplierCertListenerController) PreProfAudit() {
|
|
|
businessKey := this.GetString("businessKey")
|
|
businessKey := this.GetString("businessKey")
|
|
|
- supplierCertId := strings.Split(businessKey, "_")[0]
|
|
|
|
|
|
|
+ supplierCertId := strings.Split(businessKey, "-")[0]
|
|
|
|
|
|
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
@@ -137,11 +151,109 @@ func (this *OilSupplierCertListenerController) PreProfAudit() {
|
|
|
supplierCertEntity.Status = suppliercert.PROF_AUDIT_STATUS //业务处室专业审批
|
|
supplierCertEntity.Status = suppliercert.PROF_AUDIT_STATUS //业务处室专业审批
|
|
|
certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
|
|
certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
|
|
|
|
|
|
|
|
- //查出业务处室接收分办的人员
|
|
|
|
|
- stepCode := workflow.PROF_AUDIT
|
|
|
|
|
|
|
+ //查出业务处室专业审批的人员
|
|
|
|
|
+ //专业审批人已在分办时指定
|
|
|
|
|
+ //stepCode := workflow.PROF_AUDIT
|
|
|
|
|
+ //auditSettingService := auditsetting.GetOilAuditSettingService(utils.DBE)
|
|
|
|
|
+ //approverIds := auditSettingService.GetApproverIdsByStepCodeAndUnitId(stepCode, supplierCertEntity.CommitComId)
|
|
|
|
|
+ this.Data["json"] = 1
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// @Title 获取集中审批人员列表 --回调
|
|
|
|
|
+// @Description get user by token
|
|
|
|
|
+// @Success 200 {string} string
|
|
|
|
|
+// @router /pre-concentrate-audit [post]
|
|
|
|
|
+func (this *OilSupplierCertListenerController) ConcentrateAudit() {
|
|
|
|
|
+ var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
|
|
+ var listenerApprove ListenerApproveParams
|
|
|
|
|
+ json.Unmarshal(jsonBlob, &listenerApprove)
|
|
|
|
|
+ supplierCertId := strings.Split(listenerApprove.BusinessKey, "-")[0]
|
|
|
|
|
+
|
|
|
|
|
+ certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
|
|
+ var supplierCertEntity suppliercert.OilSupplierCert
|
|
|
|
|
+ certSrv.GetEntityById(supplierCertId, &supplierCertEntity)
|
|
|
|
|
+ cols := []string{
|
|
|
|
|
+ "Id",
|
|
|
|
|
+ "Status",
|
|
|
|
|
+ }
|
|
|
|
|
+ //进入此步骤,记录在数据库中
|
|
|
|
|
+ supplierCertEntity.Status = suppliercert.CENT_AUDIT_STATUS //集中审批
|
|
|
|
|
+ certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
|
|
|
|
|
+
|
|
|
|
|
+ //查出集中审批的人员
|
|
|
|
|
+ stepCode := workflow.PROF_CONCENT //集中审批
|
|
|
auditSettingService := auditsetting.GetOilAuditSettingService(utils.DBE)
|
|
auditSettingService := auditsetting.GetOilAuditSettingService(utils.DBE)
|
|
|
- approverIds := auditSettingService.GetApproverIdsByStepCodeAndUnitId(stepCode, supplierCertEntity.CommitComId)
|
|
|
|
|
- this.Data["json"] = approverIds
|
|
|
|
|
|
|
+ approverIds := auditSettingService.GetApproverIdsByStepCodeForConcentrateAudit(stepCode)
|
|
|
|
|
+ var approveInfo ListenerApproveInfo
|
|
|
|
|
+ approveInfo.Users = approverIds
|
|
|
|
|
+ this.Data["json"] = &approveInfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// @Title 查询是否集中审批--回调
|
|
|
|
|
+// @Description 查询是否集中审批
|
|
|
|
|
+// @Success 200 {string} string
|
|
|
|
|
+// @router /check-need-concentrate-audit [get]
|
|
|
|
|
+func (this *OilSupplierCertListenerController) CheckNeedConcentrateAudit() {
|
|
|
|
|
+ businessKey := this.GetString("businessKey")
|
|
|
|
|
+ supplierCertId := strings.Split(businessKey, "-")[0]
|
|
|
|
|
+
|
|
|
|
|
+ certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
|
|
+ var supplierCertEntity suppliercert.OilSupplierCert
|
|
|
|
|
+ certSrv.GetEntityById(supplierCertId, &supplierCertEntity)
|
|
|
|
|
+
|
|
|
|
|
+ if supplierCertEntity.SupplierTypeCode != "01" {
|
|
|
|
|
+ panic("准入类别错误!请联系管理员!")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 需要集中评审的准入类型
|
|
|
|
|
+ var concentrateInStyleList []string
|
|
|
|
|
+ concentrateInStyleList = append(concentrateInStyleList, suppliercert.PINGSHEN)
|
|
|
|
|
+ concentrateInStyleList = append(concentrateInStyleList, suppliercert.NEIBUDUOYUAN)
|
|
|
|
|
+ // 不需要集中评审的准入类型
|
|
|
|
|
+ var unConcentrateInStyleList []string
|
|
|
|
|
+ unConcentrateInStyleList = append(unConcentrateInStyleList, suppliercert.YIJIWUZI)
|
|
|
|
|
+ unConcentrateInStyleList = append(unConcentrateInStyleList, suppliercert.ERJIWUZI)
|
|
|
|
|
+ unConcentrateInStyleList = append(unConcentrateInStyleList, suppliercert.ZHANLUEHEZUO)
|
|
|
|
|
+ unConcentrateInStyleList = append(unConcentrateInStyleList, suppliercert.WAIBUSHICHANG)
|
|
|
|
|
+
|
|
|
|
|
+ result := 0
|
|
|
|
|
+ isConcentrateAudit := "false"
|
|
|
|
|
+ unConcentrateAudit := "false"
|
|
|
|
|
+ for _, eachItem := range concentrateInStyleList{
|
|
|
|
|
+ if eachItem == supplierCertEntity.InStyle {
|
|
|
|
|
+ // 需要集中评审
|
|
|
|
|
+ isConcentrateAudit = "true"
|
|
|
|
|
+ result = 1
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ for _, eachItem := range unConcentrateInStyleList{
|
|
|
|
|
+ if eachItem == supplierCertEntity.InStyle {
|
|
|
|
|
+ // 不需要集中评审
|
|
|
|
|
+ unConcentrateAudit = "true"
|
|
|
|
|
+ result = 2
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if isConcentrateAudit == unConcentrateAudit{
|
|
|
|
|
+ // 准入类型评审方式错误!请联系管理员
|
|
|
|
|
+ result = 0
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //if result == 1 {
|
|
|
|
|
+ // cols := []string{
|
|
|
|
|
+ // "Id",
|
|
|
|
|
+ // "Status",
|
|
|
|
|
+ // }
|
|
|
|
|
+ // //进入此步骤,记录在数据库中
|
|
|
|
|
+ // supplierCertEntity.Status = suppliercert.PROF_AUDIT_STATUS //业务处室专业审批
|
|
|
|
|
+ // certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ this.Data["json"] = result
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -151,12 +263,70 @@ func (this *OilSupplierCertListenerController) PreProfAudit() {
|
|
|
// @router /check-need-pay [get]
|
|
// @router /check-need-pay [get]
|
|
|
func (this *OilSupplierCertListenerController) CheckNeedPay() {
|
|
func (this *OilSupplierCertListenerController) CheckNeedPay() {
|
|
|
businessKey := this.GetString("businessKey")
|
|
businessKey := this.GetString("businessKey")
|
|
|
- supplierCertId := strings.Split(businessKey, "_")[0]
|
|
|
|
|
|
|
+ supplierCertId := strings.Split(businessKey, "-")[0]
|
|
|
|
|
+
|
|
|
|
|
+ certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
|
|
+ var supplierCertEntity suppliercert.OilSupplierCert
|
|
|
|
|
+ certSrv.GetEntityById(supplierCertId, &supplierCertEntity)
|
|
|
|
|
|
|
|
|
|
+ var isPayList []string
|
|
|
|
|
+ isPayList = append(isPayList, suppliercert.PINGSHEN)
|
|
|
|
|
+ isPayList = append(isPayList, suppliercert.WAIBUSHICHANG)
|
|
|
|
|
+ var unPayList []string
|
|
|
|
|
+ unPayList = append(unPayList, suppliercert.YIJIWUZI)
|
|
|
|
|
+ unPayList = append(unPayList, suppliercert.ERJIWUZI)
|
|
|
|
|
+ unPayList = append(unPayList, suppliercert.ZHANLUEHEZUO)
|
|
|
|
|
+ unPayList = append(unPayList, suppliercert.NEIBUDUOYUAN)
|
|
|
|
|
+
|
|
|
|
|
+ result := 0
|
|
|
|
|
+ isPay := "false"
|
|
|
|
|
+ unPay := "false"
|
|
|
|
|
+ for _, eachItem := range isPayList{
|
|
|
|
|
+ if eachItem == supplierCertEntity.InStyle {
|
|
|
|
|
+ // 需要付费
|
|
|
|
|
+ isPay = "true"
|
|
|
|
|
+ result = 1
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ for _, eachItem := range unPayList{
|
|
|
|
|
+ if eachItem == supplierCertEntity.InStyle {
|
|
|
|
|
+ // 不需要付费
|
|
|
|
|
+ unPay = "true"
|
|
|
|
|
+ result = 2
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if isPay == unPay{
|
|
|
|
|
+ // 准入类型是否付费有误!请联系管理员
|
|
|
|
|
+ result = 0
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.Data["json"] = result
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// @Title 获取交费人--回调
|
|
|
|
|
+// @Description get user by token
|
|
|
|
|
+// @Success 200 {string} string
|
|
|
|
|
+// @router /pre-payer [get]
|
|
|
|
|
+func (this *OilSupplierCertListenerController) GetPrePayer() {
|
|
|
|
|
+ businessKey := this.GetString("businessKey")
|
|
|
|
|
+ supplierCertId := strings.Split(businessKey, "-")[0]
|
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
var supplierCertEntity suppliercert.OilSupplierCert
|
|
|
certSrv.GetEntityById(supplierCertId, &supplierCertEntity)
|
|
certSrv.GetEntityById(supplierCertId, &supplierCertEntity)
|
|
|
|
|
|
|
|
- this.Data["json"] = "1"
|
|
|
|
|
|
|
+ cols := []string{
|
|
|
|
|
+ "Id",
|
|
|
|
|
+ "Status",
|
|
|
|
|
+ }
|
|
|
|
|
+ //进入此步骤,记录在数据库中
|
|
|
|
|
+ supplierCertEntity.Status = suppliercert.PAYING_AUDIT_STATUS //待缴费
|
|
|
|
|
+ certSrv.UpdateEntityByIdCols(supplierCertId, supplierCertEntity, cols)
|
|
|
|
|
+
|
|
|
|
|
+ //创建人即为交费的人员
|
|
|
|
|
+ approverIds := supplierCertEntity.CommitComId
|
|
|
|
|
+ this.Data["json"] = approverIds
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
|
}
|
|
}
|