瀏覽代碼

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

yanite 3 年之前
父節點
當前提交
90a8e47c25

+ 13 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentPaymentOrderExportDto.java

@@ -32,8 +32,11 @@ public class StudentPaymentOrderExportDto extends StudentPaymentOrder {
     //维修费用
     private BigDecimal repairFee = BigDecimal.ZERO;
 
-    //手续费
+    //汇付手续费
     private BigDecimal transferFee = BigDecimal.ZERO;
+    
+    //平台手续费
+    private BigDecimal platformFee = BigDecimal.ZERO;
 
     //乐团课程费用
     private BigDecimal musicGroupCourseFee = BigDecimal.ZERO;
@@ -137,7 +140,15 @@ public class StudentPaymentOrderExportDto extends StudentPaymentOrder {
         this.transferFee = transferFee;
     }
 
-    public String getOrganName() {
+    public BigDecimal getPlatformFee() {
+		return platformFee;
+	}
+
+	public void setPlatformFee(BigDecimal platformFee) {
+		this.platformFee = platformFee;
+	}
+
+	public String getOrganName() {
         return organName;
     }
 

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/ExportService.java

@@ -14,7 +14,7 @@ public interface ExportService {
      * @param params
      * @throws Exception
      */
-    void orderList(Map<String, Object> params, ManagerDownload managerDownload) throws Exception;
+    void orderList(Map<String, Object> params, ManagerDownload managerDownload, boolean isPlatformUser) throws Exception;
 
 
     /**
@@ -23,7 +23,7 @@ public interface ExportService {
      * @param managerDownload
      * @throws Exception
      */
-    void routeOrderList(Map<String, Object> params, ManagerDownload managerDownload) throws Exception;
+    void routeOrderList(Map<String, Object> params, ManagerDownload managerDownload, boolean isPlatformUser) throws Exception;
 
     /**
      * 课表列表导出

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/TenantConfigService.java

@@ -9,4 +9,6 @@ public interface TenantConfigService extends IService<TenantConfig> {
     void addConfig(TenantConfigDto dto);
 
     void updateConfig(TenantConfigDto dto);
+    
+    TenantConfig queryByTenantId(Integer tenantId);
 }

+ 109 - 41
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java

@@ -1,39 +1,66 @@
 package com.ym.mec.biz.service.impl;
 
-import com.ym.mec.biz.dal.dao.*;
-import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.entity.*;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.system.ApplicationHome;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.CooperationOrganDao;
+import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
+import com.ym.mec.biz.dal.dao.ManagerDownloadDao;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
+import com.ym.mec.biz.dal.dao.PracticeGroupDao;
+import com.ym.mec.biz.dal.dao.ReplacementInstrumentActivityDao;
+import com.ym.mec.biz.dal.dao.SellOrderDao;
+import com.ym.mec.biz.dal.dao.StudentPaymentRouteOrderDao;
+import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
+import com.ym.mec.biz.dal.dao.VipGroupDao;
+import com.ym.mec.biz.dal.dto.BaseNameDto;
+import com.ym.mec.biz.dal.dto.CourseScheduleEndDto;
+import com.ym.mec.biz.dal.dto.FeeFlagNumDto;
+import com.ym.mec.biz.dal.dto.PracticeCourseDto;
+import com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityStatDto;
+import com.ym.mec.biz.dal.dto.StudentPaymentOrderExportDto;
+import com.ym.mec.biz.dal.dto.StudentVipPracticeExportDto;
+import com.ym.mec.biz.dal.entity.CooperationOrgan;
+import com.ym.mec.biz.dal.entity.Goods;
+import com.ym.mec.biz.dal.entity.ManagerDownload;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
+import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.entity.TenantConfig;
+import com.ym.mec.biz.dal.entity.VipGroup;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
 import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
-import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.ExportService;
 import com.ym.mec.biz.service.StudentPaymentOrderService;
 import com.ym.mec.biz.service.StudentService;
-import com.ym.mec.common.exception.BizException;
+import com.ym.mec.biz.service.TenantConfigService;
 import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.thirdparty.storage.StoragePluginContext;
 import com.ym.mec.thirdparty.storage.provider.KS3StoragePlugin;
-import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.excel.POIUtil;
 import com.ym.mec.util.upload.UploadUtil;
 
-import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.system.ApplicationHome;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-
-import java.io.*;
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.stream.Collectors;
-
 @Service
 public class ExportServiceImpl implements ExportService {
 
@@ -63,12 +90,15 @@ public class ExportServiceImpl implements ExportService {
     private CourseScheduleService courseScheduleService;
     @Autowired
     private StudentService studentService;
+
+	@Autowired
+	private TenantConfigService tenantConfigService;
     @Autowired
     private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
 
     @Override
     @Async
-    public void orderList(Map<String, Object> params, ManagerDownload managerDownload) throws Exception {
+    public void orderList(Map<String, Object> params, ManagerDownload managerDownload, boolean isPlatformUser) throws Exception {
         List<StudentPaymentOrderExportDto> studentPaymentOrderExportDtos = studentPaymentOrderService.ExportQueryPage(params);
         long i = 1;
         Map<Integer, String> cooperationOrganMap = new HashMap<>();
@@ -82,6 +112,11 @@ public class ExportServiceImpl implements ExportService {
             List<CooperationOrgan> cooperationOrgans = cooperationOrganDao.getCooperationOrganByIds(cooperationOrganIds);
             cooperationOrganMap = cooperationOrgans.stream().collect(Collectors.toMap(CooperationOrgan::getId, CooperationOrgan::getName));
         }
+        
+        //获取机构费率
+        Integer tenantId = (Integer) params.get("tenantId");
+        TenantConfig tenantConfig = tenantConfigService.queryByTenantId(tenantId);
+        
         for (StudentPaymentOrderExportDto row : studentPaymentOrderExportDtos) {
             if (row.getActualAmount() == null) {
                 row.setActualAmount(BigDecimal.ZERO);
@@ -97,6 +132,7 @@ public class ExportServiceImpl implements ExportService {
                 transferFee = row.getActualAmount().multiply(new BigDecimal("0.28")).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
             }
             row.setTransferFee(transferFee);
+            row.setPlatformFee(row.getActualAmount().multiply(tenantConfig.getChargeRate()).divide(new BigDecimal(1000), 2, BigDecimal.ROUND_HALF_UP));
 
             String goodsName = "";
             if (row.getOrderDetailList() != null) {
@@ -281,6 +317,7 @@ public class ExportServiceImpl implements ExportService {
                 } else if (row.getType().equals(OrderTypeEnum.OUTORDER)) {
                     row.setMusicGroupCourseFee(feeByType.getActualAmount().subtract(feeByType.getMusicalFee()).subtract(row.getTeachingFee()).subtract(row.getMaintenanceProductFee()).subtract(feeByType.getOtherFee()));
                     row.setTransferFee(BigDecimal.ZERO);
+                    row.setPlatformFee(BigDecimal.ZERO);
                 }
             }
             //如果合作单位不存在取学员的第一个乐团的合作单位,乐团主管
@@ -325,15 +362,29 @@ public class ExportServiceImpl implements ExportService {
 
         HSSFWorkbook workbook = null;
         try {
-            String[] header = {"序号", "学生编号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额", "现金支付", "余额支付", "优惠金额",
-                    "乐团课", "VIP课", "网管课", "乐理课", "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费",
-                    "账户充值", "其它", "手续费", "到账时间",
-                    "关联乐团ID/VIP课ID", "课程形态", "零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"};
-            String[] body = {"id", "userId", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "orderAmount", "expectAmount", "actualAmount", "balancePaymentAmount",  "couponRemitFee",
-                    "musicGroupCourseFee", "vipCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "maintenanceFee", "cloudTeacherFee",
-                    "leaseFee", "musicalFee", "teachingFee", "visitFee", "rechargeFee", "otherFee", "transferFee", "payTime", "musicGroupId",
-                    "groupType.desc", "sporadicType", "subjectName", "organName", "schoolName", "cooperationOrganName", "eduTeacher", "memo"};
-            workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);
+            if(isPlatformUser){
+                String[] header = {"序号", "学生编号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额", "现金支付", "余额支付", "优惠金额",
+                        "乐团课", "VIP课", "网管课", "乐理课", "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费",
+                        "账户充值", "其它", "汇付手续费","平台手续费", "到账时间",
+                        "关联乐团ID/VIP课ID", "课程形态", "零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"};
+                
+                String[] body = {"id", "userId", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "orderAmount", "expectAmount", "actualAmount", "balancePaymentAmount",  "couponRemitFee",
+                        "musicGroupCourseFee", "vipCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "maintenanceFee", "cloudTeacherFee",
+                        "leaseFee", "musicalFee", "teachingFee", "visitFee", "rechargeFee", "otherFee", "transferFee", "platformFee", "payTime", "musicGroupId",
+                        "groupType.desc", "sporadicType", "subjectName", "organName", "schoolName", "cooperationOrganName", "eduTeacher", "memo"};
+                workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);
+            }else{
+                String[] header = {"序号", "学生编号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额", "现金支付", "余额支付", "优惠金额",
+                        "乐团课", "VIP课", "网管课", "乐理课", "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费",
+                        "账户充值", "其它","平台手续费", "到账时间",
+                        "关联乐团ID/VIP课ID", "课程形态", "零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"};
+                
+                String[] body = {"id", "userId", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "orderAmount", "expectAmount", "actualAmount", "balancePaymentAmount",  "couponRemitFee",
+                        "musicGroupCourseFee", "vipCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "maintenanceFee", "cloudTeacherFee",
+                        "leaseFee", "musicalFee", "teachingFee", "visitFee", "rechargeFee", "otherFee", "platformFee", "payTime", "musicGroupId",
+                        "groupType.desc", "sporadicType", "subjectName", "organName", "schoolName", "cooperationOrganName", "eduTeacher", "memo"};
+                workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);
+            }
             workbook.write(fileOutputStream);
             fileOutputStream.getFD().sync();
             fileOutputStream.close();
@@ -359,7 +410,7 @@ public class ExportServiceImpl implements ExportService {
 
     @Override
     @Async
-    public void routeOrderList(Map<String, Object> params, ManagerDownload managerDownload) throws Exception {
+    public void routeOrderList(Map<String, Object> params, ManagerDownload managerDownload, boolean isPlatformUser) throws Exception {
         List<StudentPaymentOrderExportDto> studentPaymentOrderExportDtos = studentPaymentRouteOrderDao.ExportQueryPage(params);
 
         Map<Integer, String> cooperationOrganMap = new HashMap<>();
@@ -373,7 +424,10 @@ public class ExportServiceImpl implements ExportService {
             List<CooperationOrgan> cooperationOrgans = cooperationOrganDao.getCooperationOrganByIds(cooperationOrganIds);
             cooperationOrganMap = cooperationOrgans.stream().collect(Collectors.toMap(CooperationOrgan::getId, CooperationOrgan::getName));
         }
-        long i = 1;
+        
+        //获取机构费率
+        Integer tenantId = (Integer) params.get("tenantId");
+        TenantConfig tenantConfig = tenantConfigService.queryByTenantId(tenantId);
         
         Map<String,BigDecimal> serviceChargeMap = new HashMap<String, BigDecimal>();
         Map<String,Integer> orderCountMap = new HashMap<String, Integer>();
@@ -433,6 +487,7 @@ public class ExportServiceImpl implements ExportService {
                 
             }
             row.setTransferFee(currentFee);
+            row.setPlatformFee(row.getActualAmount().multiply(tenantConfig.getChargeRate()).divide(new BigDecimal(1000), 2, BigDecimal.ROUND_HALF_UP));
 
             String goodsName = "";
             if (row.getOrderDetailList() != null) {
@@ -617,6 +672,7 @@ public class ExportServiceImpl implements ExportService {
                 } else if (row.getType().equals(OrderTypeEnum.OUTORDER)) {
                     row.setMusicGroupCourseFee(feeByType.getActualAmount().subtract(feeByType.getMusicalFee()).subtract(feeByType.getTeachingFee()).subtract(feeByType.getRepairFee()).subtract(feeByType.getOtherFee()));
                     row.setTransferFee(BigDecimal.ZERO);
+                    row.setPlatformFee(BigDecimal.ZERO);
                 }
             }
             //如果合作单位不存在取学员的第一个乐团的合作单位和教学点
@@ -650,7 +706,6 @@ public class ExportServiceImpl implements ExportService {
             }
             row.setPaymentChannel(paymentChannel);
             row.setOrderAmount(row.getExpectAmount().add(row.getCouponRemitFee()));
-            i++;
         }
 
         Map<Long, List<StudentPaymentOrderExportDto>> orderMap = studentPaymentOrderExportDtos.stream().collect(Collectors.groupingBy(StudentPaymentOrderExportDto::getId));
@@ -816,16 +871,29 @@ public class ExportServiceImpl implements ExportService {
 
         HSSFWorkbook workbook = null;
         try {
-            String[] header = {"序号", "学生编号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额",
-                    "现金支付", "余额支付", "分润账户", "分润金额", "分配余额", "优惠金额", "乐团课", "VIP课", "网管课", "乐理课",
-                    "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费", "账户充值", "其它", "手续费", "到账时间",
-                    "关联乐团ID/VIP课ID", "课程形态", "零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"};
-            String[] body = {"id", "userId", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "orderAmount"
-                    , "expectAmount", "actualAmount", "balancePaymentAmount", "routeMerNo", "routeAmount", "routeBalance",  "couponRemitFee",
-                    "musicGroupCourseFee", "vipCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "maintenanceFee", "cloudTeacherFee", "leaseFee", "musicalFee", "teachingFee", "visitFee",
-                    "rechargeFee", "otherFee", "transferFee", "payTime", "musicGroupId",
-                    "groupType.desc", "sporadicType", "subjectName", "organName", "schoolName", "cooperationOrganName", "eduTeacher", "memo"};
-            workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);
+        	if(isPlatformUser){
+                String[] header = {"序号", "学生编号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额",
+                        "现金支付", "余额支付", "分润账户", "分润金额", "分配余额", "优惠金额", "乐团课", "VIP课", "网管课", "乐理课",
+                        "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费", "账户充值", "其它", "汇付手续费", "平台手续费", "到账时间",
+                        "关联乐团ID/VIP课ID", "课程形态", "零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"};
+                String[] body = {"id", "userId", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "orderAmount"
+                        , "expectAmount", "actualAmount", "balancePaymentAmount", "routeMerNo", "routeAmount", "routeBalance",  "couponRemitFee",
+                        "musicGroupCourseFee", "vipCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "maintenanceFee", "cloudTeacherFee", "leaseFee", "musicalFee", "teachingFee", "visitFee",
+                        "rechargeFee", "otherFee", "transferFee", "platformFee", "payTime", "musicGroupId",
+                        "groupType.desc", "sporadicType", "subjectName", "organName", "schoolName", "cooperationOrganName", "eduTeacher", "memo"};
+                workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);
+        	}else{
+                String[] header = {"序号", "学生编号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额",
+                        "现金支付", "余额支付", "分润账户", "分润金额", "分配余额", "优惠金额", "乐团课", "VIP课", "网管课", "乐理课",
+                        "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费", "账户充值", "其它", "平台手续费", "到账时间",
+                        "关联乐团ID/VIP课ID", "课程形态", "零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"};
+                String[] body = {"id", "userId", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "orderAmount"
+                        , "expectAmount", "actualAmount", "balancePaymentAmount", "routeMerNo", "routeAmount", "routeBalance",  "couponRemitFee",
+                        "musicGroupCourseFee", "vipCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "maintenanceFee", "cloudTeacherFee", "leaseFee", "musicalFee", "teachingFee", "visitFee",
+                        "rechargeFee", "otherFee", "platformFee", "payTime", "musicGroupId",
+                        "groupType.desc", "sporadicType", "subjectName", "organName", "schoolName", "cooperationOrganName", "eduTeacher", "memo"};
+                workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);
+        	}
             workbook.write(fileOutputStream);
             fileOutputStream.getFD().sync();
             fileOutputStream.close();

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

@@ -209,7 +209,7 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
         ChargeTypeSubjectMapper subjectDiscount = chargeTypeSubjectMapperDao.getSubjectDiscount(chargeTypeId, subjectId);
         
         if (subjectDiscount == null){
-        	throw new BizException("未查询到[收费类型与声部的关联关系]");
+        	subjectDiscount = new ChargeTypeSubjectMapper();
         }
         if (subjectDiscount.getGoodsDiscountRate() == null) {
         	subjectDiscount.setGoodsDiscountRate(new BigDecimal(100));

+ 10 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantConfigServiceImpl.java

@@ -8,6 +8,9 @@ import com.ym.mec.biz.dal.dto.TenantConfigDto;
 import com.ym.mec.biz.dal.entity.TenantConfig;
 import com.ym.mec.biz.service.TenantConfigService;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.WrapperUtil;
+import com.ym.mec.common.tenant.TenantContextHolder;
+
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -47,7 +50,13 @@ public class TenantConfigServiceImpl extends ServiceImpl<TenantConfigDao, Tenant
         this.updateById(info);
     }
 
-    private void setUserId(Integer id, Consumer<Integer> setOption) {
+    @Override
+	public TenantConfig queryByTenantId(Integer tenantId) {
+		return getOne(new WrapperUtil<TenantConfig>().hasEq("tenant_id_", TenantContextHolder.getTenantId())
+				.queryWrapper());
+	}
+
+	private void setUserId(Integer id, Consumer<Integer> setOption) {
         if (Objects.isNull(id)) {
             Integer userId = Optional.ofNullable(sysUserFeignService.queryUserInfo())
                     .map(SysUser::getId)

+ 13 - 4
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -18,11 +18,14 @@ import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.excel.POIUtil;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -31,6 +34,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletResponse;
+
 import java.io.IOException;
 import java.io.OutputStream;
 import java.math.BigDecimal;
@@ -1273,6 +1277,11 @@ public class ExportController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('export/orderList')")
     public HttpResponseResult orderList(StudentPaymentOrderQueryInfo queryInfo) throws Exception {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
+        
+        if(sysUser == null || sysUser.getId() == null){
+        	return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        
         queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         if (StringUtils.isNotBlank(queryInfo.getSearch())) {
             List<BasicUserDto> users = studentPaymentOrderDao.getUsers(queryInfo.getSearch());
@@ -1306,7 +1315,7 @@ public class ExportController extends BaseController {
         managerDownload.setCreateTime(nowDate);
         managerDownload.setUpdateTime(nowDate);
         managerDownloadDao.insert(managerDownload);
-        exportService.orderList(params, managerDownload);
+        exportService.orderList(params, managerDownload, sysUser.getTenantId() <= 0);
         HttpResponseResult<Object> succeed = succeed();
         succeed.setMsg(fileName + "导出申请已提交,请到【报表中心-下载列表查看】");
         return succeed;
@@ -2187,8 +2196,8 @@ public class ExportController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('export/routeOrderList')")
     public HttpResponseResult routeOrderList(StudentPaymentOrderQueryInfo queryInfo) throws Exception {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
+        if (sysUser == null || sysUser.getId() == null) {
+        	return failed(HttpStatus.FORBIDDEN, "请登录");
         }
         queryInfo.setOrganId(organizationService.getEmployeeOrgan(sysUser.getId(),queryInfo.getOrganId(),sysUser.getIsSuperAdmin()));
         if (StringUtils.isNotBlank(queryInfo.getSearch())) {
@@ -2227,7 +2236,7 @@ public class ExportController extends BaseController {
         managerDownload.setCreateTime(nowDate);
         managerDownload.setUpdateTime(nowDate);
         managerDownloadDao.insert(managerDownload);
-        exportService.routeOrderList(params, managerDownload);
+        exportService.routeOrderList(params, managerDownload, sysUser.getTenantId() <= 0);
         HttpResponseResult<Object> succeed = succeed();
         succeed.setMsg(fileName + "导出申请已提交,请到【报表中心-下载列表查看】");
         return succeed;

+ 1 - 3
mec-web/src/main/java/com/ym/mec/web/controller/TenantConfigController.java

@@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.RestController;
 import com.ym.mec.biz.dal.entity.TenantConfig;
 import com.ym.mec.biz.service.TenantConfigService;
 import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.page.WrapperUtil;
 import com.ym.mec.common.tenant.TenantContextHolder;
 
 @RequestMapping("tenantConfig")
@@ -28,8 +27,7 @@ public class TenantConfigController extends BaseController {
 	@PreAuthorize("@pcs.hasPermissions('tenantConfig/get')")
 	public Object get() {
 		// 查询云教室扣费标准
-		TenantConfig tenantConfig = tenantConfigService.getOne(new WrapperUtil<TenantConfig>().hasEq("tenant_id_", TenantContextHolder.getTenantId())
-				.queryWrapper());
+		TenantConfig tenantConfig = tenantConfigService.queryByTenantId(TenantContextHolder.getTenantId());
 
 		return succeed(tenantConfig);
 	}