|
|
@@ -16,6 +16,7 @@ import com.uas.sso.support.Page;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.util.List;
|
|
|
@@ -174,6 +175,23 @@ public class VendorIntroductionServiceImpl implements VendorIntroductionService
|
|
|
return new Page<>(pageable.getPageNumber(), pageable.getPageSize(), enterprises, enterprises.size() * pageable.getPageNumber());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取有效供应商数量
|
|
|
+ *
|
|
|
+ * @return 数量信息
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ModelMap getVendorCount() {
|
|
|
+ Long enUU = 0L;
|
|
|
+ if (null != SystemSession.getUser() && null != SystemSession.getUser().getEnterprise()) {
|
|
|
+ enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
+ }
|
|
|
+ Integer count = getTotalCount(enUU, null, null);
|
|
|
+ ModelMap map = new ModelMap();
|
|
|
+ map.put("count", count);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取供应商资源信息
|
|
|
* @param enUU 本企业UU
|
|
|
@@ -241,7 +259,7 @@ public class VendorIntroductionServiceImpl implements VendorIntroductionService
|
|
|
" and en_name not like '%test%' and (length(en_businesscode) > 12 or en_name like '%香港%' or en_name like '%HONG KONG%' " +
|
|
|
" or en_area like '%香港%')and (en_name not REGEXP '^[0-9]*$' and (en_name like '%ltd%' or en_name like '%limited%' or " +
|
|
|
" en_name like '%tcl%' or en_name not regexp '[\\u4e00-\\u9fa5_a-zA-Z0-9]') ) and ");
|
|
|
- if (StringUtils.isEmpty(productCondition)) {
|
|
|
+ if (StringUtils.isEmpty(productCondition) && !StringUtils.isEmpty(enterpriseCondition)) {
|
|
|
enCountSql.append(enterpriseCondition).append(" and ");
|
|
|
}
|
|
|
enCountSql.append(" en_uu <> ").append(enUU).append(") e ");
|
|
|
@@ -270,7 +288,7 @@ public class VendorIntroductionServiceImpl implements VendorIntroductionService
|
|
|
" en_name like '%tcl%' or en_name not regexp '[\\u4e00-\\u9fa5_a-zA-Z0-9]')) and ").append(enterpriseCondition).append(" and en_uu <> ").append(enUU)
|
|
|
.append(") e");
|
|
|
if (!StringUtils.isEmpty(productCondition)) {
|
|
|
- enUUSql.append(" right join ( select pr_enuu from products where ").append(productCondition).append(") p on pr_enuu = en_uu ");
|
|
|
+ enUUSql.append(" inner join ( select pr_enuu from products where ").append(productCondition).append(") p on pr_enuu = en_uu ");
|
|
|
}
|
|
|
return enUUSql.toString();
|
|
|
}
|