From b38cafc1d2a3d27dfb9332319e336503707111c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Wed, 31 Jan 2024 14:23:11 +0800 Subject: [PATCH] 'commit' --- .../Collect/Controller/CollectController.java | 10 ++++++++++ .../QingLong/Collect/Model/CollectModel.java | 19 ++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/dsideal/QingLong/Collect/Controller/CollectController.java b/src/main/java/com/dsideal/QingLong/Collect/Controller/CollectController.java index 6adf145f..71394f8a 100644 --- a/src/main/java/com/dsideal/QingLong/Collect/Controller/CollectController.java +++ b/src/main/java/com/dsideal/QingLong/Collect/Controller/CollectController.java @@ -1900,6 +1900,16 @@ public class CollectController extends Controller { renderJson(map); } + /** + * 功能:我系统中所有有效单位 + * http://10.10.21.20:9000/QingLong/collect/getAllBureau + */ + @Before({GET.class, RepeatIntercetpor.class}) + public void getAllBureau() { + List list = cm.getAllBureau(); + renderJson(CommonUtil.renderJsonForLayUI(list)); + } + /** * 功能:获取天喻的所有单位列表 * http://10.10.21.20:9000/QingLong/collect/getTyAllBureau diff --git a/src/main/java/com/dsideal/QingLong/Collect/Model/CollectModel.java b/src/main/java/com/dsideal/QingLong/Collect/Model/CollectModel.java index 841623eb..bc6f7f56 100644 --- a/src/main/java/com/dsideal/QingLong/Collect/Model/CollectModel.java +++ b/src/main/java/com/dsideal/QingLong/Collect/Model/CollectModel.java @@ -2551,11 +2551,7 @@ public class CollectModel { * @return */ public Map getAllMatchBureau() { - GlobalModel gm = new GlobalModel(); - String city_id = gm.getGlobalValueByKey("install_area"); - - String sql = "select org_id,org_name,third_party_id from t_base_organization where city_id=? and bureau_id=org_id"; - List list = Db.find(sql, city_id); + List list = getAllBureau(); Map _map = new HashMap<>(); for (Record record : list) { String third_party_id = record.getStr("third_party_id"); @@ -2564,4 +2560,17 @@ public class CollectModel { } return _map; } + + /** + * 功能:获取我系统中所有有效单位 + * @return + */ + public List getAllBureau() { + GlobalModel gm = new GlobalModel(); + String city_id = gm.getGlobalValueByKey("install_area"); + + String sql = "select org_id,org_name,third_party_id,CASE WHEN third_party_id IS NULL THEN 0 ELSE 1 END AS is_match from t_base_organization where city_id=? and bureau_id=org_id and is_virtual=0"; + List list = Db.find(sql, city_id); + return list; + } } \ No newline at end of file