parent
b4f1e3c3ec
commit
6b4bf0edb1
|
@ -39,6 +39,13 @@
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
|
|
||||||
|
<profile>
|
||||||
|
<id>xel</id> <!--相二林-->
|
||||||
|
<properties>
|
||||||
|
<profile.active>xel</profile.active>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
|
||||||
</profiles>
|
</profiles>
|
||||||
<build>
|
<build>
|
||||||
<finalName>kangarooDataCenterV3</finalName>
|
<finalName>kangarooDataCenterV3</finalName>
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.hzya.frame.plugin.dgx.u9c.dao;
|
||||||
|
|
||||||
|
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.entity.PrepaymentEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 德广信U9C预付单
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/9/18 14:35
|
||||||
|
**/
|
||||||
|
public interface IPrepaymentDao extends IBaseDao<PrepaymentEntity,String> {
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.hzya.frame.plugin.dgx.u9c.dao;
|
||||||
|
|
||||||
|
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.entity.RequisitionEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 德广信U9C请购单
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/9/18 14:08
|
||||||
|
**/
|
||||||
|
public interface IRequisitionDao extends IBaseDao<RequisitionEntity,String> {
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.hzya.frame.plugin.dgx.u9c.dao.impl;
|
||||||
|
|
||||||
|
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.dao.IPrepaymentDao;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.entity.PrepaymentEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 德广信U9C预付单
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/9/18 14:38
|
||||||
|
**/
|
||||||
|
public class PrepaymentDaoImpl extends MybatisGenericDao<PrepaymentEntity,String> implements IPrepaymentDao {
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.hzya.frame.plugin.dgx.u9c.dao.impl;
|
||||||
|
|
||||||
|
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.dao.IRequisitionDao;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.entity.RequisitionEntity;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/9/18 14:10
|
||||||
|
**/
|
||||||
|
public class RequisitionDaoImpl extends MybatisGenericDao<RequisitionEntity,String> implements IRequisitionDao {
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.hzya.frame.plugin.dgx.u9c.entity;
|
||||||
|
|
||||||
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 德广信U9C预付单
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/9/18 14:36
|
||||||
|
**/
|
||||||
|
public class PrepaymentEntity extends BaseEntity {
|
||||||
|
|
||||||
|
//开始时间 查询用
|
||||||
|
private String startTime;
|
||||||
|
//结束时间 查询用
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
public String getStartTime() {
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartTime(String startTime) {
|
||||||
|
this.startTime = startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndTime() {
|
||||||
|
return endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndTime(String endTime) {
|
||||||
|
this.endTime = endTime;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.hzya.frame.plugin.dgx.u9c.entity;
|
||||||
|
|
||||||
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 德广信U9C请购单
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/9/18 14:08
|
||||||
|
**/
|
||||||
|
public class RequisitionEntity extends BaseEntity {
|
||||||
|
|
||||||
|
//开始时间 查询用
|
||||||
|
private String startTime;
|
||||||
|
//结束时间 查询用
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
public String getStartTime() {
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartTime(String startTime) {
|
||||||
|
this.startTime = startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndTime() {
|
||||||
|
return endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndTime(String endTime) {
|
||||||
|
this.endTime = endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -2,10 +2,15 @@ package com.hzya.frame.plugin.dgx.u9c.plugin;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hzya.frame.base.PluginBaseEntity;
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.service.IPrepaymentService;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.service.IU9CPluginService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description 德广信U9C预付单推到OA走审批
|
* @Description 德广信U9C预付单推到OA走审批
|
||||||
* @Author xiangerlin
|
* @Author xiangerlin
|
||||||
|
@ -13,6 +18,8 @@ import org.slf4j.LoggerFactory;
|
||||||
**/
|
**/
|
||||||
public class PrepaymentPluginInitializer extends PluginBaseEntity {
|
public class PrepaymentPluginInitializer extends PluginBaseEntity {
|
||||||
Logger logger = LoggerFactory.getLogger(getClass());
|
Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
@Resource(name = "u9CPluginServiceImpl")
|
||||||
|
private IU9CPluginService u9CPluginService;
|
||||||
/***
|
/***
|
||||||
* 插件初始化方法
|
* 插件初始化方法
|
||||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||||
|
@ -90,6 +97,7 @@ public class PrepaymentPluginInitializer extends PluginBaseEntity {
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||||
return null;
|
u9CPluginService.prepaymentStartFlow(requestJson);
|
||||||
|
return BaseResult.getSuccessMessageEntity(getPluginLabel()+"执行成功");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,15 @@ package com.hzya.frame.plugin.dgx.u9c.plugin;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hzya.frame.base.PluginBaseEntity;
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.service.IRequisitionService;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.service.IU9CPluginService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description 德广信U9C请购单推送OA走审批
|
* @Description 德广信U9C请购单推送OA走审批
|
||||||
|
@ -13,6 +19,9 @@ import org.slf4j.LoggerFactory;
|
||||||
**/
|
**/
|
||||||
public class RequisitionPluginInitializer extends PluginBaseEntity {
|
public class RequisitionPluginInitializer extends PluginBaseEntity {
|
||||||
Logger logger = LoggerFactory.getLogger(getClass());
|
Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
|
@Resource(name = "u9CPluginServiceImpl")
|
||||||
|
private IU9CPluginService u9CPluginService;
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||||
|
@ -83,6 +92,7 @@ public class RequisitionPluginInitializer extends PluginBaseEntity {
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||||
return null;
|
u9CPluginService.requisitionStartFlow(requestJson);
|
||||||
|
return BaseResult.getSuccessMessageEntity(getPluginName()+"执行成功");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.hzya.frame.plugin.dgx.u9c.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.basedao.service.IBaseService;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.entity.PrepaymentEntity;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 德广信U9C预付单
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/9/18 14:39
|
||||||
|
**/
|
||||||
|
public interface IPrepaymentService extends IBaseService<PrepaymentEntity,String> {
|
||||||
|
/**
|
||||||
|
* 查询u9c预付单
|
||||||
|
* @param entity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PrepaymentEntity> queryList(PrepaymentEntity entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新推送状态
|
||||||
|
* @param entity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateStatus(PrepaymentEntity entity);
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.hzya.frame.plugin.dgx.u9c.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.basedao.service.IBaseService;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.entity.RequisitionEntity;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 广信U9C请购单
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/9/18 14:12
|
||||||
|
**/
|
||||||
|
public interface IRequisitionService extends IBaseService<RequisitionEntity,String> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询U9C请购单
|
||||||
|
* @param entity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<RequisitionEntity> queryList(RequisitionEntity entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新推送状态
|
||||||
|
* @param entity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateStatus(RequisitionEntity entity);
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.hzya.frame.plugin.dgx.u9c.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 德广信U9C插件service
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/9/18 15:24
|
||||||
|
**/
|
||||||
|
public interface IU9CPluginService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* u9c预付单发起OA流程
|
||||||
|
* @param requestJson
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
JsonResultEntity prepaymentStartFlow(JSONObject requestJson);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* u9c请购单发起OA流程
|
||||||
|
* @param requestJson
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
JsonResultEntity requisitionStartFlow(JSONObject requestJson);
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.hzya.frame.plugin.dgx.u9c.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.dao.IPrepaymentDao;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.entity.PrepaymentEntity;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.service.IPrepaymentService;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 德广信U9C预付单
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/9/18 14:40
|
||||||
|
**/
|
||||||
|
public class PrepaymentServiceImpl extends BaseService<PrepaymentEntity,String> implements IPrepaymentService {
|
||||||
|
|
||||||
|
private IPrepaymentDao prepaymentDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public void setPrepaymentDao(IPrepaymentDao dao) {
|
||||||
|
this.prepaymentDao = dao;
|
||||||
|
this.dao = dao;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询u9c预付单
|
||||||
|
*
|
||||||
|
* @param entity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public List<PrepaymentEntity> queryList(PrepaymentEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新推送状态
|
||||||
|
*
|
||||||
|
* @param entity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public int updateStatus(PrepaymentEntity entity) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.hzya.frame.plugin.dgx.u9c.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.dao.IRequisitionDao;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.entity.RequisitionEntity;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.service.IRequisitionService;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/9/18 14:13
|
||||||
|
**/
|
||||||
|
public class RequisitionServiceImpl extends BaseService<RequisitionEntity,String> implements IRequisitionService {
|
||||||
|
|
||||||
|
private IRequisitionDao requisitionDao;
|
||||||
|
@Autowired
|
||||||
|
public void setRequisitionDao(IRequisitionDao dao) {
|
||||||
|
this.requisitionDao = dao;
|
||||||
|
this.dao = dao;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询U9C请购单
|
||||||
|
*
|
||||||
|
* @param entity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public List<RequisitionEntity> queryList(RequisitionEntity entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新推送状态
|
||||||
|
*
|
||||||
|
* @param entity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public int updateStatus(RequisitionEntity entity) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,150 @@
|
||||||
|
package com.hzya.frame.plugin.dgx.u9c.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.entity.PrepaymentEntity;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.entity.RequisitionEntity;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.service.IPrepaymentService;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.service.IRequisitionService;
|
||||||
|
import com.hzya.frame.plugin.dgx.u9c.service.IU9CPluginService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description德广信U9C插件service
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/9/18 15:25
|
||||||
|
**/
|
||||||
|
public class U9CPluginServiceImpl implements IU9CPluginService {
|
||||||
|
Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
@Resource(name = "prepaymentServiceImpl")
|
||||||
|
private IPrepaymentService prepaymentService;
|
||||||
|
@Resource(name = "requisitionServiceImpl")
|
||||||
|
private IRequisitionService requisitionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* u9c预付单发起OA请款单流程
|
||||||
|
*
|
||||||
|
* @param requestJson
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public JsonResultEntity prepaymentStartFlow(JSONObject requestJson) {
|
||||||
|
//数据源编码
|
||||||
|
String datasourceCode = requestJson.getString("sourceCode");
|
||||||
|
//开始时间
|
||||||
|
String startTime = DateUtil.format(requestJson.getDate("startTime"),"yyyy-MM-dd HH:mm:ss");
|
||||||
|
//结束时间
|
||||||
|
String endTime = DateUtil.format(requestJson.getDate("endTime"),"yyyy-MM-dd HH:mm:ss");
|
||||||
|
//重试id
|
||||||
|
String taskId = requestJson.getString("integration_task_living_details_id");
|
||||||
|
//查询U9C预付单
|
||||||
|
PrepaymentEntity prepaymentEntity = new PrepaymentEntity();
|
||||||
|
prepaymentEntity.setDataSourceCode(datasourceCode);
|
||||||
|
if (StrUtil.isEmpty(taskId)){
|
||||||
|
prepaymentEntity.setStartTime(startTime);
|
||||||
|
prepaymentEntity.setEndTime(endTime);
|
||||||
|
}else {
|
||||||
|
prepaymentEntity.setId(taskId);
|
||||||
|
}
|
||||||
|
List<PrepaymentEntity> prepaymentList = prepaymentService.queryList(prepaymentEntity);
|
||||||
|
if (CollectionUtils.isNotEmpty(prepaymentList)){
|
||||||
|
for (PrepaymentEntity prepayment : prepaymentList) {
|
||||||
|
//主表
|
||||||
|
JSONObject formmain_0668 = new JSONObject();
|
||||||
|
//子表
|
||||||
|
List<JSONObject> formsonList = new LinkedList<>();
|
||||||
|
JSONObject formson_0669 = new JSONObject();
|
||||||
|
formsonList.add(formson_0669);
|
||||||
|
JSONObject formData = new JSONObject();
|
||||||
|
formData.put("formmain_0668",formmain_0668);
|
||||||
|
formData.put("formson_0669",formsonList);
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
data.put("templateCode","");
|
||||||
|
data.put("draft","0");
|
||||||
|
data.put("data",formData);
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("appName","collaboration");
|
||||||
|
param.put("data",data);
|
||||||
|
String s = invokeEsb(param, "800045", "8000450001");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return BaseResult.getSuccessMessageEntity("德广信U9C预付单推到OA插件执行成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* u9c请购单发起OA请购单流程
|
||||||
|
*
|
||||||
|
* @param requestJson
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public JsonResultEntity requisitionStartFlow(JSONObject requestJson) {
|
||||||
|
//数据源编码
|
||||||
|
String datasourceCode = requestJson.getString("sourceCode");
|
||||||
|
//开始时间
|
||||||
|
String startTime = DateUtil.format(requestJson.getDate("startTime"),"yyyy-MM-dd HH:mm:ss");
|
||||||
|
//结束时间
|
||||||
|
String endTime = DateUtil.format(requestJson.getDate("endTime"),"yyyy-MM-dd HH:mm:ss");
|
||||||
|
//重试id
|
||||||
|
String taskId = requestJson.getString("integration_task_living_details_id");
|
||||||
|
//查询u9c请购单
|
||||||
|
RequisitionEntity requisitionEntity = new RequisitionEntity();
|
||||||
|
if (StrUtil.isEmpty(taskId)){
|
||||||
|
requisitionEntity.setStartTime(startTime);
|
||||||
|
requisitionEntity.setEndTime(endTime);
|
||||||
|
}else {
|
||||||
|
requisitionEntity.setId(taskId);
|
||||||
|
}
|
||||||
|
List<RequisitionEntity> requisitionList = requisitionService.queryList(requisitionEntity);
|
||||||
|
if (CollectionUtils.isNotEmpty(requisitionList)){
|
||||||
|
for (RequisitionEntity requisition : requisitionList) {
|
||||||
|
//主表
|
||||||
|
JSONObject formmain_0652 = new JSONObject();
|
||||||
|
//子表
|
||||||
|
List<JSONObject> formsonList = new LinkedList<>();
|
||||||
|
JSONObject formson_0653 = new JSONObject();
|
||||||
|
formsonList.add(formson_0653);
|
||||||
|
JSONObject formData = new JSONObject();
|
||||||
|
formData.put("formmain_0652",formmain_0652);
|
||||||
|
formData.put("formson_0653",formsonList);
|
||||||
|
JSONObject data = new JSONObject();
|
||||||
|
data.put("templateCode","");
|
||||||
|
data.put("draft","0");
|
||||||
|
data.put("data",formData);
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("appName","collaboration");
|
||||||
|
param.put("data",data);
|
||||||
|
String s = invokeEsb(param, "800045", "8000450001");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return BaseResult.getSuccessMessageEntity("德广信U9C请购单推送OA插件执行成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
//调用注册好的esb接口
|
||||||
|
private String invokeEsb(JSONObject jsonObject,String appId,String apiCode){
|
||||||
|
String param = jsonObject.toString();
|
||||||
|
logger.info("调用:{},请求参数:{}",apiCode,param);
|
||||||
|
String result = HttpRequest.post("")
|
||||||
|
.header("appId",appId)//目标应用
|
||||||
|
.header("apiCode",apiCode)//目标api
|
||||||
|
.header("publicKey","ZJYAh1QkjBK/pIrl8+vYvw190Jg/Oh84xuvDYe8sPbEtO65Ce7eDIk+3zDUT+v578prj")//调用方key
|
||||||
|
.header("secretKey","oS2ELoTO92eVwuu0wsFvvHivg3rt8iyJqZTNDxa3iiZHzw7KU9LjmJqJDi2kQNo5j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//调用方密钥
|
||||||
|
.body(param)
|
||||||
|
.timeout(30000)
|
||||||
|
.execute()
|
||||||
|
.body();
|
||||||
|
logger.info("调用:{},返回参数:{}",apiCode,result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<plugin>
|
||||||
|
<id>dgxU9CPlugin</id>
|
||||||
|
<name>德广信U9C插件</name>
|
||||||
|
<category>24091801</category>
|
||||||
|
</plugin>
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||||
|
<beans default-autowire="byName">
|
||||||
|
<bean name="requisitionDaoImpl" class="com.hzya.frame.plugin.dgx.u9c.dao.impl.RequisitionDaoImpl" />
|
||||||
|
<bean name="PrepaymentDaoImpl" class="com.hzya.frame.plugin.dgx.u9c.dao.impl.PrepaymentDaoImpl" />
|
||||||
|
</beans>
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||||
|
<beans default-autowire="byName">
|
||||||
|
<bean name="prepaymentPluginInitializer" class="com.hzya.frame.plugin.dgx.u9c.plugin.PrepaymentPluginInitializer" />
|
||||||
|
<bean name="requisitionPluginInitializer" class="com.hzya.frame.plugin.dgx.u9c.plugin.RequisitionPluginInitializer" />
|
||||||
|
<bean name="prepaymentPluginInitializer" class="com.hzya.frame.plugin.dgx.u9c.plugin.PrepaymentPluginInitializer" />
|
||||||
|
</beans>
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||||
|
<beans default-autowire="byName">
|
||||||
|
<bean name="requisitionServiceImpl" class="com.hzya.frame.plugin.dgx.u9c.service.impl.RequisitionServiceImpl" />
|
||||||
|
<bean name="prepaymentServiceImpl" class="com.hzya.frame.plugin.dgx.u9c.service.impl.PrepaymentServiceImpl" />
|
||||||
|
<bean name="u9CPluginServiceImpl" class="com.hzya.frame.plugin.dgx.u9c.service.impl.U9CPluginServiceImpl" />
|
||||||
|
</beans>
|
Loading…
Reference in New Issue