更新OA档案表方法改成执行sql语句,不调用rest接口了

2024年7月9日 11:22:04
This commit is contained in:
xiang2lin 2024-07-09 11:22:09 +08:00
parent e74c8668ff
commit 8a4f453a0c
2 changed files with 41 additions and 12 deletions

View File

@ -26,4 +26,11 @@ public interface ISeeyonExtService {
* @param logEntity * @param logEntity
*/ */
void ydcSeeyon2u8CallBack(SysMessageManageLogEntity logEntity); void ydcSeeyon2u8CallBack(SysMessageManageLogEntity logEntity);
/**
* 更新英德赛表单
* @param sql
* @param dataSourceCode
*/
void updateYdcForm(String sql,String dataSourceCode);
} }

View File

@ -9,6 +9,8 @@ import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.execsql.service.IExecSqlService;
import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity; import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity;
import com.hzya.frame.seeyon.service.ISeeyonExtService; import com.hzya.frame.seeyon.service.ISeeyonExtService;
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
@ -41,6 +43,8 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
@Autowired @Autowired
private IIntegrationTaskLivingDetailsService taskLivingDetailsService; private IIntegrationTaskLivingDetailsService taskLivingDetailsService;
@Autowired
private IExecSqlService executionService;
static { static {
inventoryAttrMap = new HashMap<>(); inventoryAttrMap = new HashMap<>();
@ -146,18 +150,20 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
} }
if (StrUtil.isNotEmpty(sql)){ if (StrUtil.isNotEmpty(sql)){
logger.info("要执行的sql:{}",sql); logger.info("要执行的sql:{}",sql);
String sign = SecureUtil.md5(sql); //不调rest接口了改成直接更新
String data = SecureUtil.aes(KEY.getBytes()).encryptHex(sql); updateYdcForm(sql,"ydc_oa_sqlserver");
Map<String, String> headerMap = MapBuilder.<String, String>create(true) // String sign = SecureUtil.md5(sql);
.put("apiCode", "8000190001") // String data = SecureUtil.aes(KEY.getBytes()).encryptHex(sql);
.put("publicKey","ZJYA+I8JEYTh7Mkjr7ncOp1uISzUk/ugy0uL4OTJgepuip9Ce7eDIk+3zDUT+v578prj") // Map<String, String> headerMap = MapBuilder.<String, String>create(true)
.put("secretKey","cYLV+V7qcvBEWU/hAhH4Mgd6Zjs43nALsmzdNApb142abKpMCMTwodlKbQQe5/oEj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") // .put("apiCode", "8000190001")
.put("appId","800019") // .put("publicKey","ZJYA+I8JEYTh7Mkjr7ncOp1uISzUk/ugy0uL4OTJgepuip9Ce7eDIk+3zDUT+v578prj")
.build(); // .put("secretKey","cYLV+V7qcvBEWU/hAhH4Mgd6Zjs43nALsmzdNApb142abKpMCMTwodlKbQQe5/oEj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")
JSONObject params = new JSONObject(); // .put("appId","800019")
params.put("sign",sign); // .build();
params.put("data",data); // JSONObject params = new JSONObject();
String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(JSON.toJSONString(params)).timeout(60000).execute().body(); // params.put("sign",sign);
// params.put("data",data);
// String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(JSON.toJSONString(params)).timeout(60000).execute().body();
} }
} }
} }
@ -190,6 +196,22 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService {
} }
} }
/**
* 更新英德赛表单
*
* @param sql
* @param dataSourceCode
*/
@Override
@DS("#dataSourceCode")
public void updateYdcForm(String sql, String dataSourceCode) {
try {
executionService.execUpdateSql(sql,dataSourceCode);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
//存货参数组装 //存货参数组装
private SysExtensionApiEntity getInventory(JSONObject businessData,SysExtensionApiEntity param,JSONObject hzyaExtData){ private SysExtensionApiEntity getInventory(JSONObject businessData,SysExtensionApiEntity param,JSONObject hzyaExtData){
if (null != businessData){ if (null != businessData){