@ -2551,11 +2551,7 @@ public class CollectModel {
* @return
* /
public Map < String , Record > 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 < Record > list = Db . find ( sql , city_id ) ;
List < Record > list = getAllBureau ( - 1 ) ;
Map < String , Record > _map = new HashMap < > ( ) ;
for ( Record record : list ) {
String third_party_id = record . getStr ( "third_party_id" ) ;
@ -2564,4 +2560,48 @@ public class CollectModel {
}
return _map ;
}
/ * *
* 功 能 : 获 取 我 系 统 中 所 有 有 效 单 位
*
* @return
* /
public List < Record > getAllBureau ( int type_id ) {
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 order by is_match desc" ;
List < Record > list = Db . find ( sql , city_id ) ;
List < Record > res = new ArrayList < > ( ) ;
for ( Record record : list ) {
int is_match = record . getInt ( "is_match" ) ;
if ( type_id = = 0 & & is_match = = 0 ) res . add ( record ) ;
if ( type_id = = 1 & & is_match = = 1 ) res . add ( record ) ;
if ( type_id = = - 1 ) res . add ( record ) ;
}
return res ;
}
/ * *
* 功 能 : 匹 配 第 三 方 系 统 与 我 们 的 系 统 单 位 ID 一 致
*
* @throws InterruptedException
* /
public void matchBureau ( String org_id , String third_party_id ) {
Record record = Db . findById ( "t_base_organization" , "org_id" , org_id ) ;
record . set ( "third_party_id" , third_party_id ) ;
Db . update ( "t_base_organization" , "org_id" , record ) ;
}
/ * *
* 功 功 能 : 解 除 第 三 方 系 统 与 我 们 的 系 统 单 位 ID 的 匹 配
*
* @throws InterruptedException
* /
public void disMatchBureau ( String org_id ) {
Record record = Db . findById ( "t_base_organization" , "org_id" , org_id ) ;
record . set ( "third_party_id" , null ) ;
Db . update ( "t_base_organization" , "org_id" , record ) ;
}
}