P2-1: 移植 EIP3 组织/用户/角色/OTP 模块进保真层(原样,包名签名不动)
framework/com.dsasp.server.organize/src 的 5 个 impl 原样移入 platform-legacy-core: OrganizationServiceImpl / UserFindServiceImpl / RoleServiceImpl / UserOtpServiceImpl / AssignmentHandlerImpl(Activator 不移植,见手册 §5.17)。 补齐依赖闭包(legacy-core 原无): - common 接口 5 个:OrganizationService / UserFindService / RoleService / UserOtpService / AssignmentHandler - AssignmentHandlerImpl 的 workflow 依赖:ProcessDefinitionService + WFMould OTP 库 jotpverify.jar(ft.otp.verify.OTPVerify,无公网坐标)经 platform-legacy-core/local-libs 模块内私有仓库解析(file://), 父 pom 不动,构建可复现(手册 §5.OTP)。 LegacyXmlWiring 补 4 个 impl 的 setter 注入(等价原 organize service.xml <property>,旧类零修改,手册 §4.1)。 privilege 模块 diff 核查:除 OSGi Activator 外已全部在仓库,无需再搬。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,11 +13,20 @@ import com.dsasp.server.common.log.service.SystemLogManager;
|
||||
import com.dsasp.server.core.service.FlowServiceImpl;
|
||||
import com.dsasp.server.dataDic.service.POJOCRUDServiceImpl;
|
||||
import com.dsasp.server.dataDic.service.POJOServiceImpl;
|
||||
import com.dsasp.server.organize.service.AssignmentHandlerImpl;
|
||||
import com.dsasp.server.organize.service.OrganizationServiceImpl;
|
||||
import com.dsasp.server.organize.service.UserFindServiceImpl;
|
||||
import com.dsasp.server.organize.service.UserOtpServiceImpl;
|
||||
|
||||
/**
|
||||
* 等价替代原 com.dsasp.server.dataDic/META-INF/spring/service.xml 的
|
||||
* <property> setter 装配:systemLogManager / dataOperatorLog 在旧代码中
|
||||
* 不是 @Autowired 字段,而是 XML 注入。这里集中补齐,旧类零修改。
|
||||
*
|
||||
* <p>P2 组织/用户:OrganizationServiceImpl / UserFindServiceImpl / UserOtpServiceImpl /
|
||||
* AssignmentHandlerImpl 的依赖(pojoCRUDService、jdbcTemplate、organizationService、userFindService)
|
||||
* 在 framework 同样是 XML <property> setter 注入(非 @Autowired 字段),这里一并补齐
|
||||
* (旧类零修改,见迁移手册 §4.1)。RoleServiceImpl.jdbcTemplate 是 @Autowired,无需手工补。
|
||||
*/
|
||||
@Configuration
|
||||
public class LegacyXmlWiring implements SmartInitializingSingleton {
|
||||
@@ -28,19 +37,31 @@ public class LegacyXmlWiring implements SmartInitializingSingleton {
|
||||
private final DataOperatorLog dataOperatorLog;
|
||||
private final FlowServiceImpl flowService;
|
||||
private final JdbcTemplate jdbcTemplate;
|
||||
private final OrganizationServiceImpl organizationService;
|
||||
private final UserFindServiceImpl userFindService;
|
||||
private final UserOtpServiceImpl userOtpService;
|
||||
private final AssignmentHandlerImpl assignmentHandler;
|
||||
|
||||
public LegacyXmlWiring(POJOCRUDServiceImpl pojoCRUDService,
|
||||
POJOServiceImpl pojoService,
|
||||
SystemLogManager systemLogManager,
|
||||
DataOperatorLog dataOperatorLog,
|
||||
FlowServiceImpl flowService,
|
||||
JdbcTemplate jdbcTemplate) {
|
||||
JdbcTemplate jdbcTemplate,
|
||||
OrganizationServiceImpl organizationService,
|
||||
UserFindServiceImpl userFindService,
|
||||
UserOtpServiceImpl userOtpService,
|
||||
AssignmentHandlerImpl assignmentHandler) {
|
||||
this.pojoCRUDService = pojoCRUDService;
|
||||
this.pojoService = pojoService;
|
||||
this.systemLogManager = systemLogManager;
|
||||
this.dataOperatorLog = dataOperatorLog;
|
||||
this.flowService = flowService;
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
this.organizationService = organizationService;
|
||||
this.userFindService = userFindService;
|
||||
this.userOtpService = userOtpService;
|
||||
this.assignmentHandler = assignmentHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,6 +72,17 @@ public class LegacyXmlWiring implements SmartInitializingSingleton {
|
||||
// 服务流引擎:FlowServiceImpl.jdbcTemplate 在 framework 经 XML <property> 注入,非 @Autowired 字段。
|
||||
// 等价补齐(见迁移手册 §4.1)。仅 isExistEntityFlow/addDefaultFlowService 用到,执行路径不依赖。
|
||||
flowService.setJdbcTemplate(jdbcTemplate);
|
||||
|
||||
// P2 组织/用户:等价原 com.dsasp.server.organize/META-INF/spring/*.xml 的 <property> 注入
|
||||
organizationService.setPojoCRUDService(pojoCRUDService);
|
||||
organizationService.setJdbcTemplate(jdbcTemplate);
|
||||
userFindService.setPojoCRUDService(pojoCRUDService);
|
||||
userFindService.setJdbcTemplate(jdbcTemplate);
|
||||
userFindService.setOrganizationService(organizationService);
|
||||
userOtpService.setPojoCRUDService(pojoCRUDService);
|
||||
userOtpService.setJdbcTemplate(jdbcTemplate);
|
||||
assignmentHandler.setOrganizationService(organizationService);
|
||||
assignmentHandler.setUserFindService(userFindService);
|
||||
}
|
||||
|
||||
/** 引擎字段值含 joda DateTime(CREATETIME 等),Boot 3 需显式注册序列化模块。 */
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>ft.otp</groupId>
|
||||
<artifactId>jotpverify</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
<description>EIP3 旧系统动态令牌(OTP)校验库 jotpverify.jar(ft.otp.verify.OTPVerify),
|
||||
UserOtpServiceImpl 依赖。无公网坐标,随工程置于 platform-legacy-core/local-libs 项目内私有仓库,
|
||||
经模块 pom 的 file:// repository 解析,构建可复现,父 pom 不动。</description>
|
||||
</project>
|
||||
@@ -11,6 +11,20 @@
|
||||
<artifactId>platform-legacy-core</artifactId>
|
||||
<name>platform-legacy-core</name>
|
||||
<description>保真层:移植引擎原样,包名 com.dsasp.* 不动。对拍=完成定义,与 framework 源码 diff 保持最小</description>
|
||||
|
||||
<repositories>
|
||||
<!-- P2:UserOtpServiceImpl 依赖旧系统动态令牌库 jotpverify.jar(ft.otp.verify.OTPVerify),
|
||||
无公网坐标。置于本模块内 local-libs/ 私有仓库(标准 Maven repo 布局),构建可复现、
|
||||
父 pom 不动。详见 platform-auth/P2组织权限实测报告.md。 -->
|
||||
<repository>
|
||||
<id>legacy-core-local-libs</id>
|
||||
<name>EIP3 旧系统私有 jar(项目内)</name>
|
||||
<url>file://${project.basedir}/local-libs</url>
|
||||
<releases><enabled>true</enabled></releases>
|
||||
<snapshots><enabled>false</enabled></snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jdbc</artifactId></dependency>
|
||||
<dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId></dependency>
|
||||
@@ -27,6 +41,9 @@
|
||||
与 framework 原版一致(原样移植,不改 Jackson 2);传递依赖 jackson-core-asl -->
|
||||
<dependency><groupId>org.codehaus.jackson</groupId><artifactId>jackson-mapper-asl</artifactId></dependency>
|
||||
<dependency><groupId>jakarta.servlet</groupId><artifactId>jakarta.servlet-api</artifactId><scope>provided</scope></dependency>
|
||||
<!-- P2 组织/用户:UserOtpServiceImpl(动态令牌认证)依赖旧系统 OTP 校验库,
|
||||
经本模块 local-libs 私有仓库解析(见上 <repositories>);原样移植,一行不改 -->
|
||||
<dependency><groupId>ft.otp</groupId><artifactId>jotpverify</artifactId><version>1.0.0</version></dependency>
|
||||
<!-- C2 单测:DataFilterHelper JSON 互转 + getWhereClause 拼接(纯逻辑,假 POJOInfo) -->
|
||||
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.dsasp.server.common.organization.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface OrganizationService {
|
||||
|
||||
// public List<Org> getOrgs();
|
||||
//
|
||||
// public List<Depart> getDeparts(String orgId);
|
||||
//
|
||||
// public List<Position> getPositions(String departId);
|
||||
//
|
||||
// public boolean assignUsersForPosition(String positionId, List<String> userIds);
|
||||
//
|
||||
// public boolean assignPositionsForUser(String userId, List<String> positionIds);
|
||||
//
|
||||
// /**
|
||||
// * set user's main position, everyone is only one main position except admin
|
||||
// * @param userId
|
||||
// * @param positionId
|
||||
// * @return
|
||||
// */
|
||||
// public boolean setMainPosition(String userId, String positionId);
|
||||
//
|
||||
// /**
|
||||
// * get user's main position,
|
||||
// * @param userId
|
||||
// * @return
|
||||
// */
|
||||
// public Position getMainPosition(String userId);
|
||||
//
|
||||
// /**
|
||||
// *
|
||||
// * @param dimensionId
|
||||
// * @return
|
||||
// */
|
||||
// public List<DimensionDepart> getDimensionDeparts(String dimensionId);
|
||||
|
||||
// /**
|
||||
// * 获取所有组织
|
||||
// * @return
|
||||
// */
|
||||
// public List<GeneralPOJO> getOrgs();
|
||||
//
|
||||
// /**
|
||||
// * 获取某个组织下的所有部门
|
||||
// * @param orgId 组织ID
|
||||
// * @return
|
||||
// */
|
||||
// public List<GeneralPOJO> getDeparts(String orgId);
|
||||
|
||||
// /**
|
||||
// * 获取某个部门下的所有岗位
|
||||
// * @param departId 部门ID
|
||||
// * @return
|
||||
// */
|
||||
// public List<GeneralPOJO> getPositions(String departId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户的所有岗位
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public List<String> getPositionsByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 获取用户的主岗位
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public String getMainPosition(String userId);
|
||||
|
||||
/**
|
||||
* 获取用户的主部门
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public String getMainDepart(String userId);
|
||||
|
||||
/**
|
||||
* 查询指定部门下的指定岗位类别的所有岗位
|
||||
* @param departId 部门ID
|
||||
* @param positionType 岗位类别ID
|
||||
* @return
|
||||
*/
|
||||
public List<String> getPositionsByDepartAndPositionType(String departId,String positionType);
|
||||
|
||||
/**
|
||||
* 查询指定部门下的指定岗位类别的所有岗位
|
||||
* @param departId 部门ID
|
||||
* @param positionTypes 岗位类别ID
|
||||
* @return
|
||||
*/
|
||||
public List<String> getPositionsByDepartAndPositionTypes(String departId,List<String> positionTypes);
|
||||
|
||||
/**
|
||||
* 查询指定公司下的指定岗位类别的所有岗位
|
||||
* @param orgId 公司ID
|
||||
* @param positionTypes 岗位类别ID
|
||||
* @return
|
||||
*/
|
||||
public List<String> getPositionsByOrgAndPositionTypes(String orgId,List<String> positionTypes);
|
||||
|
||||
/**
|
||||
* 查询部门所属公司
|
||||
* @param departId
|
||||
* @return
|
||||
*/
|
||||
public String getOrgIdByDepartId(String departId);
|
||||
|
||||
/**
|
||||
* 查询指定岗位类别的所有岗位
|
||||
* @param departId 部门ID
|
||||
* @param positionTypes 岗位类别ID
|
||||
* @return
|
||||
*/
|
||||
public List<String> getPositionsByPositionTypes(List<String> positionTypes);
|
||||
|
||||
public List<Map<String,Object>> getDepartTreeByOrgId(String orgid);
|
||||
|
||||
/**
|
||||
* 查询用户所属(组织、部门、岗位)
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public List<String> findUserContainer(String userId);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.dsasp.server.common.user.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wuqz
|
||||
*
|
||||
*/
|
||||
public interface AssignmentHandler {
|
||||
|
||||
public List<String> assignmentUser(Object ...objects);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.dsasp.server.common.user.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface RoleService {
|
||||
|
||||
public boolean assignRoleForUser(String userId, List<String> roleIds);
|
||||
|
||||
public boolean assignUserForRole(String roleId, List<String> userIds);
|
||||
|
||||
/**
|
||||
* 根据用户id获取用户角色
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public List<String> findRolesByUserId(String userId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.dsasp.server.common.user.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UserFindService {
|
||||
|
||||
public List<String> findUsersByPositions(List<String> positionIds);
|
||||
|
||||
public List<String> findUsersByPosizion(String positionId);
|
||||
|
||||
public List<String> findUsersByRoles(List<String> roleIds);
|
||||
|
||||
public List<String> findUsersByRoles(String roleId);
|
||||
|
||||
public List<String> findUsersByDepart(String departId);
|
||||
|
||||
public List<String> findUsersByDeparts(List<String> departIds);
|
||||
|
||||
public List<String> findUsersByOrg(String orgId);
|
||||
|
||||
public List<String> findUsersByOrgs(List<String> orgIds);
|
||||
|
||||
public List<String> findDirectLeader(String userId);
|
||||
|
||||
public List<String> findDepartManager(String departId);
|
||||
|
||||
/**
|
||||
* search the users by positionType , dimension and currentDepart
|
||||
* @param departId
|
||||
* @param dimension
|
||||
* @param positionType
|
||||
* @param direction 0: up, 1: down
|
||||
* @return
|
||||
*/
|
||||
public List<String> findUsersByDimenPositionType(String curPositionId, String dimension, String positionType, int direction);
|
||||
|
||||
/**
|
||||
* search all the users of the dimension by positionType
|
||||
* @param dimension
|
||||
* @param positionType
|
||||
* @return
|
||||
*/
|
||||
public List<String> findUserByDimenPositionType(String dimension, String positionType);
|
||||
|
||||
public List<String> findUsersByDepartPositionType(String departId, String positionType);
|
||||
|
||||
public List<String> findUsersByDepartPositionTypes(String departId, List<String> positionType);
|
||||
|
||||
public List<String> findUsersByPositionTypes( List<String> positionType);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param curDepartId
|
||||
* @param dimension
|
||||
* @param positionType
|
||||
* @param direction 0:up,1:down
|
||||
* @return
|
||||
*/
|
||||
public List<String> findUsersByDimenDepartPositionTypes(String curDepartId,String dimension,List<String> positionTypes,int direction);
|
||||
|
||||
/**
|
||||
* 查询下属
|
||||
* @param leaderId
|
||||
* @return
|
||||
*/
|
||||
public List<String> findUnderling(String leaderId);
|
||||
|
||||
/**
|
||||
* 查询用户的Email
|
||||
* @param userIds
|
||||
* @return Email集合
|
||||
*/
|
||||
public List<String> findUserEmails(List<String> userIds);
|
||||
|
||||
/**
|
||||
* 查询用户的手机号码
|
||||
* @param userIds
|
||||
* @return
|
||||
*/
|
||||
public List<String> findUserPhoneNumbers(List<String> userIds);
|
||||
|
||||
/**
|
||||
* 通过用户、组织、部门、岗位类别查询用户
|
||||
* @param userOrgIds 用户、组织、部门、岗位类别ID集合
|
||||
* @return
|
||||
*/
|
||||
public List<String> findUsersByUserOrg(List<String> userOrgIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询指定公司的岗位类别人员
|
||||
* @param orgId
|
||||
* @param positionType
|
||||
* @return
|
||||
*/
|
||||
public List<String> findUsersByOrgIdAndPositionType(String orgId,String positionType);
|
||||
|
||||
public List<String> findUsersByOrgIdAndPositionTypes(String orgId,List<String> positionTypes);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.dsasp.server.common.user.service;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import com.dsasp.server.common.exception.ValidationException;
|
||||
|
||||
public interface UserOtpService {
|
||||
|
||||
public boolean checkIsNeedOtp(String userId);
|
||||
|
||||
/**
|
||||
* 用户身份认证
|
||||
* @param otp 动态令牌产生的密码
|
||||
* @param userId 用户ID
|
||||
* @return
|
||||
*/
|
||||
public boolean checkOTP(String otp,String userId) throws ValidationException;
|
||||
|
||||
/**
|
||||
* 同步动态令牌
|
||||
* @throws ValidationException
|
||||
*/
|
||||
public void syncOTP(Map<String,Object> map, Properties ctx) throws ValidationException;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.dsasp.server.common.workflow.bean;
|
||||
|
||||
public interface WFMould {
|
||||
|
||||
public String getMouldName();
|
||||
|
||||
public String getProcessDefinitionName();
|
||||
|
||||
public String getMouldId();
|
||||
|
||||
public String getType();
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.dsasp.server.common.workflow.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.dsasp.server.common.exception.ValidationException;
|
||||
import com.dsasp.server.common.workflow.bean.WFMould;
|
||||
|
||||
|
||||
|
||||
|
||||
public interface ProcessDefinitionService {
|
||||
public final static String[][] properties = {{"user","用户"},{"roles","角色"},
|
||||
{"depart","部门"},{"position","岗位"},
|
||||
{"initiator","发起者"},{"initiatorDepartManager","发起者部门负责人"},
|
||||
{"initiatorLeader","发起者直属领导"},{"initiatorSubordinate","发起者下属"},
|
||||
{"initiatorDepart","发起者部门"},{"sameToTask","与指定任务相同处理者"},
|
||||
{"beforeTaskLeader","前一任务处理者领导"},{"beforeTaskDepartManager","前一任务处理者部门负责人"},
|
||||
{"fixedDimension","指定维度岗位类别负责人"},{"formSpecifiedDimension","岗位类别负责人"},{"projectRoleType", "基于项目角色"},{"scriptUser","脚本"}};
|
||||
|
||||
public static final String USER = "user";
|
||||
public static final String ROLES = "roles";
|
||||
public static final String DEPART = "depart";
|
||||
public static final String POSITION = "position";
|
||||
public static final String INITIATOR = "initiator";
|
||||
public static final String INITIATORDEPARTMANAGER = "initiatorDepartManager";
|
||||
public static final String INITIATORLEADER = "initiatorLeader";
|
||||
public static final String INITIATORSUBORDINATE = "initiatorSubordinate";
|
||||
public static final String INITIATORDEPART = "initiatorDepart";
|
||||
public static final String SAMETOTASK = "sameToTask";
|
||||
public static final String BEFORETASKLEADER = "beforeTaskLeader";
|
||||
public static final String BEFORETASKDEPARTMANAGER = "beforeTaskDepartManager";
|
||||
public static final String FIXEDDIMENSION = "fixedDimension";
|
||||
public static final String FORMSPECIFIEDDIMENSION = "formSpecifiedDimension";
|
||||
public static final String PROJECTROLETYPE = "projectRoleType";
|
||||
public static final String SCRIPTUSER = "scriptUser";
|
||||
|
||||
public void saveBpmnModel(String modelId,String json,String tempId,String xml) throws ValidationException;
|
||||
|
||||
public void deployBpmnModel(String modelName,String bpmnXml) throws ValidationException;
|
||||
|
||||
public List<WFMould> queryProcessDefinition(String processName);
|
||||
public List<WFMould> queryProcessDefinition(String processName,String category);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.dsasp.server.organize.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.dsasp.server.common.organization.service.OrganizationService;
|
||||
import com.dsasp.server.common.user.service.AssignmentHandler;
|
||||
import com.dsasp.server.common.user.service.UserFindService;
|
||||
import com.dsasp.server.common.util.StringUtil;
|
||||
import com.dsasp.server.common.workflow.service.ProcessDefinitionService;
|
||||
@Service("assignmentHandler")
|
||||
@Transactional
|
||||
public class AssignmentHandlerImpl implements AssignmentHandler{
|
||||
|
||||
public void setOrganizationService(OrganizationService organizationService) {
|
||||
this.organizationService = organizationService;
|
||||
}
|
||||
|
||||
public void setUserFindService(UserFindService userFindService) {
|
||||
this.userFindService = userFindService;
|
||||
}
|
||||
|
||||
private UserFindService userFindService;
|
||||
|
||||
private OrganizationService organizationService;
|
||||
|
||||
|
||||
public static String ADMINISTRATIVE="administrative";
|
||||
|
||||
@Override
|
||||
public List<String> assignmentUser(Object... objects) {
|
||||
String type = (String)objects[0];
|
||||
String content = (String)objects[1];
|
||||
String author = null;//发起人
|
||||
if(objects.length > 2){
|
||||
author = (String)objects[2];
|
||||
}
|
||||
String curDepart = null;//发起人所属部门
|
||||
if(objects.length > 3)
|
||||
curDepart = (String)objects[3];
|
||||
String beforeUser = "";//前一任务处理者或前任一任务处理者
|
||||
if(objects.length > 4)
|
||||
beforeUser =(String)objects[4];
|
||||
|
||||
List<String> rtn = new ArrayList<String>();
|
||||
List<String> contents = new ArrayList<String>();
|
||||
if(!StringUtil.isEmpty(content)){
|
||||
contents = Arrays.asList(content.split(","));
|
||||
}
|
||||
if(contents == null)
|
||||
return rtn;
|
||||
if(ProcessDefinitionService.USER.equals(type)){
|
||||
if(content != null)
|
||||
return contents;
|
||||
}else if(ProcessDefinitionService.ROLES.equals(type)){//角色
|
||||
return userFindService.findUsersByRoles(contents);
|
||||
}else if(ProcessDefinitionService.DEPART.equals(type)){
|
||||
return userFindService.findUsersByDeparts(contents);
|
||||
}else if(ProcessDefinitionService.POSITION.equals(type)){
|
||||
return userFindService.findUsersByPositions(contents);
|
||||
}else if(ProcessDefinitionService.INITIATOR.equals(type)){
|
||||
rtn.add(author);
|
||||
return rtn;
|
||||
}else if(ProcessDefinitionService.INITIATORDEPARTMANAGER.equals(type)){//发起者部门领导
|
||||
//发起者主岗位主部门的部门负责人
|
||||
//1、查询发起者的主部门
|
||||
String mainDepart = organizationService.getMainDepart(author);
|
||||
if(mainDepart == null)
|
||||
return rtn;
|
||||
//2、查询部门的领导
|
||||
return userFindService.findDepartManager(mainDepart);
|
||||
}else if(ProcessDefinitionService.INITIATORLEADER.equals(type)){
|
||||
return userFindService.findDirectLeader(author);
|
||||
}else if(ProcessDefinitionService.INITIATORSUBORDINATE.equals(type)){//发起者下属
|
||||
return userFindService.findUnderling(author);
|
||||
}else if(ProcessDefinitionService.INITIATORDEPART.equals(type)){//发起者部门
|
||||
//1、查询发起者的主部门
|
||||
//String mainDepart = organizationService.getMainDepart(author);
|
||||
//if(mainDepart != null)
|
||||
//rtn.add(mainDepart);
|
||||
return userFindService.findUsersByDepart(curDepart);
|
||||
}else if(ProcessDefinitionService.SAMETOTASK.equals(type)){//与指定任务相同处理者
|
||||
rtn.add(beforeUser);
|
||||
return rtn;
|
||||
}else if(ProcessDefinitionService.BEFORETASKLEADER.equals(type)){
|
||||
return userFindService.findDirectLeader(beforeUser);
|
||||
}else if(ProcessDefinitionService.BEFORETASKDEPARTMANAGER.equals(type)){//前一任务处理者部门负责人
|
||||
//1、查询/前一任务处理者的主部门
|
||||
String mainDepart = organizationService.getMainDepart(beforeUser);
|
||||
if(mainDepart == null)
|
||||
return rtn;
|
||||
//2、查询部门的领导
|
||||
return userFindService.findDepartManager(mainDepart);
|
||||
}else if(ProcessDefinitionService.FIXEDDIMENSION.equals(type)){//指定维度岗位类别相关人
|
||||
if(contents.size() < 2){
|
||||
return rtn;
|
||||
}
|
||||
String dimension = contents.get(0);
|
||||
List<String> positionTypes = new ArrayList<String>();
|
||||
for(int i=1;i<contents.size();i++){
|
||||
positionTypes.add(contents.get(i));
|
||||
}
|
||||
return userFindService.findUsersByDimenDepartPositionTypes(curDepart, dimension, positionTypes, 0);
|
||||
}else if("formSpecifiedDimension".equals(type)){//岗位类别相关人
|
||||
return userFindService.findUsersByDepartPositionTypes(curDepart, contents);
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
package com.dsasp.server.organize.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.support.rowset.SqlRowSet;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.dsasp.server.common.dataDic.bean.GeneralPOJO;
|
||||
import com.dsasp.server.common.dataDic.service.POJOCRUDService;
|
||||
import com.dsasp.server.common.organization.service.OrganizationService;
|
||||
import com.dsasp.server.common.util.StringUtil;
|
||||
import com.dsasp.server.common.util.UserSession;
|
||||
|
||||
@Service("organizationService")
|
||||
@Transactional
|
||||
public class OrganizationServiceImpl implements OrganizationService{
|
||||
|
||||
private final String POSITIONUSERTABLE = "SYS_POSITIONUSER";
|
||||
|
||||
private final String POSITIONTABLE = "SYS_POSITION";
|
||||
|
||||
private POJOCRUDService pojoCRUDService;
|
||||
|
||||
public void setPojoCRUDService(POJOCRUDService pojoCRUDService) {
|
||||
this.pojoCRUDService = pojoCRUDService;
|
||||
}
|
||||
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public List<GeneralPOJO> getOrgs() {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<GeneralPOJO> getDeparts(String orgId) {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<GeneralPOJO> getPositions(String departId) {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
public List<String> getPositionsByUserId(String userId){
|
||||
List<String> positions = new ArrayList<String>();
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put(POJOCRUDService.PAGE_SIZE, Integer.MAX_VALUE);
|
||||
param.put("current", 0);
|
||||
param.put(POJOCRUDService.PAGE_START, 0);
|
||||
param.put("USERID",userId);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("POSITIONID");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, POSITIONUSERTABLE, UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO po : list){
|
||||
positions.add((String)po.get_Value("POSITIONID"));
|
||||
}
|
||||
}
|
||||
return positions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMainPosition(String userId) {
|
||||
if(userId == null)
|
||||
return null;
|
||||
// TODO Auto-generated method stub
|
||||
GeneralPOJO po = pojoCRUDService.loadPOJO(userId, "SYS_USER", UserSession.getAdmin(), true);
|
||||
return (String)po.get_Value("MASTERPOSITION");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMainDepart(String userId) {
|
||||
if(userId == null)
|
||||
return null;
|
||||
GeneralPOJO po = pojoCRUDService.loadPOJO(userId, "SYS_USER", UserSession.getAdmin(), true);
|
||||
return (String)po.get_Value("MASTERDEPART");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getPositionsByDepartAndPositionType(String departId,
|
||||
String positionType) {
|
||||
List<String> positionTypes = new ArrayList<String>();
|
||||
positionTypes.add(positionType);
|
||||
return getPositionsByDepartAndPositionTypes(departId, positionTypes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getPositionsByDepartAndPositionTypes(String departId,
|
||||
List<String> positionTypes) {
|
||||
Set<String> postionIds = new LinkedHashSet<String>();
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put("PARENTDEPARTID",departId);
|
||||
param.put("POSITIONTYPE",positionTypes);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("SYS_POSITION_ID");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, POSITIONTABLE, UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO po : list){
|
||||
postionIds.add((String)po.get_Value("SYS_POSITION_ID"));
|
||||
}
|
||||
}
|
||||
return new ArrayList<String>(postionIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getPositionsByPositionTypes(List<String> positionTypes) {
|
||||
Set<String> postionIds = new LinkedHashSet<String>();
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put("POSITIONTYPE",positionTypes);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("SYS_POSITION_ID");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, POSITIONTABLE, UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO po : list){
|
||||
postionIds.add((String)po.get_Value("SYS_POSITION_ID"));
|
||||
}
|
||||
}
|
||||
return new ArrayList<String>(postionIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getDepartTreeByOrgId(String orgid) {
|
||||
List<Map<String,Object>> departs = new ArrayList<Map<String,Object>>();
|
||||
if(!StringUtil.isEmpty(orgid)){
|
||||
String select = "SELECT view_depart_id,path from view_depart_tree where orgid='"+orgid+"'";
|
||||
SqlRowSet set = jdbcTemplate.queryForRowSet(select);
|
||||
while (set != null && set.next()) {
|
||||
Map<String,Object> map = new HashMap<String, Object>();
|
||||
String id = set.getString("view_depart_id");
|
||||
map.put("SYS_DEPART_ID", id);
|
||||
map.put("NAME", set.getString("path"));
|
||||
departs.add(map);
|
||||
}
|
||||
}
|
||||
return departs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUserContainer(String userId) {
|
||||
Set<String> rtnlist = new LinkedHashSet<String>();
|
||||
if(!StringUtil.isEmpty(userId)){
|
||||
rtnlist.add("ALL ");
|
||||
rtnlist.add(userId);
|
||||
String select = "select a.positiontype,a.parentdepartid,c.orgid from SYS_POSITION as a "+
|
||||
|
||||
" inner join sys_positionuser as b on a.sys_position_id = b.positionid and userid = '"+userId+"'"+
|
||||
|
||||
" inner join view_depart_tree as c on a.parentdepartid = c.view_depart_id";
|
||||
SqlRowSet set = jdbcTemplate.queryForRowSet(select);
|
||||
while (set != null && set.next()) {
|
||||
String positiontype = set.getString("positiontype");
|
||||
String departid = set.getString("parentdepartid");
|
||||
String orgid = set.getString("orgid");
|
||||
if(positiontype != null){
|
||||
rtnlist.add(positiontype);
|
||||
}
|
||||
if(departid != null){
|
||||
rtnlist.add(departid);
|
||||
}
|
||||
if(orgid != null){
|
||||
rtnlist.add(orgid);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ArrayList<String>(rtnlist);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<String> getPositionsByOrgAndPositionTypes(String orgId,
|
||||
List<String> positionTypes) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
String select = "select a.sys_position_id from sys_position as a inner join view_depart_tree as b on a.parentdepartid = b.view_depart_id where b.orgid = '"+orgId+"' and a.positiontype in("+StringUtil.convertListStrToSql(positionTypes)+")";
|
||||
SqlRowSet set = jdbcTemplate.queryForRowSet(select);
|
||||
while (set != null && set.next()) {
|
||||
String positiontid = set.getString("sys_position_id");
|
||||
list.add(positiontid);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getOrgIdByDepartId(String departId) {
|
||||
if(!StringUtil.isEmpty(departId)){
|
||||
String select = "SELECT orgid from view_depart_tree where view_depart_id='"+departId+"'";
|
||||
SqlRowSet set = jdbcTemplate.queryForRowSet(select);
|
||||
while (set != null && set.next()) {
|
||||
Map<String,Object> map = new HashMap<String, Object>();
|
||||
return set.getString("orgid");
|
||||
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.dsasp.server.organize.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.support.rowset.SqlRowSet;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.dsasp.server.common.user.service.RoleService;
|
||||
import com.dsasp.server.common.util.StringUtil;
|
||||
|
||||
@Service("roleService")
|
||||
@Transactional
|
||||
public class RoleServiceImpl implements RoleService {
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean assignRoleForUser(String userId, List<String> roleIds) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean assignUserForRole(String roleId, List<String> userIds) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findRolesByUserId(String userId) {
|
||||
if (StringUtil.isEmpty(userId)) {
|
||||
return null;
|
||||
}
|
||||
List<String> list = new ArrayList<String>();
|
||||
String sql = "SELECT DISTINCT(ugr.roleid) FROM sys_usergrouprole AS ugr INNER JOIN sys_usergroupuser AS ugu ON ugu.usergroupid = ugr.usergroupid WHERE ugu.userid ='"
|
||||
+ userId + "'";
|
||||
SqlRowSet set = jdbcTemplate.queryForRowSet(sql);
|
||||
if (set != null) {
|
||||
while (set.next()) {
|
||||
list.add(set.getString("roleid"));
|
||||
}
|
||||
}
|
||||
|
||||
String dataRoleSql = "SELECT DISTINCT(DATAROLE) FROM SYS_ROLE_ROLE WHERE OPERATORROLE IN ( " + StringUtil.convertListStrToSql(list) + ")";
|
||||
SqlRowSet dataRoleSet = jdbcTemplate.queryForRowSet(dataRoleSql);
|
||||
if (dataRoleSet != null) {
|
||||
while (dataRoleSet.next()) {
|
||||
list.add(dataRoleSet.getString("DATAROLE"));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,516 @@
|
||||
package com.dsasp.server.organize.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.support.rowset.SqlRowSet;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.dsasp.server.common.dataDic.bean.CustomSearchConditional;
|
||||
import com.dsasp.server.common.dataDic.bean.GeneralPOJO;
|
||||
import com.dsasp.server.common.dataDic.service.POJOCRUDService;
|
||||
import com.dsasp.server.common.organization.service.OrganizationService;
|
||||
import com.dsasp.server.common.user.service.UserFindService;
|
||||
import com.dsasp.server.common.util.StringUtil;
|
||||
import com.dsasp.server.common.util.UserSession;
|
||||
@Service("userFindService")
|
||||
@Transactional
|
||||
public class UserFindServiceImpl implements UserFindService{
|
||||
|
||||
public void setOrganizationService(OrganizationService organizationService) {
|
||||
this.organizationService = organizationService;
|
||||
}
|
||||
|
||||
public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
}
|
||||
|
||||
private final String POSITIONUSERTABLE = "SYS_POSITIONUSER";
|
||||
|
||||
private final String POSITIONTABLE = "SYS_POSITION";
|
||||
|
||||
private final String USERLEADER = "SYS_USERLEADER";
|
||||
|
||||
private final String DEPART = "SYS_DEPART";
|
||||
|
||||
private final String VIEWDIMENSIONDEPART="VIEW_SYS_DIMENSIONDEPART";
|
||||
|
||||
private final String USERTABLE = "SYS_USER";
|
||||
|
||||
private POJOCRUDService pojoCRUDService;
|
||||
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
public void setPojoCRUDService(POJOCRUDService pojoCRUDService) {
|
||||
this.pojoCRUDService = pojoCRUDService;
|
||||
}
|
||||
|
||||
private OrganizationService organizationService;
|
||||
|
||||
@Override
|
||||
public List<String> findUsersByPositions(List<String> positionIds) {
|
||||
Set<String> userIds = new LinkedHashSet<String>();
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put("POSITIONID",positionIds);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("USERID");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, POSITIONUSERTABLE,UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO po : list){
|
||||
if(po.get_Value("USERID") != null){
|
||||
userIds.add((String)po.get_Value("USERID"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ArrayList<String>(userIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUsersByPosizion(String positionId) {
|
||||
Set<String> userIds = new LinkedHashSet<String>();
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put("POSITIONID",positionId);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("USERID");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, POSITIONUSERTABLE, UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO po : list){
|
||||
if(po.get_Value("USERID") != null){
|
||||
userIds.add((String)po.get_Value("USERID"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ArrayList<String>(userIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUsersByRoles(List<String> roleIds) {
|
||||
List<String> users = new ArrayList<String>();
|
||||
if(roleIds != null && roleIds.size() == 0){
|
||||
return users;
|
||||
}
|
||||
|
||||
String select = "SELECT distinct a.sys_user_id as userid FROM sys_user a LEFT JOIN sys_usergroupuser b ON a.sys_user_id = b.userid::bpchar JOIN sys_usergrouprole c ON b.usergroupid::text = c.usergroupid::text where (a.state = 1 or a.state = 2) and c.roleid in(";
|
||||
for(int i=0; i < roleIds.size();i++){
|
||||
String roleId = roleIds.get(i);
|
||||
select +="'"+roleId+"'";
|
||||
if(i < roleIds.size()-1){
|
||||
select+=",";
|
||||
}
|
||||
}
|
||||
|
||||
select+=")";
|
||||
SqlRowSet set = jdbcTemplate.queryForRowSet(select);
|
||||
while (set != null && set.next()) {
|
||||
String id = set.getString("userid");
|
||||
users.add(id);
|
||||
}
|
||||
return users;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUsersByRoles(String roleId) {
|
||||
List<String> users = new ArrayList<String>();
|
||||
if(StringUtil.isEmpty(roleId)){
|
||||
return users;
|
||||
}
|
||||
String select = "SELECT distinct a.sys_user_id as userid FROM sys_user a LEFT JOIN sys_usergroupuser b ON a.sys_user_id = b.userid::bpchar JOIN sys_usergrouprole c ON b.usergroupid::text = c.usergroupid::text where (a.state = 1 or a.state = 2) and c.roleid ='";
|
||||
select+=roleId;
|
||||
select+="'";
|
||||
SqlRowSet set = jdbcTemplate.queryForRowSet(select);
|
||||
while (set != null && set.next()) {
|
||||
String id = set.getString("userid");
|
||||
users.add(id);
|
||||
}
|
||||
return users;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUsersByDepart(String departId) {
|
||||
List<String> positionIds = new ArrayList<String>();
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put("PARENTDEPARTID",departId);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("SYS_POSITION_ID");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, POSITIONTABLE, UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO po : list){
|
||||
if(po.get_Value("SYS_POSITION_ID") != null){
|
||||
positionIds.add((String)po.get_Value("SYS_POSITION_ID"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return findUsersByPositions(positionIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUsersByDeparts(List<String> departIds) {
|
||||
List<String> positionIds = new ArrayList<String>();
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put("PARENTDEPARTID",departIds);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("SYS_POSITION_ID");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, POSITIONTABLE, UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO po : list){
|
||||
if(po.get_Value("SYS_POSITION_ID") != null){
|
||||
positionIds.add((String)po.get_Value("SYS_POSITION_ID"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return findUsersByPositions(positionIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUsersByOrg(String orgId) {
|
||||
List<String> userIds = new ArrayList<String>();
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put("USERORGID",orgId);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("SYS_USER_ID");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, USERTABLE, UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO po : list){
|
||||
if(po.get_Value("SYS_USER_ID") != null){
|
||||
userIds.add((String)po.get_Value("SYS_USER_ID"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return userIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUsersByOrgs(List<String> orgIds) {
|
||||
List<String> userIds = new ArrayList<String>();
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put("USERORGID",orgIds);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("SYS_USER_ID");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, USERTABLE, UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO po : list){
|
||||
if(po.get_Value("SYS_USER_ID") != null){
|
||||
userIds.add((String)po.get_Value("SYS_USER_ID"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return userIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findDirectLeader(String userId) {
|
||||
List<String> userIds = new ArrayList<String>();
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put("USERID",userId);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("LEADERID");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, USERLEADER, UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO po : list){
|
||||
if(po.get_Value("LEADERID") != null){
|
||||
userIds.add((String)po.get_Value("LEADERID"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return userIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findDepartManager(String departId) {
|
||||
GeneralPOJO pojo = pojoCRUDService.loadPOJO(departId, DEPART, UserSession.getAdmin(), false);
|
||||
Set<String> userIds = new LinkedHashSet<String>();
|
||||
if(pojo != null && pojo.get_Value("LEADER") != null){
|
||||
userIds.add((String)pojo.get_Value("LEADER"));
|
||||
}
|
||||
return new ArrayList<String>(userIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUsersByDimenPositionType(String curPositionId,
|
||||
String dimension, String positionType, int direction) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUserByDimenPositionType(String dimension,
|
||||
String positionType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUnderling(String leaderId) {
|
||||
List<String> userIds = new ArrayList<String>();
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put("LEADERID",leaderId);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("USERID");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, USERLEADER, UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO po : list){
|
||||
if(po.get_Value("USERID") != null){
|
||||
userIds.add((String)po.get_Value("USERID"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return userIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUsersByDepartPositionType(String departId,
|
||||
String positionType) {
|
||||
List<String> userIds = new ArrayList<String>();
|
||||
//1、查询指定部门下的指定岗位类别的所有岗位
|
||||
List<String> positionIds = organizationService.getPositionsByDepartAndPositionType(departId, positionType);
|
||||
if(positionIds != null && positionIds.size() > 0){
|
||||
return findUsersByPositions(positionIds);
|
||||
}
|
||||
return userIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUsersByDepartPositionTypes(String departId,
|
||||
List<String> positionTypes) {
|
||||
List<String> userIds = new ArrayList<String>();
|
||||
//1、查询指定部门下的指定岗位类别的所有岗位
|
||||
List<String> positionIds = organizationService.getPositionsByDepartAndPositionTypes(departId, positionTypes);
|
||||
if(positionIds != null && positionIds.size() > 0){
|
||||
return findUsersByPositions(positionIds);
|
||||
}else{
|
||||
//查询该部门所属公司下的岗位类别的所有岗位
|
||||
String orgid = organizationService.getOrgIdByDepartId(departId);
|
||||
if(orgid != null){
|
||||
positionIds = organizationService.getPositionsByOrgAndPositionTypes(orgid, positionTypes);
|
||||
if(positionIds != null && positionIds.size() > 0){
|
||||
return findUsersByPositions(positionIds);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return userIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUsersByPositionTypes(List<String> positionTypes) {
|
||||
List<String> userIds = new ArrayList<String>();
|
||||
//1、查询指定部门下的指定岗位类别的所有岗位
|
||||
List<String> positionIds = organizationService.getPositionsByPositionTypes(positionTypes);
|
||||
if(positionIds != null && positionIds.size() > 0){
|
||||
return findUsersByPositions(positionIds);
|
||||
}
|
||||
return userIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUsersByDimenDepartPositionTypes(String curDepartId,
|
||||
String dimension, List<String> positionTypes, int direction) {
|
||||
List<String> userIds = new ArrayList<String>();
|
||||
//1、查询当前维度下的当前部门;
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put("DEPARTID",curDepartId);
|
||||
param.put("DIMENSIONID", dimension);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("PARENTDEPARTIDS");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, VIEWDIMENSIONDEPART, UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() == 1){
|
||||
//2、查询当前部门下是否有该职位类别的职位
|
||||
List<String> positionIds = organizationService.getPositionsByDepartAndPositionTypes(curDepartId, positionTypes);
|
||||
if(positionIds != null && positionIds.size() > 0){
|
||||
return findUsersByPositions(positionIds);
|
||||
}
|
||||
GeneralPOJO po = list.get(0);
|
||||
|
||||
if(direction ==0 ){//向上找
|
||||
String parentIds = (String)po.get_Value("PARENTDEPARTIDS");
|
||||
if(parentIds != null){
|
||||
List<String> parentDeparts = Arrays.asList(parentIds.split(","));
|
||||
for(int i = (parentDeparts.size()-1);i>-1;i--){
|
||||
String parentDepart = parentDeparts.get(i);
|
||||
List<String> parentPositionIds = organizationService.getPositionsByDepartAndPositionTypes(parentDepart, positionTypes);
|
||||
if(parentPositionIds != null && parentPositionIds.size() > 0){//找到职位返回
|
||||
return findUsersByPositions(parentPositionIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if(direction == 1){ //向下找
|
||||
//TODO 实现维度向下找
|
||||
}
|
||||
|
||||
}
|
||||
return userIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUserEmails(List<String> userIds) {
|
||||
List<String> emails = new ArrayList<String>();
|
||||
if(userIds == null || userIds.size() ==0)
|
||||
return emails;
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put("SYS_USER_ID",userIds);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("EMAIL");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, USERTABLE, UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO pojo : list){
|
||||
String email = (String)pojo.get_Value("EMAIL");
|
||||
if(!StringUtil.isEmpty(email)){
|
||||
emails.add(email);
|
||||
}
|
||||
}
|
||||
}
|
||||
return emails;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUserPhoneNumbers(List<String> userIds) {
|
||||
List<String> phones = new ArrayList<String>();
|
||||
if(userIds == null || userIds.size() ==0)
|
||||
return phones;
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put("SYS_USER_ID",userIds);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("MOBILE");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, USERTABLE, UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO pojo : list){
|
||||
String mobile = (String)pojo.get_Value("MOBILE");
|
||||
if(!StringUtil.isEmpty(mobile)){
|
||||
phones.add(mobile);
|
||||
}
|
||||
}
|
||||
}
|
||||
return phones;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findUsersByUserOrg(List<String> userOrgIds) {
|
||||
Set<String> userIds = new LinkedHashSet<String>();
|
||||
if(userOrgIds != null && userOrgIds.size() > 0){
|
||||
Map<String,Object> param = new HashMap<String,Object>();
|
||||
param.put("VIEW_USERORG_ID",userOrgIds);
|
||||
param.put("ISDEL",0);
|
||||
List<String> returnColumns= new ArrayList<String>();
|
||||
returnColumns.add("VIEW_USERORG_ID");
|
||||
returnColumns.add("TYPE");
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(param, "VIEW_USERORG", UserSession.getAdmin(),returnColumns));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO po : list){
|
||||
Integer type = (Integer)po.get_Value("TYPE");
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
if(type == 0){//全体人员
|
||||
userIds.addAll(getUsers(params));
|
||||
return new ArrayList<String>(userIds);
|
||||
}else if(type == 1){//用户
|
||||
params.put("VIEW_SYS_USER_ID", new CustomSearchConditional("VIEW_SYS_USER_ID IN (select userid from sys_positionuser)"));
|
||||
userIds.add(po.get_ID());
|
||||
}else if(type == 2){//公司下所有人员
|
||||
String sc = "VIEW_SYS_USER_ID IN(select distinct b.userid from sys_position as a left join sys_positionuser b on a.sys_position_id = b.positionid";
|
||||
sc+=" where a.parentdepartid in (";
|
||||
sc+=" select view_depart_id from view_depart_tree where orgid = '"+po.get_ID()+"'";
|
||||
sc+="))";
|
||||
params.put("VIEW_SYS_USER_ID", new CustomSearchConditional(sc));
|
||||
userIds.addAll(getUsers(params));
|
||||
}else if(type == 3){//部门下所有人员
|
||||
String sc = "VIEW_SYS_USER_ID IN(select distinct b.userid from sys_position as a left join sys_positionuser b on a.sys_position_id = b.positionid";
|
||||
sc+=" where a.parentdepartid in (";
|
||||
sc+=" select view_depart_id from view_depart_tree where '"+po.get_ID()+"'=ANY(allparents)";
|
||||
sc+=" union ";
|
||||
sc+=" select '"+po.get_ID()+"'))";
|
||||
params.put("VIEW_SYS_USER_ID", new CustomSearchConditional(sc));
|
||||
userIds.addAll(getUsers(params));
|
||||
}else if(type == 4){//岗位类别下所有人员
|
||||
params.put("STATE", new CustomSearchConditional("STATE IN(1,2)"));
|
||||
String sc = "VIEW_SYS_USER_ID IN(select distinct b.userid from sys_position as a left join sys_positionuser b on a.sys_position_id = b.positionid";
|
||||
sc+=" where a.positiontype ='"+po.get_ID()+"')";
|
||||
params.put("VIEW_SYS_USER_ID", new CustomSearchConditional(sc));
|
||||
userIds.addAll(getUsers(params));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ArrayList<String>(userIds);
|
||||
}
|
||||
|
||||
private List<String> getUsers(Map<String,Object> map){
|
||||
List<String> users = new ArrayList<String>();
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
List<String> rtnList = new ArrayList<String>();
|
||||
rtnList.add("VIEW_SYS_USER_ID");
|
||||
params.put(POJOCRUDService.PAGE_SIZE, Integer.MAX_VALUE);
|
||||
params.put("current", 0);
|
||||
params.put(POJOCRUDService.PAGE_START, 0);
|
||||
params.put(POJOCRUDService.RETURN_COLUMNS_LIST, rtnList);
|
||||
params.put("STATE", new CustomSearchConditional("STATE IN(1,2)"));
|
||||
params.put(POJOCRUDService.ORDER, " order by ACCOUNT ASC");
|
||||
|
||||
if(map != null){
|
||||
params.putAll(map);
|
||||
}
|
||||
Map resultCountMap = (Map) ((Map) pojoCRUDService.listSelectSpecialCol(params, "VIEW_SYS_USER", UserSession.getAdmin(),rtnList));
|
||||
List<GeneralPOJO> list = (List<GeneralPOJO>) resultCountMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(list != null && list.size() > 0){
|
||||
for(GeneralPOJO po : list){
|
||||
users.add(po.get_ID());
|
||||
}
|
||||
}
|
||||
return users;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定公司的岗位类别人员
|
||||
* @param orgId
|
||||
* @param positionType
|
||||
* @return
|
||||
*/
|
||||
public List<String> findUsersByOrgIdAndPositionType(String orgId,String positionType){
|
||||
if(StringUtil.isEmpty(orgId) || StringUtil.isEmpty(positionType)){
|
||||
return new ArrayList<String>();
|
||||
}
|
||||
Set<String> userIds = new LinkedHashSet<String>();
|
||||
String select = "select distinct userid from sys_positionuser as pu where pu.positionid in ("
|
||||
+"select b.sys_position_id from view_depart_tree a inner join sys_position b on a.view_depart_id = b.parentdepartid where a.orgid = '"+orgId+"' and b.positiontype = '"+positionType+"'"
|
||||
+")";
|
||||
SqlRowSet set = jdbcTemplate.queryForRowSet(select);
|
||||
while (set != null && set.next()) {
|
||||
String id = set.getString("userid");
|
||||
userIds.add(id);
|
||||
}
|
||||
return new ArrayList<String>(userIds);
|
||||
}
|
||||
|
||||
public List<String> findUsersByOrgIdAndPositionTypes(String orgId,List<String> positionTypes){
|
||||
if(StringUtil.isEmpty(orgId) || positionTypes == null || positionTypes.size() == 0){
|
||||
return new ArrayList<String>();
|
||||
}
|
||||
Set<String> userIds = new LinkedHashSet<String>();
|
||||
String select = "select distinct userid from sys_positionuser as pu where pu.positionid in ("
|
||||
+"select b.sys_position_id from view_depart_tree a inner join sys_position b on a.view_depart_id = b.parentdepartid where a.orgid = '"+orgId+"' and b.positiontype in ("+StringUtil.convertListStrToSql(positionTypes)+")"
|
||||
+")";
|
||||
SqlRowSet set = jdbcTemplate.queryForRowSet(select);
|
||||
while (set != null && set.next()) {
|
||||
String id = set.getString("userid");
|
||||
userIds.add(id);
|
||||
}
|
||||
return new ArrayList<String>(userIds);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.dsasp.server.organize.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.dsasp.server.common.dataDic.bean.GeneralPOJO;
|
||||
import com.dsasp.server.common.dataDic.service.POJOCRUDService;
|
||||
import com.dsasp.server.common.exception.ValidationException;
|
||||
import com.dsasp.server.common.user.service.UserOtpService;
|
||||
import com.dsasp.server.common.util.StringUtil;
|
||||
import com.dsasp.server.common.util.UserSession;
|
||||
|
||||
import ft.otp.verify.OTPVerify;
|
||||
@Service("userOtpService")
|
||||
@Transactional
|
||||
public class UserOtpServiceImpl implements UserOtpService{
|
||||
private POJOCRUDService pojoCRUDService;
|
||||
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
public void setPojoCRUDService(POJOCRUDService pojoCRUDService) {
|
||||
this.pojoCRUDService = pojoCRUDService;
|
||||
}
|
||||
|
||||
public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkOTP(String otp, String userId)
|
||||
throws ValidationException {
|
||||
GeneralPOJO po = getOtpInfo(userId);
|
||||
if(po != null){
|
||||
String authkey = (String)po.get_Value("AUTHKEY");
|
||||
Integer currdft =(Integer)po.get_Value("CURRDFT");
|
||||
Long currsucc = Long.valueOf((String)po.get_Value("CURRSUCC"));
|
||||
Map hashMap = OTPVerify.ET_CheckPwdz201(
|
||||
authkey, //令牌密钥
|
||||
System.currentTimeMillis()/1000, //调用本接口计算机的当前时间
|
||||
0, //给0
|
||||
60, //给60,因为每60秒变更新的动态口令
|
||||
currdft, //漂移值,用于调整硬件与服务器的时间偏差,见手册说明
|
||||
20, //认证窗口,见手册说明
|
||||
currsucc, //成功值,用于调整硬件与服务器的时间偏差,见手册说明
|
||||
otp); //要认证的动态口令OTP
|
||||
|
||||
Long nReturn = (Long)hashMap.get("returnCode");
|
||||
|
||||
if(OTPVerify.OTP_SUCCESS == nReturn)//认证成功
|
||||
{
|
||||
//验证成功后更新漂移值、成功值 至数据库
|
||||
int iDrift = ((Long)hashMap.get("currentDrift")).intValue();
|
||||
Long lSucc = ((Long)hashMap.get("currentUTCEpoch")).longValue();
|
||||
|
||||
Map<String,Object> updateMap = new HashMap<String, Object>();
|
||||
updateMap.put("SYS_USEROTP_ID", po.get_ID());
|
||||
updateMap.put("CURRDFT", iDrift);
|
||||
updateMap.put("CURRSUCC", lSucc.toString());
|
||||
|
||||
pojoCRUDService.update(updateMap, "SYS_USEROTP", UserSession.getAdmin());
|
||||
return true;
|
||||
}else{
|
||||
//throw new ValidationException("动态密码认证失败!");
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkIsNeedOtp(String userId) {
|
||||
return getOtpInfo(userId) != null;
|
||||
}
|
||||
|
||||
private GeneralPOJO getOtpInfo(String userId){
|
||||
if(StringUtil.isEmpty(userId))
|
||||
return null;
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
map.put("USERID", userId);
|
||||
Map<String, Object> resultMap = pojoCRUDService.listSelect(map, "SYS_USEROTP", UserSession.getAdmin());
|
||||
List<GeneralPOJO> result = (List<GeneralPOJO>)resultMap.get(POJOCRUDService.LIST_RESULT);
|
||||
if(result != null && result.size() == 1){
|
||||
return result.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncOTP(Map<String,Object> map, Properties ctx)
|
||||
throws ValidationException {
|
||||
String id = (String)map.get("SYS_USEROTP_ID");
|
||||
String seed = (String)map.get("AUTHKEY");
|
||||
String sOTP1 = (String)map.get("OPT1");
|
||||
String sOTP2 = (String)map.get("OPT2");
|
||||
int iDrift = 0;
|
||||
Long lSucc = 0l;
|
||||
Map hashMap = OTPVerify.ET_Syncz201(seed, System.currentTimeMillis()/1000, 0, 60, iDrift, 60, lSucc,
|
||||
sOTP1,sOTP2);
|
||||
|
||||
Long nReturn = (Long)hashMap.get("returnCode");
|
||||
//System.out.println("returnCode = " + nReturn);
|
||||
|
||||
if(nReturn == OTPVerify.OTP_SUCCESS)
|
||||
{
|
||||
iDrift = ((Long)hashMap.get("currentDrift")).intValue();
|
||||
lSucc = ((Long)hashMap.get("currentUTCEpoch")).longValue();
|
||||
Map<String,Object> updateMap = new HashMap<String, Object>();
|
||||
updateMap.put("SYS_USEROTP_ID", id);
|
||||
updateMap.put("CURRDFT", iDrift);
|
||||
updateMap.put("CURRSUCC", lSucc.toString());
|
||||
|
||||
pojoCRUDService.update(updateMap, "SYS_USEROTP", ctx);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ValidationException("动态令牌同步失败!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user