| | |
| | | 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.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | 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.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; |
| | |
| | | import com.ltkj.mall.mallOrderUtils.TjConstants; |
| | | import com.ltkj.system.service.ISysConfigService; |
| | | import com.ltkj.system.service.ISysDeptService; |
| | | import com.ltkj.system.service.ISysDictDataService; |
| | | import com.ltkj.system.service.ISysUserService; |
| | | import com.ltkj.web.controller.his.HisApiGetMethodService; |
| | | import com.ltkj.web.controller.his.HisApiMethodService; |
| | |
| | | private LisJyflhbService lisJyflhbService; |
| | | @Autowired |
| | | private SamplingServiceApi samplingServiceApi; |
| | | @Autowired |
| | | private ISysDictDataService sysDictDataService; |
| | | @Autowired |
| | | private TjSamplingMapper tjSamplingMapper; |
| | | @Autowired |
| | | private ISysConfigService sysConfigService; |
| | | @Resource |
| | | private ITjXdPictureService xdPictureService; |
| | | @Autowired |
| | | private TjOutpinmedicXmService tjOutpinmedicXmService; |
| | | @Autowired |
| | | private TjOrderYcxmService ycxmService; |
| | | @Autowired |
| | | private ITjRulesService rulesService; |
| | | @Autowired |
| | | private ITjProAdvicerulesService tjProAdvicerulesService; |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | if (null != tjReservation && tjReservation.getPayType() == 1) { |
| | | tjOrderDetailService.updateTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId()), |
| | | sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | orderRemarkService.updateTjOrderRemarkSfbzByJxbzisnull(tjOrder.getOrderId().toString(),tjFlowingWater.getTjSerialNumber().toString()); |
| | | } |
| | | } |
| | | if (tjFlowingWater.getPayStasus() == 1) { |
| | | tjOrderDetailService.updateTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId()), |
| | | sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | orderRemarkService.updateTjOrderRemarkSfbzByJxbzisnull(tjOrder.getOrderId().toString(),tjFlowingWater.getTjSerialNumber().toString()); |
| | | } |
| | | if (tjFlowingWater.getDiscount() == null) { |
| | | transitionService.updateTbTransitionPriceByCusId(tjCustomer.getCusIdcard(), new BigDecimal(10), tjOrder.getTjNumber()); |
| | |
| | | @Override |
| | | @Async("async") |
| | | public void collectFees(TjOrder order, List<TjConsumables> list2, List<TbTransition> tbTransitionList, SysUser sysUser, String discount) { |
| | | orderRemarkService.deletedOrderRemarkByTjNum(order.getTjNumber()); |
| | | redisCache.deleteObject("getOrderDetailByProParentId" + order.getTjNumber()); |
| | | // orderRemarkService.deletedOrderRemarkByTjNum(order.getTjNumber()); |
| | | // redisCache.deleteObject("getOrderDetailByProParentId" + order.getTjNumber()); |
| | | for (TbTransition transition : tbTransitionList) { |
| | | // transition.setNowPrice(transition.getOrdPrice().multiply(BigDecimal.valueOf(Double.parseDouble(discount)).divide(BigDecimal.valueOf(10)))); |
| | | // transitionService.updateById(transition); |
| | |
| | | //父项 |
| | | ArrayList<TbTransition> collect1 = tbTransitionList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TbTransition::getParentProId))), ArrayList::new)); |
| | | List<Long> parentProIds = collect1.stream().map(TbTransition::getParentProId).collect(Collectors.toList()); |
| | | if (parentProIds.size() > 0) { |
| | | if (!parentProIds.isEmpty()) { |
| | | for (Long parentProId : parentProIds) { |
| | | TjProject parentProject = projectService.selectTjProjectByProId(parentProId); |
| | | if (null != parentProject) { |
| | | LambdaQueryWrapper<TjProConsumables> wqqq = new LambdaQueryWrapper<>(); |
| | | wqqq.eq(TjProConsumables::getProId, parentProject.getProId()); |
| | | List<TjProConsumables> proConsumables = proConsumablesService.list(wqqq); |
| | | if (null != proConsumables && proConsumables.size() > 0) { |
| | | if (null != proConsumables && !proConsumables.isEmpty()) { |
| | | for (TjProConsumables tjProConsumables : proConsumables) { |
| | | TjConsumables tjConsumables = consumablesService.selectTjConsumablesById(tjProConsumables.getConsumablesId()); |
| | | list2.add(tjConsumables); |
| | | } |
| | | } |
| | | TjOrderRemark tjOrderRemark = new TjOrderRemark(); |
| | | tjOrderRemark.setProId(parentProId); |
| | | tjOrderRemark.setProName(parentProject.getProName()); |
| | | tjOrderRemark.setDeptId(parentProject.getDeptId()); |
| | | tjOrderRemark.setTjNumber(order.getTjNumber()); |
| | | tjOrderRemark.setCreateBy(sysUser.getNickName()); |
| | | tjOrderRemark.setCreateTime(new Date()); |
| | | tjOrderRemark.setUpdateBy(sysUser.getNickName()); |
| | | tjOrderRemark.setUpdateTime(new Date()); |
| | | tjOrderRemark.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | orderRemarkService.save(tjOrderRemark); |
| | | Map<String, Object> map = getOrderDetailByProParentId(String.valueOf(parentProId), order.getTjNumber()); |
| | | redisCache.setCacheMapValue("getOrderDetailByProParentId" + order.getTjNumber(), String.valueOf(parentProId), map); |
| | | // TjOrderRemark tjOrderRemark = new TjOrderRemark(); |
| | | // tjOrderRemark.setProId(parentProId); |
| | | // tjOrderRemark.setProName(parentProject.getProName()); |
| | | // tjOrderRemark.setDeptId(parentProject.getDeptId()); |
| | | // tjOrderRemark.setTjNumber(order.getTjNumber()); |
| | | // tjOrderRemark.setCreateBy(sysUser.getNickName()); |
| | | // tjOrderRemark.setCreateTime(new Date()); |
| | | // tjOrderRemark.setUpdateBy(sysUser.getNickName()); |
| | | // tjOrderRemark.setUpdateTime(new Date()); |
| | | // tjOrderRemark.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // orderRemarkService.save(tjOrderRemark); |
| | | // Map<String, Object> map = getOrderDetailByProParentId(String.valueOf(parentProId), order.getTjNumber()); |
| | | // redisCache.setCacheMapValue("getOrderDetailByProParentId" + order.getTjNumber(), String.valueOf(parentProId), map); |
| | | } |
| | | } |
| | | } |
| | |
| | | chargingStandardService.save(tjChargingStandard); |
| | | } |
| | | |
| | | // LambdaQueryWrapper<TjOrderDetail> wq = new LambdaQueryWrapper<>(); |
| | | // wq.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | // wq.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | // wq.eq(TjOrderDetail::getIsSampling, 0); |
| | | // List<TjOrderDetail> detailList = tjOrderDetailService.list(wq); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | addCaiYangDengJi(detailList, !detailList.isEmpty(), order, sysUser,null); |
| | | List<TjXdPicture> xdPictureList = xdPictureService.saveTjXdPicture(order.getTjNumber()); |
| | | xdPictureService.saveBatch(xdPictureList); |
| | | } |
| | | |
| | | 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) { |
| | |
| | | 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()); |
| | | LtkjJyxmzd jyxmzd = lisApiMethod.getJyxmzd(project); |
| | | 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.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()); |
| | | 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.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()); |
| | |
| | | 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")){ |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | 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())); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void updateOrdeltile(List<TjOrderDetail> tjOrderDetailList, SysUser sysUser, TjOrder order) { |
| | | 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); |
| | | 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(); |
| | | } |
| | | |
| | | |
| | | 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("。|,|,"); |
| | | 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)); |
| | | } |
| | | ycxmService.updateById(ycxm); |
| | | if(detail.getExceptionDesc()==0)ycxmService.remove(wq); |
| | | } |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | // @Async("async") |
| | | // @Transactional |
| | | public Boolean iundividualCharges(TjFlowingWater tjFlowingWater, TjOrder order, TjCustomer customer, SysUser sysUser) { |
| | | public Boolean iundividualCharges(TjFlowingWater tjFlowingWater, TjOrder order, TjCustomer customer, SysUser sysUser,String jxbz) { |
| | | Date dates = new Date(); |
| | | final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | String jxbz = DateUtil.format(dates, "yyyyMMddHHmmss")+order.getOrderId(); |
| | | |
| | | tjFlowingWater.setJxbz(jxbz); |
| | | tjFlowingWaterService.updateById(tjFlowingWater); |
| | |
| | | |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | |
| | | // //检验 |
| | | // List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>(); |
| | | // |
| | | // //检查 |
| | | // List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>(); |
| | | // |
| | | // |
| | | // //处置 |
| | | // List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>(); |
| | | // |
| | | // List<OutpinmedicapplyDetilsDto> outpinmedicapplyDetilsDtos =new ArrayList<>(); |
| | | |
| | | List<TjProject> projectList=new ArrayList<>(); |
| | | |
| | | ArrayList<TjOrderDetail> tjOrderDetails = new ArrayList<>(); |
| | | // ArrayList<TjOrderDetail> tjOrderDetails = new ArrayList<>(); |
| | | for (String tjProId : tjProIds) { |
| | | TjProject project = projectService.getById(Long.valueOf(tjProId)); |
| | | if (null != project && project.getProParentId() == 0) { |
| | |
| | | tjOrderDetailService.save(detail1); |
| | | } |
| | | |
| | | if(null !=config && config.equals("Y")){ |
| | | //检验 |
| | | // if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJyDeptIds().contains(project.getDeptId().toString())) { |
| | | // if (null != project.getHisXmbm()) { |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | // if (project.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(project.getSl()); |
| | | // detailsDtos.add(detailsDto); |
| | | // } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | // } |
| | | |
| | | //检查 |
| | | |
| | | // if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJcDeptIds().contains(project.getDeptId().toString())) { |
| | | // if (null != project.getHisXmbm()) { |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | // if (project.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(project.getSl()); |
| | | // detailsDtoss.add(detailsDto); |
| | | // } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | // } |
| | | |
| | | //处置 |
| | | |
| | | // if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getCzDeptIds().contains(project.getDeptId().toString())) { |
| | | // if (null != project.getHisXmbm()) { |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | // if (project.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(project.getSl()); |
| | | // detailDtos.add(detailsDto); |
| | | // } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | } else { |
| | | |
| | | //如果该项目存在 则 不保存 |
| | |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setJxbz(jxbz); |
| | | tjOrderDetailService.save(detail); |
| | | tjOrderDetails.add(detail); |
| | | // tjOrderDetails.add(detail); |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJiJxbz(order.getOrderId(),jxbz); |
| | | addCaiYangDengJi(detailList,!detailList.isEmpty(), order, sysUser,jxbz); |
| | | |
| | | tjOrderDetails = new ArrayList<>(); |
| | | // TODO 和签到登记一样 只有配置中的以及收费类型为体检票时才增加到采样管理表 |
| | | // tjOrderDetails = new ArrayList<>(); |
| | | |
| | | ArrayList<TjProject> jianChaProjects = new ArrayList<>(); |
| | | // ArrayList<TjProject> jianYanProjects = new ArrayList<>(); |
| | | |
| | | if(!projectList.isEmpty()){ |
| | | List<TjProject> list = projectList.stream().distinct().collect(Collectors.toList()); |
| | |
| | | detail1.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | detail1.setJxbz(jxbz); |
| | | tjOrderDetailService.save(detail1); |
| | | tjOrderDetails.add(detail1); |
| | | // if(null !=config && config.equals("Y")){ |
| | | //检验 |
| | | // if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJyDeptIds().contains(project.getDeptId().toString())) { |
| | | // if (null != project.getHisXmbm()) { |
| | | // jianYanProjects.add(project); |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // |
| | | // detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | // |
| | | // if (project.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(project.getSl()); |
| | | // detailsDtos.add(detailsDto); |
| | | // } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | // } |
| | | |
| | | //检查 |
| | | |
| | | // tjOrderDetails.add(detail1); |
| | | if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJcDeptIds().contains(project.getDeptId().toString())) { |
| | | if (null != project.getHisXmbm()) { |
| | | jianChaProjects.add(project); |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | // if (project.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(project.getSl()); |
| | | // detailsDtoss.add(detailsDto); |
| | | } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | } |
| | | |
| | | //处置 |
| | | // if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getCzDeptIds().contains(project.getDeptId().toString())) { |
| | | // if (null != project.getHisXmbm()) { |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | // if (project.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(project.getSl()); |
| | | // detailDtos.add(detailsDto); |
| | | // } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | // TODO 和签到登记一样 只有配置中的以及收费类型为体检票时才增加到采样管理表 |
| | | if (lisApiMethod.isUseLisAndPacsRegister(order) && tjFlowingWater.getPayType() == 6L) { |
| | | if(config.equalsIgnoreCase("Y")){ |
| | | // if (lisApiMethod.isUseLisAndPacsRegister(order) && tjFlowingWater.getPayType() == 6L) { |
| | | List<TjOrderDetail> detailLists = tjOrderDetailService.getCaiYangDengJiJxbz(order.getOrderId(), jxbz); |
| | | addCaiYangDengJi(detailLists, !detailLists.isEmpty(), order, sysUser, jxbz); |
| | | // } |
| | | AjaxResult result = tijianbulushenqing(customer, date, order.getCardId(), jxbz, jianChaProjects, tjFlowingWater.getPayType() == 6L); |
| | | if (!result.get("code").toString().equals("200")) |
| | | return false; |
| | | }else { |
| | | List<TjOrderDetail> detailLists = tjOrderDetailService.getCaiYangDengJiJxbz(order.getOrderId(), jxbz); |
| | | addCaiYangDengJi(detailLists, !detailLists.isEmpty(), order, sysUser, jxbz); |
| | | addCaiYangDengJiByDiaoYongShiTu(detailLists, !detailLists.isEmpty(), order, sysUser, jxbz); |
| | | } |
| | | } |
| | | |
| | | // Boolean useLisAndPacsRegister = lisApiMethod.isUseLisAndPacsRegister(order); |
| | | if(null !=config && config.equals("Y")){ |
| | | AjaxResult result = tijianbulushenqing(customer, date, order.getCardId(), jxbz, jianChaProjects, tjFlowingWater.getPayType() == 6L); |
| | | if (!result.get("code").toString().equals("200")) |
| | | return false; |
| | | // if (useLisAndPacsRegister) { |
| | | // List<TjProject> projectList2 = jianYanProjects.stream().distinct().collect(Collectors.toList()); |
| | | // 检查申请 |
| | | // pacsReg(order, customer, jianChaProjects); |
| | | // }else { |
| | | |
| | | |
| | | /* //检验申请 |
| | | if(!detailsDtos.isEmpty()){ |
| | | OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | | dto.setHisRegistrationId(order.getCardId()); |
| | | dto.setSfzh(customer.getCusIdcard()); |
| | | dto.setSqysbm("00029"); |
| | | dto.setMzksbm("0101"); |
| | | dto.setSjrq(date); |
| | | dto.setCzybm("00029"); |
| | | dto.setCzyksbm("0101"); |
| | | dto.setSfjz("0"); |
| | | dto.setDetails(detailsDtos.stream().distinct().collect(Collectors.toList())); |
| | | AjaxResult ajaxResult1 = controller.Outpintestapply(dto); |
| | | String result5 = getAjaxResult(ajaxResult1); |
| | | JSONObject object3 = getJSONObject(result5); |
| | | String code3 = object3.getStr("ResultCode"); |
| | | if (code3.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details = dto.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setSfjx("Y"); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(dto.getHisRegistrationId()); |
| | | LambdaQueryWrapper<TjCustomer> wrapper4 = new LambdaQueryWrapper<>(); |
| | | wrapper4.eq(TjCustomer::getCardId, tree.getCardId()); |
| | | TjCustomer tjCustomer = tjCustomerService.getOne(wrapper4); |
| | | tree.setPationid(tjCustomer.getPationId()); |
| | | JSONObject resultData = object3.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("jysqdh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("检验"); |
| | | LambdaQueryWrapper<TjProject> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjProject::getHisXmbm, mxfyxmbm); |
| | | wrapper.eq(TjProject::getProParentId,0); |
| | | List<TjProject> list = projectService.list(wrapper); |
| | | String tj_price = ""; |
| | | for (TjProject project : list) { |
| | | tj_price += project.getProPrice() + "、"; |
| | | } |
| | | tree.setTjPrice(tj_price.substring(0, tj_price.length() - 1)); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(dates); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | |
| | | // List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | // addCaiYangDengJi(detailList,!detailList.isEmpty(), order, sysUser,jxbz); |
| | | |
| | | } |
| | | } |
| | | |
| | | //门诊检查申请 |
| | | if(!detailsDtoss.isEmpty()){ |
| | | OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto(); |
| | | outpinexamapplyDto.setHisRegistrationId(order.getCardId()); |
| | | outpinexamapplyDto.setSfzh(customer.getCusIdcard()); |
| | | outpinexamapplyDto.setSqysbm("00029"); |
| | | outpinexamapplyDto.setMzksbm("0101"); |
| | | outpinexamapplyDto.setCzybm("00029"); |
| | | outpinexamapplyDto.setCzyksbm("0101"); |
| | | outpinexamapplyDto.setSfjz("0"); |
| | | outpinexamapplyDto.setDetails(detailsDtoss.stream().distinct().collect(Collectors.toList())); |
| | | AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto); |
| | | String result6 = getAjaxResult(ajaxResult2); |
| | | JSONObject object5 = getJSONObject(result6); |
| | | String code4 = object5.getStr("ResultCode"); |
| | | if (code4.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details = outpinexamapplyDto.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setSfjx("Y"); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(outpinexamapplyDto.getHisRegistrationId()); |
| | | LambdaQueryWrapper<TjCustomer> wrapper4 = new LambdaQueryWrapper<>(); |
| | | wrapper4.eq(TjCustomer::getCardId, tree.getCardId()); |
| | | TjCustomer tjCustomer = tjCustomerService.getOne(wrapper4); |
| | | tree.setPationid(tjCustomer.getPationId()); |
| | | JSONObject resultData = object5.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("jcsqdh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("检查"); |
| | | LambdaQueryWrapper<TjProject> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjProject::getHisXmbm, mxfyxmbm); |
| | | wrapper.eq(TjProject::getProParentId,0); |
| | | List<TjProject> list = projectService.list(wrapper); |
| | | String tj_price = ""; |
| | | for (TjProject project : list) { |
| | | tj_price += project.getProPrice() + "、"; |
| | | } |
| | | tree.setTjPrice(tj_price.substring(0, tj_price.length() - 1)); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(dates); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | }*/ |
| | | // } |
| | | /* //药品申请 |
| | | if(!outpinmedicapplyDetilsDtos.isEmpty()){ |
| | | OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); |
| | | dto1.setHisRegistrationId(order.getCardId()); |
| | | dto1.setSfzh(customer.getCusIdcard()); |
| | | dto1.setSqysbm("00029"); |
| | | dto1.setMzksbm("0101"); |
| | | dto1.setSjrq(date); |
| | | dto1.setCzybm("00029"); |
| | | dto1.setCzyksbm("0101"); |
| | | dto1.setCflxbm("A"); |
| | | dto1.setYfbm("1"); |
| | | dto1.setFyts("1"); |
| | | dto1.setMzzd(""); |
| | | dto1.setDetails(outpinmedicapplyDetilsDtos); |
| | | AjaxResult result = controller.Outpinmedicapply(dto1); |
| | | String result1 = getAjaxResult(result); |
| | | JSONObject object = getJSONObject(result1); |
| | | String code = object.getStr("ResultCode"); |
| | | if(null !=code && code.equals("0")){ |
| | | JSONObject resultData = object.getJSONObject("ResultData"); |
| | | // Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0); |
| | | String cfh = resultData.getStr("cfh"); |
| | | |
| | | for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { |
| | | TjCf cf=new TjCf(); |
| | | cf.setCardId(order.getCardId()); |
| | | cf.setSfzh(customer.getCusIdcard()); |
| | | cf.setCfh(cfh); |
| | | cf.setSqysbm("00029"); |
| | | cf.setSqysxm("王健萍"); |
| | | cf.setMzksbn("0101"); |
| | | cf.setSqrq(date); |
| | | cf.setCzybm("00029"); |
| | | cf.setYpbm(detilsDto.getYpbm()); |
| | | cf.setYpmc("尿素[14C]呼气试验药盒"); |
| | | cf.setSl(String.valueOf(detilsDto.getSl())); |
| | | cf.setDj(String.valueOf(detilsDto.getDj())); |
| | | cf.setDcjl(String.valueOf(detilsDto.getDcjl())); |
| | | cf.setPj(String.valueOf(detilsDto.getPj())); |
| | | cf.setJj(String.valueOf(detilsDto.getJj())); |
| | | cf.setCreateTime(new Date()); |
| | | cf.setJxbz(jxbz); |
| | | cfService.save(cf); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //门诊治疗处置申请 |
| | | if(!detailDtos.isEmpty()){ |
| | | OutpintreatapplyDto dao = new OutpintreatapplyDto(); |
| | | dao.setHisRegistrationId(order.getCardId()); |
| | | dao.setSfzh(customer.getCusIdcard()); |
| | | dao.setSqysbm("00029"); |
| | | dao.setMzksbm("0101"); |
| | | dao.setSjrq(date); |
| | | dao.setCzybm("00029"); |
| | | dao.setCzyksbm("0101"); |
| | | dao.setSfjz("0"); |
| | | dao.setDetails(detailDtos.stream().distinct().collect(Collectors.toList())); |
| | | AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao); |
| | | String mzylyzsq2 = getAjaxResult(mzylyzsq1); |
| | | JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2); |
| | | String code5 = mzylyzsq3.getStr("ResultCode"); |
| | | if (code5.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details1 = dao.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details1) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setSfjx("Y"); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(dao.getHisRegistrationId()); |
| | | LambdaQueryWrapper<TjCustomer> wrapper4 = new LambdaQueryWrapper<>(); |
| | | wrapper4.eq(TjCustomer::getCardId, tree.getCardId()); |
| | | TjCustomer tjCustomer = tjCustomerService.getOne(wrapper4); |
| | | tree.setPationid(tjCustomer.getPationId()); |
| | | JSONObject resultData = mzylyzsq3.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("zlczh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("处置"); |
| | | LambdaQueryWrapper<TjProject> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjProject::getHisXmbm, mxfyxmbm); |
| | | wrapper.eq(TjProject::getProParentId,0); |
| | | List<TjProject> list = projectService.list(wrapper); |
| | | String tj_price = ""; |
| | | for (TjProject project : list) { |
| | | tj_price += project.getProPrice() + "、"; |
| | | } |
| | | tree.setTjPrice(tj_price.substring(0, tj_price.length() - 1)); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(dates); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | }*/ |
| | | } |
| | | |
| | | //父项耗材 |
| | | // ArrayList<TjConsumables> collect = list2.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TjConsumables::getId))), ArrayList::new)); |
| | | // for (TjConsumables tjConsumables : collect) { |
| | | // TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | // tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | // tjChargingStandard.setConsumablesId(tjConsumables.getId()); |
| | | // tjChargingStandard.setPrice(tjConsumables.getPrice()); |
| | | // tjChargingStandard.setProName(tjConsumables.getMakings()); |
| | | // tjChargingStandard.setConsumablesName(tjConsumables.getMakings()); |
| | | // tjChargingStandard.setCompany(tjConsumables.getSpecifications()); |
| | | // tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | // tjChargingStandard.setCreateTime(dates); |
| | | // tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | // tjChargingStandard.setUpdateTime(dates); |
| | | // tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // chargingStandardService.save(tjChargingStandard); |
| | | // } |
| | | return true; |
| | | } |
| | | |
| | | 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) { |
| | | 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.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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | 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())); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //体检对his申请单调用方法 |
| | | // public AjaxResult tijianbulushenqing(TjCustomer customer, String date,String cardId,String jxbz,ArrayList<TjProject> jianChaProjects,Boolean isTuanTiPiao) { |
| | | // TjOrder order = orderService.getOrderByCardId(cardId); |
| | | // if(null !=order){ |
| | | // 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 (useLisAndPacsRegister && isTuanTiPiao) { |
| | | // // 检查申请 |
| | | // pacsReg(order, customer, jianChaProjects); |
| | | // LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(TjSampling::getTjNum,order.getTjNumber()); |
| | | // wrapper.eq(TjSampling::getJxbz,jxbz); |
| | | // List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | // log.info("采样数据 ->{}",JSONUtil.toJsonStr(list)); |
| | | // if (!list.isEmpty()){ |
| | | // Map<String, List<TjSampling>> listMap = list.stream().collect(Collectors.groupingBy(TjSampling::getSpecimenTypeCode)); |
| | | // log.info("分组后 ->{}",JSONUtil.toJsonStr(listMap)); |
| | | // ArrayList<String> ids = new ArrayList<>(); |
| | | // for (Map.Entry<String, List<TjSampling>> entry : listMap.entrySet()) { |
| | | // log.info("key ->{},val ->{}",entry.getKey(),entry.getValue()); |
| | | // // Lis标本代码 |
| | | // String specimenTypeCode = entry.getKey(); |
| | | // List<TjSampling> samplings = entry.getValue(); |
| | | // if (samplings.size() >= 2){ |
| | | // // 进行合并 |
| | | // List<String> stringList = samplings.stream().map(TjSampling::getId).collect(Collectors.toList()); |
| | | // log.info("提取id ->{}",stringList); |
| | | // for (int i = 0; i < stringList.size(); i++) { |
| | | // String s = stringList.get(i); |
| | | // if (tjSamplingService.isMergeItem(s) != 0) { |
| | | // stringList.remove(s); |
| | | // ids.add(s); |
| | | // } |
| | | // } |
| | | // if (stringList.size() > 1) { |
| | | // String id = tjSamplingService.mergeCaiYangApi(stringList,lis_tmh_prefix); |
| | | // ids.add(id); |
| | | // }else { |
| | | // ids.add(stringList.get(0)); |
| | | // } |
| | | // }else { |
| | | // ids.add(samplings.get(0).getId()); |
| | | // } |
| | | // } |
| | | // Boolean confirmed = samplingServiceApi.confirmSamplingApi(ids, "Y", "N"); |
| | | // if (!confirmed) |
| | | // return AjaxResult.error("处理失败"); |
| | | // } |
| | | // }else { |
| | | // //检验申请 |
| | | // OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | | // dto.setHisRegistrationId(cardId); |
| | | // dto.setSfzh(customer.getCusIdcard()); |
| | | // dto.setSqysbm(ysbm); |
| | | // dto.setMzksbm(dept); |
| | | // dto.setSjrq(date); |
| | | // dto.setCzybm(ysbm); |
| | | // dto.setCzyksbm(dept); |
| | | // dto.setSfjz("0"); |
| | | // |
| | | // List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>(); |
| | | // if (null != detailList && !detailList.isEmpty()) { |
| | | // LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | // wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | //// wq.groupBy(TjProject::getHisXmbm); |
| | | //// wq.in(TjProject::getDeptId, "241", "317"); |
| | | // wq.in(TjProject::getDeptId,deptService.getJyDeptIds()); |
| | | // List<TjProject> projects = projectService.list(wq); |
| | | // if (null != projects && !projects.isEmpty()) { |
| | | // for (TjProject project : projects) { |
| | | // if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | // if (null != project.getHisXmbm()) { |
| | | // 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()); |
| | | // detailsDtos.add(detailsDto); |
| | | // } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // if (!detailsDtos.isEmpty()) { |
| | | // dto.setDetails(detailsDtos); |
| | | // AjaxResult ajaxResult1 = controller.Outpintestapply(dto); |
| | | // String result5 = getAjaxResult(ajaxResult1); |
| | | // JSONObject object3 = getJSONObject(result5); |
| | | // String code3 = object3.getStr("ResultCode"); |
| | | // if (code3.equals("0")) { |
| | | // List<OutpintestapplyDetailsDto> details = dto.getDetails(); |
| | | // for (OutpintestapplyDetailsDto detail : details) { |
| | | // LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | // tree.setJxbz(jxbz); |
| | | // tree.setCardId(dto.getHisRegistrationId()); |
| | | // tree.setPationid(customer.getPationId()); |
| | | // JSONObject resultData = object3.getJSONObject("ResultData"); |
| | | // tree.setSqdh(resultData.getStr("jysqdh")); |
| | | // tree.setFyhj(resultData.getStr("fyhj")); |
| | | // String mxfyxmbm = detail.getMxfyxmbm(); |
| | | // tree.setHisXmdm(mxfyxmbm); |
| | | // tree.setType("检验"); |
| | | // tree.setService("his"); |
| | | // tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | // LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | // if (detail.getSfzhfy().equals("1")) |
| | | // wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | // else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | // List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | // if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | // String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | // LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | // wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | // LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | // LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | // wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | // LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | // tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | // } |
| | | // tree.setCreateTime(DateUtil.date()); |
| | | // ltkjJianchajianyanTreeService.save(tree); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // //门诊检查申请 |
| | | // OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto(); |
| | | // outpinexamapplyDto.setHisRegistrationId(cardId); |
| | | // outpinexamapplyDto.setSfzh(customer.getCusIdcard()); |
| | | // outpinexamapplyDto.setSqysbm(ysbm); |
| | | // outpinexamapplyDto.setMzksbm(dept); |
| | | // outpinexamapplyDto.setCzybm(ysbm); |
| | | // outpinexamapplyDto.setCzyksbm(dept); |
| | | // outpinexamapplyDto.setSfjz("0"); |
| | | //// List<TbTransition> detailLists = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId); |
| | | // List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>(); |
| | | // if (null != detailList && !detailList.isEmpty()) { |
| | | // LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | // wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | // wq.in(TjProject::getDeptId,deptService.getJcDeptIds()); |
| | | // List<TjProject> projects = projectService.list(wq); |
| | | // if (null != projects && !projects.isEmpty()) { |
| | | // for (TjProject project : projects) { |
| | | // if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | // if (null != project.getHisXmbm()) { |
| | | // 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()); |
| | | // detailsDtoss.add(detailsDto); |
| | | // } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // if (!detailsDtoss.isEmpty()) { |
| | | // outpinexamapplyDto.setDetails(detailsDtoss); |
| | | // AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto); |
| | | // String result6 = getAjaxResult(ajaxResult2); |
| | | // JSONObject object5 = getJSONObject(result6); |
| | | // String code4 = object5.getStr("ResultCode"); |
| | | // if (code4.equals("0")) { |
| | | // List<OutpintestapplyDetailsDto> details = outpinexamapplyDto.getDetails(); |
| | | // for (OutpintestapplyDetailsDto detail : details) { |
| | | // LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | // tree.setJxbz(jxbz); |
| | | // tree.setCardId(outpinexamapplyDto.getHisRegistrationId()); |
| | | // tree.setPationid(customer.getPationId()); |
| | | // JSONObject resultData = object5.getJSONObject("ResultData"); |
| | | // tree.setSqdh(resultData.getStr("jcsqdh")); |
| | | // tree.setFyhj(resultData.getStr("fyhj")); |
| | | // String mxfyxmbm = detail.getMxfyxmbm(); |
| | | // tree.setHisXmdm(mxfyxmbm); |
| | | // tree.setType("检查"); |
| | | // tree.setService("his"); |
| | | // tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | // LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | // if (detail.getSfzhfy().equals("1")) |
| | | // wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | // else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | // List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | // if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | // String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | // LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | // wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | // LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | // LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | // wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | // LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | // tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | // } |
| | | // tree.setCreateTime(DateUtil.date()); |
| | | // ltkjJianchajianyanTreeService.save(tree); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // //门诊治疗处置申请 |
| | | // OutpintreatapplyDto dao = new OutpintreatapplyDto(); |
| | | // dao.setHisRegistrationId(cardId); |
| | | // dao.setSfzh(customer.getCusIdcard()); |
| | | // dao.setSqysbm(ysbm); |
| | | // dao.setMzksbm(dept); |
| | | // dao.setSjrq(date); |
| | | // dao.setCzybm(ysbm); |
| | | // dao.setCzyksbm(dept); |
| | | // dao.setSfjz("0"); |
| | | //// List<TbTransition> details = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId); |
| | | // List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>(); |
| | | // if (null != detailList && !detailList.isEmpty()) { |
| | | // LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | // wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | // wq.in(TjProject::getDeptId,deptService.getCzDeptIds()); |
| | | // List<TjProject> projects = projectService.list(wq); |
| | | // if (null != projects && !projects.isEmpty()) { |
| | | // for (TjProject project : projects) { |
| | | // if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | // if (null != project.getHisXmbm()) { |
| | | // 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); |
| | | // } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // if (!detailDtos.isEmpty()) { |
| | | // dao.setDetails(detailDtos); |
| | | // AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao); |
| | | // String mzylyzsq2 = getAjaxResult(mzylyzsq1); |
| | | // JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2); |
| | | // String code5 = mzylyzsq3.getStr("ResultCode"); |
| | | // if (code5.equals("0")) { |
| | | // List<OutpintestapplyDetailsDto> details1 = dao.getDetails(); |
| | | // for (OutpintestapplyDetailsDto detail : details1) { |
| | | // LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | // tree.setJxbz(jxbz); |
| | | // tree.setCardId(dao.getHisRegistrationId()); |
| | | // tree.setPationid(customer.getPationId()); |
| | | // JSONObject resultData = mzylyzsq3.getJSONObject("ResultData"); |
| | | // tree.setSqdh(resultData.getStr("zlczh")); |
| | | // tree.setFyhj(resultData.getStr("fyhj")); |
| | | // String mxfyxmbm = detail.getMxfyxmbm(); |
| | | // tree.setHisXmdm(mxfyxmbm); |
| | | // tree.setType("处置"); |
| | | // tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | // LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | // if (detail.getSfzhfy().equals("1")) |
| | | // wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | // else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | // List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | // if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | // String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | // LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | // wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | // LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | // LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | // wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | // LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | // tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | // } |
| | | // tree.setCreateTime(DateUtil.date()); |
| | | // ltkjJianchajianyanTreeService.save(tree); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // //药品申请 |
| | | // if(!outpinmedicapplyDetilsDtos.isEmpty()){ |
| | | // OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); |
| | | // dto1.setHisRegistrationId(cardId); |
| | | // dto1.setSfzh(customer.getCusIdcard()); |
| | | // dto1.setSqysbm(ysbm); |
| | | // dto1.setMzksbm(dept); |
| | | // dto1.setSjrq(date); |
| | | // dto1.setCzybm(ysbm); |
| | | // dto1.setCzyksbm(dept); |
| | | // dto1.setCflxbm("A"); |
| | | // dto1.setYfbm("1"); |
| | | // dto1.setFyts("1"); |
| | | // dto1.setMzzd(""); |
| | | // dto1.setDetails(outpinmedicapplyDetilsDtos); |
| | | // AjaxResult result = controller.Outpinmedicapply(dto1); |
| | | // String result1 = getAjaxResult(result); |
| | | // JSONObject object = getJSONObject(result1); |
| | | // String code = object.getStr("ResultCode"); |
| | | // if(null !=code && code.equals("0")){ |
| | | // JSONObject resultData = object.getJSONObject("ResultData"); |
| | | //// Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0); |
| | | // String cfh = resultData.getStr("cfh"); |
| | | // log.info("药品申请后的处方号是: "+cfh+" outpinmedicapplyDetilsDtos 里面的值为: "+outpinmedicapplyDetilsDtos.toString()); |
| | | // for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { |
| | | // TjCf cf=new TjCf(); |
| | | // cf.setJxbz(jxbz); |
| | | // cf.setCardId(cardId); |
| | | // cf.setSfzh(customer.getCusIdcard()); |
| | | // cf.setCfh(cfh); |
| | | // cf.setSqysbm(ysbm); |
| | | // cf.setSqysxm(ysmc); |
| | | // cf.setMzksbn(dept); |
| | | // cf.setSqrq(date); |
| | | // cf.setCzybm(ysbm); |
| | | // cf.setYpbm(detilsDto.getYpbm()); |
| | | // cf.setYpmc("尿素[14C]呼气试验药盒"); |
| | | // cf.setSl(String.valueOf(detilsDto.getSl())); |
| | | // cf.setDj(String.valueOf(detilsDto.getDj())); |
| | | // cf.setDcjl(String.valueOf(detilsDto.getDcjl())); |
| | | // cf.setPj(String.valueOf(detilsDto.getPj())); |
| | | // cf.setJj(String.valueOf(detilsDto.getJj())); |
| | | // cf.setCreateTime(new Date()); |
| | | // cfService.save(cf); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // return AjaxResult.success(); |
| | | // } |
| | | |
| | | /**/ |
| | | // public AjaxResult tijianbulushenqing(TjCustomer customer, String date,String cardId,String jxbz,ArrayList<TjProject> jianChaProjects,Boolean isTuanTiPiao) { |
| | | // TjOrder order = orderService.getOrderByCardId(cardId); |
| | | // if(null !=order){ |
| | | // 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 (useLisAndPacsRegister && isTuanTiPiao) { |
| | | // // 检查申请 |
| | | // pacsReg(order, customer, jianChaProjects); |
| | | // LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(TjSampling::getTjNum,order.getTjNumber()); |
| | | // wrapper.eq(TjSampling::getJxbz,jxbz); |
| | | // List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | // log.info("采样数据 ->{}",JSONUtil.toJsonStr(list)); |
| | | // if (!list.isEmpty()){ |
| | | // Map<String, List<TjSampling>> listMap = list.stream().collect(Collectors.groupingBy(TjSampling::getSpecimenTypeCode)); |
| | | // log.info("分组后 ->{}",JSONUtil.toJsonStr(listMap)); |
| | | // ArrayList<String> ids = new ArrayList<>(); |
| | | // for (Map.Entry<String, List<TjSampling>> entry : listMap.entrySet()) { |
| | | // log.info("key ->{},val ->{}",entry.getKey(),entry.getValue()); |
| | | // // Lis标本代码 |
| | | // String specimenTypeCode = entry.getKey(); |
| | | // List<TjSampling> samplings = entry.getValue(); |
| | | // if (samplings.size() >= 2){ |
| | | // // 进行合并 |
| | | // List<String> stringList = samplings.stream().map(TjSampling::getId).collect(Collectors.toList()); |
| | | // log.info("提取id ->{}",stringList); |
| | | // for (int i = 0; i < stringList.size(); i++) { |
| | | // String s = stringList.get(i); |
| | | // if (tjSamplingService.isMergeItem(s) != 0) { |
| | | // stringList.remove(s); |
| | | // ids.add(s); |
| | | // } |
| | | // } |
| | | // if (stringList.size() > 1) { |
| | | // String id = tjSamplingService.mergeCaiYangApi(stringList,lis_tmh_prefix); |
| | | // ids.add(id); |
| | | // }else { |
| | | // ids.add(stringList.get(0)); |
| | | // } |
| | | // }else { |
| | | // ids.add(samplings.get(0).getId()); |
| | | // } |
| | | // } |
| | | // Boolean confirmed = samplingServiceApi.confirmSamplingApi(ids, "Y", "N"); |
| | | // if (!confirmed) |
| | | // return AjaxResult.error("处理失败"); |
| | | // } |
| | | // }else { |
| | | // //检验申请 |
| | | // if (null != detailList && !detailList.isEmpty()) { |
| | | // LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | // wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | //// wq.groupBy(TjProject::getHisXmbm); |
| | | //// wq.in(TjProject::getDeptId, "241", "317"); |
| | | // wq.in(TjProject::getDeptId,deptService.getJyDeptIds()); |
| | | // List<TjProject> projects = projectService.list(wq); |
| | | // if (null != projects && !projects.isEmpty()) { |
| | | // List<TjProject> notNull = projects.stream().filter(i -> i.getSpecimenType() != null).collect(Collectors.toList()); |
| | | // List<TjProject> isNull = projects.stream().filter(i -> i.getSpecimenType() == null).collect(Collectors.toList()); |
| | | // Map<String, List<TjProject>> listMap = notNull.stream().collect(Collectors.groupingBy(TjProject::getSpecimenType)); |
| | | // if (!isNull.isEmpty()) |
| | | // listMap.put("",isNull); |
| | | // for (Map.Entry<String, List<TjProject>> entry : listMap.entrySet()) { |
| | | // OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | | // dto.setHisRegistrationId(cardId); |
| | | // dto.setSfzh(customer.getCusIdcard()); |
| | | // dto.setSqysbm(ysbm); |
| | | // dto.setMzksbm(dept); |
| | | // dto.setSjrq(date); |
| | | // dto.setCzybm(ysbm); |
| | | // dto.setCzyksbm(dept); |
| | | // dto.setSfjz("0"); |
| | | // List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>(); |
| | | // List<TjProject> value = entry.getValue(); |
| | | // for (TjProject project : value) { |
| | | // LambdaQueryWrapper<TjProject> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(TjProject::getProParentId,project.getProId()); |
| | | // List<TjProject> list = projectService.list(wrapper); |
| | | // for (TjProject tjProject : list) { |
| | | // if (StrUtil.isNotBlank(tjProject.getHisXmbm()) && tjProject.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // detailsDto.setMxfyxmbm(tjProject.getHisXmbm()); |
| | | // if (tjProject.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(tjProject.getSl()); |
| | | // detailsDto.setProjg(tjProject.getProPrice()); |
| | | // detailsDtos.add(detailsDto); |
| | | // } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | // } |
| | | // } |
| | | // if (!detailsDtos.isEmpty()) { |
| | | // dto.setDetails(detailsDtos); |
| | | // AjaxResult ajaxResult1 = controller.Outpintestapply(dto); |
| | | // String result5 = getAjaxResult(ajaxResult1); |
| | | // JSONObject object3 = getJSONObject(result5); |
| | | // String code3 = object3.getStr("ResultCode"); |
| | | // if (code3.equals("0")) { |
| | | // List<OutpintestapplyDetailsDto> details = dto.getDetails(); |
| | | // for (OutpintestapplyDetailsDto detail : details) { |
| | | // LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | // tree.setCardId(dto.getHisRegistrationId()); |
| | | // tree.setPationid(customer.getPationId()); |
| | | // JSONObject resultData = object3.getJSONObject("ResultData"); |
| | | // tree.setSqdh(resultData.getStr("jysqdh")); |
| | | // tree.setFyhj(resultData.getStr("fyhj")); |
| | | // String mxfyxmbm = detail.getMxfyxmbm(); |
| | | // tree.setHisXmdm(mxfyxmbm); |
| | | // tree.setType("检验"); |
| | | // tree.setService("his"); |
| | | // tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | // LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | // if (detail.getSfzhfy().equals("1")) |
| | | // wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | // else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | // List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | // if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | // String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | // LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | // wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | // LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | // LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | // wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | // LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | // tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | // } |
| | | // tree.setCreateTime(DateUtil.date()); |
| | | // ltkjJianchajianyanTreeService.save(tree); |
| | | // } |
| | | // // TODO 个人以及团体 暂不向采样管理写数据 |
| | | // // HIS发送无法合并操作 无法获取LIS的检验序号 条码无法打印 |
| | | //// TjOrder tjOrder = orderService.getOrderByCardId(cardId); |
| | | //// if(null !=tjOrder){ |
| | | //// List<TjOrderDetail> dengJi = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId()); |
| | | //// tjSysAsyncService.addCaiYangDengJi(dengJi,!dengJi.isEmpty(),tjOrder, SecurityUtils.getLoginUser().getUser(), null); |
| | | //// } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // //门诊检查申请 |
| | | //// List<TbTransition> detailLists = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId); |
| | | // if (null != detailList && !detailList.isEmpty()) { |
| | | // LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | // wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | // wq.in(TjProject::getDeptId,deptService.getJcDeptIds()); |
| | | // List<TjProject> projects = projectService.list(wq); |
| | | // if (null != projects && !projects.isEmpty()) { |
| | | // for (TjProject project : projects) { |
| | | // OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto(); |
| | | // outpinexamapplyDto.setHisRegistrationId(cardId); |
| | | // outpinexamapplyDto.setSfzh(customer.getCusIdcard()); |
| | | // outpinexamapplyDto.setSqysbm(ysbm); |
| | | // outpinexamapplyDto.setMzksbm(dept); |
| | | // outpinexamapplyDto.setCzybm(ysbm); |
| | | // outpinexamapplyDto.setCzyksbm(dept); |
| | | // outpinexamapplyDto.setSfjz("0"); |
| | | // List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>(); |
| | | // if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | // LambdaQueryWrapper<TjProject> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(TjProject::getProParentId,project.getProId()); |
| | | // List<TjProject> list = projectService.list(wrapper); |
| | | // for (TjProject tjProject : list) { |
| | | // if (StrUtil.isNotBlank(tjProject.getHisXmbm()) && tjProject.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // detailsDto.setMxfyxmbm(tjProject.getHisXmbm()); |
| | | // if (tjProject.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(tjProject.getSl()); |
| | | // detailsDto.setProjg(tjProject.getProPrice()); |
| | | // detailsDtoss.add(detailsDto); |
| | | // } |
| | | // } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | // } |
| | | // if (!detailsDtoss.isEmpty()) { |
| | | // outpinexamapplyDto.setDetails(detailsDtoss); |
| | | // AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto); |
| | | // String result6 = getAjaxResult(ajaxResult2); |
| | | // JSONObject object5 = getJSONObject(result6); |
| | | // String code4 = object5.getStr("ResultCode"); |
| | | // if (code4.equals("0")) { |
| | | // List<OutpintestapplyDetailsDto> details = outpinexamapplyDto.getDetails(); |
| | | // for (OutpintestapplyDetailsDto detail : details) { |
| | | // LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | // tree.setJxbz(jxbz); |
| | | // tree.setCardId(outpinexamapplyDto.getHisRegistrationId()); |
| | | // tree.setPationid(customer.getPationId()); |
| | | // JSONObject resultData = object5.getJSONObject("ResultData"); |
| | | // tree.setSqdh(resultData.getStr("jcsqdh")); |
| | | // tree.setFyhj(resultData.getStr("fyhj")); |
| | | // String mxfyxmbm = detail.getMxfyxmbm(); |
| | | // tree.setHisXmdm(mxfyxmbm); |
| | | // tree.setType("检查"); |
| | | // tree.setService("his"); |
| | | // tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | // LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | // if (detail.getSfzhfy().equals("1")) |
| | | // wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | // else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | // List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | // if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | // String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | // LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | // wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | // LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | // LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | // wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | // LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | // tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | // } |
| | | // tree.setCreateTime(DateUtil.date()); |
| | | // ltkjJianchajianyanTreeService.save(tree); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // //门诊治疗处置申请 |
| | | // OutpintreatapplyDto dao = new OutpintreatapplyDto(); |
| | | // dao.setHisRegistrationId(cardId); |
| | | // dao.setSfzh(customer.getCusIdcard()); |
| | | // dao.setSqysbm(ysbm); |
| | | // dao.setMzksbm(dept); |
| | | // dao.setSjrq(date); |
| | | // dao.setCzybm(ysbm); |
| | | // dao.setCzyksbm(dept); |
| | | // dao.setSfjz("0"); |
| | | //// List<TbTransition> details = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId); |
| | | // if (null != detailList && !detailList.isEmpty()) { |
| | | // LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | // wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | // wq.in(TjProject::getDeptId,deptService.getCzDeptIds()); |
| | | // List<TjProject> projects = projectService.list(wq); |
| | | // if (null != projects && !projects.isEmpty()) { |
| | | // for (TjProject project : projects) { |
| | | // List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>(); |
| | | // if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | // LambdaQueryWrapper<TjProject> wrapper = new LambdaQueryWrapper<>(); |
| | | // wrapper.eq(TjProject::getProParentId,project.getProId()); |
| | | // List<TjProject> list = projectService.list(wrapper); |
| | | // for (TjProject tjProject : list) { |
| | | // if (StrUtil.isNotBlank(tjProject.getHisXmbm()) && tjProject.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | // OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | // detailsDto.setMxfyxmbm(tjProject.getHisXmbm()); |
| | | // if (tjProject.getSfzhfy().equals("Y")) { |
| | | // detailsDto.setSfzhfy("1"); |
| | | // } else { |
| | | // detailsDto.setSfzhfy("0"); |
| | | // } |
| | | // detailsDto.setSl(tjProject.getSl()); |
| | | // detailsDto.setProjg(tjProject.getProPrice()); |
| | | // detailDtos.add(detailsDto); |
| | | // } |
| | | // } |
| | | // if(project.getProId()==1740177341251154377L){ |
| | | // OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | // detilsDto.setYpbm("00006670"); |
| | | // detilsDto.setPcbm("06"); |
| | | // detilsDto.setSl("1"); |
| | | // detilsDto.setDj("60"); |
| | | // detilsDto.setDcjl("1"); |
| | | // detilsDto.setPj("60"); |
| | | // detilsDto.setJj("60"); |
| | | // detilsDto.setJldw(""); |
| | | // detilsDto.setTjbm(""); |
| | | // detilsDto.setPs(""); |
| | | // detilsDto.setPsbm(""); |
| | | // detilsDto.setYyts(""); |
| | | // detilsDto.setXtph(""); |
| | | // detilsDto.setScph(""); |
| | | // detilsDto.setYpxq(""); |
| | | // detilsDto.setCdbm(""); |
| | | // detilsDto.setKfdw(""); |
| | | // detilsDto.setYfdw(""); |
| | | // detilsDto.setYysm(""); |
| | | // detilsDto.setFzbl("1"); |
| | | // detilsDto.setZh("0"); |
| | | // outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | // } |
| | | // } |
| | | // if (!detailDtos.isEmpty()) { |
| | | // dao.setDetails(detailDtos); |
| | | // AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao); |
| | | // String mzylyzsq2 = getAjaxResult(mzylyzsq1); |
| | | // JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2); |
| | | // String code5 = mzylyzsq3.getStr("ResultCode"); |
| | | // if (code5.equals("0")) { |
| | | // List<OutpintestapplyDetailsDto> details1 = dao.getDetails(); |
| | | // for (OutpintestapplyDetailsDto detail : details1) { |
| | | // LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | // tree.setJxbz(jxbz); |
| | | // tree.setCardId(dao.getHisRegistrationId()); |
| | | // tree.setPationid(customer.getPationId()); |
| | | // JSONObject resultData = mzylyzsq3.getJSONObject("ResultData"); |
| | | // tree.setSqdh(resultData.getStr("zlczh")); |
| | | // tree.setFyhj(resultData.getStr("fyhj")); |
| | | // String mxfyxmbm = detail.getMxfyxmbm(); |
| | | // tree.setHisXmdm(mxfyxmbm); |
| | | // tree.setType("处置"); |
| | | // tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | // LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | // if (detail.getSfzhfy().equals("1")) |
| | | // wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | // else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | // List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | // if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | // String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | // LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | // wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | // LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | // LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | // wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | // LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | // tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | // } |
| | | // tree.setCreateTime(DateUtil.date()); |
| | | // ltkjJianchajianyanTreeService.save(tree); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // //药品申请 |
| | | // if(!outpinmedicapplyDetilsDtos.isEmpty()){ |
| | | // OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); |
| | | // dto1.setHisRegistrationId(cardId); |
| | | // dto1.setSfzh(customer.getCusIdcard()); |
| | | // dto1.setSqysbm(ysbm); |
| | | // dto1.setMzksbm(dept); |
| | | // dto1.setSjrq(date); |
| | | // dto1.setCzybm(ysbm); |
| | | // dto1.setCzyksbm(dept); |
| | | // dto1.setCflxbm("A"); |
| | | // dto1.setYfbm("1"); |
| | | // dto1.setFyts("1"); |
| | | // dto1.setMzzd(""); |
| | | // dto1.setDetails(outpinmedicapplyDetilsDtos); |
| | | // AjaxResult result = controller.Outpinmedicapply(dto1); |
| | | // String result1 = getAjaxResult(result); |
| | | // JSONObject object = getJSONObject(result1); |
| | | // String code = object.getStr("ResultCode"); |
| | | // if(null !=code && code.equals("0")){ |
| | | // JSONObject resultData = object.getJSONObject("ResultData"); |
| | | //// Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0); |
| | | // String cfh = resultData.getStr("cfh"); |
| | | // log.info("药品申请后的处方号是: "+cfh+" outpinmedicapplyDetilsDtos 里面的值为: "+outpinmedicapplyDetilsDtos.toString()); |
| | | // for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { |
| | | // TjCf cf=new TjCf(); |
| | | // cf.setJxbz(jxbz); |
| | | // cf.setCardId(cardId); |
| | | // cf.setSfzh(customer.getCusIdcard()); |
| | | // cf.setCfh(cfh); |
| | | // cf.setSqysbm(ysbm); |
| | | // cf.setSqysxm(ysmc); |
| | | // cf.setMzksbn(dept); |
| | | // cf.setSqrq(date); |
| | | // cf.setCzybm(ysbm); |
| | | // cf.setYpbm(detilsDto.getYpbm()); |
| | | // cf.setYpmc("尿素[14C]呼气试验药盒"); |
| | | // cf.setSl(String.valueOf(detilsDto.getSl())); |
| | | // cf.setDj(String.valueOf(detilsDto.getDj())); |
| | | // cf.setDcjl(String.valueOf(detilsDto.getDcjl())); |
| | | // cf.setPj(String.valueOf(detilsDto.getPj())); |
| | | // cf.setJj(String.valueOf(detilsDto.getJj())); |
| | | // cf.setCreateTime(new Date()); |
| | | // cfService.save(cf); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // return AjaxResult.success(); |
| | | // } |
| | | |
| | | public AjaxResult tijianbulushenqing(TjCustomer customer, String date,String cardId,String jxbz,ArrayList<TjProject> jianChaProjects,Boolean isTuanTiPiao) { |
| | | TjOrder order = orderService.getOrderByCardId(cardId); |
| | | if(null !=order){ |
| | | 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<>(); |
| | |
| | | pacsReg(order, customer, jianChaProjects); |
| | | LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjSampling::getTjNum,order.getTjNumber()); |
| | | wrapper.eq(TjSampling::getJxbz,jxbz); |
| | | List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | log.info("采样数据 ->{}",list); |
| | | log.info("采样数据 ->{}",JSONUtil.toJsonStr(list)); |
| | | if (!list.isEmpty()){ |
| | | Map<String, List<TjSampling>> listMap = list.stream().collect(Collectors.groupingBy(TjSampling::getSpecimenTypeCode)); |
| | | log.info("分组后 ->{}",JSONUtil.toJsonStr(listMap)); |
| | |
| | | // Lis标本代码 |
| | | String specimenTypeCode = entry.getKey(); |
| | | List<TjSampling> samplings = entry.getValue(); |
| | | if (samplings.size() > 1){ |
| | | if (samplings.size() >= 2){ |
| | | // 进行合并 |
| | | List<String> stringList = samplings.stream().map(TjSampling::getId).collect(Collectors.toList()); |
| | | log.info("提取id ->{}",stringList); |
| | | // log.info("提取id ->{}",stringList); |
| | | for (int i = 0; i < stringList.size(); i++) { |
| | | String s = stringList.get(i); |
| | | if (tjSamplingService.isMergeItem(s) != 0) { |
| | |
| | | ids.add(s); |
| | | } |
| | | } |
| | | String id = tjSamplingService.mergeCaiYangApi(stringList); |
| | | ids.add(id); |
| | | if (stringList.size() > 1) { |
| | | String id = tjSamplingService.mergeCaiYangApi(stringList,lis_tmh_prefix); |
| | | ids.add(id); |
| | | }else { |
| | | ids.add(stringList.get(0)); |
| | | } |
| | | }else { |
| | | ids.add(samplings.get(0).getId()); |
| | | } |
| | |
| | | return AjaxResult.error("处理失败"); |
| | | } |
| | | }else { |
| | | List<TjOutpinmedicXm> outpinmedicXms = tjOutpinmedicXmService.list(); |
| | | //检验申请 |
| | | OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | | dto.setHisRegistrationId(cardId); |
| | | dto.setSfzh(customer.getCusIdcard()); |
| | | dto.setSqysbm("00029"); |
| | | dto.setMzksbm("0101"); |
| | | dto.setSjrq(date); |
| | | dto.setCzybm("00029"); |
| | | dto.setCzyksbm("0101"); |
| | | dto.setSfjz("0"); |
| | | |
| | | List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>(); |
| | | if (null != detailList && !detailList.isEmpty()) { |
| | | LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | |
| | | wq.in(TjProject::getDeptId,deptService.getJyDeptIds()); |
| | | List<TjProject> projects = projectService.list(wq); |
| | | if (null != projects && !projects.isEmpty()) { |
| | | for (TjProject project : projects) { |
| | | if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | if (null != project.getHisXmbm()) { |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | List<TjProject> notNull = projects.stream().filter(i -> i.getSpecimenType() != null).collect(Collectors.toList()); |
| | | List<TjProject> isNull = projects.stream().filter(i -> i.getSpecimenType() == null).collect(Collectors.toList()); |
| | | Map<String, List<TjProject>> listMap = notNull.stream().collect(Collectors.groupingBy(TjProject::getSpecimenType)); |
| | | if (!isNull.isEmpty()) |
| | | listMap.put("",isNull); |
| | | for (Map.Entry<String, List<TjProject>> entry : listMap.entrySet()) { |
| | | OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | | dto.setHisRegistrationId(cardId); |
| | | dto.setSfzh(customer.getCusIdcard()); |
| | | dto.setSqysbm(ysbm); |
| | | dto.setMzksbm(dept); |
| | | dto.setSjrq(date); |
| | | dto.setCzybm(ysbm); |
| | | dto.setCzyksbm(dept); |
| | | dto.setSfjz("0"); |
| | | List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>(); |
| | | List<TjProject> value = entry.getValue(); |
| | | for (TjProject project : value) { |
| | | LambdaQueryWrapper<TjProject> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjProject::getProParentId,project.getProId()); |
| | | List<TjProject> list = projectService.list(wrapper); |
| | | for (TjProject tjProject : list) { |
| | | if (StrUtil.isNotBlank(tjProject.getHisXmbm()) && tjProject.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(tjProject.getHisXmbm()); |
| | | if (tjProject.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | } |
| | | detailsDto.setSl(tjProject.getSl()); |
| | | detailsDto.setProjg(tjProject.getProPrice()); |
| | | detailsDtos.add(detailsDto); |
| | | } |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDto.setProjg(project.getProPrice()); |
| | | detailsDtos.add(detailsDto); |
| | | } |
| | | if(project.getProId()==1740177341251154377L){ |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm("00006670"); |
| | | detilsDto.setPcbm("06"); |
| | | detilsDto.setSl("1"); |
| | | detilsDto.setDj("60"); |
| | | detilsDto.setDcjl("1"); |
| | | detilsDto.setPj("60"); |
| | | detilsDto.setJj("60"); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | | detilsDto.setPsbm(""); |
| | | detilsDto.setYyts(""); |
| | | detilsDto.setXtph(""); |
| | | detilsDto.setScph(""); |
| | | detilsDto.setYpxq(""); |
| | | detilsDto.setCdbm(""); |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setFzbl("1"); |
| | | detilsDto.setZh("0"); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | if (!outpinmedicXms.isEmpty()) { |
| | | outpinmedicXms.stream().filter(i -> i.getProId().equals(project.getProId())).forEach(i -> { |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm(i.getYpbm()); |
| | | detilsDto.setPcbm(i.getPcbm()); |
| | | detilsDto.setSl(i.getSl()); |
| | | detilsDto.setDj(i.getDj()); |
| | | detilsDto.setDcjl(i.getDcjl()); |
| | | detilsDto.setPj(i.getPj()); |
| | | detilsDto.setJj(i.getJj()); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | | detilsDto.setPsbm(""); |
| | | detilsDto.setYyts(""); |
| | | detilsDto.setXtph(""); |
| | | detilsDto.setScph(""); |
| | | detilsDto.setYpxq(""); |
| | | detilsDto.setCdbm(""); |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (!detailsDtos.isEmpty()) { |
| | | dto.setDetails(detailsDtos); |
| | | AjaxResult ajaxResult1 = controller.Outpintestapply(dto); |
| | | String result5 = getAjaxResult(ajaxResult1); |
| | | JSONObject object3 = getJSONObject(result5); |
| | | String code3 = object3.getStr("ResultCode"); |
| | | if (code3.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details = dto.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(dto.getHisRegistrationId()); |
| | | tree.setPationid(customer.getPationId()); |
| | | JSONObject resultData = object3.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("jysqdh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("检验"); |
| | | tree.setService("his"); |
| | | tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | if (!detailsDtos.isEmpty()) { |
| | | dto.setDetails(detailsDtos); |
| | | AjaxResult ajaxResult1 = controller.Outpintestapply(dto); |
| | | String result5 = getAjaxResult(ajaxResult1); |
| | | JSONObject object3 = getJSONObject(result5); |
| | | String code3 = object3.getStr("ResultCode"); |
| | | if (code3.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details = dto.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setCardId(dto.getHisRegistrationId()); |
| | | tree.setPationid(customer.getPationId()); |
| | | JSONObject resultData = object3.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("jysqdh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("检验"); |
| | | tree.setService("his"); |
| | | tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(DateUtil.date()); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | // TODO 个人以及团体 暂不向采样管理写数据 |
| | | // HIS发送无法合并操作 无法获取LIS的检验序号 条码无法打印 |
| | | // TjOrder tjOrder = orderService.getOrderByCardId(cardId); |
| | | // if(null !=tjOrder){ |
| | | // List<TjOrderDetail> dengJi = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId()); |
| | | // tjSysAsyncService.addCaiYangDengJi(dengJi,!dengJi.isEmpty(),tjOrder, SecurityUtils.getLoginUser().getUser(), null); |
| | | // } |
| | | } |
| | | } |
| | | tree.setCreateTime(DateUtil.date()); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //门诊检查申请 |
| | | OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto(); |
| | | outpinexamapplyDto.setHisRegistrationId(cardId); |
| | | outpinexamapplyDto.setSfzh(customer.getCusIdcard()); |
| | | outpinexamapplyDto.setSqysbm("00029"); |
| | | outpinexamapplyDto.setMzksbm("0101"); |
| | | outpinexamapplyDto.setCzybm("00029"); |
| | | outpinexamapplyDto.setCzyksbm("0101"); |
| | | outpinexamapplyDto.setSfjz("0"); |
| | | // List<TbTransition> detailLists = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId); |
| | | List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>(); |
| | | if (null != detailList && !detailList.isEmpty()) { |
| | | LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | wq.in(TjProject::getDeptId,deptService.getJcDeptIds()); |
| | | List<TjProject> projects = projectService.list(wq); |
| | | if (null != projects && !projects.isEmpty()) { |
| | | for (TjProject project : projects) { |
| | | if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | if (null != project.getHisXmbm()) { |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | List<Long> proIds = projects.stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | if (!proIds.isEmpty()){ |
| | | QueryWrapper<TjProject> wrapper4 = new QueryWrapper<>(); |
| | | wrapper4.select("sum(sl) as sl","pro_id" |
| | | ,"pro_parent_id","pro_name","his_xmbm","his_xmmc" |
| | | ,"pro_price"); |
| | | wrapper4.in("pro_parent_id",proIds); |
| | | wrapper4.groupBy("his_xmbm"); |
| | | projects = projectService.list(wrapper4); |
| | | if (null != projects && !projects.isEmpty()) { |
| | | List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>(); |
| | | for (TjProject project : projects) { |
| | | if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | if (StrUtil.isNotBlank(project.getHisXmbm()) && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | detailsDto.setSfzhfy("0"); |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDto.setProjg(project.getProPrice()); |
| | | detailsDtoss.add(detailsDto); |
| | | } |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDto.setProjg(project.getProPrice()); |
| | | detailsDtoss.add(detailsDto); |
| | | } |
| | | if(project.getProId()==1740177341251154377L){ |
| | | } |
| | | List<Long> proParentIds = projects.stream().map(TjProject::getProParentId).distinct().collect(Collectors.toList()); |
| | | if (!outpinmedicXms.isEmpty()) { |
| | | outpinmedicXms.stream().filter(i -> proParentIds.contains(i.getProId())).forEach(i -> { |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm("00006670"); |
| | | detilsDto.setPcbm("06"); |
| | | detilsDto.setSl("1"); |
| | | detilsDto.setDj("60"); |
| | | detilsDto.setDcjl("1"); |
| | | detilsDto.setPj("60"); |
| | | detilsDto.setJj("60"); |
| | | detilsDto.setYpbm(i.getYpbm()); |
| | | detilsDto.setPcbm(i.getPcbm()); |
| | | detilsDto.setSl(i.getSl()); |
| | | detilsDto.setDj(i.getDj()); |
| | | detilsDto.setDcjl(i.getDcjl()); |
| | | detilsDto.setPj(i.getPj()); |
| | | detilsDto.setJj(i.getJj()); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setFzbl("1"); |
| | | detilsDto.setZh("0"); |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | | if (!detailsDtoss.isEmpty()) { |
| | | OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto(); |
| | | outpinexamapplyDto.setHisRegistrationId(cardId); |
| | | outpinexamapplyDto.setSfzh(customer.getCusIdcard()); |
| | | outpinexamapplyDto.setSqysbm(ysbm); |
| | | outpinexamapplyDto.setMzksbm(dept); |
| | | outpinexamapplyDto.setCzybm(ysbm); |
| | | outpinexamapplyDto.setCzyksbm(dept); |
| | | outpinexamapplyDto.setSfjz("0"); |
| | | outpinexamapplyDto.setDetails(detailsDtoss); |
| | | AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto); |
| | | String result6 = getAjaxResult(ajaxResult2); |
| | | JSONObject object5 = getJSONObject(result6); |
| | | String code4 = object5.getStr("ResultCode"); |
| | | if (code4.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details = outpinexamapplyDto.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(outpinexamapplyDto.getHisRegistrationId()); |
| | | tree.setPationid(customer.getPationId()); |
| | | JSONObject resultData = object5.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("jcsqdh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("检查"); |
| | | tree.setService("his"); |
| | | tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(DateUtil.date()); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (!detailsDtoss.isEmpty()) { |
| | | outpinexamapplyDto.setDetails(detailsDtoss); |
| | | AjaxResult ajaxResult2 = controller.Outpinexamapply(outpinexamapplyDto); |
| | | String result6 = getAjaxResult(ajaxResult2); |
| | | JSONObject object5 = getJSONObject(result6); |
| | | String code4 = object5.getStr("ResultCode"); |
| | | if (code4.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details = outpinexamapplyDto.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(outpinexamapplyDto.getHisRegistrationId()); |
| | | tree.setPationid(customer.getPationId()); |
| | | JSONObject resultData = object5.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("jcsqdh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("检查"); |
| | | tree.setService("his"); |
| | | tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(DateUtil.date()); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | |
| | | OutpintreatapplyDto dao = new OutpintreatapplyDto(); |
| | | dao.setHisRegistrationId(cardId); |
| | | dao.setSfzh(customer.getCusIdcard()); |
| | | dao.setSqysbm("00029"); |
| | | dao.setMzksbm("0101"); |
| | | dao.setSqysbm(ysbm); |
| | | dao.setMzksbm(dept); |
| | | dao.setSjrq(date); |
| | | dao.setCzybm("00029"); |
| | | dao.setCzyksbm("0101"); |
| | | dao.setCzybm(ysbm); |
| | | dao.setCzyksbm(dept); |
| | | dao.setSfjz("0"); |
| | | // List<TbTransition> details = tbTransitionService.getTbTransitionListByCusId(customer.getCusIdcard(),cardId); |
| | | List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>(); |
| | | if (null != detailList && !detailList.isEmpty()) { |
| | | LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | | wq.in(TjProject::getDeptId,deptService.getCzDeptIds()); |
| | | List<TjProject> projects = projectService.list(wq); |
| | | if (null != projects && !projects.isEmpty()) { |
| | | for (TjProject project : projects) { |
| | | if (0 == project.getProParentId() && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | if (null != project.getHisXmbm()) { |
| | | List<Long> proIds = projects.stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | if (!proIds.isEmpty()){ |
| | | QueryWrapper<TjProject> wrapper4 = new QueryWrapper<>(); |
| | | wrapper4.select("sum(sl) as sl","pro_id" |
| | | ,"pro_parent_id","pro_name","his_xmbm","his_xmmc" |
| | | ,"pro_price"); |
| | | wrapper4.in("pro_parent_id",proIds); |
| | | wrapper4.groupBy("his_xmbm"); |
| | | projects = projectService.list(wrapper4); |
| | | if (null != projects && !projects.isEmpty()) { |
| | | List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>(); |
| | | for (TjProject project : projects) { |
| | | if (StrUtil.isNotBlank(project.getHisXmbm()) && project.getProPrice().compareTo(BigDecimal.ZERO) != 0) { |
| | | OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); |
| | | detailsDto.setMxfyxmbm(project.getHisXmbm()); |
| | | if (project.getSfzhfy().equals("Y")) { |
| | | detailsDto.setSfzhfy("1"); |
| | | } else { |
| | | detailsDto.setSfzhfy("0"); |
| | | } |
| | | detailsDto.setSfzhfy("0"); |
| | | detailsDto.setSl(project.getSl()); |
| | | detailsDto.setProjg(project.getProPrice()); |
| | | detailDtos.add(detailsDto); |
| | | } |
| | | if(project.getProId()==1740177341251154377L){ |
| | | } |
| | | List<Long> proParentIds = projects.stream().map(TjProject::getProParentId).distinct().collect(Collectors.toList()); |
| | | if (!outpinmedicXms.isEmpty()) { |
| | | outpinmedicXms.stream().filter(i -> proParentIds.contains(i.getProId())).forEach(i -> { |
| | | OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); |
| | | detilsDto.setYpbm("00006670"); |
| | | detilsDto.setPcbm("06"); |
| | | detilsDto.setSl("1"); |
| | | detilsDto.setDj("60"); |
| | | detilsDto.setDcjl("1"); |
| | | detilsDto.setPj("60"); |
| | | detilsDto.setJj("60"); |
| | | detilsDto.setYpbm(i.getYpbm()); |
| | | detilsDto.setPcbm(i.getPcbm()); |
| | | detilsDto.setSl(i.getSl()); |
| | | detilsDto.setDj(i.getDj()); |
| | | detilsDto.setDcjl(i.getDcjl()); |
| | | detilsDto.setPj(i.getPj()); |
| | | detilsDto.setJj(i.getJj()); |
| | | detilsDto.setJldw(""); |
| | | detilsDto.setTjbm(""); |
| | | detilsDto.setPs(""); |
| | |
| | | detilsDto.setKfdw(""); |
| | | detilsDto.setYfdw(""); |
| | | detilsDto.setYysm(""); |
| | | detilsDto.setFzbl("1"); |
| | | detilsDto.setZh("0"); |
| | | detilsDto.setYpmc(i.getYpmc()); |
| | | detilsDto.setFzbl(i.getFzbl()); |
| | | detilsDto.setZh(i.getZh()); |
| | | outpinmedicapplyDetilsDtos.add(detilsDto); |
| | | }); |
| | | } |
| | | if (!detailDtos.isEmpty()) { |
| | | dao.setDetails(detailDtos); |
| | | AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao); |
| | | String mzylyzsq2 = getAjaxResult(mzylyzsq1); |
| | | JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2); |
| | | String code5 = mzylyzsq3.getStr("ResultCode"); |
| | | if (code5.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details1 = dao.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details1) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(dao.getHisRegistrationId()); |
| | | tree.setPationid(customer.getPationId()); |
| | | JSONObject resultData = mzylyzsq3.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("zlczh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("处置"); |
| | | tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(DateUtil.date()); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (!detailDtos.isEmpty()) { |
| | | dao.setDetails(detailDtos); |
| | | AjaxResult mzylyzsq1 = controller.Outpintreatapply(dao); |
| | | String mzylyzsq2 = getAjaxResult(mzylyzsq1); |
| | | JSONObject mzylyzsq3 = getJSONObject(mzylyzsq2); |
| | | String code5 = mzylyzsq3.getStr("ResultCode"); |
| | | if (code5.equals("0")) { |
| | | List<OutpintestapplyDetailsDto> details1 = dao.getDetails(); |
| | | for (OutpintestapplyDetailsDto detail : details1) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setJxbz(jxbz); |
| | | tree.setCardId(dao.getHisRegistrationId()); |
| | | tree.setPationid(customer.getPationId()); |
| | | JSONObject resultData = mzylyzsq3.getJSONObject("ResultData"); |
| | | tree.setSqdh(resultData.getStr("zlczh")); |
| | | tree.setFyhj(resultData.getStr("fyhj")); |
| | | String mxfyxmbm = detail.getMxfyxmbm(); |
| | | tree.setHisXmdm(mxfyxmbm); |
| | | tree.setType("处置"); |
| | | tree.setTjPrice(String.valueOf(detail.getProjg())); |
| | | LambdaQueryWrapper<LtkjJfzhglmxjfxmzd> wrapper1 = new LambdaQueryWrapper<>(); |
| | | if (detail.getSfzhfy().equals("1")) |
| | | wrapper1.eq(LtkjJfzhglmxjfxmzd::getZhxmdm, mxfyxmbm); |
| | | else wrapper1.eq(LtkjJfzhglmxjfxmzd::getXmdm, mxfyxmbm); |
| | | List<LtkjJfzhglmxjfxmzd> ltkjJfzhglmxjfxmzds = ltkjJfzhglmxjfxmzdService.list(wrapper1); |
| | | if (ltkjJfzhglmxjfxmzds != null && !ltkjJfzhglmxjfxmzds.isEmpty()) { |
| | | String xmdm = ltkjJfzhglmxjfxmzds.get(0).getXmdm(); |
| | | LambdaQueryWrapper<LtkjMxjfxmzd> wrapper2 = new LambdaQueryWrapper<>(); |
| | | wrapper2.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper2); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper3); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(DateUtil.date()); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | |
| | | OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); |
| | | dto1.setHisRegistrationId(cardId); |
| | | dto1.setSfzh(customer.getCusIdcard()); |
| | | dto1.setSqysbm("00029"); |
| | | dto1.setMzksbm("0101"); |
| | | dto1.setSqysbm(ysbm); |
| | | dto1.setMzksbm(dept); |
| | | dto1.setSjrq(date); |
| | | dto1.setCzybm("00029"); |
| | | dto1.setCzyksbm("0101"); |
| | | dto1.setCflxbm("A"); |
| | | dto1.setYfbm("1"); |
| | | String yfbm = configService.selectConfigByKey("chufang_yfbm"); |
| | | String mzzd = configService.selectConfigByKey("chufang_mzzd"); |
| | | String czybm = configService.selectConfigByKey("chufang_czybm"); |
| | | String czyksbm = configService.selectConfigByKey("chufang_czyksbm"); |
| | | String cflxbm = configService.selectConfigByKey("chufang_cflxbm"); |
| | | if (czybm.equalsIgnoreCase("N")) |
| | | dto1.setCzybm(ysbm); |
| | | else dto1.setCzybm(czybm); |
| | | if (czyksbm.equalsIgnoreCase("N")) |
| | | dto1.setCzyksbm(dept); |
| | | else dto1.setCzyksbm(dept); |
| | | dto1.setCflxbm(cflxbm); |
| | | if (yfbm.equalsIgnoreCase("N")) |
| | | dto1.setYfbm("1"); |
| | | else dto1.setYfbm(yfbm); |
| | | dto1.setFyts("1"); |
| | | dto1.setMzzd(""); |
| | | if (mzzd.equalsIgnoreCase("N")) |
| | | dto1.setMzzd(""); |
| | | else dto1.setMzzd(mzzd); |
| | | dto1.setDetails(outpinmedicapplyDetilsDtos); |
| | | AjaxResult result = controller.Outpinmedicapply(dto1); |
| | | String result1 = getAjaxResult(result); |
| | |
| | | cf.setCardId(cardId); |
| | | cf.setSfzh(customer.getCusIdcard()); |
| | | cf.setCfh(cfh); |
| | | cf.setSqysbm("00029"); |
| | | cf.setSqysxm("王健萍"); |
| | | cf.setMzksbn("0101"); |
| | | cf.setSqysbm(ysbm); |
| | | cf.setSqysxm(ysmc); |
| | | cf.setMzksbn(dept); |
| | | cf.setSqrq(date); |
| | | cf.setCzybm("00029"); |
| | | cf.setCzybm(ysbm); |
| | | cf.setYpbm(detilsDto.getYpbm()); |
| | | cf.setYpmc("尿素[14C]呼气试验药盒"); |
| | | cf.setYpmc(detilsDto.getYpmc()); |
| | | cf.setSl(String.valueOf(detilsDto.getSl())); |
| | | cf.setDj(String.valueOf(detilsDto.getDj())); |
| | | cf.setDcjl(String.valueOf(detilsDto.getDcjl())); |
| | |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | transitionService.saveTemoTransitionByGroupingId(reservation.getIdCard(), reservation.getGroupingId()); |
| | | // transitionService.saveTemoTransitionByGroupingId(reservation.getIdCard(), reservation.getGroupingId()); |
| | | transitionService.ttsaveTemoTransitionByGroupingId(reservation.getIdCard(),"0",reservation.getGroupingId()); |
| | | |
| | | threadPool.shutdown(); |
| | | } catch (Exception e) { |
| | |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | addCaiYangDengJi(detailList, detailList.size() > 0, order, sysUser,null); |
| | | } |
| | | |
| | | |
| | | |
| | | //首页饼状图登记人数接口 |
| | | private AjaxResult getPieCharts() { |
| | |
| | | map.put("remark", remark.getRemark()); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public void tjUpdateDetatilByVi(String s) { |
| | | |
| | | } |
| | | } |