| | |
| | | import com.ltkj.web.controller.lis.LisApiMethod; |
| | | import com.ltkj.web.controller.pacs.PacsApiMethodService; |
| | | import com.ltkj.web.controller.system.SamplingServiceApi; |
| | | import jodd.util.StringUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | |
| | | @Override |
| | | //@Async("async") |
| | | public void updateOrdeltile(List<TjOrderDetail> tjOrderDetailList, SysUser sysUser, TjOrder order, TjOrderRemark orderRemark) { |
| | | String currentDataSource = DynamicDataSourceContextHolder.getDataSourceType(); |
| | | log.info("异步线程中的数据源: {}", currentDataSource); |
| | | |
| | | String deptname = ""; |
| | | TjProject tjProject = projectService.getById(orderRemark.getProId()); |
| | | if (null != tjProject) { |
| | | SysDept dept = deptService.getById(tjProject.getDeptId()); |
| | | if (dept.getParentId() != 100L) { |
| | | deptname = deptService.getprentks(dept.getParentId().toString()); |
| | | } else { |
| | | deptname = dept.getDeptName(); |
| | | } |
| | | |
| | | String ssyszy=""; |
| | | for (TjOrderDetail detail : tjOrderDetailList) { |
| | | |
| | | detail.setTjStatus(1L); |
| | | LambdaQueryWrapper<TjStandard> wq0 = new LambdaQueryWrapper<>(); |
| | | wq0.eq(TjStandard::getProId, detail.getProId()); |
| | | detail.setUpdateBy(sysUser.getNickName()); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.updateById(detail); |
| | | try { |
| | | LambdaQueryWrapper<TjOrderYcxm> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderYcxm::getTjh, order.getTjNumber()); |
| | | wq.eq(TjOrderYcxm::getJcxm, detail.getProName()); |
| | | if (detail.getExceptionDesc() == 1) { |
| | | TjOrderYcxm ycxm = ycxmService.getOne(wq); |
| | | if (null != ycxm) { |
| | | ycxm.setJcjg(detail.getProResult()); |
| | | List<Map<String, Object>> maps = rulesService.getyichangxiangmujianyiguize(detail.getProId().toString() |
| | | , detail.getProName().replaceAll("[((][^))]*[))]", "") |
| | | .replaceAll("[ 测定检测]", "").replaceAll("\\[.*?\\]", ""), "", order.getTjNumber() |
| | | , detail.getProName().replaceAll("[((][^))]*[\u4e00-\u9fa5]+[^))]*[))]", "") |
| | | .replaceAll("[ 测定检测]", "").replaceAll("\\[.*?\\]", "") |
| | | , detail.getProResult()); |
| | | |
| | | |
| | | String[] split = detail.getProResult().split("。|,|,"); |
| | | List<Map<String, Object>> mapList = new ArrayList<>(); |
| | | for (String s : split) { |
| | | s = s.replaceAll("\n", ""); |
| | | // Map<String,Object> maps= rulesService.getyichangxiangmujianyiguizeJianCha(s); |
| | | Map<String, Object> mapss = tjProAdvicerulesService.getyichangxiangmujianyiguizeJianCha(deptname, s, "0"); |
| | | if (null != mapss && !mapss.isEmpty()) { |
| | | Object bt = mapss.get("bt"); |
| | | Object nr = mapss.get("nr"); |
| | | if (null != bt || null != nr) { |
| | | |
| | | } |
| | | mapList.add(mapss); |
| | | } |
| | | } |
| | | |
| | | if (null != maps && !maps.isEmpty()) { |
| | | ycxm.setJynr(JSONUtil.toJsonStr(maps)); |
| | | } |
| | | if (!mapList.isEmpty()) { |
| | | ycxm.setJynr(JSONUtil.toJsonStr(mapList)); |
| | | } |
| | | if(detail.getProName().contains("舒张压")||detail.getProName().contains("收缩压")){ |
| | | ssyszy+=ycxm.getJcxm(); |
| | | } |
| | | ycxmService.updateById(ycxm); |
| | | } |
| | | }else { |
| | | ycxmService.remove(wq); |
| | | } |
| | | |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error(e.getMessage()); |
| | | try { |
| | | String deptname = ""; |
| | | TjProject tjProject = projectService.getById(orderRemark.getProId()); |
| | | if (null != tjProject) { |
| | | SysDept dept = deptService.getById(tjProject.getDeptId()); |
| | | if (dept.getParentId() != 100L) { |
| | | deptname = deptService.getprentks(dept.getParentId().toString()); |
| | | } else { |
| | | deptname = dept.getDeptName(); |
| | | } |
| | | |
| | | StringBuilder ssyszys = new StringBuilder(); |
| | | StringBuilder ssyszyjgs = new StringBuilder(); |
| | | List<Map<String, Object>> jianyilis=new ArrayList<>(); |
| | | for (TjOrderDetail detail : tjOrderDetailList) { |
| | | detail.setTjStatus(1L); |
| | | LambdaQueryWrapper<TjStandard> wq0 = new LambdaQueryWrapper<>(); |
| | | wq0.eq(TjStandard::getProId, detail.getProId()); |
| | | detail.setUpdateBy(sysUser.getNickName()); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.updateById(detail); |
| | | |
| | | LambdaQueryWrapper<TjOrderYcxm> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderYcxm::getTjh, order.getTjNumber()); |
| | | wq.eq(TjOrderYcxm::getJcxm, detail.getProName()); |
| | | if (detail.getExceptionDesc() == 1) { |
| | | |
| | | if(!detail.getProName().contains("舒张压") && !detail.getProName().contains("收缩压")){ |
| | | List<Map<String, Object>> maps = rulesService.getyichangxiangmujianyiguize(detail.getProId().toString() |
| | | , detail.getProName().replaceAll("[((][^))]*[))]", "") |
| | | .replaceAll("[ 测定检测]", "").replaceAll("\\[.*?\\]", ""), "", order.getTjNumber() |
| | | , detail.getProName().replaceAll("[((][^))]*[\u4e00-\u9fa5]+[^))]*[))]", "") |
| | | .replaceAll("[ 测定检测]", "").replaceAll("\\[.*?\\]", "") |
| | | , detail.getProResult()); |
| | | |
| | | |
| | | String[] split = detail.getProResult().split("。|,|,"); |
| | | List<Map<String, Object>> mapList = new ArrayList<>(); |
| | | for (String s : split) { |
| | | s = s.replaceAll("\n", ""); |
| | | // Map<String,Object> maps= rulesService.getyichangxiangmujianyiguizeJianCha(s); |
| | | Map<String, Object> mapss = tjProAdvicerulesService.getyichangxiangmujianyiguizeJianCha(deptname, s, "0"); |
| | | if (null != mapss && !mapss.isEmpty()) { |
| | | Object bt = mapss.get("bt"); |
| | | Object nr = mapss.get("nr"); |
| | | if (null != bt || null != nr) { |
| | | |
| | | } |
| | | mapList.add(mapss); |
| | | } |
| | | } |
| | | TjOrderYcxm ycxm = ycxmService.getOne(wq); |
| | | if (null != ycxm) { |
| | | ycxm.setJcjg(detail.getProResult()); |
| | | if (null != maps && !maps.isEmpty()) { |
| | | ycxm.setJynr(JSONUtil.toJsonStr(maps)); |
| | | } |
| | | if (!mapList.isEmpty()) { |
| | | ycxm.setJynr(JSONUtil.toJsonStr(mapList)); |
| | | } |
| | | ycxmService.updateById(ycxm); |
| | | }else { |
| | | TjOrderYcxm orderYcxm =new TjOrderYcxm(); |
| | | orderYcxm.setTjh(order.getTjNumber()); |
| | | orderYcxm.setParentName(tjProject.getProName()); |
| | | orderYcxm.setJcxm(detail.getProName()); |
| | | orderYcxm.setJcjg(detail.getProResult()); |
| | | if (null != maps && !maps.isEmpty()) { |
| | | orderYcxm.setJynr(JSONUtil.toJsonStr(maps)); |
| | | } |
| | | if (!mapList.isEmpty()) { |
| | | orderYcxm.setJynr(JSONUtil.toJsonStr(mapList)); |
| | | } |
| | | orderYcxm.setJyjc("0"); |
| | | ycxmService.save(orderYcxm); |
| | | } |
| | | }else { |
| | | |
| | | List<Map<String, Object>> maps = rulesService.getyichangxiangmujianyiguize(detail.getProId().toString() |
| | | , detail.getProName().replaceAll("[((][^))]*[))]", "") |
| | | .replaceAll("[ 测定检测]", "").replaceAll("\\[.*?\\]", ""), "", order.getTjNumber() |
| | | , detail.getProName().replaceAll("[((][^))]*[\u4e00-\u9fa5]+[^))]*[))]", "") |
| | | .replaceAll("[ 测定检测]", "").replaceAll("\\[.*?\\]", "") |
| | | , detail.getProResult()); |
| | | |
| | | |
| | | String[] split = detail.getProResult().split("。|,|,"); |
| | | List<Map<String, Object>> mapList = new ArrayList<>(); |
| | | for (String s : split) { |
| | | s = s.replaceAll("\n", ""); |
| | | // Map<String,Object> maps= rulesService.getyichangxiangmujianyiguizeJianCha(s); |
| | | Map<String, Object> mapss = tjProAdvicerulesService.getyichangxiangmujianyiguizeJianCha(deptname, s, "0"); |
| | | if (null != mapss && !mapss.isEmpty()) { |
| | | Object bt = mapss.get("bt"); |
| | | Object nr = mapss.get("nr"); |
| | | if (null != bt || null != nr) { |
| | | |
| | | } |
| | | mapList.add(mapss); |
| | | } |
| | | } |
| | | |
| | | if (null != maps && !maps.isEmpty()) { |
| | | jianyilis.addAll(maps); |
| | | } |
| | | if (!mapList.isEmpty()) { |
| | | jianyilis.addAll(mapList); |
| | | } |
| | | ssyszys.append(detail.getProName()).append("/"); |
| | | ssyszyjgs.append(detail.getProResult()).append("/"); |
| | | |
| | | } |
| | | }else { |
| | | if(detail.getProName().contains("舒张压") || detail.getProName().contains("收缩压")){ |
| | | ssyszys.append(detail.getProName()).append("/"); |
| | | ssyszyjgs.append(detail.getProResult()).append("/"); |
| | | |
| | | } |
| | | ycxmService.remove(wq); |
| | | } |
| | | } |
| | | |
| | | if(StrUtil.isNotBlank(ssyszys.toString())){ |
| | | LambdaQueryWrapper<TjOrderYcxm> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderYcxm::getTjh, order.getTjNumber()); |
| | | wq.like(TjOrderYcxm::getJcxm,"舒张压"); |
| | | ycxmService.remove(wq); |
| | | TjOrderYcxm orderYcxm =new TjOrderYcxm(); |
| | | orderYcxm.setTjh(order.getTjNumber()); |
| | | orderYcxm.setParentName(tjProject.getProName()); |
| | | orderYcxm.setJcxm(ssyszys.toString().replaceFirst("/$", "")); |
| | | orderYcxm.setJcjg(ssyszyjgs.toString().replaceFirst("/$", "")); |
| | | orderYcxm.setJynr(JSONUtil.toJsonStr(jianyilis)); |
| | | orderYcxm.setJyjc("0"); |
| | | ycxmService.save(orderYcxm); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error(String.valueOf(e)); |
| | | } |
| | | |
| | | } |