Browse Source

Merge remote-tracking branch 'origin/master_saas' into master_saas

liweifan 3 years ago
parent
commit
6269f49c77

+ 12 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentManageListDto.java

@@ -21,6 +21,9 @@ public class StudentManageListDto {
     @ApiModelProperty(value = "用户名",required = false)
     private String realName;
 
+    @ApiModelProperty(value = "用户头像",required = false)
+    private String avatar;
+
     @ApiModelProperty(value = "用户名",required = false)
     private String username;
 
@@ -121,7 +124,15 @@ public class StudentManageListDto {
     private Integer recordUserId;
 	
 	private String extSubjectIds;
-	
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
     public Integer getRecordUserId() {
         return recordUserId;
     }

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentService.java

@@ -16,6 +16,7 @@ import com.ym.mec.biz.dal.enums.GradeTypeEnum;
 import com.ym.mec.biz.dal.enums.PeriodEnum;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 
 public interface StudentService extends BaseService<Integer, Student> {
@@ -167,4 +168,11 @@ public interface StudentService extends BaseService<Integer, Student> {
     <T extends BaseStudentDto> SysUser upSetStudent(T student);
 
     PageInfo<SysUserDto> queryStudentBasicInfo(UserBasicQueryInfo queryInfo);
+
+    /**
+     * 获取和当前指导老师关联的学员
+     *
+     * @return
+     */
+    PageInfo<BasicUserDto> queryStudent(QueryInfo queryInfo);
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java

@@ -50,6 +50,7 @@ import java.util.function.Function;
 import java.util.stream.Collectors;
 
 import static com.ym.mec.biz.dal.enums.OrderTypeEnum.OUTORDER;
+import static com.ym.mec.biz.dal.enums.OrderTypeEnum.SPORADIC;
 import static com.ym.mec.common.controller.BaseController.succeed;
 
 @Service
@@ -2390,6 +2391,14 @@ public class ExportServiceImpl implements ExportService {
             if(basicOrder.getRouteAmount().compareTo(BigDecimal.ZERO) == 0){
                 continue;
             }
+            //如果是零星收费的账户充值,不管销售还是服务,统一放在其他收费项目中
+            if(basicOrder.getType() == OrderTypeEnum.SPORADIC
+                    && basicOrder.getGroupType() == GroupType.SPORADIC
+                    && basicOrder.getServiceAmount().compareTo(BigDecimal.ZERO) == 0
+                    && basicOrder.getSaleAmount().compareTo(BigDecimal.ZERO) == 0){
+                basicOrder.setOtherFee(basicOrder.getRouteAmount());
+                continue;
+            }
             //如果有订单详情
             List<StudentPaymentOrderDetail> detailList = orderDetailMap.get(basicOrder.getId());
             if (!CollectionUtils.isEmpty(detailList)) {

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java

@@ -24,6 +24,7 @@ import javax.annotation.PostConstruct;
 
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.page.*;
+import com.ym.mec.common.page.QueryInfo;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -1358,6 +1359,26 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         return pageInfo;
     }
 
+    @Override
+    public PageInfo<BasicUserDto> queryStudent(QueryInfo queryInfo) {
+        PageInfo<BasicUserDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+        Map<String, Object> params = new HashMap<>();
+        MapUtil.populateMap(params, queryInfo);
+
+        List<BasicUserDto> dataList = null;
+        int count = teacherDao.countStudent(params);
+        if (count > 0) {
+            pageInfo.setTotal(count);
+            params.put("offset", pageInfo.getOffset());
+            dataList = teacherDao.queryStudent(params);
+        }
+        if (count == 0) {
+            dataList = new ArrayList<>();
+        }
+        pageInfo.setRows(dataList);
+        return pageInfo;
+    }
+
     @Transactional(rollbackFor = Exception.class)
     public  <T extends BaseStudentDto> void insertStudent(T baseStudent){
         Student student = new Student();

+ 2 - 1
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -38,6 +38,7 @@
     <resultMap id="studentManageListDto" type="com.ym.mec.biz.dal.dto.StudentManageListDto">
         <result property="userId" column="user_id_"/>
         <result property="realName" column="real_name_"/>
+        <result property="avatar" column="avatar_"/>
         <result property="nation" column="nation_"/>
         <result property="parentsPhone" column="parents_phone_"/>
         <result property="parentsName" column="real_name_"/>
@@ -147,7 +148,7 @@
 
     <select id="findStudentsByOrganId" resultMap="studentManageListDto">
         SELECT o.`name_` organ_name_,o.grade_type_,s.`user_id_` ,su.`username_` ,su.`phone_` parents_phone_,s.ext_subject_ids_,
-        sut.name_ real_name_,su.`gender_` , su.organ_id_,
+        sut.name_ real_name_,su.`gender_` , su.organ_id_,su.avatar_,
 		tu.`real_name_` teacher_name_,CASE s.service_tag_ WHEN 2 THEN 0 ELSE s.service_tag_ END service_tag_ ,s.`operating_tag_` ,
         s.care_package_, s.come_on_package_, suca.`course_balance_` ,suca.balance_,
 		sub.`name_` music_group_subject_ ,su.birthdate_,s.subject_id_list_,s.teacher_id_,s.current_grade_num_,s.current_class_,s.member_rank_setting_id_,

+ 8 - 12
mec-student/src/main/java/com/ym/mec/student/controller/StudentController.java

@@ -1,12 +1,13 @@
 package com.ym.mec.student.controller;
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.Student;
+import com.ym.mec.biz.dal.entity.StudentPreRegistration;
+import com.ym.mec.biz.service.StudentService;
+import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-
-import java.util.Date;
-
-import javax.annotation.Resource;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -14,12 +15,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.entity.Student;
-import com.ym.mec.biz.dal.entity.StudentPreRegistration;
-import com.ym.mec.biz.service.StudentService;
-import com.ym.mec.common.controller.BaseController;
+import javax.annotation.Resource;
+import java.util.Date;
 
 @RequestMapping("student")
 @Api(tags = "学生服务")
@@ -60,5 +57,4 @@ public class StudentController extends BaseController {
 		}
 		return succeed();
 	}
-
 }

+ 18 - 3
mec-teacher/src/main/java/com/ym/mec/teacher/controller/StudentController.java

@@ -1,15 +1,17 @@
 package com.ym.mec.teacher.controller;
 
+import com.ym.mec.biz.dal.page.StudentManageQueryInfo;
+import com.ym.mec.biz.service.StudentManageService;
 import com.ym.mec.biz.service.SysUserCashAccountService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
 import java.util.Optional;
 
 @Api(tags = "学生管理")
@@ -19,6 +21,10 @@ public class StudentController extends BaseController {
 
     @Autowired
     private SysUserCashAccountService sysUserCashAccountService;
+    @Resource
+    private SysUserService sysUserService;
+    @Autowired
+    private StudentManageService studentManageService;
 
     @ApiOperation(value = "获取学员账户信息")
     @GetMapping("/userCashAccount/get")
@@ -27,4 +33,13 @@ public class StudentController extends BaseController {
         return succeed(sysUserCashAccountService.get(id));
     }
 
+
+    @ApiOperation(value = "获取学生列表")
+    @PostMapping("/queryStudentList")
+    public Object queryStudentList(@RequestBody StudentManageQueryInfo queryInfo){
+        queryInfo.setTeacherId(sysUserService.getUserId());
+        queryInfo.setIsExport(false);
+        return succeed(studentManageService.findStudentsByOrganId(queryInfo));
+    }
+
 }

+ 3 - 6
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -16,10 +16,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.CollectionUtils;
-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;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.*;
 import java.util.stream.Collectors;
@@ -58,9 +55,9 @@ public class StudentManageController extends BaseController {
     }
 
     @ApiOperation(value = "获取学生列表")
-    @GetMapping("/queryStudentList")
+    @PostMapping("/queryStudentList")
     @PreAuthorize("@pcs.hasPermissions('studentManage/queryStudentList')")
-    public Object queryStudentList(StudentManageQueryInfo queryInfo){
+    public Object queryStudentList(@RequestBody StudentManageQueryInfo queryInfo){
         queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setIsExport(false);
         return succeed(studentManageService.findStudentsByOrganId(queryInfo));

+ 14 - 6
mec-web/src/main/java/com/ym/mec/web/controller/education/EduStudentStudentController.java

@@ -8,8 +8,7 @@ import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.Teacher;
 import com.ym.mec.biz.dal.page.StudentManageQueryInfo;
 import com.ym.mec.biz.dal.page.StudentQueryInfo;
-import com.ym.mec.biz.service.StudentManageService;
-import com.ym.mec.biz.service.TeacherService;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiOperation;
 
@@ -19,11 +18,10 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
-import com.ym.mec.biz.service.StudentAttendanceService;
-import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
 
 import java.util.Arrays;
@@ -46,6 +44,8 @@ public class EduStudentStudentController extends BaseController {
     @Autowired
     private StudentManageService studentManageService;
     @Autowired
+    private OrganizationService organizationService;
+    @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
     private EmployeeDao employeeDao;
@@ -77,8 +77,8 @@ public class EduStudentStudentController extends BaseController {
     }
 
     @ApiOperation(value = "获取学生列表")
-    @GetMapping("eduStudentManage/queryStudentList")
-    public Object queryStudentList(StudentManageQueryInfo queryInfo){
+    @PostMapping("eduStudentManage/queryStudentList")
+    public Object queryStudentList(@RequestBody StudentManageQueryInfo queryInfo){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {
             return failed("用户信息获取失败");
@@ -111,4 +111,12 @@ public class EduStudentStudentController extends BaseController {
         return succeed(studentManageService.findStudentsByOrganId(queryInfo));
     }
 
+    @ApiOperation(value = "获取学生列表")
+    @PostMapping("eduStudentManage/queryStudentPage")
+    public Object queryStudentPage(@RequestBody StudentManageQueryInfo queryInfo){
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
+        queryInfo.setIsExport(false);
+        return succeed(studentManageService.findStudentsByOrganId(queryInfo));
+    }
+
 }