fix 标签管理提示语
This commit is contained in:
@@ -9,9 +9,23 @@ public class ResultCommon {
|
||||
|
||||
private ResultCommon() {}
|
||||
|
||||
public static final String OK = "message.ok"; // 操作成功
|
||||
// 操作成功
|
||||
public static final String OK = "message.ok";
|
||||
// 操作失败
|
||||
public static final String ERROR = "message.error";
|
||||
// 编辑成功
|
||||
public static final String EDIT_OK = "edit.ok";
|
||||
// 编辑失败
|
||||
public static final String EDIT_ERROR = "edit.error";
|
||||
// 请选择数据
|
||||
public static final String PLEASE_SELECT_DATA = "please.select.data";
|
||||
// 删除成功
|
||||
public static final String SUCCESSFULLY_DELETED = "successfully.deleted";
|
||||
// 批量删除成功
|
||||
public static final String SUCCESSFULLY_DELETED_IN_BULK = "successfully.deleted.in.bulk";
|
||||
// 未找到对应数据
|
||||
public static final String NO_CORRESPONDING_DATA_FOUND = "no.corresponding.data.found";
|
||||
|
||||
public static final String ERROR = "message.error"; // 操作失败
|
||||
public static final String EMPTY_SOURCE = "message.empty.source"; // 来源不能为空
|
||||
public static final String EMPTY_STANDARD_NUMBER = "message.empty.standard.number"; // 标准编号不能为空
|
||||
public static final String EMPTY_STANDARD_NAME = "message.empty.standard.name"; // 标准名称不能为空
|
||||
@@ -25,11 +39,10 @@ public class ResultCommon {
|
||||
public static final String RMR_SET_QUALITY_OVER_TEN = "es.rmr.setQuality.overTen"; // 请最多选择10条
|
||||
|
||||
public static final String SUCCESSFULLY_CLEARED = "successfully.cleared"; // 清除成功
|
||||
public static final String SUCCESSFULLY_DELETED = "successfully.deleted"; // 删除成功
|
||||
public static final String SUCCESSFULLY_DELETED_IN_BULK = "successfully.deleted.in.bulk"; // 批量删除成功
|
||||
|
||||
public static final String CANNOT_DUPLICATE_FAVORITES = "cannot.duplicate.favorites"; // 不能重复收藏
|
||||
public static final String PLEASE_SELECT_DATA = "please.select.data"; // 请选择数据
|
||||
public static final String NO_CORRESPONDING_DATA_FOUND = "no.corresponding.data.found"; // 未找到对应数据
|
||||
|
||||
|
||||
public static final String THE_TOPLEVEL_GROUP_CANNOT_BE_DELETED = "the.toplevel.group.cannot.be.deleted"; // 最高级组别不能删除
|
||||
public static final String PLEASE_SELECT_PERSONNEL_AND_WORKGROUP = "please.select.personnel.and.workgroup"; // 请选择人员和工作组
|
||||
public static final String NUMBER_WORK_NO_ALREADY_EXISTS = "number.work.no.already.exists"; // 工号已存在
|
||||
@@ -69,5 +82,9 @@ public class ResultCommon {
|
||||
|
||||
public static final String ZIP_CHARSET_ERROR = "zip.charset.error"; // zip压缩包编码错误
|
||||
|
||||
//同一所属模块下,展示区域名称不能重复!
|
||||
public static final String TAG_ERROR_1 = "tag.error.1";
|
||||
//该展示区域有关联数据,无法删除!
|
||||
public static final String TAG_ERROR_2 = "tag.error.2";
|
||||
|
||||
}
|
||||
|
||||
+13
-45
@@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.enums.LanguageEnum;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.laws.common.constant.ResultCommon;
|
||||
import com.jero.modules.system.service.ISysDictItemService;
|
||||
import com.jero.modules.tag.entity.LawsArea;
|
||||
import com.jero.modules.tag.service.ILawsAreaService;
|
||||
@@ -14,7 +14,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Results;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -99,17 +98,10 @@ public class LawsAreaController extends JeroController<LawsArea, ILawsAreaServic
|
||||
public Result<?> add(@Validated @RequestBody LawsArea lawsArea) {
|
||||
int count= lawsAreaService.queryExitAreaName(lawsArea);
|
||||
if (count > 0) {
|
||||
// TODO Cut属性一定能拿到?拿不到的时候显示中文还是英文?现在对吗?测试了吗?
|
||||
//中英切换提示语
|
||||
if(LanguageEnum.CN.getValue().equals(lawsArea.getCut())) {
|
||||
return Result.error("同一所属模块下,展示区域名称不能重复!");
|
||||
}else{
|
||||
return Result.error("Under the same module, the display area name cannot be duplicate!");
|
||||
}
|
||||
|
||||
return Result.error(ResultCommon.TAG_ERROR_1);
|
||||
}else {
|
||||
lawsAreaService.add(lawsArea);
|
||||
return Result.OK("添加成功!");
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +116,6 @@ public class LawsAreaController extends JeroController<LawsArea, ILawsAreaServic
|
||||
@PostMapping(value = "/edit")
|
||||
@RequiresPermissions("area:edit")
|
||||
public Result<?> edit(@Validated @RequestBody LawsArea lawsArea) {
|
||||
// TODO 编辑的时候不考虑ID?不试试现在还能编辑成功?
|
||||
|
||||
QueryWrapper<LawsArea> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.eq("show_area", lawsArea.getShowArea()).eq("is_model", lawsArea.getIsModel());
|
||||
@@ -132,20 +123,13 @@ public class LawsAreaController extends JeroController<LawsArea, ILawsAreaServic
|
||||
if(!existAreaList.isEmpty()){//有同名数据
|
||||
if(existAreaList.get(0).getId().equals(lawsArea.getId())) {//已存在同名的数据,就是正在编辑的这个
|
||||
lawsAreaService.editById(lawsArea);
|
||||
return Result.OK("编辑成功!");
|
||||
return Result.OK(ResultCommon.EDIT_OK);
|
||||
}else {
|
||||
//中英切换提示语
|
||||
// TODO Cut属性一定能拿到?拿不到的时候显示中文还是英文?现在对吗?测试了吗?
|
||||
if (LanguageEnum.CN.getValue().equals(lawsArea.getCut())) {
|
||||
|
||||
return Result.error("同一所属模块下,展示区域名称不能重复!");
|
||||
} else {
|
||||
return Result.error("Under the same module, the display area name cannot be duplicate!");
|
||||
}
|
||||
return Result.error(ResultCommon.TAG_ERROR_1);
|
||||
}
|
||||
}else {
|
||||
lawsAreaService.editById(lawsArea);
|
||||
return Result.OK("编辑成功!");
|
||||
return Result.OK(ResultCommon.EDIT_OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,22 +142,16 @@ public class LawsAreaController extends JeroController<LawsArea, ILawsAreaServic
|
||||
@RequiresPermissions("area:delete")
|
||||
public Result<?> delete(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||
return Result.error("请选择数据!");
|
||||
return Result.error(ResultCommon.PLEASE_SELECT_DATA);
|
||||
}
|
||||
String id = map.get("id");
|
||||
LawsArea lawsArea = lawsAreaService.queryById(id);
|
||||
int count= lawsTagService.queryExitArea(lawsArea);
|
||||
if (count > 0) {
|
||||
//中英切换提示语
|
||||
// TODO 只改一半?编辑和新增改了,删除不改?
|
||||
//if(LanguageEnum.CN.getValue().equals(cut)) {
|
||||
return Result.error("该展示区域有关联数据,无法删除!");
|
||||
//}else{
|
||||
// return Result.error("This exhibition area has associated data and cannot be deleted!");
|
||||
//}
|
||||
return Result.error(ResultCommon.TAG_ERROR_2);
|
||||
}else {
|
||||
lawsAreaService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
return Result.OK(ResultCommon.SUCCESSFULLY_DELETED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,10 +164,10 @@ public class LawsAreaController extends JeroController<LawsArea, ILawsAreaServic
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
|
||||
return Result.error("请选择数据!");
|
||||
return Result.error(ResultCommon.PLEASE_SELECT_DATA);
|
||||
}
|
||||
this.lawsAreaService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
return Result.OK(ResultCommon.SUCCESSFULLY_DELETED_IN_BULK);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -204,12 +182,7 @@ public class LawsAreaController extends JeroController<LawsArea, ILawsAreaServic
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
LawsArea lawsArea = lawsAreaService.queryById(id);
|
||||
if(lawsArea ==null) {
|
||||
//中英切换提示语
|
||||
if(LanguageEnum.CN.getValue().equals(lawsArea.getCut())) {
|
||||
return Result.error("未找到对应数据");
|
||||
}else{
|
||||
return Result.error("No corresponding data was found.");
|
||||
}
|
||||
return Result.error(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
return Result.OK(lawsArea);
|
||||
}
|
||||
@@ -249,12 +222,7 @@ public class LawsAreaController extends JeroController<LawsArea, ILawsAreaServic
|
||||
public Result<?> selectShowAreaById(@RequestParam(name="id",required=true) String id) {
|
||||
LawsArea lawsArea = (LawsArea) lawsAreaService.selectShowAreaById(id);
|
||||
if(lawsArea ==null) {
|
||||
//中英切换提示语
|
||||
if(LanguageEnum.CN.getValue().equals(lawsArea.getCut())) {
|
||||
return Result.error("未找到对应数据");
|
||||
}else{
|
||||
return Result.error("No corresponding data was found.");
|
||||
}
|
||||
return Result.error(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
return Result.OK(lawsArea);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user