|
|
@@ -3,17 +3,12 @@ package com.uas.platform.b2c.prod.store.service.impl;
|
|
|
import com.uas.platform.b2c.common.account.dao.EnterpriseDao;
|
|
|
import com.uas.platform.b2c.common.account.model.Enterprise;
|
|
|
import com.uas.platform.b2c.common.account.model.User;
|
|
|
+import com.uas.platform.b2c.common.base.dao.CommonDao;
|
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
import com.uas.platform.b2c.core.utils.UuidUtils;
|
|
|
import com.uas.platform.b2c.prod.store.dao.StoreApplyDao;
|
|
|
import com.uas.platform.b2c.prod.store.dao.StoreBrandInfoDao;
|
|
|
-import com.uas.platform.b2c.prod.store.model.EnterpriseSimple;
|
|
|
-import com.uas.platform.b2c.prod.store.model.Qualification;
|
|
|
-import com.uas.platform.b2c.prod.store.model.QualificationType;
|
|
|
-import com.uas.platform.b2c.prod.store.model.StoreApply;
|
|
|
-import com.uas.platform.b2c.prod.store.model.StoreBrandInfo;
|
|
|
-import com.uas.platform.b2c.prod.store.model.StoreIn;
|
|
|
-import com.uas.platform.b2c.prod.store.model.StoreType;
|
|
|
+import com.uas.platform.b2c.prod.store.model.*;
|
|
|
import com.uas.platform.b2c.prod.store.service.StoreApplyService;
|
|
|
import com.uas.platform.b2c.prod.store.service.StoreInService;
|
|
|
import com.uas.platform.b2c.trade.support.CodeType;
|
|
|
@@ -23,7 +18,10 @@ import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.persistence.criteria.CriterionExpression;
|
|
|
import com.uas.platform.core.persistence.criteria.SimpleExpression;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.core.convert.converter.Converter;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.Pageable;
|
|
|
+import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -55,12 +53,16 @@ public class StoreApplyServiceImpl implements StoreApplyService {
|
|
|
|
|
|
private final StoreBrandInfoDao brandInfoDao;
|
|
|
|
|
|
+ private final CommonDao commonDao;
|
|
|
+
|
|
|
@Autowired
|
|
|
- public StoreApplyServiceImpl(StoreApplyDao storeApplyDao, EnterpriseDao enterpriseDao, StoreInService storeInService, StoreBrandInfoDao brandInfoDao) {
|
|
|
+ public StoreApplyServiceImpl(StoreApplyDao storeApplyDao, EnterpriseDao enterpriseDao, StoreInService storeInService,
|
|
|
+ StoreBrandInfoDao brandInfoDao, CommonDao commonDao) {
|
|
|
this.storeApplyDao = storeApplyDao;
|
|
|
this.enterpriseDao = enterpriseDao;
|
|
|
this.storeInService = storeInService;
|
|
|
this.brandInfoDao = brandInfoDao;
|
|
|
+ this.commonDao = commonDao;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -305,4 +307,49 @@ public class StoreApplyServiceImpl implements StoreApplyService {
|
|
|
return new ResultMap(CodeType.ERROR_STATE, "数据操作异常");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public com.uas.sso.support.Page<StoreInfoAndProdExport> getStoreInfoAndProdCount(Pageable pageable, Date startTime, Date endTime) {
|
|
|
+ if (pageable == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ StringBuilder sql = new StringBuilder("select a.apply_create_time applyTime, a.apply_store_name storeName, "
|
|
|
+ + "a.apply_store_enuu enuu,a.apply_auth_time agreeTime, a.apply_auth_person_name agreeName, " +
|
|
|
+ "ifnull(p.count, 0) count from `store$apply` a left join (select pr_enuu, count(1) count from products" +
|
|
|
+ " group by pr_enuu) p on p.pr_enuu = a.apply_store_enuu where a.apply_status='PASS' ");
|
|
|
+ if (!StringUtils.isEmpty(startTime)) {
|
|
|
+ sql.append(" and date(a.apply_create_time) >= '" + new java.sql.Date(startTime.getTime()) + "'");
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(endTime)) {
|
|
|
+ sql.append(" and date(a.apply_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
|
|
|
+ }
|
|
|
+ sql.append(" order by a.apply_create_time limit " + pageable.getPageNumber() * pageable.getPageSize() + ","
|
|
|
+ + pageable.getPageSize());
|
|
|
+ StringBuilder totalSql = new StringBuilder("select count(1) from `store$apply` a where a.apply_status='PASS' ");
|
|
|
+ if (!StringUtils.isEmpty(startTime)) {
|
|
|
+ totalSql.append(" and date(a.apply_create_time) >= '" + new java.sql.Date(startTime.getTime()) + "'");
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(endTime)) {
|
|
|
+ totalSql.append(" and date(a.apply_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
|
|
|
+ }
|
|
|
+ Integer total = commonDao.queryForObject(totalSql.toString(), Integer.class);
|
|
|
+ List<StoreInfoAndProdExport> exports = commonDao.query(sql.toString(), StoreInfoAndProdExport.class);
|
|
|
+ return new com.uas.sso.support.Page<>(pageable.getPageNumber(), pageable.getPageSize(), exports, total);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<StoreInfoAndProdExport> storeInfoAndProdCountExport(Date startTime, Date endTime) {
|
|
|
+ StringBuilder sql = new StringBuilder("select a.apply_create_time applyTime, a.apply_store_name storeName, "
|
|
|
+ + "a.apply_store_enuu enuu,a.apply_auth_time agreeTime, a.apply_auth_person_name agreeName, " +
|
|
|
+ "ifnull(p.count, 0) count from `store$apply` a left join (select pr_enuu, count(1) count from products" +
|
|
|
+ " group by pr_enuu) p on p.pr_enuu = a.apply_store_enuu where a.apply_status='PASS' ");
|
|
|
+ if (!StringUtils.isEmpty(startTime)) {
|
|
|
+ sql.append(" and date(a.apply_create_time) >= '" + new java.sql.Date(startTime.getTime()) + "'");
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(endTime)) {
|
|
|
+ sql.append(" and date(a.apply_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
|
|
|
+ }
|
|
|
+ sql.append(" order by a.apply_create_time");
|
|
|
+ return commonDao.query(sql.toString(), StoreInfoAndProdExport.class);
|
|
|
+ }
|
|
|
}
|