| | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.IdUtil; |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.crypto.symmetric.DES; |
| | | import cn.hutool.extra.pinyin.PinyinUtil; |
| | | import cn.hutool.json.JSONArray; |
| | |
| | | @ApiParam(value = "登记开始时间") @RequestParam(required = false) Date djbeginTime, |
| | | @ApiParam(value = "登记结束时间") @RequestParam(required = false) Date djendTime, |
| | | @ApiParam(value = "报告开始时间") @RequestParam(required = false) Date bgbeginTime, |
| | | @ApiParam(value = "报告结束时间") @RequestParam(required = false) Date bgendTime) { |
| | | @ApiParam(value = "报告结束时间") @RequestParam(required = false) Date bgendTime, |
| | | @ApiParam(value = "单位") @RequestParam(required = false) String dw) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (null != name) { |
| | | List<TjCustomer> customerList; |
| | | LambdaQueryWrapper<TjCustomer> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.like(TjCustomer::getCusName, name); |
| | | List<TjCustomer> customerList = tjCustomerService.list(wqq); |
| | | if (StrUtil.isNotBlank(dw)){ |
| | | wqq.like(TjCustomer::getCompName,dw); |
| | | customerList = tjCustomerService.list(wqq); |
| | | }else { |
| | | customerList = tjCustomerService.list(wqq); |
| | | } |
| | | if (null != customerList && !customerList.isEmpty()) { |
| | | List<TjOrder> list = new ArrayList<>(); |
| | | for (TjCustomer customer : customerList) { |
| | |
| | | map.put("list", collect); |
| | | return AjaxResult.success(map); |
| | | } |
| | | else { |
| | | if (StrUtil.isNotBlank(dw)){ |
| | | wqq = new LambdaQueryWrapper<>(); |
| | | wqq.like(TjCustomer::getCusName, name); |
| | | customerList = tjCustomerService.list(wqq); |
| | | LambdaQueryWrapper<DictComp> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.like(DictComp::getCnName,dw); |
| | | List<String> list = iDictCompService.list(wrapper).stream().map(DictComp::getCnName).collect(Collectors.toList()); |
| | | if (null != customerList && !customerList.isEmpty()) { |
| | | List<TjOrder> list1 = new ArrayList<>(); |
| | | for (TjCustomer customer : customerList) { |
| | | LambdaQueryWrapper<TjOrder> wq = new LambdaQueryWrapper<>(); |
| | | if (null != djbeginTime && null != djendTime) { |
| | | wq.between(TjOrder::getCreateTime, DateUtil.beginOfDay(djbeginTime), DateUtil.endOfDay(djendTime)); |
| | | wq.in(TjOrder::getFirmId, list); |
| | | } |
| | | wq.eq(TjOrder::getUserId, customer.getCusId()); |
| | | list1.addAll(tjOrderService.list(wq)); |
| | | } |
| | | List<TjOrder> collect = null; |
| | | if (!list1.isEmpty()) { |
| | | for (TjOrder order : list1) { |
| | | TjCustomer tjCustomer = tjCustomerService.getById(order.getUserId()); |
| | | if (null != tjCustomer) { |
| | | // order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | | order.setTjCustomerName(tjCustomer.getCusName()); |
| | | // order.setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | order.setTjCustomerPhone(tjCustomer.getCusPhone()); |
| | | // order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | | order.setTjCusIdCard(tjCustomer.getCusIdcard()); |
| | | order.setTjCustomerSex(tjCustomer.getCusSex()); |
| | | order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | order.setCareer(tjCustomer.getCareer()); |
| | | order.setIdType(tjCustomer.getIdType()); |
| | | order.setAgeUnit(tjCustomer.getAgeUnit()); |
| | | order.setTjCount(String.valueOf(tjCustomer.getCusNumber())); |
| | | if (null != tjCustomer.getCompName()) { |
| | | order.setDictCompName(tjCustomer.getCompName()); |
| | | } else { |
| | | String firmId = order.getFirmId(); |
| | | if (firmId != null && null != iDictCompService.getById(String.valueOf(order.getFirmId()))) { |
| | | order.setDictCompName(iDictCompService.getById(String.valueOf(order.getFirmId())).getCnName()); |
| | | } |
| | | } |
| | | |
| | | if (null != order.getPacId()) { |
| | | if (null != tjPackageService.getById(order.getPacId())) { |
| | | order.setPacName(tjPackageService.getById(order.getPacId()).getPacName()); |
| | | } |
| | | if (null != dwDeptService.getById(order.getPacId())) { |
| | | order.setPacName(dwDeptService.getById(order.getPacId()).getDwDeptName()); |
| | | } |
| | | } |
| | | TjDjdDyjl dycs = djdDyjlService.getDjdDyCsByTjNum(order.getTjNumber()); |
| | | if (null != dycs) order.setDycs(Math.toIntExact(dycs.getDycs())); |
| | | } |
| | | } |
| | | collect = list1.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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | Page<TjOrder> page1 = new Page<>(pageNum, pageSize); |
| | |
| | | |
| | | if (null != xmmc) { |
| | | wq.in(TjOrder::getTjNumber, projectService.getTjNumLIstByXmmx(xmmc)); |
| | | } |
| | | |
| | | if (StrUtil.isNotBlank(dw)){ |
| | | LambdaQueryWrapper<DictComp> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.like(DictComp::getCnName,dw); |
| | | List<String> list = iDictCompService.list(wrapper).stream().map(DictComp::getDrugManufacturerId).collect(Collectors.toList()); |
| | | wq.in(TjOrder::getFirmId,list); |
| | | } |
| | | |
| | | wq.orderByDesc(TjOrder::getCreateTime); |
| | |
| | | TjDjdDyjl dycs = djdDyjlService.getDjdDyCsByTjNum(order.getTjNumber()); |
| | | if (null != dycs) order.setDycs(Math.toIntExact(dycs.getDycs())); |
| | | } |
| | | int czwj = remarkService.panduaniscunzaiweijian(order.getTjNumber()); |
| | | int sfwc = remarkService.panduaniswancheng(order.getTjNumber()); |
| | | Date checkTime = order.getCheckTime(); |
| | | Date reportTime = order.getReportTime(); |
| | | Integer heshouStatus = order.getHeshouStatus(); |
| | | Date lastTime = order.getPrintLastTime(); |
| | | if (czwj == 0) { |
| | | //未检 |
| | | order.setZt("未检"); |
| | | } else if (czwj > 0) { |
| | | //在检 |
| | | order.setZt("在检"); |
| | | } else if (sfwc == 0) { |
| | | //已完成 |
| | | order.setZt("已完成"); |
| | | } else if (null != checkTime) { |
| | | //已审核 |
| | | order.setZt("已审核"); |
| | | } else if (null != reportTime) { |
| | | //生成报告 |
| | | order.setZt("生成报告"); |
| | | } else if (null != heshouStatus) { |
| | | //报告核收 |
| | | order.setZt("报告核收"); |
| | | } else if (null != lastTime) { |
| | | //已出报告 |
| | | order.setZt("已出报告"); |
| | | } else { |
| | | order.setZt("未检"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | map.put("list", list); |
| | |
| | | } else { |
| | | map.put("total", 0); |
| | | } |
| | | if (collect == null) collect = new ArrayList<>(); |
| | | map.put("list", collect); |
| | | return AjaxResult.success(map); |
| | | } |
| | |
| | | } |
| | | 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(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |