diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisSettleInvoiceChRecordServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisSettleInvoiceChRecordServiceImpl.java index c25843ec1..4553d667f 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisSettleInvoiceChRecordServiceImpl.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisSettleInvoiceChRecordServiceImpl.java @@ -526,12 +526,34 @@ public class EmisSettleInvoiceChRecordServiceImpl extends EmisBaseService implem } - } - else{ - EmisSettleInvoiceChRecord newRecord=new EmisSettleInvoiceChRecord(); + } else { + // 安全获取failDetails数组 - 根据实际JSON结构调整路径 + JSONArray jArrFailList = null; + String errorMessage = jRst != null ? jRst.getString("message") : "未知错误"; + + if (jRst != null) { + JSONObject data = jRst.getJSONObject("data"); + if (data != null) { + jArrFailList = data.getJSONArray("failDetails"); + } + } + + // 构建错误描述 + String statusDesc = errorMessage; + if (jArrFailList != null && jArrFailList.size() > 0) { + JSONObject item0 = jArrFailList.getJSONObject(0); + if (item0 != null) { + String failReason = item0.getString("failReason"); + if (failReason != null) { + statusDesc = errorMessage + " -- " + failReason; + } + } + } + + EmisSettleInvoiceChRecord newRecord = new EmisSettleInvoiceChRecord(); newRecord.setId(old.getId()); newRecord.setOpenChStatus("-1"); - newRecord.setOpenChStatusDesc(jRst.getString("message")); + newRecord.setOpenChStatusDesc(statusDesc); emisSettleInvoiceChRecordMapper.updateEmisSettleInvoiceChRecord(newRecord); } return 1; diff --git a/emis-biz/src/main/resources/mapper/EmisWriteoffApplyMapper.xml b/emis-biz/src/main/resources/mapper/EmisWriteoffApplyMapper.xml index 2cecef438..230241246 100644 --- a/emis-biz/src/main/resources/mapper/EmisWriteoffApplyMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisWriteoffApplyMapper.xml @@ -493,8 +493,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" w.create_time as w_create_time, w.update_by as w_update_by, w.update_time as w_update_time, w.remark as w_remark, -- 新增运单字段:寄件日期、产品类型、件数、结算重量 w.send_date as w_send_date, w.product_type as w_product_type, w.parcel_qty as w_parcel_qty, w.settlement_weight as w_settlement_weight, - -- 快件类型(寄件网点-目的网点) - CONCAT(COALESCE(send_site.size_code2, ''), '-', COALESCE(dest_site.size_code2, '')) as express_type,tp.prod_name as w_product_type_name, + -- 快件类型(寄件网点名称-目的网点名称) + CONCAT(COALESCE(send_site.site_name, ''), '--', COALESCE(dest_site.site_name, '')) as express_type,tp.prod_name as w_product_type_name, -- 结算账单信息 sb.id as sb_id, sb.settle_bill_no as sb_settle_bill_no, sb.settle_bill_name as sb_settle_bill_name, @@ -522,9 +522,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ssb.customer_name as ssb_customer_name, ssb.invoiced_money as ssb_invoiced_money, ssb.reced_money as ssb_reced_money, ssb.satisfy_money as ssb_satisfy_money, ssb.allowance_money as ssb_allowance_money, ssb.deduction_money as ssb_deduction_money, ssb.other_money as ssb_other_money, ssb.satisfy_reason as ssb_satisfy_reason, ssb.allowance_reason as ssb_allowance_reason, - ssb.deduction_reason as ssb_deduction_reason, ssb.other_reason as ssb_other_reason, + ssb.deduction_reason as ssb_deduction_reason, ssb.other_reason as ssb_other_reason, ssb.bl_confirm_center as ssb_bl_confirm_center, ssb.bl_confirm_site as ssb_bl_confirm_site, - ssb.create_by as ssb_create_by, ssb.create_time as ssb_create_time, ssb.update_by as ssb_update_by, + ssb.create_by as ssb_create_by, ssb.create_time as ssb_create_time, ssb.update_by as ssb_update_by, ssb.update_time as ssb_update_time from emis_waybill w left join emis_settle_sub_bill ssb on w.bill_code = ssb.bill_code and ssb.del_flag = '0'