synchronizers
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
package org.maxkey.persistence.service;
|
||||
|
||||
import java.sql.Types;
|
||||
import java.util.List;
|
||||
import org.apache.mybatis.jpa.persistence.JpaBaseService;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
@@ -66,6 +67,15 @@ public class OrganizationsService extends JpaBaseService<Organizations>{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void saveOrUpdate(Organizations organization) {
|
||||
if(findOne(" id = ? and instid = ?",
|
||||
new Object[] { organization.getId().toString(), organization.getInstId() },
|
||||
new int[] { Types.VARCHAR, Types.VARCHAR }) == null) {
|
||||
insert(organization);
|
||||
}else {
|
||||
update(organization);
|
||||
}
|
||||
}
|
||||
public List<Organizations> queryOrgs(Organizations organization){
|
||||
return getMapper().queryOrgs(organization);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
package org.maxkey.persistence.service;
|
||||
|
||||
|
||||
import java.sql.Types;
|
||||
|
||||
import org.apache.mybatis.jpa.persistence.JpaBaseService;
|
||||
import org.maxkey.constants.ConstsStatus;
|
||||
import org.maxkey.crypto.password.PasswordReciprocal;
|
||||
@@ -163,6 +165,17 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
|
||||
}
|
||||
|
||||
|
||||
public void saveOrUpdate(UserInfo userInfo) {
|
||||
if(findOne(" username = ? and instid = ?",
|
||||
new Object[] { userInfo.getUsername(),userInfo.getInstId() },
|
||||
new int[] { Types.VARCHAR,Types.VARCHAR}) == null) {
|
||||
insert(userInfo);
|
||||
}else {
|
||||
userInfo.setPassword(null);
|
||||
update(userInfo);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean updateProtectedApps(UserInfo userinfo) {
|
||||
try {
|
||||
if(WebContext.getUserInfo() != null) {
|
||||
|
||||
Reference in New Issue
Block a user