| | |
| | | order.setZt("在检"); |
| | | orders.add(order); |
| | | } |
| | | if (zt==2 && sfwc == 0) { |
| | | if (zt==2 && sfwc == 0 && order.getCheckStatus()==0 && order.getCheckTime()==null && order.getHeshouStatus()==0 && order.getPrintLastTime()==null) { |
| | | //已完成2 |
| | | order.setZt("已完成"); |
| | | orders.add(order); |
| | |
| | | |
| | | if(null !=zt){ |
| | | if(zt==3){ |
| | | //已审核 |
| | | wq.isNotNull(TjOrder::getCheckTime); |
| | | wq.eq(TjOrder::getCheckStatus,1); |
| | | wq.isNull(TjOrder::getHeshouTime); |
| | | wq.isNull(TjOrder::getPrintLastTime); |
| | | wq.eq(TjOrder::getHeshouStatus,0); |
| | | } |
| | | if(zt==4){ |
| | | //生成报告 |
| | | wq.isNotNull(TjOrder::getReportTime); |
| | | wq.isNull(TjOrder::getHeshouTime); |
| | | wq.isNull(TjOrder::getPrintLastTime); |
| | | wq.eq(TjOrder::getHeshouStatus,0); |
| | | } |
| | | if(zt==5){ |
| | | //报告核收 |
| | | wq.eq(TjOrder::getHeshouStatus,1); |
| | | wq.isNull(TjOrder::getPrintLastTime); |
| | | } |
| | | if(zt==6){ |
| | | //已出报告 |
| | | wq.isNotNull(TjOrder::getPrintLastTime); |
| | | wq.eq(TjOrder::getHeshouStatus,1); |
| | | wq.isNotNull(TjOrder::getPrintLastTime); |
| | | } |
| | | } |
| | |
| | | @ApiOperation(value = "体检报告页面——体检记录列表") |
| | | public AjaxResult getOrderListOO(@ApiParam(value = "页码数(默认1)") @RequestParam(defaultValue = "1") Integer pageNum, |
| | | @ApiParam(value = "显示条数(默认10)") @RequestParam(defaultValue = "10") Integer pageSize, |
| | | @ApiParam(value = "打印未打印状态 0未打印 1已打印") @RequestParam(defaultValue = "0") Integer dyzt, |
| | | @ApiParam(value = "打印未打印状态 0未打印 1已打印") @RequestParam(required = false) Integer dyzt, |
| | | @ApiParam(value = "体检号)") @RequestParam(required = false) String tjNum, |
| | | @ApiParam(value = "姓名)") @RequestParam(required = false) String name, |
| | | @ApiParam(value = "单位") @RequestParam(required = false) String dw, |
| | | @ApiParam(value = "报告开始时间") @RequestParam(required = false) String djbeginTime, |
| | | @ApiParam(value = "报告结束时间") @RequestParam(required = false) String djendTime) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | /* Map<String, Object> map = new HashMap<>(); |
| | | List<Long> cusIds = null; |
| | | if (StringUtil.isNotBlank(name)) { |
| | | LambdaQueryWrapper<TjCustomer> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.like(TjCustomer::getCusName, name); |
| | | cusIds = tjCustomerService.list(wqq).stream().map(TjCustomer::getCusId).collect(Collectors.toList()); |
| | | // if (null != customerList && !customerList.isEmpty()) { |
| | | // List<TjOrder> list = new ArrayList<>(); |
| | | // for (TjCustomer customer : customerList) { |
| | | // LambdaQueryWrapper<TjOrder> wq = new LambdaQueryWrapper<>(); |
| | | // wq.eq(TjOrder::getUserId, customer.getCusId()); |
| | | // if (dyzt == 0) { |
| | | // wq.isNull(TjOrder::getPrintLastTime); |
| | | // wq.eq(TjOrder::getHeshouStatus, 1); |
| | | // } else { |
| | | // wq.isNotNull(TjOrder::getPrintLastTime); |
| | | // } |
| | | // list.addAll(tjOrderService.list(wq)); |
| | | // } |
| | | // List<TjOrder> collect = null; |
| | | // if (!list.isEmpty()) { |
| | | // |
| | | // for (int i = 0; i < list.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()); |
| | | // } |
| | | // } |
| | | // } |
| | | // 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); |
| | | // } |
| | | // 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); |
| | | // List<TjCustomer> customerList = tjCustomerService.list(wqq); |
| | | // List<TjOrder> list = new ArrayList<>(); |
| | | // if (null != customerList && !customerList.isEmpty()) { |
| | | // for (TjCustomer customer : customerList) { |
| | | // LambdaQueryWrapper<TjOrder> wq = new LambdaQueryWrapper<>(); |
| | | // wq.eq(TjOrder::getUserId, customer.getCusId()); |
| | | // if (dyzt == 0) { |
| | | // wq.isNull(TjOrder::getPrintLastTime); |
| | | // wq.eq(TjOrder::getHeshouStatus, 1); |
| | | // } else { |
| | | // wq.isNotNull(TjOrder::getPrintLastTime); |
| | | // } |
| | | // list.addAll(tjOrderService.list(wq)); |
| | | // } |
| | | // } |
| | | // List<String> dwIds = iDictCompService.getdwIdByDwName(dw); |
| | | // |
| | | // LambdaQueryWrapper<TjOrder> wq = new LambdaQueryWrapper<>(); |
| | | // 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 (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()); |
| | | // } |
| | | // } |
| | | // } |
| | | // 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); |
| | | // |
| | | // |
| | | // } |
| | | |
| | | |
| | | Page<TjOrder> page1 = new Page<>(pageNum, pageSize); |
| | | LambdaQueryWrapper<TjOrder> wq = new LambdaQueryWrapper<>(); |
| | | if (dyzt == 0) { |
| | |
| | | } |
| | | } |
| | | map.put("list", list); |
| | | map.put("total", page2.getTotal()); |
| | | map.put("total", page2.getTotal());*/ |
| | | |
| | | if (djbeginTime == null) djbeginTime = ""; |
| | | if (djendTime == null) djendTime = ""; |
| | | Map<String, Object> map= tjOrderService.getTjBgdyList(pageNum,pageSize,dyzt,tjNum,name,dw,djbeginTime,djendTime); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | |
| | | // } |
| | | } |
| | | |
| | | @PostMapping("/heXiaoByIds/{orderIds}") |
| | | @PostMapping("/heXiaoByIds") |
| | | @ApiOperation(value = "核收报告——————总检审核通过后可以核销,核收后才能打印") |
| | | @Transactional |
| | | @RepeatSubmit |
| | | public AjaxResult heXiaoByIds(@PathVariable String[] orderIds) { |
| | | public AjaxResult heXiaoByIds(@RequestBody List<String> orderIds) { |
| | | if(null !=orderIds && !orderIds.isEmpty()){ |
| | | Date date = new Date(); |
| | | for (String orderId : orderIds) { |
| | | TjOrder byId = tjOrderService.getById(orderId); |
| | | if (null != byId) { |
| | | if (byId.getReportTime() == null) { |
| | | |
| | | /*if (byId.getReportTime() == null) { |
| | | LambdaQueryWrapper<TjReportTemplate> tjReportTemplateLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | tjReportTemplateLambdaQueryWrapper.eq(TjReportTemplate::getFlag, 1); |
| | | tjReportTemplateLambdaQueryWrapper.eq(TjReportTemplate::getOpen, 0); |
| | |
| | | //修改order表中的打印报告时间为当前时间 |
| | | LambdaUpdateWrapper<TjOrder> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(TjOrder::getTjNumber, byId.getTjNumber()); |
| | | // updateWrapper.set(TjOrder::getReportTime, new Date()); |
| | | // updateWrapper.set(TjOrder::getPrintLastTime, new Date()); |
| | | // updateWrapper.set(TjOrder::getDownloadLastTime, new Date()); |
| | | updateWrapper.set(TjOrder::getStatus, TjConstants.TJ_END); |
| | | tjOrderService.update(updateWrapper); |
| | | } |
| | | String hisRegistrationId = byId.getCardId(); |
| | | Date createTime = byId.getCreateTime(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String ksrq = dateFormat.format(createTime); |
| | | String jsrq = dateFormat.format(date); |
| | | HashMap<String, Object> params = new HashMap<>(); |
| | | params.put("his_registration_id", hisRegistrationId); |
| | | params.put("ksbm", ""); |
| | | params.put("pationid", ""); |
| | | params.put("ksrq", ksrq); |
| | | params.put("jsrq", jsrq); |
| | | params.put("pagecount", 100); |
| | | params.put("page", 1); |
| | | |
| | | LambdaQueryWrapper<TjCustomer> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjCustomer::getCusId, byId.getUserId()); |
| | | TjCustomer tjCustomer = tjCustomerService.getOne(wq1); |
| | |
| | | try { |
| | | shengchengbgmoban(byId.getTjNumber(), byId, tjCustomer, reportTemplate, zongJianYiShiQianMing); |
| | | byId.setStatus(TjConstants.TJ_END); |
| | | // byId.setReportTime(date); |
| | | // byId.setPrintLastTime(date); |
| | | // byId.setDownloadLastTime(date); |
| | | } catch (Exception e) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | e.printStackTrace(); |
| | |
| | | logger.error("生成报告异常"); |
| | | return AjaxResult.error("生成报告异常,核收失败"); |
| | | } |
| | | } |
| | | |
| | | }*/ |
| | | byId.setHeshouStatus(1); |
| | | byId.setHeshouDoctor(UserHoder.getLoginUser().getUserId()); |
| | | byId.setHeshouTime(date); |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return AjaxResult.success("核收成功"); |
| | | } |
| | | |
| | | |
| | | public AjaxResult shengchengbgmoban(String tjNumber, TjOrder tjOrder, TjCustomer tjCustomer, TjReportTemplate reportTemplate, TjReportTemplate zongJianYiShiQianMing) throws Exception { |
| | | // AjaxResult ajaxResult = hisPDFUtil.hisPDF(tjOrder, tjCustomer, reportTemplate); |
| | | // AjaxResult ajaxResult = hisPDFUtil.hisPDFNew(tjOrder, tjCustomer, reportTemplate); |
| | | |
| | | AjaxResult ajaxResult = hisPDFUtil.hisPDFNew2(tjOrder, tjCustomer, reportTemplate, zongJianYiShiQianMing); |
| | | if (!ajaxResult.get("code").toString().equals("200")) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | tjReport.setType("体检报告"); |
| | | tjReport.setPrint("pdf"); |
| | | tjReportService.save(tjReport); |
| | | // Date date = new Date(); |
| | | // tjOrder.setStatus(TjConstants.TJ_END); |
| | | // tjOrder.setReportTime(date); |
| | | // tjOrder.setPrintLastTime(date); |
| | | // tjOrder.setDownloadLastTime(date); |
| | | // tjOrderService.updateById(tjOrder); |
| | | } |
| | | return ajaxResult; |
| | | } |
| | |
| | | wq.eq(TjOrderRemark::getTjNumber, tjNUm); |
| | | wq.eq(TjOrderRemark::getProId, proId); |
| | | TjOrderRemark remark = remarkService.getOne(wq); |
| | | remark.setType(1); |
| | | remark.setType(2); |
| | | remarkService.updateById(remark); |
| | | return AjaxResult.success("操作成功!"); |
| | | } |
| | |
| | | //生成报告 |
| | | a=4; |
| | | } |
| | | if (null != heshouStatus) { |
| | | if (heshouStatus==1) { |
| | | //报告核收 |
| | | a=5; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/heshouchexiao") |
| | | @ApiOperation(value = "撤销报告接口") |
| | | @Transactional |
| | | public AjaxResult heshouchexiao(@RequestBody List<String> tjNUms) { |
| | | |
| | | if(null !=tjNUms && !tjNUms.isEmpty()){ |
| | | |
| | | // 不在使用逻辑删除 逻辑删除导致打印报告生成 查询sql缓慢 |
| | | //逻辑删除数据库里的报告 |
| | | LambdaQueryWrapper<TjReport> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.select(TjReport::getReId); |
| | | wq1.in(TjReport::getTjNumber, tjNUms); |
| | | wq1.eq(TjReport::getPrint, "pdf"); |
| | | List<Long> list = tjReportService.list(wq1).stream().map(TjReport::getReId).collect(Collectors.toList()); |
| | | for (String tjNUm : tjNUms) { |
| | | TjOrder order = tjOrderService.getOrderByTjNum(tjNUm); |
| | | if(null !=order){ |
| | | order.setHeshouStatus(0); |
| | | order.setHeshouTime(null); |
| | | order.setHeshouDoctor(null); |
| | | order.setPrintLastTime(null); |
| | | order.setReportTime(null); |
| | | order.setStatus(TjConstants.TJ_WAIT); |
| | | if (!tjOrderService.updateById(order)) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("操作失败"); |
| | | } |
| | | } |
| | | } |
| | | int i = tjReportService.deleteTjReportByReIds(list.toArray(new Long[]{})); |
| | | if (i == 0) { |
| | | return AjaxResult.error("撤回失败!"); |
| | | } |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |