Commit 505078a0 by xuwenhao

修改测试bug

parent 2197d2cd
...@@ -211,4 +211,11 @@ public interface SysUserMapper { ...@@ -211,4 +211,11 @@ public interface SysUserMapper {
int updateUserNameByUserId(@Param("userName") String userName, int updateUserNameByUserId(@Param("userName") String userName,
@Param("userId") Long userId); @Param("userId") Long userId);
/**
* 更新用户表
* @param updateUserList
*/
void updateUserList(@Param("list") List<SysUser> updateUserList);
// 新增用户表
void addUserList(@Param("list") List<SysUser> addUserList);
} }
...@@ -342,4 +342,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -342,4 +342,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
</select> </select>
<update id="updateUserList" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
<foreach collection="list" item="data" separator=";">
update sys_user
<trim prefix="SET" suffixOverrides=",">
<if test="data.userName != null and data.userName != ''">
user_name = #{data.userName},
</if>
</trim>
where user_id = #{data.userId}
</foreach>
</update>
<insert id="addUserList" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
<foreach collection="list" item="data" separator=";">
insert into sys_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="data.userLoginType != null and data.userLoginType != ''">
user_login_type,
</if>
<if test="data.userName != null and data.userName != ''">
user_name,
</if>
<if test="data.phonenumber != null and data.phonenumber != ''">
phonenumber,
</if>
<if test="data.studentId != null">
student_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="data.userLoginType != null and data.userLoginType != ''">
#{data.userLoginType},
</if>
<if test="data.userName != null and data.userName != ''">
#{data.userName},
</if>
<if test="data.phonenumber != null and data.phonenumber != ''">
#{data.phonenumber},
</if>
<if test="data.studentId != null">
#{data.studentId},
</if>
</trim>
</foreach>
</insert>
</mapper> </mapper>
...@@ -23,6 +23,7 @@ import yangtz.cs.liu.campus.service.impl.student.SchoolStudentServiceImpl; ...@@ -23,6 +23,7 @@ import yangtz.cs.liu.campus.service.impl.student.SchoolStudentServiceImpl;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Scanner; import java.util.Scanner;
...@@ -52,7 +53,8 @@ public class SchoolStudentIntegralController extends BaseController ...@@ -52,7 +53,8 @@ public class SchoolStudentIntegralController extends BaseController
//获取所在学期 //获取所在学期
int term = isNewTerm(); int term = isNewTerm();
schoolStudentIntegral.setStudentId(studentId); schoolStudentIntegral.setStudentId(studentId);
schoolStudentIntegral.setTerm(term); schoolStudentIntegral.setSchoolYear(null);
// schoolStudentIntegral.setTerm(term);
startPage(); startPage();
List<SchoolStudentIntegral> list = schoolStudentIntegralService.selectSchoolStudentIntegralList(schoolStudentIntegral); List<SchoolStudentIntegral> list = schoolStudentIntegralService.selectSchoolStudentIntegralList(schoolStudentIntegral);
return getDataTable(list); return getDataTable(list);
...@@ -71,6 +73,20 @@ public class SchoolStudentIntegralController extends BaseController ...@@ -71,6 +73,20 @@ public class SchoolStudentIntegralController extends BaseController
return term; return term;
} }
private Integer isNewTermY(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
//获取当前年月
int month = cal.get(Calendar.MONTH) + 1;
//设置当前学期为上学期
int term = 0;
//2-7为下学期,8-1为上学期
if (month >= 2 && month < 8) {
term = 1;
}
return term;
}
/** /**
* 查询改名学生总积分???? * 查询改名学生总积分????
* @param schoolStudentIntegral * @param schoolStudentIntegral
...@@ -98,7 +114,7 @@ public class SchoolStudentIntegralController extends BaseController ...@@ -98,7 +114,7 @@ public class SchoolStudentIntegralController extends BaseController
public void export(HttpServletResponse response, @PathVariable Long studentId,SchoolStudentIntegral schoolStudentIntegral) public void export(HttpServletResponse response, @PathVariable Long studentId,SchoolStudentIntegral schoolStudentIntegral)
{ {
schoolStudentIntegral.setStudentId(studentId); schoolStudentIntegral.setStudentId(studentId);
schoolStudentIntegral.setTerm(isNewTerm()); // schoolStudentIntegral.setTerm(isNewTerm());
List<SchoolStudentIntegral> list = schoolStudentIntegralService.selectSchoolStudentIntegralList(schoolStudentIntegral); List<SchoolStudentIntegral> list = schoolStudentIntegralService.selectSchoolStudentIntegralList(schoolStudentIntegral);
ExcelUtil<SchoolStudentIntegral> util = new ExcelUtil<SchoolStudentIntegral>(SchoolStudentIntegral.class); ExcelUtil<SchoolStudentIntegral> util = new ExcelUtil<SchoolStudentIntegral>(SchoolStudentIntegral.class);
util.exportExcel(response, list, "学生积分数据"); util.exportExcel(response, list, "学生积分数据");
...@@ -127,7 +143,8 @@ public class SchoolStudentIntegralController extends BaseController ...@@ -127,7 +143,8 @@ public class SchoolStudentIntegralController extends BaseController
} }
//根据日期判断所添加的这个积分应属于哪学年哪学期 //根据日期判断所添加的这个积分应属于哪学年哪学期
int schoolYear = DateUtils.getSchoolYear(schoolStudentIntegral.getDay()); int schoolYear = DateUtils.getSchoolYear(schoolStudentIntegral.getDay());
int term = isNewTerm();
int term = isNewTermY(schoolStudentIntegral.getDay());
schoolStudentIntegral.setSchoolYear(schoolYear); schoolStudentIntegral.setSchoolYear(schoolYear);
schoolStudentIntegral.setTerm(term); schoolStudentIntegral.setTerm(term);
//schoolStudentIntegral.setCreateTime(DateTime.now()); //schoolStudentIntegral.setCreateTime(DateTime.now());
......
...@@ -86,17 +86,17 @@ public class StatisticsController extends BaseController { ...@@ -86,17 +86,17 @@ public class StatisticsController extends BaseController {
/** /**
* 教务-统计-年龄统计 * 教务-统计-年龄统计
*/ */
@GetMapping("/age") @GetMapping("/age/{schoolYear}")
public TableDataInfo age() public TableDataInfo age(@PathVariable("schoolYear") int schoolYear)
{ {
return getDataTable(statisticsService.getAgeNum()); return getDataTable(statisticsService.getAgeNum(schoolYear));
} }
/**年龄导出*/ /**年龄导出*/
@PostMapping("/exportAge") @PostMapping("/exportAge/{schoolYear}")
public void exportAge(HttpServletResponse response) public void exportAge(@PathVariable("schoolYear") int schoolYear,HttpServletResponse response)
{ {
List<StatisticsAgeVo> list = statisticsService.getAgeNum(); List<StatisticsAgeVo> list = statisticsService.getAgeNum(schoolYear);
try { try {
TemplateExportParams params = new TemplateExportParams(TemplateExcelUtils.convertTemplatePath("template/countAge.xlsx")); TemplateExportParams params = new TemplateExportParams(TemplateExcelUtils.convertTemplatePath("template/countAge.xlsx"));
Map<String, Object> finalMap = new HashMap<String, Object>(); Map<String, Object> finalMap = new HashMap<String, Object>();
......
...@@ -140,7 +140,9 @@ public class SchoolMessageParentsPushsController extends BaseController ...@@ -140,7 +140,9 @@ public class SchoolMessageParentsPushsController extends BaseController
boolean flag = parentsPushsService.save(parentsPushs); boolean flag = parentsPushsService.save(parentsPushs);
if(flag){ if(flag){
//获取当前学年 //获取当前学年
int schoolYear = HolidayDateUtil.getSchoolYear(); // int schoolYear = HolidayDateUtil.getSchoolYear();
// TODO 修改最新学年
int schoolYear = gradeService.isNewSchoolYear();
//获取当前级部(存在当前登录人在多个级部工作) //获取当前级部(存在当前登录人在多个级部工作)
//List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(),schoolYear); //List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(),schoolYear);
List<SchoolGrade> gradeIds = gradeMentorService.selectGradeList(getUserId()); List<SchoolGrade> gradeIds = gradeMentorService.selectGradeList(getUserId());
......
...@@ -63,7 +63,7 @@ public class MinisterialController extends BaseController { ...@@ -63,7 +63,7 @@ public class MinisterialController extends BaseController {
@GetMapping("/getClassTreeForGrade") @GetMapping("/getClassTreeForGrade")
public AjaxResult getClassTreeList(SchoolClass schoolClass) { public AjaxResult getClassTreeList(SchoolClass schoolClass) {
//获取当前学年 //获取当前学年
int schoolYear = HolidayDateUtil.getSchoolYear(); // int schoolYear = HolidayDateUtil.getSchoolYear();
//List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(),schoolYear); //List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(),schoolYear);
List<SchoolGrade> gradeIds = gradeMentorService.selectGradeList(getUserId()); List<SchoolGrade> gradeIds = gradeMentorService.selectGradeList(getUserId());
if(StringUtils.isNull(gradeIds) || gradeIds.size() == 0){ if(StringUtils.isNull(gradeIds) || gradeIds.size() == 0){
...@@ -100,7 +100,7 @@ public class MinisterialController extends BaseController { ...@@ -100,7 +100,7 @@ public class MinisterialController extends BaseController {
@GetMapping("/getClassForGrade") @GetMapping("/getClassForGrade")
public TableDataInfo getClassForGrade(SchoolClass schoolClass) { public TableDataInfo getClassForGrade(SchoolClass schoolClass) {
//获取当前学年 //获取当前学年
int schoolYear = HolidayDateUtil.getSchoolYear(); // int schoolYear = HolidayDateUtil.getSchoolYear();
//List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(),schoolYear); //List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(),schoolYear);
List<SchoolGrade> gradeIds = gradeMentorService.selectGradeList(getUserId()); List<SchoolGrade> gradeIds = gradeMentorService.selectGradeList(getUserId());
if(StringUtils.isNull(gradeIds) || gradeIds.size() == 0){ if(StringUtils.isNull(gradeIds) || gradeIds.size() == 0){
...@@ -134,7 +134,7 @@ public class MinisterialController extends BaseController { ...@@ -134,7 +134,7 @@ public class MinisterialController extends BaseController {
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo studentList(SchoolStudentVO schoolStudent) { public TableDataInfo studentList(SchoolStudentVO schoolStudent) {
//获取当前学年 //获取当前学年
int schoolYear = HolidayDateUtil.getSchoolYear(); // int schoolYear = HolidayDateUtil.getSchoolYear();
//List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(),schoolYear); //List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(),schoolYear);
List<SchoolGrade> gradeIds = gradeMentorService.selectGradeList(getUserId()); List<SchoolGrade> gradeIds = gradeMentorService.selectGradeList(getUserId());
if(StringUtils.isNull(gradeIds) || gradeIds.size() == 0){ if(StringUtils.isNull(gradeIds) || gradeIds.size() == 0){
...@@ -207,7 +207,9 @@ public class MinisterialController extends BaseController { ...@@ -207,7 +207,9 @@ public class MinisterialController extends BaseController {
@GetMapping("/parentList") @GetMapping("/parentList")
public TableDataInfo allParentList(SchoolStudentParentVO schoolStudentParentVO) { public TableDataInfo allParentList(SchoolStudentParentVO schoolStudentParentVO) {
//获取当前学年 //获取当前学年
int schoolYear = HolidayDateUtil.getSchoolYear(); // int schoolYear = HolidayDateUtil.getSchoolYear();
// TODO 修改最新学年
int schoolYear = gradeService.isNewSchoolYear();
//List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(),schoolYear); //List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(),schoolYear);
List<SchoolGrade> gradeIds = gradeMentorService.selectGradeList(getUserId()); List<SchoolGrade> gradeIds = gradeMentorService.selectGradeList(getUserId());
if(StringUtils.isNull(gradeIds) || gradeIds.size() == 0){ if(StringUtils.isNull(gradeIds) || gradeIds.size() == 0){
......
...@@ -309,7 +309,23 @@ public class SchoolPurchaseController extends BaseController { ...@@ -309,7 +309,23 @@ public class SchoolPurchaseController extends BaseController {
*/ */
@GetMapping("/selectRegisterById/{id}") @GetMapping("/selectRegisterById/{id}")
public AjaxResult selectRegisterById(@PathVariable("id") Long id) { public AjaxResult selectRegisterById(@PathVariable("id") Long id) {
return AjaxResult.success(schoolPurchaseService.getById(id)); // return AjaxResult.success(schoolPurchaseService.getById(id));
// TODO 修改采购信息详情
SchoolPurchase schoolPurchase = schoolPurchaseService.getById(id);
PurchaseVo purchaseVo = new PurchaseVo();
BeanUtils.copyProperties(schoolPurchase,purchaseVo);
LambdaQueryWrapper<SchoolPurchaseDetails> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolPurchaseDetails::getPurchaseId,id);
List<SchoolPurchaseDetails> list = schoolPurchaseDetailService.list(wrapper);
List<SchoolPurchaseDetailsVo> voList = new ArrayList<>();
list.forEach(schoolPurchaseDetails -> {
SchoolPurchaseDetailsVo schoolPurchaseDetailsVo = new SchoolPurchaseDetailsVo();
BeanUtils.copyProperties(schoolPurchaseDetails,schoolPurchaseDetailsVo);
voList.add(schoolPurchaseDetailsVo);
});
purchaseVo.setList(voList);
return AjaxResult.success(purchaseVo);
} }
/** /**
......
...@@ -7,7 +7,6 @@ import com.core.utils.HolidayDateUtil; ...@@ -7,7 +7,6 @@ import com.core.utils.HolidayDateUtil;
import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SchoolTeacher;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.exception.base.BaseException; import com.ruoyi.common.exception.base.BaseException;
...@@ -22,25 +21,20 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -22,25 +21,20 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import yangtz.cs.liu.campus.controller.patrol.SchoolPatrolController;
import yangtz.cs.liu.campus.domain.SchoolStudentIntegral.SchoolStudentIntegral; import yangtz.cs.liu.campus.domain.SchoolStudentIntegral.SchoolStudentIntegral;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClass; import yangtz.cs.liu.campus.domain.schoolClass.SchoolClass;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClassHeadmaster; import yangtz.cs.liu.campus.domain.schoolClass.SchoolClassHeadmaster;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClassMentor; import yangtz.cs.liu.campus.domain.schoolClass.SchoolClassMentor;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade; import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGradeMentor;
import yangtz.cs.liu.campus.domain.student.SchoolStudent;
import yangtz.cs.liu.campus.service.ISchoolStudentIntegra.ISchoolStudentIntegralService; import yangtz.cs.liu.campus.service.ISchoolStudentIntegra.ISchoolStudentIntegralService;
import yangtz.cs.liu.campus.service.schoolClass.ISchoolClassHeadmasterService; import yangtz.cs.liu.campus.service.schoolClass.ISchoolClassHeadmasterService;
import yangtz.cs.liu.campus.service.schoolClass.ISchoolClassMentorService; import yangtz.cs.liu.campus.service.schoolClass.ISchoolClassMentorService;
import yangtz.cs.liu.campus.service.schoolClass.ISchoolClassService; import yangtz.cs.liu.campus.service.schoolClass.ISchoolClassService;
import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeMentorService;
import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeService; import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeService;
import yangtz.cs.liu.campus.service.student.ISchoolStudentService; import yangtz.cs.liu.campus.service.student.ISchoolStudentService;
import yangtz.cs.liu.campus.service.teacher.ISchoolTeacherService;
import yangtz.cs.liu.campus.vo.schoolClass.ClassBatchVo; import yangtz.cs.liu.campus.vo.schoolClass.ClassBatchVo;
import yangtz.cs.liu.campus.vo.schoolClass.ClassTreeSelect; import yangtz.cs.liu.campus.vo.schoolClass.ClassTreeSelect;
import yangtz.cs.liu.campus.vo.schoolgrade.GradeTreeSelect; import yangtz.cs.liu.campus.vo.schoolClass.SchoolClassDrVo;
import yangtz.cs.liu.campus.vo.student.SchoolStudentVO; import yangtz.cs.liu.campus.vo.student.SchoolStudentVO;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -282,26 +276,26 @@ public class SchoolClassController extends BaseController { ...@@ -282,26 +276,26 @@ public class SchoolClassController extends BaseController {
/** /**
* 下载模板 * 下载模板
* * TODO 修改班级管理导入
* @return * @return
*/ */
@PostMapping("/importTemplate") @PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) { public void importTemplate(HttpServletResponse response) {
ExcelUtil<SchoolClass> util = new ExcelUtil<>(SchoolClass.class); ExcelUtil<SchoolClassDrVo> util = new ExcelUtil<>(SchoolClassDrVo.class);
util.importTemplateExcel(response, "班级表"); util.importTemplateExcel(response, "班级表");
} }
/** /**
* 导入 * 导入
* * TODO 修改班级管理导入
* @param file * @param file
* @return * @return
* @throws Exception * @throws Exception
*/ */
@PostMapping("/importData") @PostMapping("/importData")
public AjaxResult importData(MultipartFile file) throws Exception { public AjaxResult importData(MultipartFile file) throws Exception {
ExcelUtil<SchoolClass> util = new ExcelUtil<SchoolClass>(SchoolClass.class); ExcelUtil<SchoolClassDrVo> util = new ExcelUtil<SchoolClassDrVo>(SchoolClassDrVo.class);
List<SchoolClass> list = util.importExcel(file.getInputStream()); List<SchoolClassDrVo> list = util.importExcel(file.getInputStream());
//校验 //校验
schoolClassService.checkImport(list); schoolClassService.checkImport(list);
//导入 //导入
...@@ -309,6 +303,35 @@ public class SchoolClassController extends BaseController { ...@@ -309,6 +303,35 @@ public class SchoolClassController extends BaseController {
return AjaxResult.success(message); return AjaxResult.success(message);
} }
// /**
// * 下载模板
// *
// * @return
// */
// @PostMapping("/importTemplate")
// public void importTemplate(HttpServletResponse response) {
// ExcelUtil<SchoolClass> util = new ExcelUtil<>(SchoolClass.class);
// util.importTemplateExcel(response, "班级表");
// }
//
// /**
// * 导入
// *
// * @param file
// * @return
// * @throws Exception
// */
// @PostMapping("/importData")
// public AjaxResult importData(MultipartFile file) throws Exception {
// ExcelUtil<SchoolClass> util = new ExcelUtil<SchoolClass>(SchoolClass.class);
// List<SchoolClass> list = util.importExcel(file.getInputStream());
// //校验
// schoolClassService.checkImport(list);
// //导入
// String message = schoolClassService.importExamDetail(list);
// return AjaxResult.success(message);
// }
/** /**
......
...@@ -98,7 +98,7 @@ public class SchoolDcwjController extends BaseController { ...@@ -98,7 +98,7 @@ public class SchoolDcwjController extends BaseController {
public TableDataInfo list(SchoolDcwj schoolDcwj) { public TableDataInfo list(SchoolDcwj schoolDcwj) {
//获取当前登录人当前学年所在级部 //获取当前登录人当前学年所在级部
//获取当前学年 //获取当前学年
int schoolYear = HolidayDateUtil.getSchoolYear(); // int schoolYear = HolidayDateUtil.getSchoolYear();
//获取当前用户所在级部 //获取当前用户所在级部
/* List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(), schoolYear); /* List<SchoolGrade> gradeIds = gradeMentorService.selectGrades(getUserId(), schoolYear);
if (StringUtils.isNull(gradeIds) || gradeIds.size() == 0) { if (StringUtils.isNull(gradeIds) || gradeIds.size() == 0) {
...@@ -132,7 +132,9 @@ public class SchoolDcwjController extends BaseController { ...@@ -132,7 +132,9 @@ public class SchoolDcwjController extends BaseController {
public TableDataInfo headerList(SchoolDcwj schoolDcwj) { public TableDataInfo headerList(SchoolDcwj schoolDcwj) {
//获取当前登录人当前学年所任班主任的班级ids //获取当前登录人当前学年所任班主任的班级ids
//获取当前学年 //获取当前学年
int schoolYear = HolidayDateUtil.getSchoolYear(); // int schoolYear = HolidayDateUtil.getSchoolYear();
// TODO 修改最新学年
int schoolYear = gradeService.isNewSchoolYear();
LambdaQueryWrapper<SchoolClass> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SchoolClass> lqw = new LambdaQueryWrapper<>();
lqw lqw
.eq(SchoolClass::getSchoolYear, schoolYear) .eq(SchoolClass::getSchoolYear, schoolYear)
...@@ -422,7 +424,9 @@ public class SchoolDcwjController extends BaseController { ...@@ -422,7 +424,9 @@ public class SchoolDcwjController extends BaseController {
public List<Long> getStudentIds() { public List<Long> getStudentIds() {
//获取班主任所在班级的学生 //获取班主任所在班级的学生
//获取当前学年 //获取当前学年
int schoolYear = HolidayDateUtil.getSchoolYear(); // int schoolYear = HolidayDateUtil.getSchoolYear();
// TODO 修改最新学年
int schoolYear = gradeService.isNewSchoolYear();
LambdaQueryWrapper<SchoolClass> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SchoolClass> lqw = new LambdaQueryWrapper<>();
lqw lqw
.eq(SchoolClass::getSchoolYear, schoolYear) .eq(SchoolClass::getSchoolYear, schoolYear)
......
...@@ -541,8 +541,10 @@ public class SchoolDcwjNrController extends BaseController ...@@ -541,8 +541,10 @@ public class SchoolDcwjNrController extends BaseController
.set(SchoolDcwjNr::getNrN,null) .set(SchoolDcwjNr::getNrN,null)
.set(SchoolDcwjNr::getNrO,null); .set(SchoolDcwjNr::getNrO,null);
//判断是否有页面逻辑,如果没有,则要将表里的值(如果之前有)去掉 //判断是否有页面逻辑,如果没有,则要将表里的值(如果之前有)去掉
if(StringUtils.isNull(schoolDcwjNr.getNrId()) || "".equals(schoolDcwjNr.getNrId())) { if(StringUtils.isNull(schoolDcwjNr.getNrId())) {
luw.set(SchoolDcwjNr::getNrId,null).set(SchoolDcwjNr::getNrSelect,null); luw.set(SchoolDcwjNr::getNrId,null).set(SchoolDcwjNr::getNrSelect,null);
}else {
luw.set(SchoolDcwjNr::getNrId,schoolDcwjNr.getNrId()).set(SchoolDcwjNr::getNrSelect,schoolDcwjNr.getNrSelect());
} }
return toAjax(schoolDcwjNrService.update(luw)); return toAjax(schoolDcwjNrService.update(luw));
} }
...@@ -550,7 +552,7 @@ public class SchoolDcwjNrController extends BaseController ...@@ -550,7 +552,7 @@ public class SchoolDcwjNrController extends BaseController
} }
public void judgePx(SchoolDcwjNr schoolDcwjNr){ public void judgePx(SchoolDcwjNr schoolDcwjNr){
if(StringUtils.isNull(schoolDcwjNr.getDcwjId()) || "".equals(schoolDcwjNr.getDcwjId())){ if(StringUtils.isNull(schoolDcwjNr.getDcwjId())){
throw new ServiceException("主表id为空,请检查"); throw new ServiceException("主表id为空,请检查");
} }
LambdaQueryWrapper<SchoolDcwjNr> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SchoolDcwjNr> lqw = new LambdaQueryWrapper<>();
......
...@@ -26,8 +26,10 @@ import com.ruoyi.common.enums.BusinessType; ...@@ -26,8 +26,10 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import yangtz.cs.liu.campus.domain.purchase.SchoolPurchase;
import yangtz.cs.liu.campus.domain.schoolbudget.SchoolBudget; import yangtz.cs.liu.campus.domain.schoolbudget.SchoolBudget;
import yangtz.cs.liu.campus.domain.schoolbudget.SchoolBudgetDetails; import yangtz.cs.liu.campus.domain.schoolbudget.SchoolBudgetDetails;
import yangtz.cs.liu.campus.service.purchase.ISchoolPurchaseService;
import yangtz.cs.liu.campus.service.schoolbudget.ISchoolBudgetDetailsService; import yangtz.cs.liu.campus.service.schoolbudget.ISchoolBudgetDetailsService;
import yangtz.cs.liu.campus.service.schoolbudget.ISchoolBudgetService; import yangtz.cs.liu.campus.service.schoolbudget.ISchoolBudgetService;
import yangtz.cs.liu.campus.vo.schoolbudget.SchoolBudgetVo; import yangtz.cs.liu.campus.vo.schoolbudget.SchoolBudgetVo;
...@@ -48,6 +50,9 @@ public class SchoolBudgetController extends BaseController ...@@ -48,6 +50,9 @@ public class SchoolBudgetController extends BaseController
@Autowired @Autowired
private ISchoolBudgetDetailsService schoolBudgetDetailsService; private ISchoolBudgetDetailsService schoolBudgetDetailsService;
@Autowired
private ISchoolPurchaseService purchaseService;
/** /**
* 按科室过滤查询预算项目列表 * 按科室过滤查询预算项目列表
*/ */
...@@ -165,6 +170,14 @@ public class SchoolBudgetController extends BaseController ...@@ -165,6 +170,14 @@ public class SchoolBudgetController extends BaseController
@DeleteMapping("/delete/{ids}") @DeleteMapping("/delete/{ids}")
public AjaxResult remove(@PathVariable List<Integer> ids) public AjaxResult remove(@PathVariable List<Integer> ids)
{ {
// TODO 修改
//判断该预算项目是否已经采购过
LambdaQueryWrapper<SchoolPurchase> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SchoolPurchase::getBudgetId,ids);
List<SchoolPurchase> list = purchaseService.list(wrapper);
if (StringUtils.isNotNull(list) && list.size() > 0){
throw new ServiceException("该预算项目已采购,不可删除");
}
//删除子表 //删除子表
LambdaQueryWrapper<SchoolBudgetDetails> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SchoolBudgetDetails> lqw = new LambdaQueryWrapper<>();
lqw.in(SchoolBudgetDetails::getBudgetId,ids); lqw.in(SchoolBudgetDetails::getBudgetId,ids);
......
...@@ -82,7 +82,7 @@ public class SchoolStudentController extends BaseController { ...@@ -82,7 +82,7 @@ public class SchoolStudentController extends BaseController {
*/ */
@PostMapping("/add") @PostMapping("/add")
public AjaxResult add(@RequestBody @Validated SchoolStudent schoolStudent) { public AjaxResult add(@RequestBody @Validated SchoolStudent schoolStudent) {
checkStudentUnique(schoolStudent); checkStudentUniqueXz(schoolStudent);
boolean flag = schoolStudentService.save(schoolStudent); boolean flag = schoolStudentService.save(schoolStudent);
//添加关系到学生班级表 //添加关系到学生班级表
if(StringUtils.isNotNull(schoolStudent.getClassId())){ if(StringUtils.isNotNull(schoolStudent.getClassId())){
...@@ -114,50 +114,157 @@ public class SchoolStudentController extends BaseController { ...@@ -114,50 +114,157 @@ public class SchoolStudentController extends BaseController {
relationService.remove(lqw); relationService.remove(lqw);
addRelation(schoolStudent); addRelation(schoolStudent);
} }
} }
return toAjax(flag); return toAjax(flag);
} }
private void checkStudentUniqueXz(SchoolStudent schoolStudent) {
// TODO 修改
LambdaQueryWrapper<SchoolStudent> lqw = new LambdaQueryWrapper<>();
lqw
.eq(SchoolStudent::getIdCard, schoolStudent.getIdCard());
SchoolStudent student = schoolStudentService.getOne(lqw);
if (StringUtils.isNotNull(student)){
if (schoolStudent.getIdCard().equals(student.getIdCard())){
throw new ServiceException("身份证号已存在");
}
}
LambdaQueryWrapper<SchoolStudent> lqw1 = new LambdaQueryWrapper<>();
lqw1
.eq(SchoolStudent::getSchoolNo, schoolStudent.getSchoolNo());
SchoolStudent student1 = schoolStudentService.getOne(lqw1);
if (StringUtils.isNotNull(student1)){
if (schoolStudent.getSchoolNo().equals(student1.getSchoolNo())){
throw new ServiceException("注册序号已存在");
}
}
LambdaQueryWrapper<SchoolStudent> lqw2 = new LambdaQueryWrapper<>();
lqw2
.eq(SchoolStudent::getProvincialNumber, schoolStudent.getProvincialNumber());
SchoolStudent student2 = schoolStudentService.getOne(lqw2);
if (StringUtils.isNotNull(student2)){
if (schoolStudent.getProvincialNumber().equals(student2.getProvincialNumber())){
throw new ServiceException("省学籍辅号已存在");
}
}
LambdaQueryWrapper<SchoolStudent> lqw3 = new LambdaQueryWrapper<>();
lqw3
.eq(SchoolStudent::getNationalNumber, schoolStudent.getNationalNumber());
SchoolStudent student3 = schoolStudentService.getOne(lqw3);
if (StringUtils.isNotNull(student3)){
if (schoolStudent.getNationalNumber().equals(student3.getNationalNumber())){
throw new ServiceException("全国学籍号已存在");
}
}
LambdaQueryWrapper<SchoolStudent> lqw4 = new LambdaQueryWrapper<>();
lqw4
.eq(SchoolStudent::getOneCard, schoolStudent.getOneCard());
SchoolStudent student4 = schoolStudentService.getOne(lqw4);
if (StringUtils.isNotNull(student4)){
if (schoolStudent.getOneCard().equals(student4.getOneCard())){
throw new ServiceException("校园一卡通已存在");
}
}
}
private void checkStudentUnique(SchoolStudent schoolStudent) { private void checkStudentUnique(SchoolStudent schoolStudent) {
// TODO 原代码
// LambdaQueryWrapper<SchoolStudent> lqw = new LambdaQueryWrapper<>();
// lqw
// .eq(SchoolStudent::getIdCard, schoolStudent.getIdCard())
// .or()
// .eq(SchoolStudent::getSchoolNo, schoolStudent.getSchoolNo())
// .or()
// .eq(isNotBlank(schoolStudent.getProvincialNumber()),SchoolStudent::getProvincialNumber,schoolStudent.getProvincialNumber())
// .or()
// .eq(isNotBlank(schoolStudent.getNationalNumber()),SchoolStudent::getNationalNumber,schoolStudent.getNationalNumber())
// .or()
// .eq(isNotBlank(schoolStudent.getOneCard()), SchoolStudent::getOneCard, schoolStudent.getOneCard());
// SchoolStudent student = schoolStudentService.getOne(lqw);
// if (StringUtils.isNotNull(student)) {
// if (StringUtils.isNotNull(schoolStudent.getId()) && schoolStudent.getId().equals(student.getId())) {
// return;
// }
// if (schoolStudent.getIdCard().equals(student.getIdCard())) {
// throw new ServiceException("身份证号已存在");
// }
// if (schoolStudent.getSchoolNo().equals(student.getSchoolNo())) {
// throw new ServiceException("注册序号已存在");
// }
// if(StringUtils.isNotBlank(schoolStudent.getProvincialNumber())){
// if (schoolStudent.getProvincialNumber().equals(student.getProvincialNumber())) {
// throw new ServiceException("省学籍辅号已存在");
// }
// }
// if(StringUtils.isNotBlank(schoolStudent.getNationalNumber())){
// if (schoolStudent.getNationalNumber().equals(student.getNationalNumber())) {
// throw new ServiceException("全国学籍号已存在");
// }
// }
// if (StringUtils.isNotBlank(schoolStudent.getOneCard())) {
// if (schoolStudent.getOneCard().equals(student.getOneCard())) {
// throw new ServiceException("校园一卡通已存在");
// }
// }
// }
// TODO 修改
LambdaQueryWrapper<SchoolStudent> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SchoolStudent> lqw = new LambdaQueryWrapper<>();
lqw lqw
.eq(SchoolStudent::getIdCard, schoolStudent.getIdCard()) .eq(SchoolStudent::getIdCard, schoolStudent.getIdCard())
.or() .notIn(SchoolStudent::getId,schoolStudent.getId());
.eq(SchoolStudent::getSchoolNo, schoolStudent.getSchoolNo())
.or()
.eq(isNotBlank(schoolStudent.getProvincialNumber()),SchoolStudent::getProvincialNumber,schoolStudent.getProvincialNumber())
.or()
.eq(isNotBlank(schoolStudent.getNationalNumber()),SchoolStudent::getNationalNumber,schoolStudent.getNationalNumber())
.or()
.eq(isNotBlank(schoolStudent.getOneCard()), SchoolStudent::getOneCard, schoolStudent.getOneCard());
SchoolStudent student = schoolStudentService.getOne(lqw); SchoolStudent student = schoolStudentService.getOne(lqw);
if (StringUtils.isNotNull(student)) { if (StringUtils.isNotNull(student)){
if (StringUtils.isNotNull(schoolStudent.getId()) && schoolStudent.getId().equals(student.getId())) { if (schoolStudent.getIdCard().equals(student.getIdCard())){
return;
}
if (schoolStudent.getIdCard().equals(student.getIdCard())) {
throw new ServiceException("身份证号已存在"); throw new ServiceException("身份证号已存在");
} }
if (schoolStudent.getSchoolNo().equals(student.getSchoolNo())) { }
LambdaQueryWrapper<SchoolStudent> lqw1 = new LambdaQueryWrapper<>();
lqw1
.eq(SchoolStudent::getSchoolNo, schoolStudent.getSchoolNo())
.notIn(SchoolStudent::getId,schoolStudent.getId());
SchoolStudent student1 = schoolStudentService.getOne(lqw1);
if (StringUtils.isNotNull(student1)){
if (schoolStudent.getSchoolNo().equals(student1.getSchoolNo())){
throw new ServiceException("注册序号已存在"); throw new ServiceException("注册序号已存在");
} }
if(StringUtils.isNotBlank(schoolStudent.getProvincialNumber())){ }
if (schoolStudent.getProvincialNumber().equals(student.getProvincialNumber())) {
throw new ServiceException("省学籍辅号已存在"); LambdaQueryWrapper<SchoolStudent> lqw2 = new LambdaQueryWrapper<>();
} lqw2
.eq(SchoolStudent::getProvincialNumber, schoolStudent.getProvincialNumber())
.notIn(SchoolStudent::getId,schoolStudent.getId());
SchoolStudent student2 = schoolStudentService.getOne(lqw2);
if (StringUtils.isNotNull(student2)){
if (schoolStudent.getProvincialNumber().equals(student2.getProvincialNumber())){
throw new ServiceException("省学籍辅号已存在");
} }
if(StringUtils.isNotBlank(schoolStudent.getNationalNumber())){ }
if (schoolStudent.getNationalNumber().equals(student.getNationalNumber())) {
throw new ServiceException("全国学籍号已存在"); LambdaQueryWrapper<SchoolStudent> lqw3 = new LambdaQueryWrapper<>();
} lqw3
.eq(SchoolStudent::getNationalNumber, schoolStudent.getNationalNumber())
.notIn(SchoolStudent::getId,schoolStudent.getId());
SchoolStudent student3 = schoolStudentService.getOne(lqw3);
if (StringUtils.isNotNull(student3)){
if (schoolStudent.getNationalNumber().equals(student3.getNationalNumber())){
throw new ServiceException("全国学籍号已存在");
} }
if (StringUtils.isNotBlank(schoolStudent.getOneCard())) { }
if (schoolStudent.getOneCard().equals(student.getOneCard())) {
throw new ServiceException("校园一卡通已存在"); LambdaQueryWrapper<SchoolStudent> lqw4 = new LambdaQueryWrapper<>();
} lqw4
.eq(SchoolStudent::getOneCard, schoolStudent.getOneCard())
.notIn(SchoolStudent::getId,schoolStudent.getId());
SchoolStudent student4 = schoolStudentService.getOne(lqw4);
if (StringUtils.isNotNull(student4)){
if (schoolStudent.getOneCard().equals(student4.getOneCard())){
throw new ServiceException("校园一卡通已存在");
} }
} }
} }
......
...@@ -18,6 +18,7 @@ import org.activiti.engine.runtime.ProcessInstance; ...@@ -18,6 +18,7 @@ import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task; import org.activiti.engine.task.Task;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -153,7 +154,31 @@ public class SchoolStudentLeaveController extends BaseController { ...@@ -153,7 +154,31 @@ public class SchoolStudentLeaveController extends BaseController {
*/ */
@GetMapping("/queryOne/{id}") @GetMapping("/queryOne/{id}")
public AjaxResult queryOne(@PathVariable("id") Long id) { public AjaxResult queryOne(@PathVariable("id") Long id) {
return AjaxResult.success(schoolStudentLeaveService.getById(id)); SchoolStudentLeave studentLeave = schoolStudentLeaveService.getById(id);
StudentLeaveVO leaveVo = new StudentLeaveVO();
BeanUtils.copyProperties(studentLeave,leaveVo);
if (StringUtils.isNotBlank(studentLeave.getInstanceId())) {
List<Task> taskList = taskService.createTaskQuery()
.processInstanceId(studentLeave.getInstanceId())
.list(); // 例如请假会签,会同时拥有多个任务
if (!CollectionUtils.isEmpty(taskList)) {
TaskEntityImpl task = (TaskEntityImpl) taskList.get(0);
leaveVo.setTaskId(task.getId());
if (task.getSuspensionState() == 2) {
leaveVo.setTaskName("已挂起");
leaveVo.setSuspendState("2");
} else {
leaveVo.setTaskName(task.getName());
leaveVo.setSuspendState("1");
}
} else {
// 已办结或者已撤销
leaveVo.setTaskName("已结束");
}
} else {
leaveVo.setTaskName("未启动");
}
return AjaxResult.success(leaveVo);
} }
/** /**
......
...@@ -36,4 +36,10 @@ public interface StudentScoreMapper extends BaseMapper<SchoolStudentScore> { ...@@ -36,4 +36,10 @@ public interface StudentScoreMapper extends BaseMapper<SchoolStudentScore> {
* @return * @return
*/ */
int deleteStudentScore(Long[] ids); int deleteStudentScore(Long[] ids);
//批量修改学生考试成绩
void updateScoreList(@Param("list") List<SchoolStudentScore> updateScoreList);
//批量新增学生考试成绩
void insertScoreList(@Param("list") List<SchoolStudentScore> addScoreList);
} }
...@@ -2,6 +2,7 @@ package yangtz.cs.liu.campus.mapper.student; ...@@ -2,6 +2,7 @@ package yangtz.cs.liu.campus.mapper.student;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import yangtz.cs.liu.campus.domain.student.SchoolStudentClassRelation; import yangtz.cs.liu.campus.domain.student.SchoolStudentClassRelation;
import yangtz.cs.liu.campus.vo.schoolClass.StudentClassRelationVo; import yangtz.cs.liu.campus.vo.schoolClass.StudentClassRelationVo;
...@@ -11,4 +12,16 @@ import java.util.List; ...@@ -11,4 +12,16 @@ import java.util.List;
public interface SchoolStudentClassRelationMapper extends BaseMapper<SchoolStudentClassRelation> { public interface SchoolStudentClassRelationMapper extends BaseMapper<SchoolStudentClassRelation> {
//查询学生班级关系列表 //查询学生班级关系列表
List<StudentClassRelationVo> queryListByStudentId(Long studentId); List<StudentClassRelationVo> queryListByStudentId(Long studentId);
/**
* 修改学生与班级关系
* @param updateRelationList
*/
void updateRelationList(@Param("list") List<SchoolStudentClassRelation> updateRelationList);
/**
* 新增学生与班级关系
* @param addRelationList
*/
void addRelationList(@Param("list") List<SchoolStudentClassRelation> addRelationList);
} }
...@@ -79,4 +79,17 @@ public interface SchoolStudentMapper extends BaseMapper<SchoolStudent> { ...@@ -79,4 +79,17 @@ public interface SchoolStudentMapper extends BaseMapper<SchoolStudent> {
* @return * @return
*/ */
SchoolStudentVO getInfoByidCard(String idCard); SchoolStudentVO getInfoByidCard(String idCard);
/**
* 批量插入学生
* @param addList
* @return
*/
int inserStudentList(@Param("list") List<SchoolStudent> addList);
/**
* 批量更新学生信息
* @param updateList
*/
int updateStudentList(@Param("list") List<SchoolStudent> updateList);
} }
...@@ -72,4 +72,12 @@ public interface SchoolStudentParentMapper extends BaseMapper<SchoolStudentParen ...@@ -72,4 +72,12 @@ public interface SchoolStudentParentMapper extends BaseMapper<SchoolStudentParen
* 根据id 查询 openId * 根据id 查询 openId
*/ */
String getOpenIdById(Long id); String getOpenIdById(Long id);
/**
* 更新学生家长信息
* @param updateParentList
*/
void updateParentList(@Param("list") List<SchoolStudentParent> updateParentList);
// 新增学生家长信息
void addParentList(@Param("list") List<SchoolStudentParent> addParentList);
} }
...@@ -15,5 +15,5 @@ public interface IEducationStatisticsService { ...@@ -15,5 +15,5 @@ public interface IEducationStatisticsService {
List<StatisticsVariationVo> getVariationNum(String data,String data1); List<StatisticsVariationVo> getVariationNum(String data,String data1);
//年龄统计 //年龄统计
List<StatisticsAgeVo> getAgeNum(); List<StatisticsAgeVo> getAgeNum(int schoolYear);
} }
...@@ -80,51 +80,49 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch ...@@ -80,51 +80,49 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch
// 准备记录日志数据 // 准备记录日志数据
int successNum = 0; int successNum = 0;
StringBuilder successMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder();
//查询全部学生考试成绩
LambdaQueryWrapper<SchoolStudentScore> lqw = new LambdaQueryWrapper<>();
List<SchoolStudentScore> schoolStudentScores = studentScoreMapper.selectList(lqw);
List<SchoolStudentScore> updateScoreList = new ArrayList<>();
List<SchoolStudentScore> addScoreList = new ArrayList<>();
for (SchoolStudentScoreVo schoolStudentScoreVo : list) { for (SchoolStudentScoreVo schoolStudentScoreVo : list) {
LambdaQueryWrapper<SchoolStudent> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolStudent::getIdCard,schoolStudentScoreVo.getIdCard()); SchoolStudentScore score = new SchoolStudentScore();
SchoolStudent schoolStudent = schoolStudentMapper.selectOne(wrapper); for (SchoolStudentScore schoolStudentScore : schoolStudentScores) {
if (StringUtils.isNotNull(schoolStudent)){ if (schoolStudentScoreVo.getExamType().equals(schoolStudentScore.getExamType()) &&
//赋值 schoolStudentScoreVo.getStudentId().equals(schoolStudentScore.getStudentId()) &&
SchoolStudentScore schoolStudentScore = new SchoolStudentScore(); schoolStudentScore.getCurriculaId().equals(curriculaId)){
schoolStudentScore.setStudentId(schoolStudent.getId()); BeanUtils.copyProperties(schoolStudentScore,score);
schoolStudentScore.setCurriculaId(curriculaId);
schoolStudentScore.setClassId(schoolStudent.getClassId());
schoolStudentScore.setExamType(schoolStudentScoreVo.getExamType());
schoolStudentScore.setLanguage(schoolStudentScoreVo.getLanguage());
schoolStudentScore.setMath(schoolStudentScoreVo.getMath());
schoolStudentScore.setEnglish(schoolStudentScoreVo.getEnglish());
schoolStudentScore.setPolitics(schoolStudentScoreVo.getPolitics());
schoolStudentScore.setGeography(schoolStudentScoreVo.getGeography());
schoolStudentScore.setHistory(schoolStudentScoreVo.getHistory());
schoolStudentScore.setPhysics(schoolStudentScoreVo.getPhysics());
schoolStudentScore.setChemistry(schoolStudentScoreVo.getChemistry());
schoolStudentScore.setBiology(schoolStudentScoreVo.getBiology());
schoolStudentScore.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolStudentScore.setCreateTime(DateUtils.getNowDate());
LambdaQueryWrapper<SchoolStudentScore> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(SchoolStudentScore::getExamType,schoolStudentScore.getExamType())
.eq(SchoolStudentScore::getStudentId,schoolStudentScore.getStudentId())
.eq(SchoolStudentScore::getDelFlag,"0");
List<SchoolStudentScore> schoolStudentScores = studentScoreMapper.selectList(wrapper1);
String examType = schoolStudentScoreVo.getExamType();
switch (examType){
case "1":
examType = "一次";
break;
case "2":
examType = "二次";
break;
case "3":
examType = "三次";
break;
}
if (schoolStudentScores.size() > 0){
throw new ServiceException("已存在" + schoolStudentScoreVo.getStudentName() + "学生" + examType + "考试成绩");
} }
studentScoreMapper.insert(schoolStudentScore);
successNum ++;
} }
//判断学生是否存在此次考试成绩
if (StringUtils.isNotNull(score.getStudentId())){
//存在,更新学生此次考试成绩
score.setLanguage(schoolStudentScoreVo.getLanguage());
score.setMath(schoolStudentScoreVo.getMath());
score.setEnglish(schoolStudentScoreVo.getEnglish());
score.setPolitics(schoolStudentScoreVo.getPolitics());
score.setGeography(schoolStudentScoreVo.getGeography());
score.setHistory(schoolStudentScoreVo.getHistory());
score.setPhysics(schoolStudentScoreVo.getPhysics());
score.setChemistry(schoolStudentScoreVo.getChemistry());
score.setBiology(schoolStudentScoreVo.getBiology());
updateScoreList.add(score);
}else {
//不存在,新增学生此次考试成绩
SchoolStudentScore schoolStudentScore = new SchoolStudentScore();
BeanUtils.copyProperties(schoolStudentScoreVo,schoolStudentScore);
addScoreList.add(schoolStudentScore);
}
successNum ++;
}
if (updateScoreList.size() > 0){
studentScoreMapper.updateScoreList(updateScoreList);
}
if (addScoreList.size() > 0){
studentScoreMapper.insertScoreList(addScoreList);
} }
successMsg.insert(0, "恭喜您,数据已导入成功!共有 " + successNum + " 条,数据如下:"); successMsg.insert(0, "恭喜您,数据已导入成功!共有 " + successNum + " 条,数据如下:");
return successMsg.toString(); return successMsg.toString();
...@@ -153,10 +151,7 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch ...@@ -153,10 +151,7 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch
} else if (StringUtils.isEmpty(schoolStudentScoreVo.getStudentNumber())) { } else if (StringUtils.isEmpty(schoolStudentScoreVo.getStudentNumber())) {
failureNum++; failureNum++;
failureMsg.append("<br/>" + failureNum + "、学号为空,请您重新输入!"); failureMsg.append("<br/>" + failureNum + "、学号为空,请您重新输入!");
} /*else if (StringUtils.isEmpty(schoolStudentScoreVo.getClassName())) { } else if (StringUtils.isNull(schoolStudentScoreVo.getExamType())) {
failureNum++;
failureMsg.append("<br/>" + failureNum + "、班级为空,请您重新输入!");
}*/ else if (StringUtils.isNull(schoolStudentScoreVo.getExamType())) {
failureNum++; failureNum++;
failureMsg.append("<br/>" + failureNum + "、考试类型为空,请您重新输入!"); failureMsg.append("<br/>" + failureNum + "、考试类型为空,请您重新输入!");
} else { } else {
...@@ -167,17 +162,10 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch ...@@ -167,17 +162,10 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch
if (StringUtils.isNull(schoolStudents) || schoolStudents.size() == 0){ if (StringUtils.isNull(schoolStudents) || schoolStudents.size() == 0){
failureNum++; failureNum++;
failureMsg.append("<br/>" + failureNum + "、" + schoolStudentScoreVo.getStudentName() + "同学不存在,请您重新输入! "); failureMsg.append("<br/>" + failureNum + "、" + schoolStudentScoreVo.getStudentName() + "同学不存在,请您重新输入! ");
}/*else { }else {
SchoolStudent schoolStudent = schoolStudents.get(0); SchoolStudent schoolStudent = schoolStudents.get(0);
LambdaQueryWrapper<SchoolClass> queryWrapper = new LambdaQueryWrapper<>(); schoolStudentScoreVo.setStudentId(schoolStudent.getId());
queryWrapper.eq(SchoolClass::getId,schoolStudent.getClassId()) }
.eq(SchoolClass::getClassName,schoolStudentScoreVo.getClassName());
List<SchoolClass> schoolClasses = schoolClassMapper.selectList(queryWrapper);
if (StringUtils.isNull(schoolClasses) || schoolClasses.size() == 0){
failureNum++;
failureMsg.append("<br/>" + failureNum + "、" + schoolStudentScoreVo.getClassName() + "班级" + schoolStudentScoreVo.getStudentName() + "同学不存在,请您重新输入! ");
}
}*/
} }
} }
if (failureNum > 0) { if (failureNum > 0) {
...@@ -217,6 +205,34 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch ...@@ -217,6 +205,34 @@ public class StudentScoreServiceImpl extends ServiceImpl<StudentScoreMapper, Sch
if (schoolStudentScores.size() > 0){ if (schoolStudentScores.size() > 0){
throw new ServiceException("已存在该学生此次考试成绩"); throw new ServiceException("已存在该学生此次考试成绩");
} }
if (schoolStudentScore.getLanguage() > 150 || schoolStudentScore.getLanguage() < 0){
throw new ServiceException("请输入正确分数");
}
if (schoolStudentScore.getMath() > 150 || schoolStudentScore.getMath() < 0){
throw new ServiceException("请输入正确分数");
}
if (schoolStudentScore.getEnglish() > 150 || schoolStudentScore.getEnglish() < 0){
throw new ServiceException("请输入正确分数");
}
if (schoolStudentScore.getPolitics() > 150 || schoolStudentScore.getPolitics() < 0){
throw new ServiceException("请输入正确分数");
}
if (schoolStudentScore.getGeography() > 150 || schoolStudentScore.getGeography() < 0){
throw new ServiceException("请输入正确分数");
}
if (schoolStudentScore.getHistory() > 150 || schoolStudentScore.getHistory() < 0){
throw new ServiceException("请输入正确分数");
}
if (schoolStudentScore.getPhysics() > 150 || schoolStudentScore.getPhysics() < 0){
throw new ServiceException("请输入正确分数");
}
if (schoolStudentScore.getChemistry() > 150 || schoolStudentScore.getChemistry() < 0){
throw new ServiceException("请输入正确分数");
}
if (schoolStudentScore.getBiology() > 150 || schoolStudentScore.getBiology() < 0){
throw new ServiceException("请输入正确分数");
}
schoolStudentScore.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName()); schoolStudentScore.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolStudentScore.setCreateTime(DateUtils.getNowDate()); schoolStudentScore.setCreateTime(DateUtils.getNowDate());
return studentScoreMapper.insert(schoolStudentScore); return studentScoreMapper.insert(schoolStudentScore);
......
...@@ -201,10 +201,10 @@ public class EducationStatisticsServiceImpl implements IEducationStatisticsServi ...@@ -201,10 +201,10 @@ public class EducationStatisticsServiceImpl implements IEducationStatisticsServi
//年龄统计 //年龄统计
@Override @Override
public List<StatisticsAgeVo> getAgeNum() { public List<StatisticsAgeVo> getAgeNum(int schoolYear) {
List<StatisticsAgeVo> list = new ArrayList<>(); List<StatisticsAgeVo> list = new ArrayList<>();
//获取当前学年 //获取当前学年
int schoolYear = HolidayDateUtil.getSchoolYear(); // int schoolYear = HolidayDateUtil.getSchoolYear();
//int schoolYear = 2021; //int schoolYear = 2021;
//统计每个级部的班级里的学生的年龄个数 //统计每个级部的班级里的学生的年龄个数
for (int i = 1; i < 4; i++) { for (int i = 1; i < 4; i++) {
......
...@@ -30,6 +30,7 @@ import yangtz.cs.liu.campus.domain.time.*; ...@@ -30,6 +30,7 @@ import yangtz.cs.liu.campus.domain.time.*;
import yangtz.cs.liu.campus.mapper.course.SchoolCourseMapper; import yangtz.cs.liu.campus.mapper.course.SchoolCourseMapper;
import yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMapper; import yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMapper;
import yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMentorMapper; import yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMentorMapper;
import yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMapper;
import yangtz.cs.liu.campus.mapper.student.SchoolStudentMapper; import yangtz.cs.liu.campus.mapper.student.SchoolStudentMapper;
import yangtz.cs.liu.campus.mapper.student.SchoolStudentParentMapper; import yangtz.cs.liu.campus.mapper.student.SchoolStudentParentMapper;
import yangtz.cs.liu.campus.mapper.time.SchoolTimeDetailMapper; import yangtz.cs.liu.campus.mapper.time.SchoolTimeDetailMapper;
...@@ -86,6 +87,9 @@ public class SchoolTimeTableServiceImpl extends ServiceImpl<SchoolTimeTableMappe ...@@ -86,6 +87,9 @@ public class SchoolTimeTableServiceImpl extends ServiceImpl<SchoolTimeTableMappe
private SchoolClassMentorMapper classMentorMapper; private SchoolClassMentorMapper classMentorMapper;
@Autowired @Autowired
private SchoolGradeMapper gradeMapper;
@Autowired
private ISchoolCurriculumService schoolCurriculumService; private ISchoolCurriculumService schoolCurriculumService;
public static final String USE = "1"; public static final String USE = "1";
...@@ -278,7 +282,9 @@ public class SchoolTimeTableServiceImpl extends ServiceImpl<SchoolTimeTableMappe ...@@ -278,7 +282,9 @@ public class SchoolTimeTableServiceImpl extends ServiceImpl<SchoolTimeTableMappe
@Override @Override
public List<TableVO> getTeacherTable(Long teacherId){ public List<TableVO> getTeacherTable(Long teacherId){
//获取当前教师所授课班级(当前学年) //获取当前教师所授课班级(当前学年)
int schoolYear = HolidayDateUtil.getSchoolYear(); // int schoolYear = HolidayDateUtil.getSchoolYear();
// TODO 修改最新学年
int schoolYear = gradeMapper.isNewSchoolYear();
List<SchoolClassMentor> mentorList = classMentorMapper.getMentorByTeacherId(teacherId,schoolYear); List<SchoolClassMentor> mentorList = classMentorMapper.getMentorByTeacherId(teacherId,schoolYear);
if(isNull(mentorList)){ if(isNull(mentorList)){
return new ArrayList<>(); return new ArrayList<>();
...@@ -331,6 +337,13 @@ public class SchoolTimeTableServiceImpl extends ServiceImpl<SchoolTimeTableMappe ...@@ -331,6 +337,13 @@ public class SchoolTimeTableServiceImpl extends ServiceImpl<SchoolTimeTableMappe
//设置本节次星期一到星期日的课程 //设置本节次星期一到星期日的课程
public TableVO setCourse(Long teacherId,TableVO vo,List<SchoolTimeTable> tableList){ public TableVO setCourse(Long teacherId,TableVO vo,List<SchoolTimeTable> tableList){
List<SchoolCourseVO> listMonday = new ArrayList<>();
List<SchoolCourseVO> listTuesday = new ArrayList<>();
List<SchoolCourseVO> listWednesday = new ArrayList<>();
List<SchoolCourseVO> listThursday = new ArrayList<>();
List<SchoolCourseVO> listFriday = new ArrayList<>();
List<SchoolCourseVO> listSaturday = new ArrayList<>();
List<SchoolCourseVO> listSunday = new ArrayList<>();
for(SchoolTimeTable table : tableList){ for(SchoolTimeTable table : tableList){
SchoolCourseVO courseVO = new SchoolCourseVO(); SchoolCourseVO courseVO = new SchoolCourseVO();
courseVO.setId(table.getCourseId()); courseVO.setId(table.getCourseId());
...@@ -345,20 +358,118 @@ public class SchoolTimeTableServiceImpl extends ServiceImpl<SchoolTimeTableMappe ...@@ -345,20 +358,118 @@ public class SchoolTimeTableServiceImpl extends ServiceImpl<SchoolTimeTableMappe
switch (table.getWeekValue()){ switch (table.getWeekValue()){
case 1: case 1:
vo.setMonday(courseVO);break; // vo.setMonday(courseVO);break;
listMonday.add(courseVO);break;
case 2: case 2:
vo.setTuesday(courseVO);break; // vo.setTuesday(courseVO);break;
listTuesday.add(courseVO);break;
case 3: case 3:
vo.setWednesday(courseVO);break; // vo.setWednesday(courseVO);break;
listWednesday.add(courseVO);break;
case 4: case 4:
vo.setThursday(courseVO);break; // vo.setThursday(courseVO);break;
listThursday.add(courseVO);break;
case 5: case 5:
vo.setFriday(courseVO);break; // vo.setFriday(courseVO);break;
listFriday.add(courseVO);break;
case 6: case 6:
vo.setSaturday(courseVO);break; // vo.setSaturday(courseVO);break;
listSaturday.add(courseVO);break;
case 7: case 7:
vo.setSunday(courseVO);break; // vo.setSunday(courseVO);break;
listSunday.add(courseVO);break;
}
}
if (listMonday.size() > 0){
SchoolCourseVO courseVO = new SchoolCourseVO();
String courseName = "";
for (int i = 0; i < listMonday.size(); i++) {
if (i == listMonday.size() - 1){
courseName += listMonday.get(i).getCourseName();
}else {
courseName += listMonday.get(i).getCourseName() + "、";
}
}
courseVO.setCourseName(courseName);
vo.setMonday(courseVO);
}
if (listTuesday.size() > 0){
SchoolCourseVO courseVO = new SchoolCourseVO();
String courseName = "";
for (int i = 0; i < listTuesday.size(); i++) {
if (i == listTuesday.size() - 1){
courseName += listTuesday.get(i).getCourseName();
}else {
courseName += listTuesday.get(i).getCourseName() + "、";
}
}
courseVO.setCourseName(courseName);
vo.setTuesday(courseVO);
}
if (listWednesday.size() > 0){
SchoolCourseVO courseVO = new SchoolCourseVO();
String courseName = "";
for (int i = 0; i < listWednesday.size(); i++) {
if (i == listWednesday.size() - 1){
courseName += listWednesday.get(i).getCourseName();
}else {
courseName += listWednesday.get(i).getCourseName() + "、";
}
}
courseVO.setCourseName(courseName);
vo.setWednesday(courseVO);
}
if (listThursday.size() > 0){
SchoolCourseVO courseVO = new SchoolCourseVO();
String courseName = "";
for (int i = 0; i < listThursday.size(); i++) {
if (i == listThursday.size() - 1){
courseName += listThursday.get(i).getCourseName();
}else {
courseName += listThursday.get(i).getCourseName() + "、";
}
}
courseVO.setCourseName(courseName);
vo.setThursday(courseVO);
}
if (listFriday.size() > 0){
SchoolCourseVO courseVO = new SchoolCourseVO();
String courseName = "";
for (int i = 0; i < listFriday.size(); i++) {
if (i == listFriday.size() - 1){
courseName += listFriday.get(i).getCourseName();
}else {
courseName += listFriday.get(i).getCourseName() + "、";
}
}
courseVO.setCourseName(courseName);
vo.setFriday(courseVO);
}
if (listSaturday.size() > 0){
SchoolCourseVO courseVO = new SchoolCourseVO();
String courseName = "";
for (int i = 0; i < listSaturday.size(); i++) {
if (i == listSaturday.size() - 1){
courseName += listSaturday.get(i).getCourseName();
}else {
courseName += listSaturday.get(i).getCourseName() + "、";
}
}
courseVO.setCourseName(courseName);
vo.setSaturday(courseVO);
}
if (listSunday.size() > 0){
SchoolCourseVO courseVO = new SchoolCourseVO();
String courseName = "";
for (int i = 0; i < listSunday.size(); i++) {
if (i == listSunday.size() - 1){
courseName += listSunday.get(i).getCourseName();
}else {
courseName += listSunday.get(i).getCourseName() + "、";
}
} }
courseVO.setCourseName(courseName);
vo.setSunday(courseVO);
} }
return vo; return vo;
} }
......
...@@ -3,15 +3,11 @@ package yangtz.cs.liu.campus.service.schoolClass; ...@@ -3,15 +3,11 @@ package yangtz.cs.liu.campus.service.schoolClass;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClass; import yangtz.cs.liu.campus.domain.schoolClass.SchoolClass;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClassMentor; import yangtz.cs.liu.campus.domain.schoolClass.SchoolClassMentor;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGradeMentor;
import yangtz.cs.liu.campus.vo.schoolClass.ClassBatchVo; import yangtz.cs.liu.campus.vo.schoolClass.ClassBatchVo;
import yangtz.cs.liu.campus.vo.schoolClass.ClassTreeSelect; import yangtz.cs.liu.campus.vo.schoolClass.ClassTreeSelect;
import yangtz.cs.liu.campus.vo.schoolClass.SchoolClassDrVo;
import yangtz.cs.liu.campus.vo.schoolClass.SchoolClassMentorVo; import yangtz.cs.liu.campus.vo.schoolClass.SchoolClassMentorVo;
import yangtz.cs.liu.campus.vo.schoolgrade.GradeTreeSelect;
import yangtz.cs.liu.campus.vo.schoolgrade.SchoolGradeMentorVo;
import yangtz.cs.liu.wechat.vo.schoolClass.SchoolClassVo; import yangtz.cs.liu.wechat.vo.schoolClass.SchoolClassVo;
import yangtz.cs.liu.wechat.vo.schoolGrade.SchoolGradeVo;
import java.util.List; import java.util.List;
...@@ -43,13 +39,21 @@ public interface ISchoolClassService extends IService<SchoolClass> { ...@@ -43,13 +39,21 @@ public interface ISchoolClassService extends IService<SchoolClass> {
List<SchoolClassVo> getTeacherClass(Long teacherId); List<SchoolClassVo> getTeacherClass(Long teacherId);
// /**
// * 校验
// * @param list
// */
// void checkImport(List<SchoolClass> list);
//
// String importExamDetail(List<SchoolClass> list);
/** /**
* 校验 * 校验
* @param list * @param list
*/ */
void checkImport(List<SchoolClass> list); void checkImport(List<SchoolClassDrVo> list);
String importExamDetail(List<SchoolClass> list); String importExamDetail(List<SchoolClassDrVo> list);
/** /**
* *
......
...@@ -51,19 +51,19 @@ public class SchoolAuditoriumVo extends ProcessBaseEntity { ...@@ -51,19 +51,19 @@ public class SchoolAuditoriumVo extends ProcessBaseEntity {
private String duration; private String duration;
/** 是否彩排(1-是,0-否) */ /** 是否彩排(1-是,0-否) */
@Excel(name = "是否彩排", readConverterExp = "1=-是,0-否") @Excel(name = "是否彩排", combo = {"是","否"}, readConverterExp = "1=是,0=否")
private String isRehearsal; private String isRehearsal;
/** 是否录像(1-是,0-否) */ /** 是否录像(1-是,0-否) */
@Excel(name = "是否录像", readConverterExp = "1=-是,0-否") @Excel(name = "是否录像", combo = {"是","否"}, readConverterExp = "1=是,0=否")
private String isVideo; private String isVideo;
/** 是否直播(1-是,0-否) */ /** 是否直播(1-是,0-否) */
@Excel(name = "是否直播", readConverterExp = "1=-是,0-否") @Excel(name = "是否直播", combo = {"是","否"}, readConverterExp = "1=是,0=否")
private String isLive; private String isLive;
/** 是否需要大屏(1-是,0-否) */ /** 是否需要大屏(1-是,0-否) */
@Excel(name = "是否需要大屏", readConverterExp = "1=-是,0-否") @Excel(name = "是否需要大屏", combo = {"是","否"}, readConverterExp = "1=是,0=否")
private String isBigScreen; private String isBigScreen;
/** 其他要求 */ /** 其他要求 */
...@@ -79,7 +79,7 @@ public class SchoolAuditoriumVo extends ProcessBaseEntity { ...@@ -79,7 +79,7 @@ public class SchoolAuditoriumVo extends ProcessBaseEntity {
private String leadershipName; private String leadershipName;
/** 审核状态(0-未提交,1-审核中,2-审核通过,3-审核不通过) */ /** 审核状态(0-未提交,1-审核中,2-审核通过,3-审核不通过) */
@Excel(name = "审核状态", readConverterExp = "0=-未提交,1-审核中,2-审核通过,3-审核不通过") @Excel(name = "审核状态", combo = {"未提交","审核中","审核通过","审核不通过"}, readConverterExp = "0=未提交,1=审核中,2=审核通过,3=审核不通过")
private String state; private String state;
/** 审批意见 */ /** 审批意见 */
......
...@@ -94,6 +94,7 @@ public class PurchaseVo extends OurBaseEntity { ...@@ -94,6 +94,7 @@ public class PurchaseVo extends OurBaseEntity {
/** /**
* 申请时间 * 申请时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date applyTime; private Date applyTime;
/** /**
......
...@@ -29,7 +29,7 @@ public class SchoolStudentVO { ...@@ -29,7 +29,7 @@ public class SchoolStudentVO {
private String idCard; private String idCard;
/**性别**/ /**性别**/
@Excel(name = "*学生性别",combo = {"男","女"},readConverterExp = "0=男,1=女") @Excel(name = "学生性别",combo = {"男","女"},readConverterExp = "0=男,1=女")
@NotBlank(message = "学生性别不能为空") @NotBlank(message = "学生性别不能为空")
private String sex; private String sex;
...@@ -52,7 +52,7 @@ public class SchoolStudentVO { ...@@ -52,7 +52,7 @@ public class SchoolStudentVO {
/**出生日期**/ /**出生日期**/
@NotNull(message = "出生日期不能为空") @NotNull(message = "出生日期不能为空")
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "*出生日期", dateFormat = "yyyy-MM-dd",width = 25) @Excel(name = "出生日期", dateFormat = "yyyy-MM-dd",width = 25)
private Date birthday; private Date birthday;
/**学生状态**/ /**学生状态**/
......
...@@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="term != null "> and term = #{term}</if> <if test="term != null "> and term = #{term}</if>
<if test="studentId != null "> and student_id = #{studentId}</if> <if test="studentId != null "> and student_id = #{studentId}</if>
</where> </where>
order by create_time desc order by day desc
</select> </select>
<select id="selectSchoolStudentIntegralById" parameterType="Long" resultMap="SchoolStudentIntegralResult"> <select id="selectSchoolStudentIntegralById" parameterType="Long" resultMap="SchoolStudentIntegralResult">
......
...@@ -120,4 +120,140 @@ ...@@ -120,4 +120,140 @@
</foreach> </foreach>
</update> </update>
<update id="updateScoreList" parameterType="SchoolStudentScore">
<foreach collection="list" item="data" separator=";">
update school_student_score
<trim prefix="SET" suffixOverrides=",">
<if test="data.studentId != null">
student_id = #{data.studentId},
</if>
<if test="data.curriculaId != null">
curricula_id = #{data.curriculaId},
</if>
<if test="data.classId != null">
class_id = #{data.classId},
</if>
<if test="data.examType != null">
exam_type = #{data.examType},
</if>
<if test="data.language != null">
`language` = #{data.language},
</if>
<if test="data.math != null">
math = #{data.math},
</if>
<if test="data.english != null">
english = #{data.english},
</if>
<if test="data.politics != null">
politics = #{data.politics},
</if>
<if test="data.geography != null">
geography = #{data.geography},
</if>
<if test="data.history != null">
history = #{data.history},
</if>
<if test="data.physics != null">
physics = #{data.physics},
</if>
<if test="data.chemistry != null">
chemistry = #{data.chemistry},
</if>
<if test="data.biology != null">
biology = #{data.biology},
</if>
</trim>
where id = #{data.id}
</foreach>
</update>
<insert id="insertScoreList" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
<foreach collection="list" item="data" separator=";">
insert into school_student_score
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="data.studentId != null">
student_id,
</if>
<if test="data.curriculaId != null">
curricula_id,
</if>
<if test="data.classId != null">
class_id,
</if>
<if test="data.examType != null">
exam_type,
</if>
<if test="data.language != null">
`language`,
</if>
<if test="data.math != null">
math,
</if>
<if test="data.english != null">
english,
</if>
<if test="data.politics != null">
politics,
</if>
<if test="data.geography != null">
geography,
</if>
<if test="data.history != null">
history,
</if>
<if test="data.physics != null">
physics,
</if>
<if test="data.chemistry != null">
chemistry,
</if>
<if test="data.biology != null">
biology,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="data.studentId != null">
#{data.studentId},
</if>
<if test="data.curriculaId != null">
#{data.curriculaId},
</if>
<if test="data.classId != null">
#{data.classId},
</if>
<if test="data.examType != null">
#{data.examType},
</if>
<if test="data.language != null">
#{data.language},
</if>
<if test="data.math != null">
#{data.math},
</if>
<if test="data.english != null">
#{data.english},
</if>
<if test="data.politics != null">
#{data.politics},
</if>
<if test="data.geography != null">
#{data.geography},
</if>
<if test="data.history != null">
#{data.history},
</if>
<if test="data.physics != null">
#{data.physics},
</if>
<if test="data.chemistry != null">
#{data.chemistry},
</if>
<if test="data.biology != null">
#{data.biology},
</if>
</trim>
</foreach>
</insert>
</mapper> </mapper>
\ No newline at end of file
...@@ -9,4 +9,41 @@ ...@@ -9,4 +9,41 @@
left join school_class sc on cr.class_id = sc.id left join school_class sc on cr.class_id = sc.id
where cr.student_id = #{studentId} where cr.student_id = #{studentId}
</select> </select>
<update id="updateRelationList" parameterType="yangtz.cs.liu.campus.domain.student.SchoolStudentClassRelation">
<foreach collection="list" item="data" separator=";">
update school_student_class_relation
<trim prefix="SET" suffixOverrides=",">
<if test="data.classId != null">
class_id = #{data.classId},
</if>
<if test="data.studentId != null">
student_id = #{data.studentId},
</if>
</trim>
where id = #{data.id}
</foreach>
</update>
<insert id="addRelationList" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
<foreach collection="list" item="data" separator=";">
insert into school_student_class_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="data.classId != null">
class_id,
</if>
<if test="data.studentId != null">
student_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="data.classId != null">
#{data.classId},
</if>
<if test="data.studentId != null">
#{data.studentId},
</if>
</trim>
</foreach>
</insert>
</mapper> </mapper>
...@@ -296,4 +296,93 @@ ...@@ -296,4 +296,93 @@
</where> </where>
</select> </select>
<insert id="inserStudentList" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
<foreach collection="list" item="data" separator=";">
insert into school_student
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="data.classId != null">class_id,</if>
<if test="data.studentName != null and data.studentName != ''">student_name,</if>
<if test="data.sex != null and data.sex != ''">sex,</if>
<if test="data.birthday != null">birthday,</if>
<if test="data.nation != null and data.nation != ''">nation,</if>
<if test="data.homeAddress != null and data.homeAddress != ''">home_address,</if>
<if test="data.nativePlace != null and data.nativePlace != ''">native_place,</if>
<if test="data.enrollmentTime != null">enrollment_time,</if>
<if test="data.avatar != null and data.avatar != ''">avatar,</if>
<if test="data.idCard != null and data.idCard != ''">id_card,</if>
<if test="data.schoolNo != null and data.schoolNo != ''">school_no,</if>
<if test="data.studentStatus != null and data.studentStatus != ''">student_status,</if>
<if test="data.studentType != null and data.studentType != ''">student_type,</if>
<if test="data.oneCard != null and data.oneCard != ''">one_card,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="data.classId != null">#{data.classId},</if>
<if test="data.studentName != null and data.studentName != ''">#{data.studentName},</if>
<if test="data.sex != null and data.sex != ''">#{data.sex},</if>
<if test="data.birthday != null">#{data.birthday},</if>
<if test="data.nation != null and data.nation != ''">#{data.nation},</if>
<if test="data.homeAddress != null and data.homeAddress != ''">#{data.homeAddress},</if>
<if test="data.nativePlace != null and data.nativePlace != ''">#{data.nativePlace},</if>
<if test="data.enrollmentTime != null">#{data.enrollmentTime},</if>
<if test="data.avatar != null and data.avatar != ''">#{data.avatar},</if>
<if test="data.idCard != null and data.idCard != ''">#{data.idCard},</if>
<if test="data.schoolNo != null and data.schoolNo != ''">#{data.schoolNo},</if>
<if test="data.studentStatus != null and data.studentStatus != ''">#{data.studentStatus},</if>
<if test="data.studentType != null and data.studentType != ''">#{data.studentType},</if>
<if test="data.oneCard != null and data.oneCard != ''">#{data.oneCard},</if>
</trim>
</foreach>
</insert>
<update id="updateStudentList" parameterType="yangtz.cs.liu.campus.domain.student.SchoolStudent">
<foreach collection="list" item="data" separator=";">
update school_student
<trim prefix="SET" suffixOverrides=",">
<if test="data.classId != null">
class_id = #{data.classId},
</if>
<if test="data.studentName != null and data.studentName != ''">
student_name = #{data.studentName},
</if>
<if test="data.sex != null and data.sex != ''">
sex = #{data.sex},
</if>
<if test="data.birthday != null">
birthday = #{data.birthday},
</if>
<if test="data.nation != null and data.nation != ''">
nation = #{data.nation},
</if>
<if test="data.homeAddress != null and data.homeAddress != ''">
home_address = #{data.homeAddress},
</if>
<if test="data.nativePlace != null and data.nativePlace != ''">
native_place = #{data.nativePlace},
</if>
<if test="data.enrollmentTime != null">
enrollment_time = #{data.enrollmentTime},
</if>
<if test="data.avatar != null and data.avatar != ''">
avatar = #{data.avatar},
</if>
<if test="data.idCard != null and data.idCard != ''">
id_card = #{data.idCard},
</if>
<if test="data.schoolNo != null and data.schoolNo != ''">
school_no = #{data.schoolNo},
</if>
<if test="data.studentStatus != null and data.studentStatus != ''">
student_status = #{data.studentStatus},
</if>
<if test="data.studentType != null and data.studentType != ''">
student_type = #{data.studentType},
</if>
<if test="data.oneCard != null and data.oneCard != ''">
one_card = #{data.oneCard},
</if>
</trim>
where id = #{data.id}
</foreach>
</update>
</mapper> </mapper>
...@@ -190,4 +190,85 @@ ...@@ -190,4 +190,85 @@
select open_id from school_student_parent where id = #{id} and del_flag = '0' select open_id from school_student_parent where id = #{id} and del_flag = '0'
</select> </select>
<update id="updateParentList" parameterType="yangtz.cs.liu.campus.domain.student.SchoolStudentParent">
<foreach collection="list" item="data" separator=";">
update school_student_parent
<trim prefix="SET" suffixOverrides=",">
<if test="data.parentName != null and data.parentName != ''">
parent_name = #{data.parentName},
</if>
<if test="data.relationship != null and data.relationship != ''">
relationship = #{data.relationship},
</if>
<if test="data.workAddress != null and data.workAddress != ''">
work_address = #{data.workAddress},
</if>
<if test="data.contactAddress != null and data.contactAddress != ''">
contact_address = #{data.contactAddress},
</if>
<if test="data.postalCode != null and data.postalCode != ''">
postal_code = #{data.postalCode},
</if>
</trim>
where id = #{data.id}
</foreach>
</update>
<insert id="addParentList" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
<foreach collection="list" item="data" separator=";">
insert into school_student_parent
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="data.studentId != null">
student_id,
</if>
<if test="data.userId != null">
user_id,
</if>
<if test="data.parentName != null and data.parentName != ''">
parent_name,
</if>
<if test="data.telephone != null and data.telephone != ''">
postal_code,
</if>
<if test="data.relationship != null and data.relationship != ''">
relationship,
</if>
<if test="data.workAddress != null and data.workAddress != ''">
work_address,
</if>
<if test="data.contactAddress != null and data.contactAddress != ''">
contact_address,
</if>
<if test="data.postalCode != null and data.postalCode != ''">
postal_code,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="data.studentId != null">
#{data.studentId},
</if>
<if test="data.userId != null">
#{data.userId},
</if>
<if test="data.parentName != null and data.parentName != ''">
#{data.parentName},
</if>
<if test="data.telephone != null and data.telephone != ''">
#{data.telephone},
</if>
<if test="data.relationship != null and data.relationship != ''">
#{data.relationship},
</if>
<if test="data.workAddress != null and data.workAddress != ''">
#{data.workAddress},
</if>
<if test="data.contactAddress != null and data.contactAddress != ''">
#{data.contactAddress},
</if>
<if test="data.postalCode != null and data.postalCode != ''">
#{data.postalCode},
</if>
</trim>
</foreach>
</insert>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment