| | |
| | | } |
| | | if (StringUtil.isNotBlank(dw)) { |
| | | LambdaQueryWrapper<TjCustomer> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.like(TjCustomer::getCompName,dw); |
| | | wqq.like(TjCustomer::getCompName, dw); |
| | | List<TjCustomer> customerList = tjCustomerService.list(wqq); |
| | | List<TjOrder> list = new ArrayList<>(); |
| | | if (null != customerList && !customerList.isEmpty()) { |
| | |
| | | list.addAll(tjOrderService.list(wq)); |
| | | } |
| | | } |
| | | List<String> dwIds= iDictCompService.getdwIdByDwName(dw); |
| | | List<String> dwIds = iDictCompService.getdwIdByDwName(dw); |
| | | |
| | | LambdaQueryWrapper<TjOrder> wq = new LambdaQueryWrapper<>(); |
| | | wq.in(TjOrder::getFirmId,dwIds); |
| | | wq.in(TjOrder::getFirmId, dwIds); |
| | | list.addAll(tjOrderService.list(wq)); |
| | | List<TjOrder> collect = null; |
| | | if (!list.isEmpty()) { |
| | | List<TjOrder> orders = list.stream().distinct().collect(Collectors.toList()); |
| | | for (int i = 0; i < orders.size(); i++) { |
| | | TjCustomer tjCustomer = tjCustomerService.getById(list.get(i).getUserId()); |
| | | if (null == tjCustomer) { |
| | | list.remove(list.get(i)); |
| | | continue; |
| | | } |
| | | list.get(i).setTjCustomerSex(tjCustomer.getCusSex()); |
| | | list.get(i).setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | list.get(i).setTjCustomerName(tjCustomer.getCusName()); |
| | | list.get(i).setTjCustomerPhone(tjCustomer.getCusPhone()); |
| | | list.get(i).setTjCusIdCard(tjCustomer.getCusIdcard()); |
| | | if (!list.isEmpty()) { |
| | | List<TjOrder> orders = list.stream().distinct().collect(Collectors.toList()); |
| | | for (int i = 0; i < orders.size(); i++) { |
| | | TjCustomer tjCustomer = tjCustomerService.getById(list.get(i).getUserId()); |
| | | if (null == tjCustomer) { |
| | | list.remove(list.get(i)); |
| | | continue; |
| | | } |
| | | list.get(i).setTjCustomerSex(tjCustomer.getCusSex()); |
| | | list.get(i).setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | list.get(i).setTjCustomerName(tjCustomer.getCusName()); |
| | | list.get(i).setTjCustomerPhone(tjCustomer.getCusPhone()); |
| | | list.get(i).setTjCusIdCard(tjCustomer.getCusIdcard()); |
| | | |
| | | if (null != tjCustomer.getCompName()) { |
| | | list.get(i).setDictCompName(tjCustomer.getCompName()); |
| | | } else { |
| | | String firmId = list.get(i).getFirmId(); |
| | | if (firmId != null && null != iDictCompService.getById(String.valueOf(list.get(i).getFirmId()))) { |
| | | list.get(i).setDictCompName(iDictCompService.getById(String.valueOf(list.get(i).getFirmId())).getCnName()); |
| | | } |
| | | } |
| | | |
| | | if (null != list.get(i).getPacId()) { |
| | | if (null != tjPackageService.getById(list.get(i).getPacId())) { |
| | | list.get(i).setPacName(tjPackageService.getById(list.get(i).getPacId()).getPacName()); |
| | | } |
| | | if (null != dwDeptService.getById(list.get(i).getPacId())) { |
| | | list.get(i).setPacName(dwDeptService.getById(list.get(i).getPacId()).getDwDeptName()); |
| | | } |
| | | if (null != tjCustomer.getCompName()) { |
| | | list.get(i).setDictCompName(tjCustomer.getCompName()); |
| | | } else { |
| | | String firmId = list.get(i).getFirmId(); |
| | | if (firmId != null && null != iDictCompService.getById(String.valueOf(list.get(i).getFirmId()))) { |
| | | list.get(i).setDictCompName(iDictCompService.getById(String.valueOf(list.get(i).getFirmId())).getCnName()); |
| | | } |
| | | } |
| | | collect = list.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | |
| | | if (null != list.get(i).getPacId()) { |
| | | if (null != tjPackageService.getById(list.get(i).getPacId())) { |
| | | list.get(i).setPacName(tjPackageService.getById(list.get(i).getPacId()).getPacName()); |
| | | } |
| | | if (null != dwDeptService.getById(list.get(i).getPacId())) { |
| | | list.get(i).setPacName(dwDeptService.getById(list.get(i).getPacId()).getDwDeptName()); |
| | | } |
| | | } |
| | | } |
| | | if (null != collect) { |
| | | map.put("total", collect.size()); |
| | | } else { |
| | | map.put("total", 0); |
| | | } |
| | | map.put("list", collect); |
| | | return AjaxResult.success(map); |
| | | collect = list.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | } |
| | | if (null != collect) { |
| | | map.put("total", collect.size()); |
| | | } else { |
| | | map.put("total", 0); |
| | | } |
| | | map.put("list", collect); |
| | | return AjaxResult.success(map); |
| | | |
| | | |
| | | } |
| | |
| | | return AjaxResult.error("对不起您的预约已超时请重新预约"); |
| | | } |
| | | if (null != tjReservation.getTeamNo()) tjOrder.setTeamNo(tjReservation.getTeamNo()); |
| | | if (null != tjReservation.getCompanyId()) tjOrder.setFirmId(tjReservation.getCompanyId()); |
| | | // if (null != tjReservation.getCompanyId()) tjOrder.setFirmId(tjReservation.getCompanyId()); |
| | | // if (null != tjReservation.getCompany()) tjOrder.setFirmName(tjReservation.getCompany()); |
| | | if (null != tjReservation.getDepartment()) tjOrder.setFirmDeptName(tjReservation.getDepartment()); |
| | | if (null != tjReservation.getJobNo()) tjOrder.setFirmWorkId(tjReservation.getJobNo()); |
| | | if (null != tjReservation.getPacId()) tjOrder.setPacId(tjReservation.getPacId()); |
| | |
| | | tjOrder.setGroupId(tjReservation.getGroupingId()); |
| | | tjOrder.setFirmDeptId(tjReservation.getPacId()); |
| | | } |
| | | // if (null != tjReservation.getDepartmentId()) tjOrder.setFirmDeptId(tjReservation.getDepartmentId()); |
| | | tjReservation.setIsExpire(1); |
| | | tjReservationService.updateById(tjReservation); |
| | | if (null != tjReservation.getTeamNo() && tjOrder.getTjType().equals("1")) { |
| | |
| | | tjOrder.setTjType("2"); |
| | | } |
| | | } |
| | | |
| | | if (null != tjCustomer.getCompName()) { |
| | | tjOrder.setFirmName(tjCustomer.getCompName()); |
| | | } |
| | | if (null != tjCustomer.getDictCompId()) { |
| | | tjOrder.setFirmId(String.valueOf(tjCustomer.getDictCompId())); |
| | | } else { |
| | | tjOrder.setFirmId("0"); |
| | | } |
| | | |
| | | |
| | | if (null != tjOrder.getPhoto()) { |
| | | File file = new File(tjOrder.getPhoto()); |
| | |
| | | tjOrder.setPhoto(encode); |
| | | } |
| | | } |
| | | if (tjOrder.getFirmId() == null) { |
| | | tjOrder.setFirmId("0"); |
| | | } |
| | | |
| | | |
| | | if (null == tjOrder.getPacId() && null != transitionService.getTbTransitionPacIdByCusIdAndPac(String.valueOf(tjOrder.getUserId()))) { |
| | | tjOrder.setPacId(transitionService.getTbTransitionPacIdByCusIdAndPac(String.valueOf(tjOrder.getUserId()))); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/zongjanyemianshjianzhou") |
| | | @ApiOperation(value = "总检获取时间轴接口") |
| | | @Transactional |
| | | public AjaxResult zongjanyemianshjianzhou(@RequestParam String tjNUm) { |
| | | TjOrder order = tjOrderService.getOrderByTjNum(tjNUm); |
| | | if(null !=order){ |
| | | if (null != order) { |
| | | int czwj = remarkService.panduaniscunzaiweijian(tjNUm); |
| | | int sfwc = remarkService.panduaniswancheng(tjNUm); |
| | | Date checkTime = order.getCheckTime(); |
| | | Date reportTime = order.getReportTime(); |
| | | Integer heshouStatus = order.getHeshouStatus(); |
| | | Date lastTime = order.getPrintLastTime(); |
| | | if(czwj==0){ |
| | | if (czwj == 0) { |
| | | //未检 |
| | | return AjaxResult.success(0); |
| | | } else if(czwj>0) { |
| | | } else if (czwj > 0) { |
| | | //在检 |
| | | return AjaxResult.success(1); |
| | | }else if(sfwc==0){ |
| | | } else if (sfwc == 0) { |
| | | //已完成 |
| | | return AjaxResult.success(2); |
| | | }else if(null !=checkTime){ |
| | | } else if (null != checkTime) { |
| | | //已审核 |
| | | return AjaxResult.success(3); |
| | | }else if(null !=reportTime){ |
| | | } else if (null != reportTime) { |
| | | //生成报告 |
| | | return AjaxResult.success(4); |
| | | }else if(null !=heshouStatus){ |
| | | } else if (null != heshouStatus) { |
| | | //报告核收 |
| | | return AjaxResult.success(5); |
| | | }else if(null !=lastTime){ |
| | | } else if (null != lastTime) { |
| | | //已出报告 |
| | | return AjaxResult.success(6); |
| | | }else { |
| | | } else { |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |