Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

周箭河 5 vuotta sitten
vanhempi
commit
b6b44e4c73
38 muutettua tiedostoa jossa 686 lisäystä ja 117 poistoa
  1. 12 0
      edu-common/src/main/java/com/keao/edu/common/entity/SysConfig.java
  2. 10 0
      edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoom.java
  3. 11 0
      edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/Student.java
  4. 4 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/EmployeeController.java
  5. 8 3
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamTeacherSalaryController.java
  6. 14 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/StudentController.java
  7. 4 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/SysConfigController.java
  8. 6 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/TenantInfoController.java
  9. 4 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamCertificationDao.java
  10. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRegistrationDao.java
  11. 3 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRoomDao.java
  12. 2 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamTeacherSalaryDao.java
  13. 18 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/StudentDao.java
  14. 7 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/StudentExamResultDao.java
  15. 75 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/StudentExamPaymentDto.java
  16. 14 4
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/Employee.java
  17. 17 5
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamTeacherSalary.java
  18. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/Organization.java
  19. 15 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/StudentApplyQueryInfo.java
  20. 9 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamTeacherSalaryService.java
  21. 18 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/StudentService.java
  22. 3 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/TenantInfoService.java
  23. 9 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/EmployeeServiceImpl.java
  24. 52 6
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java
  25. 51 10
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamTeacherSalaryServiceImpl.java
  26. 5 5
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/OrganizationServiceImpl.java
  27. 60 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/StudentServiceImpl.java
  28. 6 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/TenantInfoServiceImpl.java
  29. 51 51
      edu-user/edu-user-server/src/main/resources/config/mybatis/EmployeeMapper.xml
  30. 10 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamCertificationMapper.xml
  31. 6 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml
  32. 58 2
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml
  33. 7 6
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml
  34. 41 3
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamTeacherSalaryMapper.xml
  35. 6 2
      edu-user/edu-user-server/src/main/resources/config/mybatis/OrganizationMapper.xml
  36. 8 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/StudentExamResultMapper.xml
  37. 34 5
      edu-user/edu-user-server/src/main/resources/config/mybatis/StudentMapper.xml
  38. 6 2
      edu-user/edu-user-server/src/main/resources/config/mybatis/SysConfigMapper.xml

+ 12 - 0
edu-common/src/main/java/com/keao/edu/common/entity/SysConfig.java

@@ -22,6 +22,10 @@ public class SysConfig {
 	/** 描述 */
 	@ApiModelProperty(value = "描述", required = true)
 	private String description;
+
+	/** 描述 */
+	@ApiModelProperty(value = "备注", required = true)
+	private String annotation;
 	
 	/** 创建时间 */
 	private java.util.Date createOn;
@@ -34,6 +38,14 @@ public class SysConfig {
 
 	private String tenantId;
 
+	public String getAnnotation() {
+		return annotation;
+	}
+
+	public void setAnnotation(String annotation) {
+		this.annotation = annotation;
+	}
+
 	public String getTenantId() {
 		return tenantId;
 	}

+ 10 - 0
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoom.java

@@ -38,6 +38,8 @@ public class ExamRoom {
 	private Integer organId;
 
 	private YesOrNoEnum examPlanPushFlag;
+
+	private Integer examRoomStudentNum;
 	
 	/**  */
 	private boolean delFlag;
@@ -164,6 +166,14 @@ public class ExamRoom {
 		this.examPlanPushFlag = examPlanPushFlag;
 	}
 
+	public Integer getExamRoomStudentNum() {
+		return examRoomStudentNum;
+	}
+
+	public void setExamRoomStudentNum(Integer examRoomStudentNum) {
+		this.examRoomStudentNum = examRoomStudentNum;
+	}
+
 	public void setTenantId(String tenantId){
 		this.tenantId = tenantId;
 	}

+ 11 - 0
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/Student.java

@@ -23,6 +23,9 @@ public class Student{
 
 	private Integer organId;
 
+	@ApiModelProperty(value = "考试次数")
+	private Integer examNum;
+
 	private SysUser sysUser;
 
 	public Student(Integer organId, String phone) {
@@ -37,6 +40,14 @@ public class Student{
 		super();
 	}
 
+	public Integer getExamNum() {
+		return examNum;
+	}
+
+	public void setExamNum(Integer examNum) {
+		this.examNum = examNum;
+	}
+
 	public Integer getOrganId() {
 		return organId;
 	}

+ 4 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/EmployeeController.java

@@ -40,8 +40,10 @@ public class EmployeeController extends BaseController {
 
 	@ApiOperation("新增员工")
 	@PostMapping(value = "/add")
-	public HttpResponseResult add(Employee employee) {
-		employeeService.add(employee);
+	public HttpResponseResult add(@RequestBody Employee employee) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        employee.setOrganId(sysUser.getId());
+	    employeeService.add(employee);
 		return succeed();
 	}
 

+ 8 - 3
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamTeacherSalaryController.java

@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -34,6 +35,9 @@ public class ExamTeacherSalaryController extends BaseController {
     @ApiOperation("新增")
     @PostMapping(value = "/add")
     public HttpResponseResult add(ExamTeacherSalary examTeacherSalary) {
+        examTeacherSalary.setTotalInvigilationNum(0);
+        examTeacherSalary.setTotalInvigilationStudentNum(0);
+        examTeacherSalary.setTotalSettlementCost(BigDecimal.ZERO);
         examTeacherSalaryService.insert(examTeacherSalary);
         return succeed();
     }
@@ -47,9 +51,10 @@ public class ExamTeacherSalaryController extends BaseController {
     }
 
     @ApiOperation("删除")
-    @PostMapping(value = "/del/{id}")
-    public HttpResponseResult add(@PathVariable("id") Long id) {
-        return succeed(examTeacherSalaryService.delete(id));
+    @PostMapping(value = "/del")
+    public HttpResponseResult add(Long id) {
+        examTeacherSalaryService.deleteExamTeacherSalary(id);
+        return succeed();
     }
 
 }

+ 14 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/StudentController.java

@@ -6,12 +6,17 @@ import com.keao.edu.common.entity.HttpResponseResult;
 import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.page.QueryInfo;
 import com.keao.edu.user.api.entity.Student;
+import com.keao.edu.user.dto.StudentExamPaymentDto;
+import com.keao.edu.user.page.StudentApplyQueryInfo;
 import com.keao.edu.user.service.StudentService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * 系统配置控制层
@@ -28,7 +33,14 @@ public class StudentController extends BaseController {
 	@GetMapping(value = "list")
     @PreAuthorize("@pcs.hasPermissions('student/list')")
 	public HttpResponseResult<PageInfo<Student>> list(QueryInfo queryInfo) {
-		return succeed(studentService.queryPage(queryInfo));
+		return succeed(studentService.queryStudentPage(queryInfo));
+	}
+
+	@ApiOperation(value = "学员报考列表")
+	@PostMapping(value = "applyList")
+    @PreAuthorize("@pcs.hasPermissions('student/applyList')")
+	public HttpResponseResult<PageInfo<StudentExamPaymentDto>> applyList(StudentApplyQueryInfo queryInfo) {
+		return succeed(studentService.queryApplyList(queryInfo));
 	}
 
 	@ApiOperation(value = "查询学员")

+ 4 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/SysConfigController.java

@@ -3,6 +3,8 @@ package com.keao.edu.user.controller;
 
 import com.keao.edu.common.controller.BaseController;
 import com.keao.edu.common.entity.SysConfig;
+import com.keao.edu.common.page.QueryInfo;
+import com.keao.edu.common.tenant.TenantContextHolder;
 import com.keao.edu.user.service.SysConfigService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -34,8 +36,10 @@ public class SysConfigController extends BaseController {
 	@GetMapping(value = "list")
     @PreAuthorize("@pcs.hasPermissions('sysConfig/list')")
 	public Object configList(String group) {
+		String tenantId = TenantContextHolder.getTenantId().toString();
 		Map<String,Object> params = new HashMap<String, Object>();
 		params.put("group", group);
+		params.put("tenantId", tenantId);
 		List<SysConfig> configs = sysConfigService.findAll(params);
 		return succeed(configs);
 	}

+ 6 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/TenantInfoController.java

@@ -5,6 +5,7 @@ import com.keao.edu.common.controller.BaseController;
 import com.keao.edu.common.entity.HttpResponseResult;
 import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.page.QueryInfo;
+import com.keao.edu.common.tenant.TenantContextHolder;
 import com.keao.edu.user.entity.TenantInfo;
 import com.keao.edu.user.service.TenantInfoService;
 import io.swagger.annotations.Api;
@@ -32,8 +33,9 @@ public class TenantInfoController extends BaseController {
 	@ApiOperation("查询机构详情")
 	@ApiImplicitParam(name = "id", value = "机构ID", required = true, dataType = "Integer", paramType = "path")
 	@GetMapping(value = "/query")
-	public HttpResponseResult<TenantInfo> query(Integer id) {
-		return succeed(tenantInfoService.get(id));
+	public HttpResponseResult<TenantInfo> query() {
+		String tenantId = TenantContextHolder.getTenantId().toString();
+		return succeed(tenantInfoService.get(Integer.parseInt(tenantId)));
 	}
 
 	@ApiOperation("新增机构")
@@ -46,7 +48,9 @@ public class TenantInfoController extends BaseController {
 	@ApiOperation("更新机构")
 	@PostMapping(value = "/update")
 	public HttpResponseResult update(TenantInfo tenantInfo) {
+		String tenantId = TenantContextHolder.getTenantId().toString();
 		tenantInfo.setUpdateTime(new Date());
+		tenantInfo.setId(Integer.parseInt(tenantId));
 		tenantInfoService.update(tenantInfo);
 		return succeed();
 	}

+ 4 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamCertificationDao.java

@@ -4,8 +4,12 @@ import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.user.entity.ExamCertification;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 public interface ExamCertificationDao extends BaseDAO<Long, ExamCertification> {
 
+    int batchInsert(@Param("ecs")List<ExamCertification> ecs);
+
 
     /**
      * 获取学员准考证

+ 11 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRegistrationDao.java

@@ -55,4 +55,15 @@ public interface ExamRegistrationDao extends BaseDAO<Long, ExamRegistration> {
                                                                  @Param("organIds") List<Integer> organIds,
                                                                  @Param("examId") Integer examId);
 
+    /**
+     * @describe 获取指定考级项目下指定学员的报名记录
+     * @author Joburgess
+     * @date 2020.07.02
+     * @param examId:
+     * @param studentIds:
+     * @return java.util.List<com.keao.edu.user.entity.ExamRegistration>
+     */
+    List<ExamRegistration> getWithExamAndStudents(@Param("examId") Integer examId,
+                                                  @Param("studentIds") List<Integer> studentIds);
+
 }

+ 3 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRoomDao.java

@@ -45,5 +45,7 @@ public interface ExamRoomDao extends BaseDAO<Long, ExamRoom> {
     List<ExamRoom> getWithExam(@Param("organIds") List<Integer> organIds,
                                 @Param("examId") Integer examId);
 
-//    int batchUpdateExamRoomPushStatus(@Param())
+    int updateSL(ExamRoom examRoom);
+
+    ExamRoom lockRoom(@Param("examRoomId") Long examRoomId);
 }

+ 2 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamTeacherSalaryDao.java

@@ -9,6 +9,8 @@ import java.util.List;
 
 public interface ExamTeacherSalaryDao extends BaseDAO<Long, ExamTeacherSalary> {
 
+    int batchUpdate(@Param("teacherSalaries") List<ExamTeacherSalary> teacherSalaries);
+
     /**
      * @describe 获取指定考级项目下的老师分润设置
      * @author Joburgess

+ 18 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/StudentDao.java

@@ -2,8 +2,25 @@ package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.user.api.entity.Student;
+import com.keao.edu.user.dto.StudentExamPaymentDto;
+
+import java.util.List;
+import java.util.Map;
 
 public interface StudentDao extends BaseDAO<Integer, Student> {
 
-	
+
+    /**
+     * COUNT学员报名详情列表
+     * @param params
+     * @return
+     */
+    int countApplyList(Map<String, Object> params);
+
+    /**
+     * 获取学员报名详情列表
+     * @param params
+     * @return
+     */
+    List<StudentExamPaymentDto> queryApplyList(Map<String, Object> params);
 }

+ 7 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/StudentExamResultDao.java

@@ -33,4 +33,11 @@ public interface StudentExamResultDao extends BaseDAO<Long, StudentExamResult> {
     StudentExamResultStatisticsDto getStudentExamResultStatisticsInfo(@Param("organIds") List<Integer> organIds,
                                                                       @Param("examId") Integer examId);
 
+    /**
+     * 获取考试次数
+     * @param studentIds
+     * @param tenantId
+     * @return
+     */
+    List<Map> countExamNum(@Param("studentIds") List<Integer> studentIds, @Param("tenantId") String tenantId);
 }

+ 75 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/StudentExamPaymentDto.java

@@ -0,0 +1,75 @@
+package com.keao.edu.user.dto;
+
+import com.keao.edu.user.entity.ExamRegistration;
+import com.keao.edu.user.entity.ExamRegistrationPayment;
+import com.keao.edu.user.entity.StudentExamResult;
+import io.swagger.annotations.ApiModelProperty;
+
+public class StudentExamPaymentDto {
+
+    @ApiModelProperty(value = "考试项目")
+    private String examBaseName;
+
+    @ApiModelProperty(value = "学员报名数据")
+    private ExamRegistration examRegistration;
+
+    @ApiModelProperty(value = "学员考试结果")
+    private StudentExamResult studentExamResult;
+
+    @ApiModelProperty(value = "学员报名订单数据")
+    private ExamRegistrationPayment examRegistrationPayment;
+
+    @ApiModelProperty(value = "合作单位")
+    private String organName;
+
+    @ApiModelProperty(value = "报考专业")
+    private String subjectName;
+
+    public String getExamBaseName() {
+        return examBaseName;
+    }
+
+    public void setExamBaseName(String examBaseName) {
+        this.examBaseName = examBaseName;
+    }
+
+    public ExamRegistration getExamRegistration() {
+        return examRegistration;
+    }
+
+    public void setExamRegistration(ExamRegistration examRegistration) {
+        this.examRegistration = examRegistration;
+    }
+
+    public StudentExamResult getStudentExamResult() {
+        return studentExamResult;
+    }
+
+    public void setStudentExamResult(StudentExamResult studentExamResult) {
+        this.studentExamResult = studentExamResult;
+    }
+
+    public ExamRegistrationPayment getExamRegistrationPayment() {
+        return examRegistrationPayment;
+    }
+
+    public void setExamRegistrationPayment(ExamRegistrationPayment examRegistrationPayment) {
+        this.examRegistrationPayment = examRegistrationPayment;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+}

+ 14 - 4
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/Employee.java

@@ -67,11 +67,13 @@ public class Employee {
 	private String roleName;
 
 	@ApiModelProperty(value = "是否删除0否1是",required = false)
-	private Integer delFlag;
+	private boolean delFlag;
 
 	@ApiModelProperty(value = "员工信息",required = false)
 	private SysUser sysUser;
 
+	private Integer organId;
+
 	private String tenantId;
 
 	public String getTenantId() {
@@ -82,11 +84,11 @@ public class Employee {
 		this.tenantId = tenantId;
 	}
 
-	public Integer getDelFlag() {
+	public boolean getDelFlag() {
 		return delFlag;
 	}
 
-	public void setDelFlag(Integer delFlag) {
+	public void setDelFlag(boolean delFlag) {
 		this.delFlag = delFlag;
 	}
 
@@ -217,7 +219,15 @@ public class Employee {
 	public String getPostalCode(){
 		return this.postalCode;
 	}
-			
+
+	public Integer getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(Integer organId) {
+		this.organId = organId;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 17 - 5
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamTeacherSalary.java

@@ -1,7 +1,9 @@
 package com.keao.edu.user.entity;
 
+import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.user.enums.ExamModeEnum;
 import com.keao.edu.user.enums.SettlementTypeEnum;
+import com.keao.edu.user.enums.TeacherSettlementTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
@@ -20,11 +22,13 @@ public class ExamTeacherSalary {
 	@ApiModelProperty(value = "考试类型")
 	private ExamModeEnum examMode;
 
-	@ApiModelProperty(value = "")
+	@ApiModelProperty(value = "教室编号")
 	private Integer teacherId;
 
+	private SysUser teacher;
+
 	@ApiModelProperty(value = "结算类型(按天/人)")
-	private SettlementTypeEnum settlementType;
+	private TeacherSettlementTypeEnum settlementType;
 
 	@ApiModelProperty(value = "分润金额")
 	private java.math.BigDecimal shareProfitAmount;
@@ -60,11 +64,11 @@ public class ExamTeacherSalary {
 		this.examMode = examMode;
 	}
 
-	public SettlementTypeEnum getSettlementType() {
+	public TeacherSettlementTypeEnum getSettlementType() {
 		return settlementType;
 	}
 
-	public void setSettlementType(SettlementTypeEnum settlementType) {
+	public void setSettlementType(TeacherSettlementTypeEnum settlementType) {
 		this.settlementType = settlementType;
 	}
 
@@ -83,7 +87,15 @@ public class ExamTeacherSalary {
 	public Integer getTeacherId(){
 		return this.teacherId;
 	}
-			
+
+	public SysUser getTeacher() {
+		return teacher;
+	}
+
+	public void setTeacher(SysUser teacher) {
+		this.teacher = teacher;
+	}
+
 	public void setShareProfitAmount(java.math.BigDecimal shareProfitAmount){
 		this.shareProfitAmount = shareProfitAmount;
 	}

+ 11 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/Organization.java

@@ -14,6 +14,9 @@ public class Organization {
 	/**  */
 	private Integer id;
 
+	/**  */
+	private Integer userId;
+
 	@ApiModelProperty(value = "合作单位名字",required = false)
 	private String name;
 
@@ -62,6 +65,14 @@ public class Organization {
 		this.name = name;
 	}
 
+	public Integer getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Integer userId) {
+		this.userId = userId;
+	}
+
 	public YesOrNoEnum getIsAllowArrangeExam() {
 		return isAllowArrangeExam;
 	}

+ 15 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/StudentApplyQueryInfo.java

@@ -0,0 +1,15 @@
+package com.keao.edu.user.page;
+
+import com.keao.edu.common.page.QueryInfo;
+
+public class StudentApplyQueryInfo extends QueryInfo {
+    private Integer studentId;
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+}

+ 9 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamTeacherSalaryService.java

@@ -14,4 +14,13 @@ public interface ExamTeacherSalaryService extends BaseService<Long, ExamTeacherS
      */
     void teacherSalarySettlementWithExam(Integer examId);
 
+    /**
+     * @describe 删除考级教室分润设置
+     * @author Joburgess
+     * @date 2020.07.02
+     * @param examTeacherSalaryId:
+     * @return void
+     */
+    void deleteExamTeacherSalary(Long examTeacherSalaryId);
+
 }

+ 18 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/StudentService.java

@@ -1,7 +1,11 @@
 package com.keao.edu.user.service;
 
+import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.common.page.QueryInfo;
 import com.keao.edu.common.service.BaseService;
 import com.keao.edu.user.api.entity.Student;
+import com.keao.edu.user.dto.StudentExamPaymentDto;
+import com.keao.edu.user.page.StudentApplyQueryInfo;
 
 /**
  * @Author Joburgess
@@ -26,4 +30,18 @@ public interface StudentService extends BaseService<Integer, Student> {
      * @return void
      */
     void updateStudent(Student student);
+
+    /**
+     * 获取学员列表
+     * @param queryInfo
+     * @return
+     */
+    PageInfo<Student> queryStudentPage(QueryInfo queryInfo);
+
+    /**
+     * 获取学员成功报名的数据详情
+     * @param queryInfo
+     * @return
+     */
+    PageInfo<StudentExamPaymentDto> queryApplyList(StudentApplyQueryInfo queryInfo);
 }

+ 3 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/TenantInfoService.java

@@ -5,4 +5,6 @@ import com.keao.edu.user.entity.TenantInfo;
 
 public interface TenantInfoService extends BaseService<Integer, TenantInfo> {
 
-}
+    void addTenant(TenantInfo tenantInfo);
+
+}

+ 9 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/EmployeeServiceImpl.java

@@ -5,12 +5,14 @@ import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.common.exception.BizException;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
+import com.keao.edu.common.tenant.TenantContextHolder;
 import com.keao.edu.im.api.client.ImFeignService;
 import com.keao.edu.im.api.entity.ImResult;
 import com.keao.edu.im.api.entity.ImUserModel;
 import com.keao.edu.user.dao.EmployeeDao;
 import com.keao.edu.user.dao.SysUserDao;
 import com.keao.edu.user.entity.Employee;
+import com.keao.edu.user.enums.YesOrNoEnum;
 import com.keao.edu.user.service.EmployeeService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,7 +38,9 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee> impl
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void add(Employee employee) {
+		String tenantId = TenantContextHolder.getTenantId().toString();
 		SysUser sysUser = employee.getSysUser();
+		employee.setTenantId(tenantId);
 		SysUser user = sysUserDao.queryByPhone(sysUser.getPhone());
 		if(user != null && user.getId() != null){
 			Employee employee1 = employeeDao.get(user.getId());
@@ -50,12 +54,16 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee> impl
 				sysUserDao.batchAddEmployeeRole(user.getId(),sysUser.getRoles());
 				user.setUserType(user.getUserType() + ",SYSTEM");
 				sysUserDao.update(user);
-				return;
+			}else if(employee1.getDelFlag()){
+				employee1.setDelFlag(false);
+				employeeDao.update(employee1);
 			}else{
 				throw new BizException("用户已存在");
 			}
+			return;
 		}
 		user = new SysUser();
+		user.setTenantId(tenantId);
 		user.setPassword(new BCryptPasswordEncoder().encode("123456"));
 		user.setUserType("SYSTEM");
 		sysUserDao.insert(user);

+ 52 - 6
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -4,23 +4,25 @@ import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.common.exception.BizException;
 import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.common.service.IdGeneratorService;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.common.tenant.TenantContextHolder;
 import com.keao.edu.user.api.entity.ExamRoom;
-import com.keao.edu.user.dao.ExamRoomDao;
-import com.keao.edu.user.dao.ExamRoomStudentRelationDao;
-import com.keao.edu.user.dao.StudentExamResultDao;
+import com.keao.edu.user.dao.*;
 import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
 import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
-import com.keao.edu.user.entity.StudentExamResult;
-import com.keao.edu.user.entity.Subject;
+import com.keao.edu.user.entity.*;
 import com.keao.edu.user.page.ExamRoomStudentRelationQueryInfo;
+import com.keao.edu.user.service.ExamCertificationService;
 import com.keao.edu.user.service.ExamRoomStudentRelationService;
+import com.keao.edu.user.service.ExamTeacherSalaryService;
 import com.keao.edu.user.service.OrganizationService;
 import com.keao.edu.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import java.util.*;
@@ -37,6 +39,16 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	private OrganizationService organizationService;
 	@Autowired
 	private StudentExamResultDao studentExamResultDao;
+	@Autowired
+	private ExamCertificationDao examCertificationDao;
+	@Autowired
+	private ExamLocationDao examLocationDao;
+	@Autowired
+	private IdGeneratorService idGeneratorService;
+	@Autowired
+	private ExamRegistrationDao examRegistrationDao;
+	@Autowired
+	private ExamTeacherSalaryService examTeacherSalaryService;
 
 	@Override
 	public BaseDAO<Long, ExamRoomStudentRelation> getDAO() {
@@ -49,6 +61,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
 	public void addStudentForRoom(Long examRoomId, String studentIdsStr) {
 		if(Objects.isNull(examRoomId)){
 			throw new BizException("请指定教室");
@@ -56,19 +69,31 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		if(StringUtils.isBlank(studentIdsStr)){
 			throw new BizException("请指定学员");
 		}
-		ExamRoom examRoom = examRoomDao.get(examRoomId);
+		ExamRoom examRoom = examRoomDao.lockRoom(examRoomId);
 		if(Objects.isNull(examRoom)){
 			throw new BizException("教室不存在");
 		}
+		ExamLocation examLocation = examLocationDao.get(examRoom.getExamLocationId());
+
 		List<ExamRoomStudentRelation> studentsWithExamRoom = examRoomStudentRelationDao.findStudentsWithExamRoom(examRoomId);
 		Set<Integer> existStudentIds = studentsWithExamRoom.stream().map(ExamRoomStudentRelation::getStudentId).collect(Collectors.toSet());
 		String[] studentIds = studentIdsStr.split(",");
+
+		List<ExamRegistration> examRegistrations = examRegistrationDao.getWithExamAndStudents(examRoom.getExaminationBasicId(), Arrays.asList(studentIds).stream().map(e -> Integer.valueOf(e)).collect(Collectors.toList()));
+		Map<Integer, ExamRegistration> studentRegistMap = examRegistrations.stream().collect(Collectors.toMap(ExamRegistration::getStudentId, e -> e));
+
 		List<ExamRoomStudentRelation> examRoomStudentRelations=new ArrayList<>();
 		List<StudentExamResult> studentExamResults=new ArrayList<>();
+		List<ExamCertification> examCertifications=new ArrayList<>();
 		for (String studentId : studentIds) {
 			if(existStudentIds.contains(Integer.valueOf(studentId))){
 				continue;
 			}
+			ExamRegistration examRegistration = studentRegistMap.get(Integer.valueOf(studentId));
+			if(Objects.isNull(examRegistration)){
+				throw new BizException("学员信息错误");
+			}
+
 			ExamRoomStudentRelation e=new ExamRoomStudentRelation();
 			e.setExaminationBasicId(examRoom.getExaminationBasicId());
 			e.setExamRoomId(examRoom.getId());
@@ -83,13 +108,29 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 			ser.setConfirmStatus(false);
 			ser.setTenantId(TenantContextHolder.getTenantId().toString());
 			studentExamResults.add(ser);
+
+			ExamCertification ec=new ExamCertification();
+			ec.setExaminationBasicId(examRoom.getExaminationBasicId());
+			ec.setStudentId(Integer.valueOf(studentId));
+			ec.setCardNo(String.valueOf(idGeneratorService.generatorId()));
+			ec.setSubjectId(examRegistration.getSubjectId());
+			ec.setLevel(examRegistration.getLevel());
+			ec.setExamStartTime(examRoom.getExamStartTime());
+			ec.setExamEndTime(examRoom.getExamEndTime());
+			ec.setExamAddress(examLocation.getAddress());
+			ec.setTenantId(TenantContextHolder.getTenantId().toString());
+			examCertifications.add(ec);
 		}
 		if(!CollectionUtils.isEmpty(examRoomStudentRelations)){
 			examRoomStudentRelationDao.batchInsert(examRoomStudentRelations);
+			examTeacherSalaryService.teacherSalarySettlementWithExam(examRoom.getExaminationBasicId());
 		}
 		if(!CollectionUtils.isEmpty(studentExamResults)){
 			studentExamResultDao.batchInsert(studentExamResults);
 		}
+		if(!CollectionUtils.isEmpty(examCertifications)){
+			examCertificationDao.batchInsert(examCertifications);
+		}
 	}
 
 	@Override
@@ -125,11 +166,16 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		if(Objects.isNull(examRoomId)){
 			throw new BizException("请指定教室");
 		}
+		ExamRoom examRoom = examRoomDao.get(examRoomId);
+		if(Objects.isNull(examRoom)){
+			throw new BizException("教室不存在");
+		}
 		if(StringUtils.isBlank(studentIdsStr)){
 			return;
 		}
 		List<Integer> studentIds = Arrays.asList(studentIdsStr.split(",")).stream().map(e -> Integer.valueOf(e)).collect(Collectors.toList());
 		examRoomStudentRelationDao.deleteStudentsFromExamRoom(examRoomId, studentIds);
+		examTeacherSalaryService.teacherSalarySettlementWithExam(examRoom.getExaminationBasicId());
 	}
 
 	@Override

+ 51 - 10
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamTeacherSalaryServiceImpl.java

@@ -1,6 +1,7 @@
 package com.keao.edu.user.service.impl;
 
 import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.common.exception.BizException;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.user.api.entity.ExamRoom;
 import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
@@ -9,15 +10,17 @@ import com.keao.edu.user.dao.ExamRoomStudentRelationDao;
 import com.keao.edu.user.dao.ExamTeacherSalaryDao;
 import com.keao.edu.user.dao.ExaminationBasicDao;
 import com.keao.edu.user.entity.ExamTeacherSalary;
+import com.keao.edu.user.enums.SettlementTypeEnum;
+import com.keao.edu.user.enums.TeacherSettlementTypeEnum;
 import com.keao.edu.user.service.ExamTeacherSalaryService;
 import com.keao.edu.user.service.ExaminationBasicService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.math.BigDecimal;
+import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -25,8 +28,6 @@ import java.util.stream.Stream;
 public class ExamTeacherSalaryServiceImpl extends BaseServiceImpl<Long, ExamTeacherSalary> implements ExamTeacherSalaryService {
 
 	@Autowired
-	private ExaminationBasicDao examinationBasicDao;
-	@Autowired
 	private ExamRoomDao examRoomDao;
 	@Autowired
 	private ExamRoomStudentRelationDao examRoomStudentRelationDao;
@@ -44,13 +45,53 @@ public class ExamTeacherSalaryServiceImpl extends BaseServiceImpl<Long, ExamTeac
 		if(CollectionUtils.isEmpty(examRooms)){
 			return;
 		}
-		List<ExamRoomStudentRelation> examRoomStudentRelations = examRoomStudentRelationDao.getExamRoomStudentRelations(examId, null, null);
-		Map<Long, List<ExamRoomStudentRelation>> examRoomStudentsMap = new HashMap<>();
-		if(!CollectionUtils.isEmpty(examRoomStudentRelations)){
-			examRoomStudentsMap=examRoomStudentRelations.stream().collect(Collectors.groupingBy(ExamRoomStudentRelation::getExamRoomId));
+
+		Map<Integer, List<ExamRoom>> teacherExamRoomMap=new HashMap<>();
+		for (ExamRoom examRoom : examRooms) {
+			if(!teacherExamRoomMap.containsKey(examRoom.getMainTeacherUserId())){
+				teacherExamRoomMap.put(examRoom.getMainTeacherUserId(), new ArrayList<>());
+			}
+			teacherExamRoomMap.get(examRoom.getMainTeacherUserId()).add(examRoom);
+			if(StringUtils.isBlank(examRoom.getAssistantTeacherUserIdList())){
+				continue;
+			}
+			for (String assistantTeacherId : examRoom.getAssistantTeacherUserIdList().split(",")) {
+				if(!teacherExamRoomMap.containsKey(Integer.valueOf(assistantTeacherId))){
+					teacherExamRoomMap.put(Integer.valueOf(assistantTeacherId), new ArrayList<>());
+				}
+				teacherExamRoomMap.get(Integer.valueOf(assistantTeacherId)).add(examRoom);
+			}
 		}
+
+		List<ExamRoomStudentRelation> examRoomStudentRelations = examRoomStudentRelationDao.getExamRoomStudentRelations(examId, null, null);
+
 		List<ExamTeacherSalary> examTeacherSalaries = examTeacherSalaryDao.queryWithExam(examId);
-		Map<Integer, ExamTeacherSalary> teacherIdSalaryMap = examTeacherSalaries.stream().collect(Collectors.toMap(ExamTeacherSalary::getTeacherId, e -> e));
+		for (ExamTeacherSalary examTeacherSalary : examTeacherSalaries) {
+			List<ExamRoom> teacherExamRooms = teacherExamRoomMap.get(examTeacherSalary.getTeacherId());
+			if(CollectionUtils.isEmpty(teacherExamRooms)){
+				examTeacherSalary.setTotalInvigilationNum(0);
+				examTeacherSalary.setTotalInvigilationStudentNum(0);
+				examTeacherSalary.setTotalSettlementCost(BigDecimal.ZERO);
+				continue;
+			}
+			Set<Long> examRoomIds = teacherExamRooms.stream().map(ExamRoom::getId).collect(Collectors.toSet());
+			long studentNum = examRoomStudentRelations.stream().filter(e -> examRoomIds.contains(e.getExamRoomId())).count();
+			examTeacherSalary.setTotalInvigilationNum(examRoomIds.size());
+			examTeacherSalary.setTotalInvigilationStudentNum((int) studentNum);
+			examTeacherSalary.setTotalSettlementCost(examTeacherSalary.getShareProfitAmount().multiply(new BigDecimal(studentNum)));
+		}
+		examTeacherSalaryDao.batchUpdate(examTeacherSalaries);
+	}
 
+	@Override
+	public void deleteExamTeacherSalary(Long examTeacherSalaryId) {
+		ExamTeacherSalary examTeacherSalary = examTeacherSalaryDao.get(examTeacherSalaryId);
+		if(Objects.isNull(examTeacherSalary)){
+			throw new BizException("教室分润设置不能存在");
+		}
+		if(examTeacherSalary.getTotalInvigilationNum()>0){
+			throw new BizException("该教室已被分配到考场");
+		}
+		examTeacherSalaryDao.delete(examTeacherSalaryId);
 	}
 }

+ 5 - 5
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/OrganizationServiceImpl.java

@@ -71,7 +71,7 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 				if(StringUtils.isEmpty(user.getPassword())){
 					sysUser.setPassword(new BCryptPasswordEncoder().encode("123456"));
 				}
-				organ.setId(user.getId());
+				organ.setUserId(user.getId());
 				organDao.insert(organ);
 				//新增用户角色
 				if(sysUser.getRoles() != null && sysUser.getRoles().size() > 0){
@@ -81,13 +81,13 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 				user.setRealName(organ.getName());
 				user.setPhone(organ.getContactPhone());
 				sysUserDao.update(user);
-				return;
 			}else if(organization.getDelFlag() == YesOrNoEnum.YES){
 				organization.setDelFlag(YesOrNoEnum.NO);
 				organDao.update(organization);
 			}else{
 				throw new BizException("用户已存在");
 			}
+			return;
 		}
 		sysUser.setPassword(new BCryptPasswordEncoder().encode("123456"));
 		sysUser.setUserType("ORGAN");
@@ -96,7 +96,7 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 		sysUserDao.insert(sysUser);
 
 		organ.setParentOrganIdTag(currentOrganization.getParentOrganIdTag() + "," + sysUser.getId());
-		organ.setId(sysUser.getId());
+		organ.setUserId(sysUser.getId());
 		organDao.insert(organ);
 		//新增用户角色
 		sysUserDao.delEmployeeRole(sysUser.getId());
@@ -112,11 +112,11 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 	@Transactional(rollbackFor = Exception.class)
 	public void updateOrganization(Organization organization) {
 		SysUser sysUser = organization.getSysUser();
-		sysUser.setId(organization.getId());
+		sysUser.setId(organization.getUserId());
 		if(null == organDao.get(sysUser.getId())){
 			throw new BizException("合作商信息不存在");
 		}
-		organization.setId(sysUser.getId());
+//		organization.setId(sysUser.getId());
 		if(StringUtils.isNotEmpty(sysUser.getPhone())){
 			SysUser queryByPhone = sysUserDao.queryByPhone(sysUser.getPhone());
 			if(queryByPhone != null && !sysUser.getId().equals(queryByPhone.getId())){

+ 60 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/StudentServiceImpl.java

@@ -3,22 +3,35 @@ package com.keao.edu.user.service.impl;
 import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.common.exception.BizException;
+import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.common.page.QueryInfo;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.im.api.client.ImFeignService;
 import com.keao.edu.im.api.entity.ImResult;
 import com.keao.edu.im.api.entity.ImUserModel;
 import com.keao.edu.user.dao.StudentDao;
+import com.keao.edu.user.dao.StudentExamResultDao;
 import com.keao.edu.user.dao.SysUserDao;
 import com.keao.edu.user.api.entity.Student;
+import com.keao.edu.user.dto.StudentExamPaymentDto;
 import com.keao.edu.user.entity.Organization;
 import com.keao.edu.user.enums.YesOrNoEnum;
+import com.keao.edu.user.page.StudentApplyQueryInfo;
 import com.keao.edu.user.service.OrganizationService;
 import com.keao.edu.user.service.StudentService;
+import com.keao.edu.util.collection.MapUtil;
+import org.apache.commons.collections.MapUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
 /**
  * @Author Joburgess
  * @Date 2020.06.18
@@ -31,6 +44,8 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
     @Autowired
     private SysUserDao sysUserDao;
     @Autowired
+    private StudentExamResultDao studentExamResultDao;
+    @Autowired
     private OrganizationService organizationService;
     @Autowired
     private ImFeignService imFeignService;
@@ -57,10 +72,10 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
                 sysUser.setId(user.getId());
                 sysUser.setUserType(user.getUserType() + ",STUDENT");
                 sysUserDao.update(sysUser);
-                return;
             }else{
                 throw new BizException("用户已存在");
             }
+            return;
         }
         Organization organization = organizationService.get(student.getOrganId());
         student.setTenantId(organization.getTenantId());
@@ -88,4 +103,48 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         sysUserDao.update(sysUser);
         studentDao.update(student);
     }
+
+    @Override
+    public PageInfo<Student> queryStudentPage(QueryInfo queryInfo) {
+        PageInfo<Student> studentPageInfo = queryPage(queryInfo);
+        List<Student> rows = studentPageInfo.getRows();
+        if(rows != null && rows.size() > 0){
+            List<Integer> studentIds = rows.stream().map(e -> e.getUserId()).collect(Collectors.toList());
+            //获取考试次数
+            Map<Integer,Integer> examNumMap = MapUtil.convertIntegerMap(studentExamResultDao.countExamNum(studentIds, queryInfo.getTenantId()));
+            rows.forEach(e->{
+                e.setExamNum(examNumMap.get(e.getUserId()));
+            });
+        }
+        return studentPageInfo;
+    }
+
+    @Override
+    public PageInfo<StudentExamPaymentDto> queryApplyList(StudentApplyQueryInfo queryInfo) {
+        PageInfo<StudentExamPaymentDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+        Map<String, Object> params = new HashMap<>();
+        MapUtil.populateMap(params, queryInfo);
+
+        List<StudentExamPaymentDto> dataList = null;
+        int count = studentDao.countApplyList(params);
+        if (count > 0) {
+            pageInfo.setTotal(count);
+            params.put("offset", pageInfo.getOffset());
+            dataList = studentDao.queryApplyList(params);
+            List<Integer> basicIds = dataList.stream().map(e -> e.getExamRegistration().getExaminationBasicId()).collect(Collectors.toList());
+            Map<Integer, String> basicNameMap = this.getMap("examination_basic", "id_", "name_", basicIds, Integer.class, String.class);
+            Map<Integer, String> organNameMap = this.getMap("organization", "id_", "name_", basicIds, Integer.class, String.class);
+            Map<Integer, String> subjectNameMap = this.getMap("subject", "id_", "name_", basicIds, Integer.class, String.class);
+            dataList.forEach(e->{
+                e.setExamBaseName(basicNameMap.get(e.getExamRegistration().getExaminationBasicId()));
+                e.setOrganName(organNameMap.get(e.getExamRegistration().getOrganId()));
+                e.setOrganName(subjectNameMap.get(e.getExamRegistration().getSubjectId()));
+            });
+        }
+        if (count == 0) {
+            dataList = new ArrayList<>();
+        }
+        pageInfo.setRows(dataList);
+        return pageInfo;
+    }
 }

+ 6 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/TenantInfoServiceImpl.java

@@ -18,5 +18,9 @@ public class TenantInfoServiceImpl extends BaseServiceImpl<Integer, TenantInfo>
 	public BaseDAO<Integer, TenantInfo> getDAO() {
 		return tenantInfoDao;
 	}
-	
-}
+
+	@Override
+	public void addTenant(TenantInfo tenantInfo) {
+
+	}
+}

+ 51 - 51
edu-user/edu-user-server/src/main/resources/config/mybatis/EmployeeMapper.xml

@@ -24,6 +24,7 @@
 		<result column="role_name_" property="roleName" />
 		<result column="del_flag_" property="delFlag" />
 		<result column="tenant_id_" property="tenantId" />
+		<result column="organ_id_" property="organId" />
 		<association property="sysUser" resultMap="com.keao.edu.user.dao.SysUserDao.SysUser"/>
 	</resultMap>
 
@@ -40,68 +41,67 @@
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.keao.edu.user.entity.Employee" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO employee (user_id_,job_nature_,education_background_,graduate_school_,technical_titles_,entry_date_,
-		certificate_type_,certificate_num_,update_time_,create_time_,introduction_,demission_date_,contact_address_,postal_code_,tenant_id_)
+		certificate_type_,certificate_num_,update_time_,create_time_,introduction_,demission_date_,contact_address_,postal_code_,tenant_id_,organ_id_)
 		VALUES(#{userId},#{jobNature},#{educationBackground},#{graduateSchool},#{technicalTitles},#{entryDate},#{certificateType},
-		#{certificateNum},#{updateTime},#{createTime},#{introduction},#{demissionDate},#{contactAddress},#{postalCode},#{tenantId})
+		#{certificateNum},NOW(),NOW(),#{introduction},#{demissionDate},#{contactAddress},#{postalCode},#{tenantId},#{organId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.keao.edu.user.entity.Employee">
-		UPDATE employee <set>
-		<if test="graduateSchool != null">
-		graduate_school_ = #{graduateSchool},
-		</if>
-		<if test="introduction != null">
-		introduction_ = #{introduction},
-		</if>
-		<if test="postalCode != null">
-		postal_code_ = #{postalCode},
-		</if>
-		<if test="technicalTitles != null">
-		technical_titles_ = #{technicalTitles},
-		</if>
-		<if test="entryDate != null">
-		entry_date_ = #{entryDate},
-		</if>
-		<if test="contactAddress != null">
-		contact_address_ = #{contactAddress},
-		</if>
-		<if test="jobNature != null">
-		job_nature_ = #{jobNature},
-		</if>
-		<if test="createTime != null">
-		create_time_ = #{createTime},
-		</if>
-		<if test="userId != null">
-		user_id_ = #{userId},
-		</if>
-		<if test="certificateType != null">
-		certificate_type_ = #{certificateType},
-		</if>
-		<if test="updateTime != null">
-		update_time_ = #{updateTime},
-		</if>
-		<if test="educationBackground != null">
-		education_background_ = #{educationBackground},
-		</if>
-		<if test="certificateNum != null">
-		certificate_num_ = #{certificateNum},
-		</if>
-		<if test="demissionDate != null">
-		demission_date_ = #{demissionDate},
-		</if>
-		<if test="tenantId != null">
-			tenant_id_=#{tenantId}
-		</if>
-		</set> WHERE user_id_ = #{userId}
+		UPDATE employee
+		<set>
+            <if test="graduateSchool != null">
+                graduate_school_ = #{graduateSchool},
+            </if>
+            <if test="introduction != null">
+                introduction_ = #{introduction},
+            </if>
+            <if test="postalCode != null">
+                postal_code_ = #{postalCode},
+            </if>
+            <if test="technicalTitles != null">
+                technical_titles_ = #{technicalTitles},
+            </if>
+            <if test="entryDate != null">
+                entry_date_ = #{entryDate},
+            </if>
+            <if test="contactAddress != null">
+                contact_address_ = #{contactAddress},
+            </if>
+            <if test="jobNature != null">
+                job_nature_ = #{jobNature},
+            </if>
+            <if test="userId != null">
+                user_id_ = #{userId},
+            </if>
+            <if test="certificateType != null">
+                certificate_type_ = #{certificateType},
+            </if>
+            <if test="educationBackground != null">
+                education_background_ = #{educationBackground},
+            </if>
+            <if test="certificateNum != null">
+                certificate_num_ = #{certificateNum},
+            </if>
+            <if test="demissionDate != null">
+                demission_date_ = #{demissionDate},
+            </if>
+            <if test="tenantId != null">
+                tenant_id_=#{tenantId},
+            </if>
+            <if test="organId != null">
+                organ_id_=#{organId},
+            </if>
+            update_time_ = NOW()
+        </set> WHERE user_id_ = #{userId}
 	</update>
 	<!-- 根据主键删除一条记录 -->
 	<update id="delete" >
-		UPDATE employee SET del_flag_ = 0,update_time_ = NOW() WHERE user_id_ = #{userId}
+		UPDATE employee SET del_flag_ = 1,update_time_ = NOW() WHERE user_id_ = #{userId}
 	</update>
 	<sql id="employeeQueryPage">
 		<where>
-				e.del_flag_ = 1 AND tenant_id_ = #{tenantId}
+				e.del_flag_ = 1 AND e.tenant_id_ = #{tenantId}
 			<if test="search != null and search != ''">
 				AND (e.user_id_ = #{search} OR su.phone_ LIKE CONCAT('%',#{search},'%') OR su.real_name_ LIKE CONCAT('%',#{search},'%'))
 			</if>

+ 10 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamCertificationMapper.xml

@@ -38,6 +38,16 @@
 		VALUES(#{id},#{examinationBasicId},#{studentId},#{cardNo},#{subjectId},#{level},#{examStartTime},
 		#{examEndTime},#{examAddress},NOW(),NOW(),#{tenantId})
 	</insert>
+
+	<insert id="batchInsert" parameterType="com.keao.edu.user.entity.ExamCertification" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO exam_certification (examination_basic_id_,student_id_,card_no_,subject_id_,
+		level_,exam_start_time_,exam_end_time_,exam_address_,create_time_,update_time_,tenant_id_)
+		VALUES
+		<foreach collection="ecs" item="ec" separator=",">
+			(#{ec.examinationBasicId},#{ec.studentId},#{ec.cardNo},#{ec.subjectId},#{ec.level},#{ec.examStartTime},
+			#{ec.examEndTime},#{ec.examAddress},NOW(),NOW(),#{ec.tenantId})
+		</foreach>
+	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.keao.edu.user.entity.ExamCertification">

+ 6 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml

@@ -214,4 +214,10 @@
 		AND er.examination_basic_id_ = #{examId}
 		AND er.status_ != ''
 	</select>
+    <select id="getWithExamAndStudents" resultMap="ExamRegistration">
+		SELECT * FROM exam_registration WHERE examination_basic_id_=#{examId} AND student_id_ IN
+		<foreach collection="studentIds" item="studentId" separator="," open="(" close=")">
+			#{studentId}
+		</foreach>
+	</select>
 </mapper>

+ 58 - 2
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml

@@ -19,6 +19,7 @@
 		<result column="del_flag_" property="delFlag" />
 		<result column="organ_id_" property="organId"/>
 		<result column="exam_plan_push_flag_" property="examPlanPushFlag" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
+		<result column="exam_room_student_num_" property="examRoomStudentNum"/>
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
@@ -37,9 +38,11 @@
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.keao.edu.user.api.entity.ExamRoom" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO exam_room (id_,examination_basic_id_,exam_mode_,exam_location_id_,subject_id_list_,main_teacher_user_id_,
-		assistant_teacher_user_id_list_,exam_start_time_,exam_end_time_,del_flag_,organ_id_,exam_plan_push_flag_,create_time_,update_time_,tenant_id_)
+		assistant_teacher_user_id_list_,exam_start_time_,exam_end_time_,del_flag_,organ_id_,exam_plan_push_flag_,
+		exam_room_student_num_,create_time_,update_time_,tenant_id_)
 		VALUES(#{id},#{examinationBasicId},#{examMode},#{examLocationId},#{subjectIdList},#{mainTeacherUserId},#{assistantTeacherUserIdList},
-		#{examStartTime},#{examEndTime},#{delFlag},#{organId},#{examPlanPushFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{tenantId})
+		#{examStartTime},#{examEndTime},#{delFlag},#{organId},#{examPlanPushFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+		#{examRoomStudentNum},NOW(),NOW(),#{tenantId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -82,9 +85,58 @@
 			<if test="examPlanPushFlag != null">
 				exam_plan_push_flag_ = #{examPlanPushFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
 			</if>
+			<if test="examRoomStudentNum!=null">
+				exam_room_student_num_=#{examRoomStudentNum},
+			</if>
 				update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>
+
+	<update id="updateSL" parameterType="com.keao.edu.user.api.entity.ExamRoom">
+		UPDATE exam_room
+		<set>
+			<if test="delFlag != null">
+				del_flag_ = #{delFlag},
+			</if>
+			<if test="examinationBasicId != null">
+				examination_basic_id_ = #{examinationBasicId},
+			</if>
+			<if test="examStartTime != null">
+				exam_start_time_ = #{examStartTime},
+			</if>
+			<if test="examEndTime != null">
+				exam_end_time_ = #{examEndTime},
+			</if>
+			<if test="subjectIdList != null">
+				subject_id_list_ = #{subjectIdList},
+			</if>
+			<if test="tenantId != null">
+				tenant_id_ = #{tenantId},
+			</if>
+			<if test="examMode != null">
+				exam_mode_ = #{examMode},
+			</if>
+			<if test="examLocationId != null">
+				exam_location_id_ = #{examLocationId},
+			</if>
+			<if test="mainTeacherUserId != null">
+				main_teacher_user_id_ = #{mainTeacherUserId},
+			</if>
+			<if test="assistantTeacherUserIdList != null">
+				assistant_teacher_user_id_list_ = #{assistantTeacherUserIdList},
+			</if>
+			<if test="organId != null">
+				organ_id_ = #{organId},
+			</if>
+			<if test="examPlanPushFlag != null">
+				exam_plan_push_flag_ = #{examPlanPushFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="examRoomStudentNum!=null">
+				exam_room_student_num_=#{examRoomStudentNum},
+			</if>
+			update_time_ = NOW()
+		</set> WHERE id_ = #{id} AND update_time_=#{updateTime}
+	</update>
 	
 	<!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
@@ -168,4 +220,8 @@
 			</foreach>
 		</if>
     </select>
+
+	<select id="lockRoom" resultType="com.keao.edu.user.api.entity.ExamRoom">
+		SELECT * FROM exam_room WHERE id_=#{examRoomId} FOR UPDATE
+	</select>
 </mapper>

+ 7 - 6
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

@@ -113,6 +113,7 @@
 			<foreach collection="organIds" item="organI" separator="," open="(" close=")">
 				#{organI}
 			</foreach>
+			AND er.status_='AUDIT_PASS'
 			<if test="examId!=null">
 				AND er.examination_basic_id_ = 1
 			</if>
@@ -127,13 +128,13 @@
 
 	<select id="findExamRoomStudents" resultMap="ExamRoomStudentRelationDto" parameterType="map">
 		SELECT
-		ersr.id_,
-		ersr.student_id_,
-		er.subject_id_ regist_subject_id_,
-		er.level_ regist_level_,
-		er.create_time_ regist_create_time_
+			ersr.id_,
+			ersr.student_id_,
+			er.subject_id_ regist_subject_id_,
+			er.level_ regist_level_,
+			er.create_time_ regist_create_time_
 		FROM
-		exam_registration er
+			exam_registration er
 		LEFT JOIN exam_room_student_relation ersr ON ersr.student_id_ = er.student_id_ ON ersr.examination_basic_id_=er.examination_basic_id_
 		<include refid="queryCondition"/>
 		ORDER BY id_ <include refid="global.limit"/>

+ 41 - 3
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamTeacherSalaryMapper.xml

@@ -19,7 +19,8 @@
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
-	</resultMap>
+		<association property="teacher" columnPrefix="teacher_" resultMap="com.keao.edu.auth.dal.dao.SysUserDao.SysUser"/>
+ 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
 	<select id="get" resultMap="ExamTeacherSalary" >
@@ -73,6 +74,42 @@
 				update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>
+
+	<update id="batchUpdate" parameterType="com.keao.edu.user.entity.ExamTeacherSalary">
+		<foreach collection="teacherSalaries" item="ts" separator=";">
+			UPDATE exam_teacher_salary
+			<set>
+				<if test="examinationBasicId != null">
+					examination_basic_id_ = #{ts.examinationBasicId},
+				</if>
+				<if test="teacherId != null">
+					teacher_id_ = #{ts.teacherId},
+				</if>
+				<if test="tenantId != null">
+					tenant_id_ = #{ts.tenantId},
+				</if>
+				<if test="examMode != null">
+					exam_mode_ = #{ts.examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+				</if>
+				<if test="shareProfitAmount != null">
+					share_profit_amount_ = #{ts.shareProfitAmount},
+				</if>
+				<if test="settlementType != null">
+					settlement_type_ = #{ts.settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+				</if>
+				<if test="totalInvigilationNum != null">
+					total_invigilation_num_ = #{ts.totalInvigilationNum},
+				</if>
+				<if test="totalInvigilationStudentNum != null">
+					total_invigilation_student_num_ = #{ts.totalInvigilationStudentNum},
+				</if>
+				<if test="totalSettlementCost != null">
+					total_settlement_fee_ = #{ts.totalSettlementCost},
+				</if>
+				update_time_ = NOW()
+			</set> WHERE id_ = #{id}
+		</foreach>
+	</update>
 	
 	<!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
@@ -87,14 +124,15 @@
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="ExamTeacherSalary" parameterType="map">
-		SELECT * FROM exam_teacher_salary
+		SELECT ets.*,su.real_name_ teacher_real_name_ FROM exam_teacher_salary ets
+		LEFT JOIN sys_user su ON ets.teacher_id_=su.id_
 		<include refid="queryPageCondition"/>
 		ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM exam_teacher_salary
+		SELECT COUNT(*) FROM exam_teacher_salary ets
 		<include refid="queryPageCondition"/>
 	</select>
     <select id="queryWithExam" resultMap="ExamTeacherSalary">

+ 6 - 2
edu-user/edu-user-server/src/main/resources/config/mybatis/OrganizationMapper.xml

@@ -8,6 +8,7 @@
 	
 	<resultMap type="com.keao.edu.user.entity.Organization" id="Organization">
 		<result column="id_" property="id" />
+		<result column="user_id_" property="userId" />
 		<result column="name_" property="name" />
 		<result column="contact_name_" property="contactName" />
 		<result column="contact_phone_" property="contactPhone" />
@@ -36,8 +37,8 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.keao.edu.user.entity.Organization" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO organization (id_,name_,contact_name_,contact_phone_,level_,parent_organ_id_,parent_organ_id_tag_,settlement_type_,share_profit_amount_,is_allow_arrange_exam_,create_time_,update_time_,tenant_id_)
-		VALUES(#{id},#{name},#{contactName},#{contactPhone},#{level},#{parentOrganId},#{parentOrganIdTag},#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+		INSERT INTO organization (id_,user_id_,name_,contact_name_,contact_phone_,level_,parent_organ_id_,parent_organ_id_tag_,settlement_type_,share_profit_amount_,is_allow_arrange_exam_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{userId},#{name},#{contactName},#{contactPhone},#{level},#{parentOrganId},#{parentOrganIdTag},#{settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
 		#{shareProfitAmount},#{isAllowArrangeExam,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),#{tenantId})
 	</insert>
 	
@@ -78,6 +79,9 @@
 			<if test="tenantId != null">
 				tenant_id_ = #{tenantId},
 			</if>
+			<if test="userId != null">
+				user_id_ = #{userId},
+			</if>
 			update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>

+ 8 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/StudentExamResultMapper.xml

@@ -155,4 +155,12 @@
 		GROUP BY
 			er.examination_basic_id_
 	</select>
+	<select id="countExamNum" resultType="java.util.HashMap">
+		SELECT ser.student_id_ 'key',COUNT(ser.id_) 'value' FROM student_exam_result ser
+		WHERE ser.tenant_id_ = #{tenantId} AND ser.is_finished_exam_ = 1 AND ser.student_id_ IN
+		<foreach collection="studentIds" item="item" open="(" close=")" separator=",">
+			#{item}
+		</foreach>
+		GROUP BY ser.student_id_
+	</select>
 </mapper>

+ 34 - 5
edu-user/edu-user-server/src/main/resources/config/mybatis/StudentMapper.xml

@@ -56,9 +56,9 @@
 
 	<sql id="queryCondition">
 		<where>
-			tenant_id_=#{tenantId}
-			<if test="search!=null">
-				AND (stu.user_id_=#{search} OR su.real_name_ LIKE CONCAT (#{search}, '%'))
+			stu.tenant_id_ = #{tenantId}
+			<if test="search != null and search != ''">
+				AND (stu.user_id_ = #{search} OR su.real_name_ LIKE CONCAT (#{search}, '%'))
 			</if>
 		</where>
 	</sql>
@@ -73,8 +73,37 @@
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM student
-		LEFT JOIN sys_user su ON su.id_=stu.user_id_
+		SELECT COUNT(*) FROM student stu
+		LEFT JOIN sys_user su ON su.id_ = stu.user_id_
 		<include refid="queryCondition"/>
 	</select>
+	<resultMap id="queryApplyListMap" type="com.keao.edu.user.dto.StudentExamPaymentDto">
+		<association property="examRegistration" resultMap="com.keao.edu.user.dao.ExamRegistrationDao.ExamRegistration"/>
+		<association property="studentExamResult" resultMap="com.keao.edu.user.dao.StudentExamResultDao.StudentExamResult"/>
+		<association property="examRegistrationPayment" resultMap="com.keao.edu.user.dao.ExamRegistrationPaymentDao.ExamRegistrationPayment"/>
+	</resultMap>
+    <select id="queryApplyList" resultMap="queryApplyListMap">
+		SELECT * FROM exam_registration er
+		LEFT JOIN exam_registration_payment erp ON er.id_ = erp.exam_registration_id_
+		LEFT JOIN student_exam_result ser ON ser.examination_basic_id_ = er.examination_basic_id_
+		<include refid="queryApplyListSql"/>
+		<include refid="global.limit"/>
+	</select>
+	<select id="countApplyList" resultType="java.lang.Integer">
+		SELECT COUNT(er.id_) FROM exam_registration er
+		LEFT JOIN exam_registration_payment erp ON er.id_ = erp.exam_registration_id_
+		LEFT JOIN student_exam_result ser ON ser.examination_basic_id_ = er.examination_basic_id_
+		<include refid="queryApplyListSql"/>
+	</select>
+	<sql id="queryApplyListSql">
+		<where>
+			er.student_id_ = erp.student_id_ AND er.student_id_ = ser.student_id_ AND erp.trans_status_ = 'SUCCESS'
+			<if test="studentId != null">
+				AND er.student_id_ = #{studentId}
+			</if>
+			<if test="tenantId != null">
+				AND er.tenant_id_ = #{tenantId}
+			</if>
+		</where>
+	</sql>
 </mapper>

+ 6 - 2
edu-user/edu-user-server/src/main/resources/config/mybatis/SysConfigMapper.xml

@@ -8,6 +8,7 @@
 		<result column="param_name_" property="paramName" />
 		<result column="paran_value_" property="paranValue" />
 		<result column="description_" property="description" />
+		<result column="annotation_" property="annotation" />
 		<result column="create_on_" property="createOn" />
 		<result column="modify_on_" property="modifyOn" />
 		<result column="group_" property="group" />
@@ -34,8 +35,8 @@
 		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
 			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO sys_config
-		(id_,param_name_,paran_value_,description_,create_on_,modify_on_,group_,tenant_id_)
-		VALUES(#{id},#{paramName},#{paranValue},#{description},#{createOn},#{modifyOn},#{group},#{tenantId})
+		(id_,param_name_,paran_value_,description_,create_on_,modify_on_,group_,tenant_id_,annotation_)
+		VALUES(#{id},#{paramName},#{paranValue},#{description},#{createOn},#{modifyOn},#{group},#{tenantId},#{annotation})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -51,6 +52,9 @@
 			<if test="description != null">
 				description_ = #{description},
 			</if>
+			<if test="annotation != null">
+				annotation_ = #{annotation},
+			</if>
 			<if test="paramName != null">
 				param_name_ = #{paramName},
 			</if>