Browse Source

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

yonge 5 years ago
parent
commit
2824b19a43

+ 16 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
+import com.ym.mec.biz.dal.dto.SporadicChargeInfoDto;
 import com.ym.mec.biz.dal.dto.UserGoodsDto;
 import com.ym.mec.biz.dal.dto.StudentPaymentOrderExportDto;
 import com.ym.mec.biz.dal.entity.Goods;
@@ -7,6 +8,7 @@ import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
+import com.ym.mec.biz.dal.page.SporadicOrderQueryInfo;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
@@ -181,4 +183,18 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
      * @return
      */
     List<StudentPaymentOrderExportDto> ExportQueryPage(Map<String, Object> params);
+
+    /**
+     * 获取零星收费订单列表
+     * @param queryInfo
+     * @return
+     */
+    List<SporadicChargeInfoDto> sporadicQueryPage( Map<String, Object> queryInfo);
+
+    /**
+     * COUNT零星收费订单列表
+     * @param params
+     * @return
+     */
+    int countSporadicPage(Map<String, Object> params);
 }

+ 86 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SporadicChargeInfoDto.java

@@ -0,0 +1,86 @@
+package com.ym.mec.biz.dal.dto;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class SporadicChargeInfoDto{
+    private String organName;
+
+    private String title;
+
+    private String type;
+
+    private BigDecimal amount;
+
+    private Date createTime;
+
+    private Date payTime;
+
+    private String username;
+
+    private String payStatus;
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public BigDecimal getAmount() {
+        return amount;
+    }
+
+    public void setAmount(BigDecimal amount) {
+        this.amount = amount;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getPayTime() {
+        return payTime;
+    }
+
+    public void setPayTime(Date payTime) {
+        this.payTime = payTime;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPayStatus() {
+        return payStatus;
+    }
+
+    public void setPayStatus(String payStatus) {
+        this.payStatus = payStatus;
+    }
+}

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherAttendanceDto.java

@@ -83,6 +83,27 @@ public class TeacherAttendanceDto {
     @ApiModelProperty(value = "学生数量")
     private Integer studentNum;
 
+    @ApiModelProperty(value = "是否是第一次进行学生点名")
+    private int studentAttendanceIsFirstTime;
+
+    private Integer enableStudentAttendanceTimeRange;
+
+    public int getStudentAttendanceIsFirstTime() {
+        return studentAttendanceIsFirstTime;
+    }
+
+    public void setStudentAttendanceIsFirstTime(int studentAttendanceIsFirstTime) {
+        this.studentAttendanceIsFirstTime = studentAttendanceIsFirstTime;
+    }
+
+    public Integer getEnableStudentAttendanceTimeRange() {
+        return enableStudentAttendanceTimeRange;
+    }
+
+    public void setEnableStudentAttendanceTimeRange(Integer enableStudentAttendanceTimeRange) {
+        this.enableStudentAttendanceTimeRange = enableStudentAttendanceTimeRange;
+    }
+
     public Integer getStudentNum() {
         return studentNum;
     }

+ 37 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/SporadicOrderQueryInfo.java

@@ -0,0 +1,37 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+public class SporadicOrderQueryInfo extends QueryInfo {
+
+    private String organId;
+
+    private Integer chargeType;
+
+    private String payStatus;
+
+    public String getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(String organId) {
+        this.organId = organId;
+    }
+
+    public Integer getChargeType() {
+        return chargeType;
+    }
+
+    public void setChargeType(Integer chargeType) {
+        this.chargeType = chargeType;
+    }
+
+    public String getPayStatus() {
+        return payStatus;
+    }
+
+    public void setPayStatus(String payStatus) {
+        this.payStatus = payStatus;
+    }
+}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderService.java

@@ -4,12 +4,15 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
+import com.ym.mec.biz.dal.dto.SporadicChargeInfoDto;
 import com.ym.mec.biz.dal.dto.StudentPaymentOrderExportDto;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
+import com.ym.mec.biz.dal.page.SporadicOrderQueryInfo;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
+import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
 public interface StudentPaymentOrderService extends BaseService<Long, StudentPaymentOrder> {
@@ -79,4 +82,11 @@ public interface StudentPaymentOrderService extends BaseService<Long, StudentPay
 
 
 	List<StudentPaymentOrderExportDto> ExportQueryPage(Map<String, Object> params);
+
+	/**
+	 * 获取零星收费订单列表
+	 * @param queryInfo
+	 * @return
+	 */
+	PageInfo<SporadicChargeInfoDto> sporadicQueryPage(SporadicOrderQueryInfo queryInfo);
 }

+ 26 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -119,6 +119,14 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				currentCourseDetail.getSchoolId().intValue());
 		currentCourseDetail.setOnlyNormal(yesOrNoEnum);
 		currentCourseDetail.setCurrentClassTimes(courseScheduleDao.countClassGroupOverCourseNum(currentCourseDetail.getClassId()));
+		SysConfig sysConfig = sysConfigService.findByParamName(SysConfigService.ENABLE_STUDENT_ATTENDANCE_TIME_RANGE);
+		currentCourseDetail.setEnableStudentAttendanceTimeRange(sysConfig.getParanValue(Integer.class));
+		int studentNum = studentAttendanceDao.countByCourseSchedule(courseID);
+		if(Objects.nonNull(studentNum)){
+			currentCourseDetail.setStudentAttendanceIsFirstTime(studentNum>0?0:1);
+		}else{
+			currentCourseDetail.setStudentAttendanceIsFirstTime(1);
+		}
 
 		currentCourseDetail.setCurrentTime(new Date());
 		currentCourseDetail.setAdvanceSignInMinutes(Integer.parseInt(sysConfigDao.findConfigValue(SysConfigService.ADVANCE_SIGN_IN_MINUTES)));
@@ -382,12 +390,12 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			studentNumCourseMap=MapUtil.convertIntegerMap(studentNumCourseMaps);
 		}
 		for (CourseScheduleDto courseScheduleDto : teacherCourseSchedulesWithDate) {
-//			Long studentNum=studentNumCourseMap.get(courseScheduleDto.getId());
-//			if(Objects.nonNull(studentNum)){
-//				courseScheduleDto.setStudentAttendanceIsFirstTime(studentNum>0?0:1);
-//			}else{
-//				courseScheduleDto.setStudentAttendanceIsFirstTime(1);
-//			}
+			Long studentNum=studentNumCourseMap.get(courseScheduleDto.getId());
+			if(Objects.nonNull(studentNum)){
+				courseScheduleDto.setStudentAttendanceIsFirstTime(studentNum>0?0:1);
+			}else{
+				courseScheduleDto.setStudentAttendanceIsFirstTime(1);
+			}
 
 			if(now.before(courseScheduleDto.getStartClassTime())){
 				courseScheduleDto.setStatus(CourseStatusEnum.NOT_START);
@@ -1038,6 +1046,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 						courseSchedules.get(courseStartDates.size()-1).setTeachMode(vipGroupCourseAdjustInfo.getTeachMode());
 						if(vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE)){
 							courseSchedules.get(courseStartDates.size()-1).setSchoolId(vipGroupCourseAdjustInfo.getSchoolId());
+						}else{
+							courseSchedules.get(courseStartDates.size()-1).setSchoolId(null);
 						}
 					}
 				}
