|
|
|
@ -38,12 +38,12 @@ public class BaseController extends Controller {
|
|
|
|
|
@IsNumericInterface({"sort_id", "stage_id"})
|
|
|
|
|
public void addSubject(String subject_name, String subject_code, int stage_id, int sort_id) {
|
|
|
|
|
//1、检查科目名称是不是已经在指定学段下存在,存在的不能继续添加
|
|
|
|
|
if (!bm.checkSubjectName(subject_name, stage_id)) {
|
|
|
|
|
if (bm.checkSubjectName(subject_name, stage_id)) {
|
|
|
|
|
renderJson(RetKit.renderFail("该科目名称已存在"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//2、检查科目代码是不是在指定学段下存在,存在的不能继续添加
|
|
|
|
|
if (!bm.checkSubjectCode(subject_code, stage_id)) {
|
|
|
|
|
if (bm.checkSubjectCode(subject_code, stage_id)) {
|
|
|
|
|
renderJson(RetKit.renderFail("该科目代码已存在"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -70,12 +70,12 @@ public class BaseController extends Controller {
|
|
|
|
|
@IsNumericInterface({"sort_id", "stage_id", "subject_id"})
|
|
|
|
|
public void updateSubject(int subject_id, String subject_name, String subject_code, int stage_id, int sort_id) {
|
|
|
|
|
//1、检查科目名称是不是已经在指定学段下存在,存在的不能继续添加
|
|
|
|
|
if (!bm.checkSubjectName(subject_id, subject_name, stage_id)) {
|
|
|
|
|
if (bm.checkSubjectName(subject_id, subject_name, stage_id)) {
|
|
|
|
|
renderJson(RetKit.renderFail("该科目名称已存在"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//2、检查科目代码是不是在指定学段下存在,存在的不能继续添加
|
|
|
|
|
if (!bm.checkSubjectCode(subject_id, subject_code, stage_id)) {
|
|
|
|
|
if (bm.checkSubjectCode(subject_id, subject_code, stage_id)) {
|
|
|
|
|
renderJson(RetKit.renderFail("该科目代码已存在"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -157,7 +157,7 @@ public class BaseController extends Controller {
|
|
|
|
|
@IsNumericInterface({"scheme_id", "stage_id", "subject_id", "type_id", "scheme_type_id", "sort_id"})
|
|
|
|
|
public void updateScheme(int scheme_id, String scheme_name, int stage_id, int subject_id, int type_id, int scheme_type_id, int sort_id) {
|
|
|
|
|
//1、检查此名称的版本是否已经存在,存在的不能继续添加
|
|
|
|
|
if (!bm.checkSchemeName(scheme_id, scheme_name, stage_id)) {
|
|
|
|
|
if (bm.checkSchemeName(scheme_id, scheme_name, stage_id)) {
|
|
|
|
|
renderJson(RetKit.renderFail("该版本名称已存在"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|