kgdxpr 1 year ago
commit dbfefc24a4

@ -1900,6 +1900,17 @@ public class CollectController extends Controller {
renderJson(map);
}
/**
*
* http://10.10.21.20:9000/QingLong/collect/getAllBureau?type_id=1
*/
@Before({GET.class, RepeatIntercetpor.class})
@IsNumericInterface({"type_id"})
public void getAllBureau(int type_id) {
List<Record> list = cm.getAllBureau(type_id);
renderJson(CommonUtil.renderJsonForLayUI(list));
}
/**
*
* http://10.10.21.20:9000/QingLong/collect/getTyAllBureau
@ -1958,5 +1969,35 @@ public class CollectController extends Controller {
}
renderJson(res);
}
/**
* ID
*
* @throws InterruptedException
*/
@Before({GET.class, RepeatIntercetpor.class})
@EmptyInterface({"third_party_id", "org_id"})
public void matchBureau(String org_id, String third_party_id) {
cm.matchBureau(org_id, third_party_id);
Map<String, Object> map = new HashMap<>();
map.put("success", true);
map.put("message", "保存成功!");
renderJson(map);
}
/**
* ID
*
* @throws InterruptedException
*/
@Before({GET.class, RepeatIntercetpor.class})
@EmptyInterface({"third_party_id", "org_id"})
public void disMatchBureau(String org_id) {
cm.disMatchBureau(org_id);
Map<String, Object> map = new HashMap<>();
map.put("success", true);
map.put("message", "保存成功!");
renderJson(map);
}
}

@ -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);
}
}
Loading…
Cancel
Save