2 İşlemeler a40dd65d8b ... 6ad9a7e224

Yazar SHA1 Mesaj Tarih
  HULEI 6ad9a7e224 Merge branch 'master' of http://210.51.45.41:3000/itcat_admin/aws_donenow 2 ay önce
  HULEI 7d1ea547a0 配置项选择服务更新产品字段 2 ay önce

+ 156 - 0
com.awspaas.user.apps.donenow_crm/src/com/awspaas/user/apps/donenow_crm/controller/accountController.java

@@ -434,5 +434,161 @@ public class accountController extends BaseController {
         return ResponseObject.newOkResponse("����ɹ�");
     }
 
+    @Mapping(value = "com.awspaas.user.apps.donenow_crm.getProductInfoByContractServiceId")
+    public ResponseObject getProductInfoByContractServiceId(UserContext uc, String id) {
+        try {
+            // 1. 根据传入的id查询BO_EU_DNCTT_CONTRACT_SERVICE表获取OBJECT_ID
+            String contractServiceSql = "SELECT OBJECT_ID " +
+                    "FROM BO_EU_DNCTT_CONTRACT_SERVICE " +
+                    "WHERE id = ?";
+            Map<String, Object> contractServiceInfo = DBSql.getMap(contractServiceSql, new Object[]{id});
+
+            Map<String, Object> result = new HashMap<>();
+
+            if (contractServiceInfo == null || contractServiceInfo.get("OBJECT_ID") == null) {
+                // 未查询到合同服务记录
+                result.put("contractServiceExists", false);
+                result.put("serviceExists", false);
+                result.put("productExists", false);
+                result.put("productId", null);
+                result.put("productName", null);
+            } else {
+                result.put("contractServiceExists", true);
+                String objectId = contractServiceInfo.get("OBJECT_ID").toString();
+
+                // 2. 根据OBJECT_ID查询BO_EU_DNIVT_SERVICE表获取PRODUCT_ID
+                String serviceSql = "SELECT PRODUCT_ID " +
+                        "FROM BO_EU_DNIVT_SERVICE " +
+                        "WHERE id = ?";
+                Map<String, Object> serviceInfo = DBSql.getMap(serviceSql, new Object[]{objectId});
+
+                if (serviceInfo == null || serviceInfo.get("PRODUCT_ID") == null) {
+                    // 未查询到服务记录
+                    result.put("serviceExists", false);
+                    result.put("productExists", false);
+                    result.put("productId", null);
+                    result.put("productName", null);
+                } else {
+                    result.put("serviceExists", true);
+                    String productId = serviceInfo.get("PRODUCT_ID").toString();
+
+                    // 3. 根据PRODUCT_ID查询bo_eu_dnivt_product表获取id和NAME
+                    String productSql = "SELECT id, NAME " +
+                            "FROM bo_eu_dnivt_product " +
+                            "WHERE id = ?";
+                    Map<String, Object> productInfo = DBSql.getMap(productSql, new Object[]{productId});
+
+                    if (productInfo == null) {
+                        // 未查询到产品记录
+                        result.put("productExists", false);
+                        result.put("productId", null);
+                        result.put("productName", null);
+                    } else {
+                        // 成功查询到产品信息
+                        result.put("productExists", true);
+                        result.put("productId", productInfo.get("id"));
+                        result.put("productName", productInfo.get("NAME"));
+                    }
+                }
+            }
+
+            ResponseObject responseObject = ResponseObject.newOkResponse();
+            responseObject.setData(result);
+            return responseObject;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return ResponseObject.newErrResponse("查询产品信息失败:" + e.getMessage());
+        }
+    }
+
+    @Mapping(value = "com.awspaas.user.apps.donenow_crm.getProductByContractCostId")
+    public ResponseObject getProductByContractCostId(UserContext uc, String id) {
+        try {
+            // 1. 第一步:根据传入的id查询bo_eu_dnctt_contract_cost表的PRODUCT_ID
+            String contractCostSql = "SELECT PRODUCT_ID " +
+                    "FROM bo_eu_dnctt_contract_cost " +
+                    "WHERE id = ?";
+            Map<String, Object> contractCostInfo = DBSql.getMap(contractCostSql, new Object[]{id});
+
+            Map<String, Object> result = new HashMap<>();
+
+            if (contractCostInfo == null || contractCostInfo.get("PRODUCT_ID") == null) {
+                // 未查询到合同成本记录或PRODUCT_ID为空
+                result.put("contractCostExists", false); // 合同成本记录是否存在
+                result.put("productExists", false); // 产品记录是否存在
+                result.put("productId", null);
+                result.put("productName", null);
+            } else {
+                result.put("contractCostExists", true);
+                String productId = contractCostInfo.get("PRODUCT_ID").toString();
+
+                // 2. 第二步:用PRODUCT_ID查询bo_eu_dnivt_product表的id和name
+                String productSql = "SELECT id, NAME " +
+                        "FROM bo_eu_dnivt_product " +
+                        "WHERE id = ?";
+                Map<String, Object> productInfo = DBSql.getMap(productSql, new Object[]{productId});
+
+                if (productInfo == null) {
+                    // 未查询到产品记录
+                    result.put("productExists", false);
+                    result.put("productId", null);
+                    result.put("productName", null);
+                } else {
+                    // 成功查询到产品信息
+                    result.put("productExists", true);
+                    result.put("productId", productInfo.get("id")); // 产品表id
+                    result.put("productName", productInfo.get("NAME")); // 产品名称
+                }
+            }
+
+            ResponseObject responseObject = ResponseObject.newOkResponse();
+            responseObject.setData(result);
+            return responseObject;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return ResponseObject.newErrResponse("查询产品信息失败:" + e.getMessage());
+        }
+    }
+
+    @Mapping(value = "com.awspaas.user.apps.donenow_crm.getUdfGroupByProductId")
+    public ResponseObject getUdfGroupByProductId(UserContext uc, String productId) {
+        try {
+            // 1. 第一步:查询产品表的INSTALLED_PRODUCT_CATE_ID
+            String productSql = "SELECT INSTALLED_PRODUCT_CATE_ID " +
+                    "FROM BO_EU_DNIVT_PRODUCT " +
+                    "WHERE id = ?";
+            Map<String, Object> productInfo = DBSql.getMap(productSql, new Object[]{productId});
+
+            Map<String, Object> result = new HashMap<>(2); // 仅存2个字段
+            String udfGroupId = null;
+            String udfGroupName = null;
+
+            if (productInfo != null && productInfo.get("INSTALLED_PRODUCT_CATE_ID") != null) {
+                String installedProductCateId = productInfo.get("INSTALLED_PRODUCT_CATE_ID").toString();
+
+                // 2. 第二步:查询自定义组表的id和name
+                String udfGroupSql = "SELECT id, NAME " +
+                        "FROM BO_EU_DNSYS_UDF_GROUP " +
+                        "WHERE is_active = 1 AND id = ?";
+                Map<String, Object> udfGroupInfo = DBSql.getMap(udfGroupSql, new Object[]{installedProductCateId});
+
+                if (udfGroupInfo != null) {
+                    udfGroupId = udfGroupInfo.get("id").toString();
+                    udfGroupName = udfGroupInfo.get("NAME").toString();
+                }
+            }
+
+            // 仅返回两个字段:自定义组id和name(不存在则为null)
+            result.put("udfGroupId", udfGroupId);
+            result.put("udfGroupName", udfGroupName);
+
+            ResponseObject responseObject = ResponseObject.newOkResponse();
+            responseObject.setData(result);
+            return responseObject;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return ResponseObject.newErrResponse("查询失败:" + e.getMessage());
+        }
+    }
 
 }

