HULEI 3 ماه پیش
والد
کامیت
a0e447e1e0

BIN
com.awspaas.user.apps.donenow_crm/lib/com.awspaas.user.apps.donenow_crm.jar


+ 16 - 5
com.awspaas.user.apps.donenow_crm/src/com/awspaas/user/apps/donenow_crm/controller/accountController.java

@@ -15,6 +15,7 @@ import com.awspaas.user.apps.donenow_crm.constant.CrmConstant;
 import org.apache.commons.lang3.StringUtils;
 
 import java.sql.Connection;
+import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -50,10 +51,13 @@ public class AccountController extends BaseController {
 
             for (String id : ids.split(",")) {
                 BO bo = SDK.getBOAPI().get(tableName, id);
-                bo.set("CLOSED", "1");
-                SDK.getBOAPI().update(tableName, bo, conn);
+                if (hasColumn(conn, tableName, "CLOSED")) {
+                    bo.set("CLOSED", "1");
+                    SDK.getBOAPI().update(tableName, bo, conn);
+                } else {
+                    SDK.getBOAPI().remove(tableName, id, conn);
+                }
 
-                //Contacts联系人 删除
                 List<BO> contacts = SDK.getBOAPI().query("BO_EU_DNCRM_CONTACT").addQuery("ACCOUNT_ID=", id).addQuery("CLOSED=", 0).list();
                 for (BO contact : contacts) {
                     contact.set("CLOSED", "1");
@@ -65,7 +69,6 @@ public class AccountController extends BaseController {
                         SDK.getORGAPI().disabledUser(userId);//禁用组织中用户
                 }
 
-                //配置项逻辑删除
                 List<BO> installedProducts = SDK.getBOAPI().query("BO_EU_DNCRM_INSTALLED_PRODUCT").addQuery("ACCOUNT_ID=", id).addQuery("CLOSED=", 0).list();
                 for (BO installedProduct : installedProducts) {
                     installedProduct.set("CLOSED", "1");
@@ -73,7 +76,6 @@ public class AccountController extends BaseController {
                 }
 
 
-                //客户地址
                 List<BO> address = SDK.getBOAPI().query("BO_EU_DNCRM_LOCATION").addQuery("ACCOUNT_ID=", id).addQuery("CLOSED=", 0).list();
                 for (BO addressBO : address) {
                     addressBO.set("CLOSED", "1");
@@ -95,6 +97,15 @@ public class AccountController extends BaseController {
         return ResponseObject.newOkResponse();
     }
 
+    /**
+     * 仅用于判断客户主表是否包含CLOSED字段(新增工具方法)
+     */
+    private boolean hasColumn(Connection conn, String tableName, String columnName) throws SQLException {
+        try (ResultSet rs = conn.getMetaData().getColumns(null, null, tableName, columnName)) {
+            return rs.next();
+        }
+    }
+
 
     /**
      * 删除联系人

+ 145 - 145
com.awspaas.user.apps.donenow_crm/src/com/awspaas/user/apps/donenow_crm/event/FormAfterSaveEvent.java

@@ -1,6 +1,6 @@
-  package com.awspaas.user.apps.donenow_crm.event;
-  
-  import java.util.List;
+package com.awspaas.user.apps.donenow_crm.event;
+
+import java.util.List;
 
 import com.actionsoft.bpms.bo.engine.BO;
 import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext;
@@ -13,146 +13,146 @@ import com.actionsoft.bpms.util.UUIDGener;
 import com.actionsoft.sdk.local.SDK;
 import com.alipay.remoting.util.StringUtils;
 import com.awspaas.user.apps.donenow_crm.constant.CrmConstant;
-  
-  
-  public class FormAfterSaveEvent
-    extends ExecuteListener
-  {
-    public String getDescription() {
-    return "表单保存后事件";
-    }
-    
-    public String getProvider() {
-     return "上海声联";
-    }
-    
-    public String getVersion() {
-    return "1.0";
-    }
-  
-    
-    public void execute(ProcessExecutionContext process) throws Exception {
-     try {
-		UserContext uc = process.getUserContext();
-		 BO formData = process.getFormData();
-		 String boName = process.getParameterOfString("$BONAME");
-		  
-		 System.out.println("单位boName:" + boName);
-		  
-		 String companyId = uc.getCompanyModel().getId();
-		 System.out.println("单位crmCompanyId:" + companyId);
-		 String parentDepartmentId=DBSql.getString("select ID from orgdepartment where COMPANYID='"+companyId+"' and DEPARTMENTNAME='客户'");
-		 System.out.println("parentDepartmentId:" + parentDepartmentId);
-
-		  
-		BO accountBo = process.getBO(CrmConstant.BO_EU_DNCRM_ACCOUNT);
-		 if (accountBo != null) {
-		   
-		   System.out.println("客户表数据:" + accountBo.getBindId());
-		    
-		   String deptId = DBSql.getString("SELECT ID FROM ORGDEPARTMENT WHERE EXT1=?", new Object[] { accountBo.getId() });
-		    
-		   System.out.println("父部门ID:" + parentDepartmentId);
-		    
- 		   String parentId = accountBo.getString("PARENT_ID");
-		    
-		   if (StringUtils.isBlank(parentId)) {
-		     parentId = parentDepartmentId;
-		    }
-		   
-		   //客户表单保存,往系统部门表中新增或者更新数据
-		   if (StringUtils.isNotBlank(deptId)) {
-		    DBSql.update("UPDATE ORGDEPARTMENT SET PARENTDEPARTMENTID=? WHERE ID=?", new Object[] { parentId, deptId });
-		    SDK.getORGAPI().updateDepartment(deptId, accountBo.getString("NAME"));
-		    } else {
-		      
-		     deptId = SDK.getORGAPI().createDepartment(companyId, accountBo.getString("NAME"), "", "", parentId, accountBo.getId(), "");
-		    } 
-		    DepartmentCache.getCache().reload();
-		   
-		   //说明是客户表单保存 
-		  if (CrmConstant.BO_EU_DNCRM_ACCOUNT.equals(boName)) {
-		   //往地址表同步数据
-			  List<BO> list = SDK.getBOAPI().query(CrmConstant.BO_EU_DNCRM_LOCATION).bindId(accountBo.getBindId()).addQuery("IS_DEFAULT=", Integer.valueOf(1)).list();
-		    //已经存在默认地址
-		    if(list.size()>0) {
-			    for (BO bo : list) {
-			      bo.set("COUNTRY_ID", accountBo.get("COUNTRY_ID"));
-			      bo.set("DISTRICT_ID", accountBo.get("DISTRICT_ID"));
-			      bo.set("ADDRESS", accountBo.get("ADDRESS"));
-			      bo.set("POSTAL_CODE", accountBo.get("POSTAL_CODE"));
-				  bo.set("CATE_ID", accountBo.get("CATE_ID"));
-			      SDK.getBOAPI().update(CrmConstant.BO_EU_DNCRM_LOCATION, bo);
-			      
-			     }
-		    }else {
-		    	//往地址表中新增数据
-		    	BO bo=new BO();
-		    	bo.setBindId(accountBo.getBindId());
-		    	bo.set("COUNTRY_ID", accountBo.get("COUNTRY_ID"));
-			    bo.set("DISTRICT_ID", accountBo.get("DISTRICT_ID"));
-			    bo.set("ADDRESS", accountBo.get("ADDRESS"));
-			    bo.set("POSTAL_CODE", accountBo.get("POSTAL_CODE"));
-			    bo.set("IS_DEFAULT", 1);
-			    bo.set("ACCOUNT_ID", accountBo.getId());
-			    bo.set("CATE_ID", CrmConstant.OFFICELOCATION);
-			    bo.set("ID", UUIDGener.getUUID());
-			    SDK.getBOAPI().create(CrmConstant.BO_EU_DNCRM_LOCATION, bo,SDK.getProcessAPI().getInstanceById(accountBo.getBindId()), uc);
-			    //更新客户表的LocationId字段
-			    accountBo.set("LOCATION_ID", bo.getId());
-			    SDK.getBOAPI().update(CrmConstant.BO_EU_DNCRM_ACCOUNT, bo);
-		     }
-		    
-		    //往联系人表同步数据
-		    List<BO> mainList = SDK.getBOAPI().query(CrmConstant.BO_EU_DNCRM_CONTACT).addQuery("ACCOUNT_ID=", accountBo.getId()).addQuery("IS_PRIMARY_CONTACT=", 1).list();
-			System.out.println("mainList:"+mainList.size());
-		    if(mainList.size()==0) {
-				  ProcessInstance createBOProcessInstance = SDK.getProcessAPI().createBOProcessInstance(CrmConstant.obj_fcf1c6204d084ea78e152af821ff4874, uc.getUID(), "");
-					BO bo=new BO();
-					bo.setId(UUIDGener.getUUID());
-					bo.set("NAME", accountBo.get("CONTACT_NAME"));
-					bo.set("SUFFIX_ID", accountBo.get("CONTACT_SUFFIX_ID"));
-					bo.set("TITLE", accountBo.get("CONTACT_TITLE"));
-					bo.set("EMAIL", accountBo.get("CONTACT_EMAIL"));
-					bo.set("MOBILE_PHONE", accountBo.get("PHONE"));
-					bo.set("PHONE", accountBo.get("ALTERNATE_PHONE1"));
-					bo.set("ACCOUNT_ID", accountBo.getId());
-					bo.set("IS_PRIMARY_CONTACT", 1);
-				 	SDK.getBOAPI().create(CrmConstant.BO_EU_DNCRM_CONTACT, bo, createBOProcessInstance, uc);
-				 	//同步联系人数据到用户表
-					new ContactFormAfterSaveEvent().saveContactData(uc, bo, CrmConstant.BO_EU_DNCRM_CONTACT, false);
-			}else {
-				BO bo = mainList.get(0);
-				bo.set("NAME", accountBo.get("CONTACT_NAME"));
-				bo.set("SUFFIX_ID", accountBo.get("CONTACT_SUFFIX_ID"));
-				bo.set("TITLE", accountBo.get("CONTACT_TITLE"));
-				bo.set("EMAIL", accountBo.get("CONTACT_EMAIL"));
-				bo.set("MOBILE_PHONE", accountBo.get("PHONE"));
-				bo.set("PHONE", accountBo.get("ALTERNATE_PHONE1"));
-				bo.set("ACCOUNT_ID", accountBo.getId());
-				SDK.getBOAPI().update(CrmConstant.BO_EU_DNCRM_CONTACT, bo);
-				//同步联系人数据到用户表
-				new ContactFormAfterSaveEvent().saveContactData(uc, bo, CrmConstant.BO_EU_DNCRM_CONTACT, false);
+
+
+public class FormAfterSaveEvent
+		extends ExecuteListener
+{
+	public String getDescription() {
+		return "锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷录锟�";
+	}
+
+	public String getProvider() {
+		return "锟较猴拷锟斤拷锟斤拷";
+	}
+
+	public String getVersion() {
+		return "1.0";
+	}
+
+
+	public void execute(ProcessExecutionContext process) throws Exception {
+		try {
+			UserContext uc = process.getUserContext();
+			BO formData = process.getFormData();
+			String boName = process.getParameterOfString("$BONAME");
+
+			System.out.println("锟斤拷位boName:" + boName);
+
+			String companyId = uc.getCompanyModel().getId();
+			System.out.println("锟斤拷位crmCompanyId:" + companyId);
+			String parentDepartmentId=DBSql.getString("select ID from orgdepartment where COMPANYID='"+companyId+"' and  DEPARTMENTNO='kehu'");
+			System.out.println("parentDepartmentId:" + parentDepartmentId);
+
+
+			BO accountBo = process.getBO(CrmConstant.BO_EU_DNCRM_ACCOUNT);
+			if (accountBo != null) {
+
+				System.out.println("锟酵伙拷锟斤拷锟斤拷锟斤拷:" + accountBo.getBindId());
+
+				String deptId = DBSql.getString("SELECT ID FROM ORGDEPARTMENT WHERE EXT1=?", new Object[] { accountBo.getId() });
+
+				System.out.println("锟斤拷锟斤拷锟斤拷ID:" + parentDepartmentId);
+
+				String parentId = accountBo.getString("PARENT_ID");
+
+				if (StringUtils.isBlank(parentId)) {
+					parentId = parentDepartmentId;
 				}
-		    }
-		  
-		  //说明是地址表单保存
-		   else if (CrmConstant.BO_EU_DNCRM_LOCATION.equals(boName)) {
-		    BO locationBo = process.getBO(CrmConstant.BO_EU_DNCRM_LOCATION);
-		    if (locationBo != null && "1".equals(locationBo.getString("IS_DEFAULT"))) {
-		      accountBo.set("COUNTRY_ID", locationBo.get("COUNTRY_ID"));
-		      accountBo.set("DISTRICT_ID", locationBo.get("DISTRICT_ID"));
-		      accountBo.set("ADDRESS", locationBo.get("ADDRESS"));
-		     accountBo.set("POSTAL_CODE", locationBo.get("POSTAL_CODE"));
-		       SDK.getBOAPI().update(CrmConstant.BO_EU_DNCRM_ACCOUNT, accountBo);
-		      } 
-		    } 
-		  }
-	} catch (Exception e) {
-		// TODO Auto-generated catch block
-		System.out.println("客户保存事件报错了:"+e.getMessage());
-	} 
-    }
-    
-    
-  }
+
+				//锟酵伙拷锟斤拷锟斤拷锟斤拷锟斤拷,锟斤拷系统锟斤拷锟脚憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟竭革拷锟斤拷锟斤拷锟斤拷
+				if (StringUtils.isNotBlank(deptId)) {
+					DBSql.update("UPDATE ORGDEPARTMENT SET PARENTDEPARTMENTID=? WHERE ID=?", new Object[] { parentId, deptId });
+					SDK.getORGAPI().updateDepartment(deptId, accountBo.getString("NAME"));
+				} else {
+
+					deptId = SDK.getORGAPI().createDepartment(companyId, accountBo.getString("NAME"), "", "", parentId, accountBo.getId(), "");
+				}
+				DepartmentCache.getCache().reload();
+
+				//说锟斤拷锟角客伙拷锟斤拷锟斤拷锟斤拷锟斤拷
+				if (CrmConstant.BO_EU_DNCRM_ACCOUNT.equals(boName)) {
+					//锟斤拷锟斤拷址锟斤拷同锟斤拷锟斤拷锟斤拷
+					List<BO> list = SDK.getBOAPI().query(CrmConstant.BO_EU_DNCRM_LOCATION).bindId(accountBo.getBindId()).addQuery("IS_DEFAULT=", Integer.valueOf(1)).list();
+					//锟窖撅拷锟斤拷锟斤拷默锟较碉拷址
+					if(list.size()>0) {
+						for (BO bo : list) {
+							bo.set("COUNTRY_ID", accountBo.get("COUNTRY_ID"));
+							bo.set("DISTRICT_ID", accountBo.get("DISTRICT_ID"));
+							bo.set("ADDRESS", accountBo.get("ADDRESS"));
+							bo.set("POSTAL_CODE", accountBo.get("POSTAL_CODE"));
+							bo.set("CATE_ID", accountBo.get("CATE_ID"));
+							SDK.getBOAPI().update(CrmConstant.BO_EU_DNCRM_LOCATION, bo);
+
+						}
+					}else {
+						//锟斤拷锟斤拷址锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷
+						BO bo=new BO();
+						bo.setBindId(accountBo.getBindId());
+						bo.set("COUNTRY_ID", accountBo.get("COUNTRY_ID"));
+						bo.set("DISTRICT_ID", accountBo.get("DISTRICT_ID"));
+						bo.set("ADDRESS", accountBo.get("ADDRESS"));
+						bo.set("POSTAL_CODE", accountBo.get("POSTAL_CODE"));
+						bo.set("IS_DEFAULT", 1);
+						bo.set("ACCOUNT_ID", accountBo.getId());
+						bo.set("CATE_ID", CrmConstant.OFFICELOCATION);
+						bo.set("ID", UUIDGener.getUUID());
+						SDK.getBOAPI().create(CrmConstant.BO_EU_DNCRM_LOCATION, bo,SDK.getProcessAPI().getInstanceById(accountBo.getBindId()), uc);
+						//锟斤拷锟铰客伙拷锟斤拷锟斤拷LocationId锟街讹拷
+						accountBo.set("LOCATION_ID", bo.getId());
+						SDK.getBOAPI().update(CrmConstant.BO_EU_DNCRM_ACCOUNT, bo);
+					}
+
+					//锟斤拷锟斤拷系锟剿憋拷同锟斤拷锟斤拷锟斤拷
+					List<BO> mainList = SDK.getBOAPI().query(CrmConstant.BO_EU_DNCRM_CONTACT).addQuery("ACCOUNT_ID=", accountBo.getId()).addQuery("IS_PRIMARY_CONTACT=", 1).list();
+					System.out.println("mainList:"+mainList.size());
+					if(mainList.size()==0) {
+						ProcessInstance createBOProcessInstance = SDK.getProcessAPI().createBOProcessInstance(CrmConstant.obj_fcf1c6204d084ea78e152af821ff4874, uc.getUID(), "");
+						BO bo=new BO();
+						bo.setId(UUIDGener.getUUID());
+						bo.set("NAME", accountBo.get("CONTACT_NAME"));
+						bo.set("SUFFIX_ID", accountBo.get("CONTACT_SUFFIX_ID"));
+						bo.set("TITLE", accountBo.get("CONTACT_TITLE"));
+						bo.set("EMAIL", accountBo.get("CONTACT_EMAIL"));
+						bo.set("MOBILE_PHONE", accountBo.get("PHONE"));
+						bo.set("PHONE", accountBo.get("ALTERNATE_PHONE1"));
+						bo.set("ACCOUNT_ID", accountBo.getId());
+						bo.set("IS_PRIMARY_CONTACT", 1);
+						SDK.getBOAPI().create(CrmConstant.BO_EU_DNCRM_CONTACT, bo, createBOProcessInstance, uc);
+						//同锟斤拷锟斤拷系锟斤拷锟斤拷锟捷碉拷锟矫伙拷锟斤拷
+						new ContactFormAfterSaveEvent().saveContactData(uc, bo, CrmConstant.BO_EU_DNCRM_CONTACT, false);
+					}else {
+						BO bo = mainList.get(0);
+						bo.set("NAME", accountBo.get("CONTACT_NAME"));
+						bo.set("SUFFIX_ID", accountBo.get("CONTACT_SUFFIX_ID"));
+						bo.set("TITLE", accountBo.get("CONTACT_TITLE"));
+						bo.set("EMAIL", accountBo.get("CONTACT_EMAIL"));
+						bo.set("MOBILE_PHONE", accountBo.get("PHONE"));
+						bo.set("PHONE", accountBo.get("ALTERNATE_PHONE1"));
+						bo.set("ACCOUNT_ID", accountBo.getId());
+						SDK.getBOAPI().update(CrmConstant.BO_EU_DNCRM_CONTACT, bo);
+						//同锟斤拷锟斤拷系锟斤拷锟斤拷锟捷碉拷锟矫伙拷锟斤拷
+						new ContactFormAfterSaveEvent().saveContactData(uc, bo, CrmConstant.BO_EU_DNCRM_CONTACT, false);
+					}
+				}
+
+				//说锟斤拷锟角碉拷址锟斤拷锟斤拷锟斤拷锟斤拷
+				else if (CrmConstant.BO_EU_DNCRM_LOCATION.equals(boName)) {
+					BO locationBo = process.getBO(CrmConstant.BO_EU_DNCRM_LOCATION);
+					if (locationBo != null && "1".equals(locationBo.getString("IS_DEFAULT"))) {
+						accountBo.set("COUNTRY_ID", locationBo.get("COUNTRY_ID"));
+						accountBo.set("DISTRICT_ID", locationBo.get("DISTRICT_ID"));
+						accountBo.set("ADDRESS", locationBo.get("ADDRESS"));
+						accountBo.set("POSTAL_CODE", locationBo.get("POSTAL_CODE"));
+						SDK.getBOAPI().update(CrmConstant.BO_EU_DNCRM_ACCOUNT, accountBo);
+					}
+				}
+			}
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			System.out.println("锟酵伙拷锟斤拷锟斤拷锟铰硷拷锟斤拷锟斤拷锟斤拷:"+e.getMessage());
+		}
+	}
+
+
+}

BIN
com.awspaas.user.apps.donenow_ivt.zip


+ 7 - 8
com.awspaas.user.apps.donenow_ivt/src/com/awspaas/user/apps/donenow_ivt/controller/caiController.java

@@ -290,35 +290,34 @@ public class caiController {
 
     @Mapping(value = "com.awspaas.user.apps.donenow_ivt.queryNonServiceOrderPrice")
     public ResponseObject queryNonServiceOrderPrice(UserContext uc, String orderId) {
-        // 1. 订单ID非空校验(完全复制日期接口的校验逻辑)
         if (StringUtils.isBlank(orderId)) {
             return ResponseObject.newErrResponse("订单ID不能为空");
         }
 
-        String sql = "select UNIT_COST_ADD_TAX " +
-                "from `BO_EU_DNIVT_ORDER_PRODUCT` " +
+        String sql = "select sum(COST_TOTAL) " +
+                "from `bo_eu_dnivt_order_product` " +
                 "where order_id = ? ";
 
         String priceStr = DBSql.getString(sql, new Object[]{orderId});
 
         if (StringUtils.isBlank(priceStr)) {
             ResponseObject responseObject = ResponseObject.newOkResponse();
-            responseObject.put("message", "未找到ORDER_ID为【" + orderId + "】的含税单价(UNIT_COST_ADD_TAX)");
+            responseObject.put("message", "未找到ORDER_ID为【" + orderId + "】的总金额(COST_TOTAL)");
             responseObject.setData(Collections.emptyList());
             return responseObject;
         }
 
-        Double unitCostAddTax = null;
+        Double costTotal = null;
         try {
-            unitCostAddTax = Double.parseDouble(priceStr);
+            costTotal = Double.parseDouble(priceStr);
         } catch (NumberFormatException e) {
-            return ResponseObject.newErrResponse("含税单价格式错误:" + priceStr);
+            return ResponseObject.newErrResponse("总金额格式错误:" + priceStr);
         }
 
         List<Map<String, Object>> resultList = new ArrayList<>();
         Map<String, Object> priceInfo = new HashMap<>();
         priceInfo.put("order_id", orderId);
-        priceInfo.put("UNIT_COST_ADD_TAX", unitCostAddTax);
+        priceInfo.put("COST_TOTAL", costTotal);
         resultList.add(priceInfo);
 
         ResponseObject responseObject = ResponseObject.newOkResponse();

+ 17 - 11
com.awspaas.user.apps.donenow_ivt/src/com/awspaas/user/apps/donenow_ivt/event/ivtOrderProcessAfterComplete.java

@@ -131,9 +131,9 @@ public class ivtOrderProcessAfterComplete extends ExecuteListener {
 
                 if (dateInfo != null && priceInfo != null) {
                     String planDate = (String) dateInfo.get("EXPECTED_SHIP_DATE");
-                    Double planAmount = (Double) priceInfo.get("UNIT_COST_ADD_TAX");
+                    Double planAmount = (Double) priceInfo.get("cost_total");
 
-                    if (StringUtils.isNotBlank(planDate) && planAmount != null && planAmount > 0) {
+                    if (StringUtils.isNotBlank(planDate) ) {
                         createPaymentPlan(uc, orderId, planDate, planAmount);
                         System.out.println("==== 非服务类付款计划创建完成,日期:" + planDate + ",金额:" + planAmount + " ====");
                     } else {
@@ -283,29 +283,35 @@ public class ivtOrderProcessAfterComplete extends ExecuteListener {
 
 
     private Map<String, Object> queryNonServiceOrderPrice(UserContext uc, String orderId) {
+        // 入参校验:订单ID为空返回null(与日期方法风格一致)
         if (StringUtils.isBlank(orderId)) {
             return null;
         }
 
-        String sql = "select UNIT_COST_ADD_TAX " +
+        // SQL查询:求和 cost_total 字段(数据库字段正确,无需修改)
+        String sql = "select sum(`cost_total`) " +
                 "from `BO_EU_DNIVT_ORDER_PRODUCT` " +
                 "where order_id = ? ";
+        String totalCostStr = DBSql.getString(sql, new Object[]{orderId});
 
-        String priceStr = DBSql.getString(sql, new Object[]{orderId});
-        if (StringUtils.isBlank(priceStr)) {
+        // 空值处理:查询结果为空返回null(与日期方法风格一致)
+        if (StringUtils.isBlank(totalCostStr)) {
             return null;
         }
 
+        // 数值转换:字符串转Double(异常时返回null)
+        Double totalCost;
         try {
-            Double unitCostAddTax = Double.parseDouble(priceStr);
-            Map<String, Object> priceInfo = new HashMap<>();
-            priceInfo.put("order_id", orderId);
-            priceInfo.put("UNIT_COST_ADD_TAX", unitCostAddTax);
-            return priceInfo;
+            totalCost = Double.parseDouble(totalCostStr);
         } catch (NumberFormatException e) {
             return null;
         }
 
-
+        // 结果封装:返回字段名改为 cost_total(小写+下划线,与前端完全对齐)
+        Map<String, Object> priceInfo = new HashMap<>();
+        priceInfo.put("order_id", orderId);
+        priceInfo.put("cost_total", totalCost); // 关键修改:字段名从 TOTAL_COST 改为 cost_total
+        return priceInfo;
     }
+
 }