查询发票批量导入结果代码调整
This commit is contained in:
parent
3e42ec3616
commit
38773ef16a
|
@ -80,7 +80,15 @@ public class InvoiceEntity extends BaseEntity {
|
||||||
private String yd_res_field;//进项发票批量导入返回流水号字段
|
private String yd_res_field;//进项发票批量导入返回流水号字段
|
||||||
private String import_result_field;//进项发票批量导入返回结果字段
|
private String import_result_field;//进项发票批量导入返回结果字段
|
||||||
private String import_result;//进项发票批量导入返回结果
|
private String import_result;//进项发票批量导入返回结果
|
||||||
|
private String bill_code;//发票批量导入单号
|
||||||
|
|
||||||
|
public String getBill_code() {
|
||||||
|
return bill_code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBill_code(String bill_code) {
|
||||||
|
this.bill_code = bill_code;
|
||||||
|
}
|
||||||
|
|
||||||
public String getTab_name() {
|
public String getTab_name() {
|
||||||
return tab_name;
|
return tab_name;
|
||||||
|
|
|
@ -70,6 +70,15 @@
|
||||||
<result property="invoice_number" column="invoice_number" />
|
<result property="invoice_number" column="invoice_number" />
|
||||||
<result property="url" column="url" />
|
<result property="url" column="url" />
|
||||||
<result property="result_status" column="result_status" />
|
<result property="result_status" column="result_status" />
|
||||||
|
<result property="summaryId" column="summaryId" />
|
||||||
|
<result property="input_result_status_filed" column="input_result_status_filed" />
|
||||||
|
<result property="input_result_status" column="input_result_status" />
|
||||||
|
<result property="yd_result" column="yd_result" />
|
||||||
|
<result property="tab_name" column="tab_name" />
|
||||||
|
<result property="yd_res_field" column="yd_res_field" />
|
||||||
|
<result property="import_result_field" column="import_result_field" />
|
||||||
|
<result property="import_result" column="import_result" />
|
||||||
|
<result property="bill_code" column="bill_code" />
|
||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
@ -90,7 +99,7 @@
|
||||||
<select id="queryInputInvoiceResult" resultMap="get-InvoiceEntity-result" parameterType="com.hzya.frame.seeyon.invoice.entity.InvoiceEntity">
|
<select id="queryInputInvoiceResult" resultMap="get-InvoiceEntity-result" parameterType="com.hzya.frame.seeyon.invoice.entity.InvoiceEntity">
|
||||||
select
|
select
|
||||||
*
|
*
|
||||||
from v_hzya_invoice_import where push_status is not null and yd_result is not null
|
from v_hzya_invoice_import where push_status is not null and yd_result is not null and import_result is null
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--通过主键修改方法-->
|
<!--通过主键修改方法-->
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.hzya.frame.seeyon.invoice.entity;
|
||||||
|
|
||||||
|
public enum InvoiceImportState {
|
||||||
|
inputZero("0","进行中"),
|
||||||
|
inputOne("1","全部成功"),
|
||||||
|
inputTwo("2","部分失败"),
|
||||||
|
inputThree("3","全部失败");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
//值
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
InvoiceImportState(String type, String value){
|
||||||
|
this.type=type;
|
||||||
|
this.value=value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String invoiceStateGetValue(String type){
|
||||||
|
for (InvoiceImportState invoiceState : InvoiceImportState.values()){
|
||||||
|
if(invoiceState.getType()==type||invoiceState.getType().equals(type)){
|
||||||
|
return invoiceState.getValue().toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,6 +16,7 @@ import com.hzya.frame.seeyon.entity.CtpFileEntity;
|
||||||
import com.hzya.frame.seeyon.invoice.dao.IInvoiceDao;
|
import com.hzya.frame.seeyon.invoice.dao.IInvoiceDao;
|
||||||
import com.hzya.frame.seeyon.invoice.dao.IInvoiceDetailsDao;
|
import com.hzya.frame.seeyon.invoice.dao.IInvoiceDetailsDao;
|
||||||
import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity;
|
import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity;
|
||||||
|
import com.hzya.frame.seeyon.invoice.entity.InvoiceImportState;
|
||||||
import com.hzya.frame.seeyon.invoice.entity.InvoiceState;
|
import com.hzya.frame.seeyon.invoice.entity.InvoiceState;
|
||||||
import com.hzya.frame.seeyon.invoice.service.IInvoiceService;
|
import com.hzya.frame.seeyon.invoice.service.IInvoiceService;
|
||||||
import com.hzya.frame.seeyon.util.OARestUtil;
|
import com.hzya.frame.seeyon.util.OARestUtil;
|
||||||
|
@ -179,7 +180,7 @@ public class InvoiceServiceImpl extends BaseService<InvoiceEntity, String> imple
|
||||||
logger.info("=====调用杭泰税务查询申请单详情的返回参数为:{}===========", result);
|
logger.info("=====调用杭泰税务查询申请单详情的返回参数为:{}===========", result);
|
||||||
JSONObject resultJson = JSONObject.parseObject(result);
|
JSONObject resultJson = JSONObject.parseObject(result);
|
||||||
if (!resultJson.getBoolean("flag")) {
|
if (!resultJson.getBoolean("flag")) {
|
||||||
saveTaskLivingDetails(entity.getId(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false, "");
|
saveTaskLivingDetails(entity.getSerial_number(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false, "QueryInvoiceResultPluginInitializer");
|
||||||
} else {
|
} else {
|
||||||
JSONObject attribute = resultJson.getJSONObject("attribute");
|
JSONObject attribute = resultJson.getJSONObject("attribute");
|
||||||
if ("0".equals(attribute.getString("code"))) {
|
if ("0".equals(attribute.getString("code"))) {
|
||||||
|
@ -231,6 +232,7 @@ public class InvoiceServiceImpl extends BaseService<InvoiceEntity, String> imple
|
||||||
ManyfileUpload(fileOfd, entity, sub_reference, att_reference, jsonObject);
|
ManyfileUpload(fileOfd, entity, sub_reference, att_reference, jsonObject);
|
||||||
logger.info("========ofd文件上传OA完成========");
|
logger.info("========ofd文件上传OA完成========");
|
||||||
}
|
}
|
||||||
|
saveTaskLivingDetails(entity.getSerial_number(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), true, "QueryInvoiceResultPluginInitializer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
@ -240,6 +242,7 @@ public class InvoiceServiceImpl extends BaseService<InvoiceEntity, String> imple
|
||||||
entity.setId(entity.getSerial_number());
|
entity.setId(entity.getSerial_number());
|
||||||
invoiceDao.updateInvoiceResult(entity);
|
invoiceDao.updateInvoiceResult(entity);
|
||||||
logger.info("=======将开票结果回写OA完毕======");
|
logger.info("=======将开票结果回写OA完毕======");
|
||||||
|
saveTaskLivingDetails(entity.getSerial_number(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false, "QueryInvoiceResultPluginInitializer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -268,6 +271,7 @@ public class InvoiceServiceImpl extends BaseService<InvoiceEntity, String> imple
|
||||||
entity.setDataSourceCode("HT-OA");
|
entity.setDataSourceCode("HT-OA");
|
||||||
JSONObject jsonObject=new JSONObject();
|
JSONObject jsonObject=new JSONObject();
|
||||||
jsonObject.put("serialNumber",entity.getYd_result());
|
jsonObject.put("serialNumber",entity.getYd_result());
|
||||||
|
logger.info("=====调用杭泰税务查询发票批量录入结果的请求参数为:{}===========",jsonObject.toJSONString());
|
||||||
//发送数据
|
//发送数据
|
||||||
String result = HttpRequest.post(url).
|
String result = HttpRequest.post(url).
|
||||||
header("appId", "800060").
|
header("appId", "800060").
|
||||||
|
@ -280,7 +284,7 @@ public class InvoiceServiceImpl extends BaseService<InvoiceEntity, String> imple
|
||||||
logger.info("=====调用杭泰税务查询发票批量录入结果的返回参数为:{}===========",result);
|
logger.info("=====调用杭泰税务查询发票批量录入结果的返回参数为:{}===========",result);
|
||||||
JSONObject resultJson = JSONObject.parseObject(result);
|
JSONObject resultJson = JSONObject.parseObject(result);
|
||||||
if (!resultJson.getBoolean("flag")) {
|
if (!resultJson.getBoolean("flag")) {
|
||||||
saveTaskLivingDetails(entity.getSerial_number(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false,"");
|
saveTaskLivingDetails(entity.getId(), entity.getBill_code(), jsonObject.toJSONString(), resultJson.toJSONString(), false,"QueryInputInvoiceResultPluginInitializer");
|
||||||
} else {
|
} else {
|
||||||
JSONObject attribute = resultJson.getJSONObject("attribute");
|
JSONObject attribute = resultJson.getJSONObject("attribute");
|
||||||
if("0".equals(attribute.getString("code"))) {
|
if("0".equals(attribute.getString("code"))) {
|
||||||
|
@ -291,11 +295,11 @@ public class InvoiceServiceImpl extends BaseService<InvoiceEntity, String> imple
|
||||||
if(serialNumber.equals(entity.getYd_result())){
|
if(serialNumber.equals(entity.getYd_result())){
|
||||||
//修改发票批量录入结果状态
|
//修改发票批量录入结果状态
|
||||||
logger.info("=========开始更新进项发票的结果==========");
|
logger.info("=========开始更新进项发票的结果==========");
|
||||||
entity.setImport_result(InvoiceState.invoiceStateGetValue(status));
|
entity.setImport_result(InvoiceImportState.invoiceStateGetValue(status));
|
||||||
entity.setDataSourceCode("HT-OA");
|
entity.setDataSourceCode("HT-OA");
|
||||||
invoiceDao.updateInputInvoiceResult(entity);
|
invoiceDao.updateInputInvoiceResult(entity);
|
||||||
logger.info("=========更新进项发票的结果完成==========");
|
logger.info("=========更新进项发票的结果完成==========");
|
||||||
saveTaskLivingDetails(entity.getId(),entity.getBusiness_no(),jsonObject.toJSONString(), resultJson.toJSONString(), true,"");
|
saveTaskLivingDetails(entity.getId(),entity.getBill_code(),jsonObject.toJSONString(), resultJson.toJSONString(), true,"QueryInputInvoiceResultPluginInitializer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -577,7 +581,7 @@ public class InvoiceServiceImpl extends BaseService<InvoiceEntity, String> imple
|
||||||
taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity);
|
taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity);
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
logger.info("抽取杭泰付款单保存日志到集成任务日志明细中失败:{}",e.getMessage());
|
logger.info("发票保存日志到集成任务日志明细中失败:{}",e.getMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue