浏览代码

update 基础技能最大建班数修改

周箭河 4 年之前
父节点
当前提交
a991a1354e

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SellOrderDao.java

@@ -196,8 +196,16 @@ public interface SellOrderDao extends BaseDAO<Integer, SellOrder> {
 
     /**
      * 获取订单的各类型费用
+     *
      * @param orderId
      * @return
      */
     StudentPaymentOrderExportDto getFeeByType(@Param("orderId") Long orderId);
+
+    /**
+     * 获取打包辅件中乐保
+     * @param orderId
+     * @return
+     */
+    BigDecimal getChildRepair(@Param("orderId") Long orderId);
 }

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

@@ -192,9 +192,10 @@ public class ExportServiceImpl implements ExportService {
                 }
             } else {
                 StudentPaymentOrderExportDto feeByType = sellOrderDao.getFeeByType(row.getId());
+                BigDecimal childRepairFee = sellOrderDao.getChildRepair(row.getId());
                 row.setMusicalFee(feeByType.getMusicalFee());
-                row.setTeachingFee(feeByType.getTeachingFee());
-                row.setMaintenanceProductFee(feeByType.getRepairFee());
+                row.setTeachingFee(feeByType.getTeachingFee().subtract(childRepairFee));
+                row.setMaintenanceProductFee(feeByType.getRepairFee().add(childRepairFee));
                 row.setOtherFee(feeByType.getOtherFee());
                 if (row.getGroupType().equals(GroupType.MUSIC)) {
                     StudentRegistration studentRegistration = studentRegistrationDao.findStudentByMusicGroupIdAndUserId(row.getMusicGroupId(), row.getUserId());
@@ -406,9 +407,10 @@ public class ExportServiceImpl implements ExportService {
                 }
             } else {
                 StudentPaymentOrderExportDto feeByType = sellOrderDao.getFeeByType(row.getId());
+                BigDecimal childRepairFee = sellOrderDao.getChildRepair(row.getId());
                 row.setMusicalFee(feeByType.getMusicalFee());
-                row.setTeachingFee(feeByType.getTeachingFee());
-                row.setMaintenanceProductFee(feeByType.getRepairFee());
+                row.setTeachingFee(feeByType.getTeachingFee().subtract(childRepairFee));
+                row.setMaintenanceProductFee(feeByType.getRepairFee().add(childRepairFee));
                 row.setOtherFee(feeByType.getOtherFee());
                 if (row.getGroupType().equals(GroupType.MUSIC)) {
                     StudentRegistration studentRegistration = studentRegistrationDao.findStudentByMusicGroupIdAndUserId(row.getMusicGroupId(), row.getUserId());

+ 5 - 0
mec-biz/src/main/resources/config/mybatis/SellOrderMapper.xml

@@ -602,4 +602,9 @@
                  LEFT JOIN goods g ON IF(so.parent_goods_id_ IS NOT NULL,g.id_ = so.parent_goods_id_,g.id_ = so.goods_id_)
         WHERE spo.id_ = #{orderId}
     </select>
+
+    <select id="getChildRepair" resultType="decimal">
+        SELECT IFNULL(SUM(actual_amount_),0) FROM sell_order WHERE order_id_ = #{orderId} AND goods_id_ = 76 AND parent_goods_id_ > 0
+    </select>
+
 </mapper>