+ 2 - 2
com.awspaas.user.apps.donenow_crm/src/com/awspaas/user/apps/donenow_crm/event/TestForm.java

@@ -21,7 +21,7 @@ public class TestForm implements DataWindowFormatSQLEventInterface {
             LOGGER.info("【初始SQL】" + sql);
             LOGGER.info("【查询参数】" + JSON.toJSONString(sqlParam));
 
-            String paramName = "ACCOUNT_ID";
+            String paramName = "EXTTEXT1";
             // 1. 先处理参数值:自动加%(避免前端未加导致模糊匹配失效)
             if (sqlParam.containsKey(paramName)) {
                 String paramValue = sqlParam.get(paramName).toString().trim();
@@ -63,7 +63,7 @@ public class TestForm implements DataWindowFormatSQLEventInterface {
 
             if (sqlParam.containsKey(paramName)) {
                 // 2. 精确删除原SQL中的ACCOUNT_ID等于条件(字符串必须和原SQL完全一致)
-                String oldAccountCondition = "AND BO_EU_DNCRM_INSTALLED_PRODUCT.ACCOUNT_ID = :ACCOUNT_ID";
+                String oldAccountCondition = "AND BO_EU_DNCRM_INSTALLED_PRODUCT.EXTTEXT1 = :EXTTEXT1";
                 sql = sql.replace(oldAccountCondition, ""); // 替换为空,删除该条件
                 LOGGER.info("【删除旧条件后SQL】" + sql);
 

+ 1 - 115
com.awspaas.user.apps.donenow_ctt/src/com/awspaas/user/apps/donenow_ctt/controller/contractApproveController.java

@@ -1923,7 +1923,7 @@ public class contractApproveController {
                     "c.ID AS c_id  " +
                     "FROM BO_EU_DNCTT_COMMISSION_IMPORT a " +
                     "JOIN BO_EU_DNCTT_COMMISSION b " +
-                    "ON a.ACCOUNT_USER_NO = b.NEW_ACCOUNT AND a.DEVICE_ID = b.DEVICE_ID" +
+                    "ON a.ACCOUNT_USER_NO = b.NEW_ACCOUNT AND a.DEVICE_ID = b.DEVICE_ID " +
                     "JOIN BO_EU_DNCTT_COMMISSION_PERIOD c " +
                     "ON a.ZB_FEE_DATE = c.ZB_FEE_DATE AND b.bindid = c.bindid " +
                     "WHERE a.ZB_FEE_DATE = ?";
@@ -2072,121 +2072,7 @@ public class contractApproveController {
         }
     }
 
-    @Mapping(value = "com.awspaas.user.apps.donenow_ctt.getProductInfoByContractServiceId")
-    public ResponseObject getProductInfoByContractServiceId(UserContext uc, String id) {
-        try {
-            // 1. 根据传入的id查询BO_EU_DNCTT_CONTRACT_SERVICE表获取OBJECT_ID
-            String contractServiceSql = "SELECT OBJECT_ID " +
-                    "FROM BO_EU_DNCTT_CONTRACT_SERVICE " +
-                    "WHERE id = ?";
-            Map<String, Object> contractServiceInfo = DBSql.getMap(contractServiceSql, new Object[]{id});
-
-            Map<String, Object> result = new HashMap<>();
-
-            if (contractServiceInfo == null || contractServiceInfo.get("OBJECT_ID") == null) {
-                // 未查询到合同服务记录
-                result.put("contractServiceExists", false);
-                result.put("serviceExists", false);
-                result.put("productExists", false);
-                result.put("productId", null);
-                result.put("productName", null);
-            } else {
-                result.put("contractServiceExists", true);
-                String objectId = contractServiceInfo.get("OBJECT_ID").toString();
-
-                // 2. 根据OBJECT_ID查询BO_EU_DNIVT_SERVICE表获取PRODUCT_ID
-                String serviceSql = "SELECT PRODUCT_ID " +
-                        "FROM BO_EU_DNIVT_SERVICE " +
-                        "WHERE id = ?";
-                Map<String, Object> serviceInfo = DBSql.getMap(serviceSql, new Object[]{objectId});
-
-                if (serviceInfo == null || serviceInfo.get("PRODUCT_ID") == null) {
-                    // 未查询到服务记录
-                    result.put("serviceExists", false);
-                    result.put("productExists", false);
-                    result.put("productId", null);
-                    result.put("productName", null);
-                } else {
-                    result.put("serviceExists", true);
-                    String productId = serviceInfo.get("PRODUCT_ID").toString();
-
-                    // 3. 根据PRODUCT_ID查询bo_eu_dnivt_product表获取id和NAME
-                    String productSql = "SELECT id, NAME " +
-                            "FROM bo_eu_dnivt_product " +
-                            "WHERE id = ?";
-                    Map<String, Object> productInfo = DBSql.getMap(productSql, new Object[]{productId});
-
-                    if (productInfo == null) {
-                        // 未查询到产品记录
-                        result.put("productExists", false);
-                        result.put("productId", null);
-                        result.put("productName", null);
-                    } else {
-                        // 成功查询到产品信息
-                        result.put("productExists", true);
-                        result.put("productId", productInfo.get("id"));
-                        result.put("productName", productInfo.get("NAME"));
-                    }
-                }
-            }
-
-            ResponseObject responseObject = ResponseObject.newOkResponse();
-            responseObject.setData(result);
-            return responseObject;
-        } catch (Exception e) {
-            e.printStackTrace();
-            return ResponseObject.newErrResponse("查询产品信息失败:" + e.getMessage());
-        }
-    }
-
-    @Mapping(value = "com.awspaas.user.apps.donenow_ctt.getProductByContractCostId")
-    public ResponseObject getProductByContractCostId(UserContext uc, String id) {
-        try {
-            // 1. 第一步:根据传入的id查询bo_eu_dnctt_contract_cost表的PRODUCT_ID
-            String contractCostSql = "SELECT PRODUCT_ID " +
-                    "FROM bo_eu_dnctt_contract_cost " +
-                    "WHERE id = ?";
-            Map<String, Object> contractCostInfo = DBSql.getMap(contractCostSql, new Object[]{id});
-
-            Map<String, Object> result = new HashMap<>();
-
-            if (contractCostInfo == null || contractCostInfo.get("PRODUCT_ID") == null) {
-                // 未查询到合同成本记录或PRODUCT_ID为空
-                result.put("contractCostExists", false); // 合同成本记录是否存在
-                result.put("productExists", false); // 产品记录是否存在
-                result.put("productId", null);
-                result.put("productName", null);
-            } else {
-                result.put("contractCostExists", true);
-                String productId = contractCostInfo.get("PRODUCT_ID").toString();
-
-                // 2. 第二步:用PRODUCT_ID查询bo_eu_dnivt_product表的id和name
-                String productSql = "SELECT id, NAME " +
-                        "FROM bo_eu_dnivt_product " +
-                        "WHERE id = ?";
-                Map<String, Object> productInfo = DBSql.getMap(productSql, new Object[]{productId});
-
-                if (productInfo == null) {
-                    // 未查询到产品记录
-                    result.put("productExists", false);
-                    result.put("productId", null);
-                    result.put("productName", null);
-                } else {
-                    // 成功查询到产品信息
-                    result.put("productExists", true);
-                    result.put("productId", productInfo.get("id")); // 产品表id
-                    result.put("productName", productInfo.get("NAME")); // 产品名称
-                }
-            }
 
-            ResponseObject responseObject = ResponseObject.newOkResponse();
-            responseObject.setData(result);
-            return responseObject;
-        } catch (Exception e) {
-            e.printStackTrace();
-            return ResponseObject.newErrResponse("查询产品信息失败:" + e.getMessage());
-        }
-    }
 
 }