Browse Source

wj 20240322

master
e 8 months ago
parent
commit
36f39e958e
  1. 65
      src/com/kingdee/eas/custom/risheng/RishengInterfaceFacadeControllerBean.java
  2. 22
      src/com/kingdee/eas/custom/risheng/RishengPendingMessageFacadeControllerBean.java

65
src/com/kingdee/eas/custom/risheng/RishengInterfaceFacadeControllerBean.java

@ -177,11 +177,42 @@ public class RishengInterfaceFacadeControllerBean extends AbstractRishengInterfa @@ -177,11 +177,42 @@ public class RishengInterfaceFacadeControllerBean extends AbstractRishengInterfa
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
try {
if(!StringUtils.isEmpty(data)) {
if("000000".equals(data)){
needUpSql = " SELECT * FROM t_bd_person a where a.fnumber is not null ";
}else{
needUpSql = " SELECT * FROM t_bd_person a where a.fnumber= '"+data+"' ";
}
}else {
//String personSql = "/*dialect*/ SELECT FNUMBER CODE FROM t_bd_person where FLASTUPDATETIME >= '"+before5+"'";
String personSql = "/*dialect*/ SELECT FNUMBER CODE FROM t_bd_person";//20240314 改为全量同步
// String personSql = "/*dialect*/ SELECT FNUMBER CODE FROM t_bd_person";//20240314 改为全量同步
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("/*dialect*/ SELECT a.FNUMBER code, a.FID,b.FID,c.FID,e.FID,f.fid,g.FID ,h.FID ,i.FID ,j.FID ,k.FID ,l.FID FROM T_BD_PERSON a ");//人员表
stringBuffer.append(" LEFT OUTER JOIN t_hr_personposition b on a.FID = b.FPERSONID ");//人员职位表
stringBuffer.append(" LEFT OUTER JOIN t_org_admin c on b.FPERSONDEP =c.FID "); //人员职位表
stringBuffer.append(" LEFT OUTER JOIN T_ORG_POSITION d on b.FPRIMARYPOSITIONID =d.FID ");//职位表
stringBuffer.append(" LEFT OUTER JOIN T_ORG_JOB e on d.FJOBID =e.FID "); //职务表
stringBuffer.append(" LEFT OUTER JOIN T_ORG_JOBCATEGORY f on e.FJOBCATEGORYID =f.FID "); //职务类型表
stringBuffer.append(" LEFT OUTER JOIN T_HR_EMPLABORRELATION g on a.FID = g.FPERSONID "); // 用工关系表
stringBuffer.append(" LEFT OUTER JOIN T_HR_BDEMPLOYEETYPE h ON A.FEMPLOYEETYPEID = H.FID ");//用工关系状态表
stringBuffer.append(" LEFT OUTER JOIN T_BD_HRFOLK i ON A.FFOLKID = I.FID ");//民族
stringBuffer.append(" LEFT OUTER JOIN T_BD_REGPERMRESIDENCE j ON A.FREGRESIDENCEID = J.FID ");//户口户籍类型
stringBuffer.append(" LEFT OUTER JOIN T_BD_HRPOLITICAL k ON A.FPOLITICALFACEID = K.FID ");//政治面貌
stringBuffer.append(" LEFT OUTER JOIN T_BD_HRDIPLOMA l ON A.FHIGHESTDEGREEID = L.FID ");// 学历
stringBuffer.append(" where a.FLASTUPDATETIME >='"+before5+"' ");
stringBuffer.append(" or b.FLASTUPDATETIME >='"+before5+"' ");
stringBuffer.append(" or c.FLASTUPDATETIME >='"+before5+"' ");
stringBuffer.append(" or d.FLASTUPDATETIME >='"+before5+"' ");
stringBuffer.append(" or e.FLASTUPDATETIME >='"+before5+"' ");
stringBuffer.append(" or f.FLASTUPDATETIME >='"+before5+"' ");
stringBuffer.append(" or g.FLASTUPDATETIME >='"+before5+"' ");
stringBuffer.append(" or h.FLASTUPDATETIME >='"+before5+"' ");
stringBuffer.append(" or i.FLASTUPDATETIME >='"+before5+"' ");
stringBuffer.append(" or j.FLASTUPDATETIME >='"+before5+"' ");
stringBuffer.append(" or k.FLASTUPDATETIME >='"+before5+"' ");
stringBuffer.append(" or l.FLASTUPDATETIME >='"+before5+"' ");
String personSql = stringBuffer.toString();
logger.error("增量更新的sql为:>>>>>"+personSql);
IRowSet personSet = DbUtil.executeQuery(ctx, personSql);
while(personSet.next()){
String pNumber = personSet.getString("CODE");
@ -421,7 +452,22 @@ public class RishengInterfaceFacadeControllerBean extends AbstractRishengInterfa @@ -421,7 +452,22 @@ public class RishengInterfaceFacadeControllerBean extends AbstractRishengInterfa
checkMap.put("managerid", managerid);
//助理 默认传无
checkMap.put("assistantid", assistantid);
//用工关系状态
String stausSql = "SELECT b.fnumber as number ,b.FNAME_L2 as name FROM T_HR_EMPLABORRELATION a " +
"LEFT OUTER JOIN T_HR_BDEMPLOYEETYPE b ON A.FLABORRELATIONSTATEID = B.FID " +
"where a.FPERSONID ='"+pid+"'";
IRowSet stausSet = DbUtil.executeQuery(ctx, stausSql);
if(stausSet.next()){
String yggxzt = stausSet.getString("number");//用工关系状态编码
status=getOaStatus(yggxzt);
}
checkMap.put("status", status);
if(!StringUtils.isEmpty(needUpSet.getString("fncell"))) {
mobile = needUpSet.getString("fncell");
}
@ -588,6 +634,21 @@ public class RishengInterfaceFacadeControllerBean extends AbstractRishengInterfa @@ -588,6 +634,21 @@ public class RishengInterfaceFacadeControllerBean extends AbstractRishengInterfa
}
return null;
}
private String getOaStatus(String yggxzt) {
// HR 正式员工 001,试用期员工 002,试岗期员工 0002,退休 011,返聘 013,离职S09,辞退 010、辞职 009
// OA 正式、临时、解聘、离职、退休
if("001".equals(yggxzt)||"013".equals(yggxzt)){
return "正式";
}else if("002".equals(yggxzt)||"0002".equals(yggxzt)){
return "临时";
}else if("S09".equals(yggxzt)||"010".equals(yggxzt)||"009".equals(yggxzt)){
return "离职";
}else if ("011".equals(yggxzt)){
return "退休";
}
return "正式";
}
/**
* 职级同步到OA
*/

22
src/com/kingdee/eas/custom/risheng/RishengPendingMessageFacadeControllerBean.java

@ -106,8 +106,8 @@ public class RishengPendingMessageFacadeControllerBean extends AbstractRishengPe @@ -106,8 +106,8 @@ public class RishengPendingMessageFacadeControllerBean extends AbstractRishengPe
String FBIZOBJID = queryPendingRows.getString("FBIZOBJID");// 业务对象内码
//String rcvNum = queryPendingRows.getString("RECEIVERNUMBER"); //暂时设置为0003
String rcvNum = "0003";
String rcvNum = queryPendingRows.getString("RECEIVERNUMBER"); //暂时设置为0003
// String rcvNum = "0003";
String receiverNumberBase = Base64.encode(rcvNum.getBytes());
String mbosUrl = getUrl(taskId, EID, "https://mbos.kdeascloud.com/mbos/page/loadPage?", "10036", ctx,FBIZOBJID);
mbosUrl = mbosUrl+"&token="+receiverNumberBase+"&isOtherApp=true&path=lczs2";
@ -122,14 +122,16 @@ public class RishengPendingMessageFacadeControllerBean extends AbstractRishengPe @@ -122,14 +122,16 @@ public class RishengPendingMessageFacadeControllerBean extends AbstractRishengPe
if(cjr.equals("1")||cjr.equals("2")){
cjrNumber=cjrNumber.substring(1, cjrNumber.length());
}
queryPendingMap.put("creator", "0003");
//queryPendingMap.put("creator", "0003");
queryPendingMap.put("creator", cjrNumber);
//接收人,接收人先设置为0003
String jsrNumber = queryPendingRows.getString("RECEIVERNUMBER");
String substring = jsrNumber.substring(0, 1);
if(substring.equals("1")||substring.equals("2")){
jsrNumber=jsrNumber.substring(1, jsrNumber.length());
}
queryPendingMap.put("receiver", "0003");// 接收人ID
// queryPendingMap.put("receiver", "0003");// 接收人ID
queryPendingMap.put("receiver", jsrNumber);// 接收人ID
Date createTime = queryPendingRows.getDate("RECEIVETIME");
queryPendingMap.put("createdatetime", sdf.format(createTime));// 流程创建时间
queryPendingMap.put("receivedatetime", sdf.format(createTime));// 接受日期
@ -290,11 +292,11 @@ public class RishengPendingMessageFacadeControllerBean extends AbstractRishengPe @@ -290,11 +292,11 @@ public class RishengPendingMessageFacadeControllerBean extends AbstractRishengPe
queryPendingMap.put("nodename", "1");// 步骤名称
queryPendingMap.put("viewtype", "0");// 流程查看状态
String cjrNumber = queryUpfatePendRows.getString("SENDERNUMBER");
//queryPendingMap.put("creator", cjrNumber);// 创建人 暂时设置成0003
queryPendingMap.put("creator", "0003");
queryPendingMap.put("creator", cjrNumber);// 创建人 暂时设置成0003
// queryPendingMap.put("creator", "0003");
String jsrNumber = queryUpfatePendRows.getString("RECEIVERNUMBER");
//queryPendingMap.put("receiver", jsrNumber);// 接收人ID 暂时设置成0003
queryPendingMap.put("receiver", "0003");
queryPendingMap.put("receiver", jsrNumber);// 接收人ID 暂时设置成0003
// queryPendingMap.put("receiver", "0003");
Date createTime = queryUpfatePendRows.getDate("RECEIVETIME");
queryPendingMap.put("createdatetime", sdf.format(createTime));// 流程创建时间
queryPendingMap.put("receivedatetime", sdf.format(createTime));// 接受日期
@ -305,8 +307,8 @@ public class RishengPendingMessageFacadeControllerBean extends AbstractRishengPe @@ -305,8 +307,8 @@ public class RishengPendingMessageFacadeControllerBean extends AbstractRishengPe
queryPendingMap.put("pcurl",url);// pc地址
String FBIZOBJID = queryUpfatePendRows.getString("FBIZOBJID");// 业务对象内码
//String rcvNum = queryPendingRows.getString("RECEIVERNUMBER"); //暂时设置为0003
String rcvNum = "0003";
String rcvNum = jsrNumber; //暂时设置为0003
//String rcvNum = "0003";
String receiverNumberBase = Base64.encode(rcvNum.getBytes());
String mbosUrl = getUrl(taskId, EID, "https://mbos.kdeascloud.com/mbos/page/loadPage?", "10036", ctx,FBIZOBJID);
mbosUrl = mbosUrl+"&token="+receiverNumberBase+"&isOtherApp=true&path=lczs2";

Loading…
Cancel
Save