#EC_HJ2# 去掉测试开发的代码及使用配置文件替换代码固定的地址
parent
cb51b24c3d
commit
32b9414a31
@ -0,0 +1,23 @@
|
||||
##门户地址
|
||||
portal_host = http://172.16.25.133
|
||||
|
||||
##门户人员认证接口
|
||||
portal_user_auth = http://172.16.25.133/portal-web/user/current
|
||||
|
||||
##门户首页
|
||||
portal_homepage = http://172.16.25.133/portal-web/#
|
||||
|
||||
##RocketMq的consumerGroup
|
||||
consumerGroup = cbec-consumer-group_nj_133
|
||||
|
||||
##RocketMq的namesrvAddr
|
||||
namesrvAddr = 172.16.84.183:9001;172.16.84.187:9001
|
||||
|
||||
##RocketMq的instanceName
|
||||
instanceName = dataSync_topic_nj
|
||||
|
||||
##RocketMq的topic
|
||||
topic = dataSync_topic_nj
|
||||
|
||||
##RocketMq的subExpression
|
||||
subExpression = BPM
|
@ -1,11 +0,0 @@
|
||||
package com.api.bpm.todo;
|
||||
|
||||
|
||||
|
||||
import com.engine.bpm.todo.web.WorkflowTodoAction;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/workflow")
|
||||
public class WorkflowTodoActionApi extends WorkflowTodoAction {
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
package com.api.mq;
|
||||
|
||||
|
||||
import com.engine.mq.RocketMqAction;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/kxn/spa")
|
||||
public class RocketMqActionApi extends RocketMqAction {
|
||||
}
|
@ -1,494 +0,0 @@
|
||||
package com.api.mq.util;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.TimeUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.company.DepartmentComInfo;
|
||||
import weaver.hrm.resource.ResourceComInfo;
|
||||
|
||||
public class RocketmqUtil {
|
||||
|
||||
public int updateOrgData(String data)
|
||||
{
|
||||
|
||||
BaseBean bb = new BaseBean();
|
||||
int errcount = 0;
|
||||
JSONObject jsonObject = JSONObject.parseObject(data);
|
||||
if(jsonObject.containsKey("requestObject"))
|
||||
{
|
||||
JSONArray requestArray = jsonObject.getJSONArray("requestObject");
|
||||
|
||||
for(int i=0;i<requestArray.size();i++)
|
||||
{
|
||||
JSONObject requestObject = requestArray.getJSONObject(i);
|
||||
System.out.println(requestObject.toJSONString());
|
||||
|
||||
if(!requestObject.isEmpty()){
|
||||
if(requestObject.containsKey("tableName") && requestObject.containsKey("content"))
|
||||
{
|
||||
String tableName = requestObject.getString("tableName");
|
||||
bb.writeLog("tableName:"+tableName);
|
||||
if("organization".equals(tableName)){
|
||||
JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
int errcount1 = updasteSysOrgData(jsonArray);
|
||||
errcount += errcount1;
|
||||
}else if("system_user".equals(tableName)){
|
||||
JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
int errcount2 = updateSysUserData(jsonArray);
|
||||
errcount += errcount2;
|
||||
}else if("system_role".equals(tableName)){
|
||||
JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
updasteSysRoleData(jsonArray);
|
||||
}else if("system_post".equals(tableName)){
|
||||
JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
updasteSysPostData(jsonArray);
|
||||
}else if("system_user_role".equals(tableName)){
|
||||
JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
updateSystemUserRoleData(jsonArray);
|
||||
}else if("system_user_post".equals(tableName)){
|
||||
JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
updateSystemUserPostData(jsonArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
bb.writeLog("errcount:"+errcount);
|
||||
return errcount;
|
||||
}
|
||||
/***
|
||||
*
|
||||
* @param jsonArray
|
||||
*/
|
||||
public int updateSysUserData(JSONArray jsonArray){
|
||||
RecordSet rs = new RecordSet();
|
||||
BaseBean bb = new BaseBean();
|
||||
|
||||
//{"authenticationInfo":{"sysUserPostId":"37484","sysUserId":"1","key":"authenticationInfo"},
|
||||
// "svcCode":"70300100030001","requestObject":[{"content":[
|
||||
// {"statusDate":"2022-07-18 11:25:41","updateDate":"2022-07-22 10:52:56",
|
||||
// "regionNbr":"1","expDate":"2999-12-31 23:59:59","userOrgId":"2",
|
||||
// "password":"{bcrypt}$2a$10$wQrGr6zHlqaKbAZGaK7PC.VdmZdq4HJn6t7R4XpGsf/yKqPj6smHq",
|
||||
// "effDate":"2021-07-13 10:33:57","orgCode":"2",
|
||||
// "staffName":"zhouhan","pwdNewtime":"2022-05-18 14:42:15",
|
||||
// "pwdContinErrCnt":"0","actType":"M","sysUserId":"14002","email":"2112@qq.com",
|
||||
// "createDate":"2021-07-13 10:33:58","staffCode":"zhouhan",
|
||||
// "sysUserCode":"zhouhan","pwdErrCnt":"0","pwdEffectDays":"90","statusCd":"1000",
|
||||
// "systemInfoId":"-1","userName":"zhouhan","createStaff":"1","pwdStatus":"1100",
|
||||
// "regionId":"731","pwdSmsTel":"21423523523","loginedNum":"78","staffId":"12002",
|
||||
// "updateStaff":"1"}],"tableName":"system_user","primaryKey":"sysUserId"}],"key":"svcCont"}
|
||||
|
||||
int errcount = 0;
|
||||
for(int i=0;i<jsonArray.size();i++)
|
||||
{
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
String statusDate = Util.null2String(jsonObject.get("statusDate"));
|
||||
String updateDate = Util.null2String(jsonObject.get("updateDate"));
|
||||
String regionNbr = Util.null2String(jsonObject.get("regionNbr"));
|
||||
String userOrgId = Util.null2String(jsonObject.get("userOrgId"));
|
||||
String orgCode = Util.null2String(jsonObject.get("orgCode"));
|
||||
|
||||
String staffId = Util.null2String(jsonObject.get("staffId"));
|
||||
String staffName = Util.null2String(jsonObject.get("staffName"));
|
||||
String staffCode = Util.null2String(jsonObject.get("staffCode"));
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
|
||||
String email = Util.null2String(jsonObject.get("email"));
|
||||
String sysUserId = Util.null2String(jsonObject.get("sysUserId"));
|
||||
String sysUserCode = Util.null2String(jsonObject.get("sysUserCode"));
|
||||
String userName = Util.null2String(jsonObject.get("userName"));
|
||||
String pwdSmsTel = Util.null2String(jsonObject.get("pwdSmsTel"));
|
||||
|
||||
String loginedNum = Util.null2String(jsonObject.get("sysUserId"));
|
||||
|
||||
|
||||
String statusCd = Util.null2String(jsonObject.get("statusCd"));
|
||||
String status = "1";
|
||||
if("1100".equals(statusCd) || "1200".equals(statusCd) || "1300".equals(statusCd)){
|
||||
status = "5";
|
||||
}
|
||||
bb.writeLog("status:"+status);
|
||||
bb.writeLog("statusCd:"+statusCd);
|
||||
|
||||
String subcompanyid1 = "" ;
|
||||
String deptId = "";
|
||||
if(!"".equals(orgCode)){
|
||||
String sql = " select id,subcompanyid1 from hrmdepartment where departmentcode = ?" ;
|
||||
rs.executeQuery(sql,new Object[]{orgCode});
|
||||
if(rs.next()){
|
||||
deptId = Util.null2String(rs.getString("id"));
|
||||
subcompanyid1 = Util.null2String(rs.getString("subcompanyid1"));
|
||||
}
|
||||
}
|
||||
bb.writeLog("deptId:"+deptId);
|
||||
bb.writeLog("subcompanyid1:"+subcompanyid1);
|
||||
|
||||
String locationid = "2" ;
|
||||
String seclevel = "20" ;
|
||||
String createrid = "1" ;
|
||||
String lastmodid = "1" ;
|
||||
String creator = "1";
|
||||
String jobTitleId = "40";
|
||||
String systemlanguage = "7" ;
|
||||
String currentDate = TimeUtil.getCurrentDateString();//当前日期
|
||||
|
||||
String currentDateTime = TimeUtil.getCurrentTimeString(); //当前时间
|
||||
bb.writeLog("status:"+status);
|
||||
bb.writeLog("currentDate:"+currentDate);
|
||||
|
||||
String lastname = " ~`~`7 "+staffName+"`~`8 "+staffName+"`~`~";
|
||||
|
||||
String loginid = "";
|
||||
String sql = " select loginid from hrmresource where workcode=?" ;
|
||||
bb.writeLog("sql:"+sql);
|
||||
bb.writeLog("staffCode:"+staffCode);
|
||||
rs.executeQuery(sql,new Object[]{staffCode});
|
||||
if(rs.next()){
|
||||
loginid = Util.null2String(rs.getString("loginid"));
|
||||
}
|
||||
bb.writeLog("loginid:"+loginid);
|
||||
if(!"".equals(deptId))
|
||||
{
|
||||
if(!"".equals(loginid))
|
||||
{
|
||||
if("M".equalsIgnoreCase(actType))
|
||||
{
|
||||
String userUpdateSql = " update hrmresource set lastname=?,departmentid=?,subcompanyid1=?," +
|
||||
" creater=?,email=?,mobile=?,jobtitle=?,status=?,dsporder=?,lastmoddate=?,modified=? where workcode=? ";
|
||||
bb.writeLog("userUpdateSql:"+userUpdateSql);
|
||||
|
||||
boolean flag = rs.executeUpdate(userUpdateSql,new Object[]{staffName,deptId,subcompanyid1,creator,email,
|
||||
pwdSmsTel,jobTitleId,status,loginedNum,currentDate,currentDateTime,staffCode});
|
||||
bb.writeLog("flag:"+flag);
|
||||
|
||||
if(!flag){
|
||||
errcount++;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if("A".equalsIgnoreCase(actType))
|
||||
{
|
||||
// int tmpid = 0;
|
||||
// rs.executeSql("select max(id) from HrmResourceVirtual ");
|
||||
// if(rs.next()){
|
||||
// tmpid = rs.getInt(1)+1;
|
||||
// }
|
||||
|
||||
String pwd = "1";
|
||||
String password = DigestUtils.md5Hex(pwd).toUpperCase(); //MD5加密
|
||||
bb.writeLog("password:"+password);
|
||||
|
||||
rs.executeProc("HrmResourceMaxId_Get", "");
|
||||
rs.next();
|
||||
String id = "" + rs.getInt(1);
|
||||
bb.writeLog("id:"+id);
|
||||
|
||||
if(!"".equals(id)){
|
||||
String userInsertSql = " insert into hrmresource(id,loginid,password,workcode,lastname,departmentid,subcompanyid1," +
|
||||
"creater,email,mobile,jobtitle,status,dsporder,systemlanguage,createdate,lastmoddate,created,modified," +
|
||||
"locationid,seclevel,createrid,lastmodid) " +
|
||||
" values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
bb.writeLog("userInsertSql:"+userInsertSql);
|
||||
boolean flag = rs.executeUpdate(userInsertSql,new Object[]{id,staffCode,password,staffCode,lastname,deptId,subcompanyid1,
|
||||
creator,email,pwdSmsTel,jobTitleId,status,loginedNum,systemlanguage,currentDate,currentDate,currentDateTime,currentDateTime,
|
||||
locationid,seclevel,createrid,lastmodid});
|
||||
bb.writeLog("flag:"+flag);
|
||||
if(!flag){
|
||||
errcount++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return errcount;
|
||||
}
|
||||
|
||||
|
||||
public int updasteSysOrgData(JSONArray jsonArray){
|
||||
RecordSet rs = new RecordSet();
|
||||
BaseBean bb = new BaseBean();
|
||||
int errcount = 0;
|
||||
|
||||
// {"authenticationInfo":{"sysUserPostId":"37484","sysUserId":"1","key":"authenticationInfo"},"svcCode":
|
||||
// "70300100030001","requestObject":[{"content":[{
|
||||
// "updateDate":"2022-07-22 11:05:22","orgName":"testOrg722","parentOrgCode":"LNP000001",
|
||||
// "regionNbr":"TST_PR_CSS","orgLevel":"2","statusCd":"1000",
|
||||
// "parentOrgName":"Vivia","orgId":"17012",
|
||||
// "createStaff":"1","orgType":"1000",
|
||||
// "regionId":"36","parentOrgId":"1",
|
||||
// "orgCode":"testOrg722",
|
||||
// "pathCode":"-1.1.17012","actType":"A","partyId":"0",
|
||||
// "parRegionNbr":"1",
|
||||
// "createDate":"2022-07-22 11:05:22"
|
||||
// }],"tableName":"organization","primaryKey":"orgId"}],"key":"svcCont"}
|
||||
|
||||
|
||||
for(int i=0;i<jsonArray.size();i++)
|
||||
{
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
String orgName = Util.null2String(jsonObject.get("orgName"));
|
||||
String parentOrgCode = Util.null2String(jsonObject.get("parentOrgCode"));
|
||||
String statusCd = Util.null2String(jsonObject.get("statusCd"));
|
||||
String parentOrgName = Util.null2String(jsonObject.get("parentOrgName"));
|
||||
String orgId = Util.null2String(jsonObject.get("orgId"));
|
||||
String orgType = Util.null2String(jsonObject.get("orgType"));
|
||||
String orgCode = Util.null2String(jsonObject.get("orgCode"));
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
|
||||
String canceled = "";
|
||||
if("1100".equals(statusCd)){
|
||||
canceled = "1";
|
||||
}
|
||||
bb.writeLog("canceled:"+canceled);
|
||||
|
||||
|
||||
|
||||
String supdepid = "0";
|
||||
String subcompanyid1 = "" ;
|
||||
if(!"".equals(parentOrgCode))
|
||||
{
|
||||
rs.executeQuery(" select id from hrmsubcompany where subcompanycode=? ",new Object[]{parentOrgCode});
|
||||
if(rs.next()){
|
||||
subcompanyid1 = Util.null2String(rs.getString("id"));
|
||||
}
|
||||
if("".equals(subcompanyid1)){
|
||||
String sql = " select id,subcompanyid1 from hrmdepartment where departmentcode = ?" ;
|
||||
rs.executeQuery(sql,new Object[]{parentOrgCode});
|
||||
if(rs.next()){
|
||||
supdepid = Util.null2String(rs.getString("id"));
|
||||
subcompanyid1 = Util.null2String(rs.getString("subcompanyid1"));
|
||||
}
|
||||
}
|
||||
}
|
||||
bb.writeLog("actType:"+actType);
|
||||
bb.writeLog("supdepid:"+supdepid);
|
||||
bb.writeLog("subcompanyid1:"+subcompanyid1);
|
||||
|
||||
|
||||
if(!"".equals(subcompanyid1)){
|
||||
String deptid = "" ;
|
||||
String sql = " select id from hrmdepartment where departmentcode=?" ;
|
||||
rs.executeQuery(sql,new Object[]{orgCode});
|
||||
if(rs.next()){
|
||||
deptid = Util.null2String(rs.getString("id"));
|
||||
}
|
||||
|
||||
bb.writeLog("deptid:"+deptid);
|
||||
|
||||
if(!"".equals(deptid))
|
||||
{
|
||||
if("M".equalsIgnoreCase(actType))
|
||||
{
|
||||
String deptUpdateSql = " update hrmdepartment set departmentmark=?,departmentname=?,canceled=?," +
|
||||
" subcompanyid1=?,showorder=?, supdepid=? where departmentcode=? ";
|
||||
bb.writeLog("deptUpdateSql:"+deptUpdateSql);
|
||||
boolean flag = rs.executeUpdate(deptUpdateSql,new Object[]{orgName,orgName,canceled,subcompanyid1,orgId,supdepid,orgCode});
|
||||
bb.writeLog("flag:"+flag);
|
||||
if(!flag){
|
||||
errcount++;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if("A".equalsIgnoreCase(actType))
|
||||
{
|
||||
String deptInsertSql = " insert into hrmdepartment(departmentmark,departmentname,departmentcode," +
|
||||
" canceled,subcompanyid1,supdepid,showorder) values(?,?,?,?,?,?,?) ";
|
||||
bb.writeLog("deptInsertSql:"+deptInsertSql);
|
||||
boolean flag = rs.executeUpdate(deptInsertSql,new Object[]{orgName,orgName,orgCode,canceled,subcompanyid1,supdepid,orgId});
|
||||
bb.writeLog("flag:"+flag);
|
||||
if(!flag){
|
||||
errcount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return errcount;
|
||||
}
|
||||
|
||||
// {"authenticationInfo":{"sysUserPostId":"37484","sysUserId":"1","key":"authenticationInfo"},"svcCode":
|
||||
// "70300100030001","requestObject":[{"content":[{"sysUserRoleId":"23444","updateDate":"2022-07-22 11:08:33",
|
||||
// "systemInfoCode":"TYMH","sysRoleId":"17013","statusCd":"1000",
|
||||
// "systemInfoId":"727001","operType":"1000",
|
||||
// "systemUserCode":"finaceManager",
|
||||
// "expDate":"2120-01-01 00:00:00","orgId":"17012",
|
||||
// "createStaff":"1","effDate":"2022-07-21 10:17:51",
|
||||
// "systemUserName":"financeManager",
|
||||
// "orgCode":"testOrg722","roleCode":"orgManager","manageClass":"1000","roleName":"orgManager",
|
||||
// "actType":"A","sysUserId":"20047","createDate":"2022-07-22 11:08:33"}],
|
||||
// "tableName":"system_user_role","primaryKey":"sysUserRoleId"}],"key":"svcCont"}
|
||||
|
||||
/***
|
||||
*
|
||||
* @param jsonArray
|
||||
*/
|
||||
public static void updateSystemUserRoleData(JSONArray jsonArray) {
|
||||
RecordSet rs = new RecordSet();
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
|
||||
String sysUserRoleId = Util.null2String(jsonObject.get("sysUserRoleId"));
|
||||
String updateDate = Util.null2String(jsonObject.get("updateDate"));
|
||||
String systemInfoCode = Util.null2String(jsonObject.get("systemInfoCode"));
|
||||
String orgCode = Util.null2String(jsonObject.get("orgCode"));
|
||||
String systemUserCode = Util.null2String(jsonObject.get("systemUserCode"));
|
||||
String statusCd = Util.null2String(jsonObject.get("statusCd"));
|
||||
String roleCode = Util.null2String(jsonObject.get("roleCode"));
|
||||
String manageClass = Util.null2String(jsonObject.get("manageClass"));
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
String createDate = Util.null2String(jsonObject.get("createDate"));
|
||||
|
||||
if(!"".equals(systemUserCode)){
|
||||
String loginid = "";
|
||||
|
||||
String sql = " select loginid from hrmrole where workcode=?" ;
|
||||
rs.executeQuery(sql,new Object[]{systemUserCode});
|
||||
if(rs.next()){
|
||||
loginid = Util.null2String(rs.getString("loginid"));
|
||||
}
|
||||
|
||||
|
||||
sql = " select loginid from hrmresource where workcode=?" ;
|
||||
rs.executeQuery(sql,new Object[]{systemUserCode});
|
||||
if(rs.next()){
|
||||
loginid = Util.null2String(rs.getString("loginid"));
|
||||
}
|
||||
|
||||
if(!"".equals(loginid)){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
* @param jsonArray
|
||||
*/
|
||||
public static void updateSystemUserPostData(JSONArray jsonArray) {
|
||||
RecordSet rs = new RecordSet();
|
||||
//{"authenticationInfo":{"sysUserPostId":"37484","sysUserId":"1","key":"authenticationInfo"},
|
||||
// "svcCode":"70300100030001","requestObject":[{"content":
|
||||
// [{"updateDate":"2022-07-22 10:51:29","staffCode":"0009000380","orgName":"merchantLF",
|
||||
// "sysPostId":"0","statusCd":"1000","relType":"1100",
|
||||
// "systemUserCode":"0009000380","orgId":"9000331",
|
||||
// "createStaff":"9000377",
|
||||
// "sysUserPostId":"122952","orgType":"2400",
|
||||
// "systemUserName":"liaofei",
|
||||
// "orgCode":"GAM9000331","staffName":"liaofei","actType":"A","sysUserId":"20051",
|
||||
// "staffId":9000380,"createDate":"2022-07-22 10:51:29"}],"tableName":"system_user_post","primaryKey":"sysUserPostId"}],"key":"svcCont"}
|
||||
|
||||
for (int i = 0; i < jsonArray.size(); i++)
|
||||
{
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
|
||||
String updateDate = Util.null2String(jsonObject.get("updateDate"));
|
||||
String staffCode = Util.null2String(jsonObject.get("staffCode"));
|
||||
String orgName = Util.null2String(jsonObject.get("orgName"));
|
||||
String sysPostId = Util.null2String(jsonObject.get("sysPostId"));
|
||||
String relType = Util.null2String(jsonObject.get("relType"));
|
||||
String statusCd = Util.null2String(jsonObject.get("statusCd"));
|
||||
String systemUserCode = Util.null2String(jsonObject.get("systemUserCode"));
|
||||
String orgType = Util.null2String(jsonObject.get("orgType"));
|
||||
String orgCode = Util.null2String(jsonObject.get("orgCode"));
|
||||
String staffName = Util.null2String(jsonObject.get("staffName"));
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
String sysUserId = Util.null2String(jsonObject.get("sysUserId"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
* @param jsonArray
|
||||
*/
|
||||
public static void updasteSysRoleData(JSONArray jsonArray) {
|
||||
RecordSet rs = new RecordSet();
|
||||
//{"authenticationInfo":{"sysUserPostId":"37484","sysUserId":"1","key":"authenticationInfo"},
|
||||
// "svcCode":"70300100030001","requestObject":[{"content":
|
||||
// [{"updateDate":"2022-07-22 10:51:29","staffCode":"0009000380","orgName":"merchantLF",
|
||||
// "sysPostId":"0","statusCd":"1000","relType":"1100",
|
||||
// "systemUserCode":"0009000380","orgId":"9000331",
|
||||
// "createStaff":"9000377",
|
||||
// "sysUserPostId":"122952","orgType":"2400",
|
||||
// "systemUserName":"liaofei",
|
||||
// "orgCode":"GAM9000331","staffName":"liaofei","actType":"A","sysUserId":"20051",
|
||||
// "staffId":9000380,"createDate":"2022-07-22 10:51:29"}],"tableName":"system_user_post","primaryKey":"sysUserPostId"}],"key":"svcCont"}
|
||||
|
||||
for (int i = 0; i < jsonArray.size(); i++)
|
||||
{
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
|
||||
String updateDate = Util.null2String(jsonObject.get("updateDate"));
|
||||
String staffCode = Util.null2String(jsonObject.get("staffCode"));
|
||||
String orgName = Util.null2String(jsonObject.get("orgName"));
|
||||
String sysPostId = Util.null2String(jsonObject.get("sysPostId"));
|
||||
String relType = Util.null2String(jsonObject.get("relType"));
|
||||
String statusCd = Util.null2String(jsonObject.get("statusCd"));
|
||||
String systemUserCode = Util.null2String(jsonObject.get("systemUserCode"));
|
||||
String orgType = Util.null2String(jsonObject.get("orgType"));
|
||||
String orgCode = Util.null2String(jsonObject.get("orgCode"));
|
||||
String staffName = Util.null2String(jsonObject.get("staffName"));
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
String sysUserId = Util.null2String(jsonObject.get("sysUserId"));
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
* @param jsonArray
|
||||
*/
|
||||
public static void updasteSysPostData(JSONArray jsonArray) {
|
||||
RecordSet rs = new RecordSet();
|
||||
//{"authenticationInfo":{"sysUserPostId":"37484","sysUserId":"1","key":"authenticationInfo"},
|
||||
// "svcCode":"70300100030001","requestObject":[{"content":
|
||||
// [{"updateDate":"2022-07-22 10:51:29","staffCode":"0009000380","orgName":"merchantLF",
|
||||
// "sysPostId":"0","statusCd":"1000","relType":"1100",
|
||||
// "systemUserCode":"0009000380","orgId":"9000331",
|
||||
// "createStaff":"9000377",
|
||||
// "sysUserPostId":"122952","orgType":"2400",
|
||||
// "systemUserName":"liaofei",
|
||||
// "orgCode":"GAM9000331","staffName":"liaofei","actType":"A","sysUserId":"20051",
|
||||
// "staffId":9000380,"createDate":"2022-07-22 10:51:29"}],"tableName":"system_user_post","primaryKey":"sysUserPostId"}],"key":"svcCont"}
|
||||
|
||||
for (int i = 0; i < jsonArray.size(); i++)
|
||||
{
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
|
||||
String updateDate = Util.null2String(jsonObject.get("updateDate"));
|
||||
String staffCode = Util.null2String(jsonObject.get("staffCode"));
|
||||
String orgName = Util.null2String(jsonObject.get("orgName"));
|
||||
String sysPostId = Util.null2String(jsonObject.get("sysPostId"));
|
||||
String relType = Util.null2String(jsonObject.get("relType"));
|
||||
String statusCd = Util.null2String(jsonObject.get("statusCd"));
|
||||
String systemUserCode = Util.null2String(jsonObject.get("systemUserCode"));
|
||||
String orgType = Util.null2String(jsonObject.get("orgType"));
|
||||
String orgCode = Util.null2String(jsonObject.get("orgCode"));
|
||||
String staffName = Util.null2String(jsonObject.get("staffName"));
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
String sysUserId = Util.null2String(jsonObject.get("sysUserId"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void removeCache(){
|
||||
ResourceComInfo resComInfo;
|
||||
DepartmentComInfo deptComInfo;
|
||||
try {
|
||||
resComInfo = new ResourceComInfo();
|
||||
resComInfo.removeResourceCache();
|
||||
deptComInfo = new DepartmentComInfo();
|
||||
deptComInfo.removeCompanyCache();
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package com.engine.bpm.todo.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface WorkflowTodoService {
|
||||
|
||||
Map<String,Object> doGetTodoList(Map<String,Object> apidatas);
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
package com.engine.bpm.todo.service.impl;
|
||||
|
||||
import com.engine.bpm.todo.cmd.WorkflowTodoListCmd;
|
||||
import com.engine.bpm.todo.service.WorkflowTodoService;
|
||||
import com.engine.core.impl.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class WorkflowTodoServiceImpl extends Service implements WorkflowTodoService {
|
||||
@Override
|
||||
public Map<String, Object> doGetTodoList(Map<String, Object> apidatas) {
|
||||
return commandExecutor.execute(new WorkflowTodoListCmd(apidatas));
|
||||
}
|
||||
|
||||
}
|
@ -1,108 +0,0 @@
|
||||
package com.engine.bpm.todo.web;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.bpm.todo.service.WorkflowTodoService;
|
||||
import com.engine.bpm.todo.service.impl.WorkflowTodoServiceImpl;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import weaver.general.BaseBean;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
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.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class WorkflowTodoAction {
|
||||
|
||||
/***
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public WorkflowTodoService getService(){
|
||||
return (WorkflowTodoService) ServiceUtil.getService(WorkflowTodoServiceImpl.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/todolist")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String doGetTodoList(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||
|
||||
BaseBean bb = new BaseBean();
|
||||
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
List<Map<String,String>> list = new ArrayList<Map<String,String>>();
|
||||
try{
|
||||
String type = request.getParameter("type");
|
||||
String uid = "" ;
|
||||
String userCode = "" ;
|
||||
String zsmartLocale = "";
|
||||
String cookies = request.getHeader("cookie");
|
||||
bb.writeLog("cookies:"+cookies);
|
||||
if(!"".equals(cookies))
|
||||
{
|
||||
String[] cookievals = cookies.split(";");
|
||||
for(int i=0;i<cookievals.length;i++)
|
||||
{
|
||||
String cookval = cookievals[i];
|
||||
if(!"".equals(cookval) && cookval.contains("="))
|
||||
{
|
||||
String key = cookval.substring(0,cookval.indexOf("="));
|
||||
String value = cookval.substring(cookval.indexOf("=")+1);
|
||||
bb.writeLog("key:"+key + " value:"+value);
|
||||
if("SESSION".equals(key.trim()) || key.contains("SESSION")){
|
||||
uid = value;
|
||||
}
|
||||
|
||||
if("userCode".equalsIgnoreCase(key.trim()) || key.contains("userCode") ){
|
||||
userCode = value;
|
||||
}
|
||||
|
||||
if("ZSMART_LOCALE".equalsIgnoreCase(key.trim()) || key.contains("ZSMART_LOCALE") ){
|
||||
zsmartLocale = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Map<String,Object> dataMap = new HashMap<String,Object>();
|
||||
dataMap.put("uid",uid);
|
||||
dataMap.put("userCode",userCode);
|
||||
dataMap.put("zsmartLocale",zsmartLocale);
|
||||
|
||||
Map<String,Object> map = getService().doGetTodoList(dataMap);
|
||||
if(map !=null && map.containsKey("list")){
|
||||
list = (List<Map<String,String>>)map.get("list");
|
||||
}
|
||||
jsonArray.addAll(list);
|
||||
}catch (Exception e){
|
||||
}
|
||||
return jsonArray.toJSONString();
|
||||
}
|
||||
|
||||
|
||||
@POST
|
||||
@Path("/posttodolist")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String doPostTodoList(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||
|
||||
BaseBean bb = new BaseBean();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
try{
|
||||
|
||||
|
||||
}catch (Exception e){
|
||||
}
|
||||
return jsonObject.toJSONString();
|
||||
}
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
package weaver.interfaces.esigns;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.interfaces.filter.HttpRequestUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ESiginsTest {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
BaseBean bb = new BaseBean();
|
||||
HttpRequestUtil httpRequestUtil = new HttpRequestUtil();
|
||||
try{
|
||||
|
||||
|
||||
String uid = "" ;
|
||||
String cookies = "" ;//request.getHeader("cookie");
|
||||
bb.writeLog("cookies:"+cookies);
|
||||
if(!"".equals(cookies))
|
||||
{
|
||||
String[] cookievals = cookies.split(";");
|
||||
for(int i=0;i<cookievals.length;i++)
|
||||
{
|
||||
String cookval = cookievals[i];
|
||||
if(!"".equals(cookval) && cookval.contains("="))
|
||||
{
|
||||
String key = cookval.substring(0,cookval.indexOf("="));
|
||||
String value = cookval.substring(cookval.indexOf("=")+1);
|
||||
bb.writeLog("key:"+key + " value:"+value);
|
||||
if("SESSION".equals(key.trim()) || key.contains("SESSION")){
|
||||
uid = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String sysUserCode = "staff727" ;
|
||||
String url = "http://172.16.25.133/portal-web/v1/esign/"+sysUserCode+"/esigns" ;
|
||||
Map<String,String> headMap = new HashMap<String,String>();
|
||||
|
||||
headMap.put("Cookie","SESSION="+uid);
|
||||
String msg = HttpRequestUtil.httpGet2(url,headMap,"UTF-8");
|
||||
System.out.println("msg ==" + msg);
|
||||
if(!"".equals(msg))
|
||||
{
|
||||
JSONObject jsonObject = JSONObject.parseObject(msg);
|
||||
if("1".equals(jsonObject.getString("resultCode")))
|
||||
{
|
||||
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
}catch (Exception e3){
|
||||
System.out.println("e---2:"+e3);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
package weaver.interfaces.qt;
|
||||
|
||||
|
||||
//import com.alibaba.rocketmq.client.consumer.DefaultMQPushConsumer;
|
||||
//import com.alibaba.rocketmq.client.consumer.listener.ConsumeOrderlyStatus;
|
||||
//import com.alibaba.rocketmq.client.consumer.listener.MessageListenerOrderly;
|
||||
//import com.alibaba.rocketmq.common.consumer.ConsumeFromWhere;
|
||||
//import com.alibaba.rocketmq.common.message.MessageExt;
|
||||
//import com.alibaba.rocketmq.common.protocol.heartbeat.MessageModel;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
public class RocketMqConsumer {
|
||||
|
||||
// private DefaultMQPushConsumer consumer;
|
||||
//
|
||||
// private final MessageModel messageModel = MessageModel.CLUSTERING;
|
||||
//
|
||||
//
|
||||
// private String consumerGroupName = "portal-producer-group_nj";
|
||||
// private String instanceName = "dataSync_topic_nj" ;
|
||||
// private String nameServerAddr = "172.16.84.183:9001;172.16.84.187:9001";
|
||||
// private int consumeThreadMin;
|
||||
// private int consumeThreadMax;
|
||||
// private String topicAndTags = "*" ;
|
||||
// private int pullThresholdForQueue;
|
||||
// private int pullBatchSize;
|
||||
//
|
||||
//
|
||||
// public void afterPropertiesSet2() throws Exception {
|
||||
// consumer = new DefaultMQPushConsumer(consumerGroupName);
|
||||
// consumer.setInstanceName(instanceName);
|
||||
// consumer.setMessageModel(messageModel);
|
||||
// consumer.setNamesrvAddr(nameServerAddr);
|
||||
// consumer.setConsumeThreadMax(consumeThreadMax);
|
||||
// consumer.setConsumeThreadMin(consumeThreadMin);
|
||||
// consumer.setPullBatchSize(pullBatchSize);
|
||||
// consumer.setPullThresholdForQueue(pullThresholdForQueue);
|
||||
// consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_FIRST_OFFSET);
|
||||
// // 订阅的 topic 和 tags
|
||||
// consumer.subscribe(topicAndTags, topicAndTags);
|
||||
// // 注册监听方式 有序
|
||||
// consumer.registerMessageListener((MessageListenerOrderly) (messageExtList, consumeOrderlyContext) -> {
|
||||
// MessageExt msg = messageExtList.get(0);
|
||||
// String messageBody = new String(msg.getBody());
|
||||
// System.out.println("consume message, msgId={}, topic={}, tags={}, keys={},\n body={}"+ msg.getMsgId()+ msg.getTopic()+msg.getTags()+ msg.getKeys()+ messageBody);
|
||||
// // todo: business code to consume message
|
||||
// //yourService.xxx
|
||||
// return ConsumeOrderlyStatus.SUCCESS;
|
||||
// });
|
||||
// consumer.start();
|
||||
// System.out.println("rocketMQ consumer group [{}] started"+ consumerGroupName);
|
||||
// }
|
||||
}
|
||||
|
@ -1,39 +0,0 @@
|
||||
package weaver.interfaces.qt;
|
||||
|
||||
import com.alibaba.rocketmq.client.consumer.listener.*;
|
||||
import com.alibaba.rocketmq.common.message.MessageExt;
|
||||
import weaver.general.BaseBean;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class RocketMsgOrderListener implements MessageListenerOrderly {
|
||||
|
||||
@Override
|
||||
public ConsumeOrderlyStatus consumeMessage(List<MessageExt> msgs, ConsumeOrderlyContext consumeOrderlyContext) {
|
||||
BaseBean bb = new BaseBean();
|
||||
MessageExt msg = msgs.get(0);
|
||||
|
||||
RocketmqUtil2 rocketmqUtil = new RocketmqUtil2();
|
||||
|
||||
try {
|
||||
|
||||
bb.writeLog("Consumer---3----"+new String(msg.getBody()));
|
||||
String msgdata = new String(msg.getBody(),"UTF-8");
|
||||
if(!"".equals(msgdata))
|
||||
{
|
||||
String data = msgdata.substring(msgdata.indexOf("{"));
|
||||
int errcount = rocketmqUtil.updateOrgData(data);
|
||||
if(errcount >0){
|
||||
return ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT;
|
||||
}
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
bb.writeLog("Consumer---UnsupportedEncodingException---e:"+e);
|
||||
return ConsumeOrderlyStatus.SUSPEND_CURRENT_QUEUE_A_MOMENT;
|
||||
}
|
||||
return ConsumeOrderlyStatus.SUCCESS;
|
||||
}
|
||||
}
|
@ -1,496 +0,0 @@
|
||||
package weaver.interfaces.qt;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.TimeUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.company.DepartmentComInfo;
|
||||
import weaver.hrm.resource.ResourceComInfo;
|
||||
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
public class RocketmqUtil2 {
|
||||
private Lock lock = new ReentrantLock();
|
||||
public int updateOrgData(String data)
|
||||
{
|
||||
lock.lock();
|
||||
BaseBean bb = new BaseBean();
|
||||
int errcount = 0;
|
||||
|
||||
try{
|
||||
JSONObject jsonObject = JSONObject.parseObject(data);
|
||||
if(jsonObject.containsKey("requestObject"))
|
||||
{
|
||||
JSONArray requestArray = jsonObject.getJSONArray("requestObject");
|
||||
for(int i=0;i<requestArray.size();i++)
|
||||
{
|
||||
JSONObject requestObject = requestArray.getJSONObject(i);
|
||||
System.out.println(requestObject.toJSONString());
|
||||
if(!requestObject.isEmpty()){
|
||||
if(requestObject.containsKey("tableName") && requestObject.containsKey("content"))
|
||||
{
|
||||
String tableName = requestObject.getString("tableName");
|
||||
bb.writeLog("tableName:"+tableName);
|
||||
if("organization".equals(tableName)){
|
||||
JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
int errcount1 = updasteSysOrgData(jsonArray);
|
||||
errcount += errcount1;
|
||||
}else if("system_user".equals(tableName)){
|
||||
JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
int errcount2 = updateSysUserData(jsonArray);
|
||||
errcount += errcount2;
|
||||
}else if("system_role".equals(tableName)){
|
||||
JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
updasteSysRoleData(jsonArray);
|
||||
}else if("system_post".equals(tableName)){
|
||||
JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
updasteSysPostData(jsonArray);
|
||||
}else if("system_user_role".equals(tableName)){
|
||||
JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
updateSystemUserRoleData(jsonArray);
|
||||
}else if("system_user_post".equals(tableName)){
|
||||
JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
updateSystemUserPostData(jsonArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
|
||||
}finally {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
bb.writeLog("errcount:"+errcount);
|
||||
return errcount;
|
||||
}
|
||||
/***
|
||||
*
|
||||
* @param jsonArray
|
||||
*/
|
||||
public int updateSysUserData(JSONArray jsonArray){
|
||||
RecordSet rs = new RecordSet();
|
||||
BaseBean bb = new BaseBean();
|
||||
|
||||
//{"authenticationInfo":{"sysUserPostId":"37484","sysUserId":"1","key":"authenticationInfo"},
|
||||
// "svcCode":"70300100030001","requestObject":[{"content":[
|
||||
// {"statusDate":"2022-07-18 11:25:41","updateDate":"2022-07-22 10:52:56",
|
||||
// "regionNbr":"1","expDate":"2999-12-31 23:59:59","userOrgId":"2",
|
||||
// "password":"{bcrypt}$2a$10$wQrGr6zHlqaKbAZGaK7PC.VdmZdq4HJn6t7R4XpGsf/yKqPj6smHq",
|
||||
// "effDate":"2021-07-13 10:33:57","orgCode":"2",
|
||||
// "staffName":"zhouhan","pwdNewtime":"2022-05-18 14:42:15",
|
||||
// "pwdContinErrCnt":"0","actType":"M","sysUserId":"14002","email":"2112@qq.com",
|
||||
// "createDate":"2021-07-13 10:33:58","staffCode":"zhouhan",
|
||||
// "sysUserCode":"zhouhan","pwdErrCnt":"0","pwdEffectDays":"90","statusCd":"1000",
|
||||
// "systemInfoId":"-1","userName":"zhouhan","createStaff":"1","pwdStatus":"1100",
|
||||
// "regionId":"731","pwdSmsTel":"21423523523","loginedNum":"78","staffId":"12002",
|
||||
// "updateStaff":"1"}],"tableName":"system_user","primaryKey":"sysUserId"}],"key":"svcCont"}
|
||||
|
||||
int errcount = 0;
|
||||
for(int i=0;i<jsonArray.size();i++)
|
||||
{
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
String statusDate = Util.null2String(jsonObject.get("statusDate"));
|
||||
String updateDate = Util.null2String(jsonObject.get("updateDate"));
|
||||
String regionNbr = Util.null2String(jsonObject.get("regionNbr"));
|
||||
String userOrgId = Util.null2String(jsonObject.get("userOrgId"));
|
||||
String orgCode = Util.null2String(jsonObject.get("orgCode"));
|
||||
|
||||
String staffId = Util.null2String(jsonObject.get("staffId"));
|
||||
String staffName = Util.null2String(jsonObject.get("staffName"));
|
||||
String staffCode = Util.null2String(jsonObject.get("staffCode"));
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
|
||||
String email = Util.null2String(jsonObject.get("email"));
|
||||
String sysUserId = Util.null2String(jsonObject.get("sysUserId"));
|
||||
String sysUserCode = Util.null2String(jsonObject.get("sysUserCode"));
|
||||
String userName = Util.null2String(jsonObject.get("userName"));
|
||||
String pwdSmsTel = Util.null2String(jsonObject.get("pwdSmsTel"));
|
||||
|
||||
String loginedNum = Util.null2String(jsonObject.get("sysUserId"));
|
||||
|
||||
|
||||
String statusCd = Util.null2String(jsonObject.get("statusCd"));
|
||||
String status = "1";
|
||||
if("1100".equals(statusCd) || "1200".equals(statusCd) || "1300".equals(statusCd)){
|
||||
status = "5";
|
||||
}
|
||||
bb.writeLog("status:"+status);
|
||||
bb.writeLog("statusCd:"+statusCd);
|
||||
|
||||
String subcompanyid1 = "" ;
|
||||
String deptId = "";
|
||||
if(!"".equals(orgCode)){
|
||||
String sql = " select id,subcompanyid1 from hrmdepartment where departmentcode = ?" ;
|
||||
rs.executeQuery(sql,new Object[]{orgCode});
|
||||
if(rs.next()){
|
||||
deptId = Util.null2String(rs.getString("id"));
|
||||
subcompanyid1 = Util.null2String(rs.getString("subcompanyid1"));
|
||||
}
|
||||
}
|
||||
bb.writeLog("deptId:"+deptId);
|
||||
bb.writeLog("subcompanyid1:"+subcompanyid1);
|
||||
|
||||
String locationid = "2" ;
|
||||
String seclevel = "20" ;
|
||||
String createrid = "1" ;
|
||||
String lastmodid = "1" ;
|
||||
String creator = "1";
|
||||
String jobTitleId = "40";
|
||||
String systemlanguage = "7" ;
|
||||
String currentDate = TimeUtil.getCurrentDateString();//当前日期
|
||||
|
||||
String currentDateTime = TimeUtil.getCurrentTimeString(); //当前时间
|
||||
bb.writeLog("status:"+status);
|
||||
bb.writeLog("currentDate:"+currentDate);
|
||||
|
||||
String loginid = "";
|
||||
String sql = " select loginid from hrmresource where workcode=?" ;
|
||||
bb.writeLog("sql:"+sql);
|
||||
bb.writeLog("staffCode:"+staffCode);
|
||||
rs.executeQuery(sql,new Object[]{staffCode});
|
||||
if(rs.next()){
|
||||
loginid = Util.null2String(rs.getString("loginid"));
|
||||
}
|
||||
bb.writeLog("loginid:"+loginid);
|
||||
if(!"".equals(deptId))
|
||||
{
|
||||
if(!"".equals(loginid))
|
||||
{
|
||||
if("M".equalsIgnoreCase(actType))
|
||||
{
|
||||
String userUpdateSql = " update hrmresource set lastname=?,departmentid=?,subcompanyid1=?," +
|
||||
" creater=?,email=?,mobile=?,jobtitle=?,status=?,dsporder=?,lastmoddate=?,modified=? where workcode=? ";
|
||||
bb.writeLog("userUpdateSql:"+userUpdateSql);
|
||||
|
||||
boolean flag = rs.executeUpdate(userUpdateSql,new Object[]{staffName,deptId,subcompanyid1,creator,email,
|
||||
pwdSmsTel,jobTitleId,status,loginedNum,currentDate,currentDateTime,staffCode});
|
||||
bb.writeLog("flag:"+flag);
|
||||
|
||||
if(!flag){
|
||||
errcount++;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if("A".equalsIgnoreCase(actType))
|
||||
{
|
||||
// int tmpid = 0;
|
||||
// rs.executeSql("select max(id) from HrmResourceVirtual ");
|
||||
// if(rs.next()){
|
||||
// tmpid = rs.getInt(1)+1;
|
||||
// }
|
||||
|
||||
rs.executeProc("HrmResourceMaxId_Get", "");
|
||||
rs.next();
|
||||
String id = "" + rs.getInt(1);
|
||||
bb.writeLog("id:"+id);
|
||||
|
||||
if(!"".equals(id)){
|
||||
String userInsertSql = " insert into hrmresource(id,loginid,workcode,lastname,departmentid,subcompanyid1," +
|
||||
"creater,email,mobile,jobtitle,status,dsporder,systemlanguage,createdate,lastmoddate,created,modified," +
|
||||
"locationid,seclevel,createrid,lastmodid) " +
|
||||
" values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
bb.writeLog("userInsertSql:"+userInsertSql);
|
||||
boolean flag = rs.executeUpdate(userInsertSql,new Object[]{id,staffCode,staffCode,staffName,deptId,subcompanyid1,
|
||||
creator,email,pwdSmsTel,jobTitleId,status,loginedNum,systemlanguage,currentDate,currentDate,currentDateTime,currentDateTime,
|
||||
locationid,seclevel,createrid,lastmodid});
|
||||
bb.writeLog("flag:"+flag);
|
||||
if(!flag){
|
||||
errcount++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return errcount;
|
||||
}
|
||||
|
||||
|
||||
public int updasteSysOrgData(JSONArray jsonArray){
|
||||
RecordSet rs = new RecordSet();
|
||||
BaseBean bb = new BaseBean();
|
||||
int errcount = 0;
|
||||
|
||||
// {"authenticationInfo":{"sysUserPostId":"37484","sysUserId":"1","key":"authenticationInfo"},"svcCode":
|
||||
// "70300100030001","requestObject":[{"content":[{
|
||||
// "updateDate":"2022-07-22 11:05:22","orgName":"testOrg722","parentOrgCode":"LNP000001",
|
||||
// "regionNbr":"TST_PR_CSS","orgLevel":"2","statusCd":"1000",
|
||||
// "parentOrgName":"Vivia","orgId":"17012",
|
||||
// "createStaff":"1","orgType":"1000",
|
||||
// "regionId":"36","parentOrgId":"1",
|
||||
// "orgCode":"testOrg722",
|
||||
// "pathCode":"-1.1.17012","actType":"A","partyId":"0",
|
||||
// "parRegionNbr":"1",
|
||||
// "createDate":"2022-07-22 11:05:22"
|
||||
// }],"tableName":"organization","primaryKey":"orgId"}],"key":"svcCont"}
|
||||
|
||||
|
||||
for(int i=0;i<jsonArray.size();i++)
|
||||
{
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
String orgName = Util.null2String(jsonObject.get("orgName"));
|
||||
String parentOrgCode = Util.null2String(jsonObject.get("parentOrgCode"));
|
||||
String statusCd = Util.null2String(jsonObject.get("statusCd"));
|
||||
String parentOrgName = Util.null2String(jsonObject.get("parentOrgName"));
|
||||
String orgId = Util.null2String(jsonObject.get("orgId"));
|
||||
String orgType = Util.null2String(jsonObject.get("orgType"));
|
||||
String orgCode = Util.null2String(jsonObject.get("orgCode"));
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
|
||||
String canceled = "";
|
||||
if("1100".equals(statusCd)){
|
||||
canceled = "1";
|
||||
}
|
||||
bb.writeLog("canceled:"+canceled);
|
||||
|
||||
|
||||
|
||||
String supdepid = "0";
|
||||
String subcompanyid1 = "" ;
|
||||
if(!"".equals(parentOrgCode))
|
||||
{
|
||||
rs.executeQuery(" select id from hrmsubcompany where subcompanycode=? ",new Object[]{parentOrgCode});
|
||||
if(rs.next()){
|
||||
subcompanyid1 = Util.null2String(rs.getString("id"));
|
||||
}
|
||||
if("".equals(subcompanyid1)){
|
||||
String sql = " select id,subcompanyid1 from hrmdepartment where departmentcode = ?" ;
|
||||
rs.executeQuery(sql,new Object[]{parentOrgCode});
|
||||
if(rs.next()){
|
||||
supdepid = Util.null2String(rs.getString("id"));
|
||||
subcompanyid1 = Util.null2String(rs.getString("subcompanyid1"));
|
||||
}
|
||||
}
|
||||
}
|
||||
bb.writeLog("actType:"+actType);
|
||||
bb.writeLog("supdepid:"+supdepid);
|
||||
bb.writeLog("subcompanyid1:"+subcompanyid1);
|
||||
|
||||
|
||||
if(!"".equals(subcompanyid1)){
|
||||
String deptid = "" ;
|
||||
String sql = " select id from hrmdepartment where departmentcode=?" ;
|
||||
rs.executeQuery(sql,new Object[]{orgCode});
|
||||
if(rs.next()){
|
||||
deptid = Util.null2String(rs.getString("id"));
|
||||
}
|
||||
|
||||
bb.writeLog("deptid:"+deptid);
|
||||
|
||||
if(!"".equals(deptid))
|
||||
{
|
||||
if("M".equalsIgnoreCase(actType))
|
||||
{
|
||||
String deptUpdateSql = " update hrmdepartment set departmentmark=?,departmentname=?,canceled=?," +
|
||||
" subcompanyid1=?,showorder=?, supdepid=? where departmentcode=? ";
|
||||
bb.writeLog("deptUpdateSql:"+deptUpdateSql);
|
||||
boolean flag = rs.executeUpdate(deptUpdateSql,new Object[]{orgName,orgName,canceled,subcompanyid1,orgId,supdepid,orgCode});
|
||||
bb.writeLog("flag:"+flag);
|
||||
if(!flag){
|
||||
errcount++;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if("A".equalsIgnoreCase(actType))
|
||||
{
|
||||
String deptInsertSql = " insert into hrmdepartment(departmentmark,departmentname,departmentcode," +
|
||||
" canceled,subcompanyid1,supdepid,showorder) values(?,?,?,?,?,?,?) ";
|
||||
bb.writeLog("deptInsertSql:"+deptInsertSql);
|
||||
boolean flag = rs.executeUpdate(deptInsertSql,new Object[]{orgName,orgName,orgCode,canceled,subcompanyid1,supdepid,orgId});
|
||||
bb.writeLog("flag:"+flag);
|
||||
if(!flag){
|
||||
errcount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return errcount;
|
||||
}
|
||||
|
||||
// {"authenticationInfo":{"sysUserPostId":"37484","sysUserId":"1","key":"authenticationInfo"},"svcCode":
|
||||
// "70300100030001","requestObject":[{"content":[{"sysUserRoleId":"23444","updateDate":"2022-07-22 11:08:33",
|
||||
// "systemInfoCode":"TYMH","sysRoleId":"17013","statusCd":"1000",
|
||||
// "systemInfoId":"727001","operType":"1000",
|
||||
// "systemUserCode":"finaceManager",
|
||||
// "expDate":"2120-01-01 00:00:00","orgId":"17012",
|
||||
// "createStaff":"1","effDate":"2022-07-21 10:17:51",
|
||||
// "systemUserName":"financeManager",
|
||||
// "orgCode":"testOrg722","roleCode":"orgManager","manageClass":"1000","roleName":"orgManager",
|
||||
// "actType":"A","sysUserId":"20047","createDate":"2022-07-22 11:08:33"}],
|
||||
// "tableName":"system_user_role","primaryKey":"sysUserRoleId"}],"key":"svcCont"}
|
||||
|
||||
/***
|
||||
*
|
||||
* @param jsonArray
|
||||
*/
|
||||
public static void updateSystemUserRoleData(JSONArray jsonArray) {
|
||||
RecordSet rs = new RecordSet();
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
|
||||
String sysUserRoleId = Util.null2String(jsonObject.get("sysUserRoleId"));
|
||||
String updateDate = Util.null2String(jsonObject.get("updateDate"));
|
||||
String systemInfoCode = Util.null2String(jsonObject.get("systemInfoCode"));
|
||||
String orgCode = Util.null2String(jsonObject.get("orgCode"));
|
||||
String systemUserCode = Util.null2String(jsonObject.get("systemUserCode"));
|
||||
String statusCd = Util.null2String(jsonObject.get("statusCd"));
|
||||
String roleCode = Util.null2String(jsonObject.get("roleCode"));
|
||||
String manageClass = Util.null2String(jsonObject.get("manageClass"));
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
String createDate = Util.null2String(jsonObject.get("createDate"));
|
||||
|
||||
if(!"".equals(systemUserCode)){
|
||||
// String loginid = "";
|
||||
//
|
||||
// String sql = " select loginid from hrmrole where workcode=?" ;
|
||||
// rs.executeQuery(sql,new Object[]{systemUserCode});
|
||||
// if(rs.next()){
|
||||
// loginid = Util.null2String(rs.getString("loginid"));
|
||||
// }
|
||||
//
|
||||
//
|
||||
// sql = " select loginid from hrmresource where workcode=?" ;
|
||||
// rs.executeQuery(sql,new Object[]{systemUserCode});
|
||||
// if(rs.next()){
|
||||
// loginid = Util.null2String(rs.getString("loginid"));
|
||||
// }
|
||||
//
|
||||
// if(!"".equals(loginid)){
|
||||
//
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
* @param jsonArray
|
||||
*/
|
||||
public static void updateSystemUserPostData(JSONArray jsonArray) {
|
||||
RecordSet rs = new RecordSet();
|
||||
//{"authenticationInfo":{"sysUserPostId":"37484","sysUserId":"1","key":"authenticationInfo"},
|
||||
// "svcCode":"70300100030001","requestObject":[{"content":
|
||||
// [{"updateDate":"2022-07-22 10:51:29","staffCode":"0009000380","orgName":"merchantLF",
|
||||
// "sysPostId":"0","statusCd":"1000","relType":"1100",
|
||||
// "systemUserCode":"0009000380","orgId":"9000331",
|
||||
// "createStaff":"9000377",
|
||||
// "sysUserPostId":"122952","orgType":"2400",
|
||||
// "systemUserName":"liaofei",
|
||||
// "orgCode":"GAM9000331","staffName":"liaofei","actType":"A","sysUserId":"20051",
|
||||
// "staffId":9000380,"createDate":"2022-07-22 10:51:29"}],"tableName":"system_user_post","primaryKey":"sysUserPostId"}],"key":"svcCont"}
|
||||
|
||||
for (int i = 0; i < jsonArray.size(); i++)
|
||||
{
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
|
||||
String updateDate = Util.null2String(jsonObject.get("updateDate"));
|
||||
String staffCode = Util.null2String(jsonObject.get("staffCode"));
|
||||
String orgName = Util.null2String(jsonObject.get("orgName"));
|
||||
String sysPostId = Util.null2String(jsonObject.get("sysPostId"));
|
||||
String relType = Util.null2String(jsonObject.get("relType"));
|
||||
String statusCd = Util.null2String(jsonObject.get("statusCd"));
|
||||
String systemUserCode = Util.null2String(jsonObject.get("systemUserCode"));
|
||||
String orgType = Util.null2String(jsonObject.get("orgType"));
|
||||
String orgCode = Util.null2String(jsonObject.get("orgCode"));
|
||||
String staffName = Util.null2String(jsonObject.get("staffName"));
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
String sysUserId = Util.null2String(jsonObject.get("sysUserId"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
* @param jsonArray
|
||||
*/
|
||||
public static void updasteSysRoleData(JSONArray jsonArray) {
|
||||
RecordSet rs = new RecordSet();
|
||||
//{"authenticationInfo":{"sysUserPostId":"37484","sysUserId":"1","key":"authenticationInfo"},
|
||||
// "svcCode":"70300100030001","requestObject":[{"content":
|
||||
// [{"updateDate":"2022-07-22 10:51:29","staffCode":"0009000380","orgName":"merchantLF",
|
||||
// "sysPostId":"0","statusCd":"1000","relType":"1100",
|
||||
// "systemUserCode":"0009000380","orgId":"9000331",
|
||||
// "createStaff":"9000377",
|
||||
// "sysUserPostId":"122952","orgType":"2400",
|
||||
// "systemUserName":"liaofei",
|
||||
// "orgCode":"GAM9000331","staffName":"liaofei","actType":"A","sysUserId":"20051",
|
||||
// "staffId":9000380,"createDate":"2022-07-22 10:51:29"}],"tableName":"system_user_post","primaryKey":"sysUserPostId"}],"key":"svcCont"}
|
||||
|
||||
for (int i = 0; i < jsonArray.size(); i++)
|
||||
{
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
|
||||
String updateDate = Util.null2String(jsonObject.get("updateDate"));
|
||||
String staffCode = Util.null2String(jsonObject.get("staffCode"));
|
||||
String orgName = Util.null2String(jsonObject.get("orgName"));
|
||||
String sysPostId = Util.null2String(jsonObject.get("sysPostId"));
|
||||
String relType = Util.null2String(jsonObject.get("relType"));
|
||||
String statusCd = Util.null2String(jsonObject.get("statusCd"));
|
||||
String systemUserCode = Util.null2String(jsonObject.get("systemUserCode"));
|
||||
String orgType = Util.null2String(jsonObject.get("orgType"));
|
||||
String orgCode = Util.null2String(jsonObject.get("orgCode"));
|
||||
String staffName = Util.null2String(jsonObject.get("staffName"));
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
String sysUserId = Util.null2String(jsonObject.get("sysUserId"));
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
* @param jsonArray
|
||||
*/
|
||||
public static void updasteSysPostData(JSONArray jsonArray) {
|
||||
RecordSet rs = new RecordSet();
|
||||
//{"authenticationInfo":{"sysUserPostId":"37484","sysUserId":"1","key":"authenticationInfo"},
|
||||
// "svcCode":"70300100030001","requestObject":[{"content":
|
||||
// [{"updateDate":"2022-07-22 10:51:29","staffCode":"0009000380","orgName":"merchantLF",
|
||||
// "sysPostId":"0","statusCd":"1000","relType":"1100",
|
||||
// "systemUserCode":"0009000380","orgId":"9000331",
|
||||
// "createStaff":"9000377",
|
||||
// "sysUserPostId":"122952","orgType":"2400",
|
||||
// "systemUserName":"liaofei",
|
||||
// "orgCode":"GAM9000331","staffName":"liaofei","actType":"A","sysUserId":"20051",
|
||||
// "staffId":9000380,"createDate":"2022-07-22 10:51:29"}],"tableName":"system_user_post","primaryKey":"sysUserPostId"}],"key":"svcCont"}
|
||||
|
||||
for (int i = 0; i < jsonArray.size(); i++)
|
||||
{
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
|
||||
String updateDate = Util.null2String(jsonObject.get("updateDate"));
|
||||
String staffCode = Util.null2String(jsonObject.get("staffCode"));
|
||||
String orgName = Util.null2String(jsonObject.get("orgName"));
|
||||
String sysPostId = Util.null2String(jsonObject.get("sysPostId"));
|
||||
String relType = Util.null2String(jsonObject.get("relType"));
|
||||
String statusCd = Util.null2String(jsonObject.get("statusCd"));
|
||||
String systemUserCode = Util.null2String(jsonObject.get("systemUserCode"));
|
||||
String orgType = Util.null2String(jsonObject.get("orgType"));
|
||||
String orgCode = Util.null2String(jsonObject.get("orgCode"));
|
||||
String staffName = Util.null2String(jsonObject.get("staffName"));
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
String sysUserId = Util.null2String(jsonObject.get("sysUserId"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void removeCache(){
|
||||
ResourceComInfo resComInfo;
|
||||
DepartmentComInfo deptComInfo;
|
||||
try {
|
||||
resComInfo = new ResourceComInfo();
|
||||
resComInfo.removeResourceCache();
|
||||
deptComInfo = new DepartmentComInfo();
|
||||
deptComInfo.removeCompanyCache();
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,215 +0,0 @@
|
||||
package weaver.interfaces.qt;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
|
||||
public class SymOrgUserData {
|
||||
public static void main(String[] args) {
|
||||
String data = "{\n" +
|
||||
" \"authenticationInfo\":{\n" +
|
||||
" \"sysUserPostId\":\"37484\",\n" +
|
||||
" \"sysUserId\":\"1\",\n" +
|
||||
" \"key\":\"authenticationInfo\"\n" +
|
||||
" },\n" +
|
||||
" \"svcCode\":\"70300100030001\",\n" +
|
||||
" \"requestObject\":[\n" +
|
||||
" {\n" +
|
||||
" \"content\":[\n" +
|
||||
" {\n" +
|
||||
" \"statusDate\":\"2022-03-17 11:08:18\",\n" +
|
||||
" \"updateDate\":\"2022-07-14 01:00:04\",\n" +
|
||||
" \"regionNbr\":\"1\",\n" +
|
||||
" \"expDate\":\"2999-12-31 23:59:59\",\n" +
|
||||
" \"userOrgId\":\"4\",\n" +
|
||||
" \"password\":\"{bcrypt}$2a$10$cx6phvPFoHihrx3W1esWDObkQe3nh4rRknEEKd7yOO6PgxdpaNq/m\",\n" +
|
||||
" \"effDate\":\"2020-04-22 14:24:41\",\n" +
|
||||
" \"orgCode\":\"AGG000004\",\n" +
|
||||
" \"staffName\":\"yueyy008\",\n" +
|
||||
" \"pwdNewtime\":\"2020-04-22 14:24:41\",\n" +
|
||||
" \"pwdContinErrCnt\":\"1\",\n" +
|
||||
" \"actType\":\"M\",\n" +
|
||||
" \"sysUserId\":\"2003\",\n" +
|
||||
" \"createDate\":\"2020-04-22 14:24:42\",\n" +
|
||||
" \"staffCode\":\"yueyy008\",\n" +
|
||||
" \"sysUserCode\":\"yueyy008\",\n" +
|
||||
" \"pwdErrCnt\":\"1\",\n" +
|
||||
" \"pwdEffectDays\":\"90\",\n" +
|
||||
" \"statusCd\":\"1000\",\n" +
|
||||
" \"systemInfoId\":\"2034\",\n" +
|
||||
" \"userName\":\"yueyy008\",\n" +
|
||||
" \"createStaff\":\"1\",\n" +
|
||||
" \"pwdStatus\":\"1200\",\n" +
|
||||
" \"regionId\":\"731\",\n" +
|
||||
" \"pwdSmsTel\":\"666666666\",\n" +
|
||||
" \"staffId\":\"2003\"\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"tableName\":\"system_user\",\n" +
|
||||
" \"primaryKey\":\"sysUserId\"\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"key\":\"svcCont\"\n" +
|
||||
"}" ;
|
||||
JSONObject jsonObject = JSONObject.parseObject(data);
|
||||
|
||||
if(jsonObject.containsKey("requestObject")){
|
||||
JSONArray requestArray = jsonObject.getJSONArray("requestObject");
|
||||
|
||||
for(int i=0;i<requestArray.size();i++){
|
||||
JSONObject requestObject = requestArray.getJSONObject(i);
|
||||
System.out.println(requestObject.toJSONString());
|
||||
|
||||
if(!requestObject.isEmpty()){
|
||||
if(requestObject.containsKey("tableName") && requestObject.containsKey("content")){
|
||||
String tableName = requestObject.getString("tableName");
|
||||
// if("system_user".equals(tableName)){
|
||||
// JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
// updateSysUserData2(jsonArray);
|
||||
// }
|
||||
|
||||
System.out.println("tableName:"+tableName);
|
||||
|
||||
if("Organization".equals(tableName)){
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void updateSysUserData(JSONArray jsonArray){
|
||||
RecordSet rs = new RecordSet();
|
||||
for(int i=0;i<jsonArray.size();i++){
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
String userOrgId = Util.null2String(jsonObject.get("userOrgId"));
|
||||
String orgCode = Util.null2String(jsonObject.get("orgCode"));
|
||||
String staffName = Util.null2String(jsonObject.get("staffName"));
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
String sysUserId = Util.null2String(jsonObject.get("sysUserId"));
|
||||
String email = Util.null2String(jsonObject.get("email"));
|
||||
String staffCode = Util.null2String(jsonObject.get("staffCode"));
|
||||
String sysUserCode = Util.null2String(jsonObject.get("sysUserCode"));
|
||||
String userName = Util.null2String(jsonObject.get("userName"));
|
||||
String pwdSmsTel = Util.null2String(jsonObject.get("pwdSmsTel"));
|
||||
String staffId = Util.null2String(jsonObject.get("staffId"));
|
||||
|
||||
String statusCd = Util.null2String(jsonObject.get("statusCd"));
|
||||
String status = "1";
|
||||
if("1100".equals(status) || "1200".equals(status) || "1300".equals(status)){
|
||||
status = "5";
|
||||
}
|
||||
|
||||
String deptId = "";
|
||||
if(!"".equals(orgCode)){
|
||||
String sql = " select id from hrmdepartment where department = ? and departmentcode = ?" ;
|
||||
rs.executeUpdate(sql,new Object[]{staffCode});
|
||||
if(rs.next()){
|
||||
deptId = Util.null2String(rs.getString("id"));
|
||||
}
|
||||
}
|
||||
|
||||
String subcompanyid1 = "" ;
|
||||
String creator = "1";
|
||||
String jobTitleId = "1";
|
||||
String currentDate = "" ;
|
||||
System.out.println("status:"+status);
|
||||
|
||||
String loginid = "";
|
||||
String sql = " select loginid from hrmresource where workcode=?" ;
|
||||
rs.executeUpdate(sql,new Object[]{staffCode});
|
||||
if(rs.next()){
|
||||
loginid = Util.null2String(rs.getString("loginid"));
|
||||
}
|
||||
|
||||
if(!"".equals(deptId))
|
||||
{
|
||||
if(!"".equals(loginid))
|
||||
{
|
||||
if("M".equalsIgnoreCase(actType))
|
||||
{
|
||||
String userUpdateSql1 = " update hrmresource set lastname=?,departmentid=?,subcompanyid1=?," +
|
||||
" creater=?,email=?,mobile=?,jobtitle=?,status=?,dsporder=?,lastmoddate=?,modified=systimestamp where workcode=? ";
|
||||
boolean flag = rs.executeUpdate(userUpdateSql1,new Object[]{staffName,deptId,subcompanyid1,creator,email,
|
||||
pwdSmsTel,jobTitleId,status,sysUserId,currentDate,staffCode});
|
||||
}
|
||||
}else{
|
||||
if("A".equalsIgnoreCase(actType))
|
||||
{
|
||||
|
||||
String userInsertSql = " insert into hrmresource(loginid,workcode,lastname,departmentid,subcompanyid1," +
|
||||
" creater,email,mobile,jobtitle,status,dsporder,systemlanguage,createdate,lastmoddate,created,modified) " +
|
||||
" values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,systimestamp,systimestamp)";
|
||||
|
||||
boolean flag = rs.executeUpdate(userInsertSql,new Object[]{staffCode,staffCode,staffName,deptId,subcompanyid1,
|
||||
creator,email,pwdSmsTel,jobTitleId,status,sysUserId,7,currentDate,currentDate});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void updasteSysOrgData(String data){
|
||||
JSONObject jsonObject = JSONObject.parseObject(data);
|
||||
|
||||
if(jsonObject.containsKey("requestObject")){
|
||||
JSONArray requestArray = jsonObject.getJSONArray("requestObject");
|
||||
|
||||
for(int i=0;i<requestArray.size();i++){
|
||||
JSONObject requestObject = requestArray.getJSONObject(i);
|
||||
System.out.println(requestObject.toJSONString());
|
||||
|
||||
if(!requestObject.isEmpty()){
|
||||
if(requestObject.containsKey("tableName") && requestObject.containsKey("content")){
|
||||
String tableName = requestObject.getString("tableName");
|
||||
if("system_user".equals(tableName)){
|
||||
JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
updateSysUserData2(jsonArray,data);
|
||||
|
||||
}else if("system_user_post".equals(tableName)){
|
||||
JSONArray jsonArray = requestObject.getJSONArray("content");
|
||||
updateSysUserPosta2(jsonArray,data);
|
||||
}else if("organization".equalsIgnoreCase(tableName)){
|
||||
System.out.println("data:"+data);
|
||||
}else{
|
||||
System.out.println("data:"+data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateSysUserData2(JSONArray jsonArray,String data){
|
||||
for(int i=0;i<jsonArray.size();i++) {
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
if(!"M".equalsIgnoreCase(actType)){
|
||||
System.out.println("actType:"+actType);
|
||||
System.out.println("data:"+data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateSysUserPosta2(JSONArray jsonArray,String data){
|
||||
for(int i=0;i<jsonArray.size();i++) {
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
||||
String actType = Util.null2String(jsonObject.get("actType"));
|
||||
if(!"M".equalsIgnoreCase(actType)){
|
||||
System.out.println("actType:"+actType);
|
||||
System.out.println("data:"+data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue