|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package com.weaver.seconddev.interfaces.workflow.action;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.weaver.authority.api.req.role.BatchAuthRoleReq;
|
|
|
|
|
import com.weaver.authority.api.rest.RemoteAuthorityRoleService;
|
|
|
|
|
import com.weaver.common.base.entity.result.WeaResult;
|
|
|
|
|
import com.weaver.common.hrm.util.HrmContextUtil;
|
|
|
|
|
import com.weaver.common.i18n.tool.util.I18nContextUtil;
|
|
|
|
@ -16,6 +18,7 @@ import com.weaver.teams.domain.user.SimpleEmployee;
|
|
|
|
|
import com.weaver.verupgrade.conn.CONN_TYPE;
|
|
|
|
|
import com.weaver.verupgrade.conn.RecordSet;
|
|
|
|
|
import com.weaver.verupgrade.general.BaseBean;
|
|
|
|
|
import com.weaver.verupgrade.general.Util;
|
|
|
|
|
import com.weaver.verupgrade.interfaces.workflow.action.Action;
|
|
|
|
|
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
|
|
|
|
|
import com.weaver.verupgrade.workflow.request.RequestManager;
|
|
|
|
@ -25,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import org.springframework.core.env.Environment;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
@ -47,9 +51,14 @@ public class CustomTeAction extends BaseBean implements Action, EsbServerlessRpc
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ConfigProp configProp;
|
|
|
|
|
|
|
|
|
|
@RpcReference(group = "ebuilderform")
|
|
|
|
|
private EbFormDataDubboService ebFormDataDubboService;
|
|
|
|
|
|
|
|
|
|
@RpcReference(group = "ebuilderform")
|
|
|
|
|
private RemoteAuthorityRoleService remoteAuthorityRoleService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${weaver.swagger.basePackage}")
|
|
|
|
|
private String basePackage;
|
|
|
|
|
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(CustomTeAction.class);
|
|
|
|
@ -59,7 +68,7 @@ public class CustomTeAction extends BaseBean implements Action, EsbServerlessRpc
|
|
|
|
|
public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
|
|
|
|
|
logger.error("start CustomTeAction");
|
|
|
|
|
logger.error("srmbacklisturl == " + configProp.getSrmbacklisturl());
|
|
|
|
|
logger.error("Lplysl_url == " + configProp.getLplysl_url());
|
|
|
|
|
logger.error("lplysl_url == " + configProp.getLplysl_url());
|
|
|
|
|
logger.error("basePackage == " + basePackage);
|
|
|
|
|
logger.error("params = " + JSON.toJSONString(params));
|
|
|
|
|
|
|
|
|
@ -68,56 +77,76 @@ public class CustomTeAction extends BaseBean implements Action, EsbServerlessRpc
|
|
|
|
|
Long userIdTemp = Long.parseLong(String.valueOf(params.getOrDefault("userid", -1)));
|
|
|
|
|
RequestInfo request = requestInfoTemp.getRequestInfo(requestIdTemp, userIdTemp);
|
|
|
|
|
|
|
|
|
|
try{
|
|
|
|
|
List list = new ArrayList<String>();
|
|
|
|
|
list.get(2);
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
// 测试配置文件读取
|
|
|
|
|
// String url = Util.null2String(I18nContextUtil.getBean(Environment.class).getProperty("weaver-secondev-htportaloaUrl.accountUrl")).trim();
|
|
|
|
|
|
|
|
|
|
// logger.info("requestIdTemp = " + requestIdTemp);
|
|
|
|
|
// logger.info("userIdTemp = " + userIdTemp);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
SimpleEmployee currentEmployee = HrmContextUtil.getCurrentUser();
|
|
|
|
|
|
|
|
|
|
String tenantKey = HrmContextUtil.getCurrentTenantKey();
|
|
|
|
|
logger.info("tenantKey = " + tenantKey);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);
|
|
|
|
|
// String sql1 = "select * from e10_common.dbo.uf_CustomFlow where field1 = 1 and delete_type = 0 ";
|
|
|
|
|
String poolname = CONN_TYPE.ebuilder.getType();
|
|
|
|
|
// rs.setTenantKey(tenantKey);
|
|
|
|
|
// rs.executeSql(sql1, poolname);
|
|
|
|
|
// rs.next();
|
|
|
|
|
// String field1 = rs.getString("field1");
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// String sql2 = "update e10_common.dbo.uf_CustomFlow set field2 = '修改后数据' where field1 = 2 and delete_type = 0 ";
|
|
|
|
|
// boolean b = rs.executeSql(sql2, poolname);
|
|
|
|
|
// logger.info("更新 = " + b);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// //rpc新增建模数据
|
|
|
|
|
Long uf_CustomFlow_formId = commonDevUtil.getObjId("uf_CustomFlow");
|
|
|
|
|
logger.info("uf_CustomFlow_formId = " + uf_CustomFlow_formId);
|
|
|
|
|
Long recodId = ebFormDataDubboService.addEmptyData(uf_CustomFlow_formId, currentEmployee);// 获取插入的空的建模id
|
|
|
|
|
String sql3 = "update e10_common.dbo.uf_CustomFlow set field2 = '添加数据' where id = " + recodId + " and delete_type = 0 ";
|
|
|
|
|
boolean b1 = rs.executeSql(sql3, poolname);
|
|
|
|
|
logger.info("sql3 = " + sql3);
|
|
|
|
|
logger.info("添加 = " + b1);
|
|
|
|
|
|
|
|
|
|
logger.error("stop CustomTeAction");
|
|
|
|
|
Map<String, Object> res = new HashMap<>();
|
|
|
|
|
res.put("status", true);
|
|
|
|
|
res.put("msg", "success");
|
|
|
|
|
res.put("params", params);
|
|
|
|
|
logger.error("url = " + testProp.getAccountUrl());
|
|
|
|
|
|
|
|
|
|
SimpleEmployee currentEmployee = HrmContextUtil.getCurrentUser();
|
|
|
|
|
|
|
|
|
|
String tenantKey = HrmContextUtil.getCurrentTenantKey();
|
|
|
|
|
logger.error("tenantKey = " + tenantKey);
|
|
|
|
|
|
|
|
|
|
RecordSet rs = I18nContextUtil.getBean(RecordSet.class);
|
|
|
|
|
// String sql1 = "select field1 from e10_common.dbo.uf_CustomFlow where field1 = 5 and delete_type = 0";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String sql1 = "select id,field3 from eteams.dbo.hrmemployeedefined where FORM_DATA_ID= '100005650000063120' ";
|
|
|
|
|
// String sql1 = "select field3 from eteams.dbo.hrmemployeedefined where FORM_DATA_ID= '100005650000000052'";
|
|
|
|
|
|
|
|
|
|
String poolname = CONN_TYPE.hrm.getType();
|
|
|
|
|
|
|
|
|
|
logger.error("sql1 =" + sql1);
|
|
|
|
|
logger.error("poolname =" + poolname);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
rs.executeSql(sql1, poolname);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("rs-------", e);
|
|
|
|
|
logger.error("getExecuteResult =" + rs.getExecuteResult());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logger.error("执行rs.executeSql成功");
|
|
|
|
|
|
|
|
|
|
if (rs.next()) {
|
|
|
|
|
String field3 = rs.getString("field3");
|
|
|
|
|
logger.error("field3 = " + field3);
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// String sql2 = "update e10_common.dbo.uf_CustomFlow set field2 = '修改后数据' where field1 = 2 and delete_type = 0 ";
|
|
|
|
|
// boolean b = rs.executeSql(sql2, poolname);
|
|
|
|
|
// logger.info("更新 = " + b);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// //rpc新增建模数据
|
|
|
|
|
// Long uf_CustomFlow_formId = commonDevUtil.getObjId("uf_CustomFlow");
|
|
|
|
|
// logger.info("uf_CustomFlow_formId = " + uf_CustomFlow_formId);
|
|
|
|
|
// Long recodId = ebFormDataDubboService.addEmptyData(uf_CustomFlow_formId, currentEmployee);// 获取插入的空的建模id
|
|
|
|
|
// String sql3 = "update e10_common.dbo.uf_CustomFlow set field2 = '添加数据' where id = " + recodId + " and delete_type = 0 ";
|
|
|
|
|
// boolean b1 = rs.executeSql(sql3, poolname);
|
|
|
|
|
// logger.info("sql3 = " + sql3);
|
|
|
|
|
// logger.info("添加 = " + b1);
|
|
|
|
|
|
|
|
|
|
logger.error("stop CustomTeAction");
|
|
|
|
|
Map<String, Object> res = new HashMap<>();
|
|
|
|
|
res.put("status", true);
|
|
|
|
|
res.put("msg", "success");
|
|
|
|
|
res.put("params", params);
|
|
|
|
|
return WeaResult.success(res);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
return WeaResult.fail(500, "出错啦", getResultMapForAction(weaverResultMap, "result", e.getMessage(), request.getRequestManager()));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("异常信息 ==== " + e.getMessage());
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return WeaResult.fail(500, "出错啦", getResultMapForAction(weaverResultMap, "result", e.getMessage(), request.getRequestManager()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, Object> getResultMapForAction(Map<String, Object> map, String key, Object value, RequestManager requestManager) {
|
|
|
|
|
|
|
|
|
|
if (key != null && !key.isEmpty()) {
|
|
|
|
@ -135,5 +164,4 @@ public class CustomTeAction extends BaseBean implements Action, EsbServerlessRpc
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|