| | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.IdUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.hisDto.*; |
| | | import com.ltkj.hosp.mapper.TjSamplingMapper; |
| | | import com.ltkj.hosp.pacsDto.SavePacsApply; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.hosp.vodomain.AddNewReservationConfirm; |
| | |
| | | private SamplingServiceApi samplingServiceApi; |
| | | @Autowired |
| | | private ISysDictDataService sysDictDataService; |
| | | @Autowired |
| | | private TjSamplingMapper tjSamplingMapper; |
| | | @Autowired |
| | | private ISysConfigService sysConfigService; |
| | | |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | public void addCaiYangDengJi(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) { |
| | | String format = DateUtil.format(new Date(), "yyMMddHHmmssSSS"); |
| | | for (TjOrderDetail detail : detailList) { |
| | |
| | | TjProject project = projectService.getById(detail.getProId()); |
| | | Long proParentId = project.getProParentId(); |
| | | if (null != proParentId && proParentId == 0) { |
| | | sampling.setJyxh(idUtils.generateLisID()); |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | LtkjJyxmzd jyxmzd = lisApiMethod.getJyxmzd(project); |
| | | if (jyxmzd != null) { |
| | | sampling.setSpecimenTypeCode(jyxmzd.getJybbdm()); |
| | |
| | | } |
| | | } else { |
| | | TjProject project1 = projectService.getById(proParentId); |
| | | sampling.setJyxh(idUtils.generateLisID()); |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | LtkjJyxmzd jyxmzd = lisApiMethod.getJyxmzd(project1); |
| | | if (jyxmzd != null) { |
| | | sampling.setSpecimenTypeCode(jyxmzd.getJybbdm()); |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | 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())); |
| | | } |
| | | } |
| | | |
| | |
| | | addCaiYangDengJi(detailLists, !detailLists.isEmpty(), order, sysUser, jxbz); |
| | | } |
| | | }else { |
| | | tjOrderDetailService.updateTjOrderDetailsFlowingWaterIdByJxbz(order.getOrderId().toString(),jxbz,tjFlowingWater.getTjSerialNumber().toString()); |
| | | orderRemarkService.updateTjOrderRemarkSfbzByJxbz(order.getOrderId().toString(),jxbz,tjFlowingWater.getTjSerialNumber().toString()); |
| | | // tjOrderDetailService.updateTjOrderDetailsFlowingWaterIdByJxbz(order.getOrderId().toString(),jxbz,tjFlowingWater.getTjSerialNumber().toString()); |
| | | // orderRemarkService.updateTjOrderRemarkSfbzByJxbz(order.getOrderId().toString(),jxbz,tjFlowingWater.getTjSerialNumber().toString()); |
| | | |
| | | List<TjOrderDetail> detailLists = tjOrderDetailService.getCaiYangDengJiJxbz(order.getOrderId(), jxbz); |
| | | addCaiYangDengJiByDiaoYongShiTu(detailLists, !detailLists.isEmpty(), order, sysUser, jxbz); |
| | |
| | | } |
| | | |
| | | 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"); |
| | |
| | | Long proParentId = project.getProParentId(); |
| | | String dictLabel = sysDictDataService.selectDictLabel("sys_dict_specimen", project.getSpecimenType()); |
| | | if (null != proParentId && proParentId == 0) { |
| | | sampling.setJyxh(idUtils.generateLisID()); |
| | | 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()); |
| | | sampling.setJyxh(idUtils.generateLisID(lis_tmh_prefix)); |
| | | |
| | | sampling.setSpecimenTypeCode(project1.getSpecimenType()); |
| | | sampling.setSpecimenType(dictLabel); |
| | |
| | | } |
| | | |
| | | } |
| | | 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())); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | String dept = configService.selectConfigByKey("request_default_dept"); |
| | | String ysbm = configService.selectConfigByKey("request_default_ysbm"); |
| | | String ysmc = configService.selectConfigByKey("request_default_ysmc"); |
| | | String lis_tmh_prefix = configService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | List<TbTransition> detailList = transitionService.getBlTbTransitionListByCusId(customer.getCusIdcard(),cardId,jxbz); |
| | | Boolean useLisAndPacsRegister = lisApiMethod.isUseLisAndPacsRegister(order); |
| | | List<OutpinmedicapplyDetilsDto> outpinmedicapplyDetilsDtos =new ArrayList<>(); |
| | |
| | | } |
| | | } |
| | | if (stringList.size() > 1) { |
| | | String id = tjSamplingService.mergeCaiYangApi(stringList); |
| | | String id = tjSamplingService.mergeCaiYangApi(stringList,lis_tmh_prefix); |
| | | ids.add(id); |
| | | }else { |
| | | ids.add(stringList.get(0)); |