fix 标签管理提示语
This commit is contained in:
@@ -3,6 +3,7 @@ package com.jero.common.api.vo;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
@@ -66,11 +67,21 @@ public class Result<T> implements Serializable {
|
||||
return r;
|
||||
}
|
||||
|
||||
public static<T> Result<T> OK(String message) {
|
||||
public static<T> Result<T> OK(String msg) {
|
||||
Result<T> r = new Result<>();
|
||||
r.setSuccess(true);
|
||||
r.setCode(CommonConstant.SC_OK_200);
|
||||
r.setMessage(message);
|
||||
msg = MessageUtils.getMessage(msg);
|
||||
r.setMessage(msg);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static<T> Result<T> OK(String msg, Object... args) {
|
||||
Result<T> r = new Result<>();
|
||||
r.setSuccess(true);
|
||||
r.setCode(CommonConstant.SC_OK_200);
|
||||
msg = MessageUtils.getMessage(msg,args);
|
||||
r.setMessage(msg);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -101,6 +112,12 @@ public class Result<T> implements Serializable {
|
||||
}
|
||||
|
||||
public static<T> Result<T> error(String msg) {
|
||||
msg = MessageUtils.getMessage(msg);
|
||||
return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg);
|
||||
}
|
||||
|
||||
public static<T> Result<T> error(String msg, Object... args) {
|
||||
msg = MessageUtils.getMessage(msg,args);
|
||||
return error(CommonConstant.SC_INTERNAL_SERVER_ERROR_500, msg);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -49,5 +49,10 @@ import.error=\u5BFC\u5165\u9519\u8BEF
|
||||
please.upload.zip.archive=\u6570\u636E\u5BFC\u5165\u5931\u8D25\uFF0C\u8BF7\u4E0A\u4F20zip\u538B\u7F29\u5305
|
||||
task.handler.error=\u53EA\u6709\u5904\u7406\u4EBA\u53EF\u4EE5\u64CD\u4F5C
|
||||
no.auth=\u6CA1\u6709\u64CD\u4F5C\u6743\u9650
|
||||
tag.error.1=\u540C\u4E00\u6240\u5C5E\u6A21\u5757\u4E0B,\u5C55\u793A\u533A\u57DF\u540D\u79F0\u4E0D\u80FD\u91CD\u590D\uFF01
|
||||
edit.ok=\u7F16\u8F91\u6210\u529F
|
||||
edit.error=\u7F16\u8F91\u5931\u8D25
|
||||
tag.error.2=\u8BE5\u5C55\u793A\u533A\u57DF\u6709\u5173\u8054\u6570\u636E\uFF0C\u65E0\u6CD5\u5220\u9664\uFF01
|
||||
check.data.error=\u8BF7\u9009\u62E9\u6570\u636E
|
||||
import.template.error=\u5BFC\u5165\u6A21\u677F\u9519\u8BEF
|
||||
zip.charset.error=zip\u538B\u7F29\u5305\u7F16\u7801\u9519\u8BEF
|
||||
zip.charset.error=zip\u538B\u7F29\u5305\u7F16\u7801\u9519\u8BEF
|
||||
@@ -52,5 +52,10 @@ import.error=Import error
|
||||
please.upload.zip.archive=Data import failed, please upload zip archive
|
||||
task.handler.error=Only the handler can operate
|
||||
no.auth=No permission to operate
|
||||
tag.error.1=Under the same module, the display area name cannot be duplicate!
|
||||
edit.ok=edit ok
|
||||
edit.error=edit error
|
||||
tag.error.2=This exhibition area has associated data and cannot be deleted!
|
||||
check.data.error=Please select data
|
||||
import.template.error=Import template error
|
||||
zip.charset.error=Zip charset error
|
||||
@@ -51,5 +51,10 @@ import.zip.archive.error=\u5BFC\u5165\u9519\u8BEF
|
||||
please.upload.zip.archive=\u6570\u636E\u5BFC\u5165\u5931\u8D25\uFF0C\u8BF7\u4E0A\u4F20zip\u538B\u7F29\u5305
|
||||
task.handler.error=\u53EA\u6709\u5904\u7406\u4EBA\u53EF\u4EE5\u64CD\u4F5C
|
||||
no.auth=\u6CA1\u6709\u64CD\u4F5C\u6743\u9650
|
||||
tag.error.1=\u540C\u4E00\u6240\u5C5E\u6A21\u5757\u4E0B,\u5C55\u793A\u533A\u57DF\u540D\u79F0\u4E0D\u80FD\u91CD\u590D\uFF01
|
||||
edit.ok=\u7F16\u8F91\u6210\u529F
|
||||
edit.error=\u7F16\u8F91\u5931\u8D25
|
||||
tag.error.2=\u8BE5\u5C55\u793A\u533A\u57DF\u6709\u5173\u8054\u6570\u636E\uFF0C\u65E0\u6CD5\u5220\u9664\uFF01
|
||||
check.data.error=\u8BF7\u9009\u62E9\u6570\u636E
|
||||
import.template.error=\u5BFC\u5165\u6A21\u677F\u9519\u8BEF
|
||||
zip.charset.error=zip\u538B\u7F29\u5305\u7F16\u7801\u9519\u8BEF
|
||||
zip.charset.error=zip\u538B\u7F29\u5305\u7F16\u7801\u9519\u8BEF
|
||||
Reference in New Issue
Block a user