Browse Source

缴费确认之后,年审增项的变更

huahaiyan 6 years ago
parent
commit
5bd870f1e8

+ 4 - 4
src/dashoo.cn/backend/api/controllers/oilsupplier/annualaudit.go

@@ -897,13 +897,13 @@ func (this *AnnualAuditController) AnnualAudit() {
 			//aplydatechange := oldaplydate.Format("2006-01-02")
 			//local, _ := time.LoadLocation("Local")
 			//oldtimeaply, _ := time.ParseInLocation("2006-01-02", aplydatechange, local)
-			auditmodel.ApplyTime = oldaplydate.AddDate(1, 0, 0)
+			//auditmodel.ApplyTime = oldaplydate.AddDate(1, 0, 0)
 			var certmodel suppliercert.OilSupplierCert
-			certmodel.ApplyTime = oldaplydate.AddDate(1, 0, 0)
+			//certmodel.ApplyTime = oldaplydate.AddDate(1, 0, 0)
 			certmodel.AuditDate = time.Now()
 			certcols := []string{
 				"Id",
-				"ApplyTime",
+				//"ApplyTime",
 				"AuditDate",
 			}
 			svc.UpdateEntityByIdCols(list.CerId, certmodel, certcols)
@@ -953,7 +953,7 @@ func (this *AnnualAuditController) AnnualAudit() {
 				"Id",
 				"Status",
 				"Step",
-				"ApplyTime",
+				//"ApplyTime",
 			}
 			svc.UpdateEntityByIdCols(dataother.AnnualId, auditmodel, cols)
 

+ 36 - 3
src/dashoo.cn/backend/api/controllers/oilsupplier/paymentinfo.go

@@ -1,7 +1,11 @@
 package oilsupplier
 
 import (
+	"dashoo.cn/backend/api/business/oilsupplier/annualaudit"
 	"dashoo.cn/backend/api/business/oilsupplier/paymentbankinfo"
+	"dashoo.cn/backend/api/business/oilsupplier/suppliercertappend"
+	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
+	"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
 	"dashoo.cn/backend/api/business/register"
 	"encoding/json"
 	"strconv"
@@ -373,10 +377,39 @@ func (this *PaymentInfoController) ReceiveMoneyBillList() {
 
 		} else if payItem.PayType == "2" {//年审
 			//TODO: 修改年审时间
-
+			annuasvc := annualaudit.GetOilAnnualAuditService(utils.DBE)
+			var annualentities  []annualaudit.OilAnnualAudit
+			annwhere := " SupplierId = " + utils.ToStr(payItem.SupplierId)+ " and CerId = "+utils.ToStr(payItem.SupplierCertId) +" and Status = '6'"
+			svc.GetEntitysByWhere(OilAnnualAuditName, annwhere, &annualentities)
+			if len(annualentities) >0 {
+				//更新年审表时间
+				var annmodel  annualaudit.OilAnnualAudit
+				annmodel.Status = suppliercert.ALL_PASE_STATUS
+				annmodel.ApplyTime = annualentities[0].ApplyTime.AddDate(1, 0, 0)
+				annuasvc.UpdateEntityBywheretbl(OilAnnualAuditName,&annmodel,[]string{"ApplyTime", "Status"},annwhere)
+				//更新准入表时间
+				var certmodel suppliercert.OilSupplierCert
+				certmodel.ApplyTime = annualentities[0].ApplyTime.AddDate(1, 0, 0)
+				svc.UpdateEntityByIdCols(strconv.Itoa(payItem.SupplierCertId), &certmodel, []string{"ApplyTime"})
+			}
 		} else if payItem.PayType == "3" {//增项
-
-		}
+			appsvc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
+			//更新准入项表
+			appendwhere := " SupplierId = " + utils.ToStr(payItem.SupplierId)+ " and SupplierCertId = "+utils.ToStr(payItem.SupplierCertId)+" and Type = '2'"
+			var appendsubmodel suppliercertsub.OilSupplierCertSub
+			appendsubmodel.Type = "3"
+			appsvc.UpdateEntityBywheretbl(OilSupplierCertSubName, &appendsubmodel, []string{"Type"}, appendwhere)
+			//更新资质表
+			appendfilewhere := " SupplierId = " + utils.ToStr(payItem.SupplierId)+" and SupType = 2"
+			var appendsubfilemodel supplierfile.OilSupplierFile
+			appendsubfilemodel.SupType = 3
+			appsvc.UpdateEntityBywheretbl(OilSupplierCertSubName, &appendsubfilemodel, []string{"SupType"}, appendfilewhere)
+			//更新增项表
+			appdwhere := " SupplierId = " + utils.ToStr(payItem.SupplierId)+ " and SupplierCertId = "+utils.ToStr(payItem.SupplierCertId)+" and Status = '6'"
+			var appendmodel suppliercertappend.OilSupplierCertAppend
+			appendmodel.Status = suppliercert.ALL_PASE_STATUS
+			appsvc.UpdateEntityBywheretbl(OilSupplierCertAppendName,&appendmodel,[]string{"Status"},appdwhere)
+			}
 	}
 	//记录对账日志
 	paymentBankInfo := new(paymentbankinfo.OilPaymentBankInfo)

+ 1 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertappendsub.go

@@ -367,6 +367,7 @@ func (this *OilSupplierCertAppendSubController) AddGoodsBus() {
 		has := svc.GetEntityByWhere(OilSupplierCertSubName, where_sub, &model)
 
 		if !has {
+
 			datamain.SubClassId, _ = utils.StrTo(dataother.CheckList[n].Id).Int()
 			datamain.Code = dataother.CheckList[n].Code
 			datamain.Name = dataother.CheckList[n].Name

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/basislist.vue

@@ -299,7 +299,7 @@
 
       addappendcom() {
         let _this = this
-        _this.$confirm("确定添加变更申请, 是否继续?", "提示", {
+        _this.$confirm("确定添加增项申请, 是否继续?", "提示", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning"

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/goodslist.vue

@@ -301,7 +301,7 @@
 
       addappendcom() {
         let _this = this
-        _this.$confirm("确定添加变更申请, 是否继续?", "提示", {
+        _this.$confirm("确定添加增项申请, 是否继续?", "提示", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning"

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/techlist.vue

@@ -300,7 +300,7 @@
 
       addappendcom() {
         let _this = this
-        _this.$confirm("确定添加变更申请, 是否继续?", "提示", {
+        _this.$confirm("确定添加增项申请, 是否继续?", "提示", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning"