소스 검색

缴费单号

周箭河 4 년 전
부모
커밋
19576a8cb7

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentRouteOrderDao.java

@@ -78,4 +78,11 @@ public interface StudentPaymentRouteOrderDao extends BaseDAO<Long, StudentPaymen
      * @return
      */
     BigDecimal sumAmountByCalenderId(Long calenderId);
+
+    /**
+     * 更换订单号获取
+     * @param orderNo
+     * @return
+     */
+    StudentPaymentRouteOrder getByOrderNo(String orderNo);
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/OutOrderInfoDto.java

@@ -17,6 +17,9 @@ public class OutOrderInfoDto {
     @ApiModelProperty(value = "销售收入",required = true)
     private BigDecimal goodsAmount = BigDecimal.ZERO;
 
+    @ApiModelProperty(value = "缴费单号",required = true)
+    private Long calenderId;
+
     private List<SellOrder> sellOrders;
 
     public List<SellOrder> getSellOrders() {
@@ -50,4 +53,12 @@ public class OutOrderInfoDto {
     public void setStudentPaymentOrder(com.ym.mec.biz.dal.entity.StudentPaymentOrder studentPaymentOrder) {
         StudentPaymentOrder = studentPaymentOrder;
     }
+
+    public Long getCalenderId() {
+        return calenderId;
+    }
+
+    public void setCalenderId(Long calenderId) {
+        this.calenderId = calenderId;
+    }
 }

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

@@ -380,5 +380,8 @@
     <select id="sumAmountByCalenderId" resultType="java.math.BigDecimal">
         SELECT IF(SUM(route_amount_) IS NULL,0, SUM(route_amount_)) FROM student_payment_route_order WHERE calender_id_ = #{calenderId} AND audit_status_='PASS'
     </select>
+    <select id="getByOrderNo" resultMap="StudentPaymentRouteOrder">
+        SELECT * FROM student_payment_route_order WHERE order_no_ = #{orderNo} LIMIT 1
+    </select>
 
 </mapper>

+ 8 - 1
mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentRouteOrderController.java

@@ -1,5 +1,7 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.dao.StudentPaymentRouteOrderDao;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
@@ -52,6 +54,8 @@ public class StudentPaymentRouteOrderController extends BaseController {
     private StudentPaymentOrderDao studentPaymentOrderDao;
     @Autowired
     private SellOrderDao sellOrderDao;
+    @Autowired
+    private StudentPaymentRouteOrderDao studentPaymentRouteOrderDao;
 
     @ApiOperation(value = "财务订单列表")
     @GetMapping("/finance")
@@ -181,7 +185,10 @@ public class StudentPaymentRouteOrderController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('routeOrder/getOrderInfo')")
     public HttpResponseResult<OutOrderInfoDto> getOrderInfo(Long orderId) {
         OutOrderInfoDto outOrderInfoDto = new OutOrderInfoDto();
-        outOrderInfoDto.setStudentPaymentOrder(studentPaymentOrderDao.get(orderId));
+        StudentPaymentOrder order = studentPaymentOrderDao.get(orderId);
+        outOrderInfoDto.setStudentPaymentOrder(order);
+        StudentPaymentRouteOrder routeOrder = studentPaymentRouteOrderDao.getByOrderNo(order.getOrderNo());
+        outOrderInfoDto.setCalenderId(routeOrder.getCalenderId());
         List<SellOrder> sellOrders = sellOrderDao.getOrderSellOrder(orderId);
         BigDecimal goodsAmount = sellOrders.stream().map(SellOrder::getActualAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
         BigDecimal serviceAmount = outOrderInfoDto.getStudentPaymentOrder().getActualAmount().subtract(goodsAmount);