|
|
|
@ -1,6 +1,10 @@
|
|
|
|
|
package com.dsideal.QingLong.Zbdc.Controller;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.EmptyInterface;
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.IsLoginInterface;
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.IsNumericInterface;
|
|
|
|
|
import com.dsideal.QingLong.Util.CommonUtil;
|
|
|
|
|
import com.dsideal.QingLong.Util.SessionKit;
|
|
|
|
|
import com.dsideal.QingLong.Zbdc.Model.ZbdcModel;
|
|
|
|
|
import com.jfinal.aop.Before;
|
|
|
|
@ -8,8 +12,11 @@ import com.jfinal.core.Controller;
|
|
|
|
|
import com.jfinal.ext.interceptor.GET;
|
|
|
|
|
import com.jfinal.ext.interceptor.POST;
|
|
|
|
|
import com.jfinal.kit.Kv;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Page;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
public class ZbdcController extends Controller {
|
|
|
|
|
|
|
|
|
|
private final ZbdcModel zm = new ZbdcModel();
|
|
|
|
@ -20,6 +27,7 @@ public class ZbdcController extends Controller {
|
|
|
|
|
* @param year http://127.0.0.1:9000/QingLong/zbdc/getSchoolBase
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
public void getSchoolBase(int year) {
|
|
|
|
|
if (year == 0) year = DateTime.now().year();//如果没有传入获取的年份,那么就是系统的默认当前年份
|
|
|
|
|
String bureau_id = SessionKit.get(getRequest(), getResponse(), "bureau_id");
|
|
|
|
@ -41,6 +49,7 @@ public class ZbdcController extends Controller {
|
|
|
|
|
* @param gz_class_count 高中班级数
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
public void saveSchool(int year, int xx_student_count, int cz_student_count, int gz_student_count,
|
|
|
|
|
int xx_teacher_count, int cz_teacher_count, int gz_teacher_count,
|
|
|
|
|
int xx_class_count, int cz_class_count, int gz_class_count) {
|
|
|
|
@ -68,6 +77,7 @@ public class ZbdcController extends Controller {
|
|
|
|
|
* @param year
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
public void getSchoolCgzb(int year) {
|
|
|
|
|
if (year == 0) year = DateTime.now().year();//如果没有传入获取的年份,那么就是系统的默认当前年份
|
|
|
|
|
String bureau_id = SessionKit.get(getRequest(), getResponse(), "bureau_id");
|
|
|
|
@ -149,6 +159,7 @@ public class ZbdcController extends Controller {
|
|
|
|
|
* @param xxkx_yqypjs 小学科学-仪器已配件数(件)
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
public void saveCgzb(int year,
|
|
|
|
|
int wl_cgss, float wl_cgmj, int wl_tjss, float wl_tjmj, int wl_yqsss, float wl_yqsmj, int wl_yqyppz,
|
|
|
|
|
int wl_yqypjs, int hx_cgss, float hx_cgmj, int hx_tjss, float hx_tjmj, int hx_yqsss, float hx_yqsmj,
|
|
|
|
@ -186,6 +197,7 @@ public class ZbdcController extends Controller {
|
|
|
|
|
* 功能:获取学校类型ID
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
public void getSchoolTypeId() {
|
|
|
|
|
Record record = zm.getBureauBean(SessionKit.get(getRequest(), getResponse(), "bureau_id"));
|
|
|
|
|
int school_type_id = record.getInt("school_type_id");
|
|
|
|
@ -195,4 +207,55 @@ public class ZbdcController extends Controller {
|
|
|
|
|
kv.set("school_type_id", school_type_id);
|
|
|
|
|
renderJson(kv);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:当前登录学校,应该看到哪些需要填报的科目
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
public void getKm() {
|
|
|
|
|
Record record = zm.getBureauBean(SessionKit.get(getRequest(), getResponse(), "bureau_id"));
|
|
|
|
|
int school_type_id = record.getInt("school_type_id");
|
|
|
|
|
//有哪些学段
|
|
|
|
|
List<Integer> listStage = zm.getStageListBySchoolTypeId(school_type_id);
|
|
|
|
|
//有哪些需要填报的科目
|
|
|
|
|
List<Record> list = zm.getZbdcKm(listStage);
|
|
|
|
|
renderJson(CommonUtil.renderJsonForLayUI(list));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:获取指定科目下的填报模板
|
|
|
|
|
*
|
|
|
|
|
* @param km_code 科目代码
|
|
|
|
|
* @param level_filter 要过滤的分类名称,比如 专用,器材,健身训练类 或者 通用
|
|
|
|
|
* @param year 年份
|
|
|
|
|
* @param page 第几页
|
|
|
|
|
* @param limit 每页多少个
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
@EmptyInterface({"km_code"})
|
|
|
|
|
public void getFill(String km_code, String level_filter, int year, int page, int limit) {
|
|
|
|
|
if (year == 0) year = DateTime.now().year();//如果没有传入获取的年份,那么就是系统的默认当前年份
|
|
|
|
|
String bureau_id = SessionKit.get(getRequest(), getResponse(), "bureau_id");
|
|
|
|
|
Page<Record> list = zm.getFill(bureau_id, year, km_code, level_filter, page, limit);
|
|
|
|
|
renderJson(CommonUtil.renderJsonForLayUI(list));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:保存填报的内容
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
@IsNumericInterface({"templet_id"})
|
|
|
|
|
public void saveFill(int year, int templet_id, Float xysl) {
|
|
|
|
|
if (year == 0) year = DateTime.now().year();//如果没有传入获取的年份,那么就是系统的默认当前年份
|
|
|
|
|
String bureau_id = SessionKit.get(getRequest(), getResponse(), "bureau_id");
|
|
|
|
|
zm.saveFill(year, bureau_id, templet_id, xysl);
|
|
|
|
|
Kv kv = Kv.create();
|
|
|
|
|
kv.set("success", true);
|
|
|
|
|
kv.set("message", "保存成功!");
|
|
|
|
|
renderJson(kv);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|