calyrex 2.28

ht
calyrex 3 months ago
parent 7d353b7829
commit 7693b70fbf

@ -5,16 +5,20 @@ import java.util.Map;
import com.weaver.common.i18n.tool.util.I18nContextUtil;
import com.weaver.verupgrade.conn.CONN_TYPE;
import java.lang.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.weaver.verupgrade.conn.RecordSet;
import com.weaver.verupgrade.general.BaseBean;
import com.weaver.verupgrade.general.Util;
public class TransUtil {
private static final org.slf4j.Logger logger_24a1e280 = LoggerFactory.getLogger(TransUtil.class);
private String tenantKey;
public TransUtil(){
this.tenantKey = tenantKey;
}
/**
* value
*
@ -41,6 +45,7 @@ public class TransUtil {
// }
public String getSelectName(String tableName, String filedname, String selectvalue) {
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);
String selectname = "";
if ("".equals(selectvalue)) {
@ -62,6 +67,66 @@ public class TransUtil {
return selectname;
}
public Map<String,String> getDTtripMt(String workcode){
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);
String poolname = CONN_TYPE.ebuilder.getType();
rs.setTenantKey("t6kj9c07jr");//集团租户key
Map<String,String> map = new HashMap<>();
if("".equals(workcode)){
return map;
}
Map<String,String> rymap = getResourceInfoByworkcode(workcode);
String subcompanyid1 = rymap.get("subcompanyid1");
String sql = "select a.* from e10_common.dbo.uf_tcdjmt a where a.gs ='"+subcompanyid1+"' and a.delete_type=0";
rs.executeSql(sql, poolname);
if(rs.next()){
map.put("account",Util.null2String(rs.getString("zh")));
map.put("password",Util.null2String(rs.getString("mm")));
map.put("secret",Util.null2String(rs.getString("my")));
}
return map;
}
public Map<String,String> getResourceInfoByworkcode(String workcode ){
Map<String,String> info = new HashMap<>();
if("".equals(workcode)){
return info;
}
String sql = "SELECT a.id AS ryid, a.username AS lastname, a.job_num AS workcode, a.department AS departmentid, b.subcompanyid AS subcompanyid1 " +
" , b.name AS departmentname, c.name AS subcompanyname ,a.position as jobtitle" +
"FROM eteams.dbo.employee a, eteams.dbo.department b, eteams.dbo.department c " +
"WHERE a.department = b.id " +
" AND c.id = b.subcompanyid " +
" AND a.job_num = "+workcode+" " +
" AND a.delete_type = 0 " +
" AND a.tenant_key = '"+tenantKey+"' " +
" AND b.type = 'department' " +
" AND b.virtualid = 1 " +
" AND b.delete_type = 0 " +
" AND b.tenant_key = '"+tenantKey+"' " +
" AND c.virtualid = 1 " +
" AND c.type = 'subcompany' " +
" AND c.delete_type = 0 " +
" AND c.tenant_key = '"+tenantKey+"' ";
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);
String poolname = CONN_TYPE.hrm.getType();
rs.setTenantKey(tenantKey);
rs.executeSql(sql, poolname);
if(rs.next()){
info.put("ryid",Util.null2String(rs.getString("ryid")));
info.put("lastname",Util.null2String(rs.getString("lastname")));
info.put("workcode",Util.null2String(rs.getString("workcode")));
info.put("departmentid",Util.null2String(rs.getString("departmentid")));
info.put("subcompanyid1",Util.null2String(rs.getString("subcompanyid1")));
info.put("departmentname",Util.null2String(rs.getString("departmentname")));
info.put("subcompanyname",Util.null2String(rs.getString("subcompanyname")));
info.put("jobtitle",Util.null2String(rs.getString("jobtitle")));
}
return info;
}
/**
* id
*

@ -223,6 +223,8 @@ public class ConfigProp {
private String efsaccount;
@Value("${efspassword}")
private String efspassword;
@Value("${gy103gsid}")
private String gy103gsid;

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.weaver.common.cache.base.BaseCache;
import com.weaver.seconddev.interfaces.htjt.util.TransUtil;
import com.weaver.seconddev.interfaces.prop.ConfigProp;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
@ -45,7 +46,18 @@ public class CallDTtripService extends BaseBean {
jsonObject.put("isEncrypt", false);
jsonObject.put("random", UUID.randomUUID().toString());
jsonObject.put("timestamp", new Date().getTime());
String accessToken = getToken(jsonObject);
String outEmployeeId = String.valueOf(param.get("outEmployeeId"));
String account = Util.null2String(getPropValue("htsloasync", "dttrip_account")).trim();
String password = Util.null2String(getPropValue("htsloasync", "dttrip_password")).trim();
String secret = Util.null2String(getPropValue("htsloasync", "dttrip_secret")).trim();
TransUtil tu = new TransUtil();
Map<String,String> map = tu.getDTtripMt(outEmployeeId);
if(!"".equals(Util.null2String(map.get("account")))){
account = map.get("account");
password = map.get("password");
secret = map.get("secret");
}
String accessToken = getToken(jsonObject,account,password);
if ("E".equals(accessToken)) {
str[0] = "E";
str[1] = "获取同程Token失败";
@ -55,7 +67,7 @@ public class CallDTtripService extends BaseBean {
jsonObject.put("accessToken", accessToken);
jsonObject.put("param", param);
logger_a99d9846.error("调用同程差旅单接口数据:" + jsonObject.toJSONString());
httpPost = new HttpPost(url + "?sign=" + getSign(jsonObject.toJSONString()));
httpPost = new HttpPost(url + "?sign=" + getSign(jsonObject.toJSONString(),secret));
httpPost.setHeader(HTTP.CONTENT_TYPE, "application/json; charset=UTF-8");
httpPost.setHeader("Accept", "application/json; charset=UTF-8");
StringEntity entity = new StringEntity(jsonObject.toJSONString(), "UTF-8");
@ -90,7 +102,7 @@ public class CallDTtripService extends BaseBean {
return str;
}
public String getToken(JSONObject jsonObject) {
public String getToken(JSONObject jsonObject,String account,String password){
// String token = (String) Util_DataCache.getObjVal("DTtrip_token");
String token = "";
if (token == null) {
@ -99,8 +111,8 @@ public class CallDTtripService extends BaseBean {
// String account = Util.null2String(I18nContextUtilcus.getBean(Environment.class).getProperty("htsloasync.dttrip_account")).trim();
// String password = Util.null2String(I18nContextUtilcus.getBean(Environment.class).getProperty("htsloasync.dttrip_password")).trim();
String url = configProp.getDttrip_tokenUrl();
String account = configProp.getDttrip_account();
String password = configProp.getDttrip_password();
// String account = configProp.getDttrip_account();
// String password = configProp.getDttrip_password();
httpPost = new HttpPost(url);
httpPost.setHeader(HTTP.CONTENT_TYPE, "application/json; charset=UTF-8");
httpPost.setHeader("Accept", "application/json; charset=UTF-8");
@ -140,9 +152,9 @@ public class CallDTtripService extends BaseBean {
return token;
}
public String getSign(String postJson) {
public String getSign(String postJson,String secret){
// String secret = Util.null2String(I18nContextUtilcus.getBean(Environment.class).getProperty("htsloasync.dttrip_secret")).trim();
String secret = configProp.getDttrip_secret();
// String secret = configProp.getDttrip_secret();
String postData_md5 = SecureUtil.md5(postJson).toLowerCase();
String finallySign = SecureUtil.md5(postData_md5 + secret).toLowerCase();
return finallySign;

@ -1,5 +1,6 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.seconddev.interfaces.prop.ConfigProp;
import org.apache.commons.lang.StringEscapeUtils;
import com.weaver.seconddev.interfaces.srmoa.OaSrmVenMatExtService;
import com.weaver.seconddev.interfaces.srmoa.VenMatExtHandlerServiceServiceStub.SRM_OA_VENMATEXT_RESULT;
@ -34,6 +35,9 @@ public class OaSrmVenMatExtAction extends BaseBean implements Action, EsbServerl
@Autowired
private RequestInfo requestInfoTemp;
@Autowired
private ConfigProp configProp;
@Autowired
private OaSrmVenMatExtService service ;
@ -72,6 +76,8 @@ public class OaSrmVenMatExtAction extends BaseBean implements Action, EsbServerl
String sjcllx = "";
// 1 原材料货源, 2 OEM货源
String resourceType = "1";
String gsmc = "";
try {
logger_e97618d9.error(String.valueOf(requestid + "GY104开始调用接口同步数据"));
Property[] properties = requestinfo.getMainTableInfo().getProperty();
@ -114,6 +120,15 @@ public class OaSrmVenMatExtAction extends BaseBean implements Action, EsbServerl
resourceType = "2";
}
}
if("GSMC".equals(name)){
gsmc = value;
}
}
//申请单位 江苏华脉光电科技有限公司 不触发接口
String gy103gsid = configProp.getGy103gsid();
if(!"".equals(gsmc)&&!"".equals(gy103gsid)&&(","+gy103gsid+",").indexOf(","+gsmc+",")>=0){
logger_e97618d9.error(requestid+"sqdw:"+gsmc+" gy103gsid:"+gy103gsid);
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", Action.SUCCESS, requestinfo.getRequestManager()));
}
if ("7".equals(cllx)) {
if ("1".equals(wlhtjdqx)) {

@ -5,6 +5,8 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.weaver.seconddev.interfaces.prop.ConfigProp;
import org.apache.commons.lang.StringEscapeUtils;
import com.weaver.seconddev.interfaces.srmoa.OaSrmVenMatExtService;
import com.weaver.seconddev.interfaces.srmoa.VenMatExtHandlerServiceServiceStub.SRM_OA_VENMATEXT_RESULT;
@ -41,6 +43,10 @@ public class OaSrmVenMatExtCheckAction extends BaseBean implements Action, EsbSe
@Autowired
private OaSrmVenMatExtService service ;
@Autowired
private ConfigProp configProp;
private static final Logger logger_ac19fc9b = LoggerFactory.getLogger(OaSrmVenMatExtCheckAction.class);
public WeaResult<Map<String, Object>> execute(Map<String, Object> requestInfoMap) {
@ -59,6 +65,7 @@ public class OaSrmVenMatExtCheckAction extends BaseBean implements Action, EsbSe
String gysbm = "";
// 1 原材料货源, 2 OEM货源
String resourceType = "1";
String gsmc = "";
try {
logger_ac19fc9b.error(String.valueOf(new StringBuilder().append(requestid).append("GY104开始调用接口校验数据").toString()));
Property[] properties = requestinfo.getMainTableInfo().getProperty();
@ -89,6 +96,15 @@ public class OaSrmVenMatExtCheckAction extends BaseBean implements Action, EsbSe
resourceType = "2";
}
}
if("GSMC".equals(name)){
gsmc = value;
}
}
//申请单位 江苏华脉光电科技有限公司 不触发接口
String gy103gsid = configProp.getGy103gsid();
if(!"".equals(gsmc)&&!"".equals(gy103gsid)&&(","+gy103gsid+",").indexOf(","+gsmc+",")>=0){
logger_ac19fc9b.error(requestid+"sqdw:"+gsmc+" gy103gsid:"+gy103gsid);
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", Action.SUCCESS, requestinfo.getRequestManager()));
}
if ("4".equals(cllx)) {
if ("1".equals(wlhtjdqx)) {

@ -1,6 +1,7 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.seconddev.interfaces.htjt.util.TransUtil;
import com.weaver.seconddev.interfaces.prop.ConfigProp;
import com.weaver.seconddev.interfaces.srmoa.CallVdDlvApplyServices;
import com.weaver.seconddev.interfaces.srmoa.VdDlvApplyHandlerServiceServiceStub;
import com.weaver.seconddev.interfaces.swfa.BillFieldUtil;
@ -10,6 +11,8 @@ import com.weaver.common.i18n.tool.util.I18nContextUtil;
import com.weaver.verupgrade.conn.CONN_TYPE;
import java.lang.*;
import java.util.*;
import com.weaver.verupgrade.file.Prop;
import com.weaver.verupgrade.workflow.request.RequestManager;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.common.base.entity.result.WeaResult;
@ -33,6 +36,9 @@ public class OaSrmVendorAdmitAction extends BaseBean implements Action, EsbServe
@Autowired
private RequestInfo requestInfoTemp;
@Autowired
private ConfigProp configProp;
@Autowired
private CallVdDlvApplyServices service;
private static final Logger logger_9af84826 = LoggerFactory.getLogger(OaSrmVendorAdmitAction.class);
@ -63,10 +69,18 @@ public class OaSrmVendorAdmitAction extends BaseBean implements Action, EsbServe
map.put(name, value);
}
logger_9af84826.error("map--" + map);
String sqdwid = map.get("SQDW");//申请单位
//申请单位 江苏华脉光电科技有限公司 不触发接口
String gy103gsid = configProp.getGy103gsid();
if(!"".equals(sqdwid)&&!"".equals(gy103gsid)&&(","+gy103gsid+",").indexOf(","+sqdwid+",")>=0){
logger_9af84826.error(requestid+"sqdw:"+sqdwid+" gy103gsid:"+gy103gsid);
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", Action.SUCCESS, requestinfo.getRequestManager()));
}
ResourceComInfo resourcecominfo = I18nContextUtil.getBean(ResourceComInfo.class);
DepartmentComInfo departmentComInfo = I18nContextUtil.getBean(DepartmentComInfo.class);
// 53252测试 59388正式
String val = tu.getSelectName(tablename, "xsxxgys", map.get("XSXXGYS"));
// String val = BillFieldUtil.getselectName(map.get("XSXXGYS"), "59388");//53252测试 59388正式
logger_9af84826.error(String.valueOf("OaSrmVendorAdmitAction--线上/线下供应商:" + val));
if (val.length() > 1) {

@ -1,6 +1,7 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.seconddev.interfaces.htjt.util.TransUtil;
import com.weaver.seconddev.interfaces.prop.ConfigProp;
import org.apache.commons.lang.StringEscapeUtils;
import com.weaver.seconddev.interfaces.srmoa.CallSrmServices;
import com.weaver.seconddev.interfaces.srmoa.OaSrmVenMatExtService;
@ -48,6 +49,8 @@ public class OaSrmVendorCheckAction extends BaseBean implements Action, EsbServe
@Autowired
private OaSrmVenMatExtService service;
@Autowired
private ConfigProp configProp;
@Autowired
private CallVdDlvApplyServices vddservice;
@ -83,6 +86,13 @@ public class OaSrmVendorCheckAction extends BaseBean implements Action, EsbServe
String value = Util.null2String(aproperty[i].getValue());
map.put(name, value);
}
String sqdwid = map.get("SQDW");//申请单位
//申请单位 江苏华脉光电科技有限公司 不触发接口
String gy103gsid = configProp.getGy103gsid();
if(!"".equals(sqdwid)&&!"".equals(gy103gsid)&&(","+gy103gsid+",").indexOf(","+sqdwid+",")>=0){
logger_a864d799.error(requestid+"sqdw:"+sqdwid+" gy103gsid:"+gy103gsid);
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", Action.SUCCESS, requestinfo.getRequestManager()));
}
// String val = BillFieldUtil.getselectName(map.get("XSXXGYS"), "59388");//53252测试 59388正式
// 53252测试 59388正式
String val = tu.getSelectName(tablename, "xsxxgys", map.get("XSXXGYS"));

@ -3,6 +3,7 @@ package com.weaver.seconddev.interfaces.workflow.action;
import java.text.SimpleDateFormat;
import java.util.*;
import com.weaver.seconddev.interfaces.htjt.util.TransUtil;
import com.weaver.seconddev.interfaces.prop.ConfigProp;
import org.apache.commons.lang.StringEscapeUtils;
import com.weaver.seconddev.interfaces.srmoa.CallSrmServices;
import com.weaver.seconddev.interfaces.srmoa.OaSrmVenMatExtService;
@ -43,6 +44,9 @@ public class OaSrmVendorReapplyAction extends BaseBean implements Action, EsbSer
@Autowired
private OaSrmVenMatExtService service;
@Autowired
private ConfigProp configProp;
@Autowired
private CallSrmServices srm;
@ -76,6 +80,13 @@ public class OaSrmVendorReapplyAction extends BaseBean implements Action, EsbSer
map.put(name, value);
}
logger_a5e612ac.error("map--" + map);
String sqdwid = map.get("SQDW");//申请单位
//申请单位 江苏华脉光电科技有限公司 不触发接口
String gy103gsid = configProp.getGy103gsid();
if(!"".equals(sqdwid)&&!"".equals(gy103gsid)&&(","+gy103gsid+",").indexOf(","+sqdwid+",")>=0){
logger_a5e612ac.error(requestid+"sqdw:"+sqdwid+" gy103gsid:"+gy103gsid);
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", Action.SUCCESS, requestinfo.getRequestManager()));
}
String ckxz = map.get("CKXZ");
if ("0".equals(ckxz)) {
// 是否推送erp

@ -3,6 +3,7 @@ package com.weaver.seconddev.interfaces.workflow.action;
import java.text.SimpleDateFormat;
import java.util.*;
import com.weaver.seconddev.interfaces.htjt.util.TransUtil;
import com.weaver.seconddev.interfaces.prop.ConfigProp;
import org.apache.commons.lang.StringEscapeUtils;
import com.weaver.seconddev.interfaces.srmoa.CallSrmServices;
import com.weaver.seconddev.interfaces.srmoa.OaSrmVenMatExtService;
@ -42,6 +43,8 @@ public class OaSrmVendorSyncAction extends BaseBean implements Action, EsbServer
private RequestInfo requestInfoTemp;
@Autowired
private OaSrmVenMatExtService service;
@Autowired
private ConfigProp configProp;
@Autowired
private CallSrmServices srm;
@ -74,6 +77,13 @@ public class OaSrmVendorSyncAction extends BaseBean implements Action, EsbServer
String value = Util.null2String(aproperty[i].getValue());
map.put(name, value);
}
String sqdwid = map.get("SQDW");//申请单位
//申请单位 江苏华脉光电科技有限公司 不触发接口
String gy103gsid = configProp.getGy103gsid();
if(!"".equals(sqdwid)&&!"".equals(gy103gsid)&&(","+gy103gsid+",").indexOf(","+sqdwid+",")>=0){
logger_41a64316.error(requestid+"sqdw:"+sqdwid+" gy103gsid:"+gy103gsid);
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", Action.SUCCESS, requestinfo.getRequestManager()));
}
// 是否推送erp
String sftserp = map.get("SFTSERP");
// 流程编号

@ -223,7 +223,7 @@ public class ZZ_GDFileUploadAction extends BaseBean implements Action, EsbServer
// requestInfo.getRequestManager().setMessagecontent("获取附件失败,请联系管理员!");
// }
// }
mJson.put("fileVOList", fileVOListArr);
String errorMsg = "";
logger_b14cb5d0.error(String.valueOf("明细表开始取值"));
DetailTable[] detailtable = requestInfo.getDetailTableInfo().getDetailTable();
@ -262,6 +262,7 @@ public class ZZ_GDFileUploadAction extends BaseBean implements Action, EsbServer
logger_b14cb5d0.error(String.valueOf("获取明细表数据结束"));
//
mJson.put("snVOList", new JSONArray());
mJson.put("fileVOList", fileVOListArr);
logger_b14cb5d0.error("调用总账归档附件上传接口请求数据:=====" + mJson.toString());
// 调用接口
// String url = Util.null2String(I18nContextUtilcus.getBean(Environment.class).getProperty("hteasoasync.uploadZZInfoUrl")).trim();

Loading…
Cancel
Save