Compare commits

..

4 Commits

19 changed files with 845 additions and 0 deletions

View File

@ -0,0 +1,12 @@
package com.hzya.frame.plugin.ht.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity;
/**
* @Description OA开票申请
* @Author xiangerlin
* @Date 2025/6/21 17:07
**/
public interface IApplyInvoiceDao extends IBaseDao<ApplyInvoiceEntity,String> {
}

View File

@ -0,0 +1,12 @@
package com.hzya.frame.plugin.ht.dao;
import com.hzya.frame.basedao.dao.IBaseDao;
import com.hzya.frame.plugin.ht.entity.FundsAllocationEntity;
/**
* @Description OA资金拨付
* @Author xiangerlin
* @Date 2025/6/21 14:23
**/
public interface IFundsAllocationDao extends IBaseDao<FundsAllocationEntity,String> {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.plugin.ht.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.ht.dao.IApplyInvoiceDao;
import com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity;
import org.springframework.stereotype.Repository;
/**
* @Description OA开票申请
* @Author xiangerlin
* @Date 2025/6/21 17:07
**/
@Repository(value = "applyInvoiceDaoImpl")
public class ApplyInvoiceDaoImpl extends MybatisGenericDao<ApplyInvoiceEntity,String> implements IApplyInvoiceDao {
}

View File

@ -0,0 +1,15 @@
package com.hzya.frame.plugin.ht.dao.impl;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.ht.dao.IFundsAllocationDao;
import com.hzya.frame.plugin.ht.entity.FundsAllocationEntity;
import org.springframework.stereotype.Repository;
/**
* @Description OA资金拨付
* @Author xiangerlin
* @Date 2025/6/21 14:24
**/
@Repository(value = "fundsAllocationDaoImpl")
public class FundsAllocationDaoImpl extends MybatisGenericDao<FundsAllocationEntity,String> implements IFundsAllocationDao {
}

View File

@ -0,0 +1,59 @@
package com.hzya.frame.plugin.ht.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @Description OA开票申请 formmain_0331
* @Author xiangerlin
* @Date 2025/6/21 17:02
**/
public class ApplyInvoiceEntity extends BaseEntity {
private String field0117;//单据号
//查询待办用的字段
private String col_summary_id;
private String ctp_affair_id;
private String workitem_id;
private String member_id;//用来指定查哪个用户的待办这里要查固定人员的待办
public String getField0117() {
return field0117;
}
public void setField0117(String field0117) {
this.field0117 = field0117;
}
public String getCol_summary_id() {
return col_summary_id;
}
public void setCol_summary_id(String col_summary_id) {
this.col_summary_id = col_summary_id;
}
public String getCtp_affair_id() {
return ctp_affair_id;
}
public void setCtp_affair_id(String ctp_affair_id) {
this.ctp_affair_id = ctp_affair_id;
}
public String getWorkitem_id() {
return workitem_id;
}
public void setWorkitem_id(String workitem_id) {
this.workitem_id = workitem_id;
}
public String getMember_id() {
return member_id;
}
public void setMember_id(String member_id) {
this.member_id = member_id;
}
}

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.plugin.ht.dao.impl.ApplyInvoiceDaoImpl">
<resultMap id="get-ApplyInvoiceEntity-result" type="com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity">
<result property="id" column="id" />
<result property="field0117" column="field0117" />
</resultMap>
<resultMap id="get-Affair-subObjectId-result" type="com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity">
<result property="id" column="id" />
<result property="field0117" column="field0117" />
<result property="col_summary_id" column="col_summary_id" />
<result property="ctp_affair_id" column="ctp_affair_id" />
<result property="workitem_id" column="workitem_id" />
</resultMap>
<select id="entity_list_base" resultMap="get-ApplyInvoiceEntity-result" parameterType="com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity">
select * from formmain_0331
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">id = #{id}</if>
<if test="field0117 != null and field0117 != ''">and field0117 = #{field0117}</if>
</trim>
</select>
<!-- 查询待办事项id流程提交和退回要用到 -->
<select id="entity_list_affair" parameterType="com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity" resultMap="get-Affair-subObjectId-result">
SELECT
formmain_0331.id,-- 单据id
formmain_0331.field0117,--单据编号
COL_SUMMARY.id as col_summary_id,--流程id
CTP_AFFAIR.id as ctp_affair_id,-- 待办id
CTP_AFFAIR.SUB_OBJECT_ID as workitem_id-- 流程处理和回退要用这个id
from
formmain_0331
LEFT JOIN COL_SUMMARY on COL_SUMMARY.FORM_RECORDID = formmain_0331.id
LEFT JOIN CTP_AFFAIR on CTP_AFFAIR.OBJECT_ID = COL_SUMMARY.id and CTP_AFFAIR.MEMBER_ID = '' and CTP_AFFAIR.STATE = '3'
where
formmain_0331.id = #{id}
and CTP_AFFAIR.SUB_OBJECT_ID is not null
</select>
</mapper>

View File

@ -0,0 +1,105 @@
package com.hzya.frame.plugin.ht.entity;
import com.hzya.frame.web.entity.BaseEntity;
/**
* @Description OA资金拨付 formmain_0464
* @Author xiangerlin
* @Date 2025/6/21 14:19
**/
public class FundsAllocationEntity extends BaseEntity {
private String field0045;//单据编号
private String field0061;//税务系统id这个字段不为空时表示是税务推过来的单子
private String field0062;//单据来源这个字段不为空时表示是司库推过来的单子
private String field0063;//司库系统批次号回调时用
//审批意见相关的字段
private String col_summary_id;//流程id
private String subject;//流程标题
private String state;//流程状态
private String name;//处理人姓名
private String approval_time;//处理时间
private String content;//审批意见
public String getField0045() {
return field0045;
}
public void setField0045(String field0045) {
this.field0045 = field0045;
}
public String getField0061() {
return field0061;
}
public void setField0061(String field0061) {
this.field0061 = field0061;
}
public String getField0062() {
return field0062;
}
public void setField0062(String field0062) {
this.field0062 = field0062;
}
public String getCol_summary_id() {
return col_summary_id;
}
public void setCol_summary_id(String col_summary_id) {
this.col_summary_id = col_summary_id;
}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getApproval_time() {
return approval_time;
}
public void setApproval_time(String approval_time) {
this.approval_time = approval_time;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getField0063() {
return field0063;
}
public void setField0063(String field0063) {
this.field0063 = field0063;
}
}

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.plugin.ht.dao.impl.FundsAllocationDaoImpl">
<resultMap id="get-FundsAllocationEntity-result" type="com.hzya.frame.plugin.ht.entity.FundsAllocationEntity">
<result property="id" column="id" />
<result property="field0045" column="field0045" />
<result property="field0061" column="field0061" />
<result property="field0062" column="field0062" />
<result property="field0063" column="field0063" />
</resultMap>
<resultMap id="get-CtpComment-result" type="com.hzya.frame.plugin.ht.entity.FundsAllocationEntity">
<result property="col_summary_id" column="col_summary_id" />
<result property="subject" column="subject" />
<result property="state" column="state" />
<result property="name" column="name" />
<result property="approval_time" column="approval_time" />
<result property="content" column="content" />
</resultMap>
<select id="entity_list_base" resultMap="get-FundsAllocationEntity-result" parameterType="com.hzya.frame.plugin.ht.entity.FundsAllocationEntity">
select * from formmain_0464
<trim prefix="where" prefixOverrides="and">
<if test="id != null and id != ''">id = #{id}</if>
<if test="field0045 != null and field0045 != ''">and field0045 = #{field0045}</if>
</trim>
</select>
<!-- 查询审批意见 -->
<select id="entity_ctp_comment_all" resultMap="get-CtpComment-result" parameterType="com.hzya.frame.plugin.ht.entity.FundsAllocationEntity">
SELECT res.* from (
SELECT
col_summary.id as col_summary_id,
col_summary.subject,
col_summary.state,
ORG_MEMBER.NAME as name,
CASE CTP_AFFAIR.state
WHEN '1' THEN CTP_AFFAIR.create_date
WHEN '2' THEN CTP_AFFAIR.create_date
ELSE CTP_AFFAIR.complete_time
END as approval_time,
CTP_COMMENT_ALL.content
from col_summary
LEFT JOIN CTP_AFFAIR ON CTP_AFFAIR.object_id = col_summary.id
LEFT JOIN CTP_COMMENT_ALL ON CTP_COMMENT_ALL.affair_id = CTP_AFFAIR.id and CTP_COMMENT_ALL.FORWARD_COUNT = 0
LEFT JOIN ORG_MEMBER ON ORG_MEMBER.id = CTP_AFFAIR.member_id
where col_summary.id = #{col_summary_id}
)res ORDER BY res.approval_time desc
</select>
</mapper>

View File

@ -0,0 +1,98 @@
package com.hzya.frame.plugin.ht.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @Description 资金拨付 流程结束回调 需要同时回调有度税务和中信司库
* @Author xiangerlin
* @Date 2025/6/21 14:06
**/
public class FundsAllocationPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(FundsAllocationPluginInitializer.class);
/***
* 插件初始化方法
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-02 10:48
* @Param []
* @return void
**/
@Override
public void initialize() {
logger.info(getPluginLabel() + "執行初始化方法initialize()");
}
/****
* 插件销毁方法
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public void destroy() {
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
}
/****
* 插件的ID
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginId() {
return "FundsAllocationPlugin";
}
/****
* 插件的名称
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginName() {
return "资金拨付回调税务和司库";
}
/****
* 插件的显示值
* @author 👻👻👻👻👻👻👻👻 gjh
* @date 2023-08-02 10:48
* @return void
**/
@Override
public String getPluginLabel() {
return "资金拨付回调税务和司库";
}
/***
* 插件类型 1场景插件
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-02 14:01
* @Param []
* @return java.lang.String
**/
@Override
public String getPluginType() {
return "1";
}
/***
* 执行业务代码
* @Author 👻👻👻👻👻👻👻👻 gjh
* @Date 2023-08-07 11:20
* @param requestJson 执行业务代码的参数
* @return void
**/
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
logger.info("======开始执行资金拨付回调有度税务和中信司库插件========");
return null;
}
}

