Ver código fonte

hse导出改成word;物资类修改bug;增项资质有效期bug

wd 4 anos atrás
pai
commit
48c0b90815

+ 2 - 1
src/dashoo.cn/backend/api/conf/app.conf

@@ -87,7 +87,8 @@ callbackHost=http://localhost:10091/api
 
 [HSE]
 #HSEUrl=http://weed1.labsop.cn:9390/6,04fc24a640a08b
-HSEUrl=http://weed1.labsop.cn:9390/2,04fd6a6c3b3263
+HSEUrl=http://weed1.labsop.cn:9390/1,04fda990234e91
+HSEPdfUrl=http://weed1.labsop.cn:9390/5,04fda2a24476d8
 
 [MsgUrl]
 msgUrl=http://api.dgyt.petrochina/jcfw/duanxin/v1.0/sendmsg

+ 8 - 8
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitude.go

@@ -973,7 +973,7 @@ func (this *OilGoodsAptitudeController) UpdateCodeEntity() {
 	colsCode := []string{"Code"}
 	//svc.GetEntityById(id, &model)
 	if classall.Name1 != "" {
-		where := " Name = '" + classall.Name1 + "' and Id  <> " + utils.ToStr(classall.Id1)
+		where := " Name = '" + classall.Name1 + "' and Id  <> " + utils.ToStr(classall.Id1) + " and LENGTH(Code) = 2"
 		svc.GetEntitysByWhere(OilGoodsAptitudeClassName, where, &classmodel)
 		if len(classmodel) > 0 {
 			errinfo.Message = "大类名称已存在,请重新添加!"
@@ -987,7 +987,7 @@ func (this *OilGoodsAptitudeController) UpdateCodeEntity() {
 		}
 	}
 	if classall.Name2 != "" {
-		where := " Name = '" + classall.Name2 + "' and Id  <> " + utils.ToStr(classall.Id2)
+		where := " Name = '" + classall.Name2 + "' and Id  <> " + utils.ToStr(classall.Id2) + " and LENGTH(Code) = 4"
 		svc.GetEntitysByWhere(OilGoodsAptitudeClassName, where, &classmodel)
 		if len(classmodel) > 0 {
 			errinfo.Message = "中类名称已存在,请重新添加!"
@@ -1001,7 +1001,7 @@ func (this *OilGoodsAptitudeController) UpdateCodeEntity() {
 		}
 	}
 	if classall.Name3 != "" {
-		where := " Name = '" + classall.Name3 + "' and Id  <> " + utils.ToStr(classall.Id3)
+		where := " Name = '" + classall.Name3 + "' and Id  <> " + utils.ToStr(classall.Id3) + " and LENGTH(Code) = 6"
 		svc.GetEntitysByWhere(OilGoodsAptitudeClassName, where, &classmodel)
 		if len(classmodel) > 0 {
 			errinfo.Message = "小类名称已存在,请重新添加!"
@@ -1015,7 +1015,7 @@ func (this *OilGoodsAptitudeController) UpdateCodeEntity() {
 		}
 	}
 	if classall.Name4 != "" {
-		where := " Name = '" + classall.Name4 + "' and Id  <> " + utils.ToStr(classall.Id4)
+		where := " Name = '" + classall.Name4 + "' and Id  <> " + utils.ToStr(classall.Id4) + " and LENGTH(Code) = 8"
 		svc.GetEntitysByWhere(OilGoodsAptitudeClassName, where, &classmodel)
 		if len(classmodel) > 0 {
 			errinfo.Message = "品名已存在,请重新添加!"
@@ -1034,7 +1034,7 @@ func (this *OilGoodsAptitudeController) UpdateCodeEntity() {
 		}
 	}
 	if classall.Code1 != "" {
-		where := " Code = " + classall.Code1 + " and Id <> " + utils.ToStr(classall.Id1)
+		where := " Code = " + classall.Code1 + " and Id <> " + utils.ToStr(classall.Id1) + " and LENGTH(Code) = 2"
 		svc.GetEntitysByWhere(OilGoodsAptitudeClassName, where, &classmodel)
 		if len(classmodel) > 0 {
 			errinfo.Message = "大类编码已存在,请重新添加!"
@@ -1048,7 +1048,7 @@ func (this *OilGoodsAptitudeController) UpdateCodeEntity() {
 		}
 	}
 	if classall.Code2 != "" {
-		where := " Code = " + classall.Code2 + " and Id <> " + utils.ToStr(classall.Id2)
+		where := " Code = " + classall.Code2 + " and Id <> " + utils.ToStr(classall.Id2) + " and LENGTH(Code) = 4"
 		svc.GetEntitysByWhere(OilGoodsAptitudeClassName, where, &classmodel)
 		if len(classmodel) > 0 {
 			errinfo.Message = "中类编码已存在,请重新添加!"
@@ -1062,7 +1062,7 @@ func (this *OilGoodsAptitudeController) UpdateCodeEntity() {
 		}
 	}
 	if classall.Code3 != "" {
-		where := " Code = " + classall.Code3 + " and Id <> " + utils.ToStr(classall.Id3)
+		where := " Code = " + classall.Code3 + " and Id <> " + utils.ToStr(classall.Id3) + " and LENGTH(Code) = 6"
 		svc.GetEntitysByWhere(OilGoodsAptitudeClassName, where, &classmodel)
 		if len(classmodel) > 0 {
 			errinfo.Message = "小类编码已存在,请重新添加!"
@@ -1076,7 +1076,7 @@ func (this *OilGoodsAptitudeController) UpdateCodeEntity() {
 		}
 	}
 	if classall.Code4 != "" {
-		where := " Code = " + classall.Code4 + " and Id <> " + utils.ToStr(classall.Id4)
+		where := " Code = " + classall.Code4 + " and Id <> " + utils.ToStr(classall.Id4) + " and LENGTH(Code) = 8"
 		svc.GetEntitysByWhere(OilGoodsAptitudeClassName, where, &classmodel)
 		if len(classmodel) > 0 {
 			errinfo.Message = "品名编码已存在,请重新添加!"

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

@@ -563,18 +563,18 @@ func (this *HSEScoreController) ExportWord() {
 	fileName := "HSE培训合格证书.docx"
 
 	retDocUrl := svcActiviti.FillWordTemplate(dataMap, url, fileName)
-	model.Ip = strings.Replace(model.Ip, "60.30.245.229", "10.76.248.23", -1)
+	//model.Ip = strings.Replace(model.Ip, "60.30.245.229", "10.76.248.23", -1)
 	// 转成pdf
-	if strings.Contains(retDocUrl, "upfile") {
-		retDocUrl = "http://" + model.Ip + "/" + retDocUrl
-	} else {
-		retDocUrl = "http://" + retDocUrl
-	}
-	pdfUrl := svcActiviti.WordToPdf(retDocUrl)
+	//if strings.Contains(retDocUrl, "upfile") {
+	//	retDocUrl = "http://" + model.Ip + "/" + retDocUrl
+	//} else {
+	//	retDocUrl = "http://" + retDocUrl
+	//}
+	//pdfUrl := svcActiviti.WordToPdf(retDocUrl)
 	var datainfo ErrorDataInfo
 	datainfo.Code = 0
 	//datainfo.Item = retDocUrl
-	this.Data["json"] = pdfUrl
+	this.Data["json"] = retDocUrl
 	this.ServeJSON()
 
 }

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

@@ -4337,7 +4337,7 @@ func (this *OilSupplierController) StatisticalNum() {
 
 	var supplierBas []suppliercert.OilSupplierCert
 	certService.GetEntitysByWhere(OilSupplierCertName, "SupplierTypeCode = '02'", &supplierBas)
-	statisticalNum.BaseNum = len(supplierBas)
+	statisticalNum.BasNum = len(supplierBas)
 
 	var supplierTec []suppliercert.OilSupplierCert
 	certService.GetEntitysByWhere(OilSupplierCertName, "SupplierTypeCode = '03'", &supplierTec)

+ 0 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/goodsdataopera.vue

@@ -3142,7 +3142,6 @@
         this.SubfileForm.OldEffectDate = new Date(val.OldEffectDate)
         this.SubfileForm.OldFileUrl = val.OldFileUrl
         this.SubfileForm.FileUrl = val.FileUrl
-        this.SubfileForm.EffectDate = (this.jsEffectDate(val.EffectDate))
         this.fileList = []
         if (val.FileUrl !== '') {
           this.getwendanginfo(val.FileUrl)