节点修改
This commit is contained in:
parent
8a8ea77895
commit
e455db28a7
|
@ -0,0 +1,57 @@
|
||||||
|
package com.hzya.frame.plugin.zxBank.plugin;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
|
import com.hzya.frame.seeyon.zxbank.service.IZxBankService;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
public class ZxBankNewPluginInitializer extends PluginBaseEntity {
|
||||||
|
|
||||||
|
Logger logger = LoggerFactory.getLogger(ZxBankNewPluginInitializer.class);
|
||||||
|
@Autowired
|
||||||
|
private IZxBankService zxBankService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
logger.info(getPluginLabel() + "執行初始化方法initialize()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroy() {
|
||||||
|
logger.info(getPluginLabel() + "執行銷毀方法destroy()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginId() {
|
||||||
|
return "ZxBankNewPluginInitializer";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginName() {
|
||||||
|
return "ZxBankNewPluginInitializer插件";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginLabel() {
|
||||||
|
return "ZxBankNewPluginInitializer";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPluginType() {
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||||
|
try {
|
||||||
|
logger.info("======开始执行杭泰付款单同步========");
|
||||||
|
return zxBankService.queryArchivesNew(requestJson);
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.info("======执行杭泰付款单同步失败:{}========",e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,4 +5,5 @@
|
||||||
<bean name="ZxBankResultPluginInitializer" class="com.hzya.frame.plugin.zxBank.plugin.ZxBankResultPluginInitializer" />
|
<bean name="ZxBankResultPluginInitializer" class="com.hzya.frame.plugin.zxBank.plugin.ZxBankResultPluginInitializer" />
|
||||||
<bean name="ZxBankDistributePluginInitializer" class="com.hzya.frame.plugin.zxBank.plugin.ZxBankDistributePluginInitializer" />
|
<bean name="ZxBankDistributePluginInitializer" class="com.hzya.frame.plugin.zxBank.plugin.ZxBankDistributePluginInitializer" />
|
||||||
<bean name="ZxBankElecPluginInitializer" class="com.hzya.frame.plugin.zxBank.plugin.ZxBankElecPluginInitializer" />
|
<bean name="ZxBankElecPluginInitializer" class="com.hzya.frame.plugin.zxBank.plugin.ZxBankElecPluginInitializer" />
|
||||||
|
<bean name="ZxBankNewPluginInitializer" class="com.hzya.frame.plugin.zxBank.plugin.ZxBankNewPluginInitializer" />
|
||||||
</beans>
|
</beans>
|
||||||
|
|
|
@ -40,6 +40,16 @@ public interface IZxBankDao extends IBaseDao<ZxBankEntity, String> {
|
||||||
* **/
|
* **/
|
||||||
List<ZxBankEntity> queryResultIsNullZX(ZxBankEntity zxBankEntity);
|
List<ZxBankEntity> queryResultIsNullZX(ZxBankEntity zxBankEntity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 查询已推送并且支付结果为空的数据
|
||||||
|
* @Param
|
||||||
|
* @Return
|
||||||
|
* @Author hecan
|
||||||
|
* @Date 2025-03-18 17:44
|
||||||
|
* **/
|
||||||
|
List<ZxBankEntity> queryResultIsNullZXNew(ZxBankEntity zxBankEntity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @content 修改支付状态
|
* @content 修改支付状态
|
||||||
|
@ -59,6 +69,15 @@ public interface IZxBankDao extends IBaseDao<ZxBankEntity, String> {
|
||||||
* @Date 2025-03-19 14:15
|
* @Date 2025-03-19 14:15
|
||||||
* **/
|
* **/
|
||||||
List<ZxBankEntity> queryElecIsNullZX(ZxBankEntity entity);
|
List<ZxBankEntity> queryElecIsNullZX(ZxBankEntity entity);
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 查询已支付并且电子回单为空的数据
|
||||||
|
* @Param
|
||||||
|
* @Return
|
||||||
|
* @Author hecan
|
||||||
|
* @Date 2025-03-19 14:15
|
||||||
|
* **/
|
||||||
|
List<ZxBankEntity> queryElecIsNullZXNew(ZxBankEntity entity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -69,4 +88,24 @@ public interface IZxBankDao extends IBaseDao<ZxBankEntity, String> {
|
||||||
* @Date 2025-04-07 17:06
|
* @Date 2025-04-07 17:06
|
||||||
* **/
|
* **/
|
||||||
Integer updateElecStatusZX(ZxBankEntity entity);
|
Integer updateElecStatusZX(ZxBankEntity entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 查询组织
|
||||||
|
* @Date 11:02 上午 2025/8/25
|
||||||
|
* @param zxBankEntity
|
||||||
|
* @return java.util.List<com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity>
|
||||||
|
**/
|
||||||
|
List<ZxBankEntity> queryOrg(ZxBankEntity zxBankEntity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 查询所有结果
|
||||||
|
* @Date 11:03 上午 2025/8/25
|
||||||
|
* @param bankEntity
|
||||||
|
* @return java.util.List<com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity>
|
||||||
|
**/
|
||||||
|
List<ZxBankEntity> queryResultStatus(ZxBankEntity bankEntity);
|
||||||
|
|
||||||
|
List<ZxBankEntity> queryResultStatusMx(ZxBankEntity bankEntity);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,11 @@ public class ZxBankDaoImpl extends MybatisGenericDao<ZxBankEntity,String> implem
|
||||||
public List<ZxBankEntity> queryResultIsNullZX(ZxBankEntity entity) {
|
public List<ZxBankEntity> queryResultIsNullZX(ZxBankEntity entity) {
|
||||||
return super.queryList(entity,"queryResultIsNullZX");
|
return super.queryList(entity,"queryResultIsNullZX");
|
||||||
}
|
}
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public List<ZxBankEntity> queryResultIsNullZXNew(ZxBankEntity entity) {
|
||||||
|
return super.queryList(entity,"queryResultIsNullZXNew");
|
||||||
|
}
|
||||||
|
|
||||||
@DS("#entity.dataSourceCode")
|
@DS("#entity.dataSourceCode")
|
||||||
@Override
|
@Override
|
||||||
|
@ -58,9 +63,50 @@ public class ZxBankDaoImpl extends MybatisGenericDao<ZxBankEntity,String> implem
|
||||||
return super.queryList(entity,"queryElecIsNullZX");
|
return super.queryList(entity,"queryElecIsNullZX");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public List<ZxBankEntity> queryElecIsNullZXNew(ZxBankEntity entity) {
|
||||||
|
return super.queryList(entity,"queryElecIsNullZXNew");
|
||||||
|
}
|
||||||
|
|
||||||
@DS("#entity.dataSourceCode")
|
@DS("#entity.dataSourceCode")
|
||||||
@Override
|
@Override
|
||||||
public Integer updateElecStatusZX(ZxBankEntity entity) {
|
public Integer updateElecStatusZX(ZxBankEntity entity) {
|
||||||
return super.update("updateElecStatusZX",entity);
|
return super.update("updateElecStatusZX",entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public List<ZxBankEntity> queryOrg(ZxBankEntity entity) {
|
||||||
|
return super.queryList(entity,getSqlIdPrifx() + "queryOrg");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param entity
|
||||||
|
* @return java.util.List<com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity>
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 查询所有结果
|
||||||
|
* @Date 11:03 上午 2025/8/25
|
||||||
|
**/
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public List<ZxBankEntity> queryResultStatus(ZxBankEntity entity) {
|
||||||
|
return super.queryList(entity,getSqlIdPrifx() + "queryResultStatus");
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param entity
|
||||||
|
* @return java.util.List<com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity>
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 查询所有结果
|
||||||
|
* @Date 11:03 上午 2025/8/25
|
||||||
|
**/
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public List<ZxBankEntity> queryResultStatusMx(ZxBankEntity entity) {
|
||||||
|
return super.queryList(entity,getSqlIdPrifx() + "queryResultStatusMx");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,8 @@ public class ZxBankEntity extends BaseEntity {
|
||||||
private String receipt;//电子回单
|
private String receipt;//电子回单
|
||||||
private String pushStatus;//推送标识
|
private String pushStatus;//推送标识
|
||||||
private String summaryId;//
|
private String summaryId;//
|
||||||
|
private String mainId;//主表id
|
||||||
|
private String workitemId;//主表id
|
||||||
|
|
||||||
public String getSummaryId() {
|
public String getSummaryId() {
|
||||||
return summaryId;
|
return summaryId;
|
||||||
|
@ -255,4 +257,20 @@ public class ZxBankEntity extends BaseEntity {
|
||||||
public void setSubmitUser(String submitUser) {
|
public void setSubmitUser(String submitUser) {
|
||||||
this.submitUser = submitUser;
|
this.submitUser = submitUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMainId() {
|
||||||
|
return mainId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMainId(String mainId) {
|
||||||
|
this.mainId = mainId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWorkitemId() {
|
||||||
|
return workitemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkitemId(String workitemId) {
|
||||||
|
this.workitemId = workitemId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
<result property="receipt" column="receipt" />
|
<result property="receipt" column="receipt" />
|
||||||
<result property="pushStatus" column="pushStatus" />
|
<result property="pushStatus" column="pushStatus" />
|
||||||
<result property="summaryId" column="summaryId" />
|
<result property="summaryId" column="summaryId" />
|
||||||
|
<result property="mainId" column="mainId" />
|
||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
@ -62,6 +63,7 @@
|
||||||
,receipt as receipt
|
,receipt as receipt
|
||||||
,push_status as pushStatus
|
,push_status as pushStatus
|
||||||
,summary_id as summaryId
|
,summary_id as summaryId
|
||||||
|
,main_id as mainId
|
||||||
|
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
@ -78,11 +80,26 @@
|
||||||
<include refid="ZxBankEntity_Base_Column_List" />
|
<include refid="ZxBankEntity_Base_Column_List" />
|
||||||
from v_hzya_pay where push_status is not null and (pay_result is null or pay_result='支付中')
|
from v_hzya_pay where push_status is not null and (pay_result is null or pay_result='支付中')
|
||||||
</select>
|
</select>
|
||||||
|
<select id="queryResultIsNullZXNew" resultMap="get-ZxBankEntity-result" parameterType="com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity">
|
||||||
|
select
|
||||||
|
<include refid="ZxBankEntity_Base_Column_List" />
|
||||||
|
from v_hzya_pay_new where push_status is not null and (pay_result is null or pay_result='支付中')
|
||||||
|
</select>
|
||||||
|
<select id="queryOrg" resultType="com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity" parameterType="com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity">
|
||||||
|
select
|
||||||
|
name as recAccountName
|
||||||
|
from ORG_MEMBER where id = #{recAccountName}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="queryElecIsNullZX" resultMap="get-ZxBankEntity-result" parameterType="com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity">
|
<select id="queryElecIsNullZX" resultMap="get-ZxBankEntity-result" parameterType="com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity">
|
||||||
select
|
select
|
||||||
<include refid="ZxBankEntity_Base_Column_List" />
|
<include refid="ZxBankEntity_Base_Column_List" />
|
||||||
from v_hzya_pay where pay_result='已支付' and receipt is null
|
from v_hzya_pay where (pay_result='已支付' or pay_result='支付成功' ) and receipt is null and
|
||||||
|
</select>
|
||||||
|
<select id="queryElecIsNullZXNew" resultMap="get-ZxBankEntity-result" parameterType="com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity">
|
||||||
|
select
|
||||||
|
<include refid="ZxBankEntity_Base_Column_List" />
|
||||||
|
from v_hzya_pay_new where (pay_result='已支付' or pay_result='支付成功' ) and receipt is null and
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--通过主键修改方法-->
|
<!--通过主键修改方法-->
|
||||||
|
@ -97,9 +114,35 @@
|
||||||
|
|
||||||
<!--通过主键修改方法-->
|
<!--通过主键修改方法-->
|
||||||
<update id="updateElecStatusZX" parameterType = "com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity" >
|
<update id="updateElecStatusZX" parameterType = "com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity" >
|
||||||
update ${tabName} set ${receiptFiled} =#{receipt} where id=#{dataId}
|
update ${tabName} set ${receiptFiled} =#{receipt} where id= #{dataId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="queryResultStatus" resultType="com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity" parameterType="com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity">
|
||||||
|
SELECT
|
||||||
|
${payResultField} AS payResult,
|
||||||
|
CTP_AFFAIR.SUB_OBJECT_ID as workitemId
|
||||||
|
FROM
|
||||||
|
${tabName}
|
||||||
|
LEFT JOIN COL_SUMMARY on COL_SUMMARY.FORM_RECORDID = ${tabName}.id
|
||||||
|
LEFT JOIN CTP_AFFAIR on CTP_AFFAIR.OBJECT_ID = COL_SUMMARY.id
|
||||||
|
and CTP_AFFAIR.MEMBER_ID = '8802902519613178734'
|
||||||
|
and ( CTP_AFFAIR.STATE = '3' or CTP_AFFAIR.STATE = '0')
|
||||||
|
WHERE
|
||||||
|
${tabName}.id = #{mainId}
|
||||||
|
</select>
|
||||||
|
<select id="queryResultStatusMx" resultType="com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity" parameterType="com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity">
|
||||||
|
SELECT
|
||||||
|
${payResultField} AS payResult,
|
||||||
|
CTP_AFFAIR.SUB_OBJECT_ID as workitemId
|
||||||
|
FROM
|
||||||
|
${tabName}
|
||||||
|
LEFT JOIN COL_SUMMARY on COL_SUMMARY.FORM_RECORDID = ${tabName}.formmain_id
|
||||||
|
LEFT JOIN CTP_AFFAIR on CTP_AFFAIR.OBJECT_ID = COL_SUMMARY.id
|
||||||
|
and CTP_AFFAIR.MEMBER_ID = '8802902519613178734'
|
||||||
|
and ( CTP_AFFAIR.STATE = '3' or CTP_AFFAIR.STATE = '0')
|
||||||
|
WHERE
|
||||||
|
formmain_id =#{mainId}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,16 @@ public interface IZxBankService extends IBaseService<ZxBankEntity,String> {
|
||||||
* @Date 2025-03-18 9:53
|
* @Date 2025-03-18 9:53
|
||||||
* **/
|
* **/
|
||||||
JsonResultEntity queryArchives(JSONObject jsonObject);
|
JsonResultEntity queryArchives(JSONObject jsonObject);
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @content 付款单节点推送
|
||||||
|
* @Param
|
||||||
|
* @Return
|
||||||
|
* @Author hecan
|
||||||
|
* @Date 2025-03-18 9:53
|
||||||
|
* **/
|
||||||
|
JsonResultEntity queryArchivesNew(JSONObject jsonObject);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package com.hzya.frame.seeyon.zxbank.service.impl;
|
package com.hzya.frame.seeyon.zxbank.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
|
@ -38,8 +41,10 @@ import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
@ -164,11 +169,18 @@ public class ZxBankServiceImpl extends BaseService<ZxBankEntity, String> impleme
|
||||||
zxBankEntity.setDataSourceCode("HT-OA");
|
zxBankEntity.setDataSourceCode("HT-OA");
|
||||||
logger.info("======开始查询中信返回的支付结果=====");
|
logger.info("======开始查询中信返回的支付结果=====");
|
||||||
List<ZxBankEntity> zxBankEntities = zxBankDao.queryResultIsNullZX(zxBankEntity);
|
List<ZxBankEntity> zxBankEntities = zxBankDao.queryResultIsNullZX(zxBankEntity);
|
||||||
|
List<ZxBankEntity> zxBankEntities1 = zxBankDao.queryResultIsNullZXNew(zxBankEntity);
|
||||||
|
if(zxBankEntities1 != null && zxBankEntities1.size() > 0){
|
||||||
|
if(zxBankEntities == null){
|
||||||
|
zxBankEntities = new ArrayList<>();
|
||||||
|
}
|
||||||
|
zxBankEntities.addAll(zxBankEntities1);
|
||||||
|
}
|
||||||
if(CollectionUtils.isEmpty(zxBankEntities)){
|
if(CollectionUtils.isEmpty(zxBankEntities)){
|
||||||
logger.info("=====杭泰付款单中没有已推送并且支付结果为空的数据========");
|
logger.info("=====杭泰付款单中没有已推送并且支付结果为空的数据========");
|
||||||
return BaseResult.getSuccessMessageEntity("查询成功");
|
return BaseResult.getSuccessMessageEntity("查询成功");
|
||||||
}
|
}
|
||||||
for (ZxBankEntity bankEntity : zxBankEntities) {
|
for (ZxBankEntity bankEntity : zxBankEntities) {
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
list.add(bankEntity.getDocumentNo());
|
list.add(bankEntity.getDocumentNo());
|
||||||
JSONObject jsonObject=new JSONObject();
|
JSONObject jsonObject=new JSONObject();
|
||||||
|
@ -219,6 +231,98 @@ public class ZxBankServiceImpl extends BaseService<ZxBankEntity, String> impleme
|
||||||
bankEntity.setPayResult(errorMsg);
|
bankEntity.setPayResult(errorMsg);
|
||||||
}
|
}
|
||||||
zxBankDao.updateResultStatus(bankEntity);
|
zxBankDao.updateResultStatus(bankEntity);
|
||||||
|
//1、查询单据是否全部流程结束
|
||||||
|
logger.error("====付款單查询中信返回的单据号为:{},返回结果为:{},错误信息为:{}",documentNo,payStatus,errorMsg);
|
||||||
|
|
||||||
|
List<ZxBankEntity> resultList = null;
|
||||||
|
bankEntity.setDataSourceCode("HT-OA");
|
||||||
|
|
||||||
|
//对公付款单
|
||||||
|
if("formson_0329".equals(bankEntity.getTabName())){
|
||||||
|
resultList = zxBankDao.queryResultStatusMx(bankEntity);
|
||||||
|
}
|
||||||
|
//招待报销单
|
||||||
|
if("formmain_0294".equals(bankEntity.getTabName())) {
|
||||||
|
resultList = zxBankDao.queryResultStatus(bankEntity);
|
||||||
|
}
|
||||||
|
//日常报销单
|
||||||
|
if("formmain_0314".equals(bankEntity.getTabName())) {
|
||||||
|
resultList = zxBankDao.queryResultStatus(bankEntity);
|
||||||
|
|
||||||
|
}
|
||||||
|
// 差旅报销单-新
|
||||||
|
if("formmain_0533".equals(bankEntity.getTabName())) {
|
||||||
|
resultList = zxBankDao.queryResultStatus(bankEntity);
|
||||||
|
|
||||||
|
}
|
||||||
|
// 借还款
|
||||||
|
if("formmain_0293".equals(bankEntity.getTabName())) {
|
||||||
|
resultList = zxBankDao.queryResultStatus(bankEntity);
|
||||||
|
|
||||||
|
}
|
||||||
|
//资金归集
|
||||||
|
if("formson_0378".equals(bankEntity.getTabName())) {
|
||||||
|
resultList = zxBankDao.queryResultStatusMx(bankEntity);
|
||||||
|
|
||||||
|
}
|
||||||
|
//资金拨付
|
||||||
|
if("formson_0465".equals(bankEntity.getTabName())) {
|
||||||
|
resultList = zxBankDao.queryResultStatusMx(bankEntity);
|
||||||
|
|
||||||
|
}
|
||||||
|
//同名账户划转
|
||||||
|
if("formson_0469".equals(bankEntity.getTabName())) {
|
||||||
|
resultList = zxBankDao.queryResultStatusMx(bankEntity);
|
||||||
|
|
||||||
|
}
|
||||||
|
//2、修改流程结果
|
||||||
|
|
||||||
|
if(resultList != null && resultList.size() > 0){
|
||||||
|
int cg = 0;
|
||||||
|
int zfz = 0;
|
||||||
|
int sl = 0;
|
||||||
|
String workitemId = null;
|
||||||
|
for (int i = 0; i < resultList.size(); i++) {
|
||||||
|
sl++;
|
||||||
|
if(resultList.get(i).getPayResult() != null && ("已支付".equals(resultList.get(i).getPayResult()) || "支付成功".equals(resultList.get(i).getPayResult()) )){
|
||||||
|
cg++;
|
||||||
|
}
|
||||||
|
if(resultList.get(i).getPayResult() == null || "".equals(resultList.get(i).getPayResult()) || "支付中".equals(resultList.get(i).getPayResult())){
|
||||||
|
zfz++;
|
||||||
|
}
|
||||||
|
if(workitemId == null){
|
||||||
|
workitemId = resultList.get(i).getWorkitemId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.error("付款單查询支付中状态:{}",zfz);
|
||||||
|
if(zfz == 0){//没有支付中才处理流程
|
||||||
|
if(workitemId != null && !"".equals(workitemId)){
|
||||||
|
String token = getTokens();
|
||||||
|
logger.error("付款單token状态:{}",token);
|
||||||
|
|
||||||
|
if(cg == sl){//流程提交
|
||||||
|
|
||||||
|
String senddata = finishValueOf(workitemId,"支付结果获取成功");
|
||||||
|
logger.error("修改流程提交发送:{}",senddata);
|
||||||
|
|
||||||
|
String returnData = doSendData("8000590007",token,senddata);
|
||||||
|
logger.error("修改流程提交返回结果"+returnData);
|
||||||
|
|
||||||
|
if (StrUtil.isNotEmpty(returnData)){
|
||||||
|
logger.error("修改流程提交返回结果"+returnData);
|
||||||
|
}
|
||||||
|
}else {//流程回退
|
||||||
|
String senddata = stepBackValueOf(workitemId,"支付错误退回");
|
||||||
|
logger.error("修改流程回退发送:{}",senddata);
|
||||||
|
String returnData = doSendData("8000590006",token,senddata);
|
||||||
|
logger.error("修改流程回退返回结果"+returnData);
|
||||||
|
if (StrUtil.isNotEmpty(returnData)){
|
||||||
|
logger.error("修改流程回退返回结果"+returnData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
saveTaskLivingDetails(bankEntity.getDataId(), bankEntity.getDocumentNo(), jsonData.toJSONString(), resultJson.toJSONString(), true,"ZxBankResultPluginInitializer");
|
saveTaskLivingDetails(bankEntity.getDataId(), bankEntity.getDocumentNo(), jsonData.toJSONString(), resultJson.toJSONString(), true,"ZxBankResultPluginInitializer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -236,8 +340,83 @@ public class ZxBankServiceImpl extends BaseService<ZxBankEntity, String> impleme
|
||||||
}
|
}
|
||||||
return BaseResult.getFailureMessageEntity("支付结果查询失败");
|
return BaseResult.getFailureMessageEntity("支付结果查询失败");
|
||||||
}
|
}
|
||||||
|
private String getTokens() {
|
||||||
|
String token = null;
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
// 向JSON对象中添加键值对
|
||||||
|
param.put("password", "b19afb1a-5a72-43db-84e1-e84aa4c571b5");
|
||||||
|
param.put("userName", "YDRest");
|
||||||
|
param.put("loginName", "ZZZH");
|
||||||
|
|
||||||
|
String result = HttpRequest.post(url)
|
||||||
|
.header("appId", "800059")
|
||||||
|
.header("apiCode", "8000590001")
|
||||||
|
.header("publicKey", "ZJYA7f8FzV219otH8zhkReiyyWpXswpbY/+StvC2em0hf59Ce7eDIk+3zDUT+v578prj")//OA公钥
|
||||||
|
.header("secretKey", "xJ9J1Ev2F0faiJ/nQnCNklskAgtQp3QSm+ihO21uY/H0UADj0tSDPxmIhFfC4v6Fj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//OA密钥
|
||||||
|
.body(param.toJSONString())//表单内容
|
||||||
|
.timeout(30000)//超时,毫秒
|
||||||
|
.execute().body();
|
||||||
|
logger.error("OaToken返回报文:{}",result);
|
||||||
|
if (StrUtil.isNotEmpty(result)){
|
||||||
|
JSONObject tokenObj = JSONObject.parseObject(result);
|
||||||
|
String code = tokenObj.getString("status");
|
||||||
|
if ("200".equals(code)){
|
||||||
|
JSONObject attribute = tokenObj.getJSONObject("attribute");
|
||||||
|
if (null != attribute){
|
||||||
|
token = attribute.getString("id");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
private String doSendData(String apiCode,String token,String param) {
|
||||||
|
String result = HttpRequest.post(url)
|
||||||
|
.header("appId", "800059")
|
||||||
|
.header("apiCode", apiCode)
|
||||||
|
.header("token", token)//token
|
||||||
|
.header("publicKey", "ZJYA7f8FzV219otH8zhkReiyyWpXswpbY/+StvC2em0hf59Ce7eDIk+3zDUT+v578prj")//OA公钥
|
||||||
|
.header("secretKey", "xJ9J1Ev2F0faiJ/nQnCNklskAgtQp3QSm+ihO21uY/H0UADj0tSDPxmIhFfC4v6Fj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//OA密钥
|
||||||
|
.body(param)//表单内容
|
||||||
|
.timeout(30000)//超时,毫秒
|
||||||
|
.execute().body();
|
||||||
|
logger.error("Oa返回报文:{}",result);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String stepBackValueOf(String workitemId, String content) {
|
||||||
|
Assert.notEmpty(workitemId,"流程提交时workitemId 必填");
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
JSONObject commentres = new JSONObject();
|
||||||
|
commentres.put("attitude", "1");//"1", //1 已阅, 2 同意, 3 不同意
|
||||||
|
commentres.put("content", content);//意见
|
||||||
|
|
||||||
|
JSONObject datares = new JSONObject();
|
||||||
|
datares.put("isWFTrace", "0");//,// 流程追溯
|
||||||
|
datares.put("comment_deal",commentres);
|
||||||
|
|
||||||
|
json.put("appName", "collaboration");//应用类型,协同表单设置为:collaboration
|
||||||
|
json.put("workitemId", workitemId);//对应事项接口返回对象中的subObjectId
|
||||||
|
json.put("data",datares);//当前处理人登录名
|
||||||
|
return json.toJSONString();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JsonResultEntity queryArchivesElec(JSONObject json) {
|
public JsonResultEntity queryArchivesElec(JSONObject json) {
|
||||||
|
@ -246,6 +425,13 @@ public class ZxBankServiceImpl extends BaseService<ZxBankEntity, String> impleme
|
||||||
zxBankEntity.setDataSourceCode("HT-OA");
|
zxBankEntity.setDataSourceCode("HT-OA");
|
||||||
logger.info("======开始查询中信电子回单=====");
|
logger.info("======开始查询中信电子回单=====");
|
||||||
List<ZxBankEntity> zxBankEntities = zxBankDao.queryElecIsNullZX(zxBankEntity);
|
List<ZxBankEntity> zxBankEntities = zxBankDao.queryElecIsNullZX(zxBankEntity);
|
||||||
|
List<ZxBankEntity> zxBankEntities1 = zxBankDao.queryElecIsNullZXNew(zxBankEntity);
|
||||||
|
if(zxBankEntities1 != null && zxBankEntities1.size() > 0){
|
||||||
|
if(zxBankEntities == null){
|
||||||
|
zxBankEntities = new ArrayList<>();
|
||||||
|
}
|
||||||
|
zxBankEntities.addAll(zxBankEntities1);
|
||||||
|
}
|
||||||
if(CollectionUtils.isEmpty(zxBankEntities)){
|
if(CollectionUtils.isEmpty(zxBankEntities)){
|
||||||
logger.info("=====杭泰付款单中没有已支付并且电子回单为空的数据========");
|
logger.info("=====杭泰付款单中没有已支付并且电子回单为空的数据========");
|
||||||
return BaseResult.getSuccessMessageEntity("查询成功");
|
return BaseResult.getSuccessMessageEntity("查询成功");
|
||||||
|
@ -619,4 +805,545 @@ public class ZxBankServiceImpl extends BaseService<ZxBankEntity, String> impleme
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//——————————————————————————————————————————————————————————————————————————————
|
||||||
|
@Override
|
||||||
|
public JsonResultEntity queryArchivesNew(JSONObject requestJson) {
|
||||||
|
logger.error("同步付款单:" + requestJson.toJSONString());
|
||||||
|
JSONObject jsonStr = requestJson.getJSONObject("jsonStr");
|
||||||
|
if (jsonStr == null) {
|
||||||
|
return BaseResult.getFailureMessageEntity("系统错误");
|
||||||
|
}
|
||||||
|
JSONObject businessDataStr = jsonStr.getJSONObject("businessDataStr");
|
||||||
|
if (businessDataStr == null) {
|
||||||
|
return BaseResult.getFailureMessageEntity("系统错误");
|
||||||
|
}
|
||||||
|
//判断是否有对应的biao单
|
||||||
|
String tableName = null;
|
||||||
|
String mxtableName = null;
|
||||||
|
if(businessDataStr.containsKey("formmain_0327")){
|
||||||
|
tableName = "formmain_0327";
|
||||||
|
mxtableName = "formson_0329";
|
||||||
|
}else if(businessDataStr.containsKey("formmain_0294")){
|
||||||
|
tableName = "formmain_0294";
|
||||||
|
mxtableName = "formson_0297";
|
||||||
|
}else if(businessDataStr.containsKey("formmain_0314")){
|
||||||
|
tableName = "formmain_0314";
|
||||||
|
mxtableName = "formson_0317";
|
||||||
|
}else if(businessDataStr.containsKey("formmain_0533")){
|
||||||
|
tableName = "formmain_0533";
|
||||||
|
mxtableName = "formson_0536";
|
||||||
|
}else if(businessDataStr.containsKey("formmain_0293")){
|
||||||
|
tableName = "formmain_0293";
|
||||||
|
mxtableName = "formson_0399";
|
||||||
|
}else if(businessDataStr.containsKey("formmain_0362")){
|
||||||
|
tableName = "formmain_0362";
|
||||||
|
mxtableName = "formson_0378";
|
||||||
|
}else if(businessDataStr.containsKey("formmain_0464")){
|
||||||
|
tableName = "formmain_0464";
|
||||||
|
mxtableName = "formson_0465";
|
||||||
|
}else if(businessDataStr.containsKey("formmain_0467")){
|
||||||
|
tableName = "formmain_0467";
|
||||||
|
mxtableName = "formson_0469";
|
||||||
|
}else {
|
||||||
|
return BaseResult.getFailureMessageEntity("系统错误,表单未配置");
|
||||||
|
}
|
||||||
|
JSONObject mainData = businessDataStr.getJSONObject(tableName);
|
||||||
|
if (mainData == null) {
|
||||||
|
return BaseResult.getFailureMessageEntity("系统错误");
|
||||||
|
}
|
||||||
|
JSONArray detailArray = businessDataStr.getJSONArray(mxtableName);
|
||||||
|
if(detailArray != null && detailArray.size() > 0){
|
||||||
|
for (int i = 0; i < detailArray.size(); i++) {
|
||||||
|
//组装发送数据
|
||||||
|
JSONObject sendData = getSendData(mainData, detailArray.getJSONObject(i),tableName,mxtableName);
|
||||||
|
//发送数据
|
||||||
|
logger.error("推送付款单推送:" + sendData.toJSONString());
|
||||||
|
String tokenResult = HttpRequest.post(url).
|
||||||
|
header("appId", "800058").
|
||||||
|
header("apiCode", "8000580000").
|
||||||
|
header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj").
|
||||||
|
header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
|
||||||
|
body(sendData.toJSONString()).
|
||||||
|
execute().
|
||||||
|
body();
|
||||||
|
logger.error("推送付款单返回:" + tokenResult);
|
||||||
|
JSONObject resoutJson = JSONObject.parseObject(tokenResult);
|
||||||
|
|
||||||
|
if (resoutJson.getBoolean("flag") ) {
|
||||||
|
JSONObject attribute = resoutJson.getJSONObject("attribute");
|
||||||
|
if("AAAAAAA".equals(attribute.getString("code"))){
|
||||||
|
JSONObject bizInfo = attribute.getJSONObject("bizInfo");
|
||||||
|
if("AAAAAAA".equals(bizInfo.getString("bizCode"))){
|
||||||
|
ZxBankEntity zxBankEntity = new ZxBankEntity();
|
||||||
|
zxBankEntity.setPushStatus("1");
|
||||||
|
zxBankEntity.setDataSourceCode("HT-OA");
|
||||||
|
//对公付款单
|
||||||
|
if("formmain_0327".equals(tableName)){
|
||||||
|
zxBankEntity.setTabName("formson_0329");
|
||||||
|
zxBankEntity.setPushStatusField("field0366");
|
||||||
|
zxBankEntity.setId(detailArray.getJSONObject(i).getString("id"));
|
||||||
|
}
|
||||||
|
//招待报销单
|
||||||
|
if("formmain_0294".equals(tableName)) {
|
||||||
|
zxBankEntity.setTabName("formmain_0294");
|
||||||
|
zxBankEntity.setPushStatusField("field0174");
|
||||||
|
zxBankEntity.setId(mainData.getString("id"));
|
||||||
|
}
|
||||||
|
//日常报销单
|
||||||
|
if("formmain_0314".equals(tableName)) {
|
||||||
|
zxBankEntity.setTabName("formmain_0314");
|
||||||
|
zxBankEntity.setPushStatusField("field0295");
|
||||||
|
zxBankEntity.setId(mainData.getString("id"));
|
||||||
|
}
|
||||||
|
// 差旅报销单-新
|
||||||
|
if("formmain_0533".equals(tableName)) {
|
||||||
|
zxBankEntity.setTabName("formmain_0533");
|
||||||
|
zxBankEntity.setPushStatusField("field0309");
|
||||||
|
zxBankEntity.setId(mainData.getString("id"));
|
||||||
|
}
|
||||||
|
// 借还款
|
||||||
|
if("formmain_0293".equals(tableName)) {
|
||||||
|
zxBankEntity.setTabName("formmain_0293");
|
||||||
|
zxBankEntity.setPushStatusField("field0092");
|
||||||
|
zxBankEntity.setId(mainData.getString("id"));
|
||||||
|
}
|
||||||
|
//资金归集
|
||||||
|
if("formmain_0362".equals(tableName)) {
|
||||||
|
zxBankEntity.setTabName("formson_0378");
|
||||||
|
zxBankEntity.setPushStatusField("field0059");
|
||||||
|
zxBankEntity.setId(detailArray.getJSONObject(i).getString("id"));
|
||||||
|
}
|
||||||
|
//资金拨付
|
||||||
|
if("formmain_0464".equals(tableName)) {
|
||||||
|
zxBankEntity.setTabName("formson_0465");
|
||||||
|
zxBankEntity.setPushStatusField("field0058");
|
||||||
|
zxBankEntity.setId(detailArray.getJSONObject(i).getString("id"));
|
||||||
|
}
|
||||||
|
//同名账户划转
|
||||||
|
if("formmain_0467".equals(tableName)) {
|
||||||
|
zxBankEntity.setTabName("formson_0469");
|
||||||
|
zxBankEntity.setPushStatusField("field0057");
|
||||||
|
zxBankEntity.setId(detailArray.getJSONObject(i).getString("id"));
|
||||||
|
}
|
||||||
|
zxBankDao.updatePushStatusZX(zxBankEntity);
|
||||||
|
return BaseResult.getSuccessMessageEntity("推送付款单成功");
|
||||||
|
}else {
|
||||||
|
return BaseResult.getFailureMessageEntity("推送付款单失败:" + bizInfo.getString("bizMessage"));
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return BaseResult.getFailureMessageEntity("推送付款单失败:" + resoutJson.getString("msg"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
JSONObject attribute = resoutJson.getJSONObject("attribute");
|
||||||
|
if("AAAAAAA".equals(attribute.getString("code"))){
|
||||||
|
JSONObject bizInfo = attribute.getJSONObject("bizInfo");
|
||||||
|
if("AAAAAAA".equals(bizInfo.getString("bizCode"))){
|
||||||
|
ZxBankEntity zxBankEntity = new ZxBankEntity();
|
||||||
|
zxBankEntity.setPushStatus("1");
|
||||||
|
zxBankEntity.setDataSourceCode("HT-OA");
|
||||||
|
//对公付款单
|
||||||
|
if("formmain_0327".equals(tableName)){
|
||||||
|
zxBankEntity.setTabName("formson_0329");
|
||||||
|
zxBankEntity.setPushStatusField("field0366");
|
||||||
|
zxBankEntity.setId(detailArray.getJSONObject(i).getString("id"));
|
||||||
|
}
|
||||||
|
//招待报销单
|
||||||
|
if("formmain_0294".equals(tableName)) {
|
||||||
|
zxBankEntity.setTabName("formmain_0294");
|
||||||
|
zxBankEntity.setPushStatusField("field0174");
|
||||||
|
zxBankEntity.setId(mainData.getString("id"));
|
||||||
|
}
|
||||||
|
//日常报销单
|
||||||
|
if("formmain_0314".equals(tableName)) {
|
||||||
|
zxBankEntity.setTabName("formmain_0314");
|
||||||
|
zxBankEntity.setPushStatusField("field0295");
|
||||||
|
zxBankEntity.setId(mainData.getString("id"));
|
||||||
|
}
|
||||||
|
// 差旅报销单-新
|
||||||
|
if("formmain_0533".equals(tableName)) {
|
||||||
|
zxBankEntity.setTabName("formmain_0533");
|
||||||
|
zxBankEntity.setPushStatusField("field0309");
|
||||||
|
zxBankEntity.setId(mainData.getString("id"));
|
||||||
|
}
|
||||||
|
// 借还款
|
||||||
|
if("formmain_0293".equals(tableName)) {
|
||||||
|
zxBankEntity.setTabName("formmain_0293");
|
||||||
|
zxBankEntity.setPushStatusField("field0092");
|
||||||
|
zxBankEntity.setId(mainData.getString("id"));
|
||||||
|
}
|
||||||
|
//资金归集
|
||||||
|
if("formmain_0362".equals(tableName)) {
|
||||||
|
zxBankEntity.setTabName("formson_0378");
|
||||||
|
zxBankEntity.setPushStatusField("field0059");
|
||||||
|
zxBankEntity.setId(detailArray.getJSONObject(i).getString("id"));
|
||||||
|
}
|
||||||
|
//资金拨付
|
||||||
|
if("formmain_0464".equals(tableName)) {
|
||||||
|
zxBankEntity.setTabName("formson_0465");
|
||||||
|
zxBankEntity.setPushStatusField("field0058");
|
||||||
|
zxBankEntity.setId(detailArray.getJSONObject(i).getString("id"));
|
||||||
|
}
|
||||||
|
//同名账户划转
|
||||||
|
if("formmain_0467".equals(tableName)) {
|
||||||
|
zxBankEntity.setTabName("formson_0469");
|
||||||
|
zxBankEntity.setPushStatusField("field0057");
|
||||||
|
zxBankEntity.setId(detailArray.getJSONObject(i).getString("id"));
|
||||||
|
}
|
||||||
|
zxBankDao.updatePushStatusZX(zxBankEntity);
|
||||||
|
return BaseResult.getSuccessMessageEntity("推送付款单成功");
|
||||||
|
}else {
|
||||||
|
return BaseResult.getFailureMessageEntity("推送付款单失败:" + bizInfo.getString("bizMessage"));
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return BaseResult.getFailureMessageEntity("推送付款单失败:" + resoutJson.getString("msg"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return BaseResult.getSuccessMessageEntity("推送付款单成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mainData
|
||||||
|
* @param mxData
|
||||||
|
* @return com.alibaba.fastjson.JSONObject
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 组装数据
|
||||||
|
* @Date 6:12 下午 2025/6/27
|
||||||
|
**/
|
||||||
|
private JSONObject getSendData(JSONObject mainData, JSONObject mxData,String tableName,String mxtableName) {
|
||||||
|
// 创建主JSONObject
|
||||||
|
String hour = Convert.toStr(DateUtil.hour(new Date(),true));
|
||||||
|
String minute = Convert.toStr(DateUtil.minute(new Date()));
|
||||||
|
JSONObject parent = new JSONObject();
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
String day = sdf.format(new Date());
|
||||||
|
//对公付款单
|
||||||
|
if("formmain_0327".equals(tableName)){
|
||||||
|
parent.put("sourceFlowNumber", mxData.getString("id")+"_"+hour+minute);
|
||||||
|
parent.put("documentNo", mainData.getString("field0146"));
|
||||||
|
parent.put("companyCode", mainData.getString("field0149"));
|
||||||
|
parent.put("fundType", "0001");
|
||||||
|
parent.put("digest","'付对公付款'"+mxData.getString("field0368"));
|
||||||
|
parent.put("payAccountNum", mxData.getString("field0137"));
|
||||||
|
parent.put("payAccountName", mainData.getString("field0116"));
|
||||||
|
parent.put("recAccountNum", mxData.getString("field0210"));
|
||||||
|
parent.put("recAccountName", mxData.getString("field0136"));
|
||||||
|
parent.put("recBankCode", mxData.getString("field0257"));
|
||||||
|
parent.put("settleAccountType", "CASH_TRANSFER");
|
||||||
|
parent.put("payChannel", "DIRECT");
|
||||||
|
if(mxData.getString("field0256") != null && !"".equals(mxData.getString("field0256"))){
|
||||||
|
parent.put("currency", mxData.getString("field0256"));
|
||||||
|
}else {
|
||||||
|
parent.put("currency", "CNY");
|
||||||
|
}
|
||||||
|
parent.put("transAmount", mxData.getString("field0135"));
|
||||||
|
if(mainData.getString("field0362") != null && !"".equals(mainData.getString("field0362"))){
|
||||||
|
parent.put("payDate",sdf.format(mainData.getDate("field0362")));
|
||||||
|
}else {
|
||||||
|
parent.put("payDate", day);
|
||||||
|
}
|
||||||
|
boolean fale=true;
|
||||||
|
parent.put("toPublic",fale);
|
||||||
|
parent.put("purpose", mainData.getString("field0124"));
|
||||||
|
}
|
||||||
|
//招待报销单
|
||||||
|
if("formmain_0294".equals(tableName)) {
|
||||||
|
parent.put("sourceFlowNumber", mainData.getString("id")+"_"+hour+minute);
|
||||||
|
parent.put("documentNo", mainData.getString("field0053"));
|
||||||
|
parent.put("companyCode", mainData.getString("field0108"));
|
||||||
|
parent.put("fundType", "0002");
|
||||||
|
parent.put("digest", "付招待报销"+mainData.getString("field0053"));
|
||||||
|
parent.put("payAccountNum", mxData.getString("field0073"));
|
||||||
|
parent.put("payAccountName", mainData.getString("field0080"));
|
||||||
|
parent.put("recAccountNum", mxData.getString("field0136"));
|
||||||
|
if(mxData.getString("field0178") != null){
|
||||||
|
ZxBankEntity zxBankEntity = new ZxBankEntity();
|
||||||
|
zxBankEntity.setDataSourceCode("HT-OA");
|
||||||
|
zxBankEntity.setRecAccountName(mxData.getString("field0178"));
|
||||||
|
List<ZxBankEntity> name = zxBankDao.queryOrg(zxBankEntity);
|
||||||
|
if(name != null && name.size() > 0){
|
||||||
|
parent.put("recAccountName", name.get(0).getRecAccountName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
parent.put("recBankCode", mxData.getString("field0176"));
|
||||||
|
parent.put("settleAccountType", "CASH_TRANSFER");
|
||||||
|
parent.put("payChannel", "DIRECT");
|
||||||
|
if(mxData.getString("field0175") != null && !"".equals(mxData.getString("field0175"))){
|
||||||
|
parent.put("currency", mxData.getString("field0175"));
|
||||||
|
}else {
|
||||||
|
parent.put("currency", "CNY");
|
||||||
|
}
|
||||||
|
parent.put("transAmount", mxData.getString("field0100"));
|
||||||
|
if(mxData.getString("field0215") != null && !"".equals(mxData.getString("field0215"))){
|
||||||
|
parent.put("payDate",sdf.format(mxData.getDate("field0215")));
|
||||||
|
}else {
|
||||||
|
parent.put("payDate", day);
|
||||||
|
}
|
||||||
|
parent.put("toPublic",false);
|
||||||
|
parent.put("recFinanceCode",getBankCode("false",mxData.getString("field0135"),mxData.getString("field0098")));
|
||||||
|
|
||||||
|
if (null != getBankCode("false",mxData.getString("field0135"),mxData.getString("field0098"))){
|
||||||
|
parent.put("recBankCode", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//日常报销单
|
||||||
|
if("formmain_0314".equals(tableName)) {
|
||||||
|
parent.put("sourceFlowNumber", mainData.getString("id")+"_"+hour+minute);
|
||||||
|
parent.put("documentNo", mainData.getString("field0220"));
|
||||||
|
parent.put("companyCode", mainData.getString("field0228"));
|
||||||
|
parent.put("fundType", "0002");
|
||||||
|
parent.put("digest", "付日常报销"+mainData.getString("field0220"));
|
||||||
|
parent.put("payAccountNum", mxData.getString("field0269"));
|
||||||
|
parent.put("payAccountName", mainData.getString("field0188"));
|
||||||
|
parent.put("recAccountNum", mxData.getString("field0217"));
|
||||||
|
if(mainData.getString("field0015") != null){
|
||||||
|
ZxBankEntity zxBankEntity = new ZxBankEntity();
|
||||||
|
zxBankEntity.setDataSourceCode("HT-OA");
|
||||||
|
zxBankEntity.setRecAccountName(mainData.getString("field0015"));
|
||||||
|
List<ZxBankEntity> name = zxBankDao.queryOrg(zxBankEntity);
|
||||||
|
if(name != null && name.size() > 0){
|
||||||
|
parent.put("recAccountName", name.get(0).getRecAccountName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parent.put("recBankCode", mxData.getString("field0297"));
|
||||||
|
parent.put("settleAccountType", "CASH_TRANSFER");
|
||||||
|
parent.put("payChannel", "DIRECT");
|
||||||
|
if(mxData.getString("field0296") != null && !"".equals(mxData.getString("field0296"))){
|
||||||
|
parent.put("currency", mxData.getString("field0296"));
|
||||||
|
}else {
|
||||||
|
parent.put("currency", "CNY");
|
||||||
|
}
|
||||||
|
|
||||||
|
parent.put("transAmount", mxData.getString("field0215"));
|
||||||
|
if(mainData.getString("field0335") != null && !"".equals(mainData.getString("field0335"))){
|
||||||
|
parent.put("payDate",sdf.format(mainData.getDate("field0335")));
|
||||||
|
}else {
|
||||||
|
parent.put("payDate", day);
|
||||||
|
}
|
||||||
|
parent.put("toPublic",false);
|
||||||
|
parent.put("recFinanceCode",getBankCode("false",mxData.getString("field0216"),mxData.getString("field0268")));
|
||||||
|
if (null != getBankCode("false",mxData.getString("field0216"),mxData.getString("field0268"))){
|
||||||
|
parent.put("recBankCode", null);
|
||||||
|
}
|
||||||
|
parent.put("purpose", mainData.getString("field0199"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 差旅报销单-新
|
||||||
|
if("formmain_0533".equals(tableName)) {
|
||||||
|
parent.put("sourceFlowNumber", mainData.getString("id")+"_"+hour+minute);
|
||||||
|
parent.put("documentNo", mainData.getString("field0094"));
|
||||||
|
parent.put("companyCode", mainData.getString("field0377"));
|
||||||
|
parent.put("fundType", "0002");
|
||||||
|
parent.put("digest", "付差旅报销"+mainData.getString("field0094"));
|
||||||
|
parent.put("payAccountNum", mxData.getString("field0266"));
|
||||||
|
parent.put("payAccountName", mainData.getString("field0188"));
|
||||||
|
parent.put("recAccountNum", mxData.getString("field0218"));
|
||||||
|
if(mxData.getString("field0313") != null){
|
||||||
|
ZxBankEntity zxBankEntity = new ZxBankEntity();
|
||||||
|
zxBankEntity.setDataSourceCode("HT-OA");
|
||||||
|
zxBankEntity.setRecAccountName(mxData.getString("field0313"));
|
||||||
|
List<ZxBankEntity> name = zxBankDao.queryOrg(zxBankEntity);
|
||||||
|
if(name != null && name.size() > 0){
|
||||||
|
parent.put("recAccountName", name.get(0).getRecAccountName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
parent.put("recBankCode", mxData.getString("field0311"));
|
||||||
|
parent.put("settleAccountType","CASH_TRANSFER");
|
||||||
|
parent.put("payChannel", "DIRECT");
|
||||||
|
if(mxData.getString("field0310") != null && !"".equals(mxData.getString("field0310"))){
|
||||||
|
parent.put("currency", mxData.getString("field0310"));
|
||||||
|
}else {
|
||||||
|
parent.put("currency", "CNY");
|
||||||
|
}
|
||||||
|
|
||||||
|
parent.put("transAmount", mxData.getString("field0215"));
|
||||||
|
if(mainData.getString("field0375") != null && !"".equals(mainData.getString("field0375"))){
|
||||||
|
parent.put("payDate",sdf.format(mainData.getDate("field0375")));
|
||||||
|
}else {
|
||||||
|
parent.put("payDate", day);
|
||||||
|
}
|
||||||
|
parent.put("toPublic",false);
|
||||||
|
parent.put("recFinanceCode",getBankCode("false",mxData.getString("field0216"),mxData.getString("field0265")));
|
||||||
|
if (null != getBankCode("false",mxData.getString("field0216"),mxData.getString("field0265"))){
|
||||||
|
parent.put("recBankCode", null);
|
||||||
|
}
|
||||||
|
parent.put("purpose", mainData.getString("field0359"));
|
||||||
|
}
|
||||||
|
// 借还款
|
||||||
|
if("formmain_0293".equals(tableName)) {
|
||||||
|
parent.put("sourceFlowNumber", mainData.getString("id")+"_"+hour+minute);
|
||||||
|
parent.put("documentNo", mainData.getString("field0056"));
|
||||||
|
parent.put("companyCode", mainData.getString("field0084"));
|
||||||
|
parent.put("fundType", "0002");
|
||||||
|
parent.put("digest", "付借还单"+mainData.getString("field0056"));
|
||||||
|
parent.put("payAccountNum", mxData.getString("field0079"));
|
||||||
|
parent.put("payAccountName", mainData.getString("field0074"));
|
||||||
|
parent.put("recAccountNum", mxData.getString("field0081"));
|
||||||
|
if(mainData.getString("field0006") != null){
|
||||||
|
ZxBankEntity zxBankEntity = new ZxBankEntity();
|
||||||
|
zxBankEntity.setDataSourceCode("HT-OA");
|
||||||
|
zxBankEntity.setRecAccountName(mainData.getString("field0006"));
|
||||||
|
List<ZxBankEntity> name = zxBankDao.queryOrg(zxBankEntity);
|
||||||
|
if(name != null && name.size() > 0){
|
||||||
|
parent.put("recAccountName", name.get(0).getRecAccountName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
parent.put("recBankCode", mxData.getString("field0093"));
|
||||||
|
parent.put("settleAccountType", "CASH_TRANSFER");
|
||||||
|
parent.put("payChannel", "DIRECT");
|
||||||
|
parent.put("currency", "CNY");
|
||||||
|
parent.put("transAmount", mxData.getString("field0077"));
|
||||||
|
if(mainData.getString("field0100") != null && !"".equals(mainData.getString("field0100"))){
|
||||||
|
parent.put("payDate",sdf.format(mainData.getDate("field0100")));
|
||||||
|
}else {
|
||||||
|
parent.put("payDate", day);
|
||||||
|
}
|
||||||
|
parent.put("toPublic",false);
|
||||||
|
parent.put("recFinanceCode",getBankCode("false",mxData.getString("field0080"),mxData.getString("field0078")));
|
||||||
|
|
||||||
|
|
||||||
|
if (null != getBankCode("false",mxData.getString("field0080"),mxData.getString("field0078"))){
|
||||||
|
parent.put("recBankCode", null);
|
||||||
|
}
|
||||||
|
parent.put("purpose", mainData.getString("field0042"));
|
||||||
|
}
|
||||||
|
//资金归集
|
||||||
|
if("formmain_0362".equals(tableName)) {
|
||||||
|
parent.put("sourceFlowNumber", mxData.getString("id")+"_"+hour+minute);
|
||||||
|
parent.put("documentNo", mxData.getString("field0061"));
|
||||||
|
parent.put("companyCode", mainData.getString("field0037"));
|
||||||
|
parent.put("fundType", "0001");
|
||||||
|
parent.put("digest", "付资金归集"+mxData.getString("field0061"));
|
||||||
|
parent.put("payAccountNum", mxData.getString("field0008"));
|
||||||
|
parent.put("payAccountName", mxData.getString("field0003"));
|
||||||
|
parent.put("recAccountNum", mainData.getString("field0023"));
|
||||||
|
parent.put("recAccountName", mainData.getString("field0001"));
|
||||||
|
parent.put("recBankCode", mainData.getString("field0046"));
|
||||||
|
parent.put("settleAccountType", "CASH_TRANSFER");
|
||||||
|
parent.put("payChannel", "DIRECT");
|
||||||
|
parent.put("currency", "CNY");
|
||||||
|
parent.put("transAmount", mxData.getString("field0004"));
|
||||||
|
if(mainData.getString("field0056") != null && !"".equals(mainData.getString("field0056"))){
|
||||||
|
parent.put("payDate",sdf.format(mainData.getDate("field0056")));
|
||||||
|
}else {
|
||||||
|
parent.put("payDate", day);
|
||||||
|
}
|
||||||
|
parent.put("toPublic",true);
|
||||||
|
parent.put("purpose", mxData.getString("field0009"));
|
||||||
|
}
|
||||||
|
//资金拨付
|
||||||
|
if("formmain_0464".equals(tableName)) {
|
||||||
|
parent.put("sourceFlowNumber", mxData.getString("id")+"_"+hour+minute);
|
||||||
|
parent.put("documentNo", mxData.getString("field0060"));
|
||||||
|
parent.put("companyCode", mainData.getString("field0037"));
|
||||||
|
parent.put("fundType", "0001");
|
||||||
|
parent.put("digest", "付资金拨付"+mxData.getString("field0060"));
|
||||||
|
parent.put("payAccountNum", mainData.getString("field0023"));
|
||||||
|
parent.put("payAccountName", mainData.getString("field0001"));
|
||||||
|
parent.put("recAccountNum", mxData.getString("field0008"));
|
||||||
|
parent.put("recAccountName", mxData.getString("field0003"));
|
||||||
|
parent.put("recBankCode", mxData.getString("field0044"));
|
||||||
|
parent.put("settleAccountType", "CASH_TRANSFER");
|
||||||
|
parent.put("payChannel", "DIRECT");
|
||||||
|
parent.put("currency", "CNY");
|
||||||
|
parent.put("transAmount", mxData.getString("field0004"));
|
||||||
|
if(mainData.getString("field0055") != null && !"".equals(mainData.getString("field0055"))){
|
||||||
|
parent.put("payDate",sdf.format(mainData.getDate("field0055")));
|
||||||
|
}else {
|
||||||
|
parent.put("payDate", day);
|
||||||
|
}
|
||||||
|
parent.put("toPublic",true);
|
||||||
|
parent.put("purpose", mxData.getString("field0009"));
|
||||||
|
}
|
||||||
|
|
||||||
|
//同名账户划转
|
||||||
|
if("formmain_0467".equals(tableName)) {
|
||||||
|
parent.put("sourceFlowNumber", mxData.getString("id")+"_"+hour+minute);
|
||||||
|
parent.put("documentNo", mxData.getString("field0059"));
|
||||||
|
parent.put("companyCode", mxData.getString("field0038"));
|
||||||
|
parent.put("fundType", "0001");
|
||||||
|
parent.put("digest", "付同名账户划转"+mxData.getString("field0059"));
|
||||||
|
parent.put("payAccountNum", mxData.getString("field0016"));
|
||||||
|
parent.put("payAccountName", mainData.getString("field0021"));
|
||||||
|
parent.put("recAccountNum", mxData.getString("field0019"));
|
||||||
|
parent.put("recAccountName", mainData.getString("field0021"));
|
||||||
|
parent.put("recBankCode", mxData.getString("field0044"));
|
||||||
|
parent.put("settleAccountType", "CASH_TRANSFER");
|
||||||
|
parent.put("payChannel","DIRECT");
|
||||||
|
parent.put("currency", "CNY");
|
||||||
|
parent.put("transAmount", mxData.getString("field0020"));
|
||||||
|
if(mainData.getString("field0054") != null && !"".equals(mainData.getString("field0054"))){
|
||||||
|
parent.put("payDate",sdf.format(mainData.getDate("field0054")));
|
||||||
|
}else {
|
||||||
|
parent.put("payDate", day);
|
||||||
|
}
|
||||||
|
parent.put("toPublic",true);
|
||||||
|
parent.put("purpose", mxData.getString("field0035"));
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject bodys = new JSONObject();
|
||||||
|
bodys.put("data",parent);
|
||||||
|
String params = bodys.toJSONString();
|
||||||
|
SM2Util sm2Util=new SM2Util();
|
||||||
|
String encrypt = sm2Util.encrypt(params, publicKey);
|
||||||
|
JSONObject zx = new JSONObject();
|
||||||
|
zx.put("data",encrypt);
|
||||||
|
return zx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取银行编码
|
||||||
|
* @param toPublic 对公/对私标记("true"表示对公,"false"表示对私)
|
||||||
|
* @param recBankName 收款银行名称
|
||||||
|
* @param payBankName 付款银行名称(原SQL中的PayBanmName应为笔误)
|
||||||
|
* @return 对应的银行编码,不满足条件时返回null
|
||||||
|
*/
|
||||||
|
public static String getBankCode(String toPublic, String recBankName, String payBankName) {
|
||||||
|
// 处理参数为空的情况
|
||||||
|
String trimmedToPublic = toPublic == null ? "" : toPublic.trim().toUpperCase();
|
||||||
|
String trimmedPayBankName = payBankName == null ? "" : payBankName.trim();
|
||||||
|
|
||||||
|
// 检查是否为对私账户且付款银行为中信银行
|
||||||
|
if ("FALSE".equals(trimmedToPublic) && trimmedPayBankName.contains("中信")) {
|
||||||
|
// 处理收款银行名称(去除前后空格)
|
||||||
|
String trimmedRecBankName = recBankName == null ? "" : recBankName.trim();
|
||||||
|
|
||||||
|
// 根据收款银行名称匹配对应的银行编码
|
||||||
|
if (trimmedRecBankName.contains("工商") || trimmedRecBankName.contains("工行")) {
|
||||||
|
return "ICBC";
|
||||||
|
} else if (trimmedRecBankName.contains("农业")) {
|
||||||
|
return "ABC";
|
||||||
|
} else if (trimmedRecBankName.contains("中国银行") || trimmedRecBankName.contains("中行")) {
|
||||||
|
return "BOC";
|
||||||
|
} else if (trimmedRecBankName.contains("建设") || trimmedRecBankName.contains("建行")) {
|
||||||
|
return "CCB";
|
||||||
|
} else if (trimmedRecBankName.contains("交通") || trimmedRecBankName.contains("交行")) {
|
||||||
|
return "BCM";
|
||||||
|
} else if (trimmedRecBankName.contains("邮政") || trimmedRecBankName.contains("邮储")) {
|
||||||
|
return "PSBC";
|
||||||
|
} else if (trimmedRecBankName.contains("中信")) {
|
||||||
|
return "CITIC";
|
||||||
|
} else if (trimmedRecBankName.contains("光大")) {
|
||||||
|
return "CEB";
|
||||||
|
} else if (trimmedRecBankName.contains("民生")) {
|
||||||
|
return "CMBC";
|
||||||
|
} else if (trimmedRecBankName.contains("广发")) {
|
||||||
|
return "CGB";
|
||||||
|
} else if (trimmedRecBankName.contains("平安")) {
|
||||||
|
return "PAB";
|
||||||
|
} else if (trimmedRecBankName.contains("招商") || trimmedRecBankName.contains("招行")) {
|
||||||
|
return "CMB";
|
||||||
|
} else if (trimmedRecBankName.contains("兴业")) {
|
||||||
|
return "CIB";
|
||||||
|
} else if (trimmedRecBankName.contains("浦发") || trimmedRecBankName.contains("浦东发展")) {
|
||||||
|
return "SPDB";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 不满足条件时返回null
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue