|
|
|
@ -942,7 +942,6 @@ public class AisinoConsoleInvoiceApiZhongQiServiceImpl implements IInvoiceApiSer |
|
|
|
|
@Override |
|
|
|
|
public HXResponse downloadRedInfo(DownloadRedInfoDTO downloadRedInfoDTO, Companyservice companyservice) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<CompanyserviceDetail> companyserviceDetailList = companyservice.getCompanyserviceDetailList(); |
|
|
|
|
if (CollectionUtils.isEmpty(companyserviceDetailList) || StrUtil.isEmpty(companyserviceDetailList.get(0).getGoldenTaxDiskNo())) { |
|
|
|
|
throw new JianshuiServiceException("金税盘编号未配置,请联系管理员!"); |
|
|
|
@ -1003,13 +1002,11 @@ public class AisinoConsoleInvoiceApiZhongQiServiceImpl implements IInvoiceApiSer |
|
|
|
|
System.out.println("存在"); |
|
|
|
|
System.out.println(data); |
|
|
|
|
if (StrUtil.isNotEmpty(data)) { |
|
|
|
|
// Map<String, Object> map = new HashMap<>();
|
|
|
|
|
data = Base64.decodeStr(data, "GB2312"); |
|
|
|
|
|
|
|
|
|
if (data.contains("<DATA>") && data.contains("</DATA>")) { |
|
|
|
|
String dataChild = data.substring(data.indexOf("<DATA>") + 6, data.indexOf("</DATA>")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cn.hutool.json.JSONObject dataChildJson = JSONUtil.parseObj(dataChild); |
|
|
|
|
String RedInvReqBill = dataChildJson.get("RedInvReqBill").toString(); |
|
|
|
|
|
|
|
|
@ -1021,7 +1018,6 @@ public class AisinoConsoleInvoiceApiZhongQiServiceImpl implements IInvoiceApiSer |
|
|
|
|
jsonArray1.add(jsonObject); |
|
|
|
|
|
|
|
|
|
// 拿到最终报文
|
|
|
|
|
// List<DownloadJdcVO> downloadJdcVOList = BeanUtil.copyToList(jsonArray, DownloadJdcVO.class);
|
|
|
|
|
List<DownloadJdcVO> downloadJdcVOList = BeanUtil.copyToList(jsonArray1, DownloadJdcVO.class); |
|
|
|
|
|
|
|
|
|
// 解析
|
|
|
|
@ -1041,98 +1037,8 @@ public class AisinoConsoleInvoiceApiZhongQiServiceImpl implements IInvoiceApiSer |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return new HXResponse("9999", "系统错误!"); |
|
|
|
|
|
|
|
|
|
// ajaxResult.get("data") != null ? JSONUtil.parseObj(ajaxResult.get("data")).get("FPXT_COM_OUTPUT")
|
|
|
|
|
|
|
|
|
|
/* cn.hutool.json.JSONObject resultJSON = JSONUtil.parseObj(ajaxResult.get("data")); |
|
|
|
|
String retcode = resultJSON.get("retcode") != null ? resultJSON.get("retcode").toString() : ""; |
|
|
|
|
String retmsg = resultJSON.get("retmsg") != null ? resultJSON.get("retmsg").toString() : ""; |
|
|
|
|
String retdata = resultJSON.get("retdata") != null ? resultJSON.get("retdata").toString() : ""; |
|
|
|
|
|
|
|
|
|
// 返回结果处理
|
|
|
|
|
if (!StringUtils.equals("0", retcode)) { |
|
|
|
|
if(StrUtil.isNotEmpty(retdata)){ |
|
|
|
|
// 返回结果解析。
|
|
|
|
|
if(retdata.indexOf("<DATA>") != -1 && retdata.indexOf("</DATA>") != -1){ |
|
|
|
|
System.out.println("存在"); |
|
|
|
|
String data = retdata.substring(retdata.indexOf("<DATA>") + 6,retdata.indexOf("</DATA>")); |
|
|
|
|
System.out.println(data); |
|
|
|
|
if(StrUtil.isNotEmpty(data)){ |
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
data = Base64.decodeStr(data,"GB2312"); |
|
|
|
|
|
|
|
|
|
if(data.indexOf("<DATA>") != -1 && data.indexOf("</DATA>") != -1){ |
|
|
|
|
String dataChild = data.substring(data.indexOf("<DATA>") + 6,data.indexOf("</DATA>")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cn.hutool.json.JSONObject dataChildJson = JSONUtil.parseObj(dataChild); |
|
|
|
|
String RedInvReqBill = dataChildJson.get("RedInvReqBill").toString(); |
|
|
|
|
cn.hutool.json.JSONArray jsonArray = JSONUtil.parseArray(RedInvReqBill); |
|
|
|
|
|
|
|
|
|
// 拿到最终报文
|
|
|
|
|
List<DownloadJdcVO> downloadJdcVOList = BeanUtil.copyToList(jsonArray,DownloadJdcVO.class); |
|
|
|
|
|
|
|
|
|
// 解析
|
|
|
|
|
List<Redinfo> red = null; |
|
|
|
|
try { |
|
|
|
|
red = parseRedinfo(downloadJdcVOList); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.info("红字信息表税局解密错误:{}",e); |
|
|
|
|
return new HXResponse("9999","系统异常!!!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return new HXResponse("0000",red); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return new HXResponse("9999",retmsg); |
|
|
|
|
}else{ |
|
|
|
|
return new HXResponse("9999",retmsg); |
|
|
|
|
}*/ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*public static void main(String[] args) { |
|
|
|
|
String aa = "{\"ReqBillNo\":\"661824626856231102101257\",\"ResBillNo\":4109222311000083,\"StatusDM\":\"TZD0000\",\"StatusMC\":\"审核通过\",\"BillType\":0,\"TypeCode\":\"0000000000\",\"InvNo\":\"00000000\",\"Szlb\":1,\"IsMutiRate\":0,\"Date\":\"2023-11-02\",\"BuyerName\":\"河南首发汽车销售服务有限公司\",\"BuyTaxCode\":\"91410922MA455KT3X6\",\"BuyerAdd\":\"\",\"BuyerBank\":\"\",\"SellerName\":\"中国重汽集团济南商用车有限公司\",\"SellTaxCode\":\"9137010072624213XP\",\"Amount\":-246902.65,\"TaxRate\":0.13,\"Tax\":-32097.35,\"ReqMemo\":\"Y\",\"SPBMBBH\":50,\"SLBZ\":0,\"YDDK\":\"\",\"DKBDBS\":\"\",\"Tspz\":\"\",\"Xhqdbz\":\"N\",\"RedInvReqBillMx\":{\"GoodsMx\":{\"GoodsName\":\"*机动车*销售折让\",\"GoodsUnit\":\"\",\"GoodsPrice\":\"\",\"GoodsTaxRate\":0.13,\"GoodsGgxh\":\"\",\"GoodsNum\":\"\",\"GoodsJE\":-246902.65,\"GoodsSE\":-32097.35,\"HS_BZ\":\"N\",\"SPBM\":1090305040000000000,\"QYSPBM\":\"004\",\"SYYHZCBZ\":0,\"YHZC\":\"\",\"LSLBZ\":\"\"}}}"; |
|
|
|
|
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(aa); |
|
|
|
|
JSONArray jsonArray1 = new JSONArray(); |
|
|
|
|
jsonArray1.add(jsonObject); |
|
|
|
|
|
|
|
|
|
// 拿到最终报文
|
|
|
|
|
// List<DownloadJdcVO> downloadJdcVOList = BeanUtil.copyToList(jsonArray, DownloadJdcVO.class);
|
|
|
|
|
List<DownloadJdcVO> downloadJdcVOList = BeanUtil.copyToList(jsonArray1, DownloadJdcVO.class); |
|
|
|
|
|
|
|
|
|
// 解析
|
|
|
|
|
List<Redinfo> redinfoList = null; |
|
|
|
|
try { |
|
|
|
|
redinfoList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
for (DownloadJdcVO downloadJdcVO : downloadJdcVOList) { |
|
|
|
|
RedinfoCopyAisinoVO redinfoCopyAisinoVO = BeanUtil.copyProperties(downloadJdcVO, RedinfoCopyAisinoVO.class); |
|
|
|
|
|
|
|
|
|
// 明细处理
|
|
|
|
|
if (!CollectionUtils.isEmpty(downloadJdcVO.getRedInvReqBillMx()) && !CollectionUtils.isEmpty(downloadJdcVO.getRedInvReqBillMx().get(0).getGoodsMx())) { |
|
|
|
|
List<DownloadJdcDetailItemVO> downloadJdcDetailItemVOS = downloadJdcVO.getRedInvReqBillMx().get(0).getGoodsMx(); |
|
|
|
|
List<RedinfodetailAisinoVO> redinfodetailAisinoVOList = BeanUtil.copyToList(downloadJdcDetailItemVOS, RedinfodetailAisinoVO.class); |
|
|
|
|
redinfoCopyAisinoVO.setRedinfodetailList(redinfodetailAisinoVOList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 返回转换
|
|
|
|
|
Redinfo redinfo = BeanUtil.copyProperties(BeanToMapUtils.fastJsonBean2Map(redinfoCopyAisinoVO), Redinfo.class); |
|
|
|
|
redinfoList.add(redinfo); |
|
|
|
|
} |
|
|
|
|
System.out.println(redinfoList); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.info("红字信息表税局解密错误:{}", e); |
|
|
|
|
// return new HXResponse("9999", "系统异常!!!");
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// return new HXResponse("0000", red);
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author kk |
|
|
|
|
* @date 15:25 |
|
|
|
|