|
|
@@ -20,7 +20,7 @@ type TmpzcgfController struct {
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /insertsupplier [get]
|
|
|
-func (this *TmpzcgfController) InsertSupplier(){
|
|
|
+func (this *TmpzcgfController) InsertSupplier() {
|
|
|
fmt.Println("======开始导入OilSupplier表======")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -44,7 +44,7 @@ func (this *TmpzcgfController) InsertSupplier(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /insertsuppliercert [get]
|
|
|
-func (this *TmpzcgfController) InsertSupplierCert(){
|
|
|
+func (this *TmpzcgfController) InsertSupplierCert() {
|
|
|
fmt.Println("=============开始导入Cert表==========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -68,7 +68,7 @@ func (this *TmpzcgfController) InsertSupplierCert(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /updatecerttypeandinflag [get]
|
|
|
-func (this *TmpzcgfController) UpdateCertTypeAndInflag(){
|
|
|
+func (this *TmpzcgfController) UpdateCertTypeAndInflag() {
|
|
|
fmt.Println("=============开始更新Cert==========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -92,7 +92,7 @@ func (this *TmpzcgfController) UpdateCertTypeAndInflag(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /updatesupplierid [get]
|
|
|
-func (this *TmpzcgfController) UpdateSupplierId(){
|
|
|
+func (this *TmpzcgfController) UpdateSupplierId() {
|
|
|
fmt.Println("=============开始更新Cert的SupplierId==========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -135,7 +135,7 @@ func (this *TmpzcgfController) UpdateSupplierId(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /insterannualaudit [get]
|
|
|
-func (this *TmpzcgfController) InsterAnnualAudit(){
|
|
|
+func (this *TmpzcgfController) InsterAnnualAudit() {
|
|
|
fmt.Println("=============开始导入年审表==========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -159,7 +159,7 @@ func (this *TmpzcgfController) InsterAnnualAudit(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /updateAnnualAudit [get]
|
|
|
-func (this *TmpzcgfController) UpdateAnnualAudit(){
|
|
|
+func (this *TmpzcgfController) UpdateAnnualAudit() {
|
|
|
fmt.Println("=============开始更新年审表==========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -204,7 +204,7 @@ func (this *TmpzcgfController) UpdateAnnualAudit(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /updateOilSupplierCertAppend [get]
|
|
|
-func (this *TmpzcgfController) UpdateOilSupplierCertAppend(){
|
|
|
+func (this *TmpzcgfController) UpdateOilSupplierCertAppend() {
|
|
|
fmt.Println("=============开始更新CertAppend==========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -215,7 +215,6 @@ func (this *TmpzcgfController) UpdateOilSupplierCertAppend(){
|
|
|
err := session.Begin()
|
|
|
svc := tmpzcgf.GetTmpzcgtService(session)
|
|
|
|
|
|
-
|
|
|
err = svc.UpOilSupplierCertAppend()
|
|
|
|
|
|
//var appendlist []suppliercertappend.OilSupplierCertAppend
|
|
|
@@ -249,15 +248,13 @@ func (this *TmpzcgfController) UpdateOilSupplierCertAppend(){
|
|
|
elapsed := time.Since(t)
|
|
|
fmt.Println(elapsed)
|
|
|
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// @Title 导入缴费记录
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /insterOilPaymentInfo [get]
|
|
|
-func (this *TmpzcgfController) InsterOilPaymentInfo(){
|
|
|
+func (this *TmpzcgfController) InsterOilPaymentInfo() {
|
|
|
fmt.Println("=============导入交费记录开始==========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -285,7 +282,7 @@ func (this *TmpzcgfController) InsterOilPaymentInfo(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /insterBadRecord [get]
|
|
|
-func (this *TmpzcgfController) InsterBadRecord(){
|
|
|
+func (this *TmpzcgfController) InsterBadRecord() {
|
|
|
fmt.Println("=============导入不良记录开始==========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -338,7 +335,7 @@ func (this *TmpzcgfController) InsterBadRecord(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /insertCertSub [get]
|
|
|
-func (this *TmpzcgfController) InsertCertSub(){
|
|
|
+func (this *TmpzcgfController) InsertCertSub() {
|
|
|
fmt.Println("=============开始导入准入范围==========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -362,7 +359,7 @@ func (this *TmpzcgfController) InsertCertSub(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /updateOilSupplierCertSub [get]
|
|
|
-func (this *TmpzcgfController) UpdateOilSupplierCertSub(){
|
|
|
+func (this *TmpzcgfController) UpdateOilSupplierCertSub() {
|
|
|
fmt.Println("=============开始更新准入范围==========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -375,7 +372,7 @@ func (this *TmpzcgfController) UpdateOilSupplierCertSub(){
|
|
|
var supplierlist []supplier.OilSupplier
|
|
|
where := "CreateBy='导入'"
|
|
|
svc.GetEntities(&supplierlist, where)
|
|
|
- for _,item := range supplierlist {
|
|
|
+ for _, item := range supplierlist {
|
|
|
where := "where b.Type = '1' and b.CreateBy='导入1' and b.Remark = '" + item.SupplierName + "'"
|
|
|
err = svc.UpdateCertSub(where)
|
|
|
if err != nil {
|
|
|
@@ -392,7 +389,7 @@ func (this *TmpzcgfController) UpdateOilSupplierCertSub(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /updateCertSubclassID [get]
|
|
|
-func (this *TmpzcgfController) UpdateCertSubclassID(){
|
|
|
+func (this *TmpzcgfController) UpdateCertSubclassID() {
|
|
|
fmt.Println("=============开始更新编码ID==========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -405,7 +402,7 @@ func (this *TmpzcgfController) UpdateCertSubclassID(){
|
|
|
var supplierlist []supplier.OilSupplier
|
|
|
where := "CreateBy='导入'"
|
|
|
svc.GetEntities(&supplierlist, where)
|
|
|
- for _,item := range supplierlist {
|
|
|
+ for _, item := range supplierlist {
|
|
|
where := " and b.Type = '1' and b.CreateBy='导入1' and b.Remark = '" + item.SupplierName + "'"
|
|
|
err = svc.UpdateCertSub01classId(where)
|
|
|
if err != nil {
|
|
|
@@ -429,15 +426,13 @@ func (this *TmpzcgfController) UpdateCertSubclassID(){
|
|
|
elapsed := time.Since(t)
|
|
|
fmt.Println(elapsed)
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// @Title 导入增项申请
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /insertOilSupplierCertAppend [get]
|
|
|
-func (this *TmpzcgfController) InsertOilSupplierCertAppend(){
|
|
|
+func (this *TmpzcgfController) InsertOilSupplierCertAppend() {
|
|
|
fmt.Println("==========导入增项申请开始=========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -461,7 +456,7 @@ func (this *TmpzcgfController) InsertOilSupplierCertAppend(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /insertOilInfoChange [get]
|
|
|
-func (this *TmpzcgfController) InsertOilInfoChange(){
|
|
|
+func (this *TmpzcgfController) InsertOilInfoChange() {
|
|
|
fmt.Println("==========导入信息变更开始=========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -485,7 +480,7 @@ func (this *TmpzcgfController) InsertOilInfoChange(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /insertOilSupplierCertSub [get]
|
|
|
-func (this *TmpzcgfController) InsertOilSupplierCertSub(){
|
|
|
+func (this *TmpzcgfController) InsertOilSupplierCertSub() {
|
|
|
fmt.Println("==========导入增项的准入范围开始=========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -509,7 +504,7 @@ func (this *TmpzcgfController) InsertOilSupplierCertSub(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /updateOilInfoChange [get]
|
|
|
-func (this *TmpzcgfController) UpdateOilInfoChange(){
|
|
|
+func (this *TmpzcgfController) UpdateOilInfoChange() {
|
|
|
fmt.Println("==========更新信息变更开始=========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -533,7 +528,7 @@ func (this *TmpzcgfController) UpdateOilInfoChange(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /updateCertSubIsType1 [get]
|
|
|
-func (this *TmpzcgfController) UpdateCertSubIsType1(){
|
|
|
+func (this *TmpzcgfController) UpdateCertSubIsType1() {
|
|
|
fmt.Println("==========更新增项的准入范围=========")
|
|
|
t := time.Now()
|
|
|
session := utils.DBE.NewSession()
|
|
|
@@ -543,12 +538,11 @@ func (this *TmpzcgfController) UpdateCertSubIsType1(){
|
|
|
}()
|
|
|
err := session.Begin()
|
|
|
|
|
|
-
|
|
|
var supplierlist []supplier.OilSupplier
|
|
|
where := "CreateBy='导入'"
|
|
|
svc := tmpzcgf.GetTmpzcgtService(session)
|
|
|
svc.GetEntities(&supplierlist, where)
|
|
|
- for _,item := range supplierlist {
|
|
|
+ for _, item := range supplierlist {
|
|
|
fmt.Println(item.SupplierName)
|
|
|
where := "where b.Type = '3' and b.ModifiedBy = '" + item.SupplierName + "'"
|
|
|
err = svc.UpdateCertSubIsType2(where)
|
|
|
@@ -558,7 +552,6 @@ func (this *TmpzcgfController) UpdateCertSubIsType1(){
|
|
|
err = session.Commit()
|
|
|
}
|
|
|
|
|
|
-
|
|
|
fmt.Println(err)
|
|
|
elapsed := time.Since(t)
|
|
|
fmt.Println(elapsed)
|
|
|
@@ -568,7 +561,7 @@ func (this *TmpzcgfController) UpdateCertSubIsType1(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /updateCertSubIsType3 [get]
|
|
|
-func (this *TmpzcgfController) UpdateCertSubIsType3(){
|
|
|
+func (this *TmpzcgfController) UpdateCertSubIsType3() {
|
|
|
fmt.Println("==========更新增项的准入范围=========")
|
|
|
t := time.Now()
|
|
|
svc := tmpzcgf.GetTmpzcgfService1(utils.DBE)
|
|
|
@@ -584,7 +577,7 @@ func (this *TmpzcgfController) UpdateCertSubIsType3(){
|
|
|
// @Description get user by token
|
|
|
// @Success 200 {object}
|
|
|
// @router /cleattmpdata [get]
|
|
|
-func (this *TmpzcgfController) ClearTmpData(){
|
|
|
+func (this *TmpzcgfController) ClearTmpData() {
|
|
|
fmt.Println("==========清空临时数据=========")
|
|
|
t := time.Now()
|
|
|
svc := tmpzcgf.GetTmpzcgfService1(utils.DBE)
|
|
|
@@ -614,3 +607,32 @@ func (this *TmpzcgfController) ClearTmpData(){
|
|
|
fmt.Println(elapsed)
|
|
|
fmt.Println("==========结束=========")
|
|
|
}
|
|
|
+
|
|
|
+// @Title 跟新
|
|
|
+// @Description get user by token
|
|
|
+// @Success 200 {object}
|
|
|
+// @router /delBadRecord [get]
|
|
|
+func (this *TmpzcgfController) DelBadRecord() {
|
|
|
+ fmt.Println("==========删除多余的不良记录=========")
|
|
|
+ t := time.Now()
|
|
|
+ session := utils.DBE.NewSession()
|
|
|
+ defer func() {
|
|
|
+ fmt.Println("==========删除多余的不良记录=========")
|
|
|
+ session.Close()
|
|
|
+ }()
|
|
|
+ err := session.Begin()
|
|
|
+
|
|
|
+ svc := tmpzcgf.GetTmpzcgtService(session)
|
|
|
+ where := "CompanyName is null"
|
|
|
+ err = svc.DeleteEntityBytbl(BaseBadRecord, where)
|
|
|
+
|
|
|
+ if err != nil {
|
|
|
+ session.Rollback()
|
|
|
+ } else {
|
|
|
+ err = session.Commit()
|
|
|
+ }
|
|
|
+
|
|
|
+ fmt.Println(err)
|
|
|
+ elapsed := time.Since(t)
|
|
|
+ fmt.Println(elapsed)
|
|
|
+}
|