| | |
| | | @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)); |
| | | |
| | |
| | | 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){ |
| | |
| | | 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<>(); |
| | |
| | | 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")); |
| | |
| | | @Select("SELECT DISTINCT a.tjh FROM ltkj_exam_jcbgd a WHERE ISNULL(a.xmdm)") |
| | | List<String> shoudongtbjcbgdsj(); |
| | | |
| | | @Select("SELECT COUNT(*) FROM tj_order a WHERE a.deleted=0 AND " + |
| | | "(a.firm_id=#{compId} OR a.team_no=#{teamNo}) AND a.pac_id=#{pacId}") |
| | | Integer getTjTeamSelectRecordCount(@Param("teamNo") String teamNo,@Param("compId") String compId,@Param("pacId") String pacId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ltkj.hosp.domain.TjReservation; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | @Select("SELECT * FROM tj_reservation WHERE deleted = 1") |
| | | public List<TjReservation> selectTjReservationByDelete(); |
| | | |
| | | |
| | | @Select("SELECT * FROM (\n" + |
| | | "SELECT a.id_card,a.pac_id,a.company,a.company_id,a.team_no,a.grouping_id FROM tj_reservation a WHERE a.deleted=0 AND a.company_id=#{compId} \n" + |
| | | "UNION\n" + |
| | | "SELECT c.cus_idcard id_card, o.pac_id pac_id,o.firm_name company,o.firm_id company_id,o.firm_id team_no,IFNULL(o.pac_id,o.group_id) grouping_id FROM tj_order o " + |
| | | "JOIN tj_customer c ON c.cus_id=o.user_id WHERE o.deleted=0 AND o.firm_id=#{compId} AND o.tj_type=1 AND o.pac_id !=0) aa GROUP BY aa.id_card") |
| | | List<TjReservation> getFirimSfList(String compId); |
| | | |
| | | |
| | | @Select("SELECT * FROM (\n" + |
| | | "SELECT a.`name`,a.phoe,a.sex, a.id_card,a.pac_id,a.company,a.company_id,a.team_no,a.grouping_id FROM tj_reservation a " + |
| | | "WHERE a.deleted=0 AND (a.team_no=#{teamNo} or a.company_id=#{teamNo}) AND a.pac_id=#{pacId}\n" + |
| | | "UNION\n" + |
| | | "SELECT c.cus_name name,c.cus_phone phone,c.cus_sex sex,c.cus_idcard id_card, o.pac_id pac_id,o.firm_name company," + |
| | | "o.firm_id company_id,o.order_id team_no,IFNULL(o.pac_id,o.group_id) grouping_id FROM " + |
| | | "tj_order o \n" + |
| | | "JOIN tj_customer c ON c.cus_id=o.user_id WHERE o.deleted=0" + |
| | | " AND (o.firm_id=(SELECT DISTINCT r.company_id FROM tj_reservation r " + |
| | | "WHERE r.deleted=0 AND ( r.team_no=#{teamNo} or r.company_id=#{teamNo})) or o.firm_id=#{teamNo}) \n" + |
| | | "AND o.tj_type=1 AND o.pac_id =#{pacId}) aa GROUP BY aa.id_card;") |
| | | List<TjReservation> getTeamTjPeopleList(@Param("teamNo") String teamNo,@Param("pacId") String pacId); |
| | | } |
| | |
| | | |
| | | List<String> shoudongtbjcbgdsj(); |
| | | |
| | | Integer getTjTeamSelectRecordCount(String teamNo, String compId, String pacId); |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | public int deleteTjReservationById(Integer id); |
| | | |
| | | List<TjReservation> getFirimSfList(String compId); |
| | | |
| | | List<TjReservation> getTeamTjPeopleList(String teamNo, String pacId); |
| | | } |
| | |
| | | public List<String> shoudongtbjcbgdsj() { |
| | | return tjOrderMapper.shoudongtbjcbgdsj(); |
| | | } |
| | | |
| | | @Override |
| | | public Integer getTjTeamSelectRecordCount(String teamNo, String compId, String pacId) { |
| | | return tjOrderMapper.getTjTeamSelectRecordCount(teamNo, compId, pacId); |
| | | } |
| | | } |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.Calendar; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | public int deleteTjReservationById(Integer id) { |
| | | return tjReservationMapper.deleteTjReservationById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<TjReservation> getFirimSfList(String compId) { |
| | | return tjReservationMapper.getFirimSfList(compId); |
| | | } |
| | | |
| | | @Override |
| | | public List<TjReservation> getTeamTjPeopleList(String teamNo, String pacId) { |
| | | return tjReservationMapper.getTeamTjPeopleList(teamNo, pacId); |
| | | } |
| | | } |