Selaa lähdekoodia

hse成绩乜有不让提交;加个开关

wd 4 vuotta sitten
vanhempi
commit
1a73c9e0d5

+ 16 - 0
src/dashoo.cn/backend/api/business/oilsupplier/suppliercert/oilsuppliercertService.go

@@ -3,6 +3,7 @@ package suppliercert
 import (
 	"dashoo.cn/backend/api/business/auditsetting"
 	"dashoo.cn/backend/api/business/oilsupplier/classorgsetting"
+	"dashoo.cn/backend/api/business/oilsupplier/hsescore"
 	"dashoo.cn/backend/api/business/oilsupplier/supplier"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertappendsub"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
@@ -336,5 +337,20 @@ func (s *OilSupplierCertService) IsSupplierCertCanSubmit(supplierId, supplierCer
 	if needBiddingBook && !hasBiddingBook {
 		panic("招标准入需提供招标中标结果 !")
 	}
+
+	// hse成绩
+	// 开关
+	isHse := paramSvc.GetBaseparameterMessage("GFGL1", "paramset", "isHse")
+	if isHse == "true" {
+		if (supplierCertEntity.SupplierTypeCode == "03" && strings.Contains(companyHasHeaders, "安全资质审查,")) || supplierCertEntity.SupplierTypeCode == "02" {
+			var hseList []hsescore.HSEScore
+			svcHse := hsescore.GetHSEScoreService(utils.DBE) //获得数据库引擎
+			svcHse.GetEntitysByWhere("HSEScore", "SupplierId = " + strconv.Itoa(supplierEntity.Id), &hseList)
+			if len(hseList) < 3 {
+				panic("缺少HSE成绩不允许提交流程 !")
+			}
+		}
+	}
+
 	return true
 }

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

@@ -302,7 +302,6 @@ func (this *HSEScoreController) ImportExcel() {
 		hse.EndTime = hseTime.EndTime
 		hse.ApplyTime = hseTime.ApplyTime
 		hse.StartTime = hseTime.StartTime
-		hse.SupplierId = supplier.Id
 		hse.TestNumber= sheet.Rows[i].Cells[2].String()
 		hse.SupplierId = supplier.Id
 		hse.Name = sheet.Rows[i].Cells[3].String()

+ 38 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

@@ -3272,6 +3272,24 @@ func (this *OilSupplierController) CheckSupplierFile() {
 				return
 			}
 		}
+
+		// hse成绩
+		// 开关
+		isHse := paramSvc.GetBaseparameterMessage("GFGL1", "paramset", "isHse")
+		if isHse == "true" {
+			if (cert.SupplierTypeCode == "03" && strings.Contains(companyHasHeaders, "安全资质审查,")) || cert.SupplierTypeCode == "02" {
+				var hseList []hsescore.HSEScore
+				svcHse := hsescore.GetHSEScoreService(utils.DBE) //获得数据库引擎
+				svcHse.GetEntitysByWhere(HSEScoreName, "SupplierId = " + strconv.Itoa(file.SupplierId), &hseList)
+				if len(hseList) < 3 {
+					errinfo.Message = "缺少HSE成绩不允许提交流程"
+					errinfo.Code = 0
+					this.Data["json"] = &errinfo
+					this.ServeJSON()
+					return
+				}
+			}
+		}
 	}
 
 	errinfo.Code = 1
@@ -3279,7 +3297,7 @@ func (this *OilSupplierController) CheckSupplierFile() {
 	this.ServeJSON()
 }
 
-// @Title 准入/增项/年审/已入库保存检查资质方法
+// @Title 增项/年审/已入库保存检查资质方法
 // @Description
 // @Success	200	{object} controllers.Request
 // @router /checkSupplierFileNew [post]
@@ -3464,6 +3482,25 @@ func (this *OilSupplierController) CheckSupplierFileNew() {
 			}
 		}
 	}
+
+	// hse成绩
+	// 开关
+	isHse := paramSvc.GetBaseparameterMessage("GFGL1", "paramset", "isHse")
+	if isHse == "true" {
+		if (cert.SupplierTypeCode == "03" && strings.Contains(companyHasHeaders, "安全资质审查,")) || cert.SupplierTypeCode == "02" {
+			var hseList []hsescore.HSEScore
+			svcHse := hsescore.GetHSEScoreService(utils.DBE) //获得数据库引擎
+			svcHse.GetEntitysByWhere(HSEScoreName, "SupplierId = " + strconv.Itoa(file.SupplierId), &hseList)
+			if len(hseList) < 3 {
+				errinfo.Message = "缺少HSE成绩不允许提交流程"
+				errinfo.Code = 0
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+				return
+			}
+		}
+	}
+
 	errinfo.Code = 1
 	this.Data["json"] = &errinfo
 	this.ServeJSON()

+ 20 - 1
src/dashoo.cn/backend/api/controllers/setting/paramset.go

@@ -6,6 +6,7 @@ import (
 	"dashoo.cn/utils"
 	"encoding/json"
 	"strconv"
+	"time"
 )
 
 // 系统参数设置
@@ -15,6 +16,7 @@ type ParamSetController struct {
 
 type ParamSerModel struct {
 	IsInvestigate   bool   `json:"isInvestigate"`
+	IsHse  			bool   `json:"IsHse"`
 	IsGetBarCode    bool   `json:"isGetBarCode"`
 	SAddLimitMonth  string `json:"sAddLimitMonth"`
 	AppendApplyNums string `json:"appendApplyNums"`
@@ -32,7 +34,7 @@ type ParamModel struct {
 
 // @Title 保存参数设置
 // @Description 保存参数设置
-// @Param	body	body	business.device.DeviceChannels	"报警项目信息"
+// @Param	body	body	business.device.DeviceChannels
 // @Success	200	{object} controllers.Request
 // @router /saveparamset [put]
 func (this *ParamSetController) ParamSetPost() {
@@ -65,6 +67,23 @@ func (this *ParamSetController) ParamSetPost() {
 		svc.UpdateEntityByIdCols(isInvEntity.Id, isInvEntity, cols)
 	}
 
+	// HSE没成绩是否允许提交流程
+	var isAllow string
+	if model.IsHse {
+		isAllow = "true"
+	} else {
+		isAllow = "false"
+	}
+	var isHse baseparameter.Base_Parameter
+	svc.GetEntity(&isHse, where + " 'isHse'")
+	if isHse.Id > 0 {
+		isHse.Parametercontent = isAllow
+		isHse.Modifieduserid, _ = utils.StrTo(this.User.Id).Int()
+		isHse.Modifiedby = this.User.Realname
+		isHse.Modifiedon = time.Now()
+		svc.UpdateEntityByIdCols(isHse.Id, isHse, cols)
+	}
+
 	// 增项申请时间间隔
 	var lmEntity baseparameter.Base_Parameter
 	svc.GetEntity(&lmEntity, where+"'sAddLimitMonth'")

+ 3 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/_opera/operation.vue

@@ -2106,7 +2106,6 @@
       this.getFileDictOptions()
       this.initTableHeader()
       this.getSupplierCert()
-      this.selectNeedSecure()
       // this.getAccessCardNo()
     },
     methods: {
@@ -2405,6 +2404,7 @@
         if (this.supplierId) {
           hseApi.selectNeedSecure(this.supplierId, this.$axios).then(res => {
             if (res.data === 1) {
+              console.log(this.formData.HseTraining, 'HSE审查培训------')
               this.formData.HseTraining = '1'
               this.hseTrainingStatus = true
             } else {
@@ -2619,6 +2619,7 @@
             .then(res => {
               this.copyformdata = _.cloneDeep(res.data[0])
               this.formData = res.data[1]
+              console.log('213120000-===')
               this.OperTypeCopy = this.formData.OperType
               this.Grade = this.formData.Grade
               if (this.Grade === '1') {
@@ -2642,6 +2643,7 @@
               this.LinkCityAry.push(this.formData.LinkCity)
               this.LinkCityAry.push(this.formData.LinkStreet)
 
+              this.selectNeedSecure()
               this.GetItemsDatas()
             })
             .catch(err => {

+ 9 - 0
src/dashoo.cn/frontend_web/src/pages/setting/paramset/index.vue

@@ -32,6 +32,9 @@
                 <template slot="append">个月</template>
               </el-input>
             </el-form-item>
+            <el-form-item label="HSE没成绩是否允许提交流程 ">
+              <el-switch on-text="是" off-text="否" on-color="#13ce66" v-model="parameterForm.isHse"></el-switch>
+            </el-form-item>
           </el-form>
         </el-col>
       </el-row>
@@ -46,6 +49,7 @@
       return {
         parameterForm: {
           isInvestigate: false,
+          isHse: true,
           sAddLimitMonth: '0',
           appendApplyNums: '2' // 增项 每年可申请次数
         }
@@ -67,6 +71,11 @@
                       _this.parameterForm.isInvestigate = true
                     }
                     break
+                  case 'isHse':
+                    if (res.data[i].Parametercontent === 'false') {
+                      _this.parameterForm.isHse = false
+                    }
+                    break
                   case 'sAddLimitMonth':
                     _this.parameterForm.sAddLimitMonth = Number(res.data[i].Parametercontent)
                     break