|
|
|
@ -45,7 +45,12 @@ public class ImportExcelResourceUtil {
|
|
|
|
|
String createrid = "1" ;
|
|
|
|
|
String lastmodid = "1" ;
|
|
|
|
|
String creator = "1";
|
|
|
|
|
String pwd = "1";
|
|
|
|
|
|
|
|
|
|
String pwd = PropBean.getUfPropValue("user_pwd") ;
|
|
|
|
|
String password = DigestUtils.md5Hex(pwd).toUpperCase(); //MD5加密
|
|
|
|
|
String currentDate = TimeUtil.getCurrentDateString();//当前日期
|
|
|
|
|
String currentDateTime = TimeUtil.getCurrentTimeString(); //当前时间
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < datalists.size(); i++)
|
|
|
|
|
{
|
|
|
|
@ -58,11 +63,6 @@ public class ImportExcelResourceUtil {
|
|
|
|
|
|
|
|
|
|
String STAFF_CODE = Util.null2String(h.get("staff_code"));
|
|
|
|
|
|
|
|
|
|
String currentDate = TimeUtil.getCurrentDateString();//当前日期
|
|
|
|
|
String currentDateTime = TimeUtil.getCurrentTimeString(); //当前时间
|
|
|
|
|
|
|
|
|
|
String password = DigestUtils.md5Hex(pwd).toUpperCase(); //MD5加密
|
|
|
|
|
|
|
|
|
|
String STAFF_ID = Util.null2String(h.get("staff_id"));
|
|
|
|
|
|
|
|
|
|
String E_MAIL = Util.null2String(h.get("e_mail"));
|
|
|
|
@ -153,10 +153,10 @@ public class ImportExcelResourceUtil {
|
|
|
|
|
BaseBean bb = new BaseBean();
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
String userid = "" ;
|
|
|
|
|
String sql = " select loginid,id,jobtitle as userid from hrmresource where workcode=?" ;
|
|
|
|
|
String sql = " select id,loginid,jobtitle from hrmresource where workcode=?" ;
|
|
|
|
|
rs.executeQuery(sql,new Object[]{STAFF_CODE});
|
|
|
|
|
if(rs.next()){
|
|
|
|
|
userid = Util.null2String(rs.getString("userid"));
|
|
|
|
|
userid = Util.null2String(rs.getString("id"));
|
|
|
|
|
jobTitleId = Util.null2String(rs.getString("jobtitle"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -177,11 +177,19 @@ public class ImportExcelResourceUtil {
|
|
|
|
|
bb.writeLog("seqorder:"+seqorder);
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(seqorder)) {
|
|
|
|
|
String cusUpdateSql = " update cus_fielddata set "+cus_staff+"=?,"+cus_eid+"=? where scope=? and scopeid=? and id=?";
|
|
|
|
|
bb.writeLog(cusUpdateSql);
|
|
|
|
|
|
|
|
|
|
bb.writeLog("cus_staff:"+cus_staff);
|
|
|
|
|
bb.writeLog("cus_eid:"+cus_eid);
|
|
|
|
|
bb.writeLog("STAFF_ID:"+STAFF_ID);
|
|
|
|
|
bb.writeLog("EID:"+EID);
|
|
|
|
|
bb.writeLog("scope:"+scope);
|
|
|
|
|
bb.writeLog("scopeid:"+scopeid);
|
|
|
|
|
bb.writeLog("userid:"+userid);
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(STAFF_ID)){
|
|
|
|
|
String cusUpdateSql = " update cus_fielddata set "+cus_staff+"=? where scope=? and scopeid=? and id=?";
|
|
|
|
|
bb.writeLog("cusUpdateSql:"+cusUpdateSql);
|
|
|
|
|
flag = rs.executeUpdate(cusUpdateSql, new Object[]{STAFF_ID, EID, scope,scopeid,userid});
|
|
|
|
|
flag = rs.executeUpdate(cusUpdateSql, new Object[]{STAFF_ID, scope,scopeid,userid});
|
|
|
|
|
bb.writeLog("flag:"+flag);
|
|
|
|
|
if(!flag)
|
|
|
|
|
{
|
|
|
|
@ -192,6 +200,23 @@ public class ImportExcelResourceUtil {
|
|
|
|
|
dataMap.put("systable",tableName);
|
|
|
|
|
recordErrorData(dataMap);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(EID)){
|
|
|
|
|
String cusUpdateSql = " update cus_fielddata set "+cus_eid+"=? where scope=? and scopeid=? and id=?";
|
|
|
|
|
bb.writeLog("cusUpdateSql:"+cusUpdateSql);
|
|
|
|
|
flag = rs.executeUpdate(cusUpdateSql, new Object[]{ EID, scope,scopeid,userid});
|
|
|
|
|
bb.writeLog("flag:"+flag);
|
|
|
|
|
if(!flag)
|
|
|
|
|
{
|
|
|
|
|
Map<String,String> dataMap = new HashMap<String,String>();
|
|
|
|
|
dataMap.put("syndate",nowDateTime);
|
|
|
|
|
dataMap.put("reqmessage", JSONObject.toJSONString(dataMap));
|
|
|
|
|
dataMap.put("errmessage","更新人员自定义信息失败");
|
|
|
|
|
dataMap.put("systable",tableName);
|
|
|
|
|
recordErrorData(dataMap);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
String cusInsertSql = " insert into cus_fielddata(scope,scopeid,id,"+cus_staff+","+cus_eid+") values(?,?,?,?,?)";
|
|
|
|
|
bb.writeLog("cusInsertSql:"+cusInsertSql);
|
|
|
|
|