|
@@ -4077,7 +4077,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}
|
|
}
|
|
|
Integer addend = 60 * 60 * 24 * 1000;
|
|
Integer addend = 60 * 60 * 24 * 1000;
|
|
|
endDate = new java.sql.Date(endDate.getTime() + addend);
|
|
endDate = new java.sql.Date(endDate.getTime() + addend);
|
|
|
- StringBuffer sql = new StringBuffer("select br_name_en as brand, count(1) as count from product$brand where br_modifytime >= ? and br_modifytime < ? group by br_name_en");
|
|
|
|
|
|
|
+ StringBuffer sql = new StringBuffer("select br_name_en as brand, count(1) as count from trade$goods where br_name_en is not null and go_update_date >= ? and go_update_date < ? group by br_name_en");
|
|
|
StringBuffer countSql = new StringBuffer("select count(1) from (").append(sql).append(") as a");
|
|
StringBuffer countSql = new StringBuffer("select count(1) from (").append(sql).append(") as a");
|
|
|
Integer count = commonDao.queryForObject(countSql.toString(), Integer.class, startDate, endDate);
|
|
Integer count = commonDao.queryForObject(countSql.toString(), Integer.class, startDate, endDate);
|
|
|
// 分页参数
|
|
// 分页参数
|
|
@@ -4097,7 +4097,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public com.uas.sso.support.Page<KindHierarchicalCount> getKindProductsCount(Pageable pageable, Date startTime, Date endTime) {
|
|
public com.uas.sso.support.Page<KindHierarchicalCount> getKindProductsCount(Pageable pageable, Date startTime, Date endTime) {
|
|
|
- StringBuffer sql = new StringBuffer("select ki_name as thirdKind, ki_parentid as parentId, count(1) as count from product$kind group by ki_name, ki_parentid");
|
|
|
|
|
|
|
+ StringBuffer sql = new StringBuffer("select ki_name as thirdKind, go_kind_uuid as kindId, count(1) as count from trade$goods group by ki_name, go_kind_uuid");
|
|
|
StringBuffer countSql = new StringBuffer("select count(1) from (").append(sql).append(") as a");
|
|
StringBuffer countSql = new StringBuffer("select count(1) from (").append(sql).append(") as a");
|
|
|
Integer count = commonDao.queryForObject(countSql.toString(), Integer.class);
|
|
Integer count = commonDao.queryForObject(countSql.toString(), Integer.class);
|
|
|
// 分页参数
|
|
// 分页参数
|
|
@@ -4106,14 +4106,17 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
List<KindHierarchicalCount> kindList = commonDao.query(sql.toString(), KindHierarchicalCount.class, pageable.getPageSize(), offset);
|
|
List<KindHierarchicalCount> kindList = commonDao.query(sql.toString(), KindHierarchicalCount.class, pageable.getPageSize(), offset);
|
|
|
if (CollectionUtils.isNotEmpty(kindList)) {
|
|
if (CollectionUtils.isNotEmpty(kindList)) {
|
|
|
kindList.forEach(kind -> {
|
|
kindList.forEach(kind -> {
|
|
|
- if (null != kind.getParentId() && kind.getParentId() != 0) {
|
|
|
|
|
- KindInfo parentKind = kindInfoDao.findOne(kind.getParentId());
|
|
|
|
|
- if (null != parentKind) {
|
|
|
|
|
- kind.setSecondKind(parentKind.getNameCn());
|
|
|
|
|
- if (null != parentKind.getParentid() && parentKind.getParentid() != 0) {
|
|
|
|
|
- KindInfo firstKind = kindInfoDao.findOne(parentKind.getParentid());
|
|
|
|
|
- if (null != firstKind) {
|
|
|
|
|
- kind.setFirstKind(firstKind.getNameCn());
|
|
|
|
|
|
|
+ if (null != kind.getKindId()) {
|
|
|
|
|
+ KindInfo kindInfo = kindInfoDao.findOne(kind.getKindId());
|
|
|
|
|
+ if (null != kindInfo && null != kindInfo.getParentid() && kindInfo.getParentid() != 0) {
|
|
|
|
|
+ KindInfo parentKind = kindInfoDao.findOne(kindInfo.getParentid());
|
|
|
|
|
+ if (null != parentKind) {
|
|
|
|
|
+ kind.setSecondKind(parentKind.getNameCn());
|
|
|
|
|
+ if (null != parentKind.getParentid() && parentKind.getParentid() != 0) {
|
|
|
|
|
+ KindInfo firstKind = kindInfoDao.findOne(parentKind.getParentid());
|
|
|
|
|
+ if (null != firstKind) {
|
|
|
|
|
+ kind.setFirstKind(firstKind.getNameCn());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|