lining 6 ani în urmă
părinte
comite
4130b0aecc

+ 29 - 0
src/dashoo.cn/backend/api/business/tmpzcgf/tmpzcgfService.go

@@ -0,0 +1,29 @@
+package tmpzcgf
+
+import (
+	. "dashoo.cn/backend/api/mydb"
+	. "dashoo.cn/utils/db"
+	"github.com/go-xorm/xorm"
+
+)
+
+type TmpzcgfService1 struct {
+	MyServiceBase
+}
+
+func GetTmpzcgfService1(xormEngine *xorm.Engine) *TmpzcgfService1 {
+	s := new(TmpzcgfService1)
+	s.DBE = xormEngine
+	return s
+}
+
+func (s *TmpzcgfService1) UpdateCertSubIsType3 () error {
+	sql := "UPDATE OilSupplierCertSub b SET "+
+		"b.SupplierId = (SELECT a.`SupplierId` FROM OilSupplierCertAppend a WHERE a.`OldId` = b.OldId AND a.AppendType = b.SupplierTypeCode AND a.ApplyDate = b.CreateOn ), "+
+		"b.SupplierCertId = (SELECT a.`SupplierCertId` FROM OilSupplierCertAppend a WHERE a.`OldId` = b.OldId AND a.AppendType = b.SupplierTypeCode AND a.ApplyDate = b.CreateOn ), "+
+		"b.SupplierCertAppendId = (SELECT a.`Id` FROM OilSupplierCertAppend a WHERE a.`OldId` = b.OldId AND a.AppendType = b.SupplierTypeCode AND a.ApplyDate = b.CreateOn ) "+
+		"where b.Type='3'"
+	_, err := s.DBE.Query(sql)
+	LogError(err)
+	return err
+}

+ 2 - 2
src/dashoo.cn/backend/api/business/tmpzcgf/tmpzcgfSession.go

@@ -300,7 +300,7 @@ func (s *TmpzcgtSession) InsertOilSupplierCertAppend() error {
 	"(Status,CreateOn,SupplierName,AppendType,CreateBy,ApplyDate,OldId) " +
 	"SELECT '11' as Status, a.`申请日期` AS CreateOn, a.`企业名称` AS SupplierName, (CASE 准入类别 WHEN '物资类' THEN '01' WHEN '基建类' THEN '02' WHEN '技术服务类' THEN '03' END) AppendType, "+
 		"'导入' AS CreateBy,a.`申请日期` AS ApplyDate, MAX(a.id) AS OldId "+
-	"FROM tmp_zengxiang a GROUP BY a.`申请日期`, a.`企业名称`, a.`准入类别`"
+	"FROM tmp_zengxiang a WHERE 企业名称 != '' GROUP BY a.`申请日期`, a.`企业名称`, a.`准入类别`"
 	_, err := s.Session.Query(sql)
 	return err
 }
@@ -352,4 +352,4 @@ func (s *TmpzcgtSession) UpdateCertSubIsType2 (where string) error {
 	where
 	_, err := s.Session.Query(sql)
 	return err
-}
+}

+ 16 - 0
src/dashoo.cn/backend/api/controllers/tmpzcgf/tmpzcgf.go

@@ -559,4 +559,20 @@ func (this *TmpzcgfController) UpdateCertSubIsType1(){
 	fmt.Println(err)
 	elapsed := time.Since(t)
 	fmt.Println(elapsed)
+}
+
+// @Title g更新
+// @Description get user by token
+// @Success 200 {object}
+// @router /updateCertSubIsType3 [get]
+func (this *TmpzcgfController) UpdateCertSubIsType3(){
+	fmt.Println("==========更新增项的准入范围=========")
+	t := time.Now()
+	svc := tmpzcgf.GetTmpzcgfService1(utils.DBE)
+	err := svc.UpdateCertSubIsType3()
+
+	fmt.Println(err)
+	elapsed := time.Since(t)
+	fmt.Println(elapsed)
+	fmt.Println("==========更新增项的准入范围结束=========")
 }

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstorage/index.vue

@@ -872,7 +872,7 @@
         }
         let myCreateOn = []
         // 解析时间
-        if (this.CreateOn.length == 2) {
+        if (this.CreateOn && this.CreateOn.length == 2) {
           this.CreateOn[1].setHours(23)
           this.CreateOn[1].setMinutes(59)
           this.CreateOn[1].setSeconds(59)

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstore/index.vue

@@ -870,7 +870,7 @@
         }
         let myCreateOn = []
         // 解析时间
-        if (this.CreateOn.length == 2) {
+        if (this.CreateOn && this.CreateOn.length == 2) {
           this.CreateOn[1].setHours(23)
           this.CreateOn[1].setMinutes(59)
           this.CreateOn[1].setSeconds(59)

+ 83 - 18
src/dashoo.cn/frontend_web/src/pages/system/tmpzcgf.vue

@@ -13,25 +13,76 @@
           <!--<el-button size="mini" type="primary" style="margin-left:10px; margin-top: -4px;" @click="opendatadialog(1,null,-1);resetForm('organizeform')">新增用户</el-button>-->
         </span>
       </div>
-       <el-button size="mini" type="primary" @click="insertsuppler" v-loading.fullscreen.lock="fullscreenLoading">导入OilSuppler</el-button>
-       <el-button size="mini" type="primary" @click="insertSupplerCert" v-loading.fullscreen.lock="fullscreenLoading">导入OilSupplerCert</el-button>
-       <el-button size="mini" type="primary" @click="updateSupplerCert" v-loading.fullscreen.lock="fullscreenLoading">更新SupplierTypeCodeAndInFlag</el-button>
-       <el-button size="mini" type="primary" @click="updateSupplerId" v-loading.fullscreen.lock="fullscreenLoading">更新Cert表的SupplierID</el-button>
-       <!--<el-button size="mini" type="primary" @click="insertSupplerCertSub" v-loading.fullscreen.lock="fullscreenLoading">导入OilSupplierCertSub表</el-button>-->
-       <el-button size="mini" type="primary" @click="insertCertSub" v-loading.fullscreen.lock="fullscreenLoading">导入CertSub表</el-button>
-       <el-button size="mini" type="primary" @click="updateCertSub" v-loading.fullscreen.lock="fullscreenLoading">更新CertSub表</el-button>
-       <!--<el-button size="mini" type="primary" @click="updateCertSubclassID" v-loading.fullscreen.lock="fullscreenLoading">更新CertSub表的编码ID</el-button>-->
+       <el-row style ="margin-bottom: 20px;">
+         <el-col :span="4">
+           <el-button size="mini" type="primary" @click="insertsuppler" v-loading.fullscreen.lock="fullscreenLoading">导入OilSuppler</el-button>
+         </el-col>
+         <el-col :span="4">
+           <el-button size="mini" type="primary" @click="insertsuppler" v-loading.fullscreen.lock="fullscreenLoading">导入OilSuppler</el-button>
+         </el-col>
+         <el-col :span="4">
+           <el-button size="mini" type="primary" @click="insertSupplerCert" v-loading.fullscreen.lock="fullscreenLoading">导入OilSupplerCert</el-button>
+         </el-col>
+         <el-col :span="4">
+           <el-button size="mini" type="primary" @click="updateSupplerCert" v-loading.fullscreen.lock="fullscreenLoading">更新SupplierTypeCodeAndInFlag</el-button>
+         </el-col>
+         <el-col :span="4">
+           <el-button size="mini" type="primary" @click="updateSupplerId" v-loading.fullscreen.lock="fullscreenLoading">更新Cert表的SupplierID</el-button>
+         </el-col>
+       </el-row>
+
+       <el-row style ="margin-bottom: 20px;">
+         <el-col :span="6">
+           <el-button size="mini" type="primary" @click="insertCertSub" v-loading.fullscreen.lock="fullscreenLoading">导入CertSub表</el-button>
+           <el-button size="mini" type="primary" @click="updateCertSub" v-loading.fullscreen.lock="fullscreenLoading">更新CertSub表</el-button>
+         </el-col>
+         <el-col :span="6">
+         </el-col>
+       </el-row>
+
+       <el-row style ="margin-bottom: 20px;">
+         <el-col :span="4">
+           <el-button size="mini" type="primary" @click="insertOilSupplierCertAppend" v-loading.fullscreen.lock="fullscreenLoading">导入增项申请</el-button>
+         </el-col>
+         <el-col :span="4">
+           <el-button size="mini" type="primary" @click="updateOilSupplierCertAppend" v-loading.fullscreen.lock="fullscreenLoading">跟新OilSupplierCertAppend表的SupplierId和CerId</el-button>
+         </el-col>
+         <el-col :span="4">
+           <el-button size="mini" type="primary" @click="insertOilSupplierCertSub" v-loading.fullscreen.lock="fullscreenLoading">导入增项的准入范围</el-button>
+         </el-col>
+         <el-col :span="4">
+           <el-button size="mini" type="primary" @click="updateCertAppendIsType2" v-loading.fullscreen.lock="fullscreenLoading">更新增项准入范围</el-button>
+         </el-col>
+         <el-col :span="4">
+           <el-button size="mini" type="primary" @click="updateCertAppendIsType3" v-loading.fullscreen.lock="fullscreenLoading">更新增项准入范围2</el-button>
+         </el-col>
+       </el-row>
+
+       <el-row style ="margin-bottom: 20px;">
+         <el-col :span="6">
+           <el-button size="mini" type="primary" @click="insterAnnualAudit" v-loading.fullscreen.lock="fullscreenLoading">导入年审表</el-button>
+           <el-button size="mini" type="primary" @click="updateAnnualAudit" v-loading.fullscreen.lock="fullscreenLoading">跟新年审表的SupplierId和CerId</el-button>
+         </el-col>
+         <el-col :span="6">
+         </el-col>
+       </el-row>
+
+
+       <el-row style ="margin-bottom: 20px;">
+         <el-col :span="6">
+           <el-button size="mini" type="primary" @click="insterOilPaymentInfo" v-loading.fullscreen.lock="fullscreenLoading">导入缴费记录并更新</el-button>
+         </el-col>
+         <el-col :span="6">
+           <el-button size="mini" type="primary" @click="insterBadRecord" v-loading.fullscreen.lock="fullscreenLoading">导入不良记录并更新</el-button>
+         </el-col>
+         <el-col :span="6">
+           <el-button size="mini" type="primary" @click="insertOilInfoChange" v-loading.fullscreen.lock="fullscreenLoading">导入信息变更</el-button>
+         </el-col>
+         <el-col :span="6">
+           <el-button size="mini" type="primary" @click="updateOilInfoChange" v-loading.fullscreen.lock="fullscreenLoading">更新新信息变更</el-button>
+         </el-col>
+       </el-row>
 
-       <el-button size="mini" type="primary" @click="insterAnnualAudit" v-loading.fullscreen.lock="fullscreenLoading">导入年审表</el-button>
-       <el-button size="mini" type="primary" @click="updateAnnualAudit" v-loading.fullscreen.lock="fullscreenLoading">跟新年审表的SupplierId和CerId</el-button>
-       <el-button size="mini" type="primary" @click="insertOilSupplierCertAppend" v-loading.fullscreen.lock="fullscreenLoading">导入增项申请</el-button>
-       <el-button size="mini" type="primary" @click="updateOilSupplierCertAppend" v-loading.fullscreen.lock="fullscreenLoading">跟新OilSupplierCertAppend表的SupplierId和CerId</el-button>
-       <el-button size="mini" type="primary" @click="insertOilSupplierCertSub" v-loading.fullscreen.lock="fullscreenLoading">导入增项的准入范围</el-button>
-       <el-button size="mini" type="primary" @click="updateCertAppendIsType2" v-loading.fullscreen.lock="fullscreenLoading">更新增项准入范围</el-button>
-       <el-button size="mini" type="primary" @click="insterOilPaymentInfo" v-loading.fullscreen.lock="fullscreenLoading">导入缴费记录并更新</el-button>
-       <el-button size="mini" type="primary" @click="insterBadRecord" v-loading.fullscreen.lock="fullscreenLoading">导入不良记录并更新</el-button>
-       <el-button size="mini" type="primary" @click="insertOilInfoChange" v-loading.fullscreen.lock="fullscreenLoading">导入信息变更</el-button>
-       <el-button size="mini" type="primary" @click="updateOilInfoChange" v-loading.fullscreen.lock="fullscreenLoading">跟新信息变更</el-button>
        <!--<el-button size="mini" type="primary" @click="insertCertSub" v-loading.fullscreen.lock="fullscreenLoading">导入准入范围</el-button>-->
     </el-card>
     <el-card class="box-card">
@@ -310,6 +361,20 @@
               })
           })
       },
+      updateCertAppendIsType3 () {
+        this.$confirm('是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            this.fullscreenLoading = true
+            this.$axios.get('tmpzcgf/updateCertSubIsType3')
+              .then(res => {
+                this.fullscreenLoading = false
+              })
+          })
+      }
     }
   }
 </script>