凭证相关--接口批次号跳号调整
This commit is contained in:
parent
7f5e4363dd
commit
9a2f573098
@ -124,6 +124,8 @@ public class VoucherToNCforAssistContract implements Job{
|
||||
String sql="SELECT id,CONTRACT_NUMBER FROM LB_CONTRACT_INFO WHERE CONTRACT_NUMBER NOT IN(SELECT TABLE_NUM FROM NCXML_DETAIL_RECORDS WHERE FLAG = '1' AND XML_TYPE='"+type+"')";
|
||||
List<Map<String, String>> rs = DataOperatorUtil.getDataBySql(Sqlca,sql,null);
|
||||
if(rs!=null && rs.size()>0) {
|
||||
// Åú´ÎºÅ
|
||||
String batch = "";
|
||||
// 生成xml头
|
||||
Document document = DocumentHelper.createDocument(); // 生成每个xml的头
|
||||
Element root = document.addElement("ufinterface");
|
||||
@ -138,8 +140,6 @@ public class VoucherToNCforAssistContract implements Job{
|
||||
root.addAttribute("replace",replace);
|
||||
root.addAttribute("roottag","");
|
||||
root.addAttribute("sender",sender);
|
||||
// »ñÈ¡Åú´ÎºÅ
|
||||
String batch = SerialNumberUtil.getVoucherPCNumber(Sqlca);
|
||||
// 遍历结果集
|
||||
for (Map<String, String> map : rs) {
|
||||
contract_number=(map.get("CONTRACT_NUMBER")==null)?"":map.get("CONTRACT_NUMBER");
|
||||
@ -173,6 +173,9 @@ public class VoucherToNCforAssistContract implements Job{
|
||||
BizObject record=JBOFactory.createBizObjectQuery(NCXML_DETAIL_RECORDS.CLASS_NAME, "BILLID='"+uuid+"'").getSingleResult(false);
|
||||
// 等于null说明新数据, 新增入记录表
|
||||
if(record==null || "".equals(record)) {
|
||||
if("".equals(batch)) {
|
||||
batch = SerialNumberUtil.getVoucherPCNumber(Sqlca);
|
||||
}
|
||||
insertSql="INSERT INTO NCXML_DETAIL_RECORDS(BILLID,XML_TYPE,TABLE_NUM,FLAG,CREATE_TIME,BATCH) VALUES('"+uuid+"','"+type+"','"+contract_number+"','1','"+year_month_days+"','"+batch+"')";
|
||||
Sqlca.executeSQL(insertSql);
|
||||
logger.info("辅助合同记录语句: " + insertSql);
|
||||
@ -357,8 +360,8 @@ public class VoucherToNCforAssistContract implements Job{
|
||||
// 判断集合为否为null, 不为空遍历集合, 获取旧数据的批次号
|
||||
if(batchList != null || batchList.size()>0) {
|
||||
// 定义当前批次, 错误记录数
|
||||
int con=0;
|
||||
for (String old_batch : batchList) {
|
||||
int con=0;
|
||||
// 查询集合, 获取旧批次的失败总数
|
||||
String selectSql="SELECT BATCH,COUNT(BILLID) CON FROM ncxml_detail_records WHERE flag !=1 AND xml_type='"+type+"' AND BATCH='"+old_batch+"' GROUP BY BATCH";
|
||||
List<Map<String,String>> dataList=DataOperatorUtil.getDataBySql(Sqlca, selectSql,null);
|
||||
@ -408,8 +411,8 @@ public class VoucherToNCforAssistContract implements Job{
|
||||
// 判断集合为否为null, 不为空遍历集合, 获取旧数据的批次号
|
||||
if(batchList != null) {
|
||||
// 定义当前批次, 错误记录数
|
||||
int con=0;
|
||||
for (String old_batch : batchList) {
|
||||
int con=0;
|
||||
// 查询集合, 获取旧批次的失败总数
|
||||
String selectSql="SELECT BATCH,COUNT(BILLID) CON FROM ncxml_detail_records WHERE flag !=1 AND xml_type='"+type+"' AND BATCH='"+old_batch+"' GROUP BY BATCH;";
|
||||
List<Map<String,String>> dataList=DataOperatorUtil.getDataBySql(Sqlca, selectSql,null);
|
||||
|
||||
@ -136,6 +136,8 @@ public class VoucherToNCforCustomer implements Job{
|
||||
String sql="SELECT max(cif.customerid) id,cif.customer_num,MAX(cif.customername)customername,MAX(cif.customertype)customertype,MAX(cif.customerid) customerid,MAX(cif.certid) as certid FROM CUSTOMER_INFO cif LEFT JOIN lb_union_lessee lul ON lul.customer_id=cif.customerid LEFT JOIN lb_contract_info lci ON lci.id=lul.contract_id WHERE lci.contract_status >='31' AND cif.customer_num NOT IN (SELECT TABLE_NUM FROM NCXML_DETAIL_RECORDS WHERE FLAG = '1' AND XML_TYPE = '"+type+"') GROUP BY CIF.CUSTOMER_NUM ";
|
||||
List<Map<String, String>> rs = DataOperatorUtil.getDataBySql(Sqlca,sql,null);
|
||||
if(rs != null && rs.size()>0) {
|
||||
// Åú´ÎºÅ
|
||||
String batch = "";
|
||||
// 记录历史批次号
|
||||
List<String> batchList= new ArrayList<String>();
|
||||
// 记录当前批次传输总量
|
||||
@ -154,8 +156,6 @@ public class VoucherToNCforCustomer implements Job{
|
||||
root.addAttribute("replace", replace);
|
||||
root.addAttribute("roottag", "");
|
||||
root.addAttribute("sender", sender);
|
||||
// 生成批次号
|
||||
String batch = SerialNumberUtil.getVoucherPCNumber(Sqlca);
|
||||
// 遍历要传输的结果集
|
||||
for(int i=0;i<rs.size();i++) {
|
||||
customer_num=rs.get(i).get("customer_num"); // 获取客户编号
|
||||
@ -240,6 +240,9 @@ public class VoucherToNCforCustomer implements Job{
|
||||
BizObject record=JBOFactory.createBizObjectQuery(NCXML_DETAIL_RECORDS.CLASS_NAME, "BILLID='"+uuid+"'").getSingleResult(false);
|
||||
// 等于null说明新数据, 新增入记录表
|
||||
if(record==null || "".equals(record)) {
|
||||
if("".equals(batch)) {
|
||||
batch = SerialNumberUtil.getVoucherPCNumber(Sqlca);
|
||||
}
|
||||
// 将客户xml信息写入状态表中
|
||||
insertSql="INSERT INTO NCXML_DETAIL_RECORDS(BILLID,XML_TYPE,TABLE_NUM,FLAG,CREATE_TIME,BATCH) VALUES('"+uuid+"','"+type+"','"+customer_num+"','1','"+year_month_days+"','"+batch+"')";
|
||||
Sqlca.executeSQL(insertSql);
|
||||
@ -426,8 +429,8 @@ public class VoucherToNCforCustomer implements Job{
|
||||
// 判断集合为否为null, 不为空遍历集合, 获取旧数据的批次号
|
||||
if(batchList != null || batchList.size()>0) {
|
||||
// 定义当前批次, 错误记录数
|
||||
int con=0;
|
||||
for (String old_batch : batchList) {
|
||||
int con=0;
|
||||
// 查询集合, 获取旧批次的失败总数
|
||||
String selectSql="SELECT BATCH,COUNT(BILLID) CON FROM ncxml_detail_records WHERE flag !=1 AND xml_type='"+type+"' AND BATCH='"+old_batch+"' GROUP BY BATCH";
|
||||
List<Map<String,String>> dataList=DataOperatorUtil.getDataBySql(Sqlca, selectSql,null);
|
||||
@ -477,8 +480,8 @@ public class VoucherToNCforCustomer implements Job{
|
||||
// 判断集合为否为null, 不为空遍历集合, 获取旧数据的批次号
|
||||
if(batchList != null) {
|
||||
// 定义当前批次, 错误记录数
|
||||
int con=0;
|
||||
for (String old_batch : batchList) {
|
||||
int con=0;
|
||||
// 查询集合, 获取旧批次的失败总数
|
||||
String selectSql="SELECT BATCH,COUNT(BILLID) CON FROM ncxml_detail_records WHERE flag !=1 AND xml_type='"+type+"' AND BATCH='"+old_batch+"' GROUP BY BATCH;";
|
||||
List<Map<String,String>> dataList=DataOperatorUtil.getDataBySql(Sqlca, selectSql,null);
|
||||
|
||||
@ -146,6 +146,8 @@ public class VoucherToNCforDistributor implements Job{
|
||||
String sql="SELECT id,DISTRIBUTOR_NAME,DISTRIBUTOR_CODING,DISTRIBUTOR_ADDRESS,FACT_ADDR,PROVINCES,POSTCODE,REGISTERED_ADDR,BUSINESS_SCOPE,SUBSIDIARY_COMPANY,TYPE,BUSINESS_LICENSE_NO,DISTRIBUTOR_STATUS,E_MAIL,FAX_NUMBER,REGISTERED_ASSET,DISTRIBUTORER,MBAFC_EARLYDISBURSEMENT_TYPE,URL FROM DISTRIBUTOR_INFO WHERE (DISTRIBUTOR_CODING NOT IN(SELECT TABLE_NUM FROM NCXML_DETAIL_RECORDS WHERE FLAG ='1' AND XML_TYPE='"+type+"') and DISTRIBUTOR_CODING not in(SELECT cust_id FROM customer_list)) and DISTRIBUTOR_STATUS='distributor_status04' ";
|
||||
List<Map<String, String>> rs = DataOperatorUtil.getDataBySql(Sqlca,sql,null);
|
||||
if(rs !=null && rs.size()>0) {
|
||||
// Åú´ÎºÅ
|
||||
String batch = "";
|
||||
// 设置xml标签头
|
||||
Document document = DocumentHelper.createDocument();
|
||||
Element root = document.addElement("ufinterface");
|
||||
@ -158,8 +160,6 @@ public class VoucherToNCforDistributor implements Job{
|
||||
root.addAttribute("replace", replace);
|
||||
root.addAttribute("roottag", "");
|
||||
root.addAttribute("sender",sender);
|
||||
// »ñÈ¡Åú´ÎºÅ
|
||||
String batch = SerialNumberUtil.getVoucherPCNumber(Sqlca);
|
||||
|
||||
// 遍历要传输的结果集
|
||||
for(int i=0; i<rs.size();i++) {
|
||||
@ -317,6 +317,9 @@ public class VoucherToNCforDistributor implements Job{
|
||||
BizObject record=JBOFactory.createBizObjectQuery(NCXML_DETAIL_RECORDS.CLASS_NAME, "BILLID='"+uuid+"'").getSingleResult(false);
|
||||
// 等于null说明新数据, 新增入记录表
|
||||
if(record==null || "".equals(record)) {
|
||||
if("".equals(batch)) {
|
||||
batch = SerialNumberUtil.getVoucherPCNumber(Sqlca);
|
||||
}
|
||||
insertSql="INSERT INTO NCXML_DETAIL_RECORDS(BILLID,XML_TYPE,TABLE_NUM,FLAG,CREATE_TIME,BATCH) VALUES('"+uuid+"','"+type+"','"+DISTRIBUTOR_CODING+"','1','"+year_month_days+"','"+batch+"')";
|
||||
Sqlca.executeSQL(insertSql);
|
||||
logger.info("经销商记录语句: "+ insertSql);
|
||||
@ -502,8 +505,8 @@ public class VoucherToNCforDistributor implements Job{
|
||||
// 判断集合为否为null, 不为空遍历集合, 获取旧数据的批次号
|
||||
if(batchList != null || batchList.size()>0) {
|
||||
// 定义当前批次, 错误记录数
|
||||
int con=0;
|
||||
for (String old_batch : batchList) {
|
||||
int con=0;
|
||||
// 查询集合, 获取旧批次的失败总数
|
||||
String selectSql="SELECT BATCH,COUNT(BILLID) CON FROM ncxml_detail_records WHERE flag !=1 AND xml_type='"+type+"' AND BATCH='"+old_batch+"' GROUP BY BATCH";
|
||||
List<Map<String,String>> dataList=DataOperatorUtil.getDataBySql(Sqlca, selectSql,null);
|
||||
@ -553,8 +556,8 @@ public class VoucherToNCforDistributor implements Job{
|
||||
// 判断集合为否为null, 不为空遍历集合, 获取旧数据的批次号
|
||||
if(batchList != null) {
|
||||
// 定义当前批次, 错误记录数
|
||||
int con=0;
|
||||
for (String old_batch : batchList) {
|
||||
int con=0;
|
||||
// 查询集合, 获取旧批次的失败总数
|
||||
String selectSql="SELECT BATCH,COUNT(BILLID) CON FROM ncxml_detail_records WHERE flag !=1 AND xml_type='"+type+"' AND BATCH='"+old_batch+"' GROUP BY BATCH;";
|
||||
List<Map<String,String>> dataList=DataOperatorUtil.getDataBySql(Sqlca, selectSql,null);
|
||||
|
||||
@ -152,8 +152,6 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
XMLWriter writer=null;
|
||||
// 记录表类别
|
||||
String type="voucher";
|
||||
// 批次号
|
||||
String batch="";
|
||||
// xml主键id
|
||||
String uuid="";
|
||||
// 获取科目id
|
||||
@ -184,6 +182,8 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
// 获取生成xml文件的数量, 最大循环值=c+1
|
||||
int c = (int)(a / b);
|
||||
for (int i = 0; i <=c && a>0; i++) {
|
||||
// 批次号
|
||||
String batch="";
|
||||
// 记录当前批次传输总量
|
||||
int count=0;
|
||||
// 记录历史批次号
|
||||
@ -202,7 +202,6 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
root.addAttribute("replace", replace);
|
||||
root.addAttribute("roottag", "");
|
||||
root.addAttribute("sender", sender);
|
||||
batch = SerialNumberUtil.getVoucherPCNumber(Sqlca);
|
||||
for (int x = i * b; x < (i + 1) * b && x < a; x++) { // 决定当前xml生成的数据量
|
||||
// 获取凭证编号
|
||||
String F3=list.get(x).get("f3");
|
||||
@ -215,7 +214,7 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
List<Map<String, String>> v1 = DataOperatorUtil.getDataBySql(Sqlca,sql1,map);
|
||||
|
||||
// 获取v8表贷方数据
|
||||
String sql2 = "SELECT f5,f6,f8,f15,f51,f52,f59,f60,f65,f73,f74,f75 FROM VOUCHER_V8 WHERE F3=:F3 AND ENTRYDC='-1'";
|
||||
String sql2 = "SELECT f1,f5,f6,f8,f15,f51,f52,f59,f60,f65,f73,f74,f75 FROM VOUCHER_V8 WHERE F3=:F3 AND ENTRYDC='-1'";
|
||||
List<Map<String, String>> v2 = DataOperatorUtil.getDataBySql(Sqlca,sql2,map);
|
||||
|
||||
// 获取v8表公共信息
|
||||
@ -223,7 +222,7 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
//OWNED_COMPANY=map2.get("f49"); // 本方id
|
||||
ACC_YEAR = map2.get("f51"); // 会计期间/年
|
||||
ACC_MONTH =map2.get("f52"); // 会计期间/月
|
||||
timeAll =map2.get("f15"); // 制单时间
|
||||
timeAll =map2.get("f1"); // 制单时间
|
||||
}
|
||||
|
||||
// 获取本方信息
|
||||
@ -500,6 +499,10 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
// 根据id查询记录表是否已经记录过, 没有记录过使用当前批次号记录, 如果已经记录了, 则不操作
|
||||
BizObject record=JBOFactory.createBizObjectQuery(NCXML_DETAIL_RECORDS.CLASS_NAME, "BILLID='"+uuid+"'").getSingleResult(false);
|
||||
if(record==null || "".equals(record)) {
|
||||
// 有新数据, 当前批次批次号为空才会生成
|
||||
if("".equals(batch)) {
|
||||
batch = SerialNumberUtil.getVoucherPCNumber(Sqlca);
|
||||
}
|
||||
// 等于null说明新数据, 新增入记录表
|
||||
insertSql="INSERT INTO NCXML_DETAIL_RECORDS(BILLID,XML_TYPE,TABLE_NUM,FLAG,CREATE_TIME,BATCH) VALUES('"+uuid+"','"+type+"','"+F3+"','1','"+year_month_days+"','"+batch+"')";
|
||||
Sqlca.executeSQL(insertSql);
|
||||
@ -686,8 +689,8 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
// 判断集合为否为null, 不为空遍历集合, 获取旧数据的批次号
|
||||
if(batchList != null || batchList.size()>0) {
|
||||
// 定义当前批次, 错误记录数
|
||||
int con=0;
|
||||
for (String old_batch : batchList) {
|
||||
int con=0;
|
||||
// 查询集合, 获取旧批次的失败总数
|
||||
String selectSql="SELECT BATCH,COUNT(BILLID) CON FROM ncxml_detail_records WHERE flag !=1 AND xml_type='"+type+"' AND BATCH='"+old_batch+"' GROUP BY BATCH";
|
||||
List<Map<String,String>> dataList=DataOperatorUtil.getDataBySql(Sqlca, selectSql,null);
|
||||
@ -737,8 +740,8 @@ public class VoucherToNCforVoucherPZ implements Job{
|
||||
// 判断集合为否为null, 不为空遍历集合, 获取旧数据的批次号
|
||||
if(batchList != null) {
|
||||
// 定义当前批次, 错误记录数
|
||||
int con=0;
|
||||
for (String old_batch : batchList) {
|
||||
int con=0;
|
||||
// 查询集合, 获取旧批次的失败总数
|
||||
String selectSql="SELECT BATCH,COUNT(BILLID) CON FROM ncxml_detail_records WHERE flag !=1 AND xml_type='"+type+"' AND BATCH='"+old_batch+"' GROUP BY BATCH;";
|
||||
List<Map<String,String>> dataList=DataOperatorUtil.getDataBySql(Sqlca, selectSql,null);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user