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()); + } + }