|
@@ -1,10 +1,10 @@
|
|
-package com.huimv.admin.service.impl;
|
|
|
|
|
|
+package com.huimv.admin.service.primary.impl;
|
|
|
|
|
|
import com.huimv.admin.domain.primary.SysAccountEntity;
|
|
import com.huimv.admin.domain.primary.SysAccountEntity;
|
|
import com.huimv.admin.domain.primary.SysUserEntity;
|
|
import com.huimv.admin.domain.primary.SysUserEntity;
|
|
import com.huimv.admin.repo.primary.SysAccountEntityRepository;
|
|
import com.huimv.admin.repo.primary.SysAccountEntityRepository;
|
|
import com.huimv.admin.repo.primary.SysUserEntityRepository;
|
|
import com.huimv.admin.repo.primary.SysUserEntityRepository;
|
|
-import com.huimv.admin.service.IAccountService;
|
|
|
|
|
|
+import com.huimv.admin.service.primary.IAccountService;
|
|
import com.huimv.admin.utils.GetMD5Str;
|
|
import com.huimv.admin.utils.GetMD5Str;
|
|
import com.huimv.admin.utils.Result;
|
|
import com.huimv.admin.utils.Result;
|
|
import com.huimv.admin.utils.ResultCode;
|
|
import com.huimv.admin.utils.ResultCode;
|
|
@@ -31,7 +31,7 @@ public class AccountServiceImpl implements IAccountService {
|
|
sysAccountEntityRepository.updateAccountStatus(id,status);
|
|
sysAccountEntityRepository.updateAccountStatus(id,status);
|
|
}
|
|
}
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- return new Result(ResultCode.FAIL);
|
|
|
|
|
|
+ return new Result(10001,"插入失败",false);
|
|
}
|
|
}
|
|
String message = "";
|
|
String message = "";
|
|
if(status == 1){
|
|
if(status == 1){
|
|
@@ -39,7 +39,7 @@ public class AccountServiceImpl implements IAccountService {
|
|
}else{
|
|
}else{
|
|
message = "你选择的账号已经暂停启用。";
|
|
message = "你选择的账号已经暂停启用。";
|
|
}
|
|
}
|
|
- return new Result(10001,message,true);
|
|
|
|
|
|
+ return new Result(10000,message,true);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -54,15 +54,15 @@ public class AccountServiceImpl implements IAccountService {
|
|
}else if (userName != null && !"".equals(userName)){
|
|
}else if (userName != null && !"".equals(userName)){
|
|
sysAccountEntity.setAccountName(userName);
|
|
sysAccountEntity.setAccountName(userName);
|
|
}else {
|
|
}else {
|
|
- return new Result(ResultCode.FAIL);
|
|
|
|
|
|
+ return new Result(10000,"新增失败",false);
|
|
}
|
|
}
|
|
sysAccountEntity.setAccountStatus(1);
|
|
sysAccountEntity.setAccountStatus(1);
|
|
sysAccountEntity.setRemark("无");
|
|
sysAccountEntity.setRemark("无");
|
|
sysAccountEntity.setPassword(GetMD5Str.getMD5Str("123456"));
|
|
sysAccountEntity.setPassword(GetMD5Str.getMD5Str("123456"));
|
|
sysAccountEntityRepository.save(sysAccountEntity);
|
|
sysAccountEntityRepository.save(sysAccountEntity);
|
|
- return new Result(ResultCode.SUCCESS);
|
|
|
|
|
|
+ return new Result(10000,"插入成功",true);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- return new Result(ResultCode.FAIL);
|
|
|
|
|
|
+ return new Result(10001,"插入失败",false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -72,9 +72,9 @@ public class AccountServiceImpl implements IAccountService {
|
|
SysAccountEntity sysAccountEntity = sysAccountEntityRepository.findById(id).get();
|
|
SysAccountEntity sysAccountEntity = sysAccountEntityRepository.findById(id).get();
|
|
sysAccountEntity.setAccountStatus(accountStatus);
|
|
sysAccountEntity.setAccountStatus(accountStatus);
|
|
sysAccountEntityRepository.save(sysAccountEntity);
|
|
sysAccountEntityRepository.save(sysAccountEntity);
|
|
- return new Result(ResultCode.SUCCESS);
|
|
|
|
|
|
+ return new Result(10000,"修改成功",true);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- return new Result(ResultCode.FAIL);
|
|
|
|
|
|
+ return new Result(10001,"修改失败",false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -85,13 +85,14 @@ public class AccountServiceImpl implements IAccountService {
|
|
sysAccountEntityRepository.deleteById(id);
|
|
sysAccountEntityRepository.deleteById(id);
|
|
}
|
|
}
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- return new Result(ResultCode.FAIL);
|
|
|
|
|
|
+ return new Result(10001,"删除失败",false);
|
|
}
|
|
}
|
|
- return new Result(ResultCode.SUCCESS);
|
|
|
|
|
|
+ return new Result(10000,"删除成功",true);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<SysAccountEntity> findAll() {
|
|
|
|
- return sysAccountEntityRepository.findAll();
|
|
|
|
|
|
+ public Result findAll() {
|
|
|
|
+ List<SysAccountEntity> all = sysAccountEntityRepository.findAll();
|
|
|
|
+ return new Result(ResultCode.SUCCESS,all);
|
|
}
|
|
}
|
|
}
|
|
}
|