| | |
| | | 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.SysRole; |
| | | import com.ltkj.common.core.domain.entity.SysUser; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.common.enums.DataSourceType; |
| | |
| | | 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; |
| | | |
| | | @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)); |
| | | } |
| | | |
| | | |
| | |
| | | @PutMapping("/getTjdetailList") |
| | | @ApiOperation(value = "根据体检订单号获取体检详情信息(并修改状态)接口") |
| | | // @PreAuthorize("@ss.hasPermi('check:check:getTjdetailList')") |
| | | @Transactional |
| | | 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) { |
| | | |
| | | 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(tjNumber); |
| | | if (num > 0) return AjaxResult.error("存在未检或延期项目暂不能生成报告!!!"); |
| | | } |
| | | return AjaxResult.success("数据不存在"); |
| | | Date date = new Date(); |
| | | if (null != tjNumber) { |
| | | Long userId = Long.valueOf(SecurityUtils.getLoginUser().getUserId()); |
| | | SysUser sysUser = userService.getById(userId); |
| | | TjOrder tjOrder = orderService.getOrderByTjNum(tjNumber); |
| | | 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)) { |
| | | AjaxResult pdf = reportController.toPdf(tjNumber); |
| | | 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(); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @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)); |
| | | } |
| | | |
| | | } |