Commit f873629b authored by 徐州's avatar 徐州

完结接口调试

parent 95f635e3
......@@ -48,12 +48,12 @@ db.driverClassName=oracle.jdbc.driver.OracleDriver
#db.url = jdbc:oracle:thin:@10.1.163.147:1521/orcl
# 现场测试 start -------------------------------------
db.url = jdbc:oracle:thin:@192.168.1.244:1521/orcl
db.username = zsb1016
db.password = 123456
#db.url = jdbc:oracle:thin:@192.168.30.140:1521:orcl
#db.username = zsb1
#db.url = jdbc:oracle:thin:@192.168.1.244:1521/orcl
#db.username = zsb1016
#db.password = 123456
db.url = jdbc:oracle:thin:@192.168.30.140:1521:orcl
db.username = zsb1
db.password = 123456
#db.username = zsb2107
#db.password = 123456
##db.username = zsb01
......
......@@ -147,6 +147,9 @@ fs-dwbm:708002
fs-qhbm:320100
fs-pjdm:32010122
fs-version:1.0.1
#收费项目编号,上线需要切为线上编码,10304240101为测试编码
fs-sfxmbh:10304240101
#fs-sfxmbh:103015601
#非税开票
EInvoiceContent:<Header><EInvoiceTag>CZ-EI-32</EInvoiceTag><EInvoiceID>0986189200-02101023</EInvoiceID><Version>1.1.0</Version></Header><EInvoiceData><Main><EInvoiceName>江苏省非税收入统一票据(电子)</EInvoiceName><EInvoiceCode>32010120</EInvoiceCode><EInvoiceNumber>{{pjdm}}</EInvoiceNumber><RandomNumber>{{random}}</RandomNumber><EInvoiceSpecimenCode>3201012010</EInvoiceSpecimenCode><SupervisorAreaCode>320100</SupervisorAreaCode><TotalAmount>{{yjje}}</TotalAmount><IssueDate>{{kprq}}</IssueDate><IssueTime>{{kpsj}}</IssueTime><InvoicingParty><InvoicingPartyCode>708002</InvoicingPartyCode><InvoicingPartyName>南京市城市建设费用征收服务中心</InvoicingPartyName><RecName>南京市城市建设费用征收服务中心</RecName><RecAcct>10105901040000062</RecAcct><RecOpBk>南京农行鼓楼支行</RecOpBk></InvoicingParty><PayerParty><PayerPartyType>2</PayerPartyType><PayerPartyCode/><PayerPartyName>{{jkr}}</PayerPartyName><PayerAcct/><PayerOpBk/></PayerParty><PayMode/><BizCode>{{lsh}}</BizCode><CurrencyType/><ExchangeRate/><Remark>{{beizhu}}</Remark><HandlingPerson>南京市城市建设费用征收服务中心</HandlingPerson><Checker/><SupervisorRemark/><InvoicingPartySeal><SealId>f2ae8a477d7247148adf2e5cd48630e6</SealId><SealName/><SealHash/></InvoicingPartySeal><SupervisorPartySeal><SealId>f2ae8a477d7247148adf2e5cd48630e6</SealId><SealName/><SealHash/></SupervisorPartySeal><MainExt><RelatedInvoiceCode/><RelatedInvoiceNumber/><PayCode>{{jkm}}</PayCode><BusinessNumber/><BusinessDate/><Gender/><Age/><Address/><School/><Faculty/><Major/><Classes/><StudentID/><MedicalType/><MedicalDate/><CaseNumber/><PatientNumber/><HospitalizationNumber/><DepartmentName/><InHospitalDate/><OutHospitalDate/><PrepayAmount/><RechargeAmount/><RefundAmount/><OrgType/><MedicalInsuranceType/><MedicalInsuranceID/><FundPayAmount/><OtherPayAmount/><AccountPayAmount/><OwnPayAmount/><SelfpaymentAmount/><SelfpaymentCost/><Custom1/><Custom2/><Custom3/><Custom4/><Custom5/><Custom6/><Custom7/><Custom8/><Custom9/><Custom10/><Custom11/><Custom12/></MainExt></Main><Details><Item><ItemCode>103015601</ItemCode><ItemName>城市基础设施配套费-城区</ItemName><ItemQuantity>{{yjmj}}</ItemQuantity><ItemUnit>元</ItemUnit><ItemStd>150.00</ItemStd><ItemAmount>{{yjje}}</ItemAmount><ItemRemark/><ItemExt><ItemDetailName/></ItemExt></Item></Details></EInvoiceData>
\ No newline at end of file
EInvoiceContent:<Header><EInvoiceTag>CZ-EI-32</EInvoiceTag><EInvoiceID>0986189200-02101023</EInvoiceID><Version>1.1.0</Version></Header><EInvoiceData><Main><EInvoiceName>江苏省非税收入统一票据(电子)</EInvoiceName><EInvoiceCode>{{EInvoiceCode}}</EInvoiceCode><EInvoiceNumber>{{EInvoiceNumber}}</EInvoiceNumber><RandomNumber>{{random}}</RandomNumber><EInvoiceSpecimenCode>3201012010</EInvoiceSpecimenCode><SupervisorAreaCode>320100</SupervisorAreaCode><TotalAmount>{{yjje}}</TotalAmount><IssueDate>{{kprq}}</IssueDate><IssueTime>{{kpsj}}</IssueTime><InvoicingParty><InvoicingPartyCode>708002</InvoicingPartyCode><InvoicingPartyName>南京市城市建设费用征收服务中心</InvoicingPartyName><RecName>南京市城市建设费用征收服务中心</RecName><RecAcct>10105901040000062</RecAcct><RecOpBk>南京农行鼓楼支行</RecOpBk></InvoicingParty><PayerParty><PayerPartyType>2</PayerPartyType><PayerPartyCode/><PayerPartyName>{{jkr}}</PayerPartyName><PayerAcct/><PayerOpBk/></PayerParty><PayMode/><BizCode>{{lsh}}</BizCode><CurrencyType/><ExchangeRate/><Remark>{{beizhu}}</Remark><HandlingPerson>南京市城市建设费用征收服务中心</HandlingPerson><Checker/><SupervisorRemark/><InvoicingPartySeal><SealId>f2ae8a477d7247148adf2e5cd48630e6</SealId><SealName/><SealHash/></InvoicingPartySeal><SupervisorPartySeal><SealId>f2ae8a477d7247148adf2e5cd48630e6</SealId><SealName/><SealHash/></SupervisorPartySeal><MainExt><RelatedInvoiceCode/><RelatedInvoiceNumber/><PayCode>{{jkm}}</PayCode><BusinessNumber/><BusinessDate/><Gender/><Age/><Address/><School/><Faculty/><Major/><Classes/><StudentID/><MedicalType/><MedicalDate/><CaseNumber/><PatientNumber/><HospitalizationNumber/><DepartmentName/><InHospitalDate/><OutHospitalDate/><PrepayAmount/><RechargeAmount/><RefundAmount/><OrgType/><MedicalInsuranceType/><MedicalInsuranceID/><FundPayAmount/><OtherPayAmount/><AccountPayAmount/><OwnPayAmount/><SelfpaymentAmount/><SelfpaymentCost/><Custom1/><Custom2/><Custom3/><Custom4/><Custom5/><Custom6/><Custom7/><Custom8/><Custom9/><Custom10/><Custom11/><Custom12/></MainExt></Main><Details><Item><ItemCode>{{itemCode}}</ItemCode><ItemName>城市基础设施配套费-城区</ItemName><ItemQuantity>{{yjmj}}</ItemQuantity><ItemUnit>元</ItemUnit><ItemStd>150.00</ItemStd><ItemAmount>{{yjje}}</ItemAmount><ItemRemark/><ItemExt><ItemDetailName/></ItemExt></Item></Details></EInvoiceData>
\ No newline at end of file
......@@ -31,8 +31,5 @@
<orderEntry type="library" exported="" name="lib" level="project" />
<orderEntry type="library" exported="" name="fr-applet-8.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="TomEE 8.5.47" level="application_server_libraries" />
<orderEntry type="library" name="netsign" level="project" />
<orderEntry type="library" name="crypto" level="project" />
<orderEntry type="library" name="ISFJ_v2_0_139_7_BAISC_JDK14" level="project" />
</component>
</module>
\ No newline at end of file
......@@ -19,7 +19,6 @@ import java.util.*;
*/
public class FsRequest {
private static String getProp(String key) {
return SysPropertiesUtil.getProperty(key);
}
......@@ -76,7 +75,7 @@ public class FsRequest {
map.put("memo",fstzs.getFstzsXm().getBeizhu());//备注
Map<String,String> mapDatail = new HashMap<>();
mapDatail.put("item_code","10304240101");//项目编号
mapDatail.put("item_code",getProp("fs-sfxmbh"));
mapDatail.put("std",fstzs.getYjje());//收费标准
mapDatail.put("number","1");//数量
mapDatail.put("amt",fstzs.getYjje());//金额
......@@ -154,7 +153,8 @@ public class FsRequest {
payCodeInfo.add(payCodeInfoMap);
map.put("pay_code_info",payCodeInfo);// 多张缴款书缴款完成后,开具电子票据需要传1张对应的缴款码
String xml = getProp("EInvoiceContent");
xml = xml.replaceAll("\\{\\{pjdm}}",getProp("fs-pjdm"));
xml = xml.replaceAll("\\{\\{EInvoiceCode}}",respPh.message.billBatchCode);
xml = xml.replaceAll("\\{\\{EInvoiceNumber}}",respPh.message.billNo);
xml = xml.replaceAll("\\{\\{random}}",new Random().nextInt(100000) + "");
xml = xml.replaceAll("\\{\\{yjje}}",fstzs.getYjje());
xml = xml.replaceAll("\\{\\{kprq}}",new SimpleDateFormat("yyyyMMdd").format(new Date()));
......@@ -164,12 +164,13 @@ public class FsRequest {
xml = xml.replaceAll("\\{\\{beizhu}}",fstzs.getFstzsXm().getBeizhu());
xml = xml.replaceAll("\\{\\{jkm}}",fstzs.getJkm());
xml = xml.replaceAll("\\{\\{yjmj}}",fstzs.getYjmj());
xml = xml.replaceAll("\\{\\{yjmj}}",fstzs.getYjmj());
xml = xml.replaceAll("\\{\\{itemCode}}",getProp("fs-sfxmbh"));
map.put("invoice_data",xml);// 电子票据头部、票面信息进行base64编码后内容。
String xmlBase64 = Base64.getEncoder().encodeToString(xml.getBytes());
map.put("invoice_data",xmlBase64);// 电子票据头部、票面信息进行base64编码后内容。
Map<String,String> signInfo = new HashMap<>();
signInfo.put("value",Base64.getEncoder().encodeToString(xml.getBytes()));//对电子票据头部、票面信息的签名值(签名原文为电子票据数据 Header和EInvoiceData内容),base64格式。
signInfo.put("value",xmlBase64);//对电子票据头部、票面信息的签名值(签名原文为电子票据数据 Header和EInvoiceData内容),base64格式。
signInfo.put("format","DETACH");//签名格式类型,目前固定 DETACH
signInfo.put("algorithm","SM2");//摘要算法,默认SM2
signInfo.put("time",new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()));//签名时间
......
package com.jshx.fstzs.fsutil;
import cn.com.infosec.netsign.agent.NetSignAgent;
import cn.com.infosec.netsign.agent.NetSignResult;
import cn.com.infosec.netsign.agent.exception.NetSignAgentException;
import cn.com.infosec.netsign.agent.exception.ServerProcessException;
import java.security.cert.X509Certificate;
public class SignUtil {
public static void init() {
try {
NetSignAgent.initialize();
} catch (NetSignAgentException e) {
e.printStackTrace();
}
}
public static String sign(String text) {
try {
//签名原文
byte[] laintext = text.getBytes() ;
//签名证书DN,null表示用服务器默认证书进行签名
String subject = null ;
//摘要算法,null表示用服务器默认的摘要算法
String digestAlg = null ;
//是否做TSA签名
boolean useTSA = false ;
//签名
NetSignResult result = NetSignAgent.detachedSignature(laintext, subject , digestAlg , useTSA ) ;
//获取byte形式的签名结果
byte[] signedText = result.getByteArrayResult( NetSignResult.SIGN_TEXT ) ;
//获取base64编码后的签名结果
String signedTextB64 = result.getStringResult( NetSignResult.SIGN_TEXT ) ;
return signedTextB64;
} catch ( NetSignAgentException e ) {
e.printStackTrace();
System.out.println( "errorCode:" + e.getErrorCode() );
System.out.println( "errorMsg:" + e.getMessage() );
} catch (ServerProcessException e ) {
e.printStackTrace();
System.out.println( "errorCode:" + e.getErrorCode() );
System.out.println( "errorMsg:" + e.getMessage() );
}
return null;
}
public static void checkSign(String text) {
try {
// 签名原文
byte[] laintext = text.getBytes();
// base64编码的签名
String signedText = "…....";
// base64编码的TSA
String tsaText = "….....";
// 是否需要返回签名证书
boolean needCert = false;
// 验签名
NetSignResult result = NetSignAgent.detachedVerify( laintext ,signedText , tsaText , needCert );
// 签名证书主题
result.getStringResult( NetSignResult.SIGN_SUBJECT );
// 签名证书颁发者主题为
result.getStringResult( NetSignResult.SIGN_ISSUER_SUBJECT );
// 签名证书序列号为
result.getStringResult( NetSignResult.SIGN_SER_NUMBER );
// 签名证书起始时间为
result.getStringResult( NetSignResult.SIGN_START_TIME );
// 签名证书终止时间为
result.getStringResult( NetSignResult.SIGN_END_TIME );
// 签名证书
X509Certificate cert = ( X509Certificate ) result
.getResult( NetSignResult.SIGN_CERT );
} catch ( NetSignAgentException e ) {
e.printStackTrace();
System.out.println( "errorCode:" + e.getErrorCode() );
System.out.println( "errorMsg:" + e.getMessage() );
} catch ( ServerProcessException e ) {
e.printStackTrace();
System.out.println( "errorCode:" + e.getErrorCode() );
System.out.println( "errorMsg:" + e.getMessage() );
}
}
public static void main(String[] args) {
System.out.println(sign("Hello"));
}
}
######server ip######
#ServerIP=192.168.2.248,192.168.2.248
ServerIP=172.16.250.115
#ServerPort=40019,5555
ServerPort=18005
Timeout=30000,30000
#�Ƿ��Զ������������
servicetestistest=yes
#�Զ������������ʱ����
servicetestinterval=10000
#���ӷ���ģʽ
#1:��̬���з��䣨HA����ռ��
#2:��̬ƽ�����䣨���أ���С�������ȣ�
#3:��̬���з��䣨HA������ռ��
#4:��̬��ѯ�����أ���ѯ��
connectionmode=1
######Server ���ܹ�Կ֤��,der�����cer�ļ�
#ServerEncCert=/opt/infosec/NetSignServer20/NetSignServer/cert/rootcert/sheca.cer
######�ͻ���ID######
#ClientID=12345678
#0-���� 1-������
CommunicateMode=1
######�Ƿ�ʹ��Socket��######
UsedConnectionPool=false
######Socket�����������######
MaxConnections=5
#######ѹ��ѡ��######
#true-�����ݽ���ѹ�� false-�����ݲ�����ѹ��
ZipMode=false
#��Ҫѹ�������ݵķ�Χ����Сֵ��
#��KΪ��λ������200�ͱ�ʾ
#���ݴ�200K��ʼ��Ҫ����ѹ������
#��ZIPModeΪtrue��ʱ�򣬴�������Ч
#����û������ã���Ĭ��ֵ��200
MinZipSize=200
#�������ͣ����ڶ�֤�������Ͱ䷢��������б��룬�����server�˱��뷽ʽ����һ�£�
#������ʱʹ��ϵͳĬ�ϱ���
encoding=GBK
#����DN��˳��0����Ȼ˳��1:CN����ǰ��2��CN�����
orderdn=0
gc=0
#����֤�����кŵ���ʽ��0:16�����ַ�����1:��һλ��0��16�����ַ�����2:10������
snmode=1
......@@ -449,7 +449,7 @@ public class FstzsAction extends BaseAction {
*/
public void kaipiao() throws IOException {
boolean result = true;
String message = "OK";
String message = "操作成功";
Fstzs fstzs = fstzsService.getById(id);
FstzsXm xm = fstzsXmService.getBySlbh(fstzs.getSlbh());
......@@ -494,6 +494,7 @@ public class FstzsAction extends BaseAction {
/**
* 缴费状态查询
* FstzsDsrw,定时任务也在查询状态,所以这边修改了,那边也需要同步修改
*/
public void queryJfzt() throws IOException {
Map<String, Object> paraMap = new HashMap<String, Object>();
......@@ -513,8 +514,6 @@ public class FstzsAction extends BaseAction {
FsRequest.jiaokuanzt(i);
return i;
}).forEach(i-> fstzsService.update(i));
}
public Pagination getPagination() {
......
package com.jshx.fstzs.web;
import com.alibaba.fastjson.JSONObject;
import com.jshx.core.base.vo.Pagination;
import com.jshx.core.utils.SysPropertiesUtil;
import com.jshx.fstzs.entity.Fstzs;
import com.jshx.fstzs.fsutil.FsRequest;
import com.jshx.fstzs.service.FstzsService;
import com.jshx.jkfsjlb.entity.Jkfsjlb;
import com.jshx.jkfsjlb.service.JkfsjlbService;
import com.jshx.tbshxk.entity.Tbshxk;
import com.jshx.tbshxk.service.TbshxkService;
import org.activiti.editor.language.json.converter.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Controller;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
@Controller
public class FstzsDsrw {
@Autowired
FstzsService fstzsService;
//每天11,12,13点刷新缴费状态
@Scheduled(cron = "0 0 11,12,13 * * ?")
public void queryJfzt() {
Map<String, Object> paraMap = new HashMap<String, Object>();
paraMap.put("status",new ArrayList<Integer>(){{
add(1);//已激活
}});
//1,查询全部未激活的信息
List<Fstzs> list = fstzsService.findList(paraMap);
list.stream().map(i-> {
//2,循环接口请求缴费状态
FsRequest.jiaokuanzt(i);
return i;
}).forEach(i-> fstzsService.update(i));
}
}
\ No newline at end of file
......@@ -76,4 +76,5 @@ public class Jkfsdsrw {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
System.err.println("接口重发定时任务在:"+dateFormat.format(new Date())+"已执行完毕。");
}
}
\ No newline at end of file
......@@ -13,6 +13,9 @@
<isNotEmpty property="zslxdbh">
<![CDATA[and t.zslxdbh like :zslxdbh]]>
</isNotEmpty>
<isNotEmpty property="slbh">
<![CDATA[and t.slbh like :slbh]]>
</isNotEmpty>
<isNotEmpty property="xxylbbh">
<![CDATA[and t.xxylbbh like :xxylbbh]]>
</isNotEmpty>
......
......@@ -17,6 +17,8 @@ import javax.servlet.http.HttpServletResponse;
import com.jshx.core.utils.StringUtil;
import com.jshx.module.admin.web.action.CommonAction;
import com.jshx.rfxm.entity.Rfxm;
import com.jshx.rfxm.service.RfxmService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.struts2.ServletActionContext;
import org.hibernate.LobHelper;
......@@ -62,6 +64,9 @@ public class TbshxkAction extends BaseAction
@Autowired
private TbshxkService tbshxkService;
@Autowired
private RfxmService rfxmService;
/**
* 修改新增标记,add为新增、mod为修改
*/
......@@ -244,6 +249,15 @@ public class TbshxkAction extends BaseAction
tbshxk1.setJsdw(jsdw);
tbshxk1.setGcxmmc(gcxmmc);
tbshxkService.update(tbshxk1);
//TODO 更新缴款通知书状态
HashMap<String, Object> rfxmParam = new HashMap<>();
rfxmParam.put("slbh",tbshxk1.getSlbh());
List<Rfxm> rfxmList = rfxmService.findRfxm(rfxmParam);
if(rfxmList != null && rfxmList.size() > 0) {//同步成功记录下,不允许再次同步了
Rfxm rfxm = rfxmList.get(0);
rfxm.setIsTb(1);
rfxmService.update(rfxm);
}
}
}catch(Exception e){
this.getResponse().getWriter().println("{\"result\":false}");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment