Merge branch 'ht' of http://ufidahz.com.cn:9015/hzya/kangarooDataCenterV3 into ht
This commit is contained in:
commit
d186be6f2d
|
@ -190,7 +190,7 @@ public class IncomeInvoiceServiceImpl extends BaseService<IncomeInvoiceEntity, S
|
|||
//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("documentNumber"));
|
||||
|
||||
JSONArray detaildata = content.getJSONArray("items");
|
||||
if(detaildata != null && detaildata.size() > 0){
|
||||
|
|
|
@ -80,7 +80,15 @@ public class InvoiceEntity extends BaseEntity {
|
|||
private String yd_res_field;//进项发票批量导入返回流水号字段
|
||||
private String import_result_field;//进项发票批量导入返回结果字段
|
||||
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() {
|
||||
return tab_name;
|
||||
|
|
|
@ -70,6 +70,15 @@
|
|||
<result property="invoice_number" column="invoice_number" />
|
||||
<result property="url" column="url" />
|
||||
<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>
|
||||
|
||||
|
@ -90,7 +99,7 @@
|
|||
<select id="queryInputInvoiceResult" resultMap="get-InvoiceEntity-result" parameterType="com.hzya.frame.seeyon.invoice.entity.InvoiceEntity">
|
||||
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>
|
||||
|
||||
<!--通过主键修改方法-->
|
||||
|
|
|
@ -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.IInvoiceDetailsDao;
|
||||
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.service.IInvoiceService;
|
||||
import com.hzya.frame.seeyon.util.OARestUtil;
|
||||
|
@ -179,7 +180,7 @@ public class InvoiceServiceImpl extends BaseService<InvoiceEntity, String> imple
|
|||
logger.info("=====调用杭泰税务查询申请单详情的返回参数为:{}===========", result);
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
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 {
|
||||
JSONObject attribute = resultJson.getJSONObject("attribute");
|
||||
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);
|
||||
logger.info("========ofd文件上传OA完成========");
|
||||
}
|
||||
saveTaskLivingDetails(entity.getSerial_number(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), true, "QueryInvoiceResultPluginInitializer");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
|
@ -240,6 +242,7 @@ public class InvoiceServiceImpl extends BaseService<InvoiceEntity, String> imple
|
|||
entity.setId(entity.getSerial_number());
|
||||
invoiceDao.updateInvoiceResult(entity);
|
||||
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");
|
||||
JSONObject jsonObject=new JSONObject();
|
||||
jsonObject.put("serialNumber",entity.getYd_result());
|
||||
logger.info("=====调用杭泰税务查询发票批量录入结果的请求参数为:{}===========",jsonObject.toJSONString());
|
||||
//发送数据
|
||||
String result = HttpRequest.post(url).
|
||||
header("appId", "800060").
|
||||
|
@ -280,7 +284,7 @@ public class InvoiceServiceImpl extends BaseService<InvoiceEntity, String> imple
|
|||
logger.info("=====调用杭泰税务查询发票批量录入结果的返回参数为:{}===========",result);
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
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 {
|
||||
JSONObject attribute = resultJson.getJSONObject("attribute");
|
||||
if("0".equals(attribute.getString("code"))) {
|
||||
|
@ -291,11 +295,11 @@ public class InvoiceServiceImpl extends BaseService<InvoiceEntity, String> imple
|
|||
if(serialNumber.equals(entity.getYd_result())){
|
||||
//修改发票批量录入结果状态
|
||||
logger.info("=========开始更新进项发票的结果==========");
|
||||
entity.setImport_result(InvoiceState.invoiceStateGetValue(status));
|
||||
entity.setImport_result(InvoiceImportState.invoiceStateGetValue(status));
|
||||
entity.setDataSourceCode("HT-OA");
|
||||
invoiceDao.updateInputInvoiceResult(entity);
|
||||
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);
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.info("抽取杭泰付款单保存日志到集成任务日志明细中失败:{}",e.getMessage());
|
||||
logger.info("发票保存日志到集成任务日志明细中失败:{}",e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue