bug52973提示语覆盖修改

This commit is contained in:
xiejunyu
2022-05-25 09:34:07 +08:00
parent 62ef3fb239
commit d2d38720df
2 changed files with 281 additions and 288 deletions
@@ -118,14 +118,9 @@ public class SysCategoryController {
@PostMapping(value = "/add")
public Result<SysCategory> add(@RequestBody SysCategory sysCategory) {
Result<SysCategory> result = new Result<SysCategory>();
try {
sysCategory.setName(sysCategory.getName().replace(" ",""));
sysCategoryService.addSysCategory(sysCategory);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
}
return result;
}
@@ -10,10 +10,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.CommonConstant;
import com.jero.common.constant.FillRuleConstant;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.util.FillRuleUtil;
import com.jero.common.util.oConvertUtils;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.entity.SysCategoryTreeVO;
@@ -64,16 +62,16 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
}
@Override
public void addSysCategory(SysCategory sysCategory) {
String categoryCode = "";
// String categoryCode = "";
String categoryPid = ISysCategoryService.ROOT_PID_VALUE;
String parentCode = null;
// String parentCode = null;
if(oConvertUtils.isNotEmpty(sysCategory.getPid())){
categoryPid = sysCategory.getPid();
//PID 不是根节点 说明需要设置父节点 hasChild 为1
if(!ISysCategoryService.ROOT_PID_VALUE.equals(categoryPid)){
SysCategory parent = baseMapper.selectById(categoryPid);
parentCode = parent.getCode();
// parentCode = parent.getCode();
if(parent!=null && !"1".equals(parent.getHasChild())){
parent.setHasChild("1");
baseMapper.updateById(parent);
@@ -83,9 +81,9 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
//update-begin--Author:baihailong Date:20191209 for:分类字典编码规则生成器做成公用配置
JSONObject formData = new JSONObject();
formData.put("pid",categoryPid);
categoryCode = (String) FillRuleUtil.executeRule(FillRuleConstant.CATEGORY,formData);
// categoryCode = (String) FillRuleUtil.executeRule(FillRuleConstant.CATEGORY,formData);
//update-end--Author:baihailong Date:20191209 for:分类字典编码规则生成器做成公用配置
sysCategory.setCode(categoryCode);
// sysCategory.setCode(categoryCode);
sysCategory.setPid(categoryPid);
sysCategory.setItemValue(String.valueOf(RandomUtils.nextLong()));
sysCategory.setIsTagDict(1);