|
@@ -13,6 +13,7 @@ import com.persagy.dmp.rwd.edit.entity.AdminUserProject;
|
|
|
import com.persagy.dmp.rwd.edit.entity.QAdminUser;
|
|
|
import com.persagy.dmp.rwd.edit.repository.AdminUserRepository;
|
|
|
import com.querydsl.core.types.dsl.BooleanExpression;
|
|
|
+import org.apache.commons.collections4.MapUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -20,6 +21,7 @@ import org.springframework.stereotype.Service;
|
|
|
import javax.transaction.Transactional;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
|
|
|
@Service
|
|
@@ -139,5 +141,22 @@ public class AdminUserService {
|
|
|
adminUserRepository.save(user);
|
|
|
return response;
|
|
|
}
|
|
|
+
|
|
|
+ public MapResponse chgpwd(Map<String, String> param) {
|
|
|
+ MapResponse resp = new MapResponse();
|
|
|
+
|
|
|
+ String oldPwd = MapUtils.getString(param, "oldPwd");
|
|
|
+ String newPwd = MapUtils.getString(param, "newPwd");
|
|
|
+
|
|
|
+ AdminUser user = adminUserRepository.findById(UserUtils.currentUserId()).get();
|
|
|
+
|
|
|
+ if (!user.getPassword().equalsIgnoreCase(MD5Utils.getSign(oldPwd))) {
|
|
|
+ resp.setFail("原密码错误");
|
|
|
+ } else {
|
|
|
+ user.setPassword(MD5Utils.getSign(newPwd));
|
|
|
+ adminUserRepository.save(user);
|
|
|
+ }
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
}
|
|
|
|