| | |
| | | package com.ltkj.web.controller.service; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | import com.ltkj.common.core.domain.entity.SysUser; |
| | |
| | | import com.ltkj.common.utils.StringUtils; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.hisDto.OutpinexamapplyDto; |
| | | import com.ltkj.hosp.hisDto.OutpintestapplyDetailsDto; |
| | | import com.ltkj.hosp.hisDto.OutpintestapplyDto; |
| | | import com.ltkj.hosp.hisDto.OutpintreatapplyDto; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.hosp.vodomain.AddNewReservationConfirm; |
| | | import com.ltkj.hosp.vodomain.LineChartsVo; |
| | | import com.ltkj.hosp.vodomain.PieChartVo; |
| | | import com.ltkj.hosp.vodomain.QjDomainVo; |
| | | import com.ltkj.mall.mallOrderUtils.TjConstants; |
| | | import com.ltkj.system.service.ISysConfigService; |
| | | import com.ltkj.system.service.ISysUserService; |
| | | import com.ltkj.web.controller.his.HisApiGetMethodService; |
| | | import com.ltkj.web.controller.his.HisApiMethodService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private IDictSfxmService dictSfxmService; |
| | | @Autowired |
| | | private ITjRulesService tjRulesService; |
| | | |
| | | @Autowired |
| | | private HisApiMethodService controller; |
| | | @Autowired |
| | | private HisApiConfigService hisApiConfigService; |
| | | @Autowired |
| | | private HisApiGetMethodService hisApiGetMethodService; |
| | | @Resource |
| | | private ISysConfigService configService; |
| | | @Autowired |
| | | private LtkjJfzhglmxjfxmzdService ltkjJfzhglmxjfxmzdService; |
| | | @Autowired |
| | | private LtkjMxjfxmzdService ltkjMxjfxmzdService; |
| | | @Autowired |
| | | private LtkjEjjfxmzdService ltkjEjjfxmzdService; |
| | | @Autowired |
| | | private LtkjJianchajianyanTreeService ltkjJianchajianyanTreeService; |
| | | |
| | | @Override |
| | | public void newSaveextracted(TjOrder tjOrder, TjCustomer tjCustomer, BigDecimal discount, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | |
| | | |
| | | @Override |
| | | @Async("async") |
| | | @Transactional |
| | | public void iundividualCharges(TjFlowingWater tjFlowingWater, TjOrder order, TjCustomer customer, SysUser sysUser) { |
| | | Date dates = new Date(); |
| | | final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss"); |
| | | List<TjConsumables> list2 = new ArrayList<>(); |
| | | String[] tjProIds = tjFlowingWater.getTjProIds(); |
| | | |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | |
| | | //检验 |
| | | List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>(); |
| | | |
| | | //检查 |
| | | List<OutpintestapplyDetailsDto> detailsDtoss = new ArrayList<>(); |
| | | |
| | | |
| | | //处置 |
| | | List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>(); |
| | | |
| | | |
| | | List<TjProject> projectList=new ArrayList<>(); |
| | | |
| | | for (String tjProId : tjProIds) { |
| | | LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.eq(TbTransition::getCusId, customer.getCusIdcard()); |
| | | TjProject project = projectService.selectTjProjectByProId(Long.valueOf(tjProId)); |
| | | TjProject project = projectService.getById(Long.valueOf(tjProId)); |
| | | if (null != project && project.getProParentId() == 0) { |
| | | TjOrderRemark tjOrderRemark = new TjOrderRemark(); |
| | | tjOrderRemark.setProId(Long.valueOf(tjProId)); |
| | |
| | | tjOrderRemark.setDeptId(project.getDeptId()); |
| | | tjOrderRemark.setTjNumber(order.getTjNumber()); |
| | | tjOrderRemark.setCreateBy(sysUser.getNickName()); |
| | | tjOrderRemark.setCreateTime(new Date()); |
| | | tjOrderRemark.setCreateTime(dates); |
| | | tjOrderRemark.setUpdateBy(sysUser.getNickName()); |
| | | tjOrderRemark.setUpdateTime(new Date()); |
| | | tjOrderRemark.setUpdateTime(dates); |
| | | tjOrderRemark.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | orderRemarkService.save(tjOrderRemark); |
| | |
| | | TjOrderDetail detail = new TjOrderDetail(); |
| | | detail.setTjStatus(0L); |
| | | detail.setOrderId(tjFlowingWater.getOrderId()); |
| | | detail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | // detail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | detail.setProId(Long.valueOf(tjProId)); |
| | | detail.setIsAddition("Y"); |
| | | detail.setCreateBy(sysUser.getNickName()); |
| | | detail.setCreateTime(new Date()); |
| | | detail.setCreateTime(dates); |
| | | detail.setUpdateBy(sysUser.getNickName()); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setUpdateTime(dates); |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.save(detail); |
| | |
| | | TjOrderDetail detail1 = new TjOrderDetail(); |
| | | detail1.setTjStatus(0L); |
| | | detail1.setOrderId(tjFlowingWater.getOrderId()); |
| | | detail1.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | // detail1.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | detail1.setProId(proId); |
| | | detail1.setIsAddition("Y"); |
| | | detail.setCreateBy(sysUser.getNickName()); |
| | | detail.setCreateTime(new Date()); |
| | | detail.setCreateTime(dates); |
| | | detail.setUpdateBy(sysUser.getNickName()); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setUpdateTime(dates); |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.save(detail1); |
| | | } |
| | | wqq.in(TbTransition::getProId, proIds); |
| | | |
| | | if(null !=config && config.equals("Y")){ |
| | | //检验 |
| | | if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 241L || project.getDeptId() == 317L)) { |
| | | 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.getProPrice().compareTo(BigDecimal.ZERO) != 0 && |
| | | (project.getDeptId() == 247 || project.getDeptId() == 248 || project.getDeptId() == 249 || |
| | | project.getDeptId() == 250 || project.getDeptId() == 251 || project.getDeptId() == 252 || |
| | | project.getDeptId() == 271 || project.getDeptId() == 273 || project.getDeptId() == 274 || |
| | | project.getDeptId() == 275 || project.getDeptId() == 298)) { |
| | | 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.getProPrice().compareTo(BigDecimal.ZERO) != 0 && |
| | | (project.getDeptId() == 100 || project.getDeptId() == 240 || project.getDeptId() == 253 || |
| | | project.getDeptId() == 254 || project.getDeptId() == 255 || project.getDeptId() == 257 || |
| | | project.getDeptId() == 258 || project.getDeptId() == 259 || project.getDeptId() == 269 || |
| | | project.getDeptId() == 270)) { |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } else { |
| | | |
| | | wqq.in(TbTransition::getProId, Arrays.asList(tjProIds)); |
| | | |
| | | TjProject projects = projectService.selectTjProjectByProId(Long.valueOf(tjProId)); |
| | | if (null != projects) { |
| | | TjProject projectss = projectService.selectTjProjectByProId(projects.getProParentId()); |
| | | if (null != projectss) { |
| | | TjOrderRemark tjOrderRemark = new TjOrderRemark(); |
| | | tjOrderRemark.setProId(Long.valueOf(tjProId)); |
| | | tjOrderRemark.setProName(projectss.getProName()); |
| | | tjOrderRemark.setDeptId(projectss.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); |
| | | TjProject projectss = projectService.getById(projects.getProParentId()); |
| | | if (null != projectss && projectss.getProParentId()==0L) { |
| | | projectList.add(projectss); |
| | | } |
| | | } |
| | | // List<Long> proIds = projectService.getTjProjectListBySoneId(tjProId).stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | TjOrderDetail detail = new TjOrderDetail(); |
| | | detail.setTjStatus(0L); |
| | | detail.setOrderId(tjFlowingWater.getOrderId()); |
| | | detail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | // detail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | detail.setProId(Long.valueOf(tjProId)); |
| | | detail.setIsAddition("Y"); |
| | | detail.setCreateBy(sysUser.getNickName()); |
| | | detail.setCreateTime(new Date()); |
| | | detail.setCreateTime(dates); |
| | | detail.setUpdateBy(sysUser.getNickName()); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setUpdateTime(dates); |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.save(detail); |
| | | // for (Long proId : proIds) { |
| | | TjOrderDetail detail1 = new TjOrderDetail(); |
| | | detail1.setTjStatus(0L); |
| | | detail1.setOrderId(tjFlowingWater.getOrderId()); |
| | | detail1.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | detail1.setProId(Long.valueOf(tjProId)); |
| | | detail1.setIsAddition("Y"); |
| | | detail.setCreateBy(sysUser.getNickName()); |
| | | detail.setCreateTime(new Date()); |
| | | detail.setUpdateBy(sysUser.getNickName()); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.save(detail1); |
| | | // } |
| | | |
| | | } |
| | | |
| | | List<TbTransition> tbTransitionList = transitionService.list(wqq); |
| | | if (null != tbTransitionList && tbTransitionList.size() > 0) { |
| | | for (TbTransition transition : tbTransitionList) { |
| | | transition.setTjNum(order.getTjNumber()); |
| | | transition.setCardId(order.getCardId()); |
| | | transition.setNowPrice(transition.getOrdPrice().multiply(BigDecimal.valueOf(Double.parseDouble(tjFlowingWater.getDiscount())).divide(BigDecimal.valueOf(10)))); |
| | | transitionService.updateById(transition); |
| | | TjProject tjProject = projectService.selectTjProjectByProId(transition.getProId()); |
| | |
| | | tjChargingStandard.setPrice(transition.getNowPrice()); |
| | | tjChargingStandard.setProName(tjProject.getProName()); |
| | | tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setCreateTime(new Date()); |
| | | tjChargingStandard.setCreateTime(dates); |
| | | tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setUpdateTime(new Date()); |
| | | tjChargingStandard.setUpdateTime(dates); |
| | | tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | chargingStandardService.save(tjChargingStandard); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if(projectList.size()>0){ |
| | | List<TjProject> list = projectList.stream().distinct().collect(Collectors.toList()); |
| | | for (TjProject project : list) { |
| | | TjOrderRemark tjOrderRemark = new TjOrderRemark(); |
| | | tjOrderRemark.setProId(project.getProId()); |
| | | tjOrderRemark.setProName(project.getProName()); |
| | | tjOrderRemark.setDeptId(project.getDeptId()); |
| | | tjOrderRemark.setTjNumber(order.getTjNumber()); |
| | | tjOrderRemark.setCreateBy(sysUser.getNickName()); |
| | | tjOrderRemark.setCreateTime(dates); |
| | | tjOrderRemark.setUpdateBy(sysUser.getNickName()); |
| | | tjOrderRemark.setUpdateTime(dates); |
| | | tjOrderRemark.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | orderRemarkService.save(tjOrderRemark); |
| | | |
| | | TjOrderDetail detail1 = new TjOrderDetail(); |
| | | detail1.setTjStatus(0L); |
| | | detail1.setOrderId(tjFlowingWater.getOrderId()); |
| | | // detail1.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | detail1.setProId(project.getProId()); |
| | | detail1.setIsAddition("Y"); |
| | | detail1.setCreateBy(sysUser.getNickName()); |
| | | detail1.setCreateTime(dates); |
| | | detail1.setUpdateBy(sysUser.getNickName()); |
| | | detail1.setUpdateTime(dates); |
| | | detail1.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail1.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.save(detail1); |
| | | if(null !=config && config.equals("Y")){ |
| | | //检验 |
| | | if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 241L || project.getDeptId() == 317L)) { |
| | | 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.getProPrice().compareTo(BigDecimal.ZERO) != 0 && |
| | | (project.getDeptId() == 247L || project.getDeptId() == 248L || project.getDeptId() == 249L || |
| | | project.getDeptId() == 250L || project.getDeptId() == 251L || project.getDeptId() == 252L || |
| | | project.getDeptId() == 271L || project.getDeptId() == 273L || project.getDeptId() == 274L || |
| | | project.getDeptId() == 275L || project.getDeptId() == 298L)) { |
| | | 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.getProPrice().compareTo(BigDecimal.ZERO) != 0 && |
| | | (project.getDeptId() == 100L || project.getDeptId() == 240L || project.getDeptId() == 253L || |
| | | project.getDeptId() == 254L || project.getDeptId() == 255L || project.getDeptId() == 257L || |
| | | project.getDeptId() == 258L || project.getDeptId() == 259L || project.getDeptId() == 269L || |
| | | project.getDeptId() == 270L)) { |
| | | 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(null !=config && config.equals("Y")){ |
| | | |
| | | |
| | | //检验申请 |
| | | if(detailsDtos.size()>0){ |
| | | 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.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); |
| | | 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()); |
| | | } |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | //门诊检查申请 |
| | | if(detailsDtoss.size()>0){ |
| | | 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.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); |
| | | 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()); |
| | | } |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //门诊治疗处置申请 |
| | | if(detailDtos.size()>0){ |
| | | 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.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); |
| | | 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()); |
| | | } |
| | | 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.setConsumablesName(tjConsumables.getMakings()); |
| | | tjChargingStandard.setCompany(tjConsumables.getSpecifications()); |
| | | tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setCreateTime(new Date()); |
| | | tjChargingStandard.setCreateTime(dates); |
| | | tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setUpdateTime(new Date()); |
| | | tjChargingStandard.setUpdateTime(dates); |
| | | tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | chargingStandardService.save(tjChargingStandard); |
| | |
| | | return customerList; |
| | | } |
| | | |
| | | //将方法返回值解析成json格式 |
| | | public JSONObject getJSONObject(String builder) { |
| | | String Response = JSONUtil.parseObj(builder).getStr("Response"); |
| | | return JSONUtil.parseObj(Response); |
| | | } |
| | | |
| | | //获取方法返回值信息 |
| | | public String getAjaxResult(AjaxResult result) { |
| | | return result.get("data").toString(); |
| | | } |
| | | |
| | | //总检点击体检信息详情 |
| | | private List<Map<String, Object>> getAjaxResult(String tjNumber) { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |