| | |
| | | private ISysDeptService deptService; |
| | | |
| | | |
| | | |
| | | @GetMapping("/getOperationPermissionsByTjNum") |
| | | @ApiOperation(value = "(初审页面 和 医生页面)根据体检号获取是否可操作权限接口 true可操作 反之不可") |
| | | public AjaxResult getOperationPermissionsByTjNum(@ApiParam(value = "体检号") @RequestParam String tjNumber) { |
| | | TjOrder order = orderService.getOrderByTjNum(tjNumber); |
| | | if(null !=order){ |
| | | if (null != order) { |
| | | Integer status = order.getStatus(); |
| | | if(status<300){ |
| | | if (status < 300) { |
| | | return AjaxResult.success(true); |
| | | } |
| | | if(status>300){ |
| | | if (status > 300) { |
| | | return AjaxResult.success(false); |
| | | } |
| | | } |
| | | return AjaxResult.success(false); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/getCsList") |
| | |
| | | customer.setTjNumber(tjOrder.getTjNumber()); |
| | | customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | customer.setOrderId(tjOrder.getOrderId()); |
| | | customer.setTjTime(tjOrder.getFinishTime()); |
| | | customer.setTjTime(tjOrder.getCreateTime()); |
| | | customer.setFinishTime(tjOrder.getFinishTime()); |
| | | customer.setCusName(MatchUtils.hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | |
| | | } |
| | | |
| | | //条件查询 |
| | | if(null != tjNumber || null !=compId || (null !=beginTime && null !=endTime)){ |
| | | if (null != tjNumber || null != compId || (null != beginTime && null != endTime)) { |
| | | orderList = orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | return getResult(page, pageSize, orderList, customerList, map); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 初审 |
| | | */ |
| | |
| | | vo.setDeptName(deptService.getById(remark.getDeptId()).getDeptName()); |
| | | vo.setProName(projectService.getById(remark.getProId()).getProName()); |
| | | vo.setType(remark.getType()); |
| | | if(null !=remark.getDoctorName()){ |
| | | if (null != remark.getDoctorName()) { |
| | | vo.setDoctorName(userService.getById(remark.getDoctorName()).getNickName()); |
| | | vo.setBcdoctorName(userService.getById(remark.getDoctorName()).getNickName()); |
| | | } |
| | |
| | | vo.setZhupdateTime(remark.getUpdateTime()); |
| | | list.add(vo); |
| | | } |
| | | |
| | | Collections.sort(list, new Comparator<CsProVo>() { |
| | | @Override |
| | | public int compare(CsProVo o1, CsProVo o2) { |
| | | return o1.getType() - o2.getType(); |
| | | } |
| | | }); |
| | | } |
| | | return AjaxResult.success(list); |
| | | } |
| | |
| | | * 初审 |
| | | */ |
| | | @GetMapping("/confirmOrder") |
| | | @ApiOperation(value = "初审(并修改状态)接口") |
| | | @PreAuthorize("@ss.hasPermi('check:check:confirmOrder')") |
| | | @ApiOperation(value = "初审(并修改状态)接口") |
| | | // @PreAuthorize("@ss.hasPermi('check:check:confirmOrder')") |
| | | @Transactional |
| | | public AjaxResult confirmOrder(@ApiParam(value = "tjNumber") @RequestParam String tjNumber, |
| | | @ApiParam(value = "状态 0同意1拒绝 默认同意") @RequestParam(defaultValue = "0") Integer status, |
| | | @ApiParam(value = "状态 0同意 1拒绝 默认同意") @RequestParam(defaultValue = "0") Integer status, |
| | | @ApiParam(value = "驳回理由") @RequestParam(required = false) String remark) { |
| | | int num = orderRemarkService.getTjYqOrderRemarkByTjNum(tjNumber); |
| | | if (num > 0) return AjaxResult.error("有延期项目暂不能审核!"); |
| | |
| | | tjOrder.setConfirmTime(new DateTime()); |
| | | tjOrder.setConfirmDoctor(sysUser.getNickName()); |
| | | tjOrder.setConfirmStatus(remark); |
| | | if(status==0){ |
| | | if (status == 0) { |
| | | tjOrder.setStatus(TjConstants.TJ_CHECK); |
| | | }else { |
| | | asyncService.updateCheckType(tjNumber); |
| | | } else { |
| | | tjOrder.setStatus(TjConstants.TJ_REFUSED); |
| | | } |
| | | if (orderService.updateById(tjOrder)) { |
| | |
| | | */ |
| | | @GetMapping("/getList") |
| | | @ApiOperation(value = "查询体检记录客户列表")//0待1已 |
| | | @PreAuthorize("@ss.hasPermi('check:check:getList')") |
| | | // @PreAuthorize("@ss.hasPermi('check:check:getList')") |
| | | public AjaxResult getList(@ApiParam(value = "审核状态0待审核1已审核") @RequestParam(required = false) Integer checkStatus, |
| | | @ApiParam(value = "页码数(默认1)") @RequestParam(defaultValue = "1") Integer page, |
| | | @ApiParam(value = "显示条数(默认10)") @RequestParam(defaultValue = "10") Integer pageSize, |
| | |
| | | } |
| | | |
| | | //条件查询 |
| | | if(null != tjNumber || null !=compId || (null !=beginTime && null !=endTime)){ |
| | | if (null != tjNumber || null != compId || (null != beginTime && null != endTime)) { |
| | | //判断是否开启初审 |
| | | if ("Y".equals(config)) { |
| | | orderList = orderService.getCsTjOrderList1(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | |
| | | customers = redisCache.getCacheMapValue("check", "ys"); |
| | | } |
| | | if (customers != null && customers.size() > 0) { |
| | | // asyncService.addRedis(customers); |
| | | List<TjCustomer> customerLists = customers.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | map.put("customers", customerLists); |
| | | map.put("total", customers.size()); |
| | |
| | | */ |
| | | @PutMapping("/getTjdetailList") |
| | | @ApiOperation(value = "根据体检订单号获取体检详情信息(并修改状态)接口") |
| | | @PreAuthorize("@ss.hasPermi('check:check:getTjdetailList')") |
| | | // @PreAuthorize("@ss.hasPermi('check:check:getTjdetailList')") |
| | | public AjaxResult getTjdetailList(@ApiParam(value = "体检tjNumber") @RequestParam String tjNumber, |
| | | @ApiParam(value = "总检建议") @RequestParam(required = false) String advice, |
| | | @ApiParam(value = "审核状态0待审核1已审核") @RequestParam Integer checkStatus) { |
| | |
| | | LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.eq(TbTransition::getCusId, customer.getCusIdcard()); |
| | | transitionService.remove(wqq); |
| | | asyncService.updateCheckType(tjNumber); |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | | return AjaxResult.error("操作失败"); |
| | |
| | | */ |
| | | @GetMapping("/updateCheckType") |
| | | @ApiOperation(value = "总检点击体检信息详情") |
| | | @PreAuthorize("@ss.hasPermi('check:check:updateCheckType')") |
| | | public AjaxResult updateCheckType(@ApiParam(value = "客户体检号") @RequestParam String tjNumber) { |
| | | if(redisCache.hasKey("updateCheckType"+tjNumber)) { |
| | | List<Map<String, Object>> cacheMapValue = redisCache.getCacheMapValue("updateCheckType" + tjNumber, tjNumber); |
| | | return AjaxResult.success(cacheMapValue); |
| | | } |
| | | return getAjaxResult(tjNumber); |
| | | } |
| | | |
| | | private AjaxResult getAjaxResult(String tjNumber) { |
| | | |
| | | asyncService.updateCheckType(tjNumber); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | LambdaQueryWrapper<TjOrder> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjOrder::getTjNumber, tjNumber); |
| | | TjOrder one = orderService.getOne(wq1); |
| | | TjOrder one = orderService.getOrderByTjNum(tjNumber); |
| | | |
| | | if (one == null) { |
| | | return AjaxResult.error("暂无数据!!"); |
| | | } |
| | | LambdaQueryWrapper<TjCustomer> wq22 = new LambdaQueryWrapper<>(); |
| | | wq22.eq(TjCustomer::getCusId, one.getUserId()); |
| | | TjCustomer customer = customerService.getOne(wq22); |
| | | LambdaQueryWrapper<TjOrderRemark> wqm = new LambdaQueryWrapper<>(); |
| | | wqm.eq(TjOrderRemark::getTjNumber, tjNumber); |
| | | wqm.eq(TjOrderRemark::getType, 1); |
| | | List<TjOrderRemark> remarkList = orderRemarkService.list(wqm); |
| | | |
| | | TjCustomer customer = customerService.getById(one.getUserId()); |
| | | List<TjOrderRemark> remarkList = orderRemarkService.getRemarkListByTjNumAndType(tjNumber); |
| | | |
| | | if (null != remarkList && remarkList.size() > 0) { |
| | | for (TjOrderRemark remark : remarkList) { |
| | | Map<String, Object> parent = new HashMap<>(); |
| | |
| | | parent.put("parent", project.getProName()); |
| | | parent.put("parentId", project.getProId().toString()); |
| | | } |
| | | LambdaQueryWrapper<TjProject> wq2 = new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjProject::getProParentId, remark.getProId()); |
| | | List<Long> sonsTjProjectList = projectService.list(wq2).stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | if (sonsTjProjectList.size() > 0) { |
| | | LambdaQueryWrapper<TjOrderDetail> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderDetail::getOrderId, one.getOrderId()); |
| | | wq.in(TjOrderDetail::getProId, sonsTjProjectList); |
| | | List<TjOrderDetail> tjOrderDetails = detailService.list(wq); |
| | | if (null != tjOrderDetails && tjOrderDetails.size() > 0) { |
| | | for (TjOrderDetail tjOrderDetail : tjOrderDetails) { |
| | | LambdaQueryWrapper<TjProject> wqqqq = new LambdaQueryWrapper<>(); |
| | | wqqqq.eq(TjProject::getProId, tjOrderDetail.getProId()); |
| | | tjOrderDetail.setProject(projectService.getOne(wqqqq)); |
| | | LambdaQueryWrapper<TjStandard> wq6 = new LambdaQueryWrapper<>(); |
| | | wq6.eq(TjStandard::getProId, tjOrderDetail.getProId()); |
| | | List<TjStandard> list2 = tjStandardService.list(wq6); |
| | | if (list2.size() == 0) { |
| | | tjOrderDetail.setStandard(new TjStandard()); |
| | | } else if (list2.size() == 1) { |
| | | tjOrderDetail.setStandard(list2.get(0)); |
| | | } else { |
| | | for (TjStandard tjStandard : list2) { |
| | | LambdaQueryWrapper<TjStandard> wq8 = new LambdaQueryWrapper<>(); |
| | | if (tjStandard.getTjSex() != null) { |
| | | wq8.eq(TjStandard::getTjSex, customer.getCusSex()); |
| | | } |
| | | if (tjStandard.getTjType() != null) { |
| | | wq8.eq(TjStandard::getTjType, StringUtils.getAgeType(DateUtil.ageOfNow(customer.getCusBrithday()))); |
| | | } |
| | | tjOrderDetail.setStandard(tjStandardService.getOne(wq8)); |
| | | } |
| | | } |
| | | List<TjOrderDetail> tjOrderDetails = detailService.getDetailByOrderIdAndParId(one.getOrderId(), remark.getProId()); |
| | | if (null != tjOrderDetails && tjOrderDetails.size() > 0) { |
| | | for (TjOrderDetail tjOrderDetail : tjOrderDetails) { |
| | | final TjProject byId = projectService.selectTjProjectByProId(tjOrderDetail.getProId()); |
| | | if(null==byId){ |
| | | detailService.removeById(tjOrderDetail.getOrderDetailId()); |
| | | }else { |
| | | tjOrderDetail.setProject(byId); |
| | | } |
| | | String summary = remark.getSummary(); |
| | | if (null != summary) { |
| | | String[] split = summary.split(";"); |
| | | LambdaQueryWrapper<TjAdvice> wq3 = new LambdaQueryWrapper<>(); |
| | | wq3.in(TjAdvice::getId, Arrays.asList(split)); |
| | | List<TjAdvice> advices = tjAdviceService.list(wq3); |
| | | if (null != advices && advices.size() > 0) { |
| | | StringBuilder string = new StringBuilder(); |
| | | for (TjAdvice advice : advices) { |
| | | string.append(advice.getTitle()).append(";"); |
| | | } |
| | | parent.put("parentAdvice", string); |
| | | } |
| | | List<TjStandard> list2 = tjStandardService.getTjStandardListByProId(String.valueOf(tjOrderDetail.getProId())); |
| | | if (list2.size() == 0) { |
| | | tjOrderDetail.setStandard(new TjStandard()); |
| | | } else if (list2.size() == 1) { |
| | | tjOrderDetail.setStandard(list2.get(0)); |
| | | } else { |
| | | parent.put("parentAdvice", null); |
| | | final int ageType = StringUtils.getAgeType(DateUtil.ageOfNow(customer.getCusBrithday())); |
| | | TjStandard tjStandard1=tjStandardService.getListBySexAndType(customer.getCusSex(),ageType, String.valueOf(tjOrderDetail.getProId())); |
| | | tjOrderDetail.setStandard(tjStandard1); |
| | | } |
| | | parent.put("sons", tjOrderDetails); |
| | | parent.put("remark", remark.getRemark()); |
| | | if (remark.getDoctorName() != null && null != userService.getById(remark.getDoctorName())) { |
| | | parent.put("doctorName", userService.getById(remark.getDoctorName()).getNickName()); |
| | | } |
| | | list.add(parent); |
| | | } else { |
| | | return AjaxResult.success("该客户没有体检项目数据"); |
| | | } |
| | | String summary = remark.getSummary(); |
| | | if (null != summary) { |
| | | String[] split = summary.split(";"); |
| | | // List<Long> longList = new ArrayList<>(); |
| | | // for (String str : split) { |
| | | // if(!"".equals(str)){ |
| | | // longList.add(Long.valueOf(str)); |
| | | // } |
| | | // } |
| | | // parent.put("parentAdvice", tjAdviceService.getAdviceStringByIds(longList)); |
| | | parent.put("parentAdvice", tjAdviceService.getAdviceStringsByIds(Arrays.asList(split))); |
| | | |
| | | } else { |
| | | parent.put("parentAdvice", null); |
| | | } |
| | | parent.put("sons", tjOrderDetails); |
| | | parent.put("remark", remark.getRemark()); |
| | | if (remark.getDoctorName() != null && null != userService.getById(remark.getDoctorName())) { |
| | | parent.put("doctorName", userService.getById(remark.getDoctorName()).getNickName()); |
| | | } |
| | | list.add(parent); |
| | | } else { |
| | | return AjaxResult.success("该客户没有体检项目数据"); |
| | | } |
| | | // } |
| | | } |
| | | return AjaxResult.success(list); |
| | | } |
| | |
| | | |
| | | @GetMapping("/getTm") |
| | | @ApiOperation(value = "获取条码") |
| | | @PreAuthorize("@ss.hasPermi('check:check:getTm')") |
| | | // @PreAuthorize("@ss.hasPermi('check:check:getTm')") |
| | | public AjaxResult getTm(@ApiParam(value = "客户体检号") @RequestParam String tjNumber) { |
| | | return AjaxResult.success(tjNumber); |
| | | } |
| | | |
| | | /** |
| | | * 总检修改备注 |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/checkUpdateOrderRemark") |
| | |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | /*private boolean getAjaxResult(@RequestParam(defaultValue = "1") @ApiParam("页码数(默认1)") Integer page, |
| | | @RequestParam(defaultValue = "10") @ApiParam("显示条数(默认10)") Integer pageSize, |
| | | List<TjOrder> orderList, |
| | | List<TjCustomer> customerList, |
| | | Map<String, Object> map) { |
| | | if (null != orderList && orderList.size() > 0) { |
| | | for (TjOrder tjOrder : orderList) { |
| | | TjCustomer customer = customerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | if (null == customer) { |
| | | continue; |
| | | } |
| | | customer.setCusName(MatchUtils.hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | customer.setTjNumber(tjOrder.getTjNumber()); |
| | | customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | customer.setOrderId(tjOrder.getOrderId()); |
| | | customer.setTjTime(tjOrder.getCreateTime()); |
| | | customer.setFinishTime(tjOrder.getFinishTime()); |
| | | if (tjOrder.getFirmId() == null || tjOrder.getFirmId().equals("0")) { |
| | | customer.setTjCompName("无"); |
| | | } else { |
| | | customer.setTjCompName(compService.getById(tjOrder.getFirmId()).getCnName()); |
| | | } |
| | | customerList.add(customer); |
| | | } |
| | | List<TjCustomer> customers = customerList.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | map.put("customers", customers); |
| | | map.put("total", customerList.size()); |
| | | return true; |
| | | } |
| | | return false; |
| | | }*/ |
| | | } |