| | |
| | | import com.ltkj.common.annotation.RepeatSubmit; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | import com.ltkj.common.core.domain.entity.SysDept; |
| | | import com.ltkj.common.core.domain.entity.SysDictData; |
| | | import com.ltkj.common.core.domain.entity.SysRole; |
| | | import com.ltkj.common.core.domain.entity.SysUser; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.common.enums.DataSourceType; |
| | |
| | | import com.ltkj.framework.config.UserHoder; |
| | | import com.ltkj.framework.datasource.DynamicDataSourceContextHolder; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.dto.CheckUpdateStatusDto; |
| | | import com.ltkj.hosp.mapper.TestMapper; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.hosp.sqlDomain.*; |
| | |
| | | import com.ltkj.mall.mallOrderUtils.TjConstants; |
| | | import com.ltkj.system.service.ISysConfigService; |
| | | import com.ltkj.system.service.ISysDeptService; |
| | | import com.ltkj.system.service.ISysDictDataService; |
| | | import com.ltkj.system.service.ISysUserService; |
| | | import com.ltkj.web.controller.his.HisApiGetMethodService; |
| | | import com.ltkj.web.controller.his.HisApiMethodService; |
| | |
| | | import org.redisson.api.RedissonClient; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.transaction.NoTransactionException; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | private ITjOrderRemarkService orderRemarkService; |
| | | @Resource |
| | | private ITbTransitionService transitionService; |
| | | @Resource |
| | | private ISysUserService userService; |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | @Resource |
| | | private TjAsyncService asyncService; |
| | | @Resource |
| | |
| | | private ISysDeptService deptService; |
| | | @Resource |
| | | private TestMapper testMapper; |
| | | @Resource |
| | | private TjvLtkjvtjpatService tjvLtkjvtjpatService; |
| | | @Resource |
| | | private LtkjMiddleDetailService middleDetailService; |
| | | @Resource |
| | | private LtkjMiddleHeadService headService; |
| | | @Resource |
| | | private LtkjExamJcbgdService jcbgdService; |
| | | @Resource |
| | |
| | | @Autowired |
| | | private SysConfigController configController; |
| | | @Autowired |
| | | private TjJcycxmService jcycxmService; |
| | | @Resource |
| | | private TjXdtgmdjgService xdtgmdjgService; |
| | | @Resource |
| | | private TjXdPictureController pictureController; |
| | | private TjReportController reportController; |
| | | @Autowired |
| | | private ISysDictDataService sysDictDataService; |
| | | |
| | | @GetMapping("/ceshicc") |
| | | @ApiOperation(value = "测试调用存储过程耗时接口") |
| | |
| | | @ApiParam(value = "姓名)") @RequestParam(required = false) String name, |
| | | @ApiParam(value = "开始时间") @RequestParam(required = false) String beginTime, |
| | | @ApiParam(value = "结束时间") @RequestParam(required = false) String endTime, |
| | | @ApiParam(value = "体检类型") @RequestParam(required = false) String tjCategory) { |
| | | @ApiParam(value = "体检类型") @RequestParam(required = false) String tjCategory, |
| | | @ApiParam(value = "体检类型") @RequestParam(required = false) String tcm) { |
| | | // String config = configService.selectConfigByKey("tj_confirm"); |
| | | // DateTime beginTimes = null; |
| | | // DateTime endTimes = null; |
| | |
| | | if (name == null) name = ""; |
| | | if (beginTime == null) beginTime = ""; |
| | | if (endTime == null) endTime = ""; |
| | | return AjaxResult.success(orderService.getCunChuGuoChengCustomerList(tjNumber, page, pageSize, checkStatus, value, beginTime, endTime, name,tjCategory)); |
| | | return AjaxResult.success(orderService.getCunChuGuoChengCustomerList(tjNumber, page, pageSize, checkStatus, value, beginTime, endTime, name,tjCategory,tcm)); |
| | | } |
| | | |
| | | |
| | |
| | | /** |
| | | * 根据体检订单号获取体检详情信息接口 |
| | | * |
| | | * @param tjNumber |
| | | * @param advice |
| | | * @param checkStatus |
| | | * @return |
| | | */ |
| | | @PutMapping("/getTjdetailList") |
| | | @PostMapping("/getTjdetailList") |
| | | @ApiOperation(value = "根据体检订单号获取体检详情信息(并修改状态)接口") |
| | | // @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, |
| | | @ApiParam(value = "职业结论") @RequestParam(required = false) String zhiyeJl, |
| | | @ApiParam(value = "职业结果") @RequestParam(required = false) String zhiyeJg) { |
| | | @Transactional |
| | | public AjaxResult getTjdetailList(@RequestBody CheckUpdateStatusDto dto) { |
| | | |
| | | String config = configService.selectConfigByKey("sfjcwjhyqxm"); |
| | | if (null != config && config.equalsIgnoreCase("Y")) { |
| | | int num = orderRemarkService.getTjYqOrderRemarkByTjNum(tjNumber); |
| | | if (num > 0) return AjaxResult.error("存在未检或延期项目暂不能生成报告!!!"); |
| | | } |
| | | Date date = new Date(); |
| | | if (null != tjNumber) { |
| | | Long userId = Long.valueOf(SecurityUtils.getLoginUser().getUserId()); |
| | | SysUser sysUser = userService.getById(userId); |
| | | LambdaQueryWrapper<TjOrder> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjOrder::getTjNumber, tjNumber); |
| | | TjOrder tjOrder = orderService.getOne(wq1); |
| | | if (null != tjOrder) { |
| | | tjOrder.setCheckAdvice(advice); |
| | | tjOrder.setCheckStatus(checkStatus); |
| | | tjOrder.setStatus(TjConstants.TJ_CHECK); |
| | | tjOrder.setCheckDoctor(sysUser.getNickName()); |
| | | tjOrder.setCheckTime(date); |
| | | tjOrder.setStatus(401); |
| | | tjOrder.setFinishTime(date); |
| | | if (StrUtil.isNotBlank(zhiyeJl)) |
| | | tjOrder.setZhiyeJl(zhiyeJl); |
| | | if (StrUtil.isNotBlank(zhiyeJg)) |
| | | tjOrder.setZhiyeJg(zhiyeJg); |
| | | if (orderService.updateById(tjOrder)) { |
| | | TjCustomer customer = customerService.getById(tjOrder.getUserId()); |
| | | if (null != customer) { |
| | | customer.setCusNumber(customer.getCusNumber() + 1); |
| | | customer.setCardId("0"); |
| | | if (customerService.updateById(customer)) { |
| | | asyncService.updateCheckType(tjNumber); |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | | return AjaxResult.error("操作失败"); |
| | | } |
| | | } |
| | | return AjaxResult.error("操作失败"); |
| | | try { |
| | | String config = configService.selectConfigByKey("sfjcwjhyqxm"); |
| | | if (null != config && config.equalsIgnoreCase("Y")) { |
| | | int num = orderRemarkService.getTjYqOrderRemarkByTjNum(dto.getTjNumber()); |
| | | if (num > 0) return AjaxResult.error("存在未检或延期项目暂不能生成报告!!!"); |
| | | } |
| | | return AjaxResult.success("数据不存在"); |
| | | Date date = new Date(); |
| | | if (null != dto.getTjNumber()) { |
| | | Long userId = Long.valueOf(SecurityUtils.getLoginUser().getUserId()); |
| | | SysUser sysUser = userService.getById(userId); |
| | | TjOrder tjOrder = orderService.getOrderByTjNum(dto.getTjNumber()); |
| | | if (null != tjOrder) { |
| | | tjOrder.setCheckAdvice(dto.getAdvice()); |
| | | tjOrder.setCheckStatus(dto.getCheckStatus()); |
| | | tjOrder.setStatus(TjConstants.TJ_CHECK); |
| | | tjOrder.setCheckDoctor(sysUser.getNickName()); |
| | | tjOrder.setCheckTime(date); |
| | | tjOrder.setStatus(401); |
| | | tjOrder.setFinishTime(date); |
| | | if (StrUtil.isNotBlank(dto.getZhiyeJl())) |
| | | tjOrder.setZhiyeJl(dto.getZhiyeJl()); |
| | | if (StrUtil.isNotBlank(dto.getZhiyeJg())) |
| | | tjOrder.setZhiyeJg(dto.getZhiyeJg()); |
| | | if (orderService.updateById(tjOrder)) { |
| | | AjaxResult pdf = reportController.toPdf(dto.getTjNumber()); |
| | | if (!pdf.get("code").toString().equals("200") ) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("操作失败!"); |
| | | } |
| | | return AjaxResult.success("审核并生成报告成功!"); |
| | | } |
| | | return AjaxResult.error("操作失败"); |
| | | } |
| | | return AjaxResult.success("数据不存在"); |
| | | } |
| | | return AjaxResult.error(); |
| | | } catch (Exception ex) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | throw new RuntimeException(ex); |
| | | } |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | |
| | |
| | | parent.put("zhiyejg", one.getZhiyeJg()); |
| | | List<TjOrderDetail> dels = new ArrayList<>(); |
| | | if (null != tjOrderDetails && !tjOrderDetails.isEmpty()) { |
| | | for (TjOrderDetail tjOrderDetail : tjOrderDetails) { |
| | | if (remark.getProsId().equals(tjOrderDetail.getProsId())) { |
| | | String ckfw = tjOrderDetail.getStanId(); |
| | | if (null != ckfw && StrUtil.isNotBlank(tjOrderDetail.getProAdvice())) { |
| | | ckfw = ckfw.replace(tjOrderDetail.getProAdvice().trim(), ""); |
| | | } |
| | | if (StrUtil.isNotBlank(ckfw)) { |
| | | try { |
| | | if (ckfw != null && ckfw.contains("-")) { |
| | | Integer.parseInt(tjOrderDetail.getYcbz()); |
| | | String[] split = ckfw.split("-"); |
| | | BigDecimal min = new BigDecimal(split[0]); |
| | | BigDecimal max = new BigDecimal(split[1]); |
| | | String proResult = tjOrderDetail.getProResult(); |
| | | if (null != proResult) { |
| | | BigDecimal jyjgval = new BigDecimal(proResult); |
| | | if (jyjgval.compareTo(min) < 0) { |
| | | tjOrderDetail.setYcbz("↓"); |
| | | } else if (jyjgval.compareTo(max) > 0) { |
| | | tjOrderDetail.setYcbz("↑"); |
| | | } else if (proResult.contains("阴")) { |
| | | tjOrderDetail.setYcbz(""); |
| | | Map<String, List<TjOrderDetail>> listMap = tjOrderDetails.stream() |
| | | .filter(i -> StrUtil.isNotBlank(i.getProResult()) && remark.getProsId().equals(i.getProsId())) |
| | | .collect(Collectors.groupingBy(TjOrderDetail::getProResult)); |
| | | boolean isGroupOnce = false; |
| | | String groupOnceProResult = ""; |
| | | if (listMap.size() == 1){ |
| | | String firstKey = listMap.keySet().stream().findFirst().orElse(null); |
| | | LambdaQueryWrapper<SysDictData> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(SysDictData::getDictType,"qj_type"); |
| | | wrapper.eq(SysDictData::getDictLabel,firstKey); |
| | | List<SysDictData> dictList = sysDictDataService.list(); |
| | | if (!dictList.isEmpty()) { |
| | | isGroupOnce = true; |
| | | groupOnceProResult = firstKey; |
| | | } |
| | | } |
| | | if (isGroupOnce){ |
| | | TjOrderDetail tjOrderDetail = new TjOrderDetail(); |
| | | tjOrderDetail.setProName(remark.getProName()); |
| | | tjOrderDetail.setProResult(groupOnceProResult); |
| | | dels.add(tjOrderDetail); |
| | | }else{ |
| | | for (TjOrderDetail tjOrderDetail : tjOrderDetails) { |
| | | if (remark.getProsId().equals(tjOrderDetail.getProsId())) { |
| | | String ckfw = tjOrderDetail.getStanId(); |
| | | if (null != ckfw && StrUtil.isNotBlank(tjOrderDetail.getProAdvice())) { |
| | | ckfw = ckfw.replace(tjOrderDetail.getProAdvice().trim(), ""); |
| | | } |
| | | if (StrUtil.isNotBlank(ckfw)) { |
| | | try { |
| | | if (ckfw != null && ckfw.contains("-")) { |
| | | Integer.parseInt(tjOrderDetail.getYcbz()); |
| | | String[] split = ckfw.split("-"); |
| | | BigDecimal min = new BigDecimal(split[0]); |
| | | BigDecimal max = new BigDecimal(split[1]); |
| | | String proResult = tjOrderDetail.getProResult(); |
| | | if (null != proResult) { |
| | | BigDecimal jyjgval = new BigDecimal(proResult); |
| | | if (jyjgval.compareTo(min) < 0) { |
| | | tjOrderDetail.setYcbz("↓"); |
| | | } else if (jyjgval.compareTo(max) > 0) { |
| | | tjOrderDetail.setYcbz("↑"); |
| | | } else if (proResult.contains("阴")) { |
| | | tjOrderDetail.setYcbz(""); |
| | | } else { |
| | | tjOrderDetail.setYcbz(""); |
| | | } |
| | | if (null != tjOrderDetail.getYcbz() && !tjOrderDetail.getYcbz().isEmpty()) { |
| | | tjOrderDetail.setProResult(tjOrderDetail.getProResult() + " [" + tjOrderDetail.getYcbz() + "]"); |
| | | } |
| | | } else { |
| | | tjOrderDetail.setYcbz(""); |
| | | } |
| | | if (null != tjOrderDetail.getYcbz() && !tjOrderDetail.getYcbz().isEmpty()) { |
| | | tjOrderDetail.setProResult(tjOrderDetail.getProResult() + " [" + tjOrderDetail.getYcbz() + "]"); |
| | | } |
| | | } else { |
| | | tjOrderDetail.setYcbz(""); |
| | | if (tjOrderDetail.getProResult() != null && tjOrderDetail.getProResult().contains("阴")) |
| | | tjOrderDetail.setYcbz(""); |
| | | |
| | | if (tjOrderDetail.getProResult() != null && tjOrderDetail.getProResult().contains("阳")) |
| | | tjOrderDetail.setYcbz("↑"); |
| | | } |
| | | } else { |
| | | if (tjOrderDetail.getProResult() != null && tjOrderDetail.getProResult().contains("阴")) |
| | | tjOrderDetail.setYcbz(""); |
| | | |
| | | if (tjOrderDetail.getProResult() != null && tjOrderDetail.getProResult().contains("阳")) |
| | | tjOrderDetail.setYcbz("↑"); |
| | | } catch (NumberFormatException ignored) { |
| | | } |
| | | } catch (NumberFormatException ignored) { |
| | | } |
| | | } else { |
| | | } else { |
| | | // tjOrderDetail.setYcbz(""); |
| | | if (tjOrderDetail.getProResult() != null && tjOrderDetail.getProResult().contains("阴")) |
| | | tjOrderDetail.setYcbz(""); |
| | | if (tjOrderDetail.getProResult() != null && tjOrderDetail.getProResult().contains("阴")) |
| | | tjOrderDetail.setYcbz(""); |
| | | |
| | | if (tjOrderDetail.getProResult() != null && tjOrderDetail.getProResult().contains("阳")) |
| | | tjOrderDetail.setYcbz("↑"); |
| | | tjOrderDetail.setProResult(tjOrderDetail.getProResult()); |
| | | } |
| | | if (tjOrderDetail.getProResult() != null && tjOrderDetail.getProResult().contains("阳")) |
| | | tjOrderDetail.setYcbz("↑"); |
| | | tjOrderDetail.setProResult(tjOrderDetail.getProResult()); |
| | | } |
| | | |
| | | if (remark.getOrgType().equals(tjOrderDetail.getOrgType())) { |
| | | dels.add(tjOrderDetail); |
| | | if (remark.getOrgType().equals(tjOrderDetail.getOrgType())) { |
| | | dels.add(tjOrderDetail); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/getRsjList") |
| | | @ApiOperation(value = "总检检查二三级查询接口")//0待1已 |
| | | // @PreAuthorize("@ss.hasPermi('check:check:getList')") |
| | | public AjaxResult getRsjList(@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, |
| | | @ApiParam(value = "体检单号") @RequestParam(required = false) String tjNumber, |
| | | @ApiParam(value = "单位") @RequestParam(required = false) Long compId, |
| | | @ApiParam(value = "姓名)") @RequestParam(required = false) String name, |
| | | @ApiParam(value = "开始时间") @RequestParam(required = false) String beginTime, |
| | | @ApiParam(value = "结束时间") @RequestParam(required = false) String endTime, |
| | | @ApiParam(value = "体检类型") @RequestParam(required = false) String tjCategory, |
| | | @ApiParam(value = "体检类型") @RequestParam(required = false) String tcm) { |
| | | |
| | | List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles(); |
| | | String type = "0"; |
| | | if (null != roles && !roles.isEmpty()) { |
| | | List<SysRole> erji = roles.stream().filter(item -> item.getRoleName().contains("二级审核")).collect(Collectors.toList()); |
| | | List<SysRole> sanji = roles.stream().filter(item -> item.getRoleName().contains("三级审核")).collect(Collectors.toList()); |
| | | if (!erji.isEmpty()) type="2"; |
| | | if (!sanji.isEmpty()) type="3"; |
| | | } |
| | | |
| | | String value = String.valueOf(compId); |
| | | if (tjNumber == null) tjNumber = ""; |
| | | if (compId == null) value = ""; |
| | | if (name == null) name = ""; |
| | | if (beginTime == null) beginTime = ""; |
| | | if (endTime == null) endTime = ""; |
| | | return AjaxResult.success(orderService.getEsjCunChuGuoChengCustomerList(tjNumber, page, pageSize, checkStatus, value, |
| | | beginTime, endTime, name,tjCategory,tcm,type)); |
| | | } |
| | | |
| | | } |