|
@@ -6,6 +6,7 @@ import com.ssj.bean.sys.sort.domain.Sort;
|
|
|
import com.ssj.bean.weixin.libmy.domain.TbLibJoin;
|
|
|
import com.ssj.bean.weixin.zyb.domain.*;
|
|
|
import com.ssj.framework.basic.common.bean.SplitPage;
|
|
|
+import com.ssj.framework.basic.config.bean.VersionConfig;
|
|
|
import com.ssj.framework.core.common.controller.BaseController;
|
|
|
import com.ssj.framework.core.util.StringUtil;
|
|
|
import com.ssj.framework.core.util.SystemResourceLocator;
|
|
@@ -13,6 +14,7 @@ import com.ssj.service.sys.sort.service.SortService;
|
|
|
import com.ssj.service.weixin.library.service.ILibJoinService;
|
|
|
import com.ssj.service.weixin.zuoyb.service.*;
|
|
|
import org.apache.commons.beanutils.BeanUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
|
|
import org.apache.poi.hssf.util.HSSFColor;
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
@@ -778,6 +780,7 @@ public class SysZuoybController extends BaseController {
|
|
|
params.put("beginDate", request.getParameter("beginDate")==null? "":request.getParameter("beginDate"));
|
|
|
params.put("endDate", request.getParameter("endDate")==null? "":request.getParameter("endDate"));
|
|
|
params.put("LIKE_id", request.getParameter("LIKE_id")==null?"":request.getParameter("LIKE_id"));
|
|
|
+ params.put("isZt", request.getParameter("isZt")==null?"":request.getParameter("isZt"));
|
|
|
|
|
|
|
|
|
|
|
@@ -894,34 +897,70 @@ public class SysZuoybController extends BaseController {
|
|
|
public Response knowHowSave(ZuoybKnowHow how) {
|
|
|
Response response = new Response();
|
|
|
how.setCreateTime(new Date());
|
|
|
+ boolean iaAdd = StringUtils.isBlank(how.getId())?true:false;
|
|
|
how = zuoybKnowHowService.save(how);
|
|
|
- String[] version = how.getVersion();
|
|
|
- if (version != null && version.length > 0) {
|
|
|
- String grade = "";
|
|
|
- List<Sort> list = sortService.getParamValByCode("grade");
|
|
|
- Integer gradeNum = how.getGradeNum();
|
|
|
- for (Sort sort : list) {
|
|
|
- if (sort.getAliases().equals(gradeNum.toString())) {
|
|
|
- grade = sort.getName();
|
|
|
- break;
|
|
|
- }
|
|
|
+ if(how.getCourseName().equals("英语") && how.getIsZt().intValue() == 1){
|
|
|
+ //1、新增专题单元
|
|
|
+ if(iaAdd){
|
|
|
+ //获取英语版本
|
|
|
+ List<VersionConfig> versionList = SystemResourceLocator.getVersionList("英语").get("英语");
|
|
|
+ ZuoybKnowHow finalHow = how;
|
|
|
+ versionList.forEach(o->{
|
|
|
+ //获取年级
|
|
|
+ List<Sort> list = sortService.getParamValByCode("grade");
|
|
|
+ for (Sort sort : list) {
|
|
|
+ ZuoybKnowHowDetailsSort howsort = new ZuoybKnowHowDetailsSort();
|
|
|
+ howsort.setCreateTime(new Date());
|
|
|
+ howsort.setType(o.getVersionType());
|
|
|
+ howsort.setHowId(finalHow.getId());
|
|
|
+ howsort.setCourseName(finalHow.getCourseName());
|
|
|
+ howsort.setNum(finalHow.getNum());
|
|
|
+ howsort.setAlias(finalHow.getName());
|
|
|
+ howsort.setLibId(finalHow.getLibId());
|
|
|
+ howsort.setStat(1);
|
|
|
+ howsort.setGrade(sort.getName());
|
|
|
+ howsort.setGradeNum(Integer.parseInt(sort.getAliases()));
|
|
|
+ for(int i=1;i<3;i++){
|
|
|
+ howsort.setSemester(i);
|
|
|
+ zuoybKnowHowDetailsSortService.save(howsort);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ //修改sort表的alias
|
|
|
+ zuoybKnowHowDetailsSortService.updateAliasByStatAndName(how.getId(),1,how.getName());
|
|
|
}
|
|
|
- for (String string : version) {
|
|
|
- ZuoybKnowHowDetailsSort howsort = new ZuoybKnowHowDetailsSort();
|
|
|
- howsort.setCreateTime(new Date());
|
|
|
- howsort.setType(Integer.parseInt(string));
|
|
|
- howsort.setHowId(how.getId());
|
|
|
- howsort.setCourseName(how.getCourseName());
|
|
|
- howsort.setNum(how.getNum());
|
|
|
- howsort.setAlias(how.getName());
|
|
|
- howsort.setLibId(how.getLibId());
|
|
|
- howsort.setStat(1);
|
|
|
- howsort.setGrade(grade);
|
|
|
- howsort.setGradeNum(how.getGradeNum());
|
|
|
- howsort.setSemester(how.getSemester());
|
|
|
- zuoybKnowHowDetailsSortService.save(howsort);
|
|
|
+
|
|
|
+ }else{
|
|
|
+ String[] version = how.getVersion();
|
|
|
+ if (version != null && version.length > 0) {
|
|
|
+ String grade = "";
|
|
|
+ List<Sort> list = sortService.getParamValByCode("grade");
|
|
|
+ Integer gradeNum = how.getGradeNum();
|
|
|
+ for (Sort sort : list) {
|
|
|
+ if (sort.getAliases().equals(gradeNum.toString())) {
|
|
|
+ grade = sort.getName();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (String string : version) {
|
|
|
+ ZuoybKnowHowDetailsSort howsort = new ZuoybKnowHowDetailsSort();
|
|
|
+ howsort.setCreateTime(new Date());
|
|
|
+ howsort.setType(Integer.parseInt(string));
|
|
|
+ howsort.setHowId(how.getId());
|
|
|
+ howsort.setCourseName(how.getCourseName());
|
|
|
+ howsort.setNum(how.getNum());
|
|
|
+ howsort.setAlias(how.getName());
|
|
|
+ howsort.setLibId(how.getLibId());
|
|
|
+ howsort.setStat(1);
|
|
|
+ howsort.setGrade(grade);
|
|
|
+ howsort.setGradeNum(how.getGradeNum());
|
|
|
+ howsort.setSemester(how.getSemester());
|
|
|
+ zuoybKnowHowDetailsSortService.save(howsort);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
response.success("添加成功");
|
|
|
return response;
|
|
|
}
|
|
@@ -1269,7 +1308,7 @@ public class SysZuoybController extends BaseController {
|
|
|
}
|
|
|
/**
|
|
|
* 作业知识点基础数据保存
|
|
|
- * @param content
|
|
|
+ * @param
|
|
|
* @return
|
|
|
* 创建人:ZhangCaibao
|
|
|
* 2017年7月5日 上午10:40:51
|
|
@@ -1280,48 +1319,96 @@ public class SysZuoybController extends BaseController {
|
|
|
public Response knowHowDetailSave(ZuoybKnowHowDetails how) {
|
|
|
Response response = new Response();
|
|
|
how.setCreateTime(new Date());
|
|
|
+ boolean iaAdd = StringUtils.isBlank(how.getId())?true:false;
|
|
|
how = zuoybKnowHowDetailsService.save(how);
|
|
|
+ ZuoybKnowHow zuoybKnowHow = zuoybKnowHowService.getById(how.getHowId());
|
|
|
+ if(zuoybKnowHow.getCourseName().equals("英语") && zuoybKnowHow.getIsZt().intValue() == 1){
|
|
|
+ //1、新增专题单元
|
|
|
+ if(iaAdd){
|
|
|
+ //获取英语版本
|
|
|
+ List<VersionConfig> versionList = SystemResourceLocator.getVersionList("英语").get("英语");
|
|
|
+ ZuoybKnowHowDetails finalHow = how;
|
|
|
+ versionList.forEach(o->{
|
|
|
+ //获取年级
|
|
|
+ List<Sort> list = sortService.getParamValByCode("grade");
|
|
|
+ for (Sort sort : list) {
|
|
|
+ ZuoybKnowHowDetailsSort howsort = new ZuoybKnowHowDetailsSort();
|
|
|
+ howsort.setCreateTime(new Date());
|
|
|
+ howsort.setHowDetailsId(finalHow.getId());
|
|
|
+ howsort.setType(o.getVersionType());
|
|
|
+ howsort.setHowId(finalHow.getHowId());
|
|
|
+ howsort.setCourseName(zuoybKnowHow.getCourseName());
|
|
|
+ howsort.setNum(finalHow.getNum());
|
|
|
+ howsort.setAlias(finalHow.getName());
|
|
|
+ howsort.setLibId(finalHow.getLibId());
|
|
|
+ howsort.setStat(2);
|
|
|
+ howsort.setGrade(sort.getName());
|
|
|
+ howsort.setGradeNum(Integer.parseInt(sort.getAliases()));
|
|
|
+
|
|
|
+
|
|
|
+ howsort.setMemorize(finalHow.getMemorize());
|
|
|
+ howsort.setUnderstanding(finalHow.getUnderstanding());
|
|
|
+ howsort.setApply(finalHow.getApply());
|
|
|
+ howsort.setModule(finalHow.getModule());
|
|
|
+ howsort.setTwoModule(finalHow.getTwoModule());
|
|
|
+ howsort.setJxmb(finalHow.getJxmb());
|
|
|
+ howsort.setZdbx(finalHow.getZdbx());
|
|
|
+ howsort.setYdsl(finalHow.getYdsl());
|
|
|
+ for(int i=1;i<3;i++){
|
|
|
+ howsort.setSemester(i);
|
|
|
+ zuoybKnowHowDetailsSortService.save(howsort);
|
|
|
+ }
|
|
|
+ zuoybKnowHowDetailsSortService.save(howsort);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ //修改sort表的alias
|
|
|
+ zuoybKnowHowDetailsSortService.updateAliasByStatAndNameAndDetailId(how.getId(),2,how.getName());
|
|
|
+ }
|
|
|
|
|
|
- String[] version = how.getVersion();
|
|
|
- if (version != null && version.length > 0) {
|
|
|
- String grade = "";
|
|
|
- List<Sort> list = sortService.getParamValByCode("grade");
|
|
|
- Integer gradeNum = how.getGradeNum();
|
|
|
- for (Sort sort : list) {
|
|
|
- if (sort.getAliases().equals(gradeNum.toString())) {
|
|
|
- grade = sort.getName();
|
|
|
- break;
|
|
|
+ }else{
|
|
|
+ String[] version = how.getVersion();
|
|
|
+ if (version != null && version.length > 0) {
|
|
|
+ String grade = "";
|
|
|
+ List<Sort> list = sortService.getParamValByCode("grade");
|
|
|
+ Integer gradeNum = how.getGradeNum();
|
|
|
+ for (Sort sort : list) {
|
|
|
+ if (sort.getAliases().equals(gradeNum.toString())) {
|
|
|
+ grade = sort.getName();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+// ZuoybKnowHow zuoybKnowHow = zuoybKnowHowService.getById(how.getHowId());
|
|
|
+ for (String string : version) {
|
|
|
+ ZuoybKnowHowDetailsSort howsort = new ZuoybKnowHowDetailsSort();
|
|
|
+ howsort.setCreateTime(new Date());
|
|
|
+ howsort.setHowDetailsId(how.getId());
|
|
|
+ howsort.setType(Integer.parseInt(string));
|
|
|
+ howsort.setHowId(how.getHowId());
|
|
|
+ howsort.setCourseName(zuoybKnowHow.getCourseName());
|
|
|
+ howsort.setNum(how.getNum());
|
|
|
+ howsort.setAlias(how.getName());
|
|
|
+ howsort.setLibId(how.getLibId());
|
|
|
+ howsort.setStat(2);
|
|
|
+ howsort.setGrade(grade);
|
|
|
+ howsort.setGradeNum(how.getGradeNum());
|
|
|
+ howsort.setSemester(how.getSemester());
|
|
|
+
|
|
|
+ howsort.setMemorize(how.getMemorize());
|
|
|
+ howsort.setUnderstanding(how.getUnderstanding());
|
|
|
+ howsort.setApply(how.getApply());
|
|
|
+ howsort.setModule(how.getModule());
|
|
|
+ howsort.setTwoModule(how.getTwoModule());
|
|
|
+ howsort.setJxmb(how.getJxmb());
|
|
|
+ howsort.setZdbx(how.getZdbx());
|
|
|
+ howsort.setYdsl(how.getYdsl());
|
|
|
+
|
|
|
+ howsort=zuoybKnowHowDetailsSortService.save(howsort);
|
|
|
}
|
|
|
- }
|
|
|
- ZuoybKnowHow zuoybKnowHow = zuoybKnowHowService.getById(how.getHowId());
|
|
|
- for (String string : version) {
|
|
|
- ZuoybKnowHowDetailsSort howsort = new ZuoybKnowHowDetailsSort();
|
|
|
- howsort.setCreateTime(new Date());
|
|
|
- howsort.setHowDetailsId(how.getId());
|
|
|
- howsort.setType(Integer.parseInt(string));
|
|
|
- howsort.setHowId(how.getHowId());
|
|
|
- howsort.setCourseName(zuoybKnowHow.getCourseName());
|
|
|
- howsort.setNum(how.getNum());
|
|
|
- howsort.setAlias(how.getName());
|
|
|
- howsort.setLibId(how.getLibId());
|
|
|
- howsort.setStat(2);
|
|
|
- howsort.setGrade(grade);
|
|
|
- howsort.setGradeNum(how.getGradeNum());
|
|
|
- howsort.setSemester(how.getSemester());
|
|
|
-
|
|
|
- howsort.setMemorize(how.getMemorize());
|
|
|
- howsort.setUnderstanding(how.getUnderstanding());
|
|
|
- howsort.setApply(how.getApply());
|
|
|
- howsort.setModule(how.getModule());
|
|
|
- howsort.setTwoModule(how.getTwoModule());
|
|
|
- howsort.setJxmb(how.getJxmb());
|
|
|
- howsort.setZdbx(how.getZdbx());
|
|
|
- howsort.setYdsl(how.getYdsl());
|
|
|
-
|
|
|
- howsort=zuoybKnowHowDetailsSortService.save(howsort);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
response.success("添加成功");
|
|
|
return response;
|
|
|
}
|
|
@@ -1390,40 +1477,75 @@ public class SysZuoybController extends BaseController {
|
|
|
public Response knowHowDetailKdSave( ZuoybKnowHowDetailsKd how) {
|
|
|
Response response = new Response();
|
|
|
how.setCreateTime(new Date());
|
|
|
+ boolean iaAdd = StringUtils.isBlank(how.getId())?true:false;
|
|
|
how = zuoybKnowHowDetailsKdService.save(how);
|
|
|
+ ZuoybKnowHow zuoybKnowHow = zuoybKnowHowService.getById(how.getHowId());
|
|
|
+ if(zuoybKnowHow.getCourseName().equals("英语") && zuoybKnowHow.getIsZt().intValue() == 1){
|
|
|
+ //1、新增专题单元
|
|
|
+ if(iaAdd){
|
|
|
+ //获取英语版本
|
|
|
+ List<VersionConfig> versionList = SystemResourceLocator.getVersionList("英语").get("英语");
|
|
|
+ ZuoybKnowHowDetailsKd finalHow = how;
|
|
|
+ versionList.forEach(o->{
|
|
|
+ //获取年级
|
|
|
+ List<Sort> list = sortService.getParamValByCode("grade");
|
|
|
+ for (Sort sort : list) {
|
|
|
+ ZuoybKnowHowDetailsSort howsort = new ZuoybKnowHowDetailsSort();
|
|
|
+ howsort.setCreateTime(new Date());
|
|
|
+ howsort.setHowDetailsId(finalHow.getHowDetailsId());
|
|
|
+ howsort.setHowDetailsKdId(finalHow.getId());
|
|
|
+ howsort.setType(o.getVersionType());
|
|
|
+ howsort.setHowId(finalHow.getHowId());
|
|
|
+ howsort.setCourseName(zuoybKnowHow.getCourseName());
|
|
|
+ howsort.setNum(finalHow.getNum());
|
|
|
+ howsort.setAlias(finalHow.getName());
|
|
|
+ howsort.setLibId(zuoybKnowHow.getLibId());
|
|
|
+ howsort.setStat(3);
|
|
|
+ howsort.setGrade(sort.getName());
|
|
|
+ howsort.setGradeNum(Integer.parseInt(sort.getAliases()));
|
|
|
+ for(int i=1;i<3;i++){
|
|
|
+ howsort.setSemester(i);
|
|
|
+ zuoybKnowHowDetailsSortService.save(howsort);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ //修改sort表的alias
|
|
|
+ zuoybKnowHowDetailsSortService.updateAliasByStatAndNameAndKdId(how.getId(),3,how.getName());
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- String [] version = how.getVersion();
|
|
|
- if(version!=null && version.length>0){
|
|
|
- String grade = "";
|
|
|
- List<Sort> list=sortService.getParamValByCode("grade");
|
|
|
- Integer gradeNum = how.getGradeNum();
|
|
|
- for (Sort sort : list) {
|
|
|
- if(sort.getAliases().equals(gradeNum.toString())){
|
|
|
- grade =sort.getName();
|
|
|
- break;
|
|
|
+ }else{
|
|
|
+ String [] version = how.getVersion();
|
|
|
+ if(version!=null && version.length>0){
|
|
|
+ String grade = "";
|
|
|
+ List<Sort> list=sortService.getParamValByCode("grade");
|
|
|
+ Integer gradeNum = how.getGradeNum();
|
|
|
+ for (Sort sort : list) {
|
|
|
+ if(sort.getAliases().equals(gradeNum.toString())){
|
|
|
+ grade =sort.getName();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+// ZuoybKnowHow zuoybKnowHow= zuoybKnowHowService.getById(how.getHowId());
|
|
|
+ for (String string : version) {
|
|
|
+ ZuoybKnowHowDetailsSort howsort = new ZuoybKnowHowDetailsSort();
|
|
|
+ howsort.setCreateTime(new Date());
|
|
|
+ howsort.setHowDetailsId(how.getHowDetailsId());
|
|
|
+ howsort.setHowDetailsKdId(how.getId());
|
|
|
+ howsort.setType(Integer.parseInt(string));
|
|
|
+ howsort.setHowId(how.getHowId());
|
|
|
+ howsort.setCourseName(zuoybKnowHow.getCourseName());
|
|
|
+ howsort.setNum(how.getNum());
|
|
|
+ howsort.setAlias(how.getName());
|
|
|
+ howsort.setLibId(zuoybKnowHow.getLibId());
|
|
|
+ howsort.setStat(3);
|
|
|
+ howsort.setGrade(grade);
|
|
|
+ howsort.setGradeNum(how.getGradeNum());
|
|
|
+ howsort.setSemester(how.getSemester());
|
|
|
+ howsort=zuoybKnowHowDetailsSortService.save(howsort);
|
|
|
}
|
|
|
- }
|
|
|
- ZuoybKnowHow zuoybKnowHow= zuoybKnowHowService.getById(how.getHowId());
|
|
|
- for (String string : version) {
|
|
|
- ZuoybKnowHowDetailsSort howsort = new ZuoybKnowHowDetailsSort();
|
|
|
- howsort.setCreateTime(new Date());
|
|
|
- howsort.setHowDetailsId(how.getHowDetailsId());
|
|
|
- howsort.setHowDetailsKdId(how.getId());
|
|
|
- howsort.setType(Integer.parseInt(string));
|
|
|
- howsort.setHowId(how.getHowId());
|
|
|
- howsort.setCourseName(zuoybKnowHow.getCourseName());
|
|
|
- howsort.setNum(how.getNum());
|
|
|
- howsort.setAlias(how.getName());
|
|
|
- howsort.setLibId(zuoybKnowHow.getLibId());
|
|
|
- howsort.setStat(3);
|
|
|
- howsort.setGrade(grade);
|
|
|
- howsort.setGradeNum(how.getGradeNum());
|
|
|
- howsort.setSemester(how.getSemester());
|
|
|
- howsort=zuoybKnowHowDetailsSortService.save(howsort);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
response.success("添加成功");
|
|
|
return response;
|
|
|
}
|