|  | @@ -16,6 +16,7 @@ import com.ym.mec.biz.service.*;
 | 
											
												
													
														|  |  import com.ym.mec.common.dal.BaseDAO;
 |  |  import com.ym.mec.common.dal.BaseDAO;
 | 
											
												
													
														|  |  import com.ym.mec.common.exception.BizException;
 |  |  import com.ym.mec.common.exception.BizException;
 | 
											
												
													
														|  |  import com.ym.mec.common.page.PageInfo;
 |  |  import com.ym.mec.common.page.PageInfo;
 | 
											
												
													
														|  | 
 |  | +import com.ym.mec.common.page.QueryInfo;
 | 
											
												
													
														|  |  import com.ym.mec.common.service.IdGeneratorService;
 |  |  import com.ym.mec.common.service.IdGeneratorService;
 | 
											
												
													
														|  |  import com.ym.mec.common.service.impl.BaseServiceImpl;
 |  |  import com.ym.mec.common.service.impl.BaseServiceImpl;
 | 
											
												
													
														|  |  import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 |  |  import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 | 
											
										
											
												
													
														|  | @@ -119,6 +120,8 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
 | 
											
												
													
														|  |              if (orderByOrderNo.getBalancePaymentAmount() != null && orderByOrderNo.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
 |  |              if (orderByOrderNo.getBalancePaymentAmount() != null && orderByOrderNo.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
 | 
											
												
													
														|  |                  sysUserCashAccountService.updateBalance(orderByOrderNo.getUserId(), orderByOrderNo.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, "关闭订单");
 |  |                  sysUserCashAccountService.updateBalance(orderByOrderNo.getUserId(), orderByOrderNo.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, "关闭订单");
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  | 
 |  | +            studentGoodsSell = studentGoodsSellDao.findByOrderNo(studentGoodsSell.getOrderNo());
 | 
											
												
													
														|  | 
 |  | +            studentGoodsSell.setGoodsSellDtos(JSON.parseArray(studentGoodsSell.getGoodsJson(),GoodsSellDto.class));
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          Integer studentId = studentGoodsSell.getUserId();
 |  |          Integer studentId = studentGoodsSell.getUserId();
 | 
											
												
													
														|  |          List<GoodsSellDto> goodsSellDtos = studentGoodsSell.getGoodsSellDtos();
 |  |          List<GoodsSellDto> goodsSellDtos = studentGoodsSell.getGoodsSellDtos();
 | 
											
										
											
												
													
														|  | @@ -130,13 +133,27 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          studentDao.lockUser(studentId);
 |  |          studentDao.lockUser(studentId);
 | 
											
												
													
														|  |          SysUser student = sysUserFeignService.queryUserById(studentId);
 |  |          SysUser student = sysUserFeignService.queryUserById(studentId);
 | 
											
												
													
														|  | 
 |  | +        //如果教务老师为空,代表学员自己创建的订单
 | 
											
												
													
														|  |          if(studentGoodsSell.getTeacherId() == null){
 |  |          if(studentGoodsSell.getTeacherId() == null){
 | 
											
												
													
														|  | -            //获取学员第一个教务老师
 |  | 
 | 
											
												
													
														|  | -            studentGoodsSell.setTeacherId(musicGroupDao.getFirstEduTeacherId(studentGoodsSell.getUserId()));
 |  | 
 | 
											
												
													
														|  | 
 |  | +            //获取学生关联的所有教务老师列表
 | 
											
												
													
														|  | 
 |  | +            List<Integer> stuEducation = studentRepairDao.countStuEducation(studentId);
 | 
											
												
													
														|  | 
 |  | +            if (stuEducation != null && stuEducation.size() == 1){
 | 
											
												
													
														|  | 
 |  | +                //获取学员乐团关联的教务
 | 
											
												
													
														|  | 
 |  | +                MusicGroup musicGroup = musicGroupDao.getStuMusic(studentId);
 | 
											
												
													
														|  | 
 |  | +                studentGoodsSell.setTeacherId(stuEducation.get(0));
 | 
											
												
													
														|  | 
 |  | +                if(musicGroup != null){
 | 
											
												
													
														|  | 
 |  | +                    studentGoodsSell.setCooperationOrganId(musicGroup.getCooperationOrganId());
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +        }else if(studentGoodsSell.getCooperationOrganId() == null){
 | 
											
												
													
														|  | 
 |  | +            //获取教务老师,学员关联的乐团
 | 
											
												
													
														|  | 
 |  | +            MusicGroup musicGroup = musicGroupDao.getStuEduMusic(studentId,studentGoodsSell.getTeacherId());
 | 
											
												
													
														|  | 
 |  | +            if(musicGroup != null){
 | 
											
												
													
														|  | 
 |  | +                studentGoodsSell.setCooperationOrganId(musicGroup.getCooperationOrganId());
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          List<Integer> goodsIds = goodsSellDtos.stream().map(e -> e.getGoodsId()).collect(Collectors.toList());
 |  |          List<Integer> goodsIds = goodsSellDtos.stream().map(e -> e.getGoodsId()).collect(Collectors.toList());
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -//        String[] goodsIds = goodsJson.split(",");
 |  | 
 | 
											
												
													
														|  |          Map<Integer, BigDecimal> map = getMap("goods", "id_", "market_price_", goodsIds, Integer.class, BigDecimal.class);
 |  |          Map<Integer, BigDecimal> map = getMap("goods", "id_", "market_price_", goodsIds, Integer.class, BigDecimal.class);
 | 
											
												
													
														|  |          for (GoodsSellDto goodsSellDto : goodsSellDtos) {
 |  |          for (GoodsSellDto goodsSellDto : goodsSellDtos) {
 | 
											
												
													
														|  |              goodsSellDto.setGoodsPrice(map.get(goodsSellDto.getGoodsId()));
 |  |              goodsSellDto.setGoodsPrice(map.get(goodsSellDto.getGoodsId()));
 | 
											
										
											
												
													
														|  | @@ -691,6 +708,31 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +    @Override
 | 
											
												
													
														|  | 
 |  | +    public PageInfo<BasicUserDto> queryEduStudents(QueryInfo queryInfo) {
 | 
											
												
													
														|  | 
 |  | +        SysUser sysUser = sysUserFeignService.queryUserInfo();
 | 
											
												
													
														|  | 
 |  | +        if (sysUser == null) {
 | 
											
												
													
														|  | 
 |  | +            throw new BizException("请登录");
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        PageInfo<BasicUserDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
 | 
											
												
													
														|  | 
 |  | +        Map<String, Object> params = new HashMap<>();
 | 
											
												
													
														|  | 
 |  | +        MapUtil.populateMap(params, queryInfo);
 | 
											
												
													
														|  | 
 |  | +        params.put("teacherId",sysUser.getId());
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        List<BasicUserDto> dataList = null;
 | 
											
												
													
														|  | 
 |  | +        int count = studentRepairDao.countEduStudents(params);
 | 
											
												
													
														|  | 
 |  | +        if (count > 0) {
 | 
											
												
													
														|  | 
 |  | +            pageInfo.setTotal(count);
 | 
											
												
													
														|  | 
 |  | +            params.put("offset", pageInfo.getOffset());
 | 
											
												
													
														|  | 
 |  | +            dataList = studentRepairDao.queryEduStudents(params);
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        if (count == 0) {
 | 
											
												
													
														|  | 
 |  | +            dataList = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        pageInfo.setRows(dataList);
 | 
											
												
													
														|  | 
 |  | +        return pageInfo;
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      private void saveSellOrder(String orderNo){
 |  |      private void saveSellOrder(String orderNo){
 | 
											
												
													
														|  |          StudentPaymentOrder orderByOrderNo = studentPaymentOrderService.findOrderByOrderNo(orderNo);
 |  |          StudentPaymentOrder orderByOrderNo = studentPaymentOrderService.findOrderByOrderNo(orderNo);
 | 
											
												
													
														|  |          StudentGoodsSell studentGoodsSell = studentGoodsSellDao.findByOrderNo(orderNo);
 |  |          StudentGoodsSell studentGoodsSell = studentGoodsSellDao.findByOrderNo(orderNo);
 | 
											
										
											
												
													
														|  | @@ -728,6 +770,8 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
 | 
											
												
													
														|  |              sellOrder.setPaymentChannel(orderByOrderNo.getPaymentChannel());
 |  |              sellOrder.setPaymentChannel(orderByOrderNo.getPaymentChannel());
 | 
											
												
													
														|  |              sellOrder.setMerNo(orderByOrderNo.getMerNos());
 |  |              sellOrder.setMerNo(orderByOrderNo.getMerNos());
 | 
											
												
													
														|  |              sellOrder.setSellTime(orderByOrderNo.getPayTime());
 |  |              sellOrder.setSellTime(orderByOrderNo.getPayTime());
 | 
											
												
													
														|  | 
 |  | +            sellOrder.setEduTeacherId(studentGoodsSell.getTeacherId());
 | 
											
												
													
														|  | 
 |  | +            sellOrder.setCooperationOrganId(studentGoodsSell.getCooperationOrganId());
 | 
											
												
													
														|  |              sellOrders.add(sellOrder);
 |  |              sellOrders.add(sellOrder);
 | 
											
												
													
														|  |          });
 |  |          });
 | 
											
												
													
														|  |          if(sellOrders.size() > 0){
 |  |          if(sellOrders.size() > 0){
 |