4 files update

webservice
calyrex 5 months ago
parent 62f3b317ae
commit 627cf4973d

@ -55,28 +55,36 @@ public class HrUtil {
* @return
*/
public Map<String, String> getHrurl(String gh, RecordSet rs) {
String field3 = "";
String sql = "select b.field3 from employee a,cus_fielddata b where a.id=b.id and scopeid=-1 and a.workcode='" + gh + "'";
String poolname_2v = CONN_TYPE.workflow.getType();
// TODO E10执行sql方法第二参数必须指定源默认使用流程源单体客户无需修改微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源
rs.executeSql(sql, poolname_2v);
if (rs.next()) {
field3 = Util.null2String(rs.getString("field3"));
}
if ("".equals(field3)) {
field3 = "jt";
}
Map<String, String> xtpz = new HashMap<>();
sql = "select * from uf_hrxt_mt where xtbs='" + field3 + "'";
String poolname_9n = CONN_TYPE.workflow.getType();
// TODO E10执行sql方法第二参数必须指定源默认使用流程源单体客户无需修改微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源
rs.executeSql(sql, poolname_9n);
if (rs.next()) {
xtpz.put("hrapiurl", Util.null2String(rs.getString("hrapiurl")));
xtpz.put("hrtoken", Util.null2String(rs.getString("hrtoken")));
xtpz.put("hrloginname", Util.null2String(rs.getString("hrloginname")));
xtpz.put("hrygwcid", Util.null2String(rs.getString("hrygwcid")));
xtpz.put("hrbkjqid", Util.null2String(rs.getString("hrbkjqid")));
try {
String field3 = "";
String sql = "select b.field3 from eteams.dbo.employee a,eteams.dbo.hrmemployeedefined b where a.formdata = b.FORM_DATA_ID and scopeid=-1 and a.workcode='" + gh + "'";
logger_3cf7b2d9.info("sql--" + sql);
String poolname_2v = CONN_TYPE.workflow.getType();
// TODO E10执行sql方法第二参数必须指定源默认使用流程源单体客户无需修改微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源
rs.executeSql(sql, poolname_2v);
if (rs.next()) {
field3 = Util.null2String(rs.getString("field3"));
}
if ("".equals(field3)) {
field3 = "jt";
}
sql = "select * from e10_common.dbo.uf_hrxt_mt where xtbs='" + field3 + "'";
logger_3cf7b2d9.info("sql--" + sql);
String poolname_9n = CONN_TYPE.workflow.getType();
// TODO E10执行sql方法第二参数必须指定源默认使用流程源单体客户无需修改微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源
rs.executeSql(sql, poolname_9n);
if (rs.next()) {
xtpz.put("hrapiurl", Util.null2String(rs.getString("hrapiurl")));
xtpz.put("hrtoken", Util.null2String(rs.getString("hrtoken")));
xtpz.put("hrloginname", Util.null2String(rs.getString("hrloginname")));
xtpz.put("hrygwcid", Util.null2String(rs.getString("hrygwcid")));
xtpz.put("hrbkjqid", Util.null2String(rs.getString("hrbkjqid")));
}
logger_3cf7b2d9.info("xtpz--"+xtpz);
}catch (Exception e){
logger_3cf7b2d9.error("获取hr系统配置失败", e);
}
return xtpz;
}

@ -13,7 +13,7 @@ import com.weaver.verupgrade.general.BaseBean;
public class SAPConn {
private static final Logger logger_cb5e740f = LoggerFactory.getLogger(SAPConn.class);
// private static final Logger logger_cb5e740f = LoggerFactory.getLogger(SAPConn.class);
static String ABAP_AS = "ABAP_AS_WITHOUT_POOL";
@ -50,7 +50,7 @@ public class SAPConn {
*/
private static void init() {
try {
logger_cb5e740f.info(String.valueOf("-------------SAP Client Connects Start ----------------"));
// logger_cb5e740f.info(String.valueOf("-------------SAP Client Connects Start ----------------"));
// sapclient = bb.getPropValue("SAPConn", "SAPClient");
// userid = bb.getPropValue("SAPConn", "Userid");
// password = bb.getPropValue("SAPConn", "Password");
@ -82,9 +82,9 @@ public class SAPConn {
// 测试10
connectProperties.setProperty(DestinationDataProvider.JCO_PEAK_LIMIT, "20");
createDataFile(ABAP_AS_POOLED, "jcoDestination", connectProperties);
logger_cb5e740f.info(String.valueOf("get connection success"));
// logger_cb5e740f.info(String.valueOf("get connection success"));
} catch (Exception e) {
logger_cb5e740f.info(String.valueOf("get connection error:" + e));
// logger_cb5e740f.info(String.valueOf("get connection error:" + e));
}
}
@ -93,15 +93,15 @@ public class SAPConn {
*/
static void createDataFile(String name, String suffix, Properties properties) {
File cfg = new File(name + "." + suffix);
logger_cb5e740f.info(String.valueOf(cfg.getPath()));
// logger_cb5e740f.info(String.valueOf(cfg.getPath()));
if (!cfg.exists()) {
try {
FileOutputStream fos = new FileOutputStream(cfg, false);
properties.store(fos, "for tests only !");
logger_cb5e740f.info(String.valueOf("createDataFile"));
// logger_cb5e740f.info(String.valueOf("createDataFile"));
fos.close();
} catch (Exception e) {
logger_cb5e740f.info(String.valueOf("createDataFile" + e.toString()));
// logger_cb5e740f.info(String.valueOf("createDataFile" + e.toString()));
throw new RuntimeException("Unable to create the destination file " + cfg.getName(), e);
}
}
@ -120,13 +120,13 @@ public class SAPConn {
System.out.println();
destination = JCoDestinationManager.getDestination(ABAP_AS_POOLED);
destination.ping();
logger_cb5e740f.info(String.valueOf("ABAP_AS_POOLED Attributes:"));
logger_cb5e740f.info(String.valueOf(destination.getAttributes()));
logger_cb5e740f.info("ABAP_AS_POOLED Attributes:");
logger_cb5e740f.info(String.valueOf(destination.getAttributes()));
// logger_cb5e740f.info(String.valueOf("ABAP_AS_POOLED Attributes:"));
// logger_cb5e740f.info(String.valueOf(destination.getAttributes()));
// logger_cb5e740f.info("ABAP_AS_POOLED Attributes:");
// logger_cb5e740f.info(String.valueOf(destination.getAttributes()));
} catch (Exception e) {
e.printStackTrace();
logger_cb5e740f.info(String.valueOf("getJCoDestination error:" + e.toString()));
// logger_cb5e740f.info(String.valueOf("getJCoDestination error:" + e.toString()));
}
return destination;
}

@ -328,7 +328,8 @@ public class ZOA_SL_GWCC_Action extends BaseBean implements Action, EsbServerles
String strss = ss.format(xs);
qjss = Double.parseDouble(strss);
} catch (Exception e) {
System.err.println(e.toString());
logger_f5224b91.error("e--",e);
return WeaResult.fail(500, "执行失败", getResultMapForAction(weaverResultMap, "result", FAILURE_AND_CONTINUE, request.getRequestManager()));
}
// ChuChaiShenQing po = new ChuChaiShenQing();
LogUtil logUtil = new LogUtil();
@ -509,9 +510,9 @@ public class ZOA_SL_GWCC_Action extends BaseBean implements Action, EsbServerles
logUtil.setFhxx("异常信息:" + e.getMessage());
logUtil.setJkzt("2");
logUtil.insertLog();
logger_f5224b91.info(String.valueOf(reid + " ZOA_SL_GWCC_Action error:" + e.getMessage()));
logger_f5224b91.info(String.valueOf(e));
logger_f5224b91.error("e--",e);
str = e.toString();
return WeaResult.fail(500, "执行失败", getResultMapForAction(weaverResultMap, "result", FAILURE_AND_CONTINUE, request.getRequestManager()));
}
if (str.length() > 150) {
str = str.substring(0, 150);
@ -620,7 +621,8 @@ public class ZOA_SL_GWCC_Action extends BaseBean implements Action, EsbServerles
logger_f5224b91.info(String.valueOf("b1:" + b1));
}
} catch (Exception e) {
logger_f5224b91.info(String.valueOf(reid + "商旅接口Exception:" + e.getMessage()));
logger_f5224b91.error("e--",e);
return WeaResult.fail(500, "执行异常", getResultMapForAction(weaverResultMap, "result", e.getMessage(), request.getRequestManager()));
// e.printStackTrace();
}
}
@ -645,7 +647,8 @@ public class ZOA_SL_GWCC_Action extends BaseBean implements Action, EsbServerles
logger_f5224b91.info(String.valueOf("b1:" + b1));
}
} catch (Exception e) {
logger_f5224b91.info(String.valueOf(reid + "携程接口Exception:" + e.getMessage()));
logger_f5224b91.error("e--",e);
return WeaResult.fail(500, "执行异常", getResultMapForAction(weaverResultMap, "result", e.getMessage(), request.getRequestManager()));
// e.printStackTrace();
}
/*try {
@ -721,8 +724,9 @@ public class ZOA_SL_GWCC_Action extends BaseBean implements Action, EsbServerles
boolean b1= rs1.executeSql(logsql4, poolname_ot);
logger_f5224b91.info(String.valueOf("b4:" + b1));
} catch (Exception e) {
e.printStackTrace();
logger_f5224b91.error("e--",e);
logger_f5224b91.info(String.valueOf(reid + "同程商旅接口Exception:" + e.getMessage()));
return WeaResult.fail(500, "执行异常", getResultMapForAction(weaverResultMap, "result", e.getMessage(), request.getRequestManager()));
}
logger_f5224b91.info(String.valueOf("调用接口完成 "));
String kssj = attribute9 + " " + attribute10 + ":00";
@ -790,16 +794,19 @@ public class ZOA_SL_GWCC_Action extends BaseBean implements Action, EsbServerles
boolean b1 = rs1.executeSql(sql_log, poolname_ni, generate);
logger_f5224b91.info(String.valueOf( "b1===" + b1));
logger_f5224b91.info(String.valueOf(reid + "同步数据到EAS异常:" + e.toString()));
logger_f5224b91.error("e",e);
return WeaResult.fail(500, "执行异常", getResultMapForAction(weaverResultMap, "result", e.getMessage(), request.getRequestManager()));
}
} catch (Exception e) {
logger_f5224b91.info(String.valueOf(reid + "Exception:" + e.toString()));
logger_f5224b91.error("e--",e);
return WeaResult.fail(500, "执行异常", getResultMapForAction(weaverResultMap, "result", e.getMessage(), request.getRequestManager()));
// e.printStackTrace();
}
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", Action.SUCCESS, request.getRequestManager()));
} catch (Exception e) {
e.printStackTrace();
logger_f5224b91.error("ZOA_SL_GWCC_Action e: {}", e.getMessage());
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", WeaResult.fail(500, "执行异常", getResultMapForAction(weaverResultMap, "result", e.getMessage(), request.getRequestManager())), request.getRequestManager()));
logger_f5224b91.error("e--",e);
return WeaResult.fail(500, "执行异常", getResultMapForAction(weaverResultMap, "result", e.getMessage(), request.getRequestManager()));
}
}

@ -10,6 +10,7 @@ import java.util.*;
import com.weaver.verupgrade.workflow.request.RequestManager;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.common.base.entity.result.WeaResult;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -27,29 +28,28 @@ import com.weaver.verupgrade.interfaces.workflow.action.Action;
* oem<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
@org.springframework.stereotype.Service("workflow_action_ZOEM_PRICE_DIFFERENCE_RATE_Action")
@Slf4j
public class ZOEM_PRICE_DIFFERENCE_RATE_Action extends BaseBean implements Action, EsbServerlessRpcRemoteInterface {
// 对应E9的请求信息对象
@Autowired
private RequestInfo requestInfoTemp;
private static final Logger logger_69cd5f8c = LoggerFactory.getLogger(ZOEM_PRICE_DIFFERENCE_RATE_Action.class);
@Override
public WeaResult<Map<String, Object>> execute(Map<String, Object> requestInfoMap) {
log.info("ZOEM_PRICE_DIFFERENCE_RATE_Action start");
Map<String, Object> weaverResultMap = new HashMap<>();
Long requestIdTemp = Long.parseLong(String.valueOf(requestInfoMap.getOrDefault("requestid", -1)));
Long userIdTemp = Long.parseLong(String.valueOf(requestInfoMap.getOrDefault("userid", -1)));
RequestInfo requestinfo = requestInfoTemp.getRequestInfo(requestIdTemp, userIdTemp);
logger_69cd5f8c.info("----- workflow_action_ZOEM_PRICE_DIFFERENCE_RATE_Action new -----");
logger_69cd5f8c.info("requestIdTemp -----"+ requestIdTemp);
logger_69cd5f8c.info("userIdTemp -----"+ userIdTemp);
log.info("----- workflow_action_ZOEM_PRICE_DIFFERENCE_RATE_Action new -----");
log.info("requestIdTemp -----"+ requestIdTemp);
log.info("userIdTemp -----"+ userIdTemp);
try {
String requestid = requestinfo.getRequestid();
String wfid = requestinfo.getWorkflowid();
try {
logger_69cd5f8c.info(String.valueOf("ZOEM_PRICE_DIFFERENCE_RATE_Action-start-" + requestid));
log.info(String.valueOf("ZOEM_PRICE_DIFFERENCE_RATE_Action-start-" + requestid));
// Property aproperty[] = requestinfo.getMainTableInfo().getProperty();
// for(int j = 0; j < aproperty.length; j++){
// String name = aproperty[j].getName().toUpperCase();
@ -58,7 +58,8 @@ public class ZOEM_PRICE_DIFFERENCE_RATE_Action extends BaseBean implements Actio
// }
// <20><>ϸ<EFBFBD><CFB8>1
DetailTable[] detailtable = requestinfo.getDetailTableInfo().getDetailTable();
DetailTable dtq = detailtable[0];
DetailTable dtq = detailtable[1];
log.info("length" + detailtable.length);
Row[] sq = dtq.getRow();
StringBuilder sb = new StringBuilder();
String state = "";
@ -74,6 +75,7 @@ public class ZOEM_PRICE_DIFFERENCE_RATE_Action extends BaseBean implements Actio
String valueq = Util.null2String(cq1.getValue());
map.put(nameq, valueq);
}
log.info("map--" + map);
// str[j][0] = requestid+"_"+j;
// <20>ɹ<EFBFBD><C9B9><EFBFBD>֯
str[j][0] = map.get("CGZZ");
@ -107,7 +109,7 @@ public class ZOEM_PRICE_DIFFERENCE_RATE_Action extends BaseBean implements Actio
}
}
// <20><>ϸ<EFBFBD><CFB8>2
DetailTable dtq2 = detailtable[1];
DetailTable dtq2 = detailtable[0];
Row[] sq2 = dtq2.getRow();
StringBuilder sb2 = new StringBuilder();
String[][] str2 = new String[sq2.length][7];
@ -150,29 +152,29 @@ public class ZOEM_PRICE_DIFFERENCE_RATE_Action extends BaseBean implements Actio
ZOEM_PRICE_DIFFERENCE_RATE info = new ZOEM_PRICE_DIFFERENCE_RATE();
String[] ret = info.Getexecute(str, str2);
state = ret[0];
logger_69cd5f8c.info(String.valueOf("ZOEM_PRICE_DIFFERENCE_RATE_Action-return-" + requestid + "-[" + ret[0] + "," + ret[1] + "]"));
log.info(String.valueOf("ZOEM_PRICE_DIFFERENCE_RATE_Action-return-" + requestid + "-[" + ret[0] + "," + ret[1] + "]"));
sb.append("OEM成品差价率返回结果" + ret[1]);
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);
BillFieldUtil util = new BillFieldUtil();
// String tablename = util.getTablename(wfid);
String tablename = requestinfo.getRequestManager().getBillTableName();
String sql = "update e10_core_business.dbo." + tablename + " set state='" + state + "',message='" + sb.toString() + "' where requestid=" + requestid;
logger_69cd5f8c.info("sql -----"+ sql);
log.info("sql -----"+ sql);
String poolname = CONN_TYPE.workflow.getType();
// TODO E10执行sql方法第二参数必须指定源默认使用流程源单体客户无需修改微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源
boolean b = rs.executeSql(sql, poolname);
logger_69cd5f8c.info("b -----"+ b);
log.info("b -----"+ b);
} catch (Exception e) {
logger_69cd5f8c.info(String.valueOf("ZOEM_PRICE_DIFFERENCE_RATE_Action-error-" + requestid + "-[" + e.toString() + "]"));
log.error("ZOEM_PRICE_DIFFERENCE_RATE_Action-error-" , e);
requestinfo.getRequestManager().setMessagecontent("OEM成品差价率返回结果" + e.toString());
return WeaResult.fail(500, "执行失败", getResultMapForAction(weaverResultMap, "result", Action.FAILURE_AND_CONTINUE, requestinfo.getRequestManager()));
}
logger_69cd5f8c.info(String.valueOf("ZOEM_PRICE_DIFFERENCE_RATE_Action-end-" + requestid));
log.info(String.valueOf("ZOEM_PRICE_DIFFERENCE_RATE_Action-end-" + requestid));
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", Action.SUCCESS, requestinfo.getRequestManager()));
} catch (Exception e) {
e.printStackTrace();
logger_69cd5f8c.error("ZOEM_PRICE_DIFFERENCE_RATE_Action e: {}", e.getMessage());
log.error("ZOEM_PRICE_DIFFERENCE_RATE_Action e: {}", e.getMessage());
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", WeaResult.fail(500, "执行异常", getResultMapForAction(weaverResultMap, "result", e.getMessage(), requestinfo.getRequestManager())), requestinfo.getRequestManager()));
}
}

Loading…
Cancel
Save