|
|
@@ -7,6 +7,7 @@ import (
|
|
|
baseparameter "dashoo.cn/business2/parameter"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
+ "supplier_system/src/dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
|
|
|
|
"dashoo.cn/backend/api/business/auditsetting"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/classorgsetting"
|
|
|
@@ -29,6 +30,91 @@ func GetOilSupplierCertService(xormEngine *xorm.Engine) *OilSupplierCertService
|
|
|
return s
|
|
|
}
|
|
|
|
|
|
+func (s *OilSupplierCertService) CheckOilSupplierCertIsNeedPayService(certId string) int {
|
|
|
+ certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
+ var supplierCertEntity suppliercert.OilSupplierCert
|
|
|
+ certSrv.GetEntityById(certId, &supplierCertEntity)
|
|
|
+
|
|
|
+ var isPayList []string
|
|
|
+ isPayList = append(isPayList, suppliercert.PINGSHEN)
|
|
|
+ isPayList = append(isPayList, suppliercert.WAIBUSHICHANG)
|
|
|
+ var unPayList []string
|
|
|
+ unPayList = append(unPayList, suppliercert.YIJIWUZI)
|
|
|
+ unPayList = append(unPayList, suppliercert.ERJIWUZI)
|
|
|
+ unPayList = append(unPayList, suppliercert.ZHANLUEHEZUO)
|
|
|
+ unPayList = append(unPayList, suppliercert.NEIBUDUOYUAN)
|
|
|
+
|
|
|
+ result := 0
|
|
|
+ isPay := "false"
|
|
|
+ unPay := "false"
|
|
|
+ for _, eachItem := range isPayList {
|
|
|
+ if eachItem == supplierCertEntity.InStyle {
|
|
|
+ // 需要付费
|
|
|
+ isPay = "true"
|
|
|
+ result = 1
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for _, eachItem := range unPayList {
|
|
|
+ if eachItem == supplierCertEntity.InStyle {
|
|
|
+ // 不需要付费
|
|
|
+ unPay = "true"
|
|
|
+ result = 2
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if isPay == unPay {
|
|
|
+ // 准入类型是否付费有误!请联系管理员
|
|
|
+ result = 0
|
|
|
+ }
|
|
|
+
|
|
|
+ return result
|
|
|
+}
|
|
|
+
|
|
|
+func (s *OilSupplierCertService) CheckOilSupplierCertIsNeedConcentrateAuditService(certId string) int {
|
|
|
+ certSrv := suppliercert.GetOilSupplierCertService(utils.DBE)
|
|
|
+ var supplierCertEntity suppliercert.OilSupplierCert
|
|
|
+ certSrv.GetEntityById(certId, &supplierCertEntity)
|
|
|
+
|
|
|
+ // 需要集中评审的准入类型
|
|
|
+ var concentrateInStyleList []string
|
|
|
+ concentrateInStyleList = append(concentrateInStyleList, suppliercert.PINGSHEN)
|
|
|
+ concentrateInStyleList = append(concentrateInStyleList, suppliercert.NEIBUDUOYUAN)
|
|
|
+ // 不需要集中评审的准入类型
|
|
|
+ var unConcentrateInStyleList []string
|
|
|
+ unConcentrateInStyleList = append(unConcentrateInStyleList, suppliercert.YIJIWUZI)
|
|
|
+ unConcentrateInStyleList = append(unConcentrateInStyleList, suppliercert.ERJIWUZI)
|
|
|
+ unConcentrateInStyleList = append(unConcentrateInStyleList, suppliercert.ZHANLUEHEZUO)
|
|
|
+ unConcentrateInStyleList = append(unConcentrateInStyleList, suppliercert.WAIBUSHICHANG)
|
|
|
+
|
|
|
+ result := 0
|
|
|
+ isConcentrateAudit := "false"
|
|
|
+ unConcentrateAudit := "false"
|
|
|
+ for _, eachItem := range concentrateInStyleList {
|
|
|
+ if eachItem == supplierCertEntity.InStyle {
|
|
|
+ // 需要集中评审
|
|
|
+ isConcentrateAudit = "true"
|
|
|
+ result = 1
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for _, eachItem := range unConcentrateInStyleList {
|
|
|
+ if eachItem == supplierCertEntity.InStyle {
|
|
|
+ // 不需要集中评审
|
|
|
+ unConcentrateAudit = "true"
|
|
|
+ result = 2
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if isConcentrateAudit == unConcentrateAudit {
|
|
|
+ // 准入类型评审方式错误!请联系管理员
|
|
|
+ result = 0
|
|
|
+ }
|
|
|
+
|
|
|
+ return result
|
|
|
+}
|
|
|
+
|
|
|
//通用多部门多实例审核方法
|
|
|
func (s *OilSupplierCertService) SubmitOrgAudit(certId, wfName, wfNodeCode, userId, result, remarks, OilSupplierCertSubName, OilClassOrgSettingName string, status string, step string) (processInstanceId, res string) {
|
|
|
//取出审批列表
|
|
|
@@ -127,9 +213,9 @@ func (s *OilSupplierCertService) IsCanApplyByExtOrganizeUser(applyType, commerci
|
|
|
if extOrganizeId == departmentId {*/
|
|
|
if isCompanyUser == 1 {
|
|
|
var tempMap []map[string]string
|
|
|
- sql:= "select 1 from OilSupplier a left join OilSupplierCert b on a.Id=b.SupplierId where b.SupplierTypeCode = '" + applyType + "' and (b.CreateUserId = '" + userId + "' or a.CommercialNo='"+commercialNo+"')"
|
|
|
- tempMap,_=s.DBE.QueryString(sql)
|
|
|
- if tempMap!=nil && tempMap[0]["1"] !="" {
|
|
|
+ sql := "select 1 from OilSupplier a left join OilSupplierCert b on a.Id=b.SupplierId where b.SupplierTypeCode = '" + applyType + "' and (b.CreateUserId = '" + userId + "' or a.CommercialNo='" + commercialNo + "')"
|
|
|
+ tempMap, _ = s.DBE.QueryString(sql)
|
|
|
+ if tempMap != nil && tempMap[0]["1"] != "" {
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
@@ -159,8 +245,7 @@ func (s *OilSupplierCertService) GetAuditUserByNoLogin(organizeId string, entiti
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-func (s *OilSupplierCertService) IsSupplierCertCanSubmit (supplierId, supplierCertId string) bool {
|
|
|
+func (s *OilSupplierCertService) IsSupplierCertCanSubmit(supplierId, supplierCertId string) bool {
|
|
|
//获取主表信息
|
|
|
var supplierEntity supplier.OilSupplier
|
|
|
supplierService := supplier.GetOilSupplierService(s.DBE)
|
|
|
@@ -190,12 +275,12 @@ func (s *OilSupplierCertService) IsSupplierCertCanSubmit (supplierId, supplierCe
|
|
|
paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
isInvestigate := paramSvc.GetBaseparameterMessage("GFGL1", "paramset", "isInvestigate")
|
|
|
if isInvestigate == "true" &&
|
|
|
- supplierCertEntity.Type == supplier.SUPPLIER_TYPE_GOODS && //当前只有物资类才可上传现场考察报告
|
|
|
+ supplierCertEntity.Type == supplier.SUPPLIER_TYPE_GOODS && //当前只有物资类才可上传现场考察报告
|
|
|
supplierEntity.OperType == "代理商" &&
|
|
|
supplierCertEntity.InStyle != supplier.IN_STYPE_GOODS_LEVEL_1 {
|
|
|
|
|
|
scenefileService := supplierscenefile.GetSupplierScenefileService(utils.DBE)
|
|
|
- scenefileEntity := scenefileService.GetSceneFileList( strconv.Itoa(supplierEntity.Id) )
|
|
|
+ scenefileEntity := scenefileService.GetSceneFileList(strconv.Itoa(supplierEntity.Id))
|
|
|
if len(scenefileEntity.FileUrl) <= 0 {
|
|
|
panic("请上传现场考察报告!")
|
|
|
}
|
|
|
@@ -203,7 +288,7 @@ func (s *OilSupplierCertService) IsSupplierCertCanSubmit (supplierId, supplierCe
|
|
|
|
|
|
//对准入资质的判断
|
|
|
supplierFileService := supplierfile.GetSupplierfileService(utils.DBE)
|
|
|
- supplierFiles := supplierFileService.GetListBySupplierId( strconv.Itoa(supplierEntity.Id) )
|
|
|
+ supplierFiles := supplierFileService.GetListBySupplierId(strconv.Itoa(supplierEntity.Id))
|
|
|
needBiddingBook := false
|
|
|
hasBiddingBook := false
|
|
|
if supplierCertEntity.InStyle == supplier.IN_STYPE_BIDDING {
|
|
|
@@ -226,4 +311,4 @@ func (s *OilSupplierCertService) IsSupplierCertCanSubmit (supplierId, supplierCe
|
|
|
}
|
|
|
|
|
|
return true
|
|
|
-}
|
|
|
+}
|