Browse Source

经营报表导出

zouxuan 2 years ago
parent
commit
f12da68fc5

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

@@ -184,8 +184,11 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
      * @param params
      * @return
      */
+
     List<StudentPaymentOrderExportDto> ExportQueryPage(Map<String, Object> params);
 
+    List<StudentPaymentOrderExportDto> ExportQueryPage1(Map<String, Object> params);
+
     List<StudentPaymentOrderMallExportDto> exportMallQueryPage(Map<String, Object> params);
 
     /**
@@ -452,4 +455,6 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
 
     //用户户购买过的活动的次数
     int countByActivityIds(@Param("activityIds") List<String> activityIds, @Param("userId") Integer userId);
+
+    int queryCount1(Map<String, Object> params);
 }

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

@@ -10,41 +10,41 @@ public class OperatingTotalIncomeDto {
     private String organName;
 
     // 学生指导费课耗收入
-    private BigDecimal studentGuidanceIncome;
+    private BigDecimal studentGuidanceIncome = BigDecimal.ZERO;
 
     // 云教练团课耗收入
 //    private BigDecimal cloudCoachGroupClassIncome;
 
     // 学校课程采买课耗收入
-    private BigDecimal coursePurchaseIncome;
+    private BigDecimal coursePurchaseIncome = BigDecimal.ZERO;
 
     // 考级
-    private BigDecimal examIncome;
+    private BigDecimal examIncome = BigDecimal.ZERO;
 
     // 维修费用
-    private BigDecimal maintenanceCost;
+    private BigDecimal maintenanceCost = BigDecimal.ZERO;
 
     // 乐保费用
-    private BigDecimal instrumentInsuranceCost;
+    private BigDecimal instrumentInsuranceCost = BigDecimal.ZERO;
 
     // 其他服务收入
-    private BigDecimal otherServiceIncome;
+    private BigDecimal otherServiceIncome = BigDecimal.ZERO;
 
     // 云教练收入
-    private BigDecimal cloudCoachIncome;
+    private BigDecimal cloudCoachIncome = BigDecimal.ZERO;
 
     // 团购乐器
-    private BigDecimal groupPurchaseInstruments;
+    private BigDecimal groupPurchaseInstruments = BigDecimal.ZERO;
 
     // 团购教辅
-    private BigDecimal groupPurchaseTeachingAids;
+    private BigDecimal groupPurchaseTeachingAids = BigDecimal.ZERO;
 
     // 大件乐器
-    private BigDecimal largeInstruments;
+    private BigDecimal largeInstruments = BigDecimal.ZERO;
 
     // 服务收入
-    private BigDecimal serviceIncome;
+    private BigDecimal serviceIncome = BigDecimal.ZERO;
 
     // 销售收入
-    private BigDecimal salesIncome;
+    private BigDecimal salesIncome = BigDecimal.ZERO;
 }

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

@@ -413,7 +413,7 @@ public class ExportServiceImpl implements ExportService {
         params.put("month",month);
         params.put("tenantId",TenantContextHolder.getTenantId());
         params.put("orderType",0);
-        int count = studentPaymentOrderDao.queryCount(params);
+        int count = studentPaymentOrderDao.queryCount1(params);
         if (count <= 0) {
             return BaseController.failed("没有可导出的数据");
         }
@@ -2308,7 +2308,7 @@ public class ExportServiceImpl implements ExportService {
 
     @Override
     public void operatingSummaryIncome(Map<String, Object> params, ManagerDownload managerDownload) {
-        List<StudentPaymentOrderExportDto> studentPaymentOrderExportDtos = studentPaymentOrderService.ExportQueryPage(params);
+        List<StudentPaymentOrderExportDto> studentPaymentOrderExportDtos = studentPaymentOrderDao.ExportQueryPage1(params);
         long i = 1;
         //获取机构费率
         List<Long> otherOrderIds = studentPaymentOrderExportDtos.stream().filter(e -> e.getGroupType() != GroupType.GOODS_SELL

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

@@ -334,6 +334,12 @@
         <include refid="queryPaymentOrder"/>
     </select>
 
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount1" resultType="int" parameterType="map">
+        SELECT COUNT(spo.id_) FROM student_payment_order spo
+        <include refid="queryPaymentOrder"/>
+    </select>
+
     <sql id="queryPaymentMallOrder">
         <where>
         	spo.tenant_id_ = #{tenantId}
@@ -750,6 +756,17 @@
         <include refid="queryPaymentOrder"/>
         ORDER BY spo.id_ ASC
     </select>
+
+    <select id="ExportQueryPage1" resultMap="orderAndDetail" parameterType="map">
+        SELECT spo.*,spod.id_ detail_id_,spod.type_ detail_type_,spod.price_
+        detail_price_,spod.kit_group_purchase_type_ detail_kit_group_purchase_type_,
+        sci.charge_type_,g.id_ goods_id
+        FROM student_payment_order spo
+        LEFT JOIN student_payment_order_detail spod on spo.id_ = spod.payment_order_id_
+        LEFT JOIN sporadic_charge_info sci on spo.music_group_id_ = sci.id_
+        <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_"/>

+ 1 - 1
mec-web/src/main/resources/exportColumnMapper.ini

@@ -348,7 +348,7 @@ fieldColumns = ["organName", "fixedHumanCost", "house", "office", "mainsProperty
 
 [oa费用明细]
 headColumns = ["城市","钉钉流程编号","费用归属学校","申请人","费用项目","费用类型","付款金额","付款时间","明细","学员编号","当期金额"]
-fieldColumns = ["organName","batchNo","cooperationOrganName","applyUser","feeProject","type","amount","paymentTime","cause","studentId","currentAmount"]
+fieldColumns = ["organName","batchNo","cooperationOrganName","applyUser","feeProject.desc","type.desc","amount","paymentTime","cause","studentId","currentAmount"]
 
 [经营报表收入汇总]
 headColumns = ["城市","学生指导费课耗收入","学校课程采买课耗收入","考级","维修费用","乐保费用","其他服务收入","云教练收入","团购乐器","团购教辅","大件乐器","其他","服务收入","销售收入"]