|
|
@@ -4,6 +4,7 @@ import (
|
|
|
msg2 "dashoo.cn/backend/api/business/msg"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/oilcostmanage"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/supplier"
|
|
|
+ "dashoo.cn/backend/api/business/oilsupplier/suppliercertappendsub"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
|
|
|
"dashoo.cn/backend/api/business/paymentinfo"
|
|
|
@@ -208,6 +209,13 @@ func (this *OilSupplierCertAppendListenerController) CheckNeedPay() {
|
|
|
// 准入类型是否付费有误!请联系管理员
|
|
|
result = 0
|
|
|
}
|
|
|
+ var paymentInfoEntity paymentinfo.OilPaymentInfo
|
|
|
+ s := paymentinfo.GetPaymentService(utils.DBE)
|
|
|
+ where := " isPay='2' and SrcId='" + supplierCertAppendId + "' and SupplierCertId='" + strconv.Itoa(supplierCertAppendEntity.SupplierCertId) + "'"
|
|
|
+ s.GetEntityByWhere("OilPaymentInfo", where, &paymentInfoEntity)
|
|
|
+ if paymentInfoEntity.Id > 0 {
|
|
|
+ result = 2 // 已交费, 不再需要交费
|
|
|
+ }
|
|
|
|
|
|
this.Data["json"] = result
|
|
|
this.ServeJSON()
|
|
|
@@ -325,41 +333,41 @@ func (this *OilSupplierCertAppendListenerController) WorkflowEndAudit() {
|
|
|
certAppendSrv.UpdateEntityBywheretbl(OilSupplierCertSubName, &appendSubFileModel, []string{"SupType"}, appendFileWhere)
|
|
|
|
|
|
//更新增项表 TODO 更新相关信息
|
|
|
- //appdWhere := " SupplierId = " + utils.ToStr(supplierCertAppendEntity.SupplierId) + " and SupplierCertId = " + utils.ToStr(supplierCertAppendEntity.SupplierCertId) + " and Status = '6'"
|
|
|
- //var appendModel suppliercertappend.OilSupplierCertAppend
|
|
|
- //appendModel.Status = suppliercert.ALL_PASE_STATUS
|
|
|
- //certAppendSrv.UpdateEntityBywheretbl(OilSupplierCertAppendName, &appendModel, []string{"Status"}, appdWhere)
|
|
|
- // 信息变更 TODO 更新相关信息
|
|
|
- //var infoItems []suppliercertappendsub.OilAppendChangeItem
|
|
|
- //where := "SupplierId = " + utils.ToStr(supplierCertAppendEntity.SupplierId) + " and InfoId = " + utils.ToStr(supplierCertAppendId)
|
|
|
- //certAppendSrv.GetEntities(&infoItems, where)
|
|
|
- //var _ error
|
|
|
- //if len(infoItems) > 0 {
|
|
|
- // for i := 0; i < len(infoItems); i++ {
|
|
|
- // where := " Id = " + utils.ToStr(supplierCertAppendEntity.SupplierId)
|
|
|
- // var sql string
|
|
|
- // if infoItems[i].SelectItem == "SetupTime" {
|
|
|
- // sql = `UPDATE ` + OilSupplierName + ` set ` + infoItems[i].SelectItem + ` = '` + infoItems[i].ChangeInfo[0:10] + `' where ` + where
|
|
|
- // } else {
|
|
|
- // sql = `UPDATE ` + OilSupplierName + ` set ` + infoItems[i].SelectItem + ` = '` + infoItems[i].ChangeInfo + `' where ` + where
|
|
|
- // }
|
|
|
- // _, _ = certAppendSrv.DBE.Exec(sql)
|
|
|
- // }
|
|
|
- //}
|
|
|
+ appdWhere := " SupplierId = " + utils.ToStr(supplierCertAppendEntity.SupplierId) + " and SupplierCertId = " + utils.ToStr(supplierCertAppendEntity.SupplierCertId) + " and Status = '6'"
|
|
|
+ var appendModel suppliercertappend.OilSupplierCertAppend
|
|
|
+ appendModel.Status = suppliercert.ALL_PASE_STATUS
|
|
|
+ certAppendSrv.UpdateEntityBywheretbl(OilSupplierCertAppendName, &appendModel, []string{"Status"}, appdWhere)
|
|
|
+ //信息变更 TODO 更新相关信息
|
|
|
+ var infoItems []suppliercertappendsub.OilAppendChangeItem
|
|
|
+ where := "SupplierId = " + utils.ToStr(supplierCertAppendEntity.SupplierId) + " and InfoId = " + utils.ToStr(supplierCertAppendId)
|
|
|
+ certAppendSrv.GetEntities(&infoItems, where)
|
|
|
+ var _ error
|
|
|
+ if len(infoItems) > 0 {
|
|
|
+ for i := 0; i < len(infoItems); i++ {
|
|
|
+ where := " Id = " + utils.ToStr(supplierCertAppendEntity.SupplierId)
|
|
|
+ var sql string
|
|
|
+ if infoItems[i].SelectItem == "SetupTime" {
|
|
|
+ sql = `UPDATE ` + OilSupplierName + ` set ` + infoItems[i].SelectItem + ` = '` + infoItems[i].ChangeInfo[0:10] + `' where ` + where
|
|
|
+ } else {
|
|
|
+ sql = `UPDATE ` + OilSupplierName + ` set ` + infoItems[i].SelectItem + ` = '` + infoItems[i].ChangeInfo + `' where ` + where
|
|
|
+ }
|
|
|
+ _, _ = certAppendSrv.DBE.Exec(sql)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 更新资质 TODO 更新相关信息
|
|
|
- //var qualDetail []suppliercertappendsub.OilAppendChangeDetail
|
|
|
- //wheres := "SupplierId = " + utils.ToStr(supplierCertAppendEntity.SupplierId) + " and ParentId=" + supplierCertAppendId
|
|
|
- //certAppendSrv.GetEntities(&qualDetail, wheres)
|
|
|
- //if len(qualDetail) > 0 {
|
|
|
- // for i := 0; i < len(qualDetail); i++ {
|
|
|
- // var supFileModel supplierfile.OilSupplierFile
|
|
|
- // supFileModel.FileName = qualDetail[i].FileName
|
|
|
- // supFileModel.FileUrl = qualDetail[i].FileUrl
|
|
|
- // supFileModel.EffectDate = qualDetail[i].EffectDate
|
|
|
- // certAppendSrv.UpdateEntityBytbl(OilSupplierFileName, qualDetail[i].FileId, &supFileModel, []string{"FileName", "FileUrl", "EffectDate"})
|
|
|
- // }
|
|
|
- //}
|
|
|
+ var qualDetail []suppliercertappendsub.OilAppendChangeDetail
|
|
|
+ wheres := "SupplierId = " + utils.ToStr(supplierCertAppendEntity.SupplierId) + " and ParentId=" + supplierCertAppendId
|
|
|
+ certAppendSrv.GetEntities(&qualDetail, wheres)
|
|
|
+ if len(qualDetail) > 0 {
|
|
|
+ for i := 0; i < len(qualDetail); i++ {
|
|
|
+ var supFileModel supplierfile.OilSupplierFile
|
|
|
+ supFileModel.FileName = qualDetail[i].FileName
|
|
|
+ supFileModel.FileUrl = qualDetail[i].FileUrl
|
|
|
+ supFileModel.EffectDate = qualDetail[i].EffectDate
|
|
|
+ certAppendSrv.UpdateEntityBytbl(OilSupplierFileName, qualDetail[i].FileId, &supFileModel, []string{"FileName", "FileUrl", "EffectDate"})
|
|
|
+ }
|
|
|
+ }
|
|
|
this.Data["json"] = 1
|
|
|
this.ServeJSON()
|
|
|
}
|