Pārlūkot izejas kodu

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

zouxuan 4 gadi atpakaļ
vecāks
revīzija
11a6eb3ca1

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RegisterDto.java

@@ -68,6 +68,10 @@ public class RegisterDto {
 
     private Date minPayTime;
 
+    private Integer perRegSort;
+
+    private Integer paySort;
+
     public Integer getUserId() {
         return userId;
     }
@@ -211,4 +215,20 @@ public class RegisterDto {
     public void setMinPayTime(Date minPayTime) {
         this.minPayTime = minPayTime;
     }
+
+    public Integer getPerRegSort() {
+        return perRegSort;
+    }
+
+    public void setPerRegSort(Integer perRegSort) {
+        this.perRegSort = perRegSort;
+    }
+
+    public Integer getPaySort() {
+        return paySort;
+    }
+
+    public void setPaySort(Integer paySort) {
+        this.paySort = paySort;
+    }
 }

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -196,7 +196,8 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         List<String> orderNoList = new ArrayList<String>();
 
         for (StudentPaymentOrder payingOrder : payingOrders) {
-            if (payingOrder.getTransNo() == null && "205".equals(payingOrder.getPaymentAccountNo()) && DateUtil.isSameDay(payingOrder.getCreateTime(), new Date())) {
+            //if (payingOrder.getTransNo() == null && "205".equals(payingOrder.getPaymentAccountNo()) && DateUtil.isSameDay(payingOrder.getCreateTime(), new Date())) {
+            if (payingOrder.getTransNo() == null && "205".equals(payingOrder.getPaymentAccountNo())) {
                 continue;
             }
             if (payingOrder.getTransNo() == null) {

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -1387,6 +1387,9 @@
         <if test="orderByPerRegister == null and orderByPayTime != null">
             ORDER BY o.payTime ${orderByPayTime},u.user_id_ ASC
         </if>
+        <if test="orderByPerRegister == null and orderByPayTime == null">
+            ORDER BY spr.create_time_ ASC,u.user_id_ ASC
+        </if>
         <include refid="global.limit"/>
     </select>
 

+ 17 - 7
mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java

@@ -17,11 +17,7 @@ import io.swagger.annotations.ApiOperation;
 
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 import javax.servlet.http.HttpServletResponse;
@@ -383,11 +379,25 @@ public class StudentRegistrationController extends BaseController {
             throw new BizException("没有可导出的记录");
         }
 
+        List<RegisterDto> hasSoredPreRegs = registerOrPreList.getRows().stream().filter(e -> e.getPerRegisterTime() != null).sorted(Comparator.comparing(RegisterDto::getPerRegisterTime)).collect(Collectors.toList());
+        int i = 1;
+        for (RegisterDto hasSoredPreReg : hasSoredPreRegs) {
+            hasSoredPreReg.setPerRegSort(i);
+            i++;
+        }
+
+        i = 1;
+        List<RegisterDto> pays = registerOrPreList.getRows().stream().filter(e -> e.getPayTime() != null).sorted(Comparator.comparing(RegisterDto::getPayTime)).collect(Collectors.toList());
+        for (RegisterDto pay : pays) {
+            pay.setPaySort(i);
+            i++;
+        }
+
         OutputStream outputStream = response.getOutputStream();
         HSSFWorkbook workbook = null;
         try {
-            String[] header = {"学员编号","学员姓名", "声部", "预报名时间","预报名时间差", "缴费时间", "缴费时间差"};
-            String[] body = {"userId","studentName", "actualSubjectName", "perRegisterTime","perRegIntervalStr","payTime", "payIntervalStr"};
+            String[] header = {"学员编号", "学员姓名", "声部", "预报名时间", "预报名时间差","预报名排名", "缴费时间", "缴费时间差","缴费排名"};
+            String[] body = {"userId", "studentName", "actualSubjectName", "perRegisterTime", "perRegIntervalStr","perRegSort", "payTime", "payIntervalStr","paySort"};
             workbook = POIUtil.exportExcel(header, body, registerOrPreList.getRows());
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=registerOrPer-" + DateUtil.getDate(new Date()) + ".xls");