main
黄海 2 years ago
parent b9587f01eb
commit 3cbe646757

@ -41,7 +41,7 @@ public final class RedisUtil {
JedisPoolConfig config = new JedisPoolConfig();
config.setMaxTotal(MAX_ACTIVE);
config.setMaxIdle(MAX_IDLE);
config.setMaxWaitMillis(MAX_WAIT);
//config.setMaxWaitMillis(MAX_WAIT);
config.setTestOnBorrow(TEST_ON_BORROW);
jedisPool = new JedisPool(config, ADDR, PORT, TIMEOUT, null);
} catch (Exception e) {

@ -93,6 +93,16 @@ public class YpController extends Controller {
renderJson(kv);
}
/**
*
* @param task_id
*/
@Before(GET.class)
@IsNumericInterface({"task_id"})
public void getTask(int task_id) {
Record record = model.getTask(task_id);
renderJson(record);
}
/**
*
@ -193,18 +203,18 @@ public class YpController extends Controller {
* excel
*
* @param task_id
* @param bx_id 0:ID
* @param bx_id 0:ID
*/
@Before(GET.class)
@IsNumericInterface({"task_id", "page", "limit"})
public void exportExcel(int task_id,int bx_id) {
public void exportExcel(int task_id, int bx_id) {
//模板文件
String excelPath = PathKit.getRootClassPath() + PropKit.get("excelExportTemplatePathSuffix").replace("\\", "/");
String filePath = excelPath + "YangPuZhaoShengExcel.json";
//转成 json对象
JSONObject jo = FileUtil.readJsonFile(filePath);
//导出
Page<Record> rs = model.getTaskInfo(task_id, bx_id,1, 99999);
Page<Record> rs = model.getTaskInfo(task_id, bx_id, 1, 99999);
String excelFile = excelPath + "excelTemp/" + UUID.randomUUID().toString().toUpperCase() + ".xls";
ExcelExportUtil.export(rs, jo, excelFile);
//提供下载
@ -291,7 +301,7 @@ public class YpController extends Controller {
}
/**
*
*/
@Before(GET.class)
@IsNumericInterface({"task_id"})

@ -40,6 +40,15 @@ public class YpModel {
return r1.getInt("count");
}
/**
*
* @param task_id
*/
public Record getTask(int task_id) {
Record record = Db.findById("t_yp_task", "task_id", task_id);
return record;
}
/**
*
*/

Loading…
Cancel
Save