|
@@ -72,6 +72,10 @@ public class AdminServiceImpl implements AdminService {
|
|
|
if (CollectionUtils.isEmpty(adminDOS)) {
|
|
|
throw new AdminServiceException(ExceptionDefinition.ADMIN_NOT_EXIST);
|
|
|
}
|
|
|
+ if(adminDOS.get(0).getStatus()==0){
|
|
|
+ throw new AdminServiceException(ExceptionDefinition.ADMIN_NOT_JIHUO);
|
|
|
+
|
|
|
+ }
|
|
|
AdminDO adminDO = adminDOS.get(0);
|
|
|
// 短信验证码
|
|
|
// String code = cacheComponent.getRaw(ADMIN_MSG_CODE+adminDO.getPhone() );
|
|
@@ -161,6 +165,7 @@ public class AdminServiceImpl implements AdminService {
|
|
|
adminDO.setStatus(AdminStatusType.ACTIVE.getCode());
|
|
|
adminDO.setLastLoginIp("0.0.0.0");
|
|
|
adminDO.setGmtLastLogin("1997-01-20 00:00:00");
|
|
|
+ adminDO.setStatus(0);
|
|
|
if (adminMapper.insert(adminDO) > 0) {
|
|
|
adminDTO.setId(adminDO.getId());
|
|
|
return adminDTO;
|
|
@@ -192,6 +197,26 @@ public class AdminServiceImpl implements AdminService {
|
|
|
throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public String updateStatus(AdminDTO adminDTO, Long adminId) throws ServiceException {
|
|
|
+ Long id = adminDTO.getId();
|
|
|
+ if (id == null) {
|
|
|
+ throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
|
|
|
+ }
|
|
|
+ AdminDO adminDO = new AdminDO();
|
|
|
+ BeanUtils.copyProperties(adminDTO, adminDO);
|
|
|
+ adminDO.setGmtUpdate(new Date());
|
|
|
+ adminDO.setStatus(1);
|
|
|
+ if (adminMapper.updateById(adminDO) > 0) {
|
|
|
+ return "ok";
|
|
|
+ }
|
|
|
+ throw new AdminServiceException(ExceptionDefinition.ADMIN_UNKNOWN_EXCEPTION);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String delete(Long id, Long adminId) throws ServiceException {
|