main
黄海 2 years ago
parent b5144b64b9
commit ee2c4f6c83

@ -63,7 +63,7 @@ public class Study {
//初始化
SyncUtil.init();
//从天喻获取所有单位名单
List<JSONObject> list = new ArrayList<>();
if (!RedisKit.Exists(KEY)) {
//获取所有机构+学校

@ -1,6 +1,7 @@
package com.dsideal.QingLong.Collect.Controller;
import cn.hutool.core.io.FileUtil;
import com.YunXiao.SortClass;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.dsideal.QingLong.Base.Model.BaseModel;
@ -1650,10 +1651,10 @@ public class CollectController extends Controller {
int job_type = jobRecord.getInt("job_type");//任务类型1表单2EXCEL模板
switch (job_type) {
case 1:
cm.getSummaryExcelForFormFill(job_id,bureau_id,publish_role_id, excelPath); //测试用例 job_id=8
cm.getSummaryExcelForFormFill(job_id, bureau_id, publish_role_id, excelPath); //测试用例 job_id=8
break;
case 2:
cm.getSummaryExcelForImportExcel(job_id,bureau_id,publish_role_id, excelPath);//测试用例 job_id=47
cm.getSummaryExcelForImportExcel(job_id, bureau_id, publish_role_id, excelPath);//测试用例 job_id=47
break;
}
//提供下载
@ -1899,4 +1900,41 @@ public class CollectController extends Controller {
renderJson(map);
}
/**
*
* http://10.10.21.20:9000/QingLong/collect/getTyAllBureau
* @throws InterruptedException
*/
@Before({GET.class, RepeatIntercetpor.class})
public void getTyAllBureau() throws InterruptedException {
String KEY = "TY_BUREAU";
//从天喻获取所有单位名单
List<JSONObject> list = new ArrayList<>();
if (!RedisKit.Exists(KEY)) {
//获取所有机构+学校
com.YunXiao.Model.BaseModel ybm = new com.YunXiao.Model.BaseModel();
List<JSONObject> jBureauList = ybm.getBureauList();
for (JSONObject jo : jBureauList) {
String org_id = jo.getString("org_id");
String org_name = jo.getString("org_name");
JSONObject jo2 = new JSONObject();
jo2.put("org_id", org_id);
jo2.put("org_name", org_name);
list.add(jo2);
}
//缓存到 Redis中有效期12小时
RedisKit.Set(KEY, list.toString());
RedisKit.Expire(KEY, 60 * 60 * 12);
} else {
String json = RedisKit.Get(KEY);
JSONArray ja = JSONArray.parseArray(json);
for (int i = 0; i < ja.size(); i++) list.add(ja.getJSONObject(i));
}
//resultA是拼装好的List集合
SortClass sort = new SortClass();
Collections.sort(list, sort);
renderJson(list);
}
}

Loading…
Cancel
Save