| 
					
				 | 
			
			
				@@ -1,9 +1,10 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 package com.ym.mec.student.controller; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.ym.mec.biz.dal.dao.OrganizationDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.dao.SysConfigDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.dto.LuckStatisDto; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.dto.OrderStatisDto; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.ym.mec.biz.dal.entity.SporadicChargeInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.ym.mec.biz.dal.entity.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.service.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import io.swagger.annotations.Api; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import io.swagger.annotations.ApiImplicitParam; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -37,9 +38,6 @@ import com.huifu.adapay.model.payment.PayChannelEnum; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.huifu.adapay.model.payment.Payment; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.dto.VipBuyResultDto; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.ym.mec.biz.dal.entity.Goods; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.ym.mec.biz.dal.entity.MusicGroup; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import com.ym.mec.biz.dal.entity.StudentPaymentOrder; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.enums.DealStatusEnum; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.biz.dal.enums.GroupType; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.ym.mec.common.controller.BaseController; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -78,6 +76,8 @@ public class StudentOrderController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private SysConfigDao sysConfigDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private SporadicChargeInfoService sporadicChargeInfoService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private OrganizationDao organizationDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @PostMapping("/notify") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public Msg notify(@ModelAttribute Msg msg) throws Exception { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -131,7 +131,7 @@ public class StudentOrderController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } else if (orderByOrderNo.getGroupType().equals(GroupType.VIP)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             VipBuyResultDto vipBuyResultInfo = vipGroupService.findVipBuyResultInfo(Integer.valueOf(orderByOrderNo.getMusicGroupId())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             orderDetail.put("detail", vipBuyResultInfo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }else if(orderByOrderNo.getGroupType().equals(GroupType.SPORADIC)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else if (orderByOrderNo.getGroupType().equals(GroupType.SPORADIC)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             SporadicChargeInfo info = sporadicChargeInfoService.get(Integer.valueOf(orderByOrderNo.getMusicGroupId())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             orderDetail.put("detail", info); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -288,21 +288,37 @@ public class StudentOrderController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public void paymentResult(HttpServletResponse response, String orderNo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             String baseApiUrl = sysConfigDao.findConfigValue("base_api_url"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            response.sendRedirect(baseApiUrl+"/#/paymentresult?orderNo=" + orderNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            response.sendRedirect(baseApiUrl + "/#/paymentresult?orderNo=" + orderNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } catch (IOException e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @GetMapping("/getLuckStatis") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public HttpResponseResult getLuckStatis(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public HttpResponseResult getLuckStatis() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<Organization> organs = organizationDao.findAllOrgans(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<OrderStatisDto> orders = studentPaymentOrderDao.getLuckStatis(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         BigDecimal totalMoney = BigDecimal.ZERO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Integer totalNum = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        for (OrderStatisDto order : orders) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            totalMoney = totalMoney.add(order.getMoney()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            totalNum += order.getNums(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (Organization organ : organs) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            boolean flag = false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (OrderStatisDto order : orders) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                totalMoney = totalMoney.add(order.getMoney()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                totalNum += order.getNums(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (organ.getName().equals(order.getOrganName())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    flag = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (!flag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                OrderStatisDto orderStatisDto = new OrderStatisDto(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                orderStatisDto.setOrganName(organ.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                orderStatisDto.setMoney(BigDecimal.ZERO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                orderStatisDto.setNums(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                orders.add(orderStatisDto); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         LuckStatisDto luckStatisDto = new LuckStatisDto(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         luckStatisDto.setOrderStatisDtoList(orders); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         luckStatisDto.setTotalNum(totalNum); 
			 |