|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
package com.weaver.seconddev.interfaces.workflow.action;
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
@ -7,15 +9,13 @@ import com.weaver.common.distribution.genid.IdGenerator;
|
|
|
|
|
import com.weaver.common.i18n.tool.util.I18nContextUtil;
|
|
|
|
|
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
|
|
|
|
|
import com.weaver.common.base.entity.result.WeaResult;
|
|
|
|
|
import com.weaver.framework.rpc.context.impl.TenantRpcContext;
|
|
|
|
|
import com.weaver.mc.util.StringUtils;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import com.weaver.verupgrade.formmode.data.GetCubeBtnActionParam;
|
|
|
|
|
import com.weaver.verupgrade.conn.RecordSet;
|
|
|
|
|
import com.weaver.verupgrade.general.Util;
|
|
|
|
|
import com.weaver.verupgrade.hrm.User;
|
|
|
|
|
import com.weaver.verupgrade.hrm.resource.ResourceComInfo;
|
|
|
|
|
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 说明
|
|
|
|
@ -44,15 +44,11 @@ public class UpdateSecLevelAndLockStatus implements EsbServerlessRpcRemoteInterf
|
|
|
|
|
public WeaResult<Map<String, Object>> execute(Map<String, Object> param) {
|
|
|
|
|
|
|
|
|
|
logger_b15f4fa5.error("htjt_mode_UpdateSecLevelAndLockStatus start param == " + param);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Long billid = Long.parseLong(String.valueOf(param.getOrDefault("billid", -1)));
|
|
|
|
|
logger_b15f4fa5.error("UpdateSecLevelAndLockStatus billid == "+ billid );
|
|
|
|
|
|
|
|
|
|
Map<String, String> result = new HashMap<String, String>();
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (billid != null) {
|
|
|
|
|
|
|
|
|
|
if (billid > 0 ) {
|
|
|
|
@ -76,31 +72,56 @@ public class UpdateSecLevelAndLockStatus implements EsbServerlessRpcRemoteInterf
|
|
|
|
|
boolean execute = rs.execute(sql);
|
|
|
|
|
logger_b15f4fa5.error("execute == "+ execute );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新账号锁定记录
|
|
|
|
|
if(StringUtils.isNotEmpty(zhsd)){
|
|
|
|
|
if(zhsd.equals(0)){ //未锁定,删除所有锁定记录
|
|
|
|
|
sql = "update ec_passport.dbo.user_lock_info set delete_type = 1 where user_id = " + ry + "and delete_type_type != 3 ";
|
|
|
|
|
sql = "update ec_passport.dbo.user_lock_info set delete_type = 1 where user_id = " + ry + "and delete_type_type = 0 ";
|
|
|
|
|
|
|
|
|
|
}else if(zhsd.equals(0)){//锁定,新增一条数据
|
|
|
|
|
logger_b15f4fa5.error("UpdateSecLevelAndLockStatus updatedelete_type == "+ sql );
|
|
|
|
|
boolean execute1 = rs.execute(sql);
|
|
|
|
|
logger_b15f4fa5.error("execute1 == "+ execute1 );
|
|
|
|
|
}else if(!zhsd.equals(0)){//锁定,新增一条数据
|
|
|
|
|
sql = "SELECT COUNT (1) AS sd FROM eteams.dbo.employee a ,ec_passport.dbo.user_lock_info b " +
|
|
|
|
|
"WHERE a.id = " + ry +" AND a.user_id = b.user_id AND a.delete_type = 0 ";
|
|
|
|
|
boolean b1 = rs.executeQuery(sql);
|
|
|
|
|
if(rs.next()){
|
|
|
|
|
int sd = rs.getInt("sd");
|
|
|
|
|
logger_b15f4fa5.error("sd == "+ sd );
|
|
|
|
|
if(sd > 0 ){
|
|
|
|
|
//有记录
|
|
|
|
|
logger_b15f4fa5.error("该账号已锁定");
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
String currentEmployeeId = TenantRpcContext.getCurrentEmployeeId();
|
|
|
|
|
String currentTenantKey = TenantRpcContext.getCurrentTenantKey();
|
|
|
|
|
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
|
|
|
|
|
// 创建 SimpleDateFormat 对象,指定包含毫秒的日期时间格式
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
|
|
|
|
|
|
|
|
|
// 使用 SimpleDateFormat 的 format 方法将 Date 对象格式化为字符串
|
|
|
|
|
String formattedDateTime = sdf.format(date);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Long id = IdGenerator.generate();
|
|
|
|
|
sql = "INSERT INTO passport.user_lock_info (" +
|
|
|
|
|
"id, create_time, update_time, creator, delete_type, " +
|
|
|
|
|
"tenant_key, user_id, employee_id, overdue_time, user_status, lock_type" +
|
|
|
|
|
") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
|
|
|
|
Long id = IdGenerator.generate();
|
|
|
|
|
") VALUES ("+id+", "+formattedDateTime +", "+formattedDateTime+", "+currentEmployeeId+
|
|
|
|
|
", 0, "+currentTenantKey +", " + ry + ", " + ry +
|
|
|
|
|
" , '2099-01-01 00:00:00.000', 'normal', 'ACCOUNT_LOCK')";
|
|
|
|
|
|
|
|
|
|
logger_b15f4fa5.error("UpdateSecLevelAndLockStatus insert == "+ sql );
|
|
|
|
|
boolean execute1 = rs.execute(sql);
|
|
|
|
|
logger_b15f4fa5.error("execute1 == "+ execute1 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
logger_b15f4fa5.error("UpdateSecLevelAndLockStatus updatedelete_type == "+ sql );
|
|
|
|
|
boolean execute1 = rs.execute(sql);
|
|
|
|
|
logger_b15f4fa5.error("execute1 == "+ execute1 );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|