Compare commits
12 Commits
a8400abac1
...
cbc9cb8b93
Author | SHA1 | Date |
---|---|---|
|
cbc9cb8b93 | |
|
486805c35a | |
|
d8d985df8e | |
|
304eb8061a | |
|
cb503948d4 | |
|
e905df8793 | |
|
4eedded2b2 | |
|
a75e1404e9 | |
|
259120d74a | |
|
e455db28a7 | |
|
8a8ea77895 | |
|
498f547ca0 |
|
@ -0,0 +1,20 @@
|
||||||
|
package com.hzya.frame.plugin.ht.dao;
|
||||||
|
|
||||||
|
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.BipProjectEntity;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.FundsAllocationEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description bip项目传递oa
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2025/6/21 14:23
|
||||||
|
**/
|
||||||
|
public interface IBipProjectDao extends IBaseDao<BipProjectEntity,String> {
|
||||||
|
List<BipProjectEntity> getBipProject(BipProjectEntity bipProjectEntity);
|
||||||
|
|
||||||
|
List<BipProjectEntity> getOaData(BipProjectEntity oadata);
|
||||||
|
|
||||||
|
int updateOaData(BipProjectEntity updateData);
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.hzya.frame.plugin.ht.dao;
|
||||||
|
|
||||||
|
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.BipProjectEntity;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.InvoiceDistributeEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IInvoiceDistributeDao extends IBaseDao<InvoiceDistributeEntity,String> {
|
||||||
|
|
||||||
|
int updataStatus(InvoiceDistributeEntity invoiceDistributeEntity);
|
||||||
|
|
||||||
|
List<InvoiceDistributeEntity> queryOrgerManber(InvoiceDistributeEntity applyPerson);
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.hzya.frame.plugin.ht.dao;
|
||||||
|
|
||||||
|
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.BipProjectEntity;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.StopAffairEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2025/6/21 14:23
|
||||||
|
**/
|
||||||
|
public interface IStopAffairDao extends IBaseDao<StopAffairEntity,String> {
|
||||||
|
List<StopAffairEntity> getStopAffair(StopAffairEntity entity);
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.hzya.frame.plugin.ht.dao.impl;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||||
|
import com.hzya.frame.plugin.ht.dao.IBipProjectDao;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.BipProjectEntity;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description bip项目传递oa
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2025/6/21 14:24
|
||||||
|
**/
|
||||||
|
@Repository(value = "bipProjectDaoImpl")
|
||||||
|
public class BipProjectDaoImpl extends MybatisGenericDao<BipProjectEntity,String> implements IBipProjectDao {
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public List<BipProjectEntity> getBipProject(BipProjectEntity entity) {
|
||||||
|
return super.query(getSqlIdPrifx() + "getBipProject",entity);
|
||||||
|
}
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public List<BipProjectEntity> getOaData(BipProjectEntity entity) {
|
||||||
|
return super.query(getSqlIdPrifx() + "getOaData",entity);
|
||||||
|
|
||||||
|
}
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public int updateOaData(BipProjectEntity entity) {
|
||||||
|
return super.update(getSqlIdPrifx() + "updateOaData",entity);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.hzya.frame.plugin.ht.dao.impl;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||||
|
import com.hzya.frame.plugin.ht.dao.IInvoiceDistributeDao;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.InvoiceDistributeEntity;
|
||||||
|
import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Repository(value = "invoiceDistributeDaoImpl")
|
||||||
|
public class InvoiceDistributeDaoImpl extends MybatisGenericDao<InvoiceDistributeEntity,String> implements IInvoiceDistributeDao {
|
||||||
|
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public int updataStatus(InvoiceDistributeEntity entity) {
|
||||||
|
return super.update(getSqlIdPrifx()+"updataStatus",entity);
|
||||||
|
}
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public List<InvoiceDistributeEntity> queryOrgerManber(InvoiceDistributeEntity entity) {
|
||||||
|
return super.query(getSqlIdPrifx()+"queryOrgerManber",entity);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.hzya.frame.plugin.ht.dao.impl;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||||
|
import com.hzya.frame.plugin.ht.dao.IBipProjectDao;
|
||||||
|
import com.hzya.frame.plugin.ht.dao.IStopAffairDao;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.BipProjectEntity;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.StopAffairEntity;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2025/6/21 14:24
|
||||||
|
**/
|
||||||
|
@Repository(value = "stopAffairDaoImpl")
|
||||||
|
public class StopAffairDaoImpl extends MybatisGenericDao<StopAffairEntity,String> implements IStopAffairDao {
|
||||||
|
|
||||||
|
@DS("#entity.dataSourceCode")
|
||||||
|
@Override
|
||||||
|
public List<StopAffairEntity> getStopAffair(StopAffairEntity entity) {
|
||||||
|
return super.query(getSqlIdPrifx() + "getStopAffair",entity);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
package com.hzya.frame.plugin.ht.entity;
|
||||||
|
|
||||||
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description bip项目传递oa
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2025/6/21 14:19
|
||||||
|
**/
|
||||||
|
public class BipProjectEntity extends BaseEntity {
|
||||||
|
|
||||||
|
private String field0001;
|
||||||
|
private String field0002;
|
||||||
|
private String field0003;
|
||||||
|
private String field0004;
|
||||||
|
private String startTime;
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
public String getField0001() {
|
||||||
|
return field0001;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setField0001(String field0001) {
|
||||||
|
this.field0001 = field0001;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getField0002() {
|
||||||
|
return field0002;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setField0002(String field0002) {
|
||||||
|
this.field0002 = field0002;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getField0003() {
|
||||||
|
return field0003;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setField0003(String field0003) {
|
||||||
|
this.field0003 = field0003;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getField0004() {
|
||||||
|
return field0004;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setField0004(String field0004) {
|
||||||
|
this.field0004 = field0004;
|
||||||
|
}
|
||||||
|
|
||||||
|
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,46 @@
|
||||||
|
<?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.BipProjectDaoImpl">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getBipProject" resultType="com.hzya.frame.plugin.ht.entity.BipProjectEntity"
|
||||||
|
parameterType="com.hzya.frame.plugin.ht.entity.BipProjectEntity">
|
||||||
|
SELECT
|
||||||
|
project_code as field0001,
|
||||||
|
REPLACE(project_name, '~', '') as field0002,
|
||||||
|
REPLACE(def2, '~', '') as field0003,
|
||||||
|
REPLACE(def3, '~', '') as field0004,
|
||||||
|
ts
|
||||||
|
FROM
|
||||||
|
BD_PROJECT
|
||||||
|
<trim prefix="where" prefixOverrides="and">
|
||||||
|
<if test="startTime != null and startTime != ''">and ts >= #{startTime}</if>
|
||||||
|
<if test="endTime != null and endTime != ''">and ts <= #{endTime}</if>
|
||||||
|
</trim>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getOaData" resultType="com.hzya.frame.plugin.ht.entity.BipProjectEntity"
|
||||||
|
parameterType="com.hzya.frame.plugin.ht.entity.BipProjectEntity">
|
||||||
|
SELECT
|
||||||
|
field0001 as field0001,
|
||||||
|
field0002 as field0002,
|
||||||
|
field0003 as field0003,
|
||||||
|
field0004 as field0004
|
||||||
|
FROM
|
||||||
|
formmain_0730
|
||||||
|
<trim prefix="where" prefixOverrides="and">
|
||||||
|
<if test="field0001 != null and field0001 != ''">and field0001 = #{field0001}</if>
|
||||||
|
</trim>
|
||||||
|
</select>
|
||||||
|
<update id="updateOaData" parameterType="com.hzya.frame.plugin.ht.entity.BipProjectEntity">
|
||||||
|
update formmain_0730 set
|
||||||
|
<trim suffix="" suffixOverrides=",">
|
||||||
|
<if test="field0001 != null and field0001 !='' ">field0001 = #{field0001},</if>
|
||||||
|
<if test="field0002 != null and field0002 !='' ">field0002 = #{field0002},</if>
|
||||||
|
<if test="field0003 != null and field0003 !='' ">field0003 = #{field0003},</if>
|
||||||
|
<if test="field0004 != null and field0004 !='' ">field0004 = #{field0004},</if>
|
||||||
|
</trim>
|
||||||
|
where field0001 = #{field0001}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.hzya.frame.plugin.ht.entity;
|
||||||
|
|
||||||
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
|
|
||||||
|
public class InvoiceDistributeEntity extends BaseEntity {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String field0206;//推送标识
|
||||||
|
private String field0215;//开票结果
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getField0206() {
|
||||||
|
return field0206;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setField0206(String field0206) {
|
||||||
|
this.field0206 = field0206;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getField0215() {
|
||||||
|
return field0215;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setField0215(String field0215) {
|
||||||
|
this.field0215 = field0215;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?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.InvoiceDistributeDaoImpl">
|
||||||
|
|
||||||
|
<update id="updataStatus" parameterType = "com.hzya.frame.plugin.ht.entity.InvoiceDistributeEntity" >
|
||||||
|
update formmain_0331 set
|
||||||
|
<trim suffix="" suffixOverrides=",">
|
||||||
|
<if test="field0206 != null and field0206 != ''"> field0206 = #{field0206},</if>
|
||||||
|
<if test="field0215 != null and field0215 != ''"> field0215 = #{field0215},</if>
|
||||||
|
</trim>
|
||||||
|
where id=#{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="queryOrgerManber" resultType="com.hzya.frame.plugin.ht.entity.InvoiceDistributeEntity"
|
||||||
|
parameterType="com.hzya.frame.plugin.ht.entity.InvoiceDistributeEntity">
|
||||||
|
select
|
||||||
|
name
|
||||||
|
from org_member
|
||||||
|
<trim prefix="where" prefixOverrides="and">
|
||||||
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
|
</trim>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.hzya.frame.plugin.ht.entity;
|
||||||
|
|
||||||
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2025/6/21 14:19
|
||||||
|
**/
|
||||||
|
public class StopAffairEntity extends BaseEntity {
|
||||||
|
|
||||||
|
private String colSummaryId;//流程id
|
||||||
|
private String ctpAffairId;//待办id
|
||||||
|
private String loginName;//登陆人
|
||||||
|
private String workitemId;//流程处理和回退要用这个id
|
||||||
|
private String dataTime;//日期
|
||||||
|
|
||||||
|
public String getColSummaryId() {
|
||||||
|
return colSummaryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColSummaryId(String colSummaryId) {
|
||||||
|
this.colSummaryId = colSummaryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCtpAffairId() {
|
||||||
|
return ctpAffairId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCtpAffairId(String ctpAffairId) {
|
||||||
|
this.ctpAffairId = ctpAffairId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLoginName() {
|
||||||
|
return loginName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoginName(String loginName) {
|
||||||
|
this.loginName = loginName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWorkitemId() {
|
||||||
|
return workitemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkitemId(String workitemId) {
|
||||||
|
this.workitemId = workitemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataTime() {
|
||||||
|
return dataTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataTime(String dataTime) {
|
||||||
|
this.dataTime = dataTime;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?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.StopAffairDaoImpl">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getStopAffair" resultType="com.hzya.frame.plugin.ht.entity.StopAffairEntity"
|
||||||
|
parameterType="com.hzya.frame.plugin.ht.entity.StopAffairEntity">
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
COL_SUMMARY.id as colSummaryId,-- 流程id
|
||||||
|
CTP_AFFAIR.id as ctpAffairId,-- 待办id
|
||||||
|
v_user_view_all.loginName as loginName,
|
||||||
|
CTP_AFFAIR.SUB_OBJECT_ID as workitemId -- 流程处理和回退要用这个id
|
||||||
|
from
|
||||||
|
formmain_0362
|
||||||
|
LEFT JOIN COL_SUMMARY on COL_SUMMARY.FORM_RECORDID = formmain_0362.id
|
||||||
|
LEFT JOIN CTP_AFFAIR on CTP_AFFAIR.OBJECT_ID = COL_SUMMARY.id
|
||||||
|
LEFT JOIN v_user_view_all on v_user_view_all.id = CTP_AFFAIR.MEMBER_ID
|
||||||
|
where
|
||||||
|
formmain_0362.finishedflag != '1' and formmain_0362.field0062 is not null
|
||||||
|
and CTP_AFFAIR.SUB_OBJECT_ID is not null and CTP_AFFAIR.STATE = '3'
|
||||||
|
and FORMAT(formmain_0362.start_date, 'yyyy-MM-dd') = #{dataTime}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,103 @@
|
||||||
|
package com.hzya.frame.plugin.ht.plugin;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
|
import com.hzya.frame.plugin.ht.service.IBipProjectService;
|
||||||
|
import com.hzya.frame.plugin.ht.service.IFundsAllocationPluginService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description bip项目传递oa
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2025/6/21 14:06
|
||||||
|
**/
|
||||||
|
public class BipProjectPluginInitializer extends PluginBaseEntity {
|
||||||
|
Logger logger = LoggerFactory.getLogger(BipProjectPluginInitializer.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBipProjectService bipProjectService;
|
||||||
|
/***
|
||||||
|
* 插件初始化方法
|
||||||
|
* @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 "BipProjectPlugin";
|
||||||
|
}
|
||||||
|
|
||||||
|
/****
|
||||||
|
* 插件的名称
|
||||||
|
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||||
|
* @date 2023-08-02 10:48
|
||||||
|
* @return void
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public String getPluginName() {
|
||||||
|
return "bip项目传递oa";
|
||||||
|
}
|
||||||
|
|
||||||
|
/****
|
||||||
|
* 插件的显示值
|
||||||
|
* @author 👻👻👻👻👻👻👻👻 gjh
|
||||||
|
* @date 2023-08-02 10:48
|
||||||
|
* @return void
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public String getPluginLabel() {
|
||||||
|
return "bip项目传递oa";
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 插件类型 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("======开始执行bip项目传递oa插件========");
|
||||||
|
return bipProjectService.sendBipProject(requestJson);
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,6 +24,7 @@ import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity;
|
||||||
import com.hzya.frame.mdm.service.IMdmServiceCache;
|
import com.hzya.frame.mdm.service.IMdmServiceCache;
|
||||||
import com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity;
|
import com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity;
|
||||||
import com.hzya.frame.plugin.ht.service.IApplyInvoiceService;
|
import com.hzya.frame.plugin.ht.service.IApplyInvoiceService;
|
||||||
|
import com.hzya.frame.plugin.ht.service.IInvoiceDistributeService;
|
||||||
import com.hzya.frame.seeyon.invoice.dao.IInvoiceDao;
|
import com.hzya.frame.seeyon.invoice.dao.IInvoiceDao;
|
||||||
import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity;
|
import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity;
|
||||||
import com.hzya.frame.sys.sysenum.SysEnum;
|
import com.hzya.frame.sys.sysenum.SysEnum;
|
||||||
|
@ -63,6 +64,8 @@ import java.util.*;
|
||||||
public class InvoiceDistributePluginInitializer extends PluginBaseEntity {
|
public class InvoiceDistributePluginInitializer extends PluginBaseEntity {
|
||||||
Logger logger = LoggerFactory.getLogger(getClass());
|
Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IInvoiceDistributeService iInvoiceDistributeService;
|
||||||
@Resource
|
@Resource
|
||||||
private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao;
|
private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao;
|
||||||
@Resource
|
@Resource
|
||||||
|
@ -173,6 +176,22 @@ public class InvoiceDistributePluginInitializer extends PluginBaseEntity {
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||||
|
try {
|
||||||
|
logger.info("======开始执行开票申请(中台蓝字,红字推送有度)同步========");
|
||||||
|
return iInvoiceDistributeService.sendInvoiceDistribute(requestJson);
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.info("======执行开票申请(中台蓝字,红字推送有度)同步失败:{}========",e.getMessage());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
/***
|
||||||
|
* 执行业务代码
|
||||||
|
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||||
|
* @Date 2023-08-07 11:20
|
||||||
|
* @param requestJson 执行业务代码的参数
|
||||||
|
* @return void
|
||||||
|
**/
|
||||||
|
public JsonResultEntity executeBusiness1(JSONObject requestJson) throws Exception {
|
||||||
try{
|
try{
|
||||||
//重试方法
|
//重试方法
|
||||||
if (null != requestJson) {
|
if (null != requestJson) {
|
||||||
|
@ -1230,7 +1249,7 @@ public class InvoiceDistributePluginInitializer extends PluginBaseEntity {
|
||||||
*/
|
*/
|
||||||
private void updateOAForm(JsonResultEntity jsonResultEntity, JSONObject data) {
|
private void updateOAForm(JsonResultEntity jsonResultEntity, JSONObject data) {
|
||||||
try {
|
try {
|
||||||
logger.info("d准备更新开票结果到OA单ata_id:{}",data.getString("data_id"));
|
logger.info("准备更新开票结果到OA单data_id:{}",data.getString("data_id"));
|
||||||
if (null != jsonResultEntity && null != data && StrUtil.isNotEmpty(data.getString("data_id"))){
|
if (null != jsonResultEntity && null != data && StrUtil.isNotEmpty(data.getString("data_id"))){
|
||||||
String data_id = data.getString("data_id");
|
String data_id = data.getString("data_id");
|
||||||
String attrStr = jsonResultEntity.getAttribute().toString();
|
String attrStr = jsonResultEntity.getAttribute().toString();
|
||||||
|
|
|
@ -0,0 +1,105 @@
|
||||||
|
package com.hzya.frame.plugin.ht.plugin;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
|
import com.hzya.frame.plugin.ht.service.IFundsAllocationPluginService;
|
||||||
|
import com.hzya.frame.plugin.ht.service.IStopAffairService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 资金归集流程终止
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2025/6/21 14:06
|
||||||
|
**/
|
||||||
|
public class StopAffairPluginInitializer extends PluginBaseEntity {
|
||||||
|
Logger logger = LoggerFactory.getLogger(StopAffairPluginInitializer.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStopAffairService stopAffairService;
|
||||||
|
/***
|
||||||
|
* 插件初始化方法
|
||||||
|
* @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 "StopAffairPlugin";
|
||||||
|
}
|
||||||
|
|
||||||
|
/****
|
||||||
|
* 插件的名称
|
||||||
|
* @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("======开始执行资金归集流程终止========");
|
||||||
|
stopAffairService.sendStopAffair(requestJson);
|
||||||
|
logger.info("======结束资金归集流程终止========");
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.hzya.frame.plugin.ht.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.basedao.service.IBaseService;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.BipProjectEntity;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.FundsAllocationEntity;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description bip项目传递oa
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2025/6/21 15:01
|
||||||
|
**/
|
||||||
|
public interface IBipProjectService extends IBaseService<BipProjectEntity,String> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description bip项目传递oa
|
||||||
|
* @Date 2:51 下午 2025/8/11
|
||||||
|
* @param requestJson
|
||||||
|
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||||
|
**/
|
||||||
|
JsonResultEntity sendBipProject(JSONObject requestJson);
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.hzya.frame.plugin.ht.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.basedao.service.IBaseService;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.InvoiceDistributeEntity;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
|
||||||
|
public interface IInvoiceDistributeService extends IBaseService<InvoiceDistributeEntity,String> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 开票申请(中台蓝字,红字推送有度)同步
|
||||||
|
* @Date 10:47 上午 2025/9/3
|
||||||
|
* @param requestJson
|
||||||
|
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||||
|
**/
|
||||||
|
JsonResultEntity sendInvoiceDistribute(JSONObject requestJson);
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.hzya.frame.plugin.ht.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.basedao.service.IBaseService;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.BipProjectEntity;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.StopAffairEntity;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 资金归集流程终止
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2025/6/21 15:01
|
||||||
|
**/
|
||||||
|
public interface IStopAffairService extends IBaseService<StopAffairEntity,String> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 资金归集流程终止
|
||||||
|
* @Date 2:51 下午 2025/8/11
|
||||||
|
* @param requestJson
|
||||||
|
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||||
|
**/
|
||||||
|
JsonResultEntity sendStopAffair(JSONObject requestJson);
|
||||||
|
}
|
|
@ -0,0 +1,226 @@
|
||||||
|
package com.hzya.frame.plugin.ht.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
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.IBipProjectDao;
|
||||||
|
import com.hzya.frame.plugin.ht.dao.IFundsAllocationDao;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.BipProjectEntity;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.FundsAllocationEntity;
|
||||||
|
import com.hzya.frame.plugin.ht.service.IBipProjectService;
|
||||||
|
import com.hzya.frame.plugin.ht.service.IFundsAllocationService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description bip项目传递oa
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2025/6/21 15:03
|
||||||
|
**/
|
||||||
|
@Service(value = "bipProjectServiceImpl")
|
||||||
|
public class BipProjectServiceImpl extends BaseService<BipProjectEntity, String> implements IBipProjectService {
|
||||||
|
|
||||||
|
private IBipProjectDao bipProjectDao;
|
||||||
|
@Value("${zt.url}")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
private static final Random random = new Random();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public void setBipProjectDao(IBipProjectDao dao) {
|
||||||
|
this.bipProjectDao = dao;
|
||||||
|
this.dao = dao;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param requestJson
|
||||||
|
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description bip项目传递oa
|
||||||
|
* @Date 2:51 下午 2025/8/11
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public JsonResultEntity sendBipProject(JSONObject requestJson) {
|
||||||
|
|
||||||
|
logger.error("bip项目传递oa入参"+requestJson.toJSONString());
|
||||||
|
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");//定时任务执行时传入的结束时间
|
||||||
|
|
||||||
|
BipProjectEntity bipProjectEntity = new BipProjectEntity();
|
||||||
|
bipProjectEntity.setDataSourceCode("htBip");
|
||||||
|
bipProjectEntity.setStartTime(startTime);
|
||||||
|
bipProjectEntity.setEndTime(endTime);
|
||||||
|
List<BipProjectEntity> bipProjectEntityList = bipProjectDao.getBipProject(bipProjectEntity);
|
||||||
|
logger.error("bip查询最新的项目返回"+bipProjectEntityList.size());
|
||||||
|
|
||||||
|
if(bipProjectEntityList != null && bipProjectEntityList.size() > 0){
|
||||||
|
for (int i = 0; i < bipProjectEntityList.size(); i++) {
|
||||||
|
//查询是否有存在数据
|
||||||
|
BipProjectEntity oadata = new BipProjectEntity();
|
||||||
|
oadata.setDataSourceCode("HT-OA");
|
||||||
|
oadata.setField0001(bipProjectEntityList.get(i).getField0001());
|
||||||
|
logger.error("bip查询是否存在项目"+bipProjectEntityList.get(i).getField0001());
|
||||||
|
|
||||||
|
List<BipProjectEntity> oaList = bipProjectDao.getOaData(oadata);
|
||||||
|
logger.error("bip查询是否存在项目返回"+oaList.size());
|
||||||
|
|
||||||
|
if(oaList != null && oaList.size() > 0){
|
||||||
|
if(oaList.size() == 1){
|
||||||
|
//修改数据
|
||||||
|
BipProjectEntity updateData = new BipProjectEntity();
|
||||||
|
updateData.setDataSourceCode("HT-OA");
|
||||||
|
updateData.setField0001(bipProjectEntityList.get(i).getField0001());
|
||||||
|
updateData.setField0002(bipProjectEntityList.get(i).getField0002());
|
||||||
|
updateData.setField0003(bipProjectEntityList.get(i).getField0003());
|
||||||
|
updateData.setField0004(bipProjectEntityList.get(i).getField0004());
|
||||||
|
bipProjectDao.updateOaData(updateData);
|
||||||
|
}else {
|
||||||
|
logger.error("根据"+bipProjectEntityList.get(i).getField0001()+"项目编码,获取OA项目编码存在多个,请联系管理员");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
//新增
|
||||||
|
//获取token
|
||||||
|
logger.error("bip项目获取token");
|
||||||
|
|
||||||
|
String token = getToken();
|
||||||
|
logger.error("bip项目获取token"+token);
|
||||||
|
|
||||||
|
//组装数据
|
||||||
|
String sendData = getSendData(bipProjectEntityList.get(i));
|
||||||
|
logger.error("bip项目无流程表单发送数据"+sendData);
|
||||||
|
|
||||||
|
String result = HttpRequest.post(url)
|
||||||
|
.header("appId", "800059")
|
||||||
|
.header("apiCode", "8000590012")
|
||||||
|
.header("token", token)
|
||||||
|
.header("publicKey", "ZJYAVJ/+Tb3icrp2wpcI/85OZ2BilQRX54aDI3vRjQZkHABCe7eDIk+3zDUT+v578prj")//OA公钥
|
||||||
|
.header("secretKey", "IA/w5YOFCFQVHBsbyjL2D7DAQnOEOFd1ZvcFkCqCTgCheYBevXC7hZOd0OUhGcHdj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//OA密钥
|
||||||
|
.body(sendData)//表单内容
|
||||||
|
.timeout(30000)//超时,毫秒
|
||||||
|
.execute().body();
|
||||||
|
logger.error("bip项目Oa无流程表单返回报文:{}",result);
|
||||||
|
if (StrUtil.isNotEmpty(result)){
|
||||||
|
JSONObject tokenObj = JSONObject.parseObject(result);
|
||||||
|
String code = tokenObj.getString("status");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getSendData(BipProjectEntity entity) {
|
||||||
|
JSONObject sendData = new JSONObject();
|
||||||
|
|
||||||
|
// 添加顶层基本字段
|
||||||
|
sendData.put("formCode", "formmain_0730");
|
||||||
|
sendData.put("loginName", "hzya");
|
||||||
|
sendData.put("rightId", "-5289104417975482331.5120195071596839780");
|
||||||
|
sendData.put("doTrigger", true);
|
||||||
|
|
||||||
|
// 创建dataList数组
|
||||||
|
JSONArray dataList = new JSONArray();
|
||||||
|
|
||||||
|
// 创建数组中的对象
|
||||||
|
JSONObject dataItem = new JSONObject();
|
||||||
|
|
||||||
|
// 创建masterTable对象
|
||||||
|
JSONObject masterTable = new JSONObject();
|
||||||
|
masterTable.put("name", "formmain_0730");
|
||||||
|
|
||||||
|
// 创建record对象
|
||||||
|
JSONObject record = new JSONObject();
|
||||||
|
record.put("id", random.nextLong());
|
||||||
|
|
||||||
|
// 创建fields数组并添加字段对象
|
||||||
|
JSONArray fields = new JSONArray();
|
||||||
|
|
||||||
|
// 添加field0001
|
||||||
|
JSONObject field1 = new JSONObject();
|
||||||
|
field1.put("name", "field0001");
|
||||||
|
field1.put("value", entity.getField0001());
|
||||||
|
field1.put("showValue", "");
|
||||||
|
fields.add(field1);
|
||||||
|
|
||||||
|
// 添加field0002
|
||||||
|
JSONObject field2 = new JSONObject();
|
||||||
|
field2.put("name", "field0002");
|
||||||
|
field2.put("value", entity.getField0002());
|
||||||
|
field2.put("showValue", "");
|
||||||
|
fields.add(field2);
|
||||||
|
|
||||||
|
// 添加field0003
|
||||||
|
JSONObject field3 = new JSONObject();
|
||||||
|
field3.put("name", "field0003");
|
||||||
|
field3.put("value", entity.getField0003());
|
||||||
|
field3.put("showValue", "");
|
||||||
|
fields.add(field3);
|
||||||
|
|
||||||
|
// 添加field0004
|
||||||
|
JSONObject field4 = new JSONObject();
|
||||||
|
field4.put("name", "field0004");
|
||||||
|
field4.put("value", entity.getField0004());
|
||||||
|
field4.put("showValue", "");
|
||||||
|
fields.add(field4);
|
||||||
|
|
||||||
|
// 将fields数组放入record
|
||||||
|
record.put("fields", fields);
|
||||||
|
|
||||||
|
// 将record放入masterTable
|
||||||
|
masterTable.put("record", record);
|
||||||
|
|
||||||
|
// 将masterTable放入dataItem
|
||||||
|
dataItem.put("masterTable", masterTable);
|
||||||
|
|
||||||
|
// 将dataItem放入dataList数组
|
||||||
|
dataList.add(dataItem);
|
||||||
|
|
||||||
|
// 将dataList放入最外层对象
|
||||||
|
sendData.put("dataList", dataList);
|
||||||
|
|
||||||
|
|
||||||
|
return sendData.toJSONString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getToken() {
|
||||||
|
String token = null;
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
// 向JSON对象中添加键值对
|
||||||
|
param.put("password", "b19afb1a-5a72-43db-84e1-e84aa4c571b5");
|
||||||
|
param.put("userName", "YDRest");
|
||||||
|
param.put("loginName", "13868833280");
|
||||||
|
|
||||||
|
String result = HttpRequest.post(url)
|
||||||
|
.header("appId", "800059")
|
||||||
|
.header("apiCode", "8000590001")
|
||||||
|
.header("publicKey", "ZJYAVJ/+Tb3icrp2wpcI/85OZ2BilQRX54aDI3vRjQZkHABCe7eDIk+3zDUT+v578prj")//OA公钥
|
||||||
|
.header("secretKey", "IA/w5YOFCFQVHBsbyjL2D7DAQnOEOFd1ZvcFkCqCTgCheYBevXC7hZOd0OUhGcHdj3JzOP8MtA1LSGvL+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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,467 @@
|
||||||
|
package com.hzya.frame.plugin.ht.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||||
|
import com.hzya.frame.plugin.ht.dao.IInvoiceDistributeDao;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.InvoiceDistributeEntity;
|
||||||
|
import com.hzya.frame.plugin.ht.service.IInvoiceDistributeService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
@Service(value = "invoiceDistributeServiceImpl")
|
||||||
|
public class InvoiceDistributeServiceImpl extends BaseService<InvoiceDistributeEntity, String> implements IInvoiceDistributeService {
|
||||||
|
|
||||||
|
private IInvoiceDistributeDao iInvoiceDistributeDao;
|
||||||
|
@Value("${zt.url}")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public void setInvoiceDistributeDao(IInvoiceDistributeDao dao) {
|
||||||
|
this.iInvoiceDistributeDao = dao;
|
||||||
|
this.dao = dao;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param requestJson
|
||||||
|
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 开票申请(中台蓝字 , 红字推送有度)同步
|
||||||
|
* @Date 10:47 上午 2025/9/3
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public JsonResultEntity sendInvoiceDistribute(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("系统错误");
|
||||||
|
}
|
||||||
|
JSONObject mainData = businessDataStr.getJSONObject("formmain_0331");
|
||||||
|
if (mainData == null) {
|
||||||
|
return BaseResult.getFailureMessageEntity("系统错误");
|
||||||
|
}
|
||||||
|
JSONArray formson_0700 = businessDataStr.getJSONArray("formson_0700");
|
||||||
|
JSONArray formson_0332 = businessDataStr.getJSONArray("formson_0332");
|
||||||
|
|
||||||
|
//组装发送数据
|
||||||
|
JSONObject sendData = null;
|
||||||
|
try {
|
||||||
|
if (mainData.getString("field0154") != null) {
|
||||||
|
if ("-6698829233380899499".equals(mainData.getString("field0154"))) {//是否红冲 否
|
||||||
|
sendData = getlzfpsqdsqSendData(mainData, formson_0700, formson_0332); //蓝字发票申请单申请
|
||||||
|
}
|
||||||
|
if ("-8073674727882144390".equals(mainData.getString("field0154"))) {//是否红冲 是
|
||||||
|
if (mainData.getString("field0165") != null) {
|
||||||
|
if ("-1414365591115381033".equals(mainData.getString("field0165"))) { //销方
|
||||||
|
sendData = gethzxxbsqdsqSendData(mainData, formson_0700, formson_0332);//红字信息表申请单申请
|
||||||
|
}
|
||||||
|
if ("3075360049544777325".equals(mainData.getString("field0165"))) { //购方
|
||||||
|
sendData = gethzfpsqdsqSendData(mainData, formson_0700, formson_0332);//红字发票申请单申请
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error("推送开票申请失败:组装数据失败:" + e.getMessage());
|
||||||
|
return BaseResult.getFailureMessageEntity("推送开票申请失败:组装数据失败");
|
||||||
|
}
|
||||||
|
if (sendData == null) {
|
||||||
|
logger.error("推送开票申请结束,该数据不需要推送");
|
||||||
|
return BaseResult.getSuccessMessageEntity("推送开票申请结束,该数据不需要推送");
|
||||||
|
}
|
||||||
|
//发送数据
|
||||||
|
logger.error("推送开票申请推送:" + sendData.toJSONString());
|
||||||
|
String resultData = null;
|
||||||
|
if (mainData.getString("field0154") != null) {
|
||||||
|
if ("-6698829233380899499".equals(mainData.getString("field0154"))) {//是否红冲 否
|
||||||
|
//蓝字发票申请单申请
|
||||||
|
resultData = HttpRequest.post(url).
|
||||||
|
header("appId", "800060").
|
||||||
|
header("apiCode", "8000600000").
|
||||||
|
header("publicKey", "ZJYA7f8FzV219otH8zhkReiyyWpXswpbY/+StvC2em0hf59Ce7eDIk+3zDUT+v578prj").
|
||||||
|
header("secretKey", "xJ9J1Ev2F0faiJ/nQnCNklskAgtQp3QSm+ihO21uY/H0UADj0tSDPxmIhFfC4v6Fj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
|
||||||
|
body(sendData.toJSONString()).
|
||||||
|
execute().
|
||||||
|
body();
|
||||||
|
}
|
||||||
|
if ("-8073674727882144390".equals(mainData.getString("field0154"))) {//是否红冲 是
|
||||||
|
|
||||||
|
if (mainData.getString("field0165") != null) {
|
||||||
|
if ("-1414365591115381033".equals(mainData.getString("field0165"))) { //销方
|
||||||
|
//红字信息表申请单申请
|
||||||
|
resultData = HttpRequest.post(url).
|
||||||
|
header("appId", "800060").
|
||||||
|
header("apiCode", "8000600001").
|
||||||
|
header("publicKey", "ZJYA7f8FzV219otH8zhkReiyyWpXswpbY/+StvC2em0hf59Ce7eDIk+3zDUT+v578prj").
|
||||||
|
header("secretKey", "xJ9J1Ev2F0faiJ/nQnCNklskAgtQp3QSm+ihO21uY/H0UADj0tSDPxmIhFfC4v6Fj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
|
||||||
|
body(sendData.toJSONString()).
|
||||||
|
execute().
|
||||||
|
body();
|
||||||
|
}
|
||||||
|
if ("3075360049544777325".equals(mainData.getString("field0165"))) { //购方
|
||||||
|
//红字发票申请单申请
|
||||||
|
resultData = HttpRequest.post(url).
|
||||||
|
header("appId", "800060").
|
||||||
|
header("apiCode", "8000600002").
|
||||||
|
header("publicKey", "ZJYA7f8FzV219otH8zhkReiyyWpXswpbY/+StvC2em0hf59Ce7eDIk+3zDUT+v578prj").
|
||||||
|
header("secretKey", "xJ9J1Ev2F0faiJ/nQnCNklskAgtQp3QSm+ihO21uY/H0UADj0tSDPxmIhFfC4v6Fj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=").
|
||||||
|
body(sendData.toJSONString()).
|
||||||
|
execute().
|
||||||
|
body();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.error("推送开票申请返回:" + resultData);
|
||||||
|
JSONObject resoutJson = JSONObject.parseObject(resultData);
|
||||||
|
if (resoutJson.getBoolean("flag")) {
|
||||||
|
InvoiceDistributeEntity invoiceDistributeEntity = new InvoiceDistributeEntity();
|
||||||
|
invoiceDistributeEntity.setId(mainData.getString("id"));
|
||||||
|
invoiceDistributeEntity.setField0206("1");
|
||||||
|
invoiceDistributeEntity.setField0215("申请单处理中");
|
||||||
|
invoiceDistributeEntity.setDataSourceCode("HT-OA");
|
||||||
|
iInvoiceDistributeDao.updataStatus(invoiceDistributeEntity);
|
||||||
|
return BaseResult.getSuccessMessageEntity("推送开票申请成功");
|
||||||
|
} else {
|
||||||
|
return BaseResult.getFailureMessageEntity("推送开票申请失败:" + resoutJson.getString("msg"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mainData
|
||||||
|
* @param formson_0700
|
||||||
|
* @param formson_0332
|
||||||
|
* @return JSONObject
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 蓝字发票申请单申请 组装数据
|
||||||
|
* @Date 6:12 下午 2025/6/27
|
||||||
|
**/
|
||||||
|
private JSONObject getlzfpsqdsqSendData(JSONObject mainData, JSONArray formson_0700,JSONArray formson_0332) throws ParseException {
|
||||||
|
|
||||||
|
JSONObject parent = new JSONObject();
|
||||||
|
JSONArray childrens = new JSONArray();
|
||||||
|
parent.put("serialNumber", mainData.getString("id"));
|
||||||
|
parent.put("companyCode", "");
|
||||||
|
parent.put("sellerTaxNo", mainData.getString("field0163"));
|
||||||
|
parent.put("templateId", "MB202504259111885691");
|
||||||
|
parent.put("businessNo", mainData.getString("field0117"));
|
||||||
|
parent.put("superiorBusinessNo", "");
|
||||||
|
parent.put("buyerName", mainData.getString("field0106"));
|
||||||
|
parent.put("buyerTaxNo", mainData.getString("field0105"));
|
||||||
|
parent.put("buyerAddrPhone", mainData.getOrDefault("field0100","") +" "+ mainData.getOrDefault("field0101",""));
|
||||||
|
String buyerBankAccount = (mainData.getString("field0103") == null ? "" : mainData.getString("field0103")).replaceAll(" ", "") + " " + (mainData.getString("field0102") == null ? "" : mainData.getString("field0102")).replaceAll(" ", "");
|
||||||
|
parent.put("buyerBankAccount", buyerBankAccount);
|
||||||
|
|
||||||
|
InvoiceDistributeEntity applyPerson = new InvoiceDistributeEntity();
|
||||||
|
applyPerson.setId(mainData.getString("field0115"));
|
||||||
|
applyPerson.setDataSourceCode("HT-OA");
|
||||||
|
List<InvoiceDistributeEntity> apply_person = iInvoiceDistributeDao.queryOrgerManber(applyPerson);
|
||||||
|
if(apply_person != null && apply_person.size() > 0){
|
||||||
|
parent.put("applyPerson", apply_person.get(0).getName());
|
||||||
|
}
|
||||||
|
parent.put("applyEmailNotice", "0");
|
||||||
|
parent.put("buyerEmailNotice", "0");
|
||||||
|
parent.put("workcode", "");
|
||||||
|
parent.put("otherEmail", stringAgg(formson_0700));
|
||||||
|
parent.put("buyerContact", "");
|
||||||
|
parent.put("buyerMobile", "");
|
||||||
|
parent.put("buyerRecvAddress", mainData.getString("field0126"));
|
||||||
|
parent.put("applicationRemark", "");
|
||||||
|
parent.put("attachments", "");
|
||||||
|
parent.put("notifyUrl", "");
|
||||||
|
parent.put("specialInvoiceMark", mainData.getString("field0167"));
|
||||||
|
parent.put("sellerName", mainData.getString("field0108"));
|
||||||
|
parent.put("sellerAddrPhone", "");
|
||||||
|
parent.put("sellerBankAccount", "");
|
||||||
|
JSONObject extFieldJSONObject = new JSONObject();
|
||||||
|
extFieldJSONObject.put("SystemOrg","OA");
|
||||||
|
parent.put("extFieldJSONObject",extFieldJSONObject);
|
||||||
|
JSONObject extendFieldsObj = new JSONObject();
|
||||||
|
extendFieldsObj.put("SystemOrg","OA");
|
||||||
|
parent.put("extendFields",extendFieldsObj);
|
||||||
|
JSONObject applicationForm = new JSONObject();
|
||||||
|
if(mainData.getString("field0109") != null){
|
||||||
|
if("-5467259512157286597".equals(mainData.getString("field0109"))){
|
||||||
|
applicationForm.put("invoiceType", "10");
|
||||||
|
}else if ("8203933372392623007".equals(mainData.getString("field0109"))){
|
||||||
|
applicationForm.put("invoiceType", "0");
|
||||||
|
}else if ("586969999836335692".equals(mainData.getString("field0109"))){
|
||||||
|
applicationForm.put("invoiceType", "21");
|
||||||
|
}else if ("-9065195408118165505".equals(mainData.getString("field0109"))){
|
||||||
|
applicationForm.put("invoiceType", "22");
|
||||||
|
}else {
|
||||||
|
applicationForm.put("invoiceType", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
applicationForm.put("isPerson", "");
|
||||||
|
applicationForm.put("levyTaxType", "0");
|
||||||
|
applicationForm.put("deduction", "");
|
||||||
|
applicationForm.put("remark", mainData.getString("field0092"));
|
||||||
|
if (formson_0332 != null && formson_0332.size() > 0) {
|
||||||
|
for (int i = 0; i < formson_0332.size(); i++) {
|
||||||
|
JSONObject detaildata1 = formson_0332.getJSONObject(i);
|
||||||
|
JSONObject details = new JSONObject();
|
||||||
|
details.put("itemNo", "");
|
||||||
|
details.put("itemName", detaildata1.getString("field0080"));
|
||||||
|
details.put("taxCateCode", detaildata1.getString("field0153"));
|
||||||
|
details.put("spec", detaildata1.getString("field0083"));
|
||||||
|
details.put("unit", detaildata1.getString("field0219"));
|
||||||
|
details.put("quantity", detaildata1.getOrDefault("field0122",0));
|
||||||
|
details.put("unitPrice", detaildata1.getOrDefault("field0085",0));
|
||||||
|
// 如果数量是0,则单价也传0
|
||||||
|
if(null == detaildata1.getString("field0122")){
|
||||||
|
details.put("unitPrice", null);
|
||||||
|
}
|
||||||
|
details.put("price", detaildata1.getString("field0087"));
|
||||||
|
details.put("taxRate", detaildata1.getString("field0224"));
|
||||||
|
details.put("zeroFlag", "");
|
||||||
|
details.put("includeTaxTag", "0");
|
||||||
|
details.put("detailType", "0");
|
||||||
|
details.put("enjoyPreferentialFlag", "0");
|
||||||
|
details.put("preferentialPolicyType", "");
|
||||||
|
childrens.add(details);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
applicationForm.put("detailList", childrens);
|
||||||
|
JSONObject specialIndustryDTO = new JSONObject();
|
||||||
|
if ("03".equals(mainData.getString("field0167"))) {
|
||||||
|
specialIndustryDTO.put("place", mainData.getString("field0210"));
|
||||||
|
specialIndustryDTO.put("placeOfDetail", mainData.getString("field0211"));
|
||||||
|
specialIndustryDTO.put("constructionProjectName", mainData.getString("field0212"));
|
||||||
|
specialIndustryDTO.put("productNo", mainData.getString("field0186"));
|
||||||
|
specialIndustryDTO.put("crossDistinctCityFlag", mainData.getString("field0187"));
|
||||||
|
if("是".equals(mainData.getString("field0187"))){
|
||||||
|
specialIndustryDTO.put("kqysssxbgglbm", mainData.getString("field0185"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ("06".equals(mainData.getString("field0167"))) {
|
||||||
|
specialIndustryDTO.put("place", mainData.getString("field0210"));
|
||||||
|
specialIndustryDTO.put("placeOfDetail", mainData.getString("field0211"));
|
||||||
|
specialIndustryDTO.put("crossDistinctCityFlag", mainData.getString("field0187"));
|
||||||
|
specialIndustryDTO.put("certificateOfTitle", mainData.getString("field0213"));
|
||||||
|
specialIndustryDTO.put("areaUnit", mainData.getString("field0214"));
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
if(mainData.getString("field0208") != null){
|
||||||
|
specialIndustryDTO.put("startDate", sdf.format(mainData.getDate("field0208")));
|
||||||
|
}
|
||||||
|
if(mainData.getString("field0209") != null){
|
||||||
|
specialIndustryDTO.put("endDate", sdf.format(mainData.getDate("field0209")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
parent.put("applicationForm", applicationForm);
|
||||||
|
parent.put("specialIndustryDTO", specialIndustryDTO);
|
||||||
|
return parent;
|
||||||
|
}
|
||||||
|
public String stringAgg( JSONArray jsonArray) {
|
||||||
|
// 防御空输入:若JSONArray为null或空,直接返回空字符串
|
||||||
|
if (jsonArray == null || jsonArray.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
// 遍历JSONArray中的每个JSONObject(对应一条formson_0700数据)
|
||||||
|
for (int i = 0; i < jsonArray.size(); i++) {
|
||||||
|
JSONObject jsonObj = jsonArray.getJSONObject(i);
|
||||||
|
if (jsonObj == null) {
|
||||||
|
continue; // 跳过空对象
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提取field0217:若字段不存在或为null,视为空值
|
||||||
|
String fieldVal = jsonObj.getString("field0217");
|
||||||
|
// 过滤无效值(null、纯空格字符串)
|
||||||
|
if (fieldVal == null || fieldVal.trim().isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 拼接逻辑:非第一个有效值时,先加';'分隔符
|
||||||
|
if (sb.length() > 0) {
|
||||||
|
sb.append(";");
|
||||||
|
}
|
||||||
|
sb.append(fieldVal);
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param mainData
|
||||||
|
* @param formson_0700
|
||||||
|
* @param formson_0332
|
||||||
|
* @return JSONObject
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 红字信息表申请单申请 组装数据
|
||||||
|
* @Date 6:12 下午 2025/6/27
|
||||||
|
**/
|
||||||
|
private JSONObject gethzxxbsqdsqSendData(JSONObject mainData, JSONArray formson_0700,JSONArray formson_0332) throws ParseException {
|
||||||
|
JSONObject parent = new JSONObject();
|
||||||
|
parent.put("serialNumber", mainData.getString("id"));
|
||||||
|
parent.put("companyCode", "");
|
||||||
|
parent.put("sellerTaxNo", mainData.getString("field0163"));
|
||||||
|
parent.put("templateId", "MB20250623LJ");
|
||||||
|
parent.put("businessNo", mainData.getString("field0117"));
|
||||||
|
parent.put("originalSellerName", mainData.getString("field0108"));
|
||||||
|
parent.put("originalSellerTaxNo", mainData.getString("field0163"));
|
||||||
|
parent.put("buyerName", mainData.getString("field0106"));
|
||||||
|
parent.put("buyerTaxNo", mainData.getString("field0105"));
|
||||||
|
InvoiceDistributeEntity applyPerson = new InvoiceDistributeEntity();
|
||||||
|
applyPerson.setId(mainData.getString("field0115"));
|
||||||
|
applyPerson.setDataSourceCode("HT-OA");
|
||||||
|
List<InvoiceDistributeEntity> apply_person = iInvoiceDistributeDao.queryOrgerManber(applyPerson);
|
||||||
|
if(apply_person != null && apply_person.size() > 0){
|
||||||
|
parent.put("applyPerson", apply_person.get(0).getName());
|
||||||
|
}
|
||||||
|
parent.put("applyEmailNotice", "0");
|
||||||
|
parent.put("buyerEmailNotice", "0");
|
||||||
|
parent.put("otherEmail", stringAgg(formson_0700));
|
||||||
|
parent.put("applicationRemark", "");
|
||||||
|
parent.put("attachments", "");
|
||||||
|
parent.put("notifyUrl","");
|
||||||
|
JSONObject extFieldJSONObject = new JSONObject();
|
||||||
|
extFieldJSONObject.put("SystemOrg","OA");
|
||||||
|
parent.put("extFieldJSONObject",extFieldJSONObject);
|
||||||
|
JSONObject extendFieldsObj = new JSONObject();
|
||||||
|
extendFieldsObj.put("SystemOrg","OA");
|
||||||
|
parent.put("extendFields",extendFieldsObj);
|
||||||
|
JSONArray applicationForm = new JSONArray();
|
||||||
|
JSONObject applicationFormJson = new JSONObject();
|
||||||
|
if(mainData.getString("field0109") != null){
|
||||||
|
if("-5467259512157286597".equals(mainData.getString("field0109"))){
|
||||||
|
applicationFormJson.put("invoiceType", "10");
|
||||||
|
}else if ("8203933372392623007".equals(mainData.getString("field0109"))){
|
||||||
|
applicationFormJson.put("invoiceType", "0");
|
||||||
|
}else if ("586969999836335692".equals(mainData.getString("field0109"))){
|
||||||
|
applicationFormJson.put("invoiceType", "21");
|
||||||
|
}else if ("-9065195408118165505".equals(mainData.getString("field0109"))){
|
||||||
|
applicationFormJson.put("invoiceType", "22");
|
||||||
|
}else {
|
||||||
|
applicationFormJson.put("invoiceType", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ("-1414365591115381033".equals(mainData.getString("field0165"))) { //销方
|
||||||
|
applicationFormJson.put("applicant", "2");
|
||||||
|
}
|
||||||
|
if ("3075360049544777325".equals(mainData.getString("field0165"))) { //购方
|
||||||
|
applicationFormJson.put("applicant", "1");
|
||||||
|
}
|
||||||
|
applicationFormJson.put("deductionStatus", "");
|
||||||
|
applicationFormJson.put("originalInvoiceCode", mainData.getString("field0157"));
|
||||||
|
applicationFormJson.put("originalInvoiceNumber", mainData.getString("field0158"));
|
||||||
|
applicationFormJson.put("originalInvoiceDate", mainData.getString("field0159"));
|
||||||
|
applicationFormJson.put("originalInvoicePrice", mainData.getString("field0160"));
|
||||||
|
//3320815801687101195 8075623800107716290 销货退回
|
||||||
|
//-8544387146720065507 8075623800107716290 开票有误
|
||||||
|
//3435351219724830575 8075623800107716290 服务中止
|
||||||
|
//-1893846937353040038 8075623800107716290 销售折让
|
||||||
|
if (mainData.getString("field0164") != null) {
|
||||||
|
if ("3320815801687101195".equals(mainData.getString("field0164"))) {
|
||||||
|
applicationFormJson.put("redFlushReason", "1");
|
||||||
|
}else if ("-8544387146720065507".equals(mainData.getString("field0164"))) {
|
||||||
|
applicationFormJson.put("redFlushReason", "2");
|
||||||
|
}else if ("3435351219724830575".equals(mainData.getString("field0164"))) {
|
||||||
|
applicationFormJson.put("redFlushReason", "3");
|
||||||
|
}else if ("-1893846937353040038".equals(mainData.getString("field0164"))) {
|
||||||
|
applicationFormJson.put("redFlushReason", "4");
|
||||||
|
}else {
|
||||||
|
applicationFormJson.put("redFlushReason", null);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
applicationFormJson.put("redFlushReason", null);
|
||||||
|
}
|
||||||
|
applicationFormJson.put("specialInvoiceMark", mainData.getString("field0167"));
|
||||||
|
applicationFormJson.put("redFlushType", "0");
|
||||||
|
applicationForm.add(applicationFormJson);
|
||||||
|
parent.put("applicationForm", applicationForm);
|
||||||
|
return parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mainData
|
||||||
|
* @param formson_0700
|
||||||
|
* @param formson_0332
|
||||||
|
* @return JSONObject
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 红字发票申请单申请 组装数据
|
||||||
|
* @Date 6:12 下午 2025/6/27
|
||||||
|
**/
|
||||||
|
private JSONObject gethzfpsqdsqSendData(JSONObject mainData, JSONArray formson_0700,JSONArray formson_0332) throws ParseException {
|
||||||
|
JSONObject parent = new JSONObject();
|
||||||
|
parent.put("serialNumber", mainData.getString("id"));
|
||||||
|
parent.put("companyCode", "0");
|
||||||
|
parent.put("sellerTaxNo", mainData.getString("field0163"));
|
||||||
|
parent.put("templateId", "MB20250623F");
|
||||||
|
parent.put("businessNo", mainData.getString("field0117"));
|
||||||
|
parent.put("originalSuperiorBusinessNo", mainData.getString("field0156"));
|
||||||
|
parent.put("buyerName", mainData.getString("field0106"));
|
||||||
|
parent.put("buyerTaxNo", mainData.getString("field0105"));
|
||||||
|
parent.put("buyerAddrPhone", mainData.getOrDefault("field0100","") +" "+ mainData.getOrDefault("field0101",""));
|
||||||
|
String buyerBankAccount = (mainData.getString("field0103") == null ? "" : mainData.getString("field0103")).replaceAll(" ", "") + " " + (mainData.getString("field0102") == null ? "" : mainData.getString("field0102")).replaceAll(" ", "");
|
||||||
|
parent.put("buyerBankAccount", buyerBankAccount);
|
||||||
|
InvoiceDistributeEntity applyPerson = new InvoiceDistributeEntity();
|
||||||
|
applyPerson.setId(mainData.getString("field0115"));
|
||||||
|
applyPerson.setDataSourceCode("HT-OA");
|
||||||
|
List<InvoiceDistributeEntity> apply_person = iInvoiceDistributeDao.queryOrgerManber(applyPerson);
|
||||||
|
if(apply_person != null && apply_person.size() > 0){
|
||||||
|
parent.put("applyPerson", apply_person.get(0).getName());
|
||||||
|
}
|
||||||
|
parent.put("applyEmailNotice", "0");
|
||||||
|
parent.put("buyerEmailNotice", "0");
|
||||||
|
parent.put("otherEmail", stringAgg(formson_0700));
|
||||||
|
parent.put("buyerContact", "");
|
||||||
|
parent.put("buyerMobile", "");
|
||||||
|
parent.put("buyerRecvAddress", mainData.getString("field0126"));
|
||||||
|
parent.put("applicationRemark", "");
|
||||||
|
parent.put("attachments", "");
|
||||||
|
parent.put("notifyUrl", "");
|
||||||
|
parent.put("specialInvoiceMark", mainData.getString("field0167"));
|
||||||
|
parent.put("sellerName", mainData.getString("field0108"));
|
||||||
|
parent.put("sellerAddrPhone", "");
|
||||||
|
parent.put("sellerBankAccount", "");
|
||||||
|
JSONObject extFieldJSONObject = new JSONObject();
|
||||||
|
extFieldJSONObject.put("SystemOrg","OA");
|
||||||
|
parent.put("extFieldJSONObject",extFieldJSONObject);
|
||||||
|
JSONObject extendFieldsObj = new JSONObject();
|
||||||
|
extendFieldsObj.put("SystemOrg","OA");
|
||||||
|
parent.put("extendFields",extendFieldsObj);
|
||||||
|
JSONArray applicationForm = new JSONArray();
|
||||||
|
JSONObject applicationFormJson = new JSONObject();
|
||||||
|
if(mainData.getString("field0109") != null){
|
||||||
|
if("-5467259512157286597".equals(mainData.getString("field0109"))){
|
||||||
|
applicationFormJson.put("invoiceType", "10");
|
||||||
|
}else if ("8203933372392623007".equals(mainData.getString("field0109"))){
|
||||||
|
applicationFormJson.put("invoiceType", "0");
|
||||||
|
}else if ("586969999836335692".equals(mainData.getString("field0109"))){
|
||||||
|
applicationFormJson.put("invoiceType", "21");
|
||||||
|
}else if ("-9065195408118165505".equals(mainData.getString("field0109"))){
|
||||||
|
applicationFormJson.put("invoiceType", "22");
|
||||||
|
}else {
|
||||||
|
applicationFormJson.put("invoiceType", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
applicationFormJson.put("originalInvoiceCode", mainData.getString("field0157"));
|
||||||
|
applicationFormJson.put("originalInvoiceNumber", mainData.getString("field0158"));
|
||||||
|
applicationFormJson.put("originalInvoiceDate", mainData.getString("field0159"));
|
||||||
|
applicationFormJson.put("originalInvoicePrice", mainData.getString("field0160"));
|
||||||
|
applicationFormJson.put("originalInvoiceCheckCode", null);
|
||||||
|
applicationFormJson.put("redLetterInfoSheetNo", mainData.getString("field0161"));
|
||||||
|
applicationFormJson.put("remark", mainData.getString("field0092"));
|
||||||
|
applicationForm.add(applicationFormJson);
|
||||||
|
parent.put("applicationForm", applicationForm);
|
||||||
|
return parent;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,149 @@
|
||||||
|
package com.hzya.frame.plugin.ht.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
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.IFundsAllocationDao;
|
||||||
|
import com.hzya.frame.plugin.ht.dao.IStopAffairDao;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.FundsAllocationEntity;
|
||||||
|
import com.hzya.frame.plugin.ht.entity.StopAffairEntity;
|
||||||
|
import com.hzya.frame.plugin.ht.service.IFundsAllocationService;
|
||||||
|
import com.hzya.frame.plugin.ht.service.IStopAffairService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 资金归集流程终止
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2025/6/21 15:03
|
||||||
|
**/
|
||||||
|
@Service(value = "stopAffairServiceImpl")
|
||||||
|
public class StopAffairServiceImpl extends BaseService<StopAffairEntity,String> implements IStopAffairService {
|
||||||
|
|
||||||
|
private IStopAffairDao stopAffairDao;
|
||||||
|
|
||||||
|
@Value("${zt.url}")
|
||||||
|
private String url;
|
||||||
|
@Autowired
|
||||||
|
public void setStopAffairDao(IStopAffairDao dao) {
|
||||||
|
this.stopAffairDao = dao;
|
||||||
|
this.dao = dao;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param requestJson
|
||||||
|
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 资金归集流程终止
|
||||||
|
* @Date 2:51 下午 2025/8/11
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public JsonResultEntity sendStopAffair(JSONObject requestJson) {
|
||||||
|
//格式化日期
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
String data = sdf.format(new Date());
|
||||||
|
//获取数据
|
||||||
|
StopAffairEntity stopAffairEntity = new StopAffairEntity();
|
||||||
|
stopAffairEntity.setDataSourceCode("HT-OA");
|
||||||
|
stopAffairEntity.setDataTime(data);
|
||||||
|
List<StopAffairEntity> stopAffairEntityList = stopAffairDao.getStopAffair(stopAffairEntity);
|
||||||
|
if(stopAffairEntityList == null || stopAffairEntityList.size() == 0){
|
||||||
|
return BaseResult.getSuccessMessageEntity("处理资金归集流程终止成功");
|
||||||
|
}
|
||||||
|
List<StopAffairEntity> list = filterByColSummaryId(stopAffairEntityList);
|
||||||
|
if(list == null || list.size() == 0){
|
||||||
|
return BaseResult.getSuccessMessageEntity("处理资金归集流程终止成功");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
String token = getTokens("ZZZH");
|
||||||
|
String senddata = getStopAffair(list.get(i).getCtpAffairId(),"ZZZH");
|
||||||
|
String returnData = doSendData("8000590002",token,senddata);
|
||||||
|
logger.error("终止流程返回结果"+returnData);
|
||||||
|
if (StrUtil.isNotEmpty(returnData)){
|
||||||
|
logger.error("终止流程返回结果"+returnData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return BaseResult.getSuccessMessageEntity("处理资金归集流程终止成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getStopAffair(String workitemId,String loginName) {
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("affairId", workitemId);
|
||||||
|
json.put("repealComment", "");
|
||||||
|
json.put("member", loginName);//当前处理人登录名
|
||||||
|
return json.toJSONString();
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
private String getTokens(String loginName) {
|
||||||
|
String token = null;
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
// 向JSON对象中添加键值对
|
||||||
|
param.put("password", "b19afb1a-5a72-43db-84e1-e84aa4c571b5");
|
||||||
|
param.put("userName", "YDRest");
|
||||||
|
param.put("loginName", loginName);
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
public List<StopAffairEntity> filterByColSummaryId(List<StopAffairEntity> entityList) {
|
||||||
|
// key: colSummaryId 的值,value: 对应的 StopAffairEntity(优先保留 loginName 为 ZZZH 的)
|
||||||
|
Map<String, StopAffairEntity> map = new HashMap<>();
|
||||||
|
for (StopAffairEntity entity : entityList) {
|
||||||
|
String colSummaryId = entity.getColSummaryId();
|
||||||
|
if (map.containsKey(colSummaryId)) {
|
||||||
|
StopAffairEntity existingEntity = map.get(colSummaryId);
|
||||||
|
// 如果当前实体 loginName 是 ZZZH,或者已存在的实体 loginName 不是 ZZZH 时,替换
|
||||||
|
if ("ZZZH".equals(entity.getLoginName())
|
||||||
|
|| !"ZZZH".equals(existingEntity.getLoginName())) {
|
||||||
|
map.put(colSummaryId, entity);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
map.put(colSummaryId, entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 将 Map 的值转换为 List 返回
|
||||||
|
return new ArrayList<>(map.values());
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,5 +6,7 @@
|
||||||
<bean name="QueryInvoiceResultPluginInitializer" class="com.hzya.frame.plugin.ht.plugin.QueryInvoiceResultPluginInitializer" />
|
<bean name="QueryInvoiceResultPluginInitializer" class="com.hzya.frame.plugin.ht.plugin.QueryInvoiceResultPluginInitializer" />
|
||||||
<bean name="QueryInputInvoiceResultPluginInitializer" class="com.hzya.frame.plugin.ht.plugin.QueryInputInvoiceResultPluginInitializer" />
|
<bean name="QueryInputInvoiceResultPluginInitializer" class="com.hzya.frame.plugin.ht.plugin.QueryInputInvoiceResultPluginInitializer" />
|
||||||
<bean name="fundsAllocationPluginInitializer" class="com.hzya.frame.plugin.ht.plugin.FundsAllocationPluginInitializer" />
|
<bean name="fundsAllocationPluginInitializer" class="com.hzya.frame.plugin.ht.plugin.FundsAllocationPluginInitializer" />
|
||||||
|
<bean name="bipProjectPluginInitializer" class="com.hzya.frame.plugin.ht.plugin.BipProjectPluginInitializer" />
|
||||||
|
<bean name="stopAffairPluginInitializer" class="com.hzya.frame.plugin.ht.plugin.StopAffairPluginInitializer" />
|
||||||
|
|
||||||
</beans>
|
</beans>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class temButtom {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test01() {
|
public void test01() {
|
||||||
String a = AESUtil.encrypt("hzya1314");
|
String a = AESUtil.encrypt("COco###2025");
|
||||||
System.out.println(a);
|
System.out.println(a);
|
||||||
String b = AESUtil.decrypt("62e4295b615a30dbf3b8ee96f41c820b");
|
String b = AESUtil.decrypt("62e4295b615a30dbf3b8ee96f41c820b");
|
||||||
System.out.println(b);
|
System.out.println(b);
|
||||||
|
|
|
@ -979,6 +979,12 @@ where id = #{id}
|
||||||
<when test="item.compareType == '6'.toString() ">
|
<when test="item.compareType == '6'.toString() ">
|
||||||
not like #{item.filedVaule}
|
not like #{item.filedVaule}
|
||||||
</when>
|
</when>
|
||||||
|
<when test="item.compareType == '7'.toString() ">
|
||||||
|
is null
|
||||||
|
</when>
|
||||||
|
<when test="item.compareType == '8'.toString() ">
|
||||||
|
not null
|
||||||
|
</when>
|
||||||
</choose>
|
</choose>
|
||||||
|
|
||||||
<choose>
|
<choose>
|
||||||
|
|
|
@ -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,9 @@ 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
|
||||||
|
private String fDocumentNo;//主表id
|
||||||
|
|
||||||
public String getSummaryId() {
|
public String getSummaryId() {
|
||||||
return summaryId;
|
return summaryId;
|
||||||
|
@ -255,4 +258,28 @@ 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getfDocumentNo() {
|
||||||
|
return fDocumentNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setfDocumentNo(String fDocumentNo) {
|
||||||
|
this.fDocumentNo = fDocumentNo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<resultMap id="get-ZxBankEntity-result" type="com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity">
|
<resultMap id="get-ZxBankEntity-result" type="com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity">
|
||||||
<result property="sourceFlowNumber" column="sourceFlowNumber" />
|
<result property="sourceFlowNumber" column="sourceFlowNumber" />
|
||||||
<result property="documentNo" column="documentNo" />
|
<result property="documentNo" column="documentNo" />
|
||||||
|
<result property="fDocumentNo" column="fDocumentNo" />
|
||||||
<result property="companyCode" column="companyCode" />
|
<result property="companyCode" column="companyCode" />
|
||||||
<result property="fundType" column="fundType" />
|
<result property="fundType" column="fundType" />
|
||||||
<result property="digest" column="digest" />
|
<result property="digest" column="digest" />
|
||||||
|
@ -30,6 +31,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>
|
||||||
|
|
||||||
|
@ -37,6 +39,7 @@
|
||||||
data_id as dataId
|
data_id as dataId
|
||||||
,source_flow_number as sourceFlowNumber
|
,source_flow_number as sourceFlowNumber
|
||||||
,document_no as documentNo
|
,document_no as documentNo
|
||||||
|
,f_document_no as fDocumentNo
|
||||||
,company_code as companyCode
|
,company_code as companyCode
|
||||||
,fund_type as fundType
|
,fund_type as fundType
|
||||||
,digest as digest
|
,digest as digest
|
||||||
|
@ -62,6 +65,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 +82,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
|
||||||
|
</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
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--通过主键修改方法-->
|
<!--通过主键修改方法-->
|
||||||
|
@ -97,9 +116,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);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue