util sql改造

webservice
qijirenjian 3 months ago
parent c09e525abd
commit 222267232a

@ -46,19 +46,10 @@ public class TransUtil {
if ("".equals(selectvalue)) {
return selectname;
}
String sql = "SELECT c.name \n" +
"FROM e10_core_business.dbo.form_field a, e10_core_business.dbo.form_table b, e10_core_business.dbo.field_option c\n" +
"WHERE a.form_id = b.form_id\n" +
" AND c.field_id = a.id\n" +
" AND b.table_name = '"+tableName+"'\n" +
" AND a.data_key = '"+filedname+"'\n" +
" AND c.value_key = '"+selectvalue+"'\n" +
" AND a.delete_type = 0\n" +
" AND a.tenant_key = 't6kj9c07jr'\n" +
" AND b.delete_type = 0\n" +
" AND b.tenant_key = 't6kj9c07jr'\n" +
" AND c.delete_type = 0\n" +
" AND c.tenant_key = 't6kj9c07jr'";
String sql = " select e.table_name, e.form_id ,e.form_name ,c.title , c.data_key ,d.name ,d.value_key from e10_core_business.dbo.form_table e " +
" left join e10_core_business.dbo.form_field c on e.form_id = c.form_id " +
" left join e10_core_business.dbo.field_option d on c.id = d.field_id " +
" where e.table_name = '"+tableName+"' and c.data_key = '"+filedname+"' and value_key = '"+selectvalue+"'";
logger_24a1e280.info("TransUtil sql "+sql);
String poolname_oj = CONN_TYPE.workflow.getType();
/* writeLog("sql:"+sql);

@ -133,7 +133,6 @@ public class BillFieldUtil {
* @return
*/
// TODO custom 问题sql
public static String getselectNameByCol(String fieldname, String workflowid, String selectvalue) {
logger_6c507bbc.info("BillFieldUtil getselectNameByCol start ");
logger_6c507bbc.info("fieldname----------- " + fieldname);
@ -144,25 +143,11 @@ public class BillFieldUtil {
String poolname_jl = CONN_TYPE.workflow.getType();
// TODO E10执行sql方法第二参数必须指定源默认使用流程源单体客户无需修改微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源
// recordSet.executeSql("select c.name from wfp_base a " + "INNER JOIN form_field b on a.formid=b.form_id " + "INNER JOIN field_option c on b.id=c.field_id " + "where b.fieldname='" + fieldname + "' and a.id=" + workflowid + " and c.selectvalue=" + selectvalue, poolname_jl);
String sql = "SELECT c.name \n" +
"FROM e10_core_business.dbo.wfp_base a\n" +
"\tINNER JOIN e10_core_business.dbo.form_field b\n" +
"\tON a.formid = b.form_id\n" +
"\tAND a.delete_type = 0\n" +
"\tAND a.tenant_key = 't6kj9c07jr'\n" +
"\tAND b.delete_type = 0\n" +
"\tAND b.tenant_key = 't6kj9c07jr'\n" +
"\tAND a.delete_type = 0\n" +
"\tAND a.tenant_key = 't6kj9c07jr'\n" +
"\tAND b.delete_type = 0\n" +
"\tAND b.tenant_key = 't6kj9c07jr'\n" +
"\tINNER JOIN field_option c\n" +
"\tON b.id = c.field_id\n" +
"\tAND c.delete_type = 0\n" +
"\tAND c.tenant_key = 't6kj9c07jr'\n" +
"WHERE b.data_key = '" + fieldname + "' \n" +
"\tAND a.id = '" + workflowid + "'\n" +
"\tAND c.value_key = '"+selectvalue+"';";
String sql = " select a.id, b.relatekey ,c.title , c.data_key ,d.name ,d.value_key from e10_core_business.dbo.wfp_base a " +
" left join e10_core_business.dbo.wfp_relateform b on a.id = b.workflowid " +
" left join e10_core_business.dbo.form_field c on b.relatekey = c.form_id " +
" left join e10_core_business.dbo.field_option d on c.id = d.field_id " +
" where a.id = '"+workflowid+"' and c.data_key = '"+fieldname+"' and value_key = '"+selectvalue+"'";
logger_6c507bbc.info("sql----------- " + sql);
recordSet.executeSql(sql, poolname_jl);

@ -69,7 +69,7 @@ public class ChuChaiShenQingNewAction extends BaseBean implements Action, EsbSer
try {
logger_fee0cda9.info(String.valueOf("ChuChaiShenQingNewAction request:" + request.getRequestid()));
String requestid = request.getRequestid();
String lastoperator = request.getLastoperator();
// String lastoperator = request.getLastoperator();
// TODO 有参构造 :new RecordSetDataSource("hr") 实例化方式改变,请检查是否有对应有参实现
RecordSet rdsd = I18nContextUtil.getBean(RecordSet.class);
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);

@ -64,8 +64,8 @@ public class NeiBuDiaoDongAction implements Action, EsbServerlessRpcRemoteInterf
String workflowid = request.getWorkflowid();
String maintable = "";
// String DealerID = "";
String sql = "select b.tablename from wfp_base a,form b where a.formid = b.id and a.id = " + workflowid;
String poolname = CONN_TYPE.workflow.getType();
// String sql = "select b.tablename from wfp_base a,form b where a.formid = b.id and a.id = " + workflowid;
// String poolname = CONN_TYPE.workflow.getType();
// RecordSetDataSource rsds = new RecordSetDataSource("eHR_test");
// rsds.executeSql("select ???GUID AS YGID from ht_psnaccount where ??????? ="+lastoperator);
// rsds.next();
@ -77,11 +77,11 @@ public class NeiBuDiaoDongAction implements Action, EsbServerlessRpcRemoteInterf
// int departmentId = Util.getIntValue(rs2.getString("id"));
/* String creater = rs2.getString("departmentmark") + "_" + rs2.getString("lastname");
TODO E10sql使/使*/
boolean b = rs.executeSql(sql, poolname);
logger_1103b3f3.info("b--" + b);
while (rs.next()) {
maintable = rs.getString("tablename");
}
// boolean b = rs.executeSql(sql, poolname);
// logger_1103b3f3.info("b--" + b);
// while (rs.next()) {
// maintable = rs.getString("tablename");
// }
// ?????????
String KDCRQ = "";
// ????

@ -70,7 +70,7 @@ public class SY_WLPS_NEW_RETURNAction extends BaseBean implements Action, EsbSer
String ycms = map.get("YCMS");
// 缺陷分类
String qxfl = map.get("QXFL");
String qxfl_name = getselectNameByCol("qxfl", workFlowId, qxfl);
String qxfl_name = util.getselectNameByCol("qxfl", workFlowId, qxfl);
// 缺陷代码
String qxdm = map.get("QXDM");
String uuid = UUID.randomUUID().toString();
@ -125,22 +125,7 @@ public class SY_WLPS_NEW_RETURNAction extends BaseBean implements Action, EsbSer
}
}
/**
*
*
* @return
*/
public static String getselectNameByCol(String fieldname, String workflowid, String selectvalue) {
String name = "";
RecordSet recordSet = I18nContextUtil.getBean(RecordSet.class);
String poolname_p2 = CONN_TYPE.workflow.getType();
// TODO E10执行sql方法第二参数必须指定源默认使用流程源单体客户无需修改微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源
recordSet.executeSql("select c.name from wfp_base a " + "INNER JOIN form_field b on a.formid=b.form_id " + "INNER JOIN e10_core_business.dbo.field_option c on b.id=c.field_id " + "where b.fieldname='" + fieldname + "' and a.id=" + workflowid + " and c.value_key=" + selectvalue, poolname_p2);
if (recordSet.next()) {
name = recordSet.getString("name");
}
return name;
}
Map<String, Object> getResultMapForAction(Map<String, Object> map, String key, Object value, RequestManager requestManager) {
if (key != null && !key.isEmpty()) {

@ -64,30 +64,30 @@ public class YongGongXuQiuAction implements Action, EsbServerlessRpcRemoteInterf
try {
log.info("do action on request:" + request.getRequestid());
String requestid = request.getRequestid();
String lastoperator = request.getLastoperator();
String creater = request.getCreatorid();
// String lastoperator = request.getLastoperator();
// String creater = request.getCreatorid();
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);
RecordSet rs2 = I18nContextUtil.getBean(RecordSet.class);
String workflowid = request.getWorkflowid();
String maintable = "";
String sql = "select b.tablename from e10_common.dbo.wfp_base a,e10_common.dbo.form b where a.formid = b.id and a.id = " + workflowid;
logger_42aadd27.info("getMainTableInfo sql = " + sql);
String createsqlString = "select id from eteams.dbo.employee as hrmresource where lastname ='" + creater + "'";
String poolname = CONN_TYPE.workflow.getType();
// RecordSet rs2 = I18nContextUtil.getBean(RecordSet.class);
// String workflowid = request.getWorkflowid();
// String maintable = "";
// String sql = "select b.tablename from e10_common.dbo.wfp_base a,e10_common.dbo.form b where a.formid = b.id and a.id = " + workflowid;
// logger_42aadd27.info("getMainTableInfo sql = " + sql);
// String createsqlString = "select id from eteams.dbo.employee as hrmresource where lastname ='" + creater + "'";
// String poolname = CONN_TYPE.workflow.getType();
// TODO E10执行sql方法第二参数必须指定源默认使用流程源单体客户无需修改微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源
boolean b = rs2.executeSql(createsqlString, poolname);
logger_42aadd27.info("getMainTableInfo rs2.executeSql = " + b);
rs2.next();
String createrId = rs2.getString("id");
String poolname_hy = CONN_TYPE.workflow.getType();
// boolean b = rs2.executeSql(createsqlString, poolname);
// logger_42aadd27.info("getMainTableInfo rs2.executeSql = " + b);
// rs2.next();
// String createrId = rs2.getString("id");
// String poolname_hy = CONN_TYPE.workflow.getType();
// int departmentId = Util.getIntValue(rs2.getString("id"));
/* String creater = rs2.getString("departmentmark") + "_" + rs2.getString("lastname");
TODO E10sql使/使*/
boolean b1 = rs.executeSql(sql, poolname_hy);
logger_42aadd27.info("getMainTableInfo rs.executeSql = " + b1);
while (rs.next()) {
maintable = rs.getString("tablename");
}
// boolean b1 = rs.executeSql(sql, poolname_hy);
// logger_42aadd27.info("getMainTableInfo rs.executeSql = " + b1);
// while (rs.next()) {
// maintable = rs.getString("tablename");
// }
// 需求部门
String XQBM = "";
// String GWXL = "";//岗位序列

@ -111,7 +111,7 @@ public class ZZ_GDFileUploadAction extends BaseBean implements Action, EsbServer
// 核算系统
String hsxt = mMap.get("HSXT");
// getHSXTName(hsxt);
String hsxtName = getselectNameByCol("hsxt", workFlowId, hsxt);
String hsxtName = unit.getselectNameByCol("hsxt", workFlowId, hsxt);
// 申请人
String sqr = mMap.get("SQR");
String sqrcode = "";
@ -285,28 +285,6 @@ public class ZZ_GDFileUploadAction extends BaseBean implements Action, EsbServer
}
}
/**
*
*
* @param
* @param
* @return
*/
public static String getselectNameByCol(String fieldname, String workflowid, String selectvalue) {
String name = "";
RecordSet recordSet = I18nContextUtil.getBean(RecordSet.class);
String poolname_48 = CONN_TYPE.workflow.getType();
// TODO E10执行sql方法第二参数必须指定源默认使用流程源单体客户无需修改微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源
String sql = "select c.name from e10_common.dbo.wfp_base a " + "INNER JOIN e10_common.dbo.form_field b on a.formid=b.form_id " + "INNER JOIN e10_common.dbo.field_option c on b.id=c.field_id " + "where b.fieldname='" + fieldname + "' and a.id=" + workflowid + " and c.value_key=" + selectvalue;
logger_b14cb5d0.info("getselectNameByCol sql = " + sql );
boolean b1 = recordSet.executeSql(sql, poolname_48);
logger_b14cb5d0.info("getselectNameByCol flag = " + b1 );
if (recordSet.next()) {
name = recordSet.getString("name");
logger_b14cb5d0.info("getselectNameByCol name = " + name );
}
return name;
}
private InputStream getFile(String filerealpath, String iszip) throws Exception {
ZipInputStream zin = null;

@ -106,7 +106,7 @@ public class ZZ_Ten_GDFileUploadAction extends BaseBean implements Action, EsbSe
// 核算系统
String hsxt = mMap.get("HSXT");
// getHSXTName(hsxt);
String hsxtName = getselectNameByCol("hsxt", workFlowId, hsxt);
String hsxtName = unit.getselectNameByCol("hsxt", workFlowId, hsxt);
// 申请人
String sqr = mMap.get("SQR");
String sqrcode = "";
@ -288,30 +288,7 @@ public class ZZ_Ten_GDFileUploadAction extends BaseBean implements Action, EsbSe
return WeaResult.success(getResultMapForAction(weaverResultMap, "result", WeaResult.fail(500, "执行异常", getResultMapForAction(weaverResultMap, "result", e.getMessage(), requestInfo.getRequestManager())), requestInfo.getRequestManager()));
}
}
/**
*
*
* @param
* @param
* @return
*/
public static String getselectNameByCol(String fieldname, String workflowid, String selectvalue) {
String name = "";
RecordSet recordSet = I18nContextUtil.getBean(RecordSet.class);
String poolname_w2 = CONN_TYPE.workflow.getType();
// TODO E10执行sql方法第二参数必须指定源默认使用流程源单体客户无需修改微服务/组合客户需根据查询表所属服务切换源,或使用外部数据源
String sql = "select c.name from e10_common.dbo.wfp_base a " + "INNER JOIN e10_common.dbo.form_field b on a.formid=b.form_id " + "INNER JOIN e10_common.dbo.field_option c on b.id=c.field_id " + "where b.fieldname='" + fieldname + "' and a.id=" + workflowid + " and c.value_key=" + selectvalue;
logger_8ab26152.info("getselectNameByCol sql = " + sql);
boolean b1 = recordSet.executeSql(sql, poolname_w2);
logger_8ab26152.info("getselectNameByCol flag = " + b1);
if (recordSet.next()) {
name = recordSet.getString("name");
}
logger_8ab26152.info("getselectNameByCol name = " + name);
return name;
}
private InputStream getFile(String filerealpath, String iszip) throws Exception {
ZipInputStream zin = null;
InputStream imagefile = null;

Loading…
Cancel
Save