calyrex 3.13

ht
calyrex 5 months ago
parent 55af5d7afe
commit d10733907f

@ -1,16 +1,18 @@
package com.weaver.seconddev.interfaces.htjt.util;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.weaver.common.hrm.util.HrmContextUtil;
import com.weaver.common.i18n.tool.util.I18nContextUtil;
import com.weaver.verupgrade.conn.CONN_TYPE;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.weaver.verupgrade.general.Util;
import com.weaver.ebuilder.form.client.ebform.data.EbFormDataDubboService;
import com.weaver.framework.rpc.annotation.RpcReference;
import com.weaver.teams.domain.user.SimpleEmployee;
import com.weaver.verupgrade.conn.RecordSet;
import com.weaver.verupgrade.formmode.setup.ModeRightInfo;
import com.weaver.verupgrade.conn.CONN_TYPE;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* createby
@ -18,94 +20,56 @@ import com.weaver.verupgrade.formmode.setup.ModeRightInfo;
* version v1
* desc
*/
@Service
@Slf4j
public class LogUtil {
private static final org.slf4j.Logger logger_aada5a9c = LoggerFactory.getLogger(LogUtil.class);
// 0 接收 1 推送
private String lx = "";
// 标题
private String bt = "";
// 流程id
private String lcid = "";
// 流程类型id
private String lclxid = "";
// 接口类名
private String jklm = "";
// 接口状态 0成功 1失败 2异常
private String jkzt = "";
// 返回消息
private String fhxx = "";
// 推送参数
private String tscs = "";
private String lx = "";//0 接收 1 推送
private String bt = "";//标题
private String lcid = "";//流程id
private String lclxid = "";//流程类型id
private String jklm = "";//接口类名
private String jkzt = "";//接口状态 0成功 1失败 2异常
private String fhxx = "";// 返回消息
private String tscs = "";// 推送参数
/**
*
*/
public void insertLog() {
//TODO custom 已解决 ConnStatement
InsertUtil iu = new InsertUtil();
String tablename = "uf_interface_log";
//TODO custom 已解决 ConnStatement
String modeid = iu.getModeId(tablename);
// String modeid ="";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdf1 = new SimpleDateFormat("HH:mm:ss");
SimpleDateFormat sdf2 = new SimpleDateFormat("HH:mm");
String nowDate = sdf.format(new Date());
String nowTime = sdf1.format(new Date());
String nowTime2 = sdf2.format(new Date());
String uuid = java.util.UUID.randomUUID().toString();
Map<String, String> map = new HashMap<>();
map.put("modedatacreatedate", nowDate);
map.put("modedatacreatetime", nowTime);
map.put("modedatacreater", "1");
map.put("modedatacreatertype", "0");
map.put("formmodeid", modeid);
map.put("modeuuid", uuid);
map.put("dyrq", nowDate);
map.put("dysj", nowTime2);
//
map.put("lx", this.lx);
//
map.put("bt", this.bt);
//
map.put("lcid", this.lcid);
//
map.put("lclxid", this.lclxid);
//
map.put("jklm", this.jklm);
//
map.put("jkzt", this.jkzt);
//
map.put("fhxx", this.fhxx);
//
map.put("tscs", this.tscs);
//TODO custom 已解决 ConnStatement
iu.insert(map, tablename);
String billid = "";
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);
String sql = "select max(id) as billid from " + tablename + " where modeuuid='" + uuid + "'";
String poolname = CONN_TYPE.workflow.getType();
// TODO E10执行sql方法第二参数必须指定源默认使用流程源单体客户无需修改微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源
rs.executeSql(sql, poolname);
if (rs.next()) {
billid = Util.null2String(rs.getString("billid"));
}
if (!"".equals(billid)) {
ModeRightInfo ModeRightInfo = I18nContextUtil.getBean(ModeRightInfo.class);
/* TODO :Integer.valueOf("1") e9:java.lang.Integer e10:long
TODO :Util.getIntValue(modeid) e9:int e10:long
TODO :Integer.valueOf(billid) e9:java.lang.Integer e10:long
TODO // 创建人字段已废弃 默认是用billid 数据对应的数据创建人*/
ModeRightInfo.editModeDataShare(Integer.valueOf("1"), Util.getIntValue(modeid), Integer.valueOf(billid));
@RpcReference(group ="ebuilderform")
private EbFormDataDubboService ebFormDataDubboService;
public void insertLog(String tenantKey){
try {
String tablename = "uf_interface_log";
if("t6kj9c07jr".equals(tenantKey)){
tablename = "uf_interface_log";
}else if("tttit1yc38".equals(tenantKey)){//光电
tablename = "ftab_277_tttit1yc38";
}else if("tejiddakia".equals(tenantKey)){//华海
tablename = "ftab_277_tejiddakia";
}
TransUtil tu = new TransUtil();
String modeid = tu.getModeId(tablename,tenantKey);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdf1 = new SimpleDateFormat("HH:mm:ss");
SimpleDateFormat sdf2 = new SimpleDateFormat("HH:mm");
String nowDate = sdf.format(new Date());
String nowTime = sdf1.format(new Date());
String nowTime2 = sdf2.format(new Date());
String uuid = java.util.UUID.randomUUID().toString();
String ryid = tu.getsysadminid(tenantKey);
SimpleEmployee user = HrmContextUtil.build(Long.valueOf(ryid),tenantKey);
Long recodId = ebFormDataDubboService.addEmptyData(Long.valueOf(modeid), user);
String sql ="update e10_common.dbo."+tablename+" set dyrq=?,dysj=?,lx=?,bt=?,lcid=?,lclxid=?,jklm=?,jkzt=?,fhxx=?,tscs=? where id="+recodId;
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);
String poolname = CONN_TYPE.ebuilder.getType();
rs.setTenantKey(tenantKey);
rs.executeUpdate(sql, poolname,nowDate,nowTime2,this.lx,this.bt,this.lcid,this.lclxid,this.jklm,this.jkzt,this.fhxx,this.tscs);
}catch (Exception e){
log.error("LogUtil insertLog error",e);
}
}
public String getLx() {
@ -171,4 +135,6 @@ public class LogUtil {
public void setTscs(String tscs) {
this.tscs = tscs;
}
}

@ -19,7 +19,6 @@ public class TransUtil {
*
* @param tableName
* @param filedname
* @param selectname
* @return
*/
// public String getSelectValue(String tableName, String filedname, String selectname) {
@ -119,6 +118,33 @@ public class TransUtil {
return info;
}
public String getModeId(String tableName,String tenantKey){
String modeid = "";
String sql = "select id from e10_common.dbo.ebdf_obj where table_name='"+tableName+"' and delete_type = 0 AND tenant_key = '"+tenantKey+"'";
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);
String poolname = CONN_TYPE.ebuilder.getType();
rs.setTenantKey(tenantKey);
rs.executeSql(sql, poolname);
if(rs.next()){
modeid = Util.null2String(rs.getString("id"));
}
return modeid;
}
public String getsysadminid(String tenantKey){
String ryid = "";
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);
String poolname = CONN_TYPE.hrm.getType();
rs.setTenantKey(tenantKey);
String sql = "select id FROM eteams.dbo.employee where username='sysadmin' AND tenant_key = '"+tenantKey+"' ";
rs.executeSql(sql, poolname);
if(rs.next()){
ryid = Util.null2String(rs.getString("id"));
}
return ryid;
}
/**

@ -294,13 +294,10 @@ public class BillFieldUtil {
" LEFT JOIN e10_other_business.dbo.hr_userinfo " +
" ON employee.id = hr_userinfo.[user] " +
" AND employee.delete_type = 0 " +
" AND employee.tenant_key = 't6kj9c07jr' " +
" AND hr_userinfo.delete_type = 0 " +
" AND hr_userinfo.tenant_key = 't6kj9c07jr' " +
") HrmResource " +
" WHERE HrmResource.id = '" + hrid +
"' AND HrmResource.delete_type = 0 " +
" AND HrmResource.tenant_key = 't6kj9c07jr' " ;
"' AND HrmResource.delete_type = 0 " ;
logger_6c507bbc.error("sql----------- " + sql);
boolean b1 = rs.executeSql(sql, poolname_2s);
@ -353,8 +350,7 @@ public class BillFieldUtil {
"FROM eteams.dbo.department HrmSubCompany " +
"WHERE id = '"+spid+"' and HrmSubCompany.virtualid = 1 " +
" AND HrmSubCompany.type = 'subcompany' " +
" AND HrmSubCompany.delete_type = 0 " +
" AND HrmSubCompany.tenant_key = 't6kj9c07jr'";
" AND HrmSubCompany.delete_type = 0 ";
logger_6c507bbc.error("sql----------- " + sql);
boolean b1 = rs.executeSql(sql, poolname_tg);

@ -83,7 +83,7 @@ public class ChangeInformationExpertsAction extends BaseBean implements Action,
}else if("tejiddakia".equals(tenantKey)){//华海
tablename1 = "hrmsubcompanydefined_11";
}
sql = "SELECT xxhzj AS xxhzj, xxhzjrdgcl AS xxhzjrdgcl FROM (SELECT t1.*, t2.id AS subcomid FROM eteams.dbo." + tablename1 + " t1 LEFT JOIN eteams.dbo.department t2 ON t1.FORM_DATA_ID = t2.formdata AND t2.delete_type = 0 AND t2.tenant_key = 't6kj9c07jr' WHERE t1.DELETE_TYPE = 0 AND t1.TENANT_KEY = 't6kj9c07jr') HrmSubcompanyDefined WHERE HrmSubcompanyDefined.delete_type = 0 AND HrmSubcompanyDefined.tenant_key = 't6kj9c07jr' and subcomid = '" + sqdw +"'";
sql = "SELECT xxhzj AS xxhzj, xxhzjrdgcl AS xxhzjrdgcl FROM (SELECT t1.*, t2.id AS subcomid FROM eteams.dbo." + tablename1 + " t1 LEFT JOIN eteams.dbo.department t2 ON t1.FORM_DATA_ID = t2.formdata AND t2.delete_type = 0 WHERE t1.DELETE_TYPE = 0) HrmSubcompanyDefined WHERE HrmSubcompanyDefined.delete_type = 0 and subcomid = '" + sqdw +"'";
String poolname_cq = CONN_TYPE.workflow.getType();
// TODO E10执行sql方法第二参数必须指定源默认使用流程源单体客户无需修改微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源
logger_750b7a22.error("sql--" + sql);

@ -219,7 +219,8 @@ public class ChuChaiShenQingNewAction extends BaseBean implements Action, EsbSer
String Message = json.getString("Message");
if (!IsSuccess) {
logUtil.setJkzt("1");
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
str = Message;
} else {
str = "SUCCESS";
@ -228,7 +229,8 @@ public class ChuChaiShenQingNewAction extends BaseBean implements Action, EsbSer
} catch (Exception e) {
logUtil.setFhxx("异常信息:" + e.getMessage());
logUtil.setJkzt("2");
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
logger_fee0cda9.error(String.valueOf(requestid + " ChuChaiShenQingNewAction error:" + e.getMessage()));
logger_fee0cda9.error(String.valueOf(e));
str = e.toString();

@ -1,5 +1,6 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.common.hrm.util.HrmContextUtil;
import com.weaver.seconddev.interfaces.htjt.util.LogUtil;
import com.weaver.seconddev.interfaces.prop.ConfigProp;
import org.apache.axis.client.Call;
@ -101,7 +102,8 @@ public class ISO_FileAddOrReviseAction extends BaseBean implements Action, EsbSe
}
logUtil.setJkzt("1");
logUtil.setFhxx(logUtil.getFhxx() + "///////" + result);
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
return WeaResult.fail(500, "ISO_FileAddOrReviseAction---同步文件新增失败-" + result[1], getResultMapForAction(weaverResultMap, "result","ISO_FileAddOrReviseAction---同步文件新增失败-" + result[1], requestInfo.getRequestManager()));
}
} else {
@ -116,7 +118,8 @@ public class ISO_FileAddOrReviseAction extends BaseBean implements Action, EsbSe
}
logUtil.setJkzt("1");
logUtil.setFhxx(logUtil.getFhxx() + "///////" + result);
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
return WeaResult.fail(500, "ISO_FileAddOrReviseAction---同步文件修订失败-" + result[1], getResultMapForAction(weaverResultMap, "result","ISO_FileAddOrReviseAction---同步文件修订失败-" + result[1], requestInfo.getRequestManager()));
}
}
@ -126,7 +129,8 @@ public class ISO_FileAddOrReviseAction extends BaseBean implements Action, EsbSe
logger_cb97befd.error(String.valueOf(e));
logUtil.setJkzt("2");
logUtil.setFhxx(logUtil.getFhxx() + "///////" + e.getMessage());
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
// requestInfo.getRequestManager().setMessageid("ERROR");
requestInfo.getRequestManager().setMessagecontent("提交失败!");
return WeaResult.fail(500, "ISO_FileAddOrReviseAction err"+ e, getResultMapForAction(weaverResultMap, "result",e.getMessage(), requestInfo.getRequestManager()));

@ -1,5 +1,6 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.common.hrm.util.HrmContextUtil;
import com.weaver.seconddev.interfaces.htjt.util.LogUtil;
import com.weaver.seconddev.interfaces.prop.ConfigProp;
import org.apache.axiom.om.OMAbstractFactory;
@ -97,7 +98,8 @@ public class ISO_FilePermissionAction extends BaseBean implements Action, EsbSer
}
logUtil.setJkzt("1");
logUtil.setFhxx(logUtil.getFhxx() + "///////" + result);
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
return WeaResult.fail(500, "ISO_FilePermissionAction---同步文件权限申请流程返回失败-" + result, getResultMapForAction(weaverResultMap, "result","ISO_FilePermissionAction---同步文件权限申请流程返回失败-" + result, requestInfo.getRequestManager()));
}
} catch (Exception e) {
@ -106,14 +108,16 @@ public class ISO_FilePermissionAction extends BaseBean implements Action, EsbSer
logger_8728ce5a.error(String.valueOf(e));
logUtil.setJkzt("2");
logUtil.setFhxx(logUtil.getFhxx() + "///////" + e.getMessage());
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
requestInfo.getRequestManager().setMessageid("ERROR:");
requestInfo.getRequestManager().setMessagecontent("提交失败!:" + e.getMessage());
return WeaResult.fail(500, "ISO_FilePermissionAction err"+ e, getResultMapForAction(weaverResultMap, "result",e.getMessage(), requestInfo.getRequestManager()));
}
logger_8728ce5a.error(String.valueOf("ISO_FilePermissionAction--end--" + requestID));
logUtil.setJkzt("0");
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", Action.SUCCESS, requestInfo.getRequestManager()));
} catch (Exception e) {
e.printStackTrace();

@ -4,6 +4,8 @@ import java.util.*;
import java.text.*;
import java.math.*;
import java.util.Date;
import com.weaver.common.hrm.util.HrmContextUtil;
import com.weaver.seconddev.interfaces.htjt.util.LogUtil;
import com.weaver.seconddev.interfaces.srmoa.*;
import com.weaver.seconddev.interfaces.swfa.*;
@ -158,7 +160,8 @@ public class OaSrmCheckPriceApproveAction extends BaseBean implements Action, Es
logger_c6c5cea5.error(String.valueOf("OaSrmCheckPriceApproveAction-Request: " + requestId + "完成"));
if (!sta.equals("S")) {
logUtil.setJkzt("1");
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
request.getRequestManager().setMessageid("ERROR:");
request.getRequestManager().setMessagecontent("回写srm失败" + meg);
return WeaResult.fail(500, "OaSrmCheckPriceApproveAction meg"+ meg, getResultMapForAction(weaverResultMap, "result",meg, request.getRequestManager()));
@ -166,7 +169,8 @@ public class OaSrmCheckPriceApproveAction extends BaseBean implements Action, Es
} catch (Exception e) {
logUtil.setJkzt("2");
logUtil.setFhxx(logUtil.getFhxx() + e.getMessage());
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
logger_c6c5cea5.error(requestId + " error:" , e);
logger_c6c5cea5.error(String.valueOf(e));
request.getRequestManager().setMessagecontent("回写srm失败接口异常请联系管理员");

@ -4,6 +4,8 @@ import java.util.*;
import java.text.*;
import java.math.*;
import java.util.Date;
import com.weaver.common.hrm.util.HrmContextUtil;
import com.weaver.seconddev.interfaces.htjt.util.LogUtil;
import com.weaver.seconddev.interfaces.srmoa.*;
import com.weaver.seconddev.interfaces.swfa.*;
@ -155,7 +157,8 @@ public class OaSrmCheckPriceRefuseAction extends BaseBean implements Action, Esb
logger_80563c68.error(String.valueOf("OaSrmCheckPriceRefuseAction-Request: " + requestId + "完成"));
if (!sta.equals("S")) {
logUtil.setJkzt("1");
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
request.getRequestManager().setMessageid("ERROR:");
request.getRequestManager().setMessagecontent("回写srm失败" + meg);
return WeaResult.fail(500, "OaSrmCheckPriceRefuseAction err"+ meg, getResultMapForAction(weaverResultMap, "result",meg, request.getRequestManager()));
@ -163,7 +166,8 @@ public class OaSrmCheckPriceRefuseAction extends BaseBean implements Action, Esb
} catch (Exception e) {
logUtil.setJkzt("2");
logUtil.setFhxx(logUtil.getFhxx() + e.getMessage());
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
logger_80563c68.error(requestId + " error:" , e);
logger_80563c68.error(String.valueOf(e));
request.getRequestManager().setMessagecontent("回写srm失败接口异常请联系管理员");

@ -8,6 +8,7 @@ import java.util.List;
import java.text.*;
import java.math.*;
import com.alibaba.fastjson.JSON;
import com.weaver.common.hrm.util.HrmContextUtil;
import com.weaver.seconddev.interfaces.htjt.util.LogUtil;
import com.weaver.seconddev.interfaces.htjt.util.TransUtil;
import com.weaver.seconddev.interfaces.prop.ConfigProp;
@ -204,7 +205,8 @@ public class ZOA_MM_PR_CREATE_YFFY_ZjAction extends BaseBean implements Action,
logger_adb00a32.error("b--" + b);
if (!"S".equals(sta)) {
logUtil.setJkzt("1");
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
}
logger_adb00a32.error(String.valueOf(reid + " start log--" + code + "--" + sqrxm));
logger_adb00a32.error(String.valueOf("------------------------------------------------------------------------"));
@ -215,7 +217,8 @@ public class ZOA_MM_PR_CREATE_YFFY_ZjAction extends BaseBean implements Action,
// BaseBean baseBean = new BaseBean();
logUtil.setFhxx(e.getMessage());
logUtil.setJkzt("2");
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
logger_adb00a32.error(String.valueOf(reid + " start log"));
logger_adb00a32.error(String.valueOf("------------------------------------------------------------------------"));
logger_adb00a32.error(String.valueOf(reid + " ZOA_MM_PR_CREATE_YFFY_ZjAction error:" + e.toString()));

@ -510,7 +510,8 @@ public class ZOA_SL_GNCC_Action extends BaseBean implements Action, EsbServerles
String Message = json.getString("Message");
if (!IsSuccess) {
logUtil.setJkzt("1");
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
str = Message;
} else {
str = "SUCCESS";
@ -519,7 +520,8 @@ public class ZOA_SL_GNCC_Action extends BaseBean implements Action, EsbServerles
} catch (Exception e) {
logUtil.setFhxx("异常信息:" + e.getMessage());
logUtil.setJkzt("2");
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
logger_5e8d517a.error(String.valueOf(reid + " ZOA_SL_GNCC_Action error:" + e.getMessage()));
logger_5e8d517a.error(String.valueOf(e));
str = e.toString();

@ -502,7 +502,8 @@ public class ZOA_SL_GWCC_Action extends BaseBean implements Action, EsbServerles
String Message = json.getString("Message");
if (!IsSuccess) {
logUtil.setJkzt("1");
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
str = Message;
String sql1 = "update e10_core_business.dbo." + tablename + " set message = isnull(cast(message as varchar(8000)),'') + '" + Message + "' where id = " + reid;
@ -518,7 +519,8 @@ public class ZOA_SL_GWCC_Action extends BaseBean implements Action, EsbServerles
} catch (Exception e) {
logUtil.setFhxx("异常信息:" + e.getMessage());
logUtil.setJkzt("2");
logUtil.insertLog();
String tenantKey = HrmContextUtil.getCurrentTenantKey();
logUtil.insertLog(tenantKey);
logger_f5224b91.error(String.valueOf(reid + " ZOA_SL_GWCC_Action error:" + e.getMessage()));
logger_f5224b91.error(String.valueOf(e));
str = e.toString();

Loading…
Cancel
Save