zjh
昨天 ad4326adc4ccad14f090fba5acb435deab8260db
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCompPayController.java
@@ -154,7 +154,8 @@
    @ApiOperation(value = "所有公司体检收费数据查询接口")
    public AjaxResult list(@RequestParam(required = false) @ApiParam(value = "单位id") String compId) {
        List<TjReservation> rightList = reservationService.list(new LambdaQueryWrapper<TjReservation>().eq(TjReservation::getCompanyId, compId));
//        List<TjReservation> rightList = reservationService.list(new LambdaQueryWrapper<TjReservation>().eq(TjReservation::getCompanyId, compId));
        List<TjReservation> rightList = reservationService.getFirimSfList(compId);
        Map<String, List<TjReservation>> collect = rightList.stream().collect(Collectors.groupingBy(TjReservation::getPacId));
@@ -191,8 +192,7 @@
        List<TjTeamSelectRecord> selectRecordList = selectRecordService.list(wq0);
        if(null !=selectRecordList && !selectRecordList.isEmpty()){
            for(TjTeamSelectRecord selectRecord : selectRecordList){
                selectRecord.setSjCount(orderService.count(new LambdaQueryWrapper<TjOrder>()
                        .eq(TjOrder::getTeamNo,selectRecord.getTeamNo()).eq(TjOrder::getPacId,selectRecord.getPacId())));
                selectRecord.setSjCount(orderService.getTjTeamSelectRecordCount(selectRecord.getTeamNo(),selectRecord.getCompId(),selectRecord.getPacId()));
                TjDwGrouping dwGrouping = dwGroupingService.getById(selectRecord.getPacId());
                if(null !=dwGrouping){
@@ -234,7 +234,8 @@
            LambdaQueryWrapper<TjReservation> wrapper = new LambdaQueryWrapper<>();
            wrapper.eq(TjReservation::getTeamNo, teamNo);
            if(StringUtil.isNotBlank(pacId))wrapper.eq(TjReservation::getPacId, pacId);
            List<TjReservation> reservationList = reservationService.list(wrapper);
//            List<TjReservation> reservationList = reservationService.list(wrapper);
            List<TjReservation> reservationList = reservationService.getTeamTjPeopleList(teamNo, pacId);
            if (null != reservationList && !reservationList.isEmpty()) {
                List<TeamTjPeopleVo> syList = new ArrayList<>();
                List<TeamTjPeopleVo> yjwjzList = new ArrayList<>();
@@ -252,7 +253,9 @@
                        throw new RuntimeException(e);
                    }
                    if (null != customer) {
                        TjOrder tjOrder = orderService.getOne(new LambdaQueryWrapper<TjOrder>().eq(TjOrder::getUserId, customer.getCusId()).eq(TjOrder::getTeamNo, teamNo));
                        TjOrder tjOrder = orderService.getOne(new LambdaQueryWrapper<TjOrder>()
                                .eq(TjOrder::getUserId, customer.getCusId())
                                .and(w->w.eq(TjOrder::getTeamNo, teamNo).or().eq(TjOrder::getPacId,reservation.getPacId())));
                        if (null != tjOrder) {
                            TjFlowingWater water = tjFlowingWaterService.getOne(new LambdaQueryWrapper<TjFlowingWater>()
                                    .eq(TjFlowingWater::getOrderId, tjOrder.getOrderId()).eq(TjFlowingWater::getIsAddition, "N"));
@@ -300,18 +303,29 @@
    @GetMapping("/getTjCompPay")
    @ApiOperation(value = "根据团队体检编号和套餐id获取结账信息")
    public AjaxResult getTjCompPay(@RequestParam @ApiParam(value = "团队编号") String teamNo,
                                          @RequestParam(required = false) @ApiParam(value = "单位id") String pacId) {
                                          @RequestParam @ApiParam(value = "套餐id") String pacId) {
        try {
             LambdaQueryWrapper<TjCompPay> wq = new LambdaQueryWrapper<>();
             wq.eq(TjCompPay::getTeamNo, teamNo);
             wq.eq(TjCompPay::getCompId, pacId);
             wq.eq(TjCompPay::getPacId, pacId);
             List<TjCompPay> tjCompPays = compPayService.list(wq);
             if(null !=tjCompPays && !tjCompPays.isEmpty()){
                 for (TjCompPay pay : tjCompPays) {
                     LambdaQueryWrapper<TjCompPayInfo> wqInfo = new LambdaQueryWrapper<>();
                     wqInfo.eq(TjCompPayInfo::getTjCompPayId, pay.getId());
                     List<TjCompPayInfo> payInfos = payInfoService.list(wqInfo);
                     if(null !=payInfos && !payInfos.isEmpty()){
                         for (TjCompPayInfo info : payInfos) {
                             TjOrder order = orderService.getOrderByTjNum(info.getTjh());
                             if(null != order){
                                 TjCustomer tjCustomer = customerService.getById(order.getUserId());
                                 if (null != tjCustomer) {
                                     info.setName(tjCustomer.getCusName());
                                 }
                             }
                         }
                     }
                     pay.setPayInfo(payInfos);
                 }
             }