feature:山能易行发票推送

release
gaorl 2 years ago
parent fd41a367d0
commit 34eebfcee0
  1. 27
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/manager/service/impl/PushInvoiceServiceImpl.java

@ -85,6 +85,7 @@ import java.math.BigDecimal;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* 推送企业数据servcie实现类
@ -459,6 +460,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
|| ConfigurerInfo.INTERFACE_VERSION_V6.equals(pushInfo.getVersionIdent())) {
DxhyInterfaceResponse dxhyInterfaceResponse = JsonUtils.getInstance().parseObject(result, DxhyInterfaceResponse.class);
if (OrderInfoEnum.INTERFACE_TYPE_INVOICE_PUSH_STATUS_1.getKey().equals(fpTsMqData.getPushType())) {
//TODO 山能易行回传流水号重置
if(OrderInfoEnum.SYS_SOURCE_SAP.getKey().equals(xtly)){
PoCommonResponseParam poCommonResponseParam = JsonUtils.getInstance().parseObject(result, PoCommonResponseParam.class);
EsOutput es_output = poCommonResponseParam.getES_OUTPUT();
@ -634,11 +636,6 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
}
}
public static void main(String[] args) {
String salt = "e4b0190b2fadc0adbe54471ffd79a729";
}
private OutputInvoiceRequest buildInvoiceRequest(DdfpxxV5 ddfpxx){
@ -1194,8 +1191,10 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
}
private void updatePushErrorMsgToDb(String fpqqlsh, String errorMessage, List<String> shList) {
String[] split = fpqqlsh.split(",");
for (String fpqqlshItem : split) {
OrderInvoiceInfo orderQuery = new OrderInvoiceInfo();
orderQuery.setFpqqlsh(fpqqlsh);
orderQuery.setFpqqlsh(fpqqlshItem);
orderQuery.setPushStatus(OrderInfoEnum.PUSH_STATUS_2.getKey());
orderQuery.setInvoicePushSbyy(errorMessage);
int updateByPrimaryKeySelective = orderInvoiceInfoService.updateOrderInvoiceInfoByFpqqlsh(orderQuery, shList);
@ -1203,6 +1202,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
log.error("{}推送状态更新失败", LOGGER_MSG);
}
}
}
private void updateInvalidPushErrorMsgToDb(String fpdm, String fphm, String errorMessage, List<String> shList) {
@ -1237,8 +1237,10 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
if (ObjectUtil.isNotEmpty(pushRspBO.getDDFPTS())) {
ddfptsBOList.addAll(pushRspBO.getDDFPTS());
} else {
String[] split = fpqqlsh.split(",");
for (String fpqqlshSplit : split) {
DdfptsBO ddfptsBO = new DdfptsBO();
ddfptsBO.setDDQQLSH(fpqqlsh);
ddfptsBO.setDDQQLSH(fpqqlshSplit);
ddfptsBO.setNSRSBH(nsrsbh);
if (ConfigureConstant.STRING_0000.equals(pushRspBO.getZTDM()) || ConfigureConstant.STRING_000000.equals(pushRspBO.getZTDM())) {
ddfptsBO.setZTDM(ConfigureConstant.STRING_000000);
@ -1248,6 +1250,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
ddfptsBOList.add(ddfptsBO);
}
}
for (DdfptsBO ddfptsBO : ddfptsBOList) {
OrderInvoiceInfo updateOrderInvoiceInfo = new OrderInvoiceInfo();
@ -1319,10 +1322,12 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
List<GsClient> gsClients = gsClientMapper.selectByGsdm(orderProcessInfo.getGsdm());
//发票开具推送
DdfpzxxV5 ddfpzxxV5 = JsonUtils.getInstance().parseObject(content.substring(1,content.length()-1), DdfpzxxV5.class);
List<DdfpzxxV5> ddfpzxxV5s = JsonUtils.getInstance().jsonToList(content, DdfpzxxV5.class);
//DdfpzxxV5 ddfpzxxV5 = JsonUtils.getInstance().parseObject(content.substring(1,content.length()-1), DdfpzxxV5.class);
List<FpkjtsReqSap> mainList = new ArrayList<>();
for (DdfpzxxV5 ddfpzxxV5 : ddfpzxxV5s) {
DdfpxxV5 ddfpxx = ddfpzxxV5.getDDFPXX();
List<DdmxxxV5> ddmxxx = ddfpzxxV5.getDDMXXX();
List<FpkjtsReqSap> mainList = new ArrayList<>();
FpkjtsReqSap fpkjtsReqSap = new FpkjtsReqSap();
List<FpkjtsMxSap> itemList = new ArrayList<>();
//主信息
@ -1415,6 +1420,7 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
poCommonRequestParam.setIS_INPUT(isInput);
ywxtParam = JsonUtils.getInstance().toJsonString(poCommonRequestParam);
}
}else if(OrderInfoEnum.INTERFACE_TYPE_INVOICE_PUSH_STATUS_2.getKey().equals(fpTsMqData.getPushType())){
OrderInvoiceInfo orderInvoiceInfo = orderInvoiceInfoService.selectOrderInvoiceInfoByFpdmAndFphm(fpTsMqData.getZfTsMqData().getFpdm(), fpTsMqData.getZfTsMqData().getFphm(), null);
@ -1479,6 +1485,9 @@ public class PushInvoiceServiceImpl implements PushInvoiceService {
return null;
}
orderProcessInfoList.addAll(orderProcessInfos);
String fpqqlsh = orderProcessInfos.stream().map(t -> t.getFpqqlsh()).collect(Collectors.joining(","));
fpTsMqData.setFpqqlsh(fpqqlsh);
log.info("山能易行发票回推重置流水号{}",fpqqlsh);
}else{
orderProcessInfoList.add(orderProcessInfo);
}

Loading…
Cancel
Save