| | |
| | | @RequestMapping(value = "/modifyDataDictionary") |
| | | public @ResponseBody |
| | | AjaxResult modifyDataDictionary(CustomerDataDictionary newDataDictionary) { |
| | | // 自己不能是自己的父节点 |
| | | if (newDataDictionary.getParentId() != null && newDataDictionary.getParentId().equals(newDataDictionary.getId())) { |
| | | throw new GlobleException("父级不能是自己"); |
| | | } |
| | | dataDictionaryDao.updateByModel(newDataDictionary); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.UPDATE_SUCCES, "数据字典"); |
| | | |
| | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.StringUtils; |
| | |
| | | |
| | | articleType.setParentIds(CollectionUtils.isNotEmpty(ids) ? StringUtils.collToStr(ids, ",") : null); |
| | | if (articleType.getId() != null) { |
| | | |
| | | // 自己不能是自己的父节点 |
| | | if (articleType.getParentId() != null && articleType.getParentId().equals(articleType.getId())) { |
| | | throw new GlobleException("父级不能是自己"); |
| | | } |
| | | return modify(currentService, articleType, "文章类型"); |
| | | } else { |
| | | |
| | |
| | | package com.matrix.system.hive.action; |
| | | |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.WebUtil; |
| | |
| | | public @ResponseBody AjaxResult addOrModify(SysDepartInfo departInfo) { |
| | | |
| | | if (departInfo.getId() != null) { |
| | | |
| | | if (departInfo.getParentId() != null && departInfo.getParentId().equals(departInfo.getId())) { |
| | | throw new GlobleException("父级不能是自己"); |
| | | } |
| | | return modify(currentService, departInfo, "部门"); |
| | | } else { |
| | | QueryUtil.setQueryLimit(departInfo); |
| | |
| | | package com.matrix.system.hive.action; |
| | | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | |
| | | AjaxResult addOrModify(SysGoodsType sysGoodsType) { |
| | | SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | if (sysGoodsType.getId() != null) { |
| | | |
| | | if (sysGoodsType.getParentId() != null && sysGoodsType.getParentId().equals(sysGoodsType.getId())) { |
| | | throw new GlobleException("父级不能是自己"); |
| | | } |
| | | return modify(currentService, sysGoodsType, "产品分类"); |
| | | } else { |
| | | |
| | |
| | | package com.matrix.system.hive.action; |
| | | |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | |
| | | AjaxResult addOrModify(ShoppingGoodsCategory shoppingGoodsCategory) { |
| | | if (shoppingGoodsCategory.getId() != null) { |
| | | |
| | | // 自己不能是自己的父节点 |
| | | if (shoppingGoodsCategory.getParentId() != null && shoppingGoodsCategory.getParentId().equals(shoppingGoodsCategory.getId())) { |
| | | throw new GlobleException("父级不能是自己"); |
| | | } |
| | | |
| | | return modify(goodsCategoryService, shoppingGoodsCategory, "商品类型"); |
| | | } else { |
| | | QueryUtil.setQueryLimit(shoppingGoodsCategory); |