From 37ac4a1ba7f76aa54bea27711e5153fa1af782c5 Mon Sep 17 00:00:00 2001 From: mzr Date: Fri, 18 Apr 2025 15:55:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=80=E5=94=AE=E5=8F=91=E7=A5=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3-=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96=E5=92=8C?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E9=87=91=E9=A2=9D=E5=8F=96=E5=80=BC=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operator/IAPISaleInvMaitainImpl.java | 57 ++++++++++++------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/so/src/public/nccloud/api/so/saleinvoice/operator/IAPISaleInvMaitainImpl.java b/so/src/public/nccloud/api/so/saleinvoice/operator/IAPISaleInvMaitainImpl.java index a4a0ee0..d3af3a9 100644 --- a/so/src/public/nccloud/api/so/saleinvoice/operator/IAPISaleInvMaitainImpl.java +++ b/so/src/public/nccloud/api/so/saleinvoice/operator/IAPISaleInvMaitainImpl.java @@ -63,6 +63,13 @@ public class IAPISaleInvMaitainImpl { return deepCloneTool; } + /** + * 蓝字发票保存提交 + * + * @param jobject BIP合同平台传参 + * @return + * @throws Exception + */ public JSONString saveBlue(JSONObject jobject) throws Exception { JSONObject ufinterfaceObj = jsonObjectAss(jobject); String tsType = ufinterfaceObj.getString("tsType"); @@ -96,7 +103,7 @@ public class IAPISaleInvMaitainImpl { content = sendResultArray.getJSONObject(0).getString("content"); } } - if (content == null || content.equals("")) { + if (content == null || content.isEmpty()) { return r != null ? ResultMessageUtil.toJSON(r.getDesc(), "0") : ResultMessageUtil.exceptionToJSON(new NullPointerException("未知异常")); @@ -141,6 +148,13 @@ public class IAPISaleInvMaitainImpl { } } + /** + * 红字发票保存接口 + * + * @param jobject BIP合同平台传参 + * @return + * @throws Exception + */ public JSONString saveRed(JSONObject jobject) throws Exception { /** * 销售发票红冲: @@ -309,7 +323,6 @@ public class IAPISaleInvMaitainImpl { String taxcodeStr = getTaxcode(item.getString("ntaxrate")); // 将 taxcodeStr 放入 bodyMap itemDetails.put("ctaxcodeid", taxcodeStr);// 税码 - itemDetails.put("nnum", item.getString("nastnum"));// 主数量 itemDetails.put("ftaxtypeflag", 1);// 扣税类别 itemDetails.put("pk_group", "00");// 集团 itemDetails.put("pk_org", originalJson.getJSONObject("billhead").getString("pk_org"));// 开票组织 @@ -363,6 +376,9 @@ public class IAPISaleInvMaitainImpl { // 税额 ntax = ntaxmny.subtract(nmny).setScale(2, RoundingMode.HALF_UP); + UFDouble nastnum1 = new UFDouble(item.getString("nastnum")); + + itemDetails.put("nnum", nastnum1);// 主数量 itemDetails.put("nqtorigprice", nqtorigprice);// 无税单价 itemDetails.put("norigprice", nqtorigprice);// 主无税单价 itemDetails.put("norigmny", norigmny);// 无税金额 @@ -395,6 +411,7 @@ public class IAPISaleInvMaitainImpl { resultJson.put("ufinterface", ufinterface); return resultJson; } catch (Exception e) { + Logger.error("saveCommit-jsonObjectAss-exp: ", e); return (JSONObject) ResultMessageUtil.exceptionToJSON(e); } } @@ -420,24 +437,6 @@ public class IAPISaleInvMaitainImpl { return value2; } - private String getString_TrimAsNull(Object value) { - if ((value == null) || (value.toString().trim().isEmpty())) { - return ""; - } - return value.toString().trim(); - } - - private UFDouble getUFDouble_NullAsZero(Object value) { - if ((value == null) || (value.toString().trim().isEmpty()) || (value.toString().trim().equals("~"))) - return UFDouble.ONE_DBL; - if ((value instanceof UFDouble)) - return (UFDouble) value; - if ((value instanceof BigDecimal)) { - return new UFDouble((BigDecimal) value); - } - return new UFDouble(value.toString().trim()); - } - /** * 根据主键查询销售发票 * @@ -685,4 +684,22 @@ public class IAPISaleInvMaitainImpl { return (Map) queryBS.executeQuery(sql, new MapProcessor()); } + private String getString_TrimAsNull(Object value) { + if ((value == null) || (value.toString().trim().isEmpty())) { + return ""; + } + return value.toString().trim(); + } + + private UFDouble getUFDouble_NullAsZero(Object value) { + if ((value == null) || (value.toString().trim().isEmpty()) || (value.toString().trim().equals("~"))) + return UFDouble.ONE_DBL; + if ((value instanceof UFDouble)) + return (UFDouble) value; + if ((value instanceof BigDecimal)) { + return new UFDouble((BigDecimal) value); + } + return new UFDouble(value.toString().trim()); + } + }