mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-08 09:58:56 +08:00
mybatis-jpa-extra-2.7
This commit is contained in:
parent
dc686cb08c
commit
283c4a5bb6
@ -40,9 +40,11 @@ public class JsonPretty implements Pretty{
|
|||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
public String jacksonFormat(Object bean){
|
public String jacksonFormat(Object bean){
|
||||||
String prettyJson="";
|
String prettyJson = "";
|
||||||
try {
|
try {
|
||||||
prettyJson= (new ObjectMapper()).writerWithDefaultPrettyPrinter().writeValueAsString(bean);
|
prettyJson = (new ObjectMapper())
|
||||||
|
.writerWithDefaultPrettyPrinter()
|
||||||
|
.writeValueAsString(bean);
|
||||||
} catch (JsonGenerationException e) {
|
} catch (JsonGenerationException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (JsonMappingException e) {
|
} catch (JsonMappingException e) {
|
||||||
@ -59,7 +61,9 @@ public class JsonPretty implements Pretty{
|
|||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
public String format(Object bean){
|
public String format(Object bean){
|
||||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
Gson gson = new GsonBuilder()
|
||||||
|
.setPrettyPrinting()
|
||||||
|
.create();
|
||||||
String json = gson.toJson(bean);
|
String json = gson.toJson(bean);
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,6 +26,7 @@ import java.util.StringTokenizer;
|
|||||||
import org.maxkey.pretty.Pretty;
|
import org.maxkey.pretty.Pretty;
|
||||||
|
|
||||||
public class SqlPretty implements Pretty{
|
public class SqlPretty implements Pretty{
|
||||||
|
|
||||||
public static final String WHITESPACE = " \n\r\f\t";
|
public static final String WHITESPACE = " \n\r\f\t";
|
||||||
private static final Set<String> BEGIN_CLAUSES = new HashSet<String>();
|
private static final Set<String> BEGIN_CLAUSES = new HashSet<String>();
|
||||||
private static final Set<String> END_CLAUSES = new HashSet<String>();
|
private static final Set<String> END_CLAUSES = new HashSet<String>();
|
||||||
@ -33,6 +34,9 @@ public class SqlPretty implements Pretty{
|
|||||||
private static final Set<String> QUANTIFIERS = new HashSet<String>();
|
private static final Set<String> QUANTIFIERS = new HashSet<String>();
|
||||||
private static final Set<String> DML = new HashSet<String>();
|
private static final Set<String> DML = new HashSet<String>();
|
||||||
private static final Set<String> MISC = new HashSet<String>();
|
private static final Set<String> MISC = new HashSet<String>();
|
||||||
|
private static final String INDENT_STRING = " ";
|
||||||
|
//mhshi modify
|
||||||
|
private static final String INITIAL = "";//System.lineSeparator() + INDENT_STRING;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
BEGIN_CLAUSES.add( "left" );
|
BEGIN_CLAUSES.add( "left" );
|
||||||
@ -72,10 +76,6 @@ public class SqlPretty implements Pretty{
|
|||||||
MISC.add( "on" );
|
MISC.add( "on" );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String INDENT_STRING = " ";
|
|
||||||
//mhshi modify
|
|
||||||
private static final String INITIAL = "";//System.lineSeparator() + INDENT_STRING;
|
|
||||||
|
|
||||||
public SqlPretty() {
|
public SqlPretty() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,10 +20,15 @@ package org.maxkey.constants;
|
|||||||
public class ConstantsEntryType {
|
public class ConstantsEntryType {
|
||||||
|
|
||||||
public static int USERINFO_TYPE = 1;
|
public static int USERINFO_TYPE = 1;
|
||||||
public static int ORG_TYPE = 2;
|
|
||||||
|
public static int ORGANIZATION_TYPE = 2;
|
||||||
|
|
||||||
public static int GROUP_TYPE = 3;
|
public static int GROUP_TYPE = 3;
|
||||||
|
|
||||||
public static int PASSWORD_TYPE = 4;
|
public static int PASSWORD_TYPE = 4;
|
||||||
|
|
||||||
public static int RESOURCES_TYPE = 5;
|
public static int RESOURCES_TYPE = 5;
|
||||||
|
|
||||||
public static int PERMISSIONS_TYPE = 6;
|
public static int PERMISSIONS_TYPE = 6;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,14 +20,23 @@ package org.maxkey.constants;
|
|||||||
public class ConstantsLoginType {
|
public class ConstantsLoginType {
|
||||||
|
|
||||||
public static final String LOCAL = "Local Login";
|
public static final String LOCAL = "Local Login";
|
||||||
|
|
||||||
public static final String BASIC = "Basic";
|
public static final String BASIC = "Basic";
|
||||||
|
|
||||||
public static final String SOCIALSIGNON = "Social Sign On";
|
public static final String SOCIALSIGNON = "Social Sign On";
|
||||||
|
|
||||||
public static final String REMEBER_ME = "RemeberMe";
|
public static final String REMEBER_ME = "RemeberMe";
|
||||||
|
|
||||||
public static final String DESKTOP = "Desktop";
|
public static final String DESKTOP = "Desktop";
|
||||||
|
|
||||||
public static final String KERBEROS = "Kerberos";
|
public static final String KERBEROS = "Kerberos";
|
||||||
|
|
||||||
public static final String SAMLTRUST = "SAML v2.0 Trust";
|
public static final String SAMLTRUST = "SAML v2.0 Trust";
|
||||||
|
|
||||||
public static final String MSADTRUST = "MS AD Trust";
|
public static final String MSADTRUST = "MS AD Trust";
|
||||||
|
|
||||||
public static final String CAS = "CAS";
|
public static final String CAS = "CAS";
|
||||||
|
|
||||||
public static final String WSFEDERATION = "WsFederation";
|
public static final String WSFEDERATION = "WsFederation";
|
||||||
|
|
||||||
public static final String JWT = "Jwt";
|
public static final String JWT = "Jwt";
|
||||||
|
|||||||
@ -28,8 +28,8 @@ public final class ConstantsPasswordSetType {
|
|||||||
|
|
||||||
public static final int INITIAL_PASSWORD = 1;
|
public static final int INITIAL_PASSWORD = 1;
|
||||||
|
|
||||||
public static final int MANAGER_CHANGED_PASSWORD = 2;
|
|
||||||
|
|
||||||
public static final int PASSWORD_EXPIRED = 3;
|
public static final int PASSWORD_EXPIRED = 3;
|
||||||
|
|
||||||
|
public static final int MANAGER_CHANGED_PASSWORD = 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,18 +32,18 @@ public final class ConstantsProtocols {
|
|||||||
|
|
||||||
public static final String TOKENBASED = "Token_Based";
|
public static final String TOKENBASED = "Token_Based";
|
||||||
|
|
||||||
// OAuth
|
|
||||||
public static final String OAUTH20 = "OAuth_v2.0";
|
|
||||||
|
|
||||||
public static final String OAUTH21 = "OAuth_v2.1";
|
|
||||||
|
|
||||||
// SAML
|
// SAML
|
||||||
public static final String SAML20 = "SAML_v2.0";
|
public static final String SAML20 = "SAML_v2.0";
|
||||||
|
|
||||||
public static final String OPEN_ID_CONNECT10 = "OpenID_Connect_v1.0";
|
|
||||||
|
|
||||||
public static final String CAS = "CAS";
|
public static final String CAS = "CAS";
|
||||||
|
|
||||||
public static final String JWT = "JWT";
|
public static final String JWT = "JWT";
|
||||||
|
|
||||||
|
// OAuth
|
||||||
|
public static final String OAUTH20 = "OAuth_v2.0";
|
||||||
|
|
||||||
|
public static final String OAUTH21 = "OAuth_v2.1";
|
||||||
|
|
||||||
|
public static final String OPEN_ID_CONNECT10 = "OpenID_Connect_v1.0";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,6 +45,4 @@ public class ContentType {
|
|||||||
|
|
||||||
public static final String IMAGE_PNG = "image/png";
|
public static final String IMAGE_PNG = "image/png";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -86,7 +86,7 @@ public class FormBasedDetailsServiceTest {
|
|||||||
idList.add("ab7422e9-a91a-4840-9e59-9d911257c918");
|
idList.add("ab7422e9-a91a-4840-9e59-9d911257c918");
|
||||||
idList.add("12b6ceb8-573b-4f01-ad85-cfb24cfa007c");
|
idList.add("12b6ceb8-573b-4f01-ad85-cfb24cfa007c");
|
||||||
idList.add("dafd5ba4-d2e3-4656-bd42-178841e610fe");
|
idList.add("dafd5ba4-d2e3-4656-bd42-178841e610fe");
|
||||||
service.batchDelete(idList);
|
service.deleteBatch(idList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@ -76,19 +76,17 @@ public class AuthorizeBaseEndpoint {
|
|||||||
Accounts account=new Accounts();
|
Accounts account=new Accounts();
|
||||||
UserInfo userInfo=WebContext.getUserInfo();
|
UserInfo userInfo=WebContext.getUserInfo();
|
||||||
Apps loadApp = getApp(app.getId());
|
Apps loadApp = getApp(app.getId());
|
||||||
if(loadApp.getCredential()==Apps.CREDENTIALS.USER_DEFINED){
|
if(loadApp.getCredential() == Apps.CREDENTIALS.USER_DEFINED){
|
||||||
|
account = accountsService.load(new Accounts(userInfo.getId(),loadApp.getId()));
|
||||||
account=accountsService.load(new Accounts(userInfo.getId(),loadApp.getId()));
|
if(account != null){
|
||||||
if(account!=null){
|
|
||||||
account.setRelatedPassword(PasswordReciprocal.getInstance().decoder(account.getRelatedPassword()));
|
account.setRelatedPassword(PasswordReciprocal.getInstance().decoder(account.getRelatedPassword()));
|
||||||
}
|
}
|
||||||
}else if(loadApp.getCredential()==Apps.CREDENTIALS.SHARED){
|
|
||||||
|
|
||||||
|
}else if(loadApp.getCredential() == Apps.CREDENTIALS.SHARED){
|
||||||
account.setRelatedUsername(loadApp.getSharedUsername());
|
account.setRelatedUsername(loadApp.getSharedUsername());
|
||||||
account.setRelatedPassword(PasswordReciprocal.getInstance().decoder(loadApp.getSharedPassword()));
|
account.setRelatedPassword(PasswordReciprocal.getInstance().decoder(loadApp.getSharedPassword()));
|
||||||
|
|
||||||
}else if(loadApp.getCredential()==Apps.CREDENTIALS.SYSTEM){
|
}else if(loadApp.getCredential() == Apps.CREDENTIALS.SYSTEM){
|
||||||
|
|
||||||
if(loadApp.getSystemUserAttr().equalsIgnoreCase("userId")){
|
if(loadApp.getSystemUserAttr().equalsIgnoreCase("userId")){
|
||||||
account.setUsername(userInfo.getId());
|
account.setUsername(userInfo.getId());
|
||||||
}else if(loadApp.getSystemUserAttr().equalsIgnoreCase("username")){
|
}else if(loadApp.getSystemUserAttr().equalsIgnoreCase("username")){
|
||||||
@ -104,7 +102,6 @@ public class AuthorizeBaseEndpoint {
|
|||||||
account.setRelatedPassword(PasswordReciprocal.getInstance().decoder(WebContext.getUserInfo().getDecipherable()));
|
account.setRelatedPassword(PasswordReciprocal.getInstance().decoder(WebContext.getUserInfo().getDecipherable()));
|
||||||
|
|
||||||
}else if(loadApp.getCredential()==Apps.CREDENTIALS.NONE){
|
}else if(loadApp.getCredential()==Apps.CREDENTIALS.NONE){
|
||||||
|
|
||||||
account.setUsername(userInfo.getUsername());
|
account.setUsername(userInfo.getUsername());
|
||||||
account.setRelatedPassword(userInfo.getUsername());
|
account.setRelatedPassword(userInfo.getUsername());
|
||||||
|
|
||||||
|
|||||||
@ -44,6 +44,6 @@ public class OnlineTicketEndpoint {
|
|||||||
public String ticketValidate(
|
public String ticketValidate(
|
||||||
@RequestParam(value ="ticket",required = true) String ticket) {
|
@RequestParam(value ="ticket",required = true) String ticket) {
|
||||||
OnlineTicket onlineTicket = onlineTicketServices.get(ticket);
|
OnlineTicket onlineTicket = onlineTicketServices.get(ticket);
|
||||||
return onlineTicket == null ? "" :onlineTicket.getTicketId();
|
return onlineTicket == null ? "" : onlineTicket.getTicketId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,12 +21,12 @@ package org.maxkey.authz.cas.endpoint.ticket;
|
|||||||
public class CasConstants {
|
public class CasConstants {
|
||||||
/* CAS Protocol Parameters. **/
|
/* CAS Protocol Parameters. **/
|
||||||
public static final class PARAMETER{
|
public static final class PARAMETER{
|
||||||
public final static String ENDPOINT_CAS_DETAILS="CAS_AUTHORIZE_ENDPOINT_CAS_DETAILS";
|
public final static String ENDPOINT_CAS_DETAILS = "CAS_AUTHORIZE_ENDPOINT_CAS_DETAILS";
|
||||||
|
|
||||||
public final static String PARAMETER_MAP="CAS_AUTHORIZE_ENDPOINT_PARAMETER_MAP";
|
public final static String PARAMETER_MAP = "CAS_AUTHORIZE_ENDPOINT_PARAMETER_MAP";
|
||||||
|
|
||||||
/** Constant representing the ticket parameter in the request. */
|
/** Constant representing the ticket parameter in the request. */
|
||||||
public final static String TICKET="ticket";
|
public final static String TICKET = "ticket";
|
||||||
|
|
||||||
/** Constant representing the service parameter in the request. */
|
/** Constant representing the service parameter in the request. */
|
||||||
public static final String SERVICE = "service";
|
public static final String SERVICE = "service";
|
||||||
|
|||||||
@ -139,7 +139,7 @@ public class AdaptersController {
|
|||||||
public Message delete(@ModelAttribute("appsAdapter") AppsAdapters appsAdapter) {
|
public Message delete(@ModelAttribute("appsAdapter") AppsAdapters appsAdapter) {
|
||||||
_logger.debug("-delete appsAdapter :" + appsAdapter);
|
_logger.debug("-delete appsAdapter :" + appsAdapter);
|
||||||
|
|
||||||
if (appsAdaptersService.batchDelete(appsAdapter.getId())) {
|
if (appsAdaptersService.deleteBatch(appsAdapter.getId())) {
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -166,7 +166,7 @@ public class ApplicationsController extends BaseAppContorller {
|
|||||||
@RequestMapping(value={"/delete"})
|
@RequestMapping(value={"/delete"})
|
||||||
public Message delete(@ModelAttribute("application") Apps application) {
|
public Message delete(@ModelAttribute("application") Apps application) {
|
||||||
_logger.debug("-delete application :" + application);
|
_logger.debug("-delete application :" + application);
|
||||||
if (appsService.batchDelete(application.getId())) {
|
if (appsService.deleteBatch(application.getId())) {
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -144,7 +144,7 @@ public class AccountsController {
|
|||||||
|
|
||||||
_logger.debug("-delete AppAccounts :" + appAccounts);
|
_logger.debug("-delete AppAccounts :" + appAccounts);
|
||||||
|
|
||||||
accountsService.batchDelete(appAccounts.getId());
|
accountsService.deleteBatch(appAccounts.getId());
|
||||||
|
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
||||||
|
|
||||||
|
|||||||
@ -157,7 +157,7 @@ public class GroupMemberController {
|
|||||||
return new Message("传入参数为空",MessageType.error);
|
return new Message("传入参数为空",MessageType.error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(groupMemberService.batchDelete(groupMember.getId())) {
|
if(groupMemberService.deleteBatch(groupMember.getId())) {
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info);
|
||||||
}
|
}
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
|
||||||
|
|||||||
@ -129,7 +129,7 @@ public class GroupPrivilegesController {
|
|||||||
return new Message("传入参数为空",MessageType.error);
|
return new Message("传入参数为空",MessageType.error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(groupPrivilegesService.batchDelete(groupApp.getId())) {
|
if(groupPrivilegesService.deleteBatch(groupApp.getId())) {
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -131,7 +131,7 @@ public class NoticesController {
|
|||||||
public Message delete(@ModelAttribute("notice")Notices notice) {
|
public Message delete(@ModelAttribute("notice")Notices notice) {
|
||||||
_logger.debug("-delete notice :" + notice);
|
_logger.debug("-delete notice :" + notice);
|
||||||
|
|
||||||
if (noticesService.batchDelete(notice.getId())) {
|
if (noticesService.deleteBatch(notice.getId())) {
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -175,7 +175,7 @@ public class OrganizationsController {
|
|||||||
@RequestMapping({"/delete"})
|
@RequestMapping({"/delete"})
|
||||||
public Message delete(@ModelAttribute("org") Organizations org) {
|
public Message delete(@ModelAttribute("org") Organizations org) {
|
||||||
_logger.debug("-delete organization :" + org);
|
_logger.debug("-delete organization :" + org);
|
||||||
if (this.organizationsService.batchDelete(org.getId())) {
|
if (this.organizationsService.deleteBatch(org.getId())) {
|
||||||
return new Message(WebContext.getI18nValue("message.action.delete.success"), MessageType.success);
|
return new Message(WebContext.getI18nValue("message.action.delete.success"), MessageType.success);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ public class OrganizationsController {
|
|||||||
// 数据去重
|
// 数据去重
|
||||||
if(!CollectionUtils.isEmpty(orgsList)){
|
if(!CollectionUtils.isEmpty(orgsList)){
|
||||||
orgsList = orgsList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getId()))), ArrayList::new));
|
orgsList = orgsList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getId()))), ArrayList::new));
|
||||||
if(organizationsService.batchInsert(orgsList)) {
|
if(organizationsService.insertBatch(orgsList)) {
|
||||||
new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS), null, MessageType.success, OperateType.add, MessageScope.DB);
|
new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS), null, MessageType.success, OperateType.add, MessageScope.DB);
|
||||||
}else {
|
}else {
|
||||||
new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR), MessageType.error);
|
new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR), MessageType.error);
|
||||||
|
|||||||
@ -144,7 +144,7 @@ public class ResourcesController {
|
|||||||
public Message delete(@ModelAttribute("resource") Resources resource) {
|
public Message delete(@ModelAttribute("resource") Resources resource) {
|
||||||
_logger.debug("-delete resource :" + resource);
|
_logger.debug("-delete resource :" + resource);
|
||||||
|
|
||||||
if (resourcesService.batchDelete(resource.getId())) {
|
if (resourcesService.deleteBatch(resource.getId())) {
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -144,7 +144,7 @@ public class RoleMemberController {
|
|||||||
return new Message("传入参数为空",MessageType.error);
|
return new Message("传入参数为空",MessageType.error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(roleMemberService.batchDelete(roleMember.getId())) {
|
if(roleMemberService.deleteBatch(roleMember.getId())) {
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS),MessageType.info);
|
||||||
}
|
}
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR),MessageType.error);
|
||||||
|
|||||||
@ -133,7 +133,7 @@ public class SocialsProviderController {
|
|||||||
public Message delete(@ModelAttribute("socialsProvider") SocialsProvider socialsProvider) {
|
public Message delete(@ModelAttribute("socialsProvider") SocialsProvider socialsProvider) {
|
||||||
_logger.debug("-delete socialsProvider :" + socialsProvider);
|
_logger.debug("-delete socialsProvider :" + socialsProvider);
|
||||||
|
|
||||||
if (socialsProviderService.batchDelete(socialsProvider.getId())) {
|
if (socialsProviderService.deleteBatch(socialsProvider.getId())) {
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -136,7 +136,7 @@ public class UserAdjointController {
|
|||||||
public Message delete(@ModelAttribute("userInfoAdjoint") UserInfoAdjoint userInfoAdjoint) {
|
public Message delete(@ModelAttribute("userInfoAdjoint") UserInfoAdjoint userInfoAdjoint) {
|
||||||
_logger.debug("-delete group :" + userInfoAdjoint);
|
_logger.debug("-delete group :" + userInfoAdjoint);
|
||||||
|
|
||||||
if (userInfoAdjointService.batchDelete(userInfoAdjoint.getId())) {
|
if (userInfoAdjointService.deleteBatch(userInfoAdjoint.getId())) {
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
||||||
} else {
|
} else {
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.error);
|
||||||
|
|||||||
@ -217,7 +217,7 @@ public class UserInfoController {
|
|||||||
@RequestMapping(value="/batchDelete")
|
@RequestMapping(value="/batchDelete")
|
||||||
public Message batchDeleteUsers(@RequestParam("id")String id) {
|
public Message batchDeleteUsers(@RequestParam("id")String id) {
|
||||||
_logger.debug(id);
|
_logger.debug(id);
|
||||||
if(userInfoService.batchDelete(StringUtils.string2List(id, ","))) {
|
if(userInfoService.deleteBatch(StringUtils.string2List(id, ","))) {
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -235,7 +235,7 @@ public class UserInfoController {
|
|||||||
@RequestMapping(value="/delete")
|
@RequestMapping(value="/delete")
|
||||||
public Message deleteUsersById(@RequestParam("id") String id) {
|
public Message deleteUsersById(@RequestParam("id") String id) {
|
||||||
_logger.debug(id);
|
_logger.debug(id);
|
||||||
if(userInfoService.batchDelete(id)) {
|
if(userInfoService.deleteBatch(id)) {
|
||||||
//provisioningPrepare.prepare(userInfo, OPERATEACTION.DELETE_ACTION);
|
//provisioningPrepare.prepare(userInfo, OPERATEACTION.DELETE_ACTION);
|
||||||
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.DELETE_SUCCESS),MessageType.success);
|
||||||
} else {
|
} else {
|
||||||
@ -313,7 +313,7 @@ public class UserInfoController {
|
|||||||
// 数据去重
|
// 数据去重
|
||||||
if(!CollectionUtils.isEmpty(userInfoList)){
|
if(!CollectionUtils.isEmpty(userInfoList)){
|
||||||
userInfoList = userInfoList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getUsername()))), ArrayList::new));
|
userInfoList = userInfoList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getUsername()))), ArrayList::new));
|
||||||
if( userInfoService.batchInsert(userInfoList)) {
|
if( userInfoService.insertBatch(userInfoList)) {
|
||||||
new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS), null, MessageType.success, OperateType.add, MessageScope.DB);
|
new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_SUCCESS), null, MessageType.success, OperateType.add, MessageScope.DB);
|
||||||
}else {
|
}else {
|
||||||
new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR), MessageType.error);
|
new Message(WebContext.getI18nValue(ConstantsOperateMessage.INSERT_ERROR), MessageType.error);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user