Explorar el Código

Merge branch 'feature/0406-degree' into master_saas

liujc hace 2 años
padre
commit
8271d3dbee

+ 11 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -1353,20 +1353,22 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
                             for (int i = 0; i < goodsOrderItemVOS.size(); i++) {
                                 GoodsOrderItemVO goodsVo = goodsOrderItemVOS.get(i);
                                 Goods goods = goodsSnMap.get(goodsVo.getProductSn());
-                                StudentPaymentOrderDetail detail = new StudentPaymentOrderDetail();
-                                detail.setType(OrderDetailTypeEnum.valueOf(goods.getType() == GoodsType.INSTRUMENT?"MUSICAL":goods.getType().getCode()));
-                                detail.setGoodsIdList(goods.getId().toString());
-                                detail.setPrice(goodsVo.getRealAmount());
-                                detail.setRemitFee(BigDecimal.ZERO);
-                                detail.setPaymentOrderId(paymentOrderId);
-                                orderDetails.add(detail);
+                                for (int j = 0; j < goodsVo.getProductQuantity(); j++) {
+                                    StudentPaymentOrderDetail detail = new StudentPaymentOrderDetail();
+                                    detail.setType(OrderDetailTypeEnum.valueOf(goods.getType() == GoodsType.INSTRUMENT?"MUSICAL":goods.getType().getCode()));
+                                    detail.setGoodsIdList(goods.getId().toString());
+                                    detail.setPrice(goodsVo.getRealAmount());
+                                    detail.setRemitFee(BigDecimal.ZERO);
+                                    detail.setPaymentOrderId(paymentOrderId);
+                                    orderDetails.add(detail);
+                                }
 
+                                BigDecimal totalAmount = goodsVo.getRealAmount().multiply(new BigDecimal(goodsVo.getProductQuantity()));
                                 SellOrder sellOrder = new SellOrder();
                                 sellOrder.setOrganId(organId);
                                 sellOrder.setTransNo(transNo);
                                 sellOrder.setOrderId(paymentOrderId);
                                 sellOrder.setOrderNo(orderNo);
-                                BigDecimal totalAmount = goodsVo.getRealAmount().multiply(new BigDecimal(goodsVo.getProductQuantity()));
                                 sellOrder.setExpectAmount(goodsVo.getRealAmount());
                                 if(goodsOrderItemVOS.size() - 1 == i){
                                     sellOrder.setBalanceAmount(subjectBalance);
@@ -1374,6 +1376,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
                                     //获取比例
                                     BigDecimal ratioAmount = totalAmount.divide(studentGoodsSellDto.getExpectAmount(), 6, BigDecimal.ROUND_HALF_UP);
                                     BigDecimal multiply = balancePaymentAmount.multiply(ratioAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
+                                    subjectBalance = subjectBalance.subtract(multiply);
                                     sellOrder.setBalanceAmount(multiply);
                                 }
                                 sellOrder.setActualAmount(totalAmount.subtract(sellOrder.getBalanceAmount()));

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

@@ -29,7 +29,7 @@ public class DegreeController extends BaseController { ;
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('degree/queryPage')")
     public HttpResponseResult queryPage(DegreeQueryInfo queryInfo) {
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
+//        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         queryInfo.setSort("create_time_");
         queryInfo.setOrder("DESC");
         return succeed(degreeRegistrationService.getPageList(queryInfo));