View File

@ -22,6 +22,8 @@ import com.hzya.frame.mdm.mdmModuleDistributeTripartite.entity.MdmModuleDistribu
import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao;
import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity;
import com.hzya.frame.mdm.service.IMdmServiceCache;
import com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity;
import com.hzya.frame.plugin.ht.service.IApplyInvoiceService;
import com.hzya.frame.seeyon.invoice.dao.IInvoiceDao;
import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity;
import com.hzya.frame.sys.sysenum.SysEnum;
@ -82,6 +84,8 @@ public class InvoiceDistributePluginInitializer extends PluginBaseEntity {
@Resource
private IMdmModuleDistributeTripartiteDao mdmModuleDistributeTripartiteDao;
@Autowired
private IApplyInvoiceService applyInvoiceService;
@Autowired
private IInvoiceDao invoiceDao;
@Value("${zt.url}")
private String url ;
@ -1233,7 +1237,17 @@ public class InvoiceDistributePluginInitializer extends PluginBaseEntity {
InvoiceEntity invoiceEntity = new InvoiceEntity();
invoiceEntity.setId(data_id);
invoiceEntity.setResult_status(message);
invoiceEntity.setDataSourceCode("HT-OA");
invoiceDao.updateInvoiceResult(invoiceEntity);
//查询待办退回流程用这里只处理退回的情况如果要处理提交要等开票成功后才能提交去定时查开票结果的定时任务里做
ApplyInvoiceEntity applyInvoice = new ApplyInvoiceEntity();
applyInvoice.setId(data_id);
applyInvoice.setDataSourceCode("HT-OA");
ApplyInvoiceEntity applyInvoiceEntity = applyInvoiceService.queryAffair(applyInvoice);
if (null != applyInvoiceEntity){
String stepBack = applyInvoiceService.stepBackValueOf(applyInvoiceEntity.getWorkitem_id(), message);
applyInvoiceService.process(stepBack,"8000590006");
}
}
}
}catch (Exception e){

View File

@ -0,0 +1,48 @@
package com.hzya.frame.plugin.ht.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity;
import com.hzya.frame.web.exception.BaseSystemException;
import java.util.List;
/**
* @Description OA开票申请
* @Author xiangerlin
* @Date 2025/6/21 17:56
**/
public interface IApplyInvoiceService extends IBaseService<ApplyInvoiceEntity,String> {
/**
* 查询待办信息
* 这里要指定人员 所以只会查出一条如果查出多条那就是有问题的
* @param entity
* @return
* @throws BaseSystemException
*/
ApplyInvoiceEntity queryAffair(ApplyInvoiceEntity entity)throws BaseSystemException;
/**
* 流程回退参数组装
* @param workitemId
* @param content
* @return
*/
String stepBackValueOf(String workitemId,String content);
/**
* 流程结束参数组装
* @param workitemId
* @param content
* @return
*/
String finishValueOf(String workitemId,String content);
/**
* 流程处理
* @param param
* @param apiCode
* @return
*/
String process(String param,String apiCode);
}

View File

@ -0,0 +1,21 @@
package com.hzya.frame.plugin.ht.service;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.hzya.frame.web.exception.BaseSystemException;
/**
* @Description 资金拨付 流程结束回调 需要同时回调有度税务和中信司库
* @Author xiangerlin
* @Date 2025/6/21 14:13
**/
public interface IFundsAllocationPluginService {
/**
* 资金拨付流程结束回调有度税务系统和中信司库
* @param requestJson
* @return
* @throws BaseSystemException
*/
JsonResultEntity callback(JSONObject requestJson)throws BaseSystemException;
}

View File

@ -0,0 +1,20 @@
package com.hzya.frame.plugin.ht.service;
import com.hzya.frame.basedao.service.IBaseService;
import com.hzya.frame.plugin.ht.entity.FundsAllocationEntity;
import java.util.List;
/**
* @Description OA资金拨付 formmain_0464
* @Author xiangerlin
* @Date 2025/6/21 15:01
**/
public interface IFundsAllocationService extends IBaseService<FundsAllocationEntity,String> {
/**
* 查询审批意见
* @param entity
* @return
*/
List<FundsAllocationEntity> queryCtpCommentList(FundsAllocationEntity entity);
}

View File

@ -0,0 +1,136 @@
package com.hzya.frame.plugin.ht.service.impl;
import cn.hutool.core.lang.Assert;
import cn.hutool.http.HttpRequest;
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.ht.dao.IApplyInvoiceDao;
import com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity;
import com.hzya.frame.plugin.ht.service.IApplyInvoiceService;
import com.hzya.frame.seeyon.util.OARestUtil;
import com.hzya.frame.web.exception.BaseSystemException;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description
* @Author xiangerlin
* @Date 2025/6/21 17:56
**/
@Service(value = "applyInvoiceServiceImpl")
public class ApplyInvoiceServiceImpl extends BaseService<ApplyInvoiceEntity,String> implements IApplyInvoiceService {
private IApplyInvoiceDao applyInvoiceDao;
@Autowired
public void setApplyInvoiceDao(IApplyInvoiceDao dao) {
this.applyInvoiceDao = dao;
this.dao = dao;
}
@Value("${zt.url}")
private String interfaceUrl;
/**
* 查询待办信息
*
* @param entity
* @return
* @throws BaseSystemException
*/
@DS("entity.dataSourceCode")
@Override
public ApplyInvoiceEntity queryAffair(ApplyInvoiceEntity entity) throws BaseSystemException {
List<ApplyInvoiceEntity> queryList = applyInvoiceDao.queryList(entity, "com.hzya.frame.plugin.ht.dao.impl.ApplyInvoiceDaoImpl.entity_list_affair");
if (CollectionUtils.isNotEmpty(queryList)){
if (queryList.size() > 1){
throw new BaseSystemException("数据异常,查询到多条待办数据"+entity.getId());
}
return queryList.get(0);
}
return null;
}
/**
* 流程回退参数组装
*
* @param workitemId
* @param content
* @return
*/
@Override
public String stepBackValueOf(String workitemId, String content) {
Assert.notEmpty(workitemId,"流程回退时workitemId 必填");
JSONObject jsonObject = new JSONObject();
jsonObject.put("appName", "collaboration");
jsonObject.put("workitemId", workitemId);
JSONObject commentDeal = new JSONObject();
commentDeal.put("attitude", "1");//1表示已阅
commentDeal.put("content", content);
JSONObject data = new JSONObject();
data.put("isWFTrace", "0");
data.put("comment_deal", commentDeal);
jsonObject.put("data", data);
return jsonObject.toJSONString();
}
/**
* 流程结束参数组装
*
* @param workitemId
* @param content
* @return
*/
@Override
public String finishValueOf(String workitemId, String content) {
Assert.notEmpty(workitemId,"流程回退时workitemId 必填");
JSONObject json = new JSONObject();
json.put("appName", "collaboration");
json.put("workitemId", workitemId);
JSONObject data = new JSONObject();
data.put("submitType", "1");
JSONObject commentDeal = new JSONObject();
commentDeal.put("attitude", "2");//2表示同意
commentDeal.put("content", content);
data.put("comment_deal", commentDeal);
json.put("data", data);
return json.toJSONString();
}
/**
* 流程处理
*
* @param param
* @param apiCode
* @return
*/
@Override
public String process(String param, String apiCode) {
Assert.notEmpty(param,"流程处理时参数不能为空");
Assert.notEmpty(apiCode,"apiCode不能为空");
logger.info("准备提交或退回流程:{},{}",apiCode,param);
String token = OARestUtil.getToken("hzya", "8000590001");
String result = HttpRequest.post(interfaceUrl)
.header("appId", "800059")//OA应用
.header("apiCode", apiCode)//流程提交/回退接口
.header("token", token)//token
.header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//中台公钥
.header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//中台密钥
.body(param)//表单内容
.timeout(30000)//超时毫秒
.execute().body();
return result;
}
}

View File

@ -0,0 +1,132 @@
package com.hzya.frame.plugin.ht.service.impl;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.plugin.ht.entity.FundsAllocationEntity;
import com.hzya.frame.plugin.ht.service.IFundsAllocationPluginService;
import com.hzya.frame.plugin.ht.service.IFundsAllocationService;
import com.hzya.frame.seeyon.enums.ColEventTypeEnum;
import com.hzya.frame.seeyon.util.SM2Util;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import com.hzya.frame.web.exception.BaseSystemException;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description 资金拨付 流程结束回调 需要同时回调有度税务和中信司库
* @Author xiangerlin
* @Date 2025/6/21 14:17
**/
@Service(value = "fundsAllocationPluginServiceImpl")
public class FundsAllocationPluginServiceImpl implements IFundsAllocationPluginService {
Logger logger = LoggerFactory.getLogger(FundsAllocationPluginServiceImpl.class);
@Value("${zt.url}")
private String interfaceUrl;
@Value("${zx.publicKey:}")
private String publicKey;
@Autowired
private IFundsAllocationService fundsAllocationService;
/**
* 资金拨付流程结束回调有度税务系统和中信司库
*
* @param requestJson
* @return
* @throws BaseSystemException
*/
@Override
public JsonResultEntity callback(JSONObject requestJson) throws BaseSystemException {
String dataSourceCode = requestJson.getString("apiDataSourceCode");//数据源
String headerStr = requestJson.getString("headers");//表头
String eventType = requestJson.getString("eventType");
String summaryId = requestJson.getString("summaryId");
Assert.notEmpty(dataSourceCode,"数据源不能为空");
Assert.notEmpty(headerStr,"headers不能为空");
Assert.notEmpty(eventType,"eventType不能为空");
Assert.notEmpty(summaryId,"summaryId不能为空");
JSONObject headers = requestJson.getJSONObject("headers");
String formmainTableName = headers.getString("formmainTableName");
JSONObject jsonStrObj = requestJson.getJSONObject("jsonStr");
JSONObject businessData = jsonStrObj.getJSONObject("businessDataStr");
JSONObject formmainData = businessData.getJSONObject(formmainTableName);
if (null != formmainData){
//税务系统id这个字段不为空时表示是税务推过来的单子
String field0061 = formmainData.getString("field0061");
//税务系统批次号
String field0063 = formmainData.getString("field0063");
if (StrUtil.isNotEmpty(field0061) || StrUtil.isNotEmpty(field0063)){
//查询审批意见
FundsAllocationEntity fundAllocation = new FundsAllocationEntity();
fundAllocation.setCol_summary_id(summaryId);
List<FundsAllocationEntity> fundsAllocationList = fundsAllocationService.queryCtpCommentList(fundAllocation);
if (CollectionUtils.isNotEmpty(fundsAllocationList)){
fundAllocation = fundsAllocationList.get(0);
}
String appId = "";//应用
String apiCode = "";//api
String param = "";//参数
if (StrUtil.isNotEmpty(field0061)){
appId = "800060";
apiCode = "8000600009";
//税务
JSONObject jsonObject = new JSONObject();
jsonObject.put("transferOrderNumber",field0061);
jsonObject.put("approvalUser",fundAllocation.getName());
jsonObject.put("approvalTime",fundAllocation.getApproval_time());
jsonObject.put("approvalRemark",StrUtil.isEmpty(fundAllocation.getContent()) ? "审批通过" : fundAllocation.getContent());
if (ColEventTypeEnum.ONPROCESSFINISHED.getType().equals(eventType)){
jsonObject.put("approvalStatus","2");
}else if (ColEventTypeEnum.ONSTOP.getType().equals(eventType)){//审批终止
jsonObject.put("approvalStatus","3");
}
param = jsonObject.toJSONString();
}else if (StrUtil.isNotEmpty(field0063)){
appId = "800058";
apiCode = "8000580004";
//司库
JSONObject jsonObject = new JSONObject();
jsonObject.put("batchNo",field0063);
jsonObject.put("reason",fundAllocation.getContent());
if (ColEventTypeEnum.ONPROCESSFINISHED.getType().equals(eventType)){
jsonObject.put("status","APPROVED");
}else if (ColEventTypeEnum.ONSTOP.getType().equals(eventType)){//审批终止
jsonObject.put("status","REJECTION");
}
JSONObject objectData = new JSONObject();
objectData.put("data",jsonObject);
logger.info("资金拨付审批回调司库请求参数明文:{}",objectData.toJSONString());
String encrypt = SM2Util.encrypt(objectData.toJSONString(),publicKey);
JSONObject jsonData = new JSONObject();
jsonData.put("data",encrypt);
param = jsonData.toJSONString();
}
if (StrUtil.isNotEmpty(appId) && StrUtil.isNotEmpty(apiCode) && StrUtil.isNotEmpty(param)){
logger.info("回调有度/司库请求apiCode{},报文:{}",apiCode,param);
String result = HttpRequest.post(interfaceUrl)
.header("appId", appId)//税务/司库应用
.header("apiCode", apiCode)//回调接口
.header("publicKey", "ZJYA7f8FzV219otH8zhkReiyyWpXswpbY/+StvC2em0hf59Ce7eDIk+3zDUT+v578prj")//OA公钥
.header("secretKey", "xJ9J1Ev2F0faiJ/nQnCNklskAgtQp3QSm+ihO21uY/H0UADj0tSDPxmIhFfC4v6Fj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//OA密钥
.body(param)//表单内容
.timeout(30000)//超时毫秒
.execute().body();
logger.info("回调有度/司库返回报文:{}",result);
return BaseResult.getSuccessMessageEntity(result);
}else {
logger.info("appId、apiCode、param 其中有参数是空的,不能执行");
}
}else {
logger.info("不是有度税务/中信司库推过来的单子,不需要执行");
}
}
return BaseResult.getFailureMessageEntity("表单数据为空");
}
}

View File

@ -0,0 +1,39 @@
package com.hzya.frame.plugin.ht.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.plugin.ht.dao.IFundsAllocationDao;
import com.hzya.frame.plugin.ht.entity.FundsAllocationEntity;
import com.hzya.frame.plugin.ht.service.IFundsAllocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description
* @Author xiangerlin
* @Date 2025/6/21 15:03
**/
@Service(value = "fundsAllocationServiceImpl")
public class FundsAllocationServiceImpl extends BaseService<FundsAllocationEntity,String> implements IFundsAllocationService {
private IFundsAllocationDao fundsAllocationDao;
@Autowired
public void setFundsAllocationDao(IFundsAllocationDao dao) {
this.fundsAllocationDao = dao;
this.dao = dao;
}
/**
* 查询审批意见
*
* @param entity
* @return
*/
@DS("#entity.dataSourceCode")
@Override
public List<FundsAllocationEntity> queryCtpCommentList(FundsAllocationEntity entity) {
List<FundsAllocationEntity> queryList = fundsAllocationDao.queryList(entity, "com.hzya.frame.plugin.ht.dao.impl.FundsAllocationDaoImpl.entity_ctp_comment_all");
return queryList;
}
}

View File

@ -5,5 +5,6 @@
<bean name="InvoiceDistributePluginInitializer" class="com.hzya.frame.plugin.ht.plugin.InvoiceDistributePluginInitializer" />
<bean name="QueryInvoiceResultPluginInitializer" class="com.hzya.frame.plugin.ht.plugin.QueryInvoiceResultPluginInitializer" />
<bean name="QueryInputInvoiceResultPluginInitializer" class="com.hzya.frame.plugin.ht.plugin.QueryInputInvoiceResultPluginInitializer" />
<bean name="fundsAllocationPluginInitializer" class="com.hzya.frame.plugin.ht.plugin.FundsAllocationPluginInitializer" />
</beans>

View File

@ -260,6 +260,27 @@ public class InvoiceServiceImpl extends BaseService<InvoiceEntity, String> imple
saveTaskLivingDetails(entity.getSerial_number(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false, "QueryInvoiceResultPluginInitializer");
}
}
//开票成功提交流程
//查询待办退回流程用这里只处理退回的情况如果要处理提交要等开票成功后才能提交去定时查开票结果的定时任务里做
ApplyInvoiceEntity applyInvoice = new ApplyInvoiceEntity();
applyInvoice.setId(entity.getSerial_number());
applyInvoice.setDataSourceCode("HT-OA");
ApplyInvoiceEntity applyInvoiceEntity = applyInvoiceService.queryAffair(applyInvoice);
if (null != applyInvoiceEntity){
String stepBack = applyInvoiceService.stepBackValueOf(applyInvoiceEntity.getWorkitem_id(), InvoiceState.invoiceStateGetValue(jsonResult.getString("resultStatus"));
applyInvoiceService.process(stepBack,"8000590007");
}
}else {
//开票失败流程回退
//查询待办退回流程用这里只处理退回的情况如果要处理提交要等开票成功后才能提交去定时查开票结果的定时任务里做
ApplyInvoiceEntity applyInvoice = new ApplyInvoiceEntity();
applyInvoice.setId(entity.getSerial_number());
applyInvoice.setDataSourceCode("HT-OA");
ApplyInvoiceEntity applyInvoiceEntity = applyInvoiceService.queryAffair(applyInvoice);
if (null != applyInvoiceEntity){
String stepBack = applyInvoiceService.stepBackValueOf(applyInvoiceEntity.getWorkitem_id(), attribute.getString("resultMsg"));
applyInvoiceService.process(stepBack,"8000590006");
}
}
}
}

View File

@ -177,6 +177,9 @@ public class OARestUtil {
hashMap.put(parameterName,example);
}
}
if (StrUtil.isNotEmpty(login_name)){
hashMap.put("loginName",login_name);
}
login_name = hashMap.get("loginName");
if (StrUtil.isEmpty(login_name)){
hashMap.put("loginName","hzya");