@@ -1324,10 +1334,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 					throw new BizException("请设置教学点");
 				}
 
-				if(Objects.nonNull(newCourseSchedule.getTeachMode())){
-					oldCourseSchedule.setTeachMode(newCourseSchedule.getTeachMode());
-				}
-
 				if(schoolIsChange){
 					oldCourseSchedule.setSchoolId(newCourseSchedule.getSchoolId());
 				}
@@ -1404,6 +1410,14 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			if(Objects.nonNull(newCourseSchedule.getSchoolId())){
 				oldCourseSchedule.setSchoolId(newCourseSchedule.getSchoolId());
 			}
+
+			if(Objects.nonNull(newCourseSchedule.getTeachMode())){
+				oldCourseSchedule.setTeachMode(newCourseSchedule.getTeachMode());
+				if(newCourseSchedule.getTeachMode().equals(TeachModeEnum.ONLINE)){
+					oldCourseSchedule.setSchoolId(null);
+				}
+			}
+
 			oldCourseSchedule.setActualTeacherId(newCourseSchedule.getActualTeacherId());
 			courseScheduleDao.update(oldCourseSchedule);
 			//删除被修改的教师课酬记录和考勤记录
@@ -2038,4 +2052,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		}
 		return courseSchedules;
 	}
+
+
 }

+ 24 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -10,9 +10,13 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dto.SporadicChargeInfoDto;
 import com.ym.mec.biz.dal.dto.StudentPaymentOrderExportDto;
+import com.ym.mec.biz.dal.page.SporadicOrderQueryInfo;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
 import com.ym.mec.biz.service.*;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.util.collection.MapUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -234,4 +238,24 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
     public List<StudentPaymentOrderExportDto> ExportQueryPage(Map<String, Object> params) {
         return studentPaymentOrderDao.ExportQueryPage(params);
     }
+
+    @Override
+    public PageInfo<SporadicChargeInfoDto> sporadicQueryPage(SporadicOrderQueryInfo queryInfo) {
+        PageInfo<SporadicChargeInfoDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+        Map<String, Object> params = new HashMap<>();
+        MapUtil.populateMap(params, queryInfo);
+
+        List<SporadicChargeInfoDto> dataList = null;
+        int count = studentPaymentOrderDao.countSporadicPage(params);
+        if (count > 0) {
+            pageInfo.setTotal(count);
+            params.put("offset", pageInfo.getOffset());
+            dataList = studentPaymentOrderDao.sporadicQueryPage(params);
+        }
+        if (count == 0) {
+            dataList = new ArrayList<>();
+        }
+        pageInfo.setRows(dataList);
+        return pageInfo;
+    }
 }

+ 8 - 2
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -195,6 +195,9 @@
             <if test="schoolId != null">
                 schoole_id_ = #{schoolId},
             </if>
+            <if test="schoolId == null">
+                schoole_id_ = null,
+            </if>
             <if test="teachMode != null">
                 teach_mode_ = #{teachMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
@@ -565,7 +568,7 @@
             (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
             AND cs.class_date_ = DATE_FORMAT(#{classDate},'%Y%m%d')
             AND csts.user_id_ = #{teacherId} AND cg.del_flag_ = 0
-            AND CONCAT( cs.class_date_, ' ', cs.start_class_time_ )&lt;NOW()
+            AND CONCAT( cs.class_date_, ' ', cs.end_class_time_ )&lt;NOW()
         ORDER BY start_class_time_
     </select>
 
@@ -1026,6 +1029,9 @@
                 <if test="item.schoolId != null">
                     schoole_id_ = #{item.schoolId},
                 </if>
+                <if test="item.schoolId == null">
+                    schoole_id_ = null,
+                </if>
                 <if test="item.teachMode != null">
                     teach_mode_ = #{item.teachMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
                 </if>
@@ -1649,7 +1655,7 @@
         LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
         LEFT JOIN class_group cg ON cg.id_=cs.class_group_id_
         LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND cssp.user_id_ = sa.user_id_
-        WHERE CONCAT(cs.class_date_,' ',cs.end_class_time_) &lt;= now() AND sa.id_ IS NULL
+        WHERE CONCAT(cs.class_date_,' ',cs.end_class_time_) &lt;= DATE_ADD(NOW(),INTERVAL -1 HOUR) AND sa.id_ IS NULL
     </select>
     <select id="getNextCourseSchedule" resultMap="CourseSchedule">
         SELECT

+ 44 - 0
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -428,4 +428,48 @@
         <include refid="queryPaymentOrder"/>
         ORDER BY spo.id_ ASC
     </select>
+    <resultMap id="SporadicChargeInfoDtoMap" type="com.ym.mec.biz.dal.dto.SporadicChargeInfoDto">
+        <result property="organName" column="organ_name_"/>
+        <result property="title" column="title_"/>
+        <result property="type" column="type_"/>
+        <result property="amount" column="amount_"/>
+        <result property="createTime" column="create_time_"/>
+        <result property="payTime" column="pay_time_"/>
+        <result property="username" column="username_"/>
+        <result property="payStatus" column="pay_status_"/>
+    </resultMap>
+    <select id="sporadicQueryPage" resultMap="SporadicChargeInfoDtoMap">
+        SELECT o.name_ organ_name_,sci.title_,sci.charge_type_ type_,
+        spo.actual_amount_ amount_,spo.create_time_,spo.pay_time_,su.username_,spo.status_ pay_status_
+        FROM student_payment_order spo
+        LEFT JOIN sys_user su ON spo.user_id_ = su.id_
+        LEFT JOIN organization o ON o.id_ = spo.organ_id_
+        LEFT JOIN sporadic_charge_info sci ON sci.id_ = spo.music_group_id_
+        WHERE spo.type_ = 'SPORADIC'
+        <include refid="sporadicQueryPageSql"/>
+        ORDER BY spo.id_ DESC
+        <include refid="global.limit"/>
+    </select>
+    <select id="countSporadicPage" resultType="java.lang.Integer">
+        SELECT COUNT(spo.id_)
+        FROM student_payment_order spo
+        LEFT JOIN sys_user su ON spo.user_id_ = su.id_
+        LEFT JOIN sporadic_charge_info sci ON sci.id_ = spo.music_group_id_
+        WHERE spo.type_ = 'SPORADIC'
+        <include refid="sporadicQueryPageSql"/>
+    </select>
+    <sql id="sporadicQueryPageSql">
+        <if test="organId != null">
+            AND FIND_IN_SET(spo.organ_id_,#{organId})
+        </if>
+        <if test="search != null">
+            AND (sci.title_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%'))
+        </if>
+        <if test="chargeType != null">
+            AND sci.charge_type_ = #{chargeType}
+        </if>
+        <if test="payStatus != null">
+            AND spo.status_ = #{payStatus}
+        </if>
+    </sql>
 </mapper>

+ 25 - 19
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -9,6 +9,7 @@ import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.biz.dal.page.CourseScheduleTeacherSalaryQueryInfo;
 import com.ym.mec.biz.dal.page.MusicGroupStudentQueryInfo;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
@@ -193,9 +194,9 @@ public class ExportController extends BaseController {
                 for (StudentPaymentOrderDetail orderDetail : row.getOrderDetailList()) {
                     if (orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL)) {
                         musicalFee = musicalFee.add(orderDetail.getPrice());
-                    }else if(orderDetail.getType().equals(OrderDetailTypeEnum.COURSE)){
+                    } else if (orderDetail.getType().equals(OrderDetailTypeEnum.COURSE)) {
                         courseFee = courseFee.add(orderDetail.getPrice());
-                    }else if (orderDetail.getType().equals(OrderDetailTypeEnum.ACCESSORIES) || orderDetail.getType().equals(OrderDetailTypeEnum.TEACHING) || orderDetail.getType().equals(OrderDetailTypeEnum.OTHER)) {
+                    } else if (orderDetail.getType().equals(OrderDetailTypeEnum.ACCESSORIES) || orderDetail.getType().equals(OrderDetailTypeEnum.TEACHING) || orderDetail.getType().equals(OrderDetailTypeEnum.OTHER)) {
                         teachingFee = teachingFee.add(orderDetail.getPrice());
                     }
                 }
@@ -209,12 +210,13 @@ public class ExportController extends BaseController {
                 if (studentRegistration != null) {
                     row.setSubjectName(studentRegistration.getSubjectName());
                     row.setSchoolName(studentRegistration.getSchoolName());
-                    if (studentRegistration.getKitType() != null && studentRegistration.getKitType().equals("LEASE")) {
+                    if (row.getType().equals(OrderTypeEnum.APPLY) && studentRegistration.getKitType() != null && studentRegistration.getKitType().equals("LEASE")) {
                         row.setLeaseFee(studentRegistration.getDepositFee());
                         row.setMusicalFee(BigDecimal.ZERO);
                     }
                 }
             } else if (row.getGroupType().equals(GroupType.VIP)) {
+                row.setCourseFee(row.getActualAmount());
                 VipGroup vipGroupInfo = vipGroupDao.findVipGroupInfo(Integer.parseInt(row.getMusicGroupId()), row.getClassGroupId());
                 if (vipGroupInfo != null) {
                     row.setSchoolName(vipGroupInfo.getSchoolName());
@@ -254,9 +256,9 @@ public class ExportController extends BaseController {
 
         try {
             String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "支付金额", "到账时间",
-                    "关联乐团ID/VIP课ID", "课程形态","课程费用", "押金", "乐器", "教辅费用", "零星收款费用", "零星收款类别", "手续费", "专业", "分部", "单位/学校", "备注"};
+                    "关联乐团ID/VIP课ID", "课程形态", "课程费用", "押金", "乐器", "教辅费用", "零星收款费用", "零星收款类别", "手续费", "专业", "分部", "单位/学校", "备注"};
             String[] body = {"id", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "actualAmount", "payTime", "musicGroupId",
-                    "groupType.desc", "courseFee","leaseFee", "musicalFee", "teachingFee", "sporadicAmount", "sporadicType", "transferFee", "subjectName", "organName", "schoolName", "memo"};
+                    "groupType.desc", "courseFee", "leaseFee", "musicalFee", "teachingFee", "sporadicAmount", "sporadicType", "transferFee", "subjectName", "organName", "schoolName", "memo"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
@@ -282,16 +284,18 @@ public class ExportController extends BaseController {
                 } else {
                     row.setGender("女");
                 }
-                if (row.getPaymentStatus().equals("PAID_COMPLETED")) {
-                    row.setPaymentStatus("完成缴费");
-                } else if (row.getPaymentStatus().equals("NON_PAYMENT")) {
-                    row.setPaymentStatus("未缴费");
-                } else if (row.getPaymentStatus().equals("PROCESSING")) {
-                    row.setPaymentStatus("缴费中");
+                if (row.getPaymentStatus() != null) {
+                    if (row.getPaymentStatus().equals("PAID_COMPLETED")) {
+                        row.setPaymentStatus("完成缴费");
+                    } else if (row.getPaymentStatus().equals("NON_PAYMENT")) {
+                        row.setPaymentStatus("未缴费");
+                    } else if (row.getPaymentStatus().equals("PROCESSING")) {
+                        row.setPaymentStatus("缴费中");
+                    }
                 }
-                if(row.getStudentStatus().equals("NORMAL")){
+                if (row.getStudentStatus().equals("NORMAL")) {
                     row.setStudentStatus("在读");
-                }else {
+                } else {
                     row.setStudentStatus("退团");
                 }
                 if (row.getIsActive()) {
@@ -299,18 +303,20 @@ public class ExportController extends BaseController {
                 } else {
                     row.setActiveName("否");
                 }
-                if(row.getIsNewStudent().equals(1)){
+                if (row.getIsNewStudent().equals(1)) {
                     row.setIsNewStudentStr("是");
-                }else {
+                } else {
                     row.setIsNewStudentStr("否");
                 }
-                row.setNextPaymentDateStr(DateUtil.format(row.getNextPaymentDate(), DateUtil.DEFAULT_PATTERN));
+                if (row.getNextPaymentDate() != null) {
+                    row.setNextPaymentDateStr(DateUtil.format(row.getNextPaymentDate(), DateUtil.DEFAULT_PATTERN));
+                }
                 row.setCurrentGrade(row.getCurrentGrade() + row.getCurrentClass());
             }
-            String[] header = {"学员编号","学员姓名", "性别", "联系电话", "年级班级", "专业", "学员状态", "新增学员", "缴费金额",
+            String[] header = {"学员编号", "学员姓名", "性别", "联系电话", "年级班级", "专业", "学员状态", "新增学员", "缴费金额",
                     "下次缴费日期", "报名缴费", "是否激活"};
-            String[] body = {"userId","realName", "gender", "phone", "currentGrade", "subjectName", "studentStatus", "isNewStudentStr",
-                    "courseFee", "nextPaymentDateStr","paymentStatus", "activeName"};
+            String[] body = {"userId", "realName", "gender", "phone", "currentGrade", "subjectName", "studentStatus", "isNewStudentStr",
+                    "courseFee", "nextPaymentDateStr", "paymentStatus", "activeName"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, musicGroupStudentsDtoPageInfo.getRows());
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");

+ 25 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentOrderController.java

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
+import com.ym.mec.biz.dal.page.SporadicOrderQueryInfo;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
 import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
 import com.ym.mec.biz.service.StudentPaymentOrderService;
@@ -81,6 +82,30 @@ public class StudentPaymentOrderController extends BaseController {
         return succeed(studentPaymentOrderPageInfo);
     }
 
+    @ApiOperation(value = "获取零星收费订单列表")
+    @GetMapping("/sporadicQueryPage")
+    @PreAuthorize("@pcs.hasPermissions('order/sporadicQueryPage')")
+    public Object sporadicQueryPage(SporadicOrderQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        if (!sysUser.getIsSuperAdmin()) {
+            Employee employee = employeeDao.get(sysUser.getId());
+            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+                queryInfo.setOrganId(employee.getOrganIdList());
+            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
+                return failed("用户所在分部异常");
+            } else {
+                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
+                    return failed("非法请求");
+                }
+            }
+        }
+        return succeed(studentPaymentOrderService.sporadicQueryPage(queryInfo));
+    }
+
     @ApiOperation(value = "获取订单列表1")
     @GetMapping("/queryPage1")
     @PreAuthorize("@pcs.hasPermissions('order/queryPage1')")