You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.1 KiB
Java
69 lines
2.1 KiB
Java
3 years ago
|
package com.engine.jygf.cmd;
|
||
|
|
||
|
import com.engine.common.biz.AbstractCommonCommand;
|
||
|
import com.engine.common.entity.BizLogContext;
|
||
|
import com.engine.core.interceptor.CommandContext;
|
||
|
import org.apache.commons.lang3.StringUtils;
|
||
|
import weaver.conn.RecordSet;
|
||
|
import weaver.hrm.User;
|
||
|
import weaver.wechat.util.Utils;
|
||
|
|
||
|
import java.util.*;
|
||
|
|
||
|
/**
|
||
|
* @Author weaver_cl
|
||
|
* @Description:
|
||
|
* @Date 2022/10/9
|
||
|
* @Version V1.0
|
||
|
**/
|
||
|
public class MobilePermissionsCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||
|
|
||
|
private static final String FIELDID = "field100026"; //移动电话自定义字段
|
||
|
|
||
|
private static final String SCOPE = "HrmCustomFieldByInfoType";
|
||
|
|
||
|
private static final String SCOPEID = "-1";
|
||
|
|
||
|
public MobilePermissionsCmd(Map<String, Object> params, User user) {
|
||
|
this.user = user;
|
||
|
this.params = params;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public BizLogContext getLogContext() {
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public Map<String, Object> execute(CommandContext commandContext) {
|
||
|
Map<String, Object> data = new HashMap<>();
|
||
|
String uid = Utils.null2String(user.getUID());
|
||
|
RecordSet rs = new RecordSet();
|
||
|
HashSet<String> ids = new HashSet<>();
|
||
|
ids.add(uid);
|
||
|
rs.executeQuery("select ckr,bckr from uf_yddhqx_dt1");
|
||
|
while (rs.next()) {
|
||
|
String ckr = Utils.null2String(rs.getString("ckr"));
|
||
|
String bckr = Utils.null2String(rs.getString("bckr"));
|
||
|
if (Arrays.asList(ckr.split(",")).contains(uid)) {
|
||
|
ids.addAll(Arrays.asList(bckr.split(",")));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Map<String,String> mobileInfo = new HashMap<>();
|
||
|
String value = StringUtils.join(ids,",");
|
||
|
rs.executeQuery("select id,"+FIELDID+" from cus_fielddata where scope = ? and scopeid = ?" +
|
||
|
" and id in ("+value+")",SCOPE,SCOPEID);
|
||
|
while (rs.next()){
|
||
|
mobileInfo.put(Utils.null2String(rs.getString("id")),rs.getString(FIELDID));
|
||
|
}
|
||
|
|
||
|
data.put("ids",ids);
|
||
|
data.put("mobileInfo",mobileInfo);
|
||
|
return data;
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|