| | |
| | | @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
|