| | |
| | | package com.ltkj.web.controller.system; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | | import java.nio.file.Paths; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | |
| | | import com.ltkj.common.core.domain.entity.SysUser; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | | import com.ltkj.common.utils.file.FileUploadUtils; |
| | | import com.ltkj.db.DataSourceContextHolder; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.service.*; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import jodd.util.StringUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Isolation; |
| | |
| | | private LtkjExamJcbgdService jcbgdService; |
| | | @Resource |
| | | private LtkjExamJcsqdService jcsqdService; |
| | | |
| | | @Value("${path.xdtfilePath}") |
| | | private String value; |
| | | /** |
| | | * 查询体检心电图管理列表 |
| | | */ |
| | |
| | | @ApiParam (value = "开始时间") @RequestParam (required = false) String beginTime, |
| | | @ApiParam (value = "结束时间") @RequestParam (required = false) String endTime) { |
| | | |
| | | // DateTime beginTimes = null; |
| | | // DateTime endTimes = null; |
| | | // if (null != beginTime && null != endTime) { |
| | | // beginTimes = DateUtil.beginOfDay(DateUtil.parse(beginTime)); |
| | | // endTimes = DateUtil.endOfDay(DateUtil.parse(endTime)); |
| | | // } |
| | | // //初始化体检订单表 |
| | | // List<TjOrder> orderList = null; |
| | | // List<TjCustomer> customerList = new ArrayList<>(); |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // |
| | | // if (checkStatus == 0) |
| | | // asyncService.wCScheckSetCustomerLisByRedis(orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes)); |
| | | // if (checkStatus == 1) |
| | | // asyncService.yCScheckSetCustomerLisByRedis(orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes)); |
| | | // |
| | | // //根据姓名查询 |
| | | // if (null != name && !"".equals(name)) { |
| | | // List<TjCustomer> list = customerService.getTjCustomerList(name); |
| | | // if (null != list && list.size() > 0) { |
| | | // List<TjCustomer> lists = new ArrayList<>(); |
| | | // for (TjCustomer customer : list) { |
| | | // orderList = orderService.getCsTjOrderListByCusId(customer.getCusId()); |
| | | // if (null != orderList && orderList.size() > 0) { |
| | | // for (TjOrder tjOrder : orderList) { |
| | | // customer.setTjNumber(tjOrder.getTjNumber()); |
| | | // customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | // customer.setOrderId(tjOrder.getOrderId()); |
| | | // customer.setTjTime(tjOrder.getCreateTime()); |
| | | // customer.setFinishTime(tjOrder.getFinishTime()); |
| | | // customer.setCusName(MatchUtils.hideCusName(customer.getCusName())); |
| | | // customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | // customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | // customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | // if (tjOrder.getFirmId().equals("0")) { |
| | | // customer.setTjCompName(null); |
| | | // } else { |
| | | // customer.setTjCompName(compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()).getCnName()); |
| | | // } |
| | | // lists.add(customer); |
| | | // } |
| | | // } |
| | | // } |
| | | // List<TjCustomer> customers = null; |
| | | // if (lists.size() > 0) { |
| | | // customers = lists.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | // } |
| | | // map.put("customers", customers); |
| | | // map.put("total", lists.size()); |
| | | // return AjaxResult.success(map); |
| | | // } |
| | | // return AjaxResult.success("暂无数据"); |
| | | // } |
| | | // |
| | | // //条件查询 |
| | | // if (null != tjNumber || null != compId || (null != beginTime && null != endTime)) { |
| | | // orderList = orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | // return getResult(page, pageSize, orderList, customerList, map); |
| | | // } |
| | | // |
| | | // List<TjCustomer> customers = null; |
| | | // if (checkStatus == 0) { |
| | | // customers = redisCache.getCacheMapValue("cScheck", "ws"); |
| | | // } |
| | | // if (checkStatus == 1) { |
| | | // customers = redisCache.getCacheMapValue("cScheck", "ys"); |
| | | // } |
| | | // if (customers != null && customers.size() > 0) { |
| | | // List<TjCustomer> customerLists = customers.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | // map.put("customers", customerLists); |
| | | // map.put("total", customers.size()); |
| | | // return AjaxResult.success(map); |
| | | // } else { |
| | | // orderList = orderService.getCsTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | // return getResult(page, pageSize, orderList, customerList, map); |
| | | // } |
| | | Long deptId = SecurityUtils.getDeptId(); |
| | | log.info("影像检查列表(骨密度和心电图)接口 当前登录人科室"+deptId); |
| | | String value = String.valueOf(compId); |
| | |
| | | Long deptId = SecurityUtils.getDeptId(); |
| | | log.info("影像检查骨密度心电图页面点击体检人员展示体检项目接口当前登录人科室"+deptId); |
| | | List<CsProVo> list = remarkService.getYxJcXx(tjNumber,deptId.toString()); |
| | | if(null !=list && !list.isEmpty()){ |
| | | for (CsProVo vo : list) { |
| | | LambdaQueryWrapper<TjXdtgmdjg> wq=new LambdaQueryWrapper<>(); |
| | | wq.eq(TjXdtgmdjg::getTjh,tjNumber); |
| | | wq.eq(TjXdtgmdjg::getProId,vo.getProId()); |
| | | TjXdtgmdjg xdtgmdjg = xdtgmdjgService.getOne(wq); |
| | | if(null !=xdtgmdjg){ |
| | | if(StringUtil.isNotBlank(xdtgmdjg.getUrl())){ |
| | | Path path = Paths.get(xdtgmdjg.getUrl()); |
| | | byte[] data = null; |
| | | try { |
| | | data = Files.readAllBytes(path); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | String base64 = Base64.getEncoder().encodeToString(data); |
| | | if(StringUtil.isNotBlank(base64)) vo.setImageUrl(base64); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | |
| | | public AjaxResult addYxJcXx(@ApiParam (value = "体检号") @RequestParam String tjNumber, |
| | | @ApiParam (value = "项目id") @RequestParam String proId, |
| | | @ApiParam (value = "检查所见") @RequestParam String jcsj, |
| | | @ApiParam (value = "检查结论") @RequestParam String jcjl) { |
| | | @ApiParam (value = "检查结论") @RequestParam String jcjl, |
| | | @ApiParam (value = "图片地址") @RequestParam(required = false) String url) { |
| | | try { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | TjOrder order = orderService.getOrderByTjNum(tjNumber); |
| | |
| | | xdtgmdjg.setJcjl(jcjl); |
| | | xdtgmdjg.setCreateBy(user.getNickName()); |
| | | xdtgmdjg.setCreateId(user.getUserId().toString()); |
| | | if(StringUtil.isNotBlank(url)) xdtgmdjg.setUrl(url); |
| | | xdtgmdjgService.save(xdtgmdjg); |
| | | saveTjXdtgmdjgByJcbgd(xdtgmdjg); |
| | | } |
| | |
| | | jcbgd.setXmdm(xdtgmdjg.getProId()); |
| | | jcbgd.setXmmc(xdtgmdjg.getProName()); |
| | | jcbgd.setBgNr(xdtgmdjg.getJcsj()); |
| | | jcbgd.setBgUrl(""); |
| | | if(StringUtil.isNotBlank(xdtgmdjg.getUrl())){ |
| | | jcbgd.setBgUrl(xdtgmdjg.getUrl()); |
| | | }else { |
| | | jcbgd.setBgUrl(""); |
| | | } |
| | | jcbgd.setShysxm(xdtgmdjg.getCreateBy()); |
| | | jcbgd.setShysdm(xdtgmdjg.getCreateId()); |
| | | jcbgd.setYxzd(xdtgmdjg.getJcjl()); |
| | |
| | | if(null !=xdtgmdjg ){ |
| | | map.put("jcsj",xdtgmdjg.getJcsj()); |
| | | map.put("jcjl",xdtgmdjg.getJcjl()); |
| | | if(StringUtil.isNotBlank(xdtgmdjg.getUrl())){ |
| | | Path path = Paths.get(xdtgmdjg.getUrl()); |
| | | byte[] data = null; |
| | | try { |
| | | data = Files.readAllBytes(path); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | String base64 = Base64.getEncoder().encodeToString(data); |
| | | map.put("tp",base64); |
| | | }else { |
| | | map.put("tp",null); |
| | | } |
| | | return AjaxResult.success(map); |
| | | }else { |
| | | TjProject tjProject = projectService.getById(proId); |
| | | map.put("jcsj",""); |
| | | map.put("jcjl",tjProject.getProDefault()==null ? "":tjProject.getProDefault()); |
| | | map.put("tp",null); |
| | | } |
| | | return AjaxResult.success(map); |
| | | } |