| | |
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | picList = new ArrayList<SwiperPicture>();
|
| | | }
|
| | |
|
| | | List<GoodsSubClass> goodsSubClassList = goodsSubClassService.getSubClassCache(gcid, 1);
|
| | | List<GoodsSubClass> goodsSubClassList = goodsSubClassService.getSubClassCache(gcid, 1,
|
| | | Calendar.getInstance().get(Calendar.MONTH) + 1);
|
| | | if (goodsSubClassList == null) {
|
| | | goodsSubClassList = new ArrayList<GoodsSubClass>();
|
| | | }
|
| | |
| | | * @param rootId 一级id |
| | | * @returnL |
| | | */ |
| | | List<GoodsSubClass> queryByRootId(@Param("rootId") Long rootId, @Param("state") Integer state); |
| | | List<GoodsSubClass> queryByRootId(@Param("rootId") Long rootId, @Param("state") Integer state,@Param("month") Integer month); |
| | | |
| | | /** |
| | | * 查询二级分类之下其他分类 |
| | |
| | | * @param classId |
| | | * @return |
| | | */ |
| | | List<GoodsSubClassLabelVO> listSubMapByClassId(@Param("classId") Long classId); |
| | | List<GoodsSubClassLabelVO> listSubMapByClassId(@Param("classId") Long classId,@Param("month")Integer month); |
| | | |
| | | |
| | | } |
| | |
| | | <include refid="Base_Column_List" /> |
| | | FROM yeshi_ec_sub_class |
| | | LEFT JOIN `yeshi_ec_sub_class_label_map` m ON m.`sclm_sub_class_id`=sub_id LEFT JOIN `yeshi_ec_sub_class_label` l ON l.`scl_id`=m.`sclm_label_id` |
| | | WHERE sub_root_id = #{rootId} |
| | | WHERE sub_root_id = #{rootId} |
| | | <if test="month != null"> |
| | | AND ( |
| | | (sub_month is null) |
| | | or |
| | | FIND_IN_SET(#{month},sub_month) |
| | | ) |
| | | </if> |
| | | |
| | | <if test="state != null">AND sub_state = #{state}</if> |
| | | ORDER BY l.`scl_order_by`,sub_weight |
| | | </select> |
| | |
| | | LEFT JOIN yeshi_ec_sub_class_label_map p ON t.`scl_id` = p.`sclm_label_id` |
| | | LEFT JOIN yeshi_ec_sub_class b ON b.`sub_id` = p.`sclm_sub_class_id` |
| | | WHERE t.`scl_class_id` = #{classId} AND b.`sub_state` = 1 |
| | | <if test="month != null"> |
| | | AND ( |
| | | (sub_month is null) |
| | | or |
| | | FIND_IN_SET(#{month},sub_month) |
| | | ) |
| | | </if> |
| | | |
| | | |
| | | ORDER BY t.`scl_order_by`,p.`sclm_order_by` |
| | | </select> |
| | | |
| | |
| | | package com.yeshi.fanli.service.impl.clazz;
|
| | |
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | |
| | | public GoodsSubClassLabelMap selectBySubClassId(Long subClassId) {
|
| | | return goodsSubClassLabelMapMapper.selectBySubClassId(subClassId);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "classCache", key = "'listSubMapCache-'+#classId")
|
| | | public List<GoodsSubClassLabelVO> listSubMapCache(Long classId) {
|
| | | List<GoodsSubClassLabelVO> list = goodsSubClassLabelMapper.listSubMapByClassId(classId);
|
| | | List<GoodsSubClassLabelVO> list = goodsSubClassLabelMapper.listSubMapByClassId(classId,
|
| | | Calendar.getInstance().get(Calendar.MONTH) + 1);
|
| | | if (list == null || list.size() == 0) {
|
| | | return list;
|
| | | }
|
| | | |
| | |
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | GoodsSubClassLabelVO labelVO = list.get(i);
|
| | | List<GoodsSubClass> listSub = labelVO.getListSub();
|
| | |
| | | i--;
|
| | | continue;
|
| | | }
|
| | | |
| | | for (GoodsSubClass goodsSubClass: listSub) {
|
| | |
|
| | | for (GoodsSubClass goodsSubClass : listSub) {
|
| | | String pictureSecond = goodsSubClass.getPictureSecond();
|
| | | if (!StringUtil.isNullOrEmpty(pictureSecond)) {
|
| | | goodsSubClass.setPicture(pictureSecond);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | labelVO.setListSub(listSub);
|
| | | }
|
| | | return list;
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | }
|
| | |
| | | @Transactional
|
| | | public void deleteByRootId(Long id) throws Exception {
|
| | |
|
| | | List<GoodsSubClass> subClassList = goodsSubClassMapper.queryByRootId(id, null);
|
| | | List<GoodsSubClass> subClassList = goodsSubClassMapper.queryByRootId(id, null, null);
|
| | | if (subClassList != null && subClassList.size() > 0) {
|
| | | for (GoodsSubClass goodsSubClass : subClassList) {
|
| | | deleteSub(goodsSubClass.getId());
|
| | |
| | | if (name == null || name.trim().length() == 0) {
|
| | | throw new GoodsSubClassException(1, "分类名称不能为空");
|
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(record.getMonth()))
|
| | | record.setMonth(null);
|
| | |
|
| | | // 图片上传
|
| | | String picture = null;
|
| | |
| | |
|
| | | @Override
|
| | | public List<GoodsSubClass> queryByRootId(Long rootId, Integer state) throws Exception {
|
| | | return goodsSubClassMapper.queryByRootId(rootId, state);
|
| | | return goodsSubClassMapper.queryByRootId(rootId, state, null);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<GoodsSubClass> getGoodsSecondClass(Long rootId, Integer state) throws Exception {
|
| | | return goodsSubClassMapper.queryByRootId(rootId, state);
|
| | | public List<GoodsSubClass> getGoodsSecondClass(Long rootId, Integer state, Integer month) throws Exception {
|
| | | return goodsSubClassMapper.queryByRootId(rootId, state, month);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "classCache", key = "'getSubClassCache-'+#rootId +'-'+#state")
|
| | | public List<GoodsSubClass> getSubClassCache(Long rootId, Integer state) throws Exception {
|
| | | return getGoodsSecondClass(rootId, state);
|
| | | public List<GoodsSubClass> getSubClassCache(Long rootId, Integer state, Integer month) throws Exception {
|
| | | return getGoodsSecondClass(rootId, state, month);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<GoodsSubClass> getGoodsSecondClass(Long rootId, Integer state) throws Exception;
|
| | | public List<GoodsSubClass> getGoodsSecondClass(Long rootId, Integer state,Integer month) throws Exception;
|
| | |
|
| | | public List<GoodsSubClass> queryByRootIdAndWeight(Long rootId, int type, int weight) throws Exception;
|
| | |
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<GoodsSubClass> getSubClassCache(Long rootId, Integer state) throws Exception;
|
| | | public List<GoodsSubClass> getSubClassCache(Long rootId, Integer state,Integer month) throws Exception;
|
| | |
|
| | | /**
|
| | | * 统计前端 点击次数
|
| | |
| | | package com.yeshi.fanli.util.dataoke;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.lang.reflect.Type;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|