Commit 22b835ec authored by wzp's avatar wzp

修改展板管理

parent 12f2edff
...@@ -97,42 +97,32 @@ public enum RESPONSE_CODE_ENUM { ...@@ -97,42 +97,32 @@ public enum RESPONSE_CODE_ENUM {
// 错误编码 // 错误编码
private String code; private String resultCode;
// 错误信息 // 错误信息
private String msg; private String message;
// 相应编码有参构造函数 // 相应编码有参构造函数
RESPONSE_CODE_ENUM(String code, String msg) {
this.code = code;
this.msg = msg; RESPONSE_CODE_ENUM(String resultCode, String message) {
this.resultCode = resultCode;
this.message = message;
} }
/** public String getResultCode() {
* 获取编码 return resultCode;
*/
public String getCode() {
return code;
} }
/** public String getMessage() {
* 设置编码 return message;
*/
public void setCode(String code) {
this.code = code;
} }
/** public void setResultCode(String resultCode) {
* 获取编码信息 this.resultCode = resultCode;
*/
public String getMsg() {
return msg;
} }
/** public void setMessage(String message) {
* 设置编码信息 this.message = message;
*/
public void setMsg(String msg) {
this.msg = msg;
} }
} }
...@@ -90,6 +90,12 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> { ...@@ -90,6 +90,12 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
MethodLog methodLog = getAnnotationLog(point); MethodLog methodLog = getAnnotationLog(point);
String ip = getIp(request); String ip = getIp(request);
TUser user = getCurAdmin(request); TUser user = getCurAdmin(request);
// if (user==null){
// HashMap<String, Object> resultMap = new HashMap<>();
// resultMap.put("resultCode", "500");
// resultMap.put("message", "用户未登录!");
// return resultMap;
// }
String methodName = user.getUserName() + "登录本系统"; String methodName = user.getUserName() + "登录本系统";
if (user.getOrgName() != null) { if (user.getOrgName() != null) {
methodName += ",机构" + user.getOrgName(); methodName += ",机构" + user.getOrgName();
...@@ -170,8 +176,8 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> { ...@@ -170,8 +176,8 @@ class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog> {
protected Map<String, Object> getFailResult() { protected Map<String, Object> getFailResult() {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), RESPONSE_CODE_ENUM.SERVER_ERROR.getCode()); map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), RESPONSE_CODE_ENUM.SERVER_ERROR.getResultCode());
map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), RESPONSE_CODE_ENUM.SERVER_ERROR.getMsg()); map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), RESPONSE_CODE_ENUM.SERVER_ERROR.getMessage());
return map; return map;
} }
......
...@@ -169,8 +169,8 @@ public class GlobalExceptionAdvisor { ...@@ -169,8 +169,8 @@ public class GlobalExceptionAdvisor {
@ExceptionHandler(InterfaceException.class) @ExceptionHandler(InterfaceException.class)
public cn.wisenergy.chnmuseum.party.common.validator.HttpResult handleInterfaceException(InterfaceException exception) { public cn.wisenergy.chnmuseum.party.common.validator.HttpResult handleInterfaceException(InterfaceException exception) {
cn.wisenergy.chnmuseum.party.common.validator.HttpResult httpResult = new cn.wisenergy.chnmuseum.party.common.validator.HttpResult(); cn.wisenergy.chnmuseum.party.common.validator.HttpResult httpResult = new cn.wisenergy.chnmuseum.party.common.validator.HttpResult();
httpResult.setCode(Integer.parseInt(exception.getErrorCode())); httpResult.setResultCode(Integer.parseInt(exception.getErrorCode()));
httpResult.setMsg(exception.getErrorMsg()); httpResult.setMessage(exception.getErrorMsg());
return httpResult; return httpResult;
} }
...@@ -209,7 +209,7 @@ public class GlobalExceptionAdvisor { ...@@ -209,7 +209,7 @@ public class GlobalExceptionAdvisor {
* @param httpResult 响应对象 * @param httpResult 响应对象
*/ */
private void addResCodeToMap(RESPONSE_CODE_ENUM responseCodeEnum, cn.wisenergy.chnmuseum.party.common.validator.HttpResult httpResult) { private void addResCodeToMap(RESPONSE_CODE_ENUM responseCodeEnum, cn.wisenergy.chnmuseum.party.common.validator.HttpResult httpResult) {
httpResult.setCode(Integer.parseInt(responseCodeEnum.getCode())); httpResult.setResultCode(Integer.parseInt(responseCodeEnum.getResultCode()));
httpResult.setMsg(responseCodeEnum.getMsg()); httpResult.setMessage(responseCodeEnum.getMessage());
} }
} }
\ No newline at end of file
...@@ -43,9 +43,9 @@ public class InterfaceException extends RuntimeException { ...@@ -43,9 +43,9 @@ public class InterfaceException extends RuntimeException {
* @param responseCode 响应编码枚举 * @param responseCode 响应编码枚举
*/ */
public InterfaceException(RESPONSE_CODE_ENUM responseCode) { public InterfaceException(RESPONSE_CODE_ENUM responseCode) {
super("errorCode:" + responseCode.getCode() + " errorMsg:" + responseCode.getMsg()); super("errorCode:" + responseCode.getResultCode() + " errorMsg:" + responseCode.getMessage());
this.errorCode = responseCode.getCode(); this.errorCode = responseCode.getResultCode();
this.errorMsg = responseCode.getMsg(); this.errorMsg = responseCode.getMessage();
} }
/** /**
......
...@@ -89,7 +89,7 @@ public class RequestParamValidAspect { ...@@ -89,7 +89,7 @@ public class RequestParamValidAspect {
} }
//返回第一条校验失败信息,也可以拼接起来返回所有的 //返回第一条校验失败信息,也可以拼接起来返回所有的
String message = validResult.iterator().next().getMessage(); String message = validResult.iterator().next().getMessage();
throw new InterfaceException(RESPONSE_CODE_ENUM.PARAM_NOT_VALID.getCode(), message); throw new InterfaceException(RESPONSE_CODE_ENUM.PARAM_NOT_VALID.getResultCode(), message);
} }
} }
......
...@@ -2,57 +2,57 @@ package cn.wisenergy.chnmuseum.party.common.validator; ...@@ -2,57 +2,57 @@ package cn.wisenergy.chnmuseum.party.common.validator;
public class HttpResult { public class HttpResult {
// 响应的状态码 // 响应的状态码
private int code; private int resultCode;
// 响应的响应信息 // 响应的响应信息
private String msg; private String message;
// 响应的响应体 // 响应的响应体
private Object body; private Object data;
public HttpResult() { public HttpResult() {
} }
public HttpResult(int code, String msg) { public HttpResult(int resultCode, String message) {
this.code = code; this.resultCode = resultCode;
this.msg = msg; this.message = message;
} }
public HttpResult(int code, Object body) { public HttpResult(int resultCode, Object data) {
this.code = code; this.resultCode = resultCode;
this.body = body; this.data = data;
} }
public int getCode() { public int getResultCode() {
return code; return resultCode;
} }
public void setCode(int code) { public void setResultCode(int resultCode) {
this.code = code; this.resultCode = resultCode;
} }
public String getMsg() { public String getMessage() {
return msg; return message;
} }
public void setMsg(String msg) { public void setMessage(String message) {
this.msg = msg; this.message = message;
} }
public Object getBody() { public Object getData() {
return body; return data;
} }
public void setBody(Object body) { public void setData(Object data) {
this.body = body; this.data = data;
} }
@Override @Override
public String toString() { public String toString() {
return "{" + return "HttpResult{" +
"\"code\":" + code + "resultCode=" + resultCode +
", \"msg\":" + "\"" + msg + "\"" + ", message='" + message + '\'' +
", \"body\":" + body + ", data=" + data +
'}'; '}';
} }
} }
...@@ -35,7 +35,7 @@ public class Audit implements Serializable { ...@@ -35,7 +35,7 @@ public class Audit implements Serializable {
@ApiModelProperty("审核ID") @ApiModelProperty("审核ID")
@TableId(value = "id", type = IdType.ASSIGN_ID) @TableId(value = "id", type = IdType.ASSIGN_ID)
@NotNull(message = "审核ID不能为空", groups = {Update.class}) @NotNull(message = "审核ID不能为空")
private String id; private String id;
@ApiModelProperty("审核内容") @ApiModelProperty("审核内容")
...@@ -48,17 +48,17 @@ public class Audit implements Serializable { ...@@ -48,17 +48,17 @@ public class Audit implements Serializable {
@ApiModelProperty("审核项ID") @ApiModelProperty("审核项ID")
@TableField("ref_item_id") @TableField("ref_item_id")
@NotBlank(message = "审核项ID不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "审核项ID不能为空", groups = {Add.class})
private String refItemId; private String refItemId;
@ApiModelProperty("提交人员") @ApiModelProperty("提交人员")
@TableField(value = "user_id", fill = FieldFill.INSERT) @TableField(value = "user_id", fill = FieldFill.INSERT)
@NotBlank(message = "提交人员不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "提交人员不能为空", groups = {Add.class})
private String userId; private String userId;
@ApiModelProperty(value = "审核内容", allowableValues = "视频内容 ASSET, 展板内容 EXHIBITION_BOARD, 学习内容 LEARNING_CONTENT, 账户 ACCOUNT") @ApiModelProperty(value = "审核内容", allowableValues = "视频内容 ASSET, 展板内容 EXHIBITION_BOARD, 学习内容 LEARNING_CONTENT, 账户 ACCOUNT")
@TableField("type") @TableField("type")
@NotBlank(message = "0,看板;1 视频;2 学习内容;3 账号禁用不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "0,看板;1 视频;2 学习内容;3 账号禁用不能为空", groups = {Add.class})
private String type; private String type;
@ApiModelProperty("操作类型") @ApiModelProperty("操作类型")
...@@ -71,7 +71,7 @@ public class Audit implements Serializable { ...@@ -71,7 +71,7 @@ public class Audit implements Serializable {
@ApiModelProperty("创建日期") @ApiModelProperty("创建日期")
@TableField(value = "create_time", fill = FieldFill.INSERT) @TableField(value = "create_time", fill = FieldFill.INSERT)
@NotNull(message = "创建日期不能为空", groups = {Add.class, Update.class}) @NotNull(message = "创建日期不能为空", groups = {Add.class})
private LocalDateTime createTime; private LocalDateTime createTime;
@ApiModelProperty("更新日期") @ApiModelProperty("更新日期")
......
...@@ -11,6 +11,7 @@ import cn.wisenergy.chnmuseum.party.service.AuditService; ...@@ -11,6 +11,7 @@ import cn.wisenergy.chnmuseum.party.service.AuditService;
import cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl; import cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController; import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -23,6 +24,7 @@ import org.springframework.validation.annotation.Validated; ...@@ -23,6 +24,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -57,7 +59,7 @@ public class AuditController extends BaseController { ...@@ -57,7 +59,7 @@ public class AuditController extends BaseController {
@ApiImplicitParam(name = "status", value = "待初审 TBC, 驳回 REFUSED,待复审 TBCA, 通过APPROVED_FINAL", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "status", value = "待初审 TBC, 驳回 REFUSED,待复审 TBCA, 通过APPROVED_FINAL", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "level", value = "初审 TBC,复审 TBCA", paramType = "query", dataType = "String") @ApiImplicitParam(name = "level", value = "初审 TBC,复审 TBCA", paramType = "query", dataType = "String")
}) })
public Map<String, Object> getUserList(String name, String status,String level) { public Map<String, Object> getUserList(String name, String status, String level) {
Page<Audit> auditList; Page<Audit> auditList;
try { try {
TUser user1 = getcurUser(); TUser user1 = getcurUser();
...@@ -72,7 +74,7 @@ public class AuditController extends BaseController { ...@@ -72,7 +74,7 @@ public class AuditController extends BaseController {
user.setAuditStatus(level); user.setAuditStatus(level);
} }
user.setOrgCode(user1.getOrgCode()); user.setOrgCode(user1.getOrgCode());
auditList = auditService.getUserList(getPage(),user); auditList = auditService.getUserList(getPage(), user);
return getResult(auditList); return getResult(auditList);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -85,10 +87,10 @@ public class AuditController extends BaseController { ...@@ -85,10 +87,10 @@ public class AuditController extends BaseController {
@ApiOperation(value = "修改禁用审核信息", notes = "修改禁用审核信息") @ApiOperation(value = "修改禁用审核信息", notes = "修改禁用审核信息")
public Map<String, Object> updateAudit(@Validated(value = {Update.class}) Audit audit) { public Map<String, Object> updateAudit(@Validated(value = {Update.class}) Audit audit) {
boolean flag; boolean flag;
if (!AuditStatusEnum.TBCA.name().equals(audit.getStatus())){ if (!AuditStatusEnum.TBCA.name().equals(audit.getStatus())) {
audit.setLevel(AuditStatusEnum.TBCA.name()); audit.setLevel(AuditStatusEnum.TBCA.name());
} }
if (!AuditStatusEnum.REFUSED.name().equals(audit.getStatus())){ if (!AuditStatusEnum.REFUSED.name().equals(audit.getStatus())) {
audit.setRemarks(""); audit.setRemarks("");
} }
try { try {
...@@ -174,8 +176,21 @@ public class AuditController extends BaseController { ...@@ -174,8 +176,21 @@ public class AuditController extends BaseController {
@GetMapping("/getById") @GetMapping("/getById")
@RequiresPermissions("/audit/getById") @RequiresPermissions("/audit/getById")
public Map<String, Object> getById(String id) { public Map<String, Object> getById(String id) {
Audit audit = auditService.getById(id); HashMap<String, Object> resultMap = new HashMap<>();
return getResult(audit);
try {
Audit audit = new Audit();
UpdateWrapper<Audit> wrapper = new UpdateWrapper<>();
wrapper.eq("ref_item_id", id);
audit = auditService.getOne(wrapper);
resultMap.put("resultCode", "500");
resultMap.put("message", "用户未登录!");
resultMap.put("data", audit);
return resultMap;
} catch (Exception e) {
e.printStackTrace();
}
return getFailResult();
} }
} }
......
...@@ -105,7 +105,7 @@ public class FileUploadController { ...@@ -105,7 +105,7 @@ public class FileUploadController {
@ApiOperation(value = "资料上传", notes = "资料上传") @ApiOperation(value = "资料上传", notes = "资料上传")
public ResponseEntity<BatchUploadResVO> uploadFile(@RequestPart(value = "file", required = false) MultipartFile[] files) throws IOException { public ResponseEntity<BatchUploadResVO> uploadFile(@RequestPart(value = "file", required = false) MultipartFile[] files) throws IOException {
if (files.length == 0) { if (files.length == 0) {
throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getCode(), "没有文件可供上传"); throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getResultCode(), "没有文件可供上传");
} }
int successCount = 0; int successCount = 0;
int failureCount = 0; int failureCount = 0;
...@@ -160,16 +160,16 @@ public class FileUploadController { ...@@ -160,16 +160,16 @@ public class FileUploadController {
@ApiOperation(value = "单图片上传", notes = "单图片上传") @ApiOperation(value = "单图片上传", notes = "单图片上传")
public ResponseEntity<ImageUploadResult> uploadImage(@RequestParam(value = "file") MultipartFile uploadFile) throws Exception { public ResponseEntity<ImageUploadResult> uploadImage(@RequestParam(value = "file") MultipartFile uploadFile) throws Exception {
if (uploadFile == null || uploadFile.getSize() == 0) { if (uploadFile == null || uploadFile.getSize() == 0) {
throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getCode(), "没有文件可供上传"); throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getResultCode(), "没有文件可供上传");
} }
String fileName = uploadFile.getOriginalFilename(); String fileName = uploadFile.getOriginalFilename();
String extension = FilenameUtils.getExtension(fileName); String extension = FilenameUtils.getExtension(fileName);
if (StringUtils.isBlank(extension)) { if (StringUtils.isBlank(extension)) {
throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getCode(), "文件格式不支持"); throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getResultCode(), "文件格式不支持");
} }
boolean anyMatch = Arrays.stream(IMAGE_TYPE).anyMatch(s -> Objects.equals(s, extension.toUpperCase())); boolean anyMatch = Arrays.stream(IMAGE_TYPE).anyMatch(s -> Objects.equals(s, extension.toUpperCase()));
if (!anyMatch) { if (!anyMatch) {
throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getCode(), "文件格式不支持"); throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getResultCode(), "文件格式不支持");
} }
String url = FastDFSUtils.uploadFile(uploadFile.getInputStream(), uploadFile.getSize(), fileName); String url = FastDFSUtils.uploadFile(uploadFile.getInputStream(), uploadFile.getSize(), fileName);
...@@ -189,11 +189,11 @@ public class FileUploadController { ...@@ -189,11 +189,11 @@ public class FileUploadController {
@ApiOperation(value = "多音频上传", notes = "多音频上传") @ApiOperation(value = "多音频上传", notes = "多音频上传")
public ResponseEntity<BatchUploadResVO> uploadAudio(@RequestPart(value = "file", required = false) MultipartFile[] files) throws IOException { public ResponseEntity<BatchUploadResVO> uploadAudio(@RequestPart(value = "file", required = false) MultipartFile[] files) throws IOException {
if (files.length == 0) { if (files.length == 0) {
throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getCode(), "没有文件可供上传"); throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getResultCode(), "没有文件可供上传");
} }
final boolean existChineseAudio = Arrays.stream(files).anyMatch(s -> Objects.requireNonNull(s.getOriginalFilename()).contains("汉语")); final boolean existChineseAudio = Arrays.stream(files).anyMatch(s -> Objects.requireNonNull(s.getOriginalFilename()).contains("汉语"));
if (!existChineseAudio) { if (!existChineseAudio) {
throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getCode(), "必须包含汉语音频"); throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getResultCode(), "必须包含汉语音频");
} }
int successCount = 0; int successCount = 0;
...@@ -252,11 +252,11 @@ public class FileUploadController { ...@@ -252,11 +252,11 @@ public class FileUploadController {
@ApiOperation(value = "多视频上传", notes = "多视频上传") @ApiOperation(value = "多视频上传", notes = "多视频上传")
public ResponseEntity<BatchUploadResVO> uploadVideo(@RequestPart(value = "file", required = false) MultipartFile[] files) throws IOException { public ResponseEntity<BatchUploadResVO> uploadVideo(@RequestPart(value = "file", required = false) MultipartFile[] files) throws IOException {
if (files == null || files.length == 0) { if (files == null || files.length == 0) {
throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getCode(), "没有文件可供上传"); throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getResultCode(), "没有文件可供上传");
} }
final boolean matchChinese = Arrays.stream(files).anyMatch(s -> Objects.requireNonNull(s.getOriginalFilename()).contains("汉语")); final boolean matchChinese = Arrays.stream(files).anyMatch(s -> Objects.requireNonNull(s.getOriginalFilename()).contains("汉语"));
if (!matchChinese) { if (!matchChinese) {
throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getCode(), "必须包含汉语视频"); throw new InterfaceException(RESPONSE_CODE_ENUM.REQUEST_PARAMS_ERROR.getResultCode(), "必须包含汉语视频");
} }
int successCount = 0; int successCount = 0;
......
...@@ -9,6 +9,7 @@ import cn.wisenergy.chnmuseum.party.model.TArea; ...@@ -9,6 +9,7 @@ import cn.wisenergy.chnmuseum.party.model.TArea;
import cn.wisenergy.chnmuseum.party.model.TUser; import cn.wisenergy.chnmuseum.party.model.TUser;
import cn.wisenergy.chnmuseum.party.service.TAreaService; import cn.wisenergy.chnmuseum.party.service.TAreaService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -70,6 +71,20 @@ public class TOrganController extends BaseController { ...@@ -70,6 +71,20 @@ public class TOrganController extends BaseController {
@ApiOperation(value = "添加机构", notes = "添加机构") @ApiOperation(value = "添加机构", notes = "添加机构")
// @MethodLog(operModule = OperModule.ORG,operType = OperType.ADD) // @MethodLog(operModule = OperModule.ORG,operType = OperType.ADD)
public Map<String, Object> add(TOrgan organ) { public Map<String, Object> add(TOrgan organ) {
QueryWrapper<TOrgan> ew = new QueryWrapper<>();
if (StringUtils.isNoneBlank(organ.getName())) {
organ.setName(organ.getName().trim());
ew.eq("is_deleted", 0);
ew.eq("name", organ.getName());
List<TOrgan> list = this.tOrganService.list(ew);
if (list != null&&list.get(0)!=null) {
HashMap<String, Object> resultMap = new HashMap<>();
resultMap.put("resultCode", "500");
resultMap.put("message", "机构名称不能重复!");
return resultMap;
}
}
organ.setCreateTime(DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis())); organ.setCreateTime(DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis()));
organ.setUpdateTime(DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis())); organ.setUpdateTime(DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis()));
String organCode = getOrganCode(organ.getParentId()); String organCode = getOrganCode(organ.getParentId());
......
...@@ -64,8 +64,8 @@ public class BaseController implements Serializable { ...@@ -64,8 +64,8 @@ public class BaseController implements Serializable {
*/ */
protected Map<String, Object> getResult(Object obj) { protected Map<String, Object> getResult(Object obj) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getCode()); map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getResultCode());
map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getMsg()); map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getMessage());
map.put(RESULT_INFO_ENUM.RESULT_BODY.getKey(), obj); map.put(RESULT_INFO_ENUM.RESULT_BODY.getKey(), obj);
return map; return map;
} }
...@@ -77,8 +77,8 @@ public class BaseController implements Serializable { ...@@ -77,8 +77,8 @@ public class BaseController implements Serializable {
*/ */
protected Map<String, Object> getSuccessResult() { protected Map<String, Object> getSuccessResult() {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getCode()); map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getResultCode());
map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getMsg()); map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), RESPONSE_CODE_ENUM.REQUEST_SUCCESS.getMessage());
map.put(RESULT_INFO_ENUM.RESULT_BODY.getKey(),""); map.put(RESULT_INFO_ENUM.RESULT_BODY.getKey(),"");
return map; return map;
} }
...@@ -105,8 +105,8 @@ public class BaseController implements Serializable { ...@@ -105,8 +105,8 @@ public class BaseController implements Serializable {
*/ */
protected Map<String, Object> getFailResult(RESPONSE_CODE_ENUM responseCodeEnum) { protected Map<String, Object> getFailResult(RESPONSE_CODE_ENUM responseCodeEnum) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), responseCodeEnum.getCode()); map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), responseCodeEnum.getResultCode());
map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), responseCodeEnum.getMsg()); map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), responseCodeEnum.getMessage());
return map; return map;
} }
...@@ -117,8 +117,8 @@ public class BaseController implements Serializable { ...@@ -117,8 +117,8 @@ public class BaseController implements Serializable {
*/ */
protected Map<String, Object> getFailResult() { protected Map<String, Object> getFailResult() {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), RESPONSE_CODE_ENUM.SERVER_ERROR.getCode()); map.put(RESULT_INFO_ENUM.RESULT_CODE.getKey(), RESPONSE_CODE_ENUM.SERVER_ERROR.getResultCode());
map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), RESPONSE_CODE_ENUM.SERVER_ERROR.getMsg()); map.put(RESULT_INFO_ENUM.RESULT_MSG.getKey(), RESPONSE_CODE_ENUM.SERVER_ERROR.getMessage());
return map; return map;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment