Compare commits
10 Commits
master
...
Z浙江泰鸿万立科技股
Author | SHA1 | Date |
---|---|---|
|
117dfe32d2 | 10 months ago |
|
17378da9d4 | 10 months ago |
|
e52a8bc5fd | 10 months ago |
|
774316c8ae | 1 year ago |
|
3597676b36 | 1 year ago |
|
1f7070c611 | 2 years ago |
|
884052dc1d | 2 years ago |
|
cf8841a775 | 2 years ago |
|
dee3855003 | 2 years ago |
|
bc855b294b | 2 years ago |
Binary file not shown.
@ -1,13 +0,0 @@
|
||||
package com.api.jygf.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/9
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Path("/mobile/permission")
|
||||
public class MobilePermissionsAction extends com.engine.jygf.web.MobilePermissionsAction {
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
package com.engine.jygf.service;
|
||||
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/9
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface MobilePermissionsService {
|
||||
|
||||
Map<String, Object> getPermissionInfo(Map<String, Object> params, User user);
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package com.engine.jygf.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.jygf.cmd.MobilePermissionsCmd;
|
||||
import com.engine.jygf.service.MobilePermissionsService;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/9
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class MobilePermissionsServiceImpl extends Service implements MobilePermissionsService {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getPermissionInfo(Map<String, Object> params, User user) {
|
||||
return commandExecutor.execute(new MobilePermissionsCmd(params,user));
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
package com.engine.jygf.web;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.jygf.service.MobilePermissionsService;
|
||||
import com.engine.jygf.service.impl.MobilePermissionsServiceImpl;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/9
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class MobilePermissionsAction {
|
||||
|
||||
public MobilePermissionsService getMobilePermissionsService(User user) {
|
||||
return ServiceUtil.getService(MobilePermissionsServiceImpl.class,user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 晶优光伏 移动电话通过建模控制权限 通讯录显示
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/controller")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getPermissionInfo(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
Map<String, Object> apidatas = new HashMap<>();
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
//实例化Service 并调用业务类处理
|
||||
apidatas = getMobilePermissionsService(user).getPermissionInfo(ParamUtil.request2Map(request), user);
|
||||
} catch (Exception e) {
|
||||
//异常处理
|
||||
apidatas.put("api_status", false);
|
||||
}
|
||||
return JSONObject.toJSONString(apidatas);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package weaver.interfaces.thwl.action.sdk;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/08/14
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class AddRequest {
|
||||
private String personName;
|
||||
private String gender;
|
||||
private String orgIndexCode;
|
||||
private String birthday;
|
||||
private String phoneNo;
|
||||
private String email;
|
||||
private String certificateType;
|
||||
private String certificateNo;
|
||||
private String jobNo;
|
||||
private ArrayList<Faces> faces;
|
||||
|
||||
public String getPersonName() {
|
||||
return personName;
|
||||
}
|
||||
|
||||
public void setPersonName(String personName) {
|
||||
this.personName = personName;
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public String getOrgIndexCode() {
|
||||
return orgIndexCode;
|
||||
}
|
||||
|
||||
public void setOrgIndexCode(String orgIndexCode) {
|
||||
this.orgIndexCode = orgIndexCode;
|
||||
}
|
||||
|
||||
public String getBirthday() {
|
||||
return birthday;
|
||||
}
|
||||
|
||||
public void setBirthday(String birthday) {
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public String getPhoneNo() {
|
||||
return phoneNo;
|
||||
}
|
||||
|
||||
public void setPhoneNo(String phoneNo) {
|
||||
this.phoneNo = phoneNo;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getCertificateType() {
|
||||
return certificateType;
|
||||
}
|
||||
|
||||
public void setCertificateType(String certificateType) {
|
||||
this.certificateType = certificateType;
|
||||
}
|
||||
|
||||
public String getCertificateNo() {
|
||||
return certificateNo;
|
||||
}
|
||||
|
||||
public void setCertificateNo(String certificateNo) {
|
||||
this.certificateNo = certificateNo;
|
||||
}
|
||||
|
||||
public String getJobNo() {
|
||||
return jobNo;
|
||||
}
|
||||
|
||||
public void setJobNo(String jobNo) {
|
||||
this.jobNo = jobNo;
|
||||
}
|
||||
|
||||
public ArrayList<Faces> getFaces() {
|
||||
return faces;
|
||||
}
|
||||
|
||||
public void setFaces(ArrayList<Faces> faces) {
|
||||
this.faces = faces;
|
||||
}
|
||||
}
|
@ -0,0 +1,184 @@
|
||||
package weaver.interfaces.thwl.action.sdk;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hikvision.artemis.sdk.ArtemisHttpUtil;
|
||||
import com.hikvision.artemis.sdk.config.ArtemisConfig;
|
||||
import weaver.general.BaseBean;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/08/14
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class ArtemisUtil {
|
||||
/**
|
||||
* 代理API网关nginx服务器ip端口
|
||||
*/
|
||||
private static final String HOST = new BaseBean().getPropValue("artemisSdk", "host");
|
||||
/**
|
||||
* 秘钥appkey
|
||||
*/
|
||||
private static final String APP_KEY = new BaseBean().getPropValue("artemisSdk", "appKey");
|
||||
/**
|
||||
* 秘钥appSecret
|
||||
*/
|
||||
private static final String APP_SECRET = new BaseBean().getPropValue("artemisSdk", "appSecret");
|
||||
|
||||
private static BaseBean baseBean = new BaseBean();
|
||||
|
||||
/**
|
||||
* 构建config对象
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private static ArtemisConfig getConfig() {
|
||||
ArtemisConfig config = new ArtemisConfig();
|
||||
config.setHost(HOST);
|
||||
config.setAppKey(APP_KEY);
|
||||
config.setAppSecret(APP_SECRET);
|
||||
return config;
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员新增
|
||||
*
|
||||
* @param addRequest
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void personSingleAdd(AddRequest addRequest) throws Exception {
|
||||
Map<String, String> path = new HashMap<String, String>(2) {
|
||||
{
|
||||
put("https://", "/artemis/api/resource/v2/person/single/add");
|
||||
}
|
||||
};
|
||||
String body = JSON.toJSONString(addRequest);
|
||||
String response = ArtemisHttpUtil.doPostStringArtemis(getConfig(), path, body, null, null, "application/json");
|
||||
JSONObject jsonObject = JSON.parseObject(response);
|
||||
baseBean.writeLog("body==" + body);
|
||||
baseBean.writeLog("response==" + response);
|
||||
String code = jsonObject.getString("code");
|
||||
String msg = jsonObject.getString("msg");
|
||||
if ("0".equals(code) && "SUCCESS".equalsIgnoreCase(msg)) {
|
||||
return;
|
||||
}
|
||||
throw new RuntimeException(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员更新
|
||||
*
|
||||
* @param updateRequest
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void personSingleUpdate(UpdateRequest updateRequest) throws Exception {
|
||||
Map<String, String> path = new HashMap<String, String>(2) {
|
||||
{
|
||||
put("https://", "/artemis/api/resource/v1/person/single/update");
|
||||
}
|
||||
};
|
||||
String body = JSON.toJSONString(updateRequest);
|
||||
String response = ArtemisHttpUtil.doPostStringArtemis(getConfig(), path, body, null, null, "application/json");
|
||||
baseBean.writeLog("body==" + body);
|
||||
baseBean.writeLog("response==" + response);
|
||||
JSONObject jsonObject = JSON.parseObject(response);
|
||||
String code = jsonObject.getString("code");
|
||||
String msg = jsonObject.getString("msg");
|
||||
if ("0".equals(code) && "SUCCESS".equalsIgnoreCase(msg)) {
|
||||
return;
|
||||
}
|
||||
throw new RuntimeException(msg);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取部门组织唯一标识
|
||||
*
|
||||
* @param departmentMark
|
||||
* @param departmentCode
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String getOrgIndexCode(String departmentMark, String departmentCode, int pageNo, int pageSize) throws Exception {
|
||||
Map<String, String> path = new HashMap<String, String>(2) {
|
||||
{
|
||||
put("https://", "/artemis/api/resource/v2/org/advance/orgList");
|
||||
}
|
||||
};
|
||||
OrgListRequest orgListRequest = new OrgListRequest();
|
||||
orgListRequest.setOrgName(departmentMark);
|
||||
orgListRequest.setPageNo(pageNo);
|
||||
orgListRequest.setPageSize(pageSize);
|
||||
|
||||
String body = JSON.toJSONString(orgListRequest);
|
||||
String response = ArtemisHttpUtil.doPostStringArtemis(getConfig(), path, body, null, null, "application/json");
|
||||
baseBean.writeLog("departmentCode==" + departmentCode + ",body==" + body);
|
||||
baseBean.writeLog("response==" + response);
|
||||
JSONObject jsonObject = JSON.parseObject(response);
|
||||
String code = jsonObject.getString("code");
|
||||
String msg = jsonObject.getString("msg");
|
||||
if ("0".equals(code) && "SUCCESS".equalsIgnoreCase(msg)) {
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
JSONArray list = data.getJSONArray("list");
|
||||
// 遍历List 通过部门编号获取组织代码
|
||||
if (list.size() > 0) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
JSONObject item = list.getJSONObject(i);
|
||||
if (departmentCode.equals(item.getString("organizationCode"))) {
|
||||
return item.getString("orgIndexCode");
|
||||
}
|
||||
}
|
||||
// 当前页未匹配到,获取下一页的数据匹配
|
||||
return getOrgIndexCode(departmentMark, departmentCode, pageNo + 1, pageSize);
|
||||
}
|
||||
// 未匹配到,返回空
|
||||
return "";
|
||||
} else {
|
||||
throw new RuntimeException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取人员ID
|
||||
*
|
||||
* @param personInfoRequest
|
||||
* @return
|
||||
*/
|
||||
public static String getPersonId(PersonInfoRequest personInfoRequest) throws Exception {
|
||||
Map<String, String> path = new HashMap<String, String>(2) {
|
||||
{
|
||||
put("https://", "/artemis/api/resource/v1/person/condition/personInfo");
|
||||
|
||||
}
|
||||
};
|
||||
String body = JSON.toJSONString(personInfoRequest);
|
||||
String response = ArtemisHttpUtil.doPostStringArtemis(getConfig(), path, body, null, null, "application/json");
|
||||
baseBean.writeLog("body==" + body);
|
||||
baseBean.writeLog("response==" + response);
|
||||
String personId = "";
|
||||
JSONObject jsonObject = JSON.parseObject(response);
|
||||
String code = jsonObject.getString("code");
|
||||
String msg = jsonObject.getString("msg");
|
||||
if ("0".equals(code) && "SUCCESS".equalsIgnoreCase(msg)) {
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
JSONArray list = data.getJSONArray("list");
|
||||
int total = data.getIntValue("total");
|
||||
if (total > 0) {
|
||||
JSONObject info = list.getJSONObject(0);
|
||||
personId = info.getString("personId");
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException(msg);
|
||||
}
|
||||
return personId;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package weaver.interfaces.thwl.action.sdk;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/08/14
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class Faces {
|
||||
private String faceData;
|
||||
|
||||
public String getFaceData() {
|
||||
return faceData;
|
||||
}
|
||||
|
||||
public void setFaceData(String faceData) {
|
||||
this.faceData = faceData;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,89 @@
|
||||
package weaver.interfaces.thwl.action.sdk;
|
||||
|
||||
import weaver.workflow.ruleDesign.Expressions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class OrgListRequest {
|
||||
private String orgName;
|
||||
private String orgIndexCodes;
|
||||
private Integer pageNo;
|
||||
private Integer pageSize;
|
||||
private String parentOrgIndexCodes;
|
||||
private Boolean isSubOrg;
|
||||
private ArrayList<Expressions> expressions;
|
||||
private String orderBy;
|
||||
private String orderType;
|
||||
|
||||
public String getOrgName() {
|
||||
return orgName;
|
||||
}
|
||||
|
||||
public void setOrgName(String orgName) {
|
||||
this.orgName = orgName;
|
||||
}
|
||||
|
||||
public String getOrgIndexCodes() {
|
||||
return orgIndexCodes;
|
||||
}
|
||||
|
||||
public void setOrgIndexCodes(String orgIndexCodes) {
|
||||
this.orgIndexCodes = orgIndexCodes;
|
||||
}
|
||||
|
||||
public Integer getPageNo() {
|
||||
return pageNo;
|
||||
}
|
||||
|
||||
public void setPageNo(Integer pageNo) {
|
||||
this.pageNo = pageNo;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public String getParentOrgIndexCodes() {
|
||||
return parentOrgIndexCodes;
|
||||
}
|
||||
|
||||
public void setParentOrgIndexCodes(String parentOrgIndexCodes) {
|
||||
this.parentOrgIndexCodes = parentOrgIndexCodes;
|
||||
}
|
||||
|
||||
public Boolean getIsSubOrg() {
|
||||
return isSubOrg;
|
||||
}
|
||||
|
||||
public void setIsSubOrg(Boolean isSubOrg) {
|
||||
this.isSubOrg = isSubOrg;
|
||||
}
|
||||
|
||||
public ArrayList<Expressions> getExpressions() {
|
||||
return expressions;
|
||||
}
|
||||
|
||||
public void setExpressions(ArrayList<Expressions> expressions) {
|
||||
this.expressions = expressions;
|
||||
}
|
||||
|
||||
public String getOrderBy() {
|
||||
return orderBy;
|
||||
}
|
||||
|
||||
public void setOrderBy(String orderBy) {
|
||||
this.orderBy = orderBy;
|
||||
}
|
||||
|
||||
public String getOrderType() {
|
||||
return orderType;
|
||||
}
|
||||
|
||||
public void setOrderType(String orderType) {
|
||||
this.orderType = orderType;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package weaver.interfaces.thwl.action.sdk;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class PersonInfoRequest {
|
||||
private String paramName;
|
||||
private ArrayList<String> paramValue;
|
||||
|
||||
public String getParamName() {
|
||||
return paramName;
|
||||
}
|
||||
|
||||
public void setParamName(String paramName) {
|
||||
this.paramName = paramName;
|
||||
}
|
||||
|
||||
public ArrayList<String> getParamValue() {
|
||||
return paramValue;
|
||||
}
|
||||
|
||||
public void setParamValue(ArrayList<String> paramValue) {
|
||||
this.paramValue = paramValue;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,162 @@
|
||||
package weaver.interfaces.thwl.action.sdk;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/08/15
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class UpdateRequest {
|
||||
private String personId;
|
||||
private String personName;
|
||||
private String orgIndexCode;
|
||||
private Integer gender;
|
||||
private String birthday;
|
||||
private String phoneNo;
|
||||
private String email;
|
||||
private String certificateType;
|
||||
private String certificateNo;
|
||||
private String jobNo;
|
||||
private String firstWorkingTime;
|
||||
private String enterTime;
|
||||
private String formalEmpTime;
|
||||
private String empType;
|
||||
private String empLevel;
|
||||
private String workPlace;
|
||||
private String leaveTime;
|
||||
|
||||
public String getPersonId() {
|
||||
return personId;
|
||||
}
|
||||
|
||||
public void setPersonId(String personId) {
|
||||
this.personId = personId;
|
||||
}
|
||||
|
||||
public String getPersonName() {
|
||||
return personName;
|
||||
}
|
||||
|
||||
public void setPersonName(String personName) {
|
||||
this.personName = personName;
|
||||
}
|
||||
|
||||
public String getOrgIndexCode() {
|
||||
return orgIndexCode;
|
||||
}
|
||||
|
||||
public void setOrgIndexCode(String orgIndexCode) {
|
||||
this.orgIndexCode = orgIndexCode;
|
||||
}
|
||||
|
||||
public Integer getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(Integer gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public String getBirthday() {
|
||||
return birthday;
|
||||
}
|
||||
|
||||
public void setBirthday(String birthday) {
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public String getPhoneNo() {
|
||||
return phoneNo;
|
||||
}
|
||||
|
||||
public void setPhoneNo(String phoneNo) {
|
||||
this.phoneNo = phoneNo;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getCertificateType() {
|
||||
return certificateType;
|
||||
}
|
||||
|
||||
public void setCertificateType(String certificateType) {
|
||||
this.certificateType = certificateType;
|
||||
}
|
||||
|
||||
public String getCertificateNo() {
|
||||
return certificateNo;
|
||||
}
|
||||
|
||||
public void setCertificateNo(String certificateNo) {
|
||||
this.certificateNo = certificateNo;
|
||||
}
|
||||
|
||||
public String getJobNo() {
|
||||
return jobNo;
|
||||
}
|
||||
|
||||
public void setJobNo(String jobNo) {
|
||||
this.jobNo = jobNo;
|
||||
}
|
||||
|
||||
public String getFirstWorkingTime() {
|
||||
return firstWorkingTime;
|
||||
}
|
||||
|
||||
public void setFirstWorkingTime(String firstWorkingTime) {
|
||||
this.firstWorkingTime = firstWorkingTime;
|
||||
}
|
||||
|
||||
public String getEnterTime() {
|
||||
return enterTime;
|
||||
}
|
||||
|
||||
public void setEnterTime(String enterTime) {
|
||||
this.enterTime = enterTime;
|
||||
}
|
||||
|
||||
public String getFormalEmpTime() {
|
||||
return formalEmpTime;
|
||||
}
|
||||
|
||||
public void setFormalEmpTime(String formalEmpTime) {
|
||||
this.formalEmpTime = formalEmpTime;
|
||||
}
|
||||
|
||||
public String getEmpType() {
|
||||
return empType;
|
||||
}
|
||||
|
||||
public void setEmpType(String empType) {
|
||||
this.empType = empType;
|
||||
}
|
||||
|
||||
public String getEmpLevel() {
|
||||
return empLevel;
|
||||
}
|
||||
|
||||
public void setEmpLevel(String empLevel) {
|
||||
this.empLevel = empLevel;
|
||||
}
|
||||
|
||||
public String getWorkPlace() {
|
||||
return workPlace;
|
||||
}
|
||||
|
||||
public void setWorkPlace(String workPlace) {
|
||||
this.workPlace = workPlace;
|
||||
}
|
||||
|
||||
public String getLeaveTime() {
|
||||
return leaveTime;
|
||||
}
|
||||
|
||||
public void setLeaveTime(String leaveTime) {
|
||||
this.leaveTime = leaveTime;
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package weaver.interfaces.thwl.cronjob;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.hrm.company.DepartmentComInfo;
|
||||
import weaver.hrm.resource.ResourceComInfo;
|
||||
import weaver.interfaces.schedule.BaseCronJob;
|
||||
import weaver.interfaces.thwl.action.sdk.ArtemisUtil;
|
||||
import weaver.interfaces.thwl.action.sdk.PersonInfoRequest;
|
||||
import weaver.interfaces.thwl.action.sdk.UpdateRequest;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/08/14
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class PersonSyncUpdateJob extends BaseCronJob {
|
||||
@Override
|
||||
public void execute() {
|
||||
RecordSet rs = new RecordSet();
|
||||
try {
|
||||
String currentDate = DateUtil.getCurrentDate();
|
||||
rs.executeQuery("select ydryxm,drgzbm from formtable_main_176 where dgrq = ? ", currentDate);
|
||||
List<Map<String, String>> personList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put(rs.getString("ydryxm"), rs.getString("drgzbm"));
|
||||
personList.add(map);
|
||||
}
|
||||
rs.writeLog("人员异动同步任务开始,共查询到异动人员" + personList.size());
|
||||
|
||||
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
|
||||
ResourceComInfo resourceComInfo = new ResourceComInfo();
|
||||
for (Map<String, String> item : personList) {
|
||||
try {
|
||||
String ydryxm = item.get("ydryxm");
|
||||
String drgzbm = item.get("drgzbm");
|
||||
String departmentCode = departmentComInfo.getDepartmentCode(drgzbm);
|
||||
String departmentMark = departmentComInfo.getDepartmentmark(drgzbm);
|
||||
|
||||
// 获取组织唯一标识
|
||||
String orgIndexCode = ArtemisUtil.getOrgIndexCode(departmentMark,departmentCode,1,10);
|
||||
|
||||
// 获取人员ID
|
||||
String workCode = resourceComInfo.getWorkcode(ydryxm);
|
||||
PersonInfoRequest personInfoRequest = new PersonInfoRequest();
|
||||
personInfoRequest.setParamName("");
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
list.add(workCode);
|
||||
personInfoRequest.setParamValue(list);
|
||||
String personId = ArtemisUtil.getPersonId(personInfoRequest);
|
||||
rs.writeLog("ydryxm==" + ydryxm + ",drgzbm==" + drgzbm + ",workCode==" + workCode + ",personId==" + personId);
|
||||
if(StringUtils.isBlank(workCode) || StringUtils.isBlank(personId)){
|
||||
continue;
|
||||
}
|
||||
|
||||
UpdateRequest updateRequest = new UpdateRequest();
|
||||
updateRequest.setPersonId(personId);
|
||||
updateRequest.setOrgIndexCode(orgIndexCode);
|
||||
ArtemisUtil.personSingleUpdate(updateRequest);
|
||||
} catch (Exception e) {
|
||||
rs.writeLog(e);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
rs.writeLog("人员异动同步失败", e);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue