|
|
@ -1,17 +1,20 @@
|
|
|
|
package com.hzya.frame.plugin.grp.service.impl;
|
|
|
|
package com.hzya.frame.plugin.grp.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
|
|
|
import cn.hutool.http.HttpRequest;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity;
|
|
|
|
import com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity;
|
|
|
|
import com.hzya.frame.grpU8.nxproof.oerdjml.service.IOerDjmlExtService;
|
|
|
|
import com.hzya.frame.grpU8.nxproof.oerdjml.service.IOerDjmlExtService;
|
|
|
|
import com.hzya.frame.grpU8.nxproof.oerdjml.service.IOerDjmlService;
|
|
|
|
import com.hzya.frame.grpU8.nxproof.oerdjml.service.IOerDjmlService;
|
|
|
|
import com.hzya.frame.plugin.grp.service.IExpensePluginService;
|
|
|
|
import com.hzya.frame.plugin.grp.service.IExpensePluginService;
|
|
|
|
|
|
|
|
import com.hzya.frame.web.entity.BaseResult;
|
|
|
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
|
|
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @Description grp报销单
|
|
|
|
* @Description grp报销单
|
|
|
@ -24,7 +27,8 @@ public class ExpensePluginServiceImpl implements IExpensePluginService {
|
|
|
|
private IOerDjmlExtService oerDjmlExtService;
|
|
|
|
private IOerDjmlExtService oerDjmlExtService;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private IOerDjmlService oerDjmlService;
|
|
|
|
private IOerDjmlService oerDjmlService;
|
|
|
|
|
|
|
|
@Value("${zt.url}")
|
|
|
|
|
|
|
|
private String interfaceUrl;
|
|
|
|
Logger logger = LoggerFactory.getLogger(IExpensePluginService.class);
|
|
|
|
Logger logger = LoggerFactory.getLogger(IExpensePluginService.class);
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 执行插件
|
|
|
|
* 执行插件
|
|
|
@ -45,10 +49,15 @@ public class ExpensePluginServiceImpl implements IExpensePluginService {
|
|
|
|
logger.info("准备开始组装参数");
|
|
|
|
logger.info("准备开始组装参数");
|
|
|
|
String param = oerDjmlExtService.saveExpensePrePlugin(json);
|
|
|
|
String param = oerDjmlExtService.saveExpensePrePlugin(json);
|
|
|
|
logger.info("OA单据组装好准备保存GRP的参数:{}",param);
|
|
|
|
logger.info("OA单据组装好准备保存GRP的参数:{}",param);
|
|
|
|
JSONObject paramJSON = new JSONObject();
|
|
|
|
String result = HttpRequest.post(interfaceUrl)
|
|
|
|
paramJSON.put("jsonStr",param);
|
|
|
|
.header("appId","800042")// grp应用
|
|
|
|
JsonResultEntity resultEntity = (JsonResultEntity) oerDjmlService.handleOerDjml(paramJSON);
|
|
|
|
.header("apiCode","8000420043")//报销单接口
|
|
|
|
logger.info("保存GRPU8响应参数:{}",JSONObject.toJSON(resultEntity));
|
|
|
|
.header("publicKey","ZJYAcDv1SMgN1oUwzfpV5byfUaN78sVw+L+DB9XTT30aS8hCe7eDIk+3zDUT+v578prj")//OA应用key
|
|
|
|
return resultEntity;
|
|
|
|
.header("secretKey","ZLQWG13Z30FoeuCgi6/Uc41XF6oLO63550OAa6ggXUmtOZj5MgQNZMjVgL/M4BRkj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//OA应用密钥
|
|
|
|
|
|
|
|
.body(param).execute().body();
|
|
|
|
|
|
|
|
// JsonResultEntity resultEntity = (JsonResultEntity) oerDjmlService.handleOerDjml(paramJSON);
|
|
|
|
|
|
|
|
// logger.info("保存GRPU8响应参数:{}",JSONObject.toJSON(resultEntity));
|
|
|
|
|
|
|
|
logger.info("保存GRPU8响应参数:{}",result);
|
|
|
|
|
|
|
|
return BaseResult.getSuccessMessageEntity(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|