| | |
| | | package com.ltkj.web.controller.service; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.IdUtil; |
| | |
| | | import com.ltkj.common.core.domain.entity.SysDept; |
| | | import com.ltkj.common.core.domain.entity.SysUser; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.common.utils.IdUtils; |
| | | import com.ltkj.hosp.idutil.IdUtils; |
| | | import com.ltkj.common.utils.StringUtils; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.*; |
| | |
| | | } |
| | | |
| | | public void addCaiYangDengJi(List<TjOrderDetail> detailList, boolean detailList1, TjOrder order, SysUser sysUser,String jxbz) { |
| | | String lis_tmh_prefix = sysConfigService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | Boolean lisAndPacsRegister = lisApiMethod.isUseLisAndPacsRegister(order); |
| | | if (null != detailList && detailList1) { |
| | | String format = DateUtil.format(new Date(), "yyMMddHHmmssSSS"); |
| | | for (TjOrderDetail detail : detailList) { |
| | | int i = samplingService.isExistProId(order.getTjNumber(), String.valueOf(detail.getProId())); |
| | | if(i>0) continue; |
| | | TjSampling sampling = new TjSampling(); |
| | | if (null == projectService.getById(detail.getProId())) continue; |
| | | TjProject project = projectService.getById(detail.getProId()); |
| | | Long proParentId = project.getProParentId(); |
| | | String dictLabel = sysDictDataService.selectDictLabel("sys_dict_specimen", project.getSpecimenType()); |
| | | if (null != proParentId && proParentId == 0) { |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | // LtkjJyxmzd jyxmzd = lisApiMethod.getJyxmzd(project); |
| | | // if (jyxmzd != null) { |
| | | if (config.equals("Y") && lisAndPacsRegister) |
| | | sampling.setJyxmdm(project.getLisXmbm()); |
| | | else sampling.setJyxmdm(String.valueOf(project.getProId())); |
| | | sampling.setSpecimenTypeCode(project.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | // LambdaQueryWrapper<LtkjJybbzd> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(LtkjJybbzd::getJybbdm,jyxmzd.getJybbdm()); |
| | | // LtkjJybbzd jybbzd = jybbzdService.getOne(wrapper); |
| | | // sampling.setSpecimenType(jybbzd.getJybbmc()); |
| | | // sampling.setJyxmdm(jyxmzd.getJyxmdm()); |
| | | // } |
| | | } else { |
| | | TjProject project1 = projectService.getById(proParentId); |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | sampling.setSpecimenTypeCode(project1.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | if (config.equals("Y") && lisAndPacsRegister) |
| | | sampling.setJyxmdm(project1.getLisXmbm()); |
| | | else sampling.setJyxmdm(String.valueOf(project1.getProId())); |
| | | // LtkjJyxmzd jyxmzd = lisApiMethod.getJyxmzd(project1); |
| | | // if (jyxmzd != null) { |
| | | // sampling.setSpecimenTypeCode(jyxmzd.getJybbdm()); |
| | | // LambdaQueryWrapper<LtkjJybbzd> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(LtkjJybbzd::getJybbdm,jyxmzd.getJybbdm()); |
| | | // LtkjJybbzd jybbzd = jybbzdService.getOne(wrapper); |
| | | // sampling.setSpecimenType(jybbzd.getJybbmc()); |
| | | // sampling.setJyxmdm(jyxmzd.getJyxmdm()); |
| | | // } |
| | | try { |
| | | String lis_tmh_prefix = sysConfigService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | Boolean lisAndPacsRegister = lisApiMethod.isUseLisAndPacsRegister(order); |
| | | if (null != detailList && detailList1) { |
| | | String format = DateUtil.format(new Date(), "yyMMddHHmmssSSS"); |
| | | for (TjOrderDetail detail : detailList) { |
| | | int i = samplingService.isExistProId(order.getTjNumber(), String.valueOf(detail.getProId())); |
| | | if(i>0) continue; |
| | | TjSampling sampling = new TjSampling(); |
| | | if (null == projectService.getById(detail.getProId())) continue; |
| | | TjProject project = projectService.getById(detail.getProId()); |
| | | Long proParentId = project.getProParentId(); |
| | | String dictLabel = sysDictDataService.selectDictLabel("sys_dict_specimen", project.getSpecimenType()); |
| | | if (null != proParentId && proParentId == 0) { |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | // LtkjJyxmzd jyxmzd = lisApiMethod.getJyxmzd(project); |
| | | // if (jyxmzd != null) { |
| | | if (config.equals("Y") && lisAndPacsRegister) |
| | | sampling.setJyxmdm(project.getLisXmbm()); |
| | | else sampling.setJyxmdm(String.valueOf(project.getProId())); |
| | | sampling.setSpecimenTypeCode(project.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | // LambdaQueryWrapper<LtkjJybbzd> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(LtkjJybbzd::getJybbdm,jyxmzd.getJybbdm()); |
| | | // LtkjJybbzd jybbzd = jybbzdService.getOne(wrapper); |
| | | // sampling.setSpecimenType(jybbzd.getJybbmc()); |
| | | // sampling.setJyxmdm(jyxmzd.getJyxmdm()); |
| | | // } |
| | | } else { |
| | | TjProject project1 = projectService.getById(proParentId); |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | sampling.setSpecimenTypeCode(project1.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | if (config.equals("Y") && lisAndPacsRegister) |
| | | sampling.setJyxmdm(project1.getLisXmbm()); |
| | | else sampling.setJyxmdm(String.valueOf(project1.getProId())); |
| | | // LtkjJyxmzd jyxmzd = lisApiMethod.getJyxmzd(project1); |
| | | // if (jyxmzd != null) { |
| | | // sampling.setSpecimenTypeCode(jyxmzd.getJybbdm()); |
| | | // LambdaQueryWrapper<LtkjJybbzd> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(LtkjJybbzd::getJybbdm,jyxmzd.getJybbdm()); |
| | | // LtkjJybbzd jybbzd = jybbzdService.getOne(wrapper); |
| | | // sampling.setSpecimenType(jybbzd.getJybbmc()); |
| | | // sampling.setJyxmdm(jyxmzd.getJyxmdm()); |
| | | // } |
| | | } |
| | | sampling.setSamplingNumber(format); |
| | | sampling.setTjNum(order.getTjNumber()); |
| | | sampling.setCusId(String.valueOf(order.getUserId())); |
| | | if (tjCustomerService.getById(String.valueOf(order.getUserId())) != null) { |
| | | sampling.setCusName(tjCustomerService.getById(String.valueOf(order.getUserId())).getCusName()); |
| | | } |
| | | sampling.setApplicationTime(new Date()); |
| | | sampling.setTjTime(order.getCreateTime()); |
| | | sampling.setProId(String.valueOf(detail.getProId())); |
| | | sampling.setProName(projectService.getById(detail.getProId()).getProName()); |
| | | sampling.setCreateBy(sysUser.getNickName()); |
| | | sampling.setCreateTime(new Date()); |
| | | sampling.setUpdateBy(sysUser.getNickName()); |
| | | sampling.setUpdateTime(new Date()); |
| | | sampling.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setJxbz(jxbz); |
| | | samplingService.save(sampling); |
| | | } |
| | | sampling.setSamplingNumber(format); |
| | | sampling.setTjNum(order.getTjNumber()); |
| | | sampling.setCusId(String.valueOf(order.getUserId())); |
| | | if (tjCustomerService.getById(String.valueOf(order.getUserId())) != null) { |
| | | sampling.setCusName(tjCustomerService.getById(String.valueOf(order.getUserId())).getCusName()); |
| | | } |
| | | sampling.setApplicationTime(new Date()); |
| | | sampling.setTjTime(order.getCreateTime()); |
| | | sampling.setProId(String.valueOf(detail.getProId())); |
| | | sampling.setProName(projectService.getById(detail.getProId()).getProName()); |
| | | sampling.setCreateBy(sysUser.getNickName()); |
| | | sampling.setCreateTime(new Date()); |
| | | sampling.setUpdateBy(sysUser.getNickName()); |
| | | sampling.setUpdateTime(new Date()); |
| | | sampling.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setJxbz(jxbz); |
| | | samplingService.save(sampling); |
| | | } |
| | | } |
| | | if (lisApiMethod.isUseLisAndPacsRegister(order) && (null != config && config.equals("Y"))){ |
| | | AjaxResult ajaxResult = lisApiMethod.getJyFlHb(); |
| | | if (ajaxResult.get("code").toString().equals("200")){ |
| | | String str = ajaxResult.get("data").toString(); |
| | | str = str.replace("=", ":"); |
| | | JSONArray array = JSONUtil.parseArray(str); |
| | | for (Object o : array) { |
| | | JSONObject object = (JSONObject) o; |
| | | LisJyflhb lisJyflhb = new LisJyflhb(); |
| | | lisJyflhb.setHbhxm(object.getStr("hbhxm")); |
| | | lisJyflhb.setFlmc(object.getStr("flmc")); |
| | | lisJyflhb.setMc(object.getStr("mc")); |
| | | lisJyflhb.setFlbm(object.getStr("flbm")); |
| | | LambdaQueryWrapper<LisJyflhb> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LisJyflhb::getFlbm,lisJyflhb.getFlbm()); |
| | | LisJyflhb jyflhb = lisJyflhbService.getOne(wrapper); |
| | | if (jyflhb == null) { |
| | | lisJyflhb.setId(IdUtil.getSnowflake().nextId()); |
| | | lisJyflhbService.save(lisJyflhb); |
| | | }else { |
| | | lisJyflhb.setId(jyflhb.getId()); |
| | | lisJyflhbService.updateById(lisJyflhb); |
| | | if (lisApiMethod.isUseLisAndPacsRegister(order) && (null != config && config.equals("Y"))){ |
| | | AjaxResult ajaxResult = lisApiMethod.getJyFlHb(); |
| | | if (ajaxResult.get("code").toString().equals("200")){ |
| | | String str = ajaxResult.get("data").toString(); |
| | | str = str.replace("=", ":"); |
| | | JSONArray array = JSONUtil.parseArray(str); |
| | | for (Object o : array) { |
| | | JSONObject object = (JSONObject) o; |
| | | LisJyflhb lisJyflhb = new LisJyflhb(); |
| | | lisJyflhb.setHbhxm(object.getStr("hbhxm")); |
| | | lisJyflhb.setFlmc(object.getStr("flmc")); |
| | | lisJyflhb.setMc(object.getStr("mc")); |
| | | lisJyflhb.setFlbm(object.getStr("flbm")); |
| | | LambdaQueryWrapper<LisJyflhb> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LisJyflhb::getFlbm,lisJyflhb.getFlbm()); |
| | | LisJyflhb jyflhb = lisJyflhbService.getOne(wrapper); |
| | | if (jyflhb == null) { |
| | | lisJyflhb.setId(IdUtil.getSnowflake().nextId()); |
| | | lisJyflhbService.save(lisJyflhb); |
| | | }else { |
| | | lisJyflhb.setId(jyflhb.getId()); |
| | | lisJyflhbService.updateById(lisJyflhb); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (StrUtil.isNotBlank(jxbz)){ |
| | | tjSamplingMapper.updateUserIdByTjNumAndJxbz(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId()),jxbz); |
| | | }else { |
| | | tjSamplingMapper.updateUserIdByTjNum(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | } |
| | | if (StrUtil.isNotBlank(jxbz)){ |
| | | tjSamplingMapper.updateUserIdByTjNumAndJxbz(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId()),jxbz); |
| | | }else { |
| | | tjSamplingMapper.updateUserIdByTjNum(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void updateOrdeltile(List<TjOrderDetail> tjOrderDetailList, SysUser sysUser, TjOrder order,TjOrderRemark orderRemark) { |
| | | 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(); |
| | | } |
| | | //@Async("async") |
| | | public void updateOrdeltile(List<TjOrderDetail> tjOrderDetailList, SysUser sysUser, TjOrder order, TjOrderRemark orderRemark) { |
| | | |
| | | 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(); |
| | | } |
| | | String xb= tjCustomerService.getSexByTjh(order.getTjNumber()); |
| | | |
| | | 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()); |
| | | ycxmService.remove(wq); |
| | | if (detail.getExceptionDesc() == 1) { |
| | | if(tjProject.getSfcyyc()==0){ |
| | | String replacedAll = detail.getProName().replaceAll("[((][^))]*[\u4e00-\u9fa5]+[^))]*[))]", "").replaceAll("[((][^))]*[))]", "") |
| | | .replaceAll("[ 测定检测]", "").replaceAll("\\[.*?\\]", "").replaceAll("◆", ""); |
| | | |
| | | if(!detail.getProName().contains("舒张压") && !detail.getProName().contains("收缩压")){ |
| | | |
| | | List<Map<String, Object>> maps = rulesService.getyichangxiangmujianyiguize(detail.getProId().toString(), replacedAll, "", order.getTjNumber() |
| | | , replacedAll, detail.getProResult()); |
| | | |
| | | |
| | | 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()); |
| | | TjOrderYcxm ycxm = ycxmService.getOne(wq); |
| | | if(null !=ycxm){ |
| | | ycxm.setJcjg(detail.getProResult()); |
| | | List<Map<String,Object>> maps= rulesService.getyichangxiangmujianyiguize(detail.getProId().toString() |
| | | ,"","",order.getTjNumber() |
| | | ,detail.getProName().replaceAll("[((][^))]*[))]", "") |
| | | .replaceAll("[ 测定检测]","") |
| | | ,detail.getProResult()); |
| | | String[] split = detail.getProResult().split("[。,,::.\\s]+"); |
| | | List<Map<String, Object>> mapList = new ArrayList<>(); |
| | | for (String s : split) { |
| | | s = s.replaceAll("\n", "").replaceAll("[((][^))]*[))]", "").replaceAll(" ","") |
| | | .replaceAll("症","").replaceAll("[0-9]", ""); |
| | | Map<String, Object> mapss = tjProAdvicerulesService.getyichangxiangmujianyiguizeJianCha(deptname, s, "0",xb); |
| | | if (null != mapss && !mapss.isEmpty()) { |
| | | Object bt = mapss.get("bt"); |
| | | Object nr = mapss.get("nr"); |
| | | if (null != bt || null != nr) { |
| | | |
| | | 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 { |
| | | |
| | | } mapList.add(mapss); |
| | | List<Map<String, Object>> maps = rulesService.getyichangxiangmujianyiguize(detail.getProId().toString() |
| | | , replacedAll, "", order.getTjNumber(), replacedAll, detail.getProResult()); |
| | | |
| | | |
| | | String[] split = detail.getProResult().split("[。,,::.\\s]+"); |
| | | List<Map<String, Object>> mapList = new ArrayList<>(); |
| | | for (String s : split) { |
| | | s = s.replaceAll("\n", "").replaceAll("[((][^))]*[))]", "").replaceAll(" ","") |
| | | .replaceAll("症","").replaceAll("[0-9]", ""); |
| | | Map<String, Object> mapss = tjProAdvicerulesService.getyichangxiangmujianyiguizeJianCha(deptname, s, "0",xb); |
| | | 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("/"); |
| | | |
| | | if(null != maps && !maps.isEmpty()){ |
| | | ycxm.setJynr(JSONUtil.toJsonStr(maps)); |
| | | } |
| | | if( !mapList.isEmpty()){ |
| | | ycxm.setJynr(JSONUtil.toJsonStr(mapList)); |
| | | } |
| | | ycxmService.updateById(ycxm); |
| | | if(detail.getExceptionDesc()==0)ycxmService.remove(wq); |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | } |
| | | |
| | | // 使用 stream 过滤出 proName 为 "舒张压" 或 "收缩压" 的元素 |
| | | List<TjOrderDetail> filteredList = tjOrderDetailList.stream() |
| | | .filter(a -> ("舒张压".equals(a.getProName()) || "收缩压".equals(a.getProName())) && a.getExceptionDesc()==1) |
| | | .collect(Collectors.toList()); |
| | | if(StrUtil.isNotBlank(ssyszys.toString())){ |
| | | |
| | | LambdaQueryWrapper<TjOrderYcxm> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderYcxm::getTjh, order.getTjNumber()); |
| | | wq.like(TjOrderYcxm::getJcxm,"舒张压"); |
| | | ycxmService.remove(wq); |
| | | |
| | | if(!filteredList.isEmpty()){ |
| | | 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)); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | public void addCaiYangDengJiByDiaoYongShiTu(List<TjOrderDetail> detailList, boolean detailList1, TjOrder order, SysUser sysUser,String jxbz) { |
| | | String lis_tmh_prefix = sysConfigService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | if (null != detailList && detailList1) { |
| | | Date date = new Date(); |
| | | String format = DateUtil.format(date, "yyMMddHHmmssSSS"); |
| | | for (TjOrderDetail detail : detailList) { |
| | | int i = samplingService.isExistProId(order.getTjNumber(), String.valueOf(detail.getProId())); |
| | | if(i>0) continue; |
| | | try { |
| | | String lis_tmh_prefix = sysConfigService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | if (null != detailList && detailList1) { |
| | | Date date = new Date(); |
| | | String format = DateUtil.format(date, "yyMMddHHmmssSSS"); |
| | | for (TjOrderDetail detail : detailList) { |
| | | int i = samplingService.isExistProId(order.getTjNumber(), String.valueOf(detail.getProId())); |
| | | if(i>0) continue; |
| | | |
| | | TjSampling sampling = new TjSampling(); |
| | | if (null == projectService.getById(detail.getProId())) continue; |
| | | TjProject project = projectService.getById(detail.getProId()); |
| | | Long proParentId = project.getProParentId(); |
| | | String dictLabel = sysDictDataService.selectDictLabel("sys_dict_specimen", project.getSpecimenType()); |
| | | if (null != proParentId && proParentId == 0) { |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | sampling.setSpecimenTypeCode(project.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | sampling.setJyxmdm(project.getProId().toString()); |
| | | } else { |
| | | TjProject project1 = projectService.getById(proParentId); |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | TjSampling sampling = new TjSampling(); |
| | | if (null == projectService.getById(detail.getProId())) continue; |
| | | TjProject project = projectService.getById(detail.getProId()); |
| | | Long proParentId = project.getProParentId(); |
| | | String dictLabel = sysDictDataService.selectDictLabel("sys_dict_specimen", project.getSpecimenType()); |
| | | if (null != proParentId && proParentId == 0) { |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | sampling.setSpecimenTypeCode(project.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | sampling.setJyxmdm(project.getProId().toString()); |
| | | } else { |
| | | TjProject project1 = projectService.getById(proParentId); |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | |
| | | sampling.setSpecimenTypeCode(project1.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | sampling.setJyxmdm(project.getProId().toString()); |
| | | sampling.setSpecimenTypeCode(project1.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | | sampling.setJyxmdm(project.getProId().toString()); |
| | | |
| | | } |
| | | sampling.setSamplingNumber(format); |
| | | sampling.setTjNum(order.getTjNumber()); |
| | | sampling.setCusId(String.valueOf(order.getUserId())); |
| | | if (tjCustomerService.getById(String.valueOf(order.getUserId())) != null) { |
| | | sampling.setCusName(tjCustomerService.getById(String.valueOf(order.getUserId())).getCusName()); |
| | | } |
| | | sampling.setApplicationTime(date); |
| | | sampling.setTjTime(order.getCreateTime()); |
| | | sampling.setProId(String.valueOf(detail.getProId())); |
| | | sampling.setProName(projectService.getById(detail.getProId()).getProName()); |
| | | sampling.setCreateBy(sysUser.getNickName()); |
| | | sampling.setCreateTime(date); |
| | | sampling.setUpdateBy(sysUser.getNickName()); |
| | | sampling.setUpdateTime(date); |
| | | sampling.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setJxbz(jxbz); |
| | | samplingService.save(sampling); |
| | | } |
| | | sampling.setSamplingNumber(format); |
| | | sampling.setTjNum(order.getTjNumber()); |
| | | sampling.setCusId(String.valueOf(order.getUserId())); |
| | | if (tjCustomerService.getById(String.valueOf(order.getUserId())) != null) { |
| | | sampling.setCusName(tjCustomerService.getById(String.valueOf(order.getUserId())).getCusName()); |
| | | } |
| | | sampling.setApplicationTime(date); |
| | | sampling.setTjTime(order.getCreateTime()); |
| | | sampling.setProId(String.valueOf(detail.getProId())); |
| | | sampling.setProName(projectService.getById(detail.getProId()).getProName()); |
| | | sampling.setCreateBy(sysUser.getNickName()); |
| | | sampling.setCreateTime(date); |
| | | sampling.setUpdateBy(sysUser.getNickName()); |
| | | sampling.setUpdateTime(date); |
| | | sampling.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setJxbz(jxbz); |
| | | samplingService.save(sampling); |
| | | } |
| | | } |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | if (lisApiMethod.isUseLisAndPacsRegister(order) && (null != config && config.equals("Y"))){ |
| | | AjaxResult ajaxResult = lisApiMethod.getJyFlHb(); |
| | | if (ajaxResult.get("code").toString().equals("200")){ |
| | | String str = ajaxResult.get("data").toString(); |
| | | str = str.replace("=", ":"); |
| | | JSONArray array = JSONUtil.parseArray(str); |
| | | for (Object o : array) { |
| | | JSONObject object = (JSONObject) o; |
| | | LisJyflhb lisJyflhb = new LisJyflhb(); |
| | | lisJyflhb.setHbhxm(object.getStr("hbhxm")); |
| | | lisJyflhb.setFlmc(object.getStr("flmc")); |
| | | lisJyflhb.setMc(object.getStr("mc")); |
| | | lisJyflhb.setFlbm(object.getStr("flbm")); |
| | | LambdaQueryWrapper<LisJyflhb> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LisJyflhb::getFlbm,lisJyflhb.getFlbm()); |
| | | LisJyflhb jyflhb = lisJyflhbService.getOne(wrapper); |
| | | if (jyflhb == null) { |
| | | lisJyflhb.setId(IdUtil.getSnowflake().nextId()); |
| | | lisJyflhbService.save(lisJyflhb); |
| | | }else { |
| | | lisJyflhb.setId(jyflhb.getId()); |
| | | lisJyflhbService.updateById(lisJyflhb); |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | if (lisApiMethod.isUseLisAndPacsRegister(order) && (null != config && config.equals("Y"))){ |
| | | AjaxResult ajaxResult = lisApiMethod.getJyFlHb(); |
| | | if (ajaxResult.get("code").toString().equals("200")){ |
| | | String str = ajaxResult.get("data").toString(); |
| | | str = str.replace("=", ":"); |
| | | JSONArray array = JSONUtil.parseArray(str); |
| | | for (Object o : array) { |
| | | JSONObject object = (JSONObject) o; |
| | | LisJyflhb lisJyflhb = new LisJyflhb(); |
| | | lisJyflhb.setHbhxm(object.getStr("hbhxm")); |
| | | lisJyflhb.setFlmc(object.getStr("flmc")); |
| | | lisJyflhb.setMc(object.getStr("mc")); |
| | | lisJyflhb.setFlbm(object.getStr("flbm")); |
| | | LambdaQueryWrapper<LisJyflhb> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(LisJyflhb::getFlbm,lisJyflhb.getFlbm()); |
| | | LisJyflhb jyflhb = lisJyflhbService.getOne(wrapper); |
| | | if (jyflhb == null) { |
| | | lisJyflhb.setId(IdUtil.getSnowflake().nextId()); |
| | | lisJyflhbService.save(lisJyflhb); |
| | | }else { |
| | | lisJyflhb.setId(jyflhb.getId()); |
| | | lisJyflhbService.updateById(lisJyflhb); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (StrUtil.isNotBlank(jxbz)){ |
| | | tjSamplingMapper.updateUserIdByTjNumAndJxbz(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId()),jxbz); |
| | | }else { |
| | | tjSamplingMapper.updateUserIdByTjNum(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | } |
| | | if (StrUtil.isNotBlank(jxbz)){ |
| | | tjSamplingMapper.updateUserIdByTjNumAndJxbz(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId()),jxbz); |
| | | }else { |
| | | tjSamplingMapper.updateUserIdByTjNum(order.getTjNumber(),sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | if (null != project.getHisXmbm()) { |
| | | { |
| | | mapJinchuan.add(project.getProParentId().toString()); |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | mapJinchuan.add(project.getProParentId().toString()); |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | } |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDto.setProjg(project.getProPrice()); |
| | | detailDtos.add(detailsDto); |
| | | } |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDto.setProjg(project.getProPrice()); |
| | | detailDtos.add(detailsDto); |
| | | |
| | | // mapJinchuan.add(project.getProParentId().toString()); |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | // if (project.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(project.getSl()); |
| | | // detailsDto.setProjg(project.getProPrice()); |
| | | // detailDtos.add(detailsDto); |
| | | } |
| | | } |
| | | List<Long> proParentIds = projects.stream().map(TjProject::getProParentId).distinct().collect(Collectors.toList()); |