|
@@ -4,6 +4,8 @@ import com.caimei.entity.*;
|
|
|
import com.caimei.mapper.products.HomePageMapper;
|
|
|
import com.caimei.service.products.HomePageService;
|
|
|
import com.caimei.utils.AppUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -14,6 +16,7 @@ import java.util.Map;
|
|
|
|
|
|
@Service
|
|
|
public class HomePageServiceImpl implements HomePageService {
|
|
|
+ protected static final Logger logger = LoggerFactory.getLogger(HomePageServiceImpl.class);
|
|
|
@Autowired
|
|
|
private HomePageMapper homePageMapper;
|
|
|
@Value("${miniprogram.domain}")
|
|
@@ -21,6 +24,7 @@ public class HomePageServiceImpl implements HomePageService {
|
|
|
|
|
|
@Override
|
|
|
public Map<String, Object> information(Integer organizeID, Integer userID) {
|
|
|
+ logger.info("------------HomePageServiceImpl.information.organizeID:" + organizeID + ",userID:" + userID);
|
|
|
Map<String, Object> map = new HashMap();
|
|
|
//商品分类
|
|
|
List<CmProductsClassify> productsClassify = homePageMapper.findClassify(organizeID);
|
|
@@ -31,6 +35,8 @@ public class HomePageServiceImpl implements HomePageService {
|
|
|
}
|
|
|
//购物车数量
|
|
|
Integer count = homePageMapper.cartQuantity(userID);
|
|
|
+ if (count == null) count = 0;
|
|
|
+ logger.info("------------HomePageServiceImpl.information.count:" + count);
|
|
|
map.put("productsClassify", productsClassify);
|
|
|
map.put("organizeProducts", organizeProducts);
|
|
|
map.put("count", count);
|