|
@@ -116,17 +116,16 @@ func (s *OilSupplierCertService) SubmitOrgAudit(certId, wfName, wfNodeCode, user
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//查询已经申请的准入记录
|
|
//查询已经申请的准入记录
|
|
|
-func (s *OilSupplierCertService) IsCanApplyByExtOrganizeUser(applyType, departmentId, userId string, isCompanyUser int) bool {
|
|
|
|
|
|
|
+func (s *OilSupplierCertService) IsCanApplyByExtOrganizeUser(applyType, commercialNo, userId string, isCompanyUser int) bool {
|
|
|
|
|
|
|
|
/*parameterSvc := baseparameter.GetBaseparameterService(s.DBE) //取出外部门ID
|
|
/*parameterSvc := baseparameter.GetBaseparameterService(s.DBE) //取出外部门ID
|
|
|
extOrganizeId := parameterSvc.GetBaseparameterMessage("GFGL", "paramset", "ExtOrganizeId")
|
|
extOrganizeId := parameterSvc.GetBaseparameterMessage("GFGL", "paramset", "ExtOrganizeId")
|
|
|
if extOrganizeId == departmentId {*/
|
|
if extOrganizeId == departmentId {*/
|
|
|
if isCompanyUser == 1 {
|
|
if isCompanyUser == 1 {
|
|
|
- where := " SupplierTypeCode = '" + applyType + "'"
|
|
|
|
|
- where += " and CreateUserId = '" + userId + "'"
|
|
|
|
|
- var model OilSupplierCert
|
|
|
|
|
- count, _ := s.GetCount(&model, where)
|
|
|
|
|
- if count > 0 {
|
|
|
|
|
|
|
+ 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"] !="" {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|