Compare commits
No commits in common. "0234240494d45d27aef81f4291d76cacd403a5e1" and "59f548ed6565e440d6c6a5ed138bfcd55bc56632" have entirely different histories.
0234240494
...
59f548ed65
|
@ -26,7 +26,7 @@ Icon
|
||||||
Network Trash Folder
|
Network Trash Folder
|
||||||
Temporary Items
|
Temporary Items
|
||||||
.apdisk
|
.apdisk
|
||||||
/base-buildpackage/base-buildpackage.iml
|
|
||||||
# ---> Windows
|
# ---> Windows
|
||||||
# Windows thumbnail cache files
|
# Windows thumbnail cache files
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
|
@ -26,7 +26,6 @@ public interface IIncomeInvoiceDao extends IBaseDao<IncomeInvoiceEntity, String>
|
||||||
List<IncomeInvoiceEntity> queryOaMx(IncomeInvoiceEntity incomeInvoiceEntity);
|
List<IncomeInvoiceEntity> queryOaMx(IncomeInvoiceEntity incomeInvoiceEntity);
|
||||||
|
|
||||||
int updateMx(IncomeInvoiceEntity incomeInvoiceEntity);
|
int updateMx(IncomeInvoiceEntity incomeInvoiceEntity);
|
||||||
int updateFP(IncomeInvoiceEntity incomeInvoiceEntity);
|
|
||||||
|
|
||||||
int saveMx(IncomeInvoiceEntity incomeInvoiceEntity);
|
int saveMx(IncomeInvoiceEntity incomeInvoiceEntity);
|
||||||
|
|
||||||
|
@ -35,7 +34,5 @@ public interface IIncomeInvoiceDao extends IBaseDao<IncomeInvoiceEntity, String>
|
||||||
List<JSONObject> queryByAloneId(IncomeInvoiceEntity jnquerydata);
|
List<JSONObject> queryByAloneId(IncomeInvoiceEntity jnquerydata);
|
||||||
|
|
||||||
List<JSONObject> queryAccount(IncomeInvoiceEntity jnentity);
|
List<JSONObject> queryAccount(IncomeInvoiceEntity jnentity);
|
||||||
|
|
||||||
List<IncomeInvoiceEntity> queryOaFp(IncomeInvoiceEntity incomeInvoiceEntity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,12 +38,6 @@ public class IncomeInvoiceDaoImpl extends MybatisGenericDao<IncomeInvoiceEntity,
|
||||||
}
|
}
|
||||||
@DS("#entity.dataSourceCode")
|
@DS("#entity.dataSourceCode")
|
||||||
@Override
|
@Override
|
||||||
public List<IncomeInvoiceEntity> queryOaFp(IncomeInvoiceEntity entity) {
|
|
||||||
List<IncomeInvoiceEntity> o = (List<IncomeInvoiceEntity>) super.selectList(getSqlIdPrifx() + "queryOaFp", entity);
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
@DS("#entity.dataSourceCode")
|
|
||||||
@Override
|
|
||||||
public List<IncomeInvoiceEntity> queryOaMx(IncomeInvoiceEntity entity) {
|
public List<IncomeInvoiceEntity> queryOaMx(IncomeInvoiceEntity entity) {
|
||||||
List<IncomeInvoiceEntity> o = (List<IncomeInvoiceEntity>) super.selectList(getSqlIdPrifx() + "queryOaMx", entity);
|
List<IncomeInvoiceEntity> o = (List<IncomeInvoiceEntity>) super.selectList(getSqlIdPrifx() + "queryOaMx", entity);
|
||||||
return o;
|
return o;
|
||||||
|
@ -55,11 +49,6 @@ public class IncomeInvoiceDaoImpl extends MybatisGenericDao<IncomeInvoiceEntity,
|
||||||
}
|
}
|
||||||
@DS("#entity.dataSourceCode")
|
@DS("#entity.dataSourceCode")
|
||||||
@Override
|
@Override
|
||||||
public int updateFP(IncomeInvoiceEntity entity) {
|
|
||||||
return super.update(getSqlIdPrifx() + "updateFP", entity);
|
|
||||||
}
|
|
||||||
@DS("#entity.dataSourceCode")
|
|
||||||
@Override
|
|
||||||
public int saveMx(IncomeInvoiceEntity entity) {
|
public int saveMx(IncomeInvoiceEntity entity) {
|
||||||
return super.insert(getSqlIdPrifx() + "saveMx", entity);
|
return super.insert(getSqlIdPrifx() + "saveMx", entity);
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,15 +179,6 @@
|
||||||
</trim>
|
</trim>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="queryOaFp" resultType="com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity" parameterType="com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity">
|
|
||||||
select
|
|
||||||
id as dataId
|
|
||||||
from formmain_0705
|
|
||||||
<trim prefix="where" prefixOverrides="and">
|
|
||||||
<if test="field0128 != null and field0128 != ''"> and field0002 = #{field0128} </if>
|
|
||||||
</trim>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="queryOaMx" resultType="com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity" parameterType="com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity">
|
<select id="queryOaMx" resultType="com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity" parameterType="com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity">
|
||||||
select
|
select
|
||||||
id as dataId
|
id as dataId
|
||||||
|
@ -209,15 +200,6 @@
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{dataId}
|
where id = #{dataId}
|
||||||
</update>
|
</update>
|
||||||
<update id="updateFP" parameterType = "com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity" >
|
|
||||||
update formmain_0705 set
|
|
||||||
<trim suffix="" suffixOverrides=",">
|
|
||||||
<if test="field0130 != null and field0130 != ''"> field0034 = #{field0130},</if>
|
|
||||||
<if test="field0138 != null and field0138 != ''"> field0035 = #{field0138},</if>
|
|
||||||
<if test="field0139 != null and field0139 != ''"> field0036 = #{field0139},</if>
|
|
||||||
</trim>
|
|
||||||
where id = #{dataId}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<insert id="saveMx" parameterType="com.hzya.frame.report.reportManage.entity.ReportManageEntity">
|
<insert id="saveMx" parameterType="com.hzya.frame.report.reportManage.entity.ReportManageEntity">
|
||||||
insert into formson_0702(
|
insert into formson_0702(
|
||||||
|
@ -563,10 +545,177 @@
|
||||||
|
|
||||||
|
|
||||||
<select id="queryAccountByZq" resultType="com.alibaba.fastjson.JSONObject" parameterType="com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity">
|
<select id="queryAccountByZq" resultType="com.alibaba.fastjson.JSONObject" parameterType="com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity">
|
||||||
select * from V_LPHB_KMFZYE
|
-- CREATE or replace VIEW V_LPHB_KMFZYE1 AS
|
||||||
|
select * from (
|
||||||
|
SELECT
|
||||||
|
year,
|
||||||
|
adjustperiod as period,
|
||||||
|
year || '-' || adjustperiod as yearperiod,
|
||||||
|
nt.code AS subjectCode,
|
||||||
|
oa.name AS subjectName,
|
||||||
|
oa.dispname as subjectFullName,
|
||||||
|
( SELECT code FROM bd_account WHERE pk_account = nt.pid ) as superCode,
|
||||||
|
case
|
||||||
|
when balanorient = '1' then '-1'
|
||||||
|
when balanorient = '0' then '1'
|
||||||
|
end as subjectDir,
|
||||||
|
case
|
||||||
|
when pk_acctype = '0001Z01000000000019S' then 1
|
||||||
|
when pk_acctype = '0001Z01000000000019T' then 2
|
||||||
|
when pk_acctype = '0001Z01000000000019V' then 3
|
||||||
|
when pk_acctype = '0001Z01000000000019U' then 4
|
||||||
|
when pk_acctype = '0001Z01000000000019W' then 5
|
||||||
|
when pk_acctype = '0001Z01000000000019X' then 6
|
||||||
|
end as subjectType,
|
||||||
|
nt.sumprint_level as subjectLevel,
|
||||||
|
case
|
||||||
|
when nt.sumprint_level = '0' then 1
|
||||||
|
when nt.sumprint_level != '0' then 0
|
||||||
|
end as endLevel,
|
||||||
|
sum( debitamount ) AS debitValue,-- 本期借方發生額
|
||||||
|
sum( localcreditamount ) AS creditValue,-- 本期貸方發生額
|
||||||
|
CASE
|
||||||
|
WHEN sum( qmlocalamount ) - ( sum( localdebitamount ) - sum( localcreditamount ) ) > 0 THEN'1'
|
||||||
|
WHEN sum( qmlocalamount ) - ( sum( localdebitamount ) - sum( localcreditamount ) ) = 0 THEN'0' ELSE '-1' END AS initialSubjectDir,
|
||||||
|
case
|
||||||
|
when sum( qmlocalamount ) - ( sum( localdebitamount ) - sum( localcreditamount ) )>0 then sum( qmlocalamount ) - ( sum( localdebitamount ) - sum( localcreditamount ) )
|
||||||
|
else 0 end AS initialDebitBalanceValue, -- 期初余额借方金额
|
||||||
|
case when sum( qmlocalamount ) - ( sum( localdebitamount ) - sum( localcreditamount ) ) < 0 then sum( qmlocalamount ) - ( sum( localdebitamount ) - sum( localcreditamount ) )
|
||||||
|
else 0 end AS initialCreditBalanceValue, -- 期初余额贷方金额
|
||||||
|
|
||||||
|
CASE
|
||||||
|
WHEN sum( qmamount ) > 0 THEN'1'
|
||||||
|
WHEN sum( qmamount ) = 0 THEN'0' ELSE '-1' END AS balanceSubjectDir,
|
||||||
|
case when sum( qmlocalamount )>0 then sum( qmlocalamount )
|
||||||
|
else 0 end as balanceDeditValue, -- 期末余额借方金额
|
||||||
|
|
||||||
|
case when sum( qmlocalamount )>0 then sum( qmlocalamount )
|
||||||
|
else 0 end as balanceCreditValue, -- 期末余额贷方金额
|
||||||
|
sum( ljlocaldebitamount ) AS totalDebitValue,
|
||||||
|
sum( ljlocalcreditamount ) AS totalCreditValue,
|
||||||
|
org.code GSBM,
|
||||||
|
org.name GSMC
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT DISTINCT
|
||||||
|
accperiodmonth.periodyear YEAR,
|
||||||
|
accperiodmonth.PERIOD ADJUSTPERIOD,
|
||||||
|
dezz.pk_org,
|
||||||
|
dezz.pk_accasoa,
|
||||||
|
dezz.pk_currtype,
|
||||||
|
dezz.assid assid,
|
||||||
|
0 AS localdebitamount,
|
||||||
|
0 AS localcreditamount,
|
||||||
|
0 AS debitamount,
|
||||||
|
0 AS creditamount,
|
||||||
|
sum( localdebitamount ) AS ljlocaldebitamount,
|
||||||
|
sum( localcreditamount ) AS ljlocalcreditamount,
|
||||||
|
sum( debitamount ) AS ljdebitamount,
|
||||||
|
sum( creditamount ) AS ljcreditamount,
|
||||||
|
0 AS qmlocalamount,
|
||||||
|
0 AS qmamount
|
||||||
|
FROM
|
||||||
|
( SELECT substr( yearmth, 0, 4 ) periodyear, substr( yearmth, 6, 7 ) period FROM bd_accperiodmonth WHERE yearmth < TO_CHAR( SYSDATE, 'YYYY-MM' ) ) accperiodmonth
|
||||||
|
LEFT JOIN gl_balance dezz ON dezz.YEAR = accperiodmonth.periodyear
|
||||||
|
AND dezz.adjustperiod < = accperiodmonth.period
|
||||||
|
WHERE
|
||||||
|
voucherkind != 5
|
||||||
|
AND voucherkind != 4
|
||||||
|
AND dezz.adjustperiod > '00'
|
||||||
|
GROUP BY
|
||||||
|
accperiodmonth.periodyear,
|
||||||
|
accperiodmonth.PERIOD,
|
||||||
|
dezz.pk_org,
|
||||||
|
dezz.pk_accasoa,
|
||||||
|
dezz.pk_currtype,
|
||||||
|
dezz.assid UNION ALL
|
||||||
|
SELECT DISTINCT
|
||||||
|
dezz.YEAR,
|
||||||
|
dezz.ADJUSTPERIOD,
|
||||||
|
dezz.pk_org,
|
||||||
|
dezz.pk_accasoa,
|
||||||
|
dezz.pk_currtype,
|
||||||
|
dezz.assid,
|
||||||
|
sum( localdebitamount ) AS localdebitamount,
|
||||||
|
sum( localcreditamount ) AS localcreditamount,
|
||||||
|
sum( debitamount ) AS debitamount,
|
||||||
|
sum( creditamount ) AS creditamount,
|
||||||
|
0 AS ljlocaldebitamount,
|
||||||
|
0 AS ljlocalcreditamount,
|
||||||
|
0 AS ljdebitamount,
|
||||||
|
0 AS ljcreditamount,
|
||||||
|
0 AS qmlocalamount,
|
||||||
|
0 AS qmamount
|
||||||
|
FROM
|
||||||
|
gl_balance dezz
|
||||||
|
WHERE
|
||||||
|
voucherkind != 5
|
||||||
|
AND voucherkind != 4
|
||||||
|
GROUP BY
|
||||||
|
dezz.YEAR,
|
||||||
|
dezz.ADJUSTPERIOD,
|
||||||
|
dezz.pk_org,
|
||||||
|
dezz.pk_accasoa,
|
||||||
|
dezz.pk_currtype,
|
||||||
|
dezz.assid UNION ALL
|
||||||
|
SELECT DISTINCT
|
||||||
|
accperiodmonth.periodyear YEAR,
|
||||||
|
accperiodmonth.PERIOD ADJUSTPERIOD,
|
||||||
|
dezz.pk_org,
|
||||||
|
dezz.pk_accasoa,
|
||||||
|
dezz.pk_currtype,
|
||||||
|
dezz.assid assid,
|
||||||
|
0 AS localdebitamount,
|
||||||
|
0 AS localcreditamount,
|
||||||
|
0 AS debitamount,
|
||||||
|
0 AS creditamount,
|
||||||
|
0 AS ljlocaldebitamount,
|
||||||
|
0 AS ljlocalcreditamount,
|
||||||
|
0 AS ljdebitamount,
|
||||||
|
0 AS ljcreditamount,
|
||||||
|
sum( localdebitamount ) - sum( localcreditamount ) AS qmlocalamount,
|
||||||
|
sum( debitamount ) - sum( creditamount ) AS qmamount
|
||||||
|
FROM
|
||||||
|
( SELECT substr( yearmth, 0, 4 ) periodyear, substr( yearmth, 6, 7 ) period FROM bd_accperiodmonth WHERE yearmth < TO_CHAR( SYSDATE, 'YYYY-MM' ) ) accperiodmonth
|
||||||
|
LEFT JOIN gl_balance dezz ON dezz.YEAR = accperiodmonth.periodyear
|
||||||
|
AND dezz.adjustperiod < = accperiodmonth.period
|
||||||
|
WHERE
|
||||||
|
voucherkind != 5
|
||||||
|
AND voucherkind != 4
|
||||||
|
AND dezz.adjustperiod >= '00'
|
||||||
|
AND dezz.adjustperiod != '12A'
|
||||||
|
GROUP BY
|
||||||
|
accperiodmonth.periodyear,
|
||||||
|
accperiodmonth.PERIOD,
|
||||||
|
dezz.pk_org,
|
||||||
|
dezz.pk_accasoa,
|
||||||
|
dezz.pk_currtype,
|
||||||
|
dezz.assid
|
||||||
|
) a
|
||||||
|
LEFT JOIN org_orgs org ON org.pk_org = a.pk_org
|
||||||
|
LEFT JOIN bd_accasoa oa ON oa.pk_accasoa = a.pk_accasoa
|
||||||
|
LEFT JOIN bd_account nt ON nt.pk_account = oa.pk_account
|
||||||
|
LEFT JOIN bd_currtype currtype ON a.pk_currtype = currtype.pk_currtype
|
||||||
|
LEFT JOIN gl_docfree1 fr1 ON fr1.assid = a.assid
|
||||||
|
where adjustperiod != '12A'
|
||||||
|
and adjustperiod >= '00'
|
||||||
|
and adjustperiod != '00'
|
||||||
|
GROUP BY
|
||||||
|
year,
|
||||||
|
adjustperiod,
|
||||||
|
nt.code ,
|
||||||
|
oa.name ,
|
||||||
|
oa.dispname,
|
||||||
|
nt.pid,
|
||||||
|
balanorient,
|
||||||
|
pk_acctype,
|
||||||
|
org.code,
|
||||||
|
org.name,
|
||||||
|
nt.sumprint_level
|
||||||
|
)m1
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="orgCode != null and orgCode !='' "> and gsbm = #{orgCode} </if>
|
<if test="orgCode != null and orgCode !='' "> and gsbm = #{orgCode} </if>
|
||||||
<if test="sysData != null and sysData !='' "> and yearperiod = #{sysData} </if>
|
<if test="sysData != null and sysData !='' "> and yearperiod = {sysData} </if>
|
||||||
</trim>
|
</trim>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.hzya.frame.plugin.incomeInvoiceData.plugin;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hzya.frame.base.PluginBaseEntity;
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
import com.hzya.frame.plugin.incomeInvoiceData.service.IIncomeInvoiceService;
|
import com.hzya.frame.plugin.incomeInvoiceData.service.IIncomeInvoiceService;
|
||||||
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -53,8 +54,8 @@ public class FinancialReportPluginInitializer extends PluginBaseEntity{
|
||||||
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||||
try {
|
try {
|
||||||
logger.info("======开始执行财务信息同步========");
|
logger.info("======开始执行财务信息同步========");
|
||||||
//return BaseResult.getSuccessMessageEntity("数据获取成功");
|
return BaseResult.getSuccessMessageEntity("数据获取成功");
|
||||||
return incomeInvoiceService.sendFinancialReportPlugin(requestJson);
|
//return incomeInvoiceService.sendFinancialReportPlugin(requestJson);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
logger.info("======执行财务同步失败:{}========",e.getMessage());
|
logger.info("======执行财务同步失败:{}========",e.getMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hzya.frame.basedao.service.IBaseService;
|
import com.hzya.frame.basedao.service.IBaseService;
|
||||||
import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity;
|
import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity;
|
||||||
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
|
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
|
||||||
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity;
|
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,7 +21,6 @@ public interface IIncomeInvoiceService extends IBaseService<IncomeInvoiceEntity,
|
||||||
**/
|
**/
|
||||||
JsonResultEntity getIncomeInvoiceData(JSONObject requestJson);
|
JsonResultEntity getIncomeInvoiceData(JSONObject requestJson);
|
||||||
SysExtensionApiEntity setData(SysExtensionApiEntity entity) throws Exception;
|
SysExtensionApiEntity setData(SysExtensionApiEntity entity) throws Exception;
|
||||||
void setDataCallBack(SysMessageManageLogEntity entity) throws Exception;
|
|
||||||
|
|
||||||
JsonResultEntity sendFinancialReportPlugin(JSONObject requestJson);
|
JsonResultEntity sendFinancialReportPlugin(JSONObject requestJson);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,18 @@
|
||||||
package com.hzya.frame.plugin.incomeInvoiceData.service.impl;
|
package com.hzya.frame.plugin.incomeInvoiceData.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import cn.hutool.http.HttpUtil;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
|
import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
|
||||||
import com.hzya.frame.plugin.incomeInvoiceData.dao.IIncomeInvoiceDao;
|
import com.hzya.frame.plugin.incomeInvoiceData.dao.IIncomeInvoiceDao;
|
||||||
import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity;
|
import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity;
|
||||||
import com.hzya.frame.plugin.incomeInvoiceData.service.IIncomeInvoiceService;
|
import com.hzya.frame.plugin.incomeInvoiceData.service.IIncomeInvoiceService;
|
||||||
import com.hzya.frame.seeyon.service.ICtpAttachmentService;
|
|
||||||
import com.hzya.frame.seeyon.util.YzfSignUtil;
|
import com.hzya.frame.seeyon.util.YzfSignUtil;
|
||||||
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
|
import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
|
||||||
import com.hzya.frame.sysnew.comparison.controlsLog.dao.impl.ControlsLogDaoImpl;
|
import com.hzya.frame.sysnew.comparison.controlsLog.dao.impl.ControlsLogDaoImpl;
|
||||||
import com.hzya.frame.sysnew.comparison.controlsLog.entity.ControlsLogEntity;
|
import com.hzya.frame.sysnew.comparison.controlsLog.entity.ControlsLogEntity;
|
||||||
import com.hzya.frame.sysnew.comparison.dao.IComparisonDao;
|
import com.hzya.frame.sysnew.comparison.dao.IComparisonDao;
|
||||||
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
|
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
|
||||||
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity;
|
|
||||||
import com.hzya.frame.uuid.UUIDLong;
|
import com.hzya.frame.uuid.UUIDLong;
|
||||||
import com.hzya.frame.uuid.UUIDUtils;
|
import com.hzya.frame.uuid.UUIDUtils;
|
||||||
import com.hzya.frame.web.entity.BaseResult;
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
|
@ -41,14 +36,8 @@ import org.springframework.core.task.TaskExecutor;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.net.ssl.SSLContext;
|
import javax.net.ssl.SSLContext;
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -57,7 +46,6 @@ import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author makejava
|
* @author makejava
|
||||||
|
@ -67,8 +55,6 @@ public class IncomeInvoiceServiceImpl extends BaseService<IncomeInvoiceEntity, S
|
||||||
|
|
||||||
private IIncomeInvoiceDao incomeInvoiceDao;
|
private IIncomeInvoiceDao incomeInvoiceDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ICtpAttachmentService ctpAttachmentService;
|
|
||||||
@Autowired
|
|
||||||
private ControlsLogDaoImpl controlsLogDaoimpl;
|
private ControlsLogDaoImpl controlsLogDaoimpl;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IComparisonDao comparisonDao;
|
private IComparisonDao comparisonDao;
|
||||||
|
@ -77,25 +63,24 @@ public class IncomeInvoiceServiceImpl extends BaseService<IncomeInvoiceEntity, S
|
||||||
this.incomeInvoiceDao = dao;
|
this.incomeInvoiceDao = dao;
|
||||||
this.dao = dao;
|
this.dao = dao;
|
||||||
}
|
}
|
||||||
//boolean flags = true;
|
boolean flags = true;
|
||||||
//String uploadBalanceTableUrl = "http://oapi.nanofintax.com/api/collect/uploadBalanceTable?accessToken";
|
String uploadBalanceTableUrl = "http://oapi.nanofintax.com/api/collect/uploadBalanceTable?accessToken";
|
||||||
//String cbUrl = "http://oapi.nanofintax.com/api/collect/uploadFinancialReport?accessToken=";
|
|
||||||
//String dataUrl = "http://oapi.nanofintax.com/api/invoice_receive/fp/v1/query?accessToken=";
|
|
||||||
//String tokenUrl = "http://oapi.nanofintax.com/api/getToken";
|
|
||||||
//String accessKey = "6X3B526P5HqE6ums";
|
|
||||||
//String accessSecret = "34e5fc32ac894a2ba2ade8c3852c7a0a";
|
|
||||||
//String taxNo = "91330110MAC5FPUY2U";
|
|
||||||
//Integer size = 50;
|
|
||||||
|
|
||||||
boolean flags = false;
|
String cbUrl = "http://oapi.nanofintax.com/api/collect/uploadFinancialReport?accessToken=";
|
||||||
String uploadBalanceTableUrl = "http://122.9.186.182:30887/open/api/uploadBalanceTable";
|
String dataUrl = "http://oapi.nanofintax.com/api/invoice_receive/fp/v1/query?accessToken=";
|
||||||
String cbUrl = "http://122.9.186.182:30887/open/api/uploadFinancialReport";
|
|
||||||
String dataUrl = "https://workbench.test.htszny.com/oapi/invoice_rec/standing/book/queryList";//全量发票数据
|
|
||||||
String tokenUrl = "http://oapi.nanofintax.com/api/getToken";
|
String tokenUrl = "http://oapi.nanofintax.com/api/getToken";
|
||||||
String accessKey = "6X3B526P5HqE6ums";
|
String accessKey = "6X3B526P5HqE6ums";
|
||||||
String accessSecret = "34e5fc32ac894a2ba2ade8c3852c7a0a";
|
String accessSecret = "34e5fc32ac894a2ba2ade8c3852c7a0a";
|
||||||
String taxNo = "91330110MAC5FPUY2U";
|
String taxNo = "91330110MAC5FPUY2U";
|
||||||
Integer size = 50;
|
Integer size = 50;
|
||||||
|
|
||||||
|
//String cbUrl = "http://oapi.nanofintax.com/api/collect/uploadFinancialReport";
|
||||||
|
//String dataUrl = "https://workbench.test.htszny.com/oapi/invoice_receive/fp/v1/query";//全量发票数据
|
||||||
|
//String tokenUrl = "http://oapi.nanofintax.com/api/getToken";
|
||||||
|
//String accessKey = "6X3B526P5HqE6ums";
|
||||||
|
//String accessSecret = "34e5fc32ac894a2ba2ade8c3852c7a0a";
|
||||||
|
//String taxNo = "91330110MAC5FPUY2U";
|
||||||
|
//Integer size = 50;
|
||||||
@Resource
|
@Resource
|
||||||
private TaskExecutor taskExecutor;
|
private TaskExecutor taskExecutor;
|
||||||
/**
|
/**
|
||||||
|
@ -183,13 +168,9 @@ public class IncomeInvoiceServiceImpl extends BaseService<IncomeInvoiceEntity, S
|
||||||
saveData.put("kpr",content.getString("kpr"));
|
saveData.put("kpr",content.getString("kpr"));
|
||||||
saveData.put("skr",content.getString("skr"));
|
saveData.put("skr",content.getString("skr"));
|
||||||
saveData.put("fhr",content.getString("fhr"));
|
saveData.put("fhr",content.getString("fhr"));
|
||||||
saveData.put("url",content.getString("url"));
|
saveData.put("url",content.getOrDefault("url","http://prd-cabinet-1257122416.cos.ap-shanghai.myqcloud.com/recv-open-input-1313818348185971712-1362629996254053632.pdf"));
|
||||||
saveData.put("ofdurl",content.getString("ofdUrl"));
|
saveData.put("ofdurl",content.getOrDefault("ofdUrl","http://prd-cabinet-1257122416.cos.ap-shanghai.myqcloud.com/recv-open-input-1313818348185971712-1362629996254053632.pdf"));
|
||||||
saveData.put("xmlurl",content.getString("xmlUrl"));
|
saveData.put("xmlurl",content.getOrDefault("xmlUrl","http://prd-cabinet-1257122416.cos.ap-shanghai.myqcloud.com/recv-open-input-1313818348185971712-1362630000427386112.xml"));
|
||||||
|
|
||||||
//saveData.put("url",content.getOrDefault("url","http://prd-cabinet-1257122416.cos.ap-shanghai.myqcloud.com/recv-open-input-1313818348185971712-1362629996254053632.pdf"));
|
|
||||||
//saveData.put("ofdurl",content.getOrDefault("ofdUrl","http://prd-cabinet-1257122416.cos.ap-shanghai.myqcloud.com/recv-open-input-1313818348185971712-1362629996254053632.pdf"));
|
|
||||||
//saveData.put("xmlurl",content.getOrDefault("xmlUrl","http://prd-cabinet-1257122416.cos.ap-shanghai.myqcloud.com/recv-open-input-1313818348185971712-1362630000427386112.xml"));
|
|
||||||
saveData.put("htbh",content.getString("contraceNumber"));
|
saveData.put("htbh",content.getString("contraceNumber"));
|
||||||
|
|
||||||
JSONArray detaildata = content.getJSONArray("items");
|
JSONArray detaildata = content.getJSONArray("items");
|
||||||
|
@ -272,7 +253,6 @@ public class IncomeInvoiceServiceImpl extends BaseService<IncomeInvoiceEntity, S
|
||||||
queryParams.put("kprqq",dataTime);
|
queryParams.put("kprqq",dataTime);
|
||||||
queryParams.put("kprqz",dataTime);
|
queryParams.put("kprqz",dataTime);
|
||||||
queryParams.put("taxNo",taxNo);
|
queryParams.put("taxNo",taxNo);
|
||||||
queryParams.put("approvalStatus",1);
|
|
||||||
dayabody.put("queryParams",queryParams);
|
dayabody.put("queryParams",queryParams);
|
||||||
if(flags) {
|
if(flags) {
|
||||||
Map<String, Object> parametersMap = new HashMap<>();
|
Map<String, Object> parametersMap = new HashMap<>();
|
||||||
|
@ -472,180 +452,36 @@ public class IncomeInvoiceServiceImpl extends BaseService<IncomeInvoiceEntity, S
|
||||||
sendBody.put("loginName",loginName);
|
sendBody.put("loginName",loginName);
|
||||||
sendBody.put("dataXml",dataXml);
|
sendBody.put("dataXml",dataXml);
|
||||||
entity.setBodys(sendBody.toJSONString());
|
entity.setBodys(sendBody.toJSONString());
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return entity;
|
|
||||||
}
|
|
||||||
public JSONObject fileUpload(File file) {
|
|
||||||
if (null != file) {
|
|
||||||
try {
|
|
||||||
HashMap<String, Object> paramMap = new HashMap<>();
|
|
||||||
String loginName = "hzya";
|
|
||||||
paramMap.put("file", file);
|
|
||||||
String url = "/seeyon/rest/attachment?token=@token@";//如果后面加上applicationCategory=1&extensions=&firstSave=true,附件业务自动生成一条记录
|
|
||||||
url = url.replaceAll("@token@", getOAToken(loginName));
|
|
||||||
String result = HttpUtil.post("http://60.204.152.210" + url, paramMap);
|
|
||||||
if (StrUtil.isNotBlank(result)) {
|
|
||||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
|
||||||
String atts = jsonObject.get("atts").toString();
|
|
||||||
if (StrUtil.isNotEmpty(atts)) {
|
|
||||||
JSONArray jsonArray = JSONArray.parseArray(atts);
|
|
||||||
JSONObject res = (JSONObject) jsonArray.get(0);
|
|
||||||
String fileUrl = res.getString("fileUrl");
|
|
||||||
logger.info("附件id:" + fileUrl);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}catch (Exception e){
|
|
||||||
logger.error("附件上传失败"+e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String sendFileUpload(String url,String filename) {
|
|
||||||
try {
|
|
||||||
// 获取文件字节数据
|
|
||||||
byte[] fileBytes = downloadFileBytes(url);
|
|
||||||
if (fileBytes != null) {
|
|
||||||
// 模拟一个文件
|
|
||||||
File tempFile = new File(filename);
|
|
||||||
try (FileOutputStream fos = new FileOutputStream(tempFile)) {
|
|
||||||
fos.write(fileBytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject data = fileUpload(tempFile);
|
|
||||||
String fileUrl = null;
|
|
||||||
if(data != null && data.getString("fileUrl") != null && !"".equals(data.getString("fileUrl")) ){
|
|
||||||
fileUrl = data.getString("fileUrl");
|
|
||||||
}
|
|
||||||
// 操作完成后删除临时文件
|
|
||||||
tempFile.deleteOnExit();
|
|
||||||
return fileUrl;
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte[] downloadFileBytes(String fileUrl) throws IOException {
|
|
||||||
URL url = new URL(fileUrl);
|
|
||||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
|
||||||
connection.setRequestMethod("GET");
|
|
||||||
try (InputStream inputStream = connection.getInputStream();
|
|
||||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
|
|
||||||
byte[] buffer = new byte[4096];
|
|
||||||
int bytesRead;
|
|
||||||
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
|
||||||
outputStream.write(buffer, 0, bytesRead);
|
|
||||||
}
|
|
||||||
return outputStream.toByteArray();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* seeyon流程事件监听后置方法,绑定修改文件
|
|
||||||
* @param entity
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void setDataCallBack(SysMessageManageLogEntity entity) throws Exception {
|
|
||||||
try {
|
|
||||||
JSONObject datas = JSONObject.parseObject(entity.getSourceData());
|
|
||||||
String bodys = datas.getString("body");
|
|
||||||
JSONObject jsonObject = JSONObject.parseObject(bodys);
|
|
||||||
|
|
||||||
String urlData = null;
|
|
||||||
String ofdurlData = null;
|
|
||||||
String xmlurlData = null;
|
|
||||||
if(jsonObject.getString("url") != null){
|
|
||||||
urlData = sendFileUpload(jsonObject.getString("url"),jsonObject.getString("fphm")+"url");
|
|
||||||
}
|
|
||||||
if(jsonObject.getString("ofdurl") != null){
|
|
||||||
ofdurlData = sendFileUpload(jsonObject.getString("ofdurl"),jsonObject.getString("fphm")+"ofdurl");
|
|
||||||
}
|
|
||||||
if(jsonObject.getString("xmlurl") != null){
|
|
||||||
xmlurlData = sendFileUpload(jsonObject.getString("xmlurl"),jsonObject.getString("fphm")+"xmlurl");
|
|
||||||
}
|
|
||||||
//urlData = "7908556313791579509";
|
|
||||||
//ofdurlData = "7908556313791579509";
|
|
||||||
//xmlurlData = "7908556313791579509";
|
|
||||||
if(jsonObject.getString("fphm") != null){
|
|
||||||
IncomeInvoiceEntity incomeInvoiceEntity = new IncomeInvoiceEntity();
|
|
||||||
incomeInvoiceEntity.setDataSourceCode("HT-OA");
|
|
||||||
incomeInvoiceEntity.setField0128(jsonObject.getString("fphm"));//发票号码
|
|
||||||
incomeInvoiceEntity.setField0130(urlData);//发票文件
|
|
||||||
incomeInvoiceEntity.setField0138(ofdurlData);//发票文件
|
|
||||||
incomeInvoiceEntity.setField0139(xmlurlData);//发票文件
|
|
||||||
List<IncomeInvoiceEntity> list = incomeInvoiceDao.queryOaFp(incomeInvoiceEntity);
|
|
||||||
if(list != null && list.size() == 1){
|
|
||||||
incomeInvoiceEntity.setDataId(list.get(0).getDataId());
|
|
||||||
if(urlData != null){
|
|
||||||
//保存关联表
|
|
||||||
String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits());
|
|
||||||
ctpAttachmentService.saveAttachment(urlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode());
|
|
||||||
}
|
|
||||||
if(ofdurlData != null){
|
|
||||||
//保存关联表
|
|
||||||
String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits());
|
|
||||||
ctpAttachmentService.saveAttachment(ofdurlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode());
|
|
||||||
}
|
|
||||||
if(xmlurlData != null){
|
|
||||||
//保存关联表
|
|
||||||
String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits());
|
|
||||||
ctpAttachmentService.saveAttachment(xmlurlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode());
|
|
||||||
}
|
|
||||||
incomeInvoiceDao.updateFP(incomeInvoiceEntity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//修改明细表
|
//修改明细表
|
||||||
if(jsonObject.getString("htbh") != null){
|
if(jsonObject.getString("htbh") != null){
|
||||||
IncomeInvoiceEntity incomeInvoiceEntity = new IncomeInvoiceEntity();
|
IncomeInvoiceEntity incomeInvoiceEntity = new IncomeInvoiceEntity();
|
||||||
incomeInvoiceEntity.setDataSourceCode("HT-OA");
|
incomeInvoiceEntity.setDataSourceCode("master");//todo
|
||||||
|
//incomeInvoiceEntity.setDataSourceCode("HT-OA");//todo
|
||||||
incomeInvoiceEntity.setField0003(jsonObject.getString("htbh"));//合同号
|
incomeInvoiceEntity.setField0003(jsonObject.getString("htbh"));//合同号
|
||||||
incomeInvoiceEntity.setField0127(jsonObject.getString("fpdm"));//发票代码
|
incomeInvoiceEntity.setField0127(jsonObject.getString("fpdm"));//发票代码
|
||||||
incomeInvoiceEntity.setField0128(jsonObject.getString("fphm"));//发票号码
|
incomeInvoiceEntity.setField0128(jsonObject.getString("fphm"));//发票号码
|
||||||
incomeInvoiceEntity.setField0129(jsonObject.getString("jshj"));//发票总额
|
incomeInvoiceEntity.setField0129(jsonObject.getString("jshj"));//发票总额
|
||||||
incomeInvoiceEntity.setField0130(urlData);//发票文件
|
incomeInvoiceEntity.setField0130(jsonObject.getString("url"));//发票文件
|
||||||
incomeInvoiceEntity.setField0138(ofdurlData);//发票文件
|
incomeInvoiceEntity.setField0138(jsonObject.getString("ofdurl"));//发票文件
|
||||||
incomeInvoiceEntity.setField0139(xmlurlData);//发票文件
|
incomeInvoiceEntity.setField0139(jsonObject.getString("xmlurl"));//发票文件
|
||||||
List<IncomeInvoiceEntity> list = incomeInvoiceDao.queryOaZb(incomeInvoiceEntity);
|
List<IncomeInvoiceEntity> list = incomeInvoiceDao.queryOaZb(incomeInvoiceEntity);
|
||||||
if(list != null && list.size() == 1){
|
if(list != null && list.size() == 1){
|
||||||
incomeInvoiceEntity.setFormmainId(list.get(0).getDataId());
|
incomeInvoiceEntity.setFormmainId(list.get(0).getDataId());
|
||||||
if(urlData != null){
|
|
||||||
//保存关联表
|
|
||||||
String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits());
|
|
||||||
ctpAttachmentService.saveAttachment(urlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode());
|
|
||||||
}
|
|
||||||
if(ofdurlData != null){
|
|
||||||
//保存关联表
|
|
||||||
String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits());
|
|
||||||
ctpAttachmentService.saveAttachment(ofdurlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode());
|
|
||||||
}
|
|
||||||
if(xmlurlData != null){
|
|
||||||
//保存关联表
|
|
||||||
String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits());
|
|
||||||
ctpAttachmentService.saveAttachment(xmlurlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode());
|
|
||||||
}
|
|
||||||
List<IncomeInvoiceEntity> mxlist = incomeInvoiceDao.queryOaMx(incomeInvoiceEntity);
|
|
||||||
if(mxlist != null && mxlist.size() == 1){
|
|
||||||
incomeInvoiceEntity.setDataId(mxlist.get(0).getDataId());
|
|
||||||
incomeInvoiceDao.updateMx(incomeInvoiceEntity);
|
|
||||||
}
|
|
||||||
if(mxlist == null || mxlist.size() == 0){
|
|
||||||
incomeInvoiceEntity.setDataId(1);
|
|
||||||
incomeInvoiceDao.saveMx(incomeInvoiceEntity);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
List<IncomeInvoiceEntity> mxlist = incomeInvoiceDao.queryOaMx(incomeInvoiceEntity);
|
||||||
|
if(mxlist != null && mxlist.size() == 1){
|
||||||
|
incomeInvoiceEntity.setDataId(mxlist.get(0).getDataId());
|
||||||
|
incomeInvoiceDao.updateMx(incomeInvoiceEntity);
|
||||||
|
}
|
||||||
|
if(mxlist == null || mxlist.size() == 0){
|
||||||
|
incomeInvoiceEntity.setDataId(1);
|
||||||
|
incomeInvoiceDao.saveMx(incomeInvoiceEntity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.getMessage());
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -671,7 +507,7 @@ public class IncomeInvoiceServiceImpl extends BaseService<IncomeInvoiceEntity, S
|
||||||
stringBuffer.append("<column id=\"field0013\" type=\"0\" name=\"销售方开户行及账号\" isNullable=\"false\" length=\"100\"/>");
|
stringBuffer.append("<column id=\"field0013\" type=\"0\" name=\"销售方开户行及账号\" isNullable=\"false\" length=\"100\"/>");
|
||||||
stringBuffer.append("<column id=\"field0014\" type=\"0\" name=\"购买方地址电话\" isNullable=\"false\" length=\"100\"/>");
|
stringBuffer.append("<column id=\"field0014\" type=\"0\" name=\"购买方地址电话\" isNullable=\"false\" length=\"100\"/>");
|
||||||
stringBuffer.append("<column id=\"field0015\" type=\"0\" name=\"购买方开户行及账号\" isNullable=\"false\" length=\"100\"/>");
|
stringBuffer.append("<column id=\"field0015\" type=\"0\" name=\"购买方开户行及账号\" isNullable=\"false\" length=\"100\"/>");
|
||||||
stringBuffer.append("<column id=\"field0017\" type=\"0\" name=\"备注\" isNullable=\"false\" length=\"4000\"/>");
|
stringBuffer.append("<column id=\"field0017\" type=\"0\" name=\"备注\" isNullable=\"false\" length=\"100\"/>");
|
||||||
stringBuffer.append("<column id=\"field0018\" type=\"0\" name=\"机器编号\" isNullable=\"false\" length=\"100\"/>");
|
stringBuffer.append("<column id=\"field0018\" type=\"0\" name=\"机器编号\" isNullable=\"false\" length=\"100\"/>");
|
||||||
stringBuffer.append("<column id=\"field0019\" type=\"0\" name=\"机打号码\" isNullable=\"false\" length=\"100\"/>");
|
stringBuffer.append("<column id=\"field0019\" type=\"0\" name=\"机打号码\" isNullable=\"false\" length=\"100\"/>");
|
||||||
stringBuffer.append("<column id=\"field0020\" type=\"0\" name=\"开票人\" isNullable=\"false\" length=\"100\"/>");
|
stringBuffer.append("<column id=\"field0020\" type=\"0\" name=\"开票人\" isNullable=\"false\" length=\"100\"/>");
|
||||||
|
@ -842,8 +678,7 @@ public class IncomeInvoiceServiceImpl extends BaseService<IncomeInvoiceEntity, S
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public JsonResultEntity sendFinancialReportPlugin(JSONObject requestJson) {
|
public JsonResultEntity sendFinancialReportPlugin(JSONObject requestJson) {
|
||||||
//String qwewq = "{\"headers\":\"{\\\"formApp\\\":\\\"99999999999999999999_onProcessFinished\\\",\\\"plugId\\\":\\\"FinancialReportPlugin\\\"}\",\"jsonStr\":\"{\\r\\n\\t\\\"affairId\\\": -4741173599500744000,\\r\\n\\t\\\"businessDataStr\\\": \\\"{\\\\\\\"ztCode\\\\\\\":\\\\\\\"X0644\\\\\\\",\\\\\\\"taxNo\\\\\\\":\\\\\\\"BT23239dN23232\\\\\\\",\\\\\\\"dataType\\\\\\\":2,\\\\\\\"period\\\\\\\":\\\\\\\"2025-06\\\\\\\",\\\\\\\"taskNo\\\\\\\":\\\\\\\"231423332145344311\\\\\\\"}\\\",\\r\\n\\t\\\"formApp\\\": \\\"99999999999999999999\\\",\\r\\n\\t\\\"summaryId\\\": 6464011607627156000,\\r\\n\\t\\\"currentActivityId\\\": \\\"17416866229614\\\",\\r\\n\\t\\\"eventType\\\": \\\"onProcessFinished\\\",\\r\\n\\t\\\"id\\\": -2019827486750716200\\r\\n}\",\"eventType\":\"onProcessFinished\",\"formAppId\":\"99999999999999999999\"}";
|
|
||||||
//requestJson = JSONObject.parseObject(qwewq);
|
|
||||||
logger.error("财报数据推送入参"+requestJson.toJSONString());
|
logger.error("财报数据推送入参"+requestJson.toJSONString());
|
||||||
JSONObject jsonStr = requestJson.getJSONObject("jsonStr");
|
JSONObject jsonStr = requestJson.getJSONObject("jsonStr");
|
||||||
JSONObject businessDataStr = jsonStr.getJSONObject("businessDataStr");
|
JSONObject businessDataStr = jsonStr.getJSONObject("businessDataStr");
|
||||||
|
@ -948,8 +783,6 @@ public class IncomeInvoiceServiceImpl extends BaseService<IncomeInvoiceEntity, S
|
||||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||||
**/
|
**/
|
||||||
private JsonResultEntity sendFinancialReport(String ztbm ,String cjzq,String rwbm) {
|
private JsonResultEntity sendFinancialReport(String ztbm ,String cjzq,String rwbm) {
|
||||||
logger.error("财报数据推送入参1"+ztbm+","+cjzq+","+rwbm);
|
|
||||||
|
|
||||||
String access_token = "";
|
String access_token = "";
|
||||||
if(flags){
|
if(flags){
|
||||||
access_token = getToken();
|
access_token = getToken();
|
||||||
|
@ -963,8 +796,8 @@ public class IncomeInvoiceServiceImpl extends BaseService<IncomeInvoiceEntity, S
|
||||||
Date date = null;
|
Date date = null;
|
||||||
String qncjzq = null;
|
String qncjzq = null;
|
||||||
IncomeInvoiceEntity dyAloneId = null;
|
IncomeInvoiceEntity dyAloneId = null;
|
||||||
JSONObject dydata = new JSONObject();
|
JSONObject dydata = null;
|
||||||
JSONObject qndata = new JSONObject();
|
JSONObject qndata = null;
|
||||||
IncomeInvoiceEntity qnAloneId = null;
|
IncomeInvoiceEntity qnAloneId = null;
|
||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
||||||
|
@ -985,11 +818,10 @@ public class IncomeInvoiceServiceImpl extends BaseService<IncomeInvoiceEntity, S
|
||||||
jnentity.setSysData(cjzq);
|
jnentity.setSysData(cjzq);
|
||||||
jnentity.setOrgCode(ztbm);
|
jnentity.setOrgCode(ztbm);
|
||||||
List<IncomeInvoiceEntity> jnlist = incomeInvoiceDao.queryZtzz(jnentity);
|
List<IncomeInvoiceEntity> jnlist = incomeInvoiceDao.queryZtzz(jnentity);
|
||||||
//List<IncomeInvoiceEntity> jnlist = null;
|
|
||||||
if(jnlist != null && jnlist.size() == 1){
|
if(jnlist != null && jnlist.size() == 1){
|
||||||
dyAloneId = jnlist.get(0);
|
dyAloneId = jnlist.get(0);
|
||||||
}else {
|
}else {
|
||||||
//return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送");
|
return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送");
|
||||||
}
|
}
|
||||||
//查询去年当帐套组织
|
//查询去年当帐套组织
|
||||||
IncomeInvoiceEntity qnentity = new IncomeInvoiceEntity();
|
IncomeInvoiceEntity qnentity = new IncomeInvoiceEntity();
|
||||||
|
@ -997,7 +829,6 @@ public class IncomeInvoiceServiceImpl extends BaseService<IncomeInvoiceEntity, S
|
||||||
qnentity.setSysData(qncjzq);
|
qnentity.setSysData(qncjzq);
|
||||||
qnentity.setOrgCode(ztbm);
|
qnentity.setOrgCode(ztbm);
|
||||||
List<IncomeInvoiceEntity> qnlist = incomeInvoiceDao.queryZtzz(qnentity);
|
List<IncomeInvoiceEntity> qnlist = incomeInvoiceDao.queryZtzz(qnentity);
|
||||||
//List<IncomeInvoiceEntity> qnlist = null;
|
|
||||||
if(qnlist != null && qnlist.size() == 1){
|
if(qnlist != null && qnlist.size() == 1){
|
||||||
qnAloneId = qnlist.get(0);
|
qnAloneId = qnlist.get(0);
|
||||||
}else {
|
}else {
|
||||||
|
@ -1005,18 +836,15 @@ public class IncomeInvoiceServiceImpl extends BaseService<IncomeInvoiceEntity, S
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询当月的财报数据
|
//查询当月的财报数据
|
||||||
if(dyAloneId != null){
|
IncomeInvoiceEntity jnquerydata = new IncomeInvoiceEntity();
|
||||||
IncomeInvoiceEntity jnquerydata = new IncomeInvoiceEntity();
|
jnquerydata.setDataSourceCode("htBip");
|
||||||
jnquerydata.setDataSourceCode("htBip");
|
jnquerydata.setAloneId(dyAloneId.getAloneId());
|
||||||
jnquerydata.setAloneId(dyAloneId.getAloneId());
|
List<JSONObject> dydataList = incomeInvoiceDao.queryByAloneId(jnquerydata);
|
||||||
List<JSONObject> dydataList = incomeInvoiceDao.queryByAloneId(jnquerydata);
|
if(dydataList != null && dydataList.size() == 1){
|
||||||
if(dydataList != null && dydataList.size() == 1){
|
dydata = dydataList.get(0);
|
||||||
dydata = dydataList.get(0);
|
}else {
|
||||||
}else {
|
return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送");
|
||||||
//return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询去年当期的财报数据
|
//查询去年当期的财报数据
|
||||||
if(qnAloneId != null){
|
if(qnAloneId != null){
|
||||||
//查找去年数据
|
//查找去年数据
|
||||||
|
|
|
@ -3,7 +3,7 @@ logging:
|
||||||
#日志级别 指定目录级别
|
#日志级别 指定目录级别
|
||||||
level:
|
level:
|
||||||
root: INFO
|
root: INFO
|
||||||
encodings: GBK
|
encodings: UTF-8
|
||||||
file:
|
file:
|
||||||
# 日志保存路径
|
# 日志保存路径
|
||||||
path: D:\yongansystem\serverV3\log\test
|
path: D:\yongansystem\serverV3\log\test
|
||||||
|
|
|
@ -18,5 +18,4 @@ public interface ICtpAttachmentDao extends IBaseDao<CtpAttachmentEntity,String>
|
||||||
//新增
|
//新增
|
||||||
@DS("#ctpAttachmentEntity.dataSourceCode")
|
@DS("#ctpAttachmentEntity.dataSourceCode")
|
||||||
CtpAttachmentEntity saveCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity);
|
CtpAttachmentEntity saveCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,9 +11,6 @@ import java.util.List;
|
||||||
* @Date 2024/6/17 15:21
|
* @Date 2024/6/17 15:21
|
||||||
**/
|
**/
|
||||||
public interface ICtpFileDao extends IBaseDao<CtpFileEntity,String> {
|
public interface ICtpFileDao extends IBaseDao<CtpFileEntity,String> {
|
||||||
|
|
||||||
|
|
||||||
List<CtpFileEntity> queryFile(CtpFileEntity ctpFileEntity);
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @content 根据附件id查询附加信息
|
* @content 根据附件id查询附加信息
|
||||||
|
|
|
@ -20,14 +20,4 @@ public class CtpFileDaoImpl extends MybatisGenericDao<CtpFileEntity,String> impl
|
||||||
public List<CtpFileEntity> queryCtpFileById(CtpFileEntity ctpFileEntity) {
|
public List<CtpFileEntity> queryCtpFileById(CtpFileEntity ctpFileEntity) {
|
||||||
return (List<CtpFileEntity>) super.selectList("queryCtpFileById",ctpFileEntity);
|
return (List<CtpFileEntity>) super.selectList("queryCtpFileById",ctpFileEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@DS("#entity.dataSourceCode")
|
|
||||||
@Override
|
|
||||||
public List<CtpFileEntity> queryFile(CtpFileEntity entity) {
|
|
||||||
List<CtpFileEntity> o = (List<CtpFileEntity>) super.selectList(getSqlIdPrifx() + "queryFile", entity);
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,19 +34,7 @@
|
||||||
|
|
||||||
|
|
||||||
<!-- 查询 采用==查询 -->
|
<!-- 查询 采用==查询 -->
|
||||||
<select id="entity_list_base" resultMap="get-CtpFileEntity-result" parameterType="com.hzya.frame.seeyon.entity.CtpFileEntity">
|
<select id="CtpFileEntity_list_base" resultMap="get-CtpFileEntity-result" parameterType="com.hzya.frame.seeyon.entity.CtpFileEntity">
|
||||||
select
|
|
||||||
<include refid="CtpFileEntity_sql"/>
|
|
||||||
from
|
|
||||||
ctp_file
|
|
||||||
<trim prefix="where" prefixOverrides="and">
|
|
||||||
<if test="id != null and id != ''">id = #{id}</if>
|
|
||||||
<if test="filename != null and filename != ''">and filename = #{filename}</if>
|
|
||||||
</trim>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- 查询 采用==查询 -->
|
|
||||||
<select id="queryFile" resultMap="get-CtpFileEntity-result" parameterType="com.hzya.frame.seeyon.entity.CtpFileEntity">
|
|
||||||
select
|
select
|
||||||
<include refid="CtpFileEntity_sql"/>
|
<include refid="CtpFileEntity_sql"/>
|
||||||
from
|
from
|
||||||
|
|
|
@ -16,5 +16,5 @@ public interface ICtpAttachmentService extends IBaseService<CtpAttachmentEntity,
|
||||||
* @param sub_reference 随机uuid
|
* @param sub_reference 随机uuid
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
CtpAttachmentEntity saveAttachment(String fileUrl, String col_summary_id, String sub_reference, String dataSourceCode)throws Exception;
|
CtpAttachmentEntity saveAttachment(String fileUrl, String col_summary_id, String sub_reference)throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,6 @@ package com.hzya.frame.seeyon.service;
|
||||||
import com.hzya.frame.basedao.service.IBaseService;
|
import com.hzya.frame.basedao.service.IBaseService;
|
||||||
import com.hzya.frame.seeyon.entity.CtpFileEntity;
|
import com.hzya.frame.seeyon.entity.CtpFileEntity;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description seeyon 附件
|
* @Description seeyon 附件
|
||||||
* @Author xiangerlin
|
* @Author xiangerlin
|
||||||
|
|
|
@ -3,12 +3,10 @@ package com.hzya.frame.seeyon.service.impl;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||||
import com.hzya.frame.seeyon.dao.ICtpAttachmentDao;
|
import com.hzya.frame.seeyon.dao.ICtpAttachmentDao;
|
||||||
import com.hzya.frame.seeyon.dao.ICtpFileDao;
|
|
||||||
import com.hzya.frame.seeyon.entity.CtpAttachmentEntity;
|
import com.hzya.frame.seeyon.entity.CtpAttachmentEntity;
|
||||||
import com.hzya.frame.seeyon.entity.CtpFileEntity;
|
import com.hzya.frame.seeyon.entity.CtpFileEntity;
|
||||||
import com.hzya.frame.seeyon.service.ICtpAttachmentService;
|
import com.hzya.frame.seeyon.service.ICtpAttachmentService;
|
||||||
import com.hzya.frame.seeyon.service.ICtpFileService;
|
import com.hzya.frame.seeyon.service.ICtpFileService;
|
||||||
import com.hzya.frame.sysnew.comparison.controlsLog.dao.impl.ControlsLogDaoImpl;
|
|
||||||
import com.hzya.frame.uuid.UUIDLong;
|
import com.hzya.frame.uuid.UUIDLong;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -28,9 +26,6 @@ public class CtpAttachmentServiceImpl extends BaseService<CtpAttachmentEntity, S
|
||||||
private ICtpAttachmentDao ctpAttachmentDao;
|
private ICtpAttachmentDao ctpAttachmentDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ICtpFileService ctpFileService;
|
private ICtpFileService ctpFileService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ICtpFileDao ctpFileDao;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public void setCtpAttachmentDao(ICtpAttachmentDao dao) {
|
public void setCtpAttachmentDao(ICtpAttachmentDao dao) {
|
||||||
this.ctpAttachmentDao = dao;
|
this.ctpAttachmentDao = dao;
|
||||||
|
@ -46,28 +41,27 @@ public class CtpAttachmentServiceImpl extends BaseService<CtpAttachmentEntity, S
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CtpAttachmentEntity saveAttachment(String fileUrl, String col_summary_id, String sub_reference, String dataSourceCode)throws Exception {
|
public CtpAttachmentEntity saveAttachment(String fileUrl, String col_summary_id, String sub_reference)throws Exception {
|
||||||
//查一下附件
|
//查一下附件
|
||||||
CtpFileEntity ctpFileEntity = new CtpFileEntity();
|
CtpFileEntity ctpFileEntity = new CtpFileEntity();
|
||||||
ctpFileEntity.setId(fileUrl);
|
ctpFileEntity.setId(fileUrl);
|
||||||
ctpFileEntity.setDataSourceCode(dataSourceCode);
|
ctpFileEntity.setDataSourceCode("");
|
||||||
List<CtpFileEntity> ctpFileList = ctpFileDao.queryFile(ctpFileEntity);
|
List<CtpFileEntity> ctpFileList = ctpFileService.query(ctpFileEntity);
|
||||||
if (CollectionUtils.isNotEmpty(ctpFileList)){
|
if (CollectionUtils.isNotEmpty(ctpFileList)){
|
||||||
CtpFileEntity ctpFile = ctpFileList.get(0);
|
CtpFileEntity ctpFile = ctpFileList.get(0);
|
||||||
if (null != ctpFile){
|
if (null != ctpFile){
|
||||||
CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity();
|
CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity();
|
||||||
ctpAttachmentEntity.setDataSourceCode(dataSourceCode);
|
|
||||||
ctpAttachmentEntity.setId(String.valueOf(UUIDLong.longUUID()));
|
ctpAttachmentEntity.setId(String.valueOf(UUIDLong.longUUID()));
|
||||||
ctpAttachmentEntity.setFile_url(ctpFile.getId());//ctp_file表的id
|
ctpAttachmentEntity.setFile_url(ctpFile.getId());//ctp_file表的id
|
||||||
ctpAttachmentEntity.setAtt_reference(col_summary_id);//业务表单的id
|
ctpAttachmentEntity.setAtt_reference(col_summary_id);//业务表单的id
|
||||||
ctpAttachmentEntity.setSub_reference(sub_reference);//这个字段要保存到业务表附件到字段上
|
ctpAttachmentEntity.setSub_reference(sub_reference);//这个字段要保存到业务表附件到字段上
|
||||||
ctpAttachmentEntity.setCategory(ctpFile.getCategory());//这里写66 才可以显示图片
|
ctpAttachmentEntity.setCategory("66");//这里写66 才可以显示图片
|
||||||
ctpAttachmentEntity.setFilename(ctpFile.getFilename());
|
ctpAttachmentEntity.setFilename(ctpFile.getFilename());
|
||||||
ctpAttachmentEntity.setType(ctpFile.getType());
|
ctpAttachmentEntity.setType(ctpFile.getType());
|
||||||
ctpAttachmentEntity.setMime_type(ctpFile.getMime_type());
|
ctpAttachmentEntity.setMime_type(ctpFile.getMime_type());
|
||||||
ctpAttachmentEntity.setAttachment_size(ctpFile.getFile_size());
|
ctpAttachmentEntity.setAttachment_size(ctpFile.getFile_size());
|
||||||
ctpAttachmentEntity.setCreatedate(new Date());
|
ctpAttachmentEntity.setCreatedate(new Date());
|
||||||
ctpAttachmentDao.saveCtpAttachment(ctpAttachmentEntity);
|
this.save(ctpAttachmentEntity);
|
||||||
return ctpAttachmentEntity;
|
return ctpAttachmentEntity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue