| | |
| | | responseJson = HttpClientUtils.sendPost(LIS_URL + apiConfig.getApiUrl(), params); |
| | | break; |
| | | } |
| | | log.info("请求返回值1 ->{}",responseJson); |
| | | Integer isResponse = apiConfig.getIsResponse(); |
| | | JSONObject response = null; |
| | | if (isResponse == 1) { |
| | |
| | | AjaxResult ajaxResult = AjaxResult.success(); |
| | | if (response.getStr(apiConfig.getResultDataKey()) != null && StrUtil.isNotBlank(response.getStr(apiConfig.getResultDataKey()))){ |
| | | JSONArray resultData = response.getJSONArray(apiConfig.getResultDataKey()); |
| | | log.info("请求返回值2 ->{}",JSONUtil.toJsonStr(resultData)); |
| | | List<Map<String, String>> list = new ArrayList<>(); |
| | | for (Object resultDatum : resultData) { |
| | | log.info("请求返回值3 ->{}",JSONUtil.toJsonStr(resultDatum)); |
| | | JSONObject object = (JSONObject) resultDatum; |
| | | ajaxResult = save(object, type,apiConfig,JSONUtil.toJsonStr(params)); |
| | | Map<String, String> map = new HashMap<>(); |
| | |
| | | if (code.equals("lis") || code.equals("pacs")) |
| | | tabName = ((ApiConfig)hisApiConfig).getTabName(); |
| | | else tabName = ((HisApiConfig) hisApiConfig).getTabName(); |
| | | log.info("save方法 ->{}", tabName); |
| | | Connection connection = getConnection(); |
| | | Boolean isExists = tabIsExists(connection, tabName); |
| | | if (null == isExists) |
| | |
| | | // wq2.eq(TjOrderDetail::getIsSampling, 0); |
| | | // List<TjOrderDetail> detailList1 = tjOrderDetailService.list(wq2); |
| | | List<TjOrderDetail> detailList1 = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId()); |
| | | tjSysAsyncService.addCaiYangDengJi(detailList1, !detailList1.isEmpty(), tjOrder, sysUser); |
| | | log.info("TjOrderDetail ->{}",JSONUtil.toJsonStr(detailList1)); |
| | | tjSysAsyncService.addCaiYangDengJi(detailList1, !detailList1.isEmpty(), tjOrder, sysUser,null); |
| | | |
| | | //检验申请 |
| | | OutpintestapplyDto dto = new OutpintestapplyDto(); |
| | |
| | | if (jysqdh != null && !jysqdh.isEmpty()){ |
| | | for (String sqdh : jysqdh) { |
| | | AjaxResult cancelLisAjaxResult = lisApiMethod.cancel(sqdh, order.getCardId(), customer1.getCusName()); |
| | | log.info("lis请求返回 ->{}",JSONUtil.toJsonStr(cancelLisAjaxResult)); |
| | | String result = cancelLisAjaxResult.get("data").toString(); |
| | | JSONObject object = JSONUtil.parseObj(result); |
| | | String code= object.getStr("ResultCode"); |
| | |
| | | if (jcsqdh != null && !jcsqdh.isEmpty()){ |
| | | for (String sqdh : jcsqdh) { |
| | | AjaxResult cancelPacsAjaxResult = pacsApiMethodService.updatePacsApply(sqdh, order.getCardId(), customer1.getCusName()); |
| | | log.info("作废检查 pacs返回 ->{}",JSONUtil.toJsonStr(cancelPacsAjaxResult)); |
| | | String result = cancelPacsAjaxResult.get("data").toString(); |
| | | JSONObject object = JSONUtil.parseObj(result); |
| | | String code = object.getStr("ResultCode"); |
| | |
| | | if (jysqdh != null && !jysqdh.isEmpty()){ |
| | | for (String sqdh : jysqdh) { |
| | | AjaxResult cancelLisAjaxResult = lisApiMethod.cancel(sqdh, order.getCardId(), customer1.getCusName()); |
| | | log.info("作废检验 pacs返回 ->{}",JSONUtil.toJsonStr(cancelLisAjaxResult)); |
| | | String result = cancelLisAjaxResult.get("data").toString(); |
| | | JSONObject object = JSONUtil.parseObj(result); |
| | | String code= object.getStr("ResultCode"); |
| | |
| | | import com.ltkj.hosp.hisDto.OutpintestapplyDetailsDto; |
| | | import com.ltkj.hosp.lisDto.LisSaveSqdxxDto; |
| | | import com.ltkj.hosp.lisDto.LisSaveSqdxxJyxmlistDto; |
| | | import com.ltkj.hosp.mapper.TbTransitionMapper; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.system.service.ISysConfigService; |
| | | import com.ltkj.system.service.ISysDeptService; |
| | |
| | | private IdUtils idUtils; |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | @Autowired |
| | | private ITjOrderService orderService; |
| | | @Autowired |
| | | private ITjCustomerService customerService; |
| | | @Autowired |
| | | private TbTransitionMapper tbTransitionMapper; |
| | | @Autowired |
| | | private ITjSamplingService tjSamplingService; |
| | | |
| | | /** |
| | | * 保存检验单申请信息 |
| | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | public Boolean save(TjSampling sampling,TjOrder tjOrder,TjCustomer tjCustomer){ |
| | | AtomicInteger xh = new AtomicInteger(); |
| | | LisSaveSqdxxDto lisSaveSqdxxDto = new LisSaveSqdxxDto(); |
| | | // String jyxh = idUtils.generateLisID(); |
| | | lisSaveSqdxxDto.setJyxh(sampling.getJyxh()); |
| | | lisSaveSqdxxDto.setBah(tjOrder.getCardId()); |
| | | lisSaveSqdxxDto.setBrxm(tjCustomer.getCusName()); |
| | | lisSaveSqdxxDto.setBrdm(PinyinUtil.getFirstLetter(tjCustomer.getCusName(), "")); |
| | | lisSaveSqdxxDto.setXb(tjCustomer.getCusSex() == 1 ? "2" : "1"); |
| | | lisSaveSqdxxDto.setCsrq(DateFormatUtils.format(tjCustomer.getCusBrithday(), "yyyy-MM-dd")); |
| | | AgeResult ageResult = DateUtils.calculateAge(tjCustomer.getCusBrithday()); |
| | | lisSaveSqdxxDto.setNl(String.valueOf(ageResult.getAge())); |
| | | lisSaveSqdxxDto.setNldw(String.valueOf(ageResult.getUnit())); |
| | | lisSaveSqdxxDto.setSfzh(tjCustomer.getCusIdcard()); |
| | | lisSaveSqdxxDto.setLxdh(tjCustomer.getCusPhone()); |
| | | lisSaveSqdxxDto.setJtzz(""); |
| | | Date date = new Date(); |
| | | lisSaveSqdxxDto.setSqrq(DateFormatUtils.format(date, "yyyy-MM-dd HH:mm:ss")); |
| | | lisSaveSqdxxDto.setCyrq(""); |
| | | lisSaveSqdxxDto.setLczd(""); |
| | | lisSaveSqdxxDto.setBz(""); |
| | | lisSaveSqdxxDto.setKsbm("0101"); |
| | | lisSaveSqdxxDto.setSqys("00029"); |
| | | lisSaveSqdxxDto.setKfbz("1"); |
| | | List<OutpintestapplyDetailsDto> detailsDtos = new ArrayList<>(); |
| | | ArrayList<LisSaveSqdxxJyxmlistDto> dtos = new ArrayList<>(); |
| | | BigDecimal allPrice = tbTransitionMapper.getLisPriceByTjNumAndParentProId(tjOrder.getTjNumber(), sampling.getProId()); |
| | | lisSaveSqdxxDto.setFyje(allPrice.toString()); |
| | | lisSaveSqdxxDto.setYbbm(sampling.getSpecimenTypeCode()); |
| | | |
| | | if (sampling.getIsMerge() == 1){ |
| | | LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjSampling::getParentId, sampling.getId()); |
| | | List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | for (TjSampling tjSampling : list) { |
| | | TjProject project = projectService.getById(tjSampling.getProId()); |
| | | LisSaveSqdxxJyxmlistDto dto = new LisSaveSqdxxJyxmlistDto(); |
| | | dto.setXh(String.valueOf(xh.getAndIncrement() + 1)); |
| | | dto.setJyxm(tjSampling.getJyxmdm()); |
| | | dto.setXmmc(tjSampling.getProName()); |
| | | dtos.add(dto); |
| | | |
| | | 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); |
| | | } |
| | | }else { |
| | | TjProject project = projectService.getById(sampling.getProId()); |
| | | LisSaveSqdxxJyxmlistDto dto = new LisSaveSqdxxJyxmlistDto(); |
| | | dto.setXh(String.valueOf(xh.getAndIncrement() + 1)); |
| | | dto.setJyxm(sampling.getJyxmdm()); |
| | | dto.setXmmc(sampling.getProName()); |
| | | dtos.add(dto); |
| | | |
| | | 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); |
| | | } |
| | | |
| | | lisSaveSqdxxDto.setJyxmlist(dtos); |
| | | log.info("检验申请参数 ->{}", JSONUtil.toJsonStr(lisSaveSqdxxDto)); |
| | | // if (true) |
| | | // return true; |
| | | AjaxResult ajaxResult = lisApiMethodService.saveSqdxx(lisSaveSqdxxDto); |
| | | // Lis请求返回 ->{"msg":"操作失败","code":500,"result":{"Response":{"ResultContent":"成功","ResultData":null,"ResultCode":"1"}}} |
| | | // {"msg":"操作成功","code":200,"data":{"ResultContent":"成功","ResultData":null,"ResultCode":"1"}} |
| | | log.info("Lis请求返回 ->{}", JSONUtil.toJsonStr(ajaxResult)); |
| | | String result = ajaxResult.get("data").toString(); |
| | | JSONObject object = JSONUtil.parseObj(result); |
| | | String code = object.getStr("ResultCode"); |
| | | if (code.equals("1")) { |
| | | for (OutpintestapplyDetailsDto detail : detailsDtos) { |
| | | LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); |
| | | tree.setCardId(tjOrder.getCardId()); |
| | | tree.setPationid(tjCustomer.getPationId()); |
| | | tree.setSqdh(sampling.getJyxh()); |
| | | tree.setFyhj(allPrice.toString()); |
| | | 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> wrapper3 = new LambdaQueryWrapper<>(); |
| | | wrapper3.eq(LtkjMxjfxmzd::getXmdm, xmdm); |
| | | LtkjMxjfxmzd mxjfxmzd = ltkjMxjfxmzdService.getOne(wrapper3); |
| | | LambdaQueryWrapper<LtkjEjjfxmzd> wrapper4 = new LambdaQueryWrapper<>(); |
| | | wrapper4.eq(LtkjEjjfxmzd::getEjkmdm, mxjfxmzd.getEjkmdm()); |
| | | LtkjEjjfxmzd ejjfxmzd = ltkjEjjfxmzdService.getOne(wrapper4); |
| | | tree.setXmfl(ejjfxmzd.getYjkmdm()); |
| | | } |
| | | tree.setCreateTime(DateUtil.date()); |
| | | tree.setJxbz(sampling.getJxbz()); |
| | | ltkjJianchajianyanTreeService.save(tree); |
| | | } |
| | | return true; |
| | | } else { |
| | | log.error("请求失败 ->{}", lisSaveSqdxxDto); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public Boolean save(TjOrder tjOrder, TjCustomer tjCustomer, List<TjProject> projects,List<TbTransition> detailList) { |
| | | // LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | // wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); |
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 检验项目字典的检验分类代码不能存在于该接口返回中,如果存在则不能合并 |
| | | * 获取检验分类合并信息字典 存在才能合并发送 不存在则只能单次发送 |
| | | * @return |
| | | */ |
| | | public AjaxResult getJyFlHb(){ |
| | | return lisApiMethodService.getJyflhbxx(); |
| | | } |
| | | } |
| | |
| | | map.put("jyxh", jyxh); |
| | | map.put("brxm", brxm); |
| | | log.info("作废检验 ->{}", JSONUtil.toJsonStr(map)); |
| | | // TODO 暂不请求 |
| | | return AjaxResult.warn("暂无此数据"); |
| | | // return AjaxResult.warn("暂无此数据"); |
| | | // String post = HttpClientUtils.sendPost(HIS_URL + "/updateSqdxx", map); |
| | | // return AjaxResult.success().put("data", post); |
| | | // return service.getLisData("updateSqdxx",map); |
| | | return service.getLisData("updateSqdxx",map); |
| | | } |
| | | |
| | | |
| | |
| | | hashMap.put("examNo", examNo); |
| | | hashMap.put("name", name); |
| | | log.info("作废检查 ->{}", JSONUtil.toJsonStr(hashMap)); |
| | | return getMethodService.getPacsData("updatePacsApply", hashMap); |
| | | // TODO 暂不发出pacs请求 |
| | | // return getMethodService.getPacsData("updatePacsApply", hashMap); |
| | | JSONObject object = JSONUtil.createObj(); |
| | | object.putOpt("ResultCode","1"); |
| | | return AjaxResult.success().put("data",JSONUtil.toJsonStr(object)); |
| | | } |
| | | |
| | | public Boolean save(TjOrder tjOrder, TjCustomer tjCustomer, List<TbTransition> detailList) { |
| | | if (true) |
| | | return true; |
| | | JSONArray array = JSONUtil.createArray(); |
| | | ArrayList<SavePacsApply> errorPacsList = new ArrayList<>(); |
| | | ArrayList<SavePacsApply> successPacsList = new ArrayList<>(); |
| | |
| | | // wq.eq(TjOrderDetail::getIsSampling, 0); |
| | | // List<TjOrderDetail> detailList = tjOrderDetailService.list(wq); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | addCaiYangDengJi(detailList, !detailList.isEmpty(), order, sysUser); |
| | | addCaiYangDengJi(detailList, !detailList.isEmpty(), order, sysUser,null); |
| | | } |
| | | |
| | | public void addCaiYangDengJi(List<TjOrderDetail> detailList, boolean detailList1, TjOrder order, SysUser sysUser) { |
| | | public void addCaiYangDengJi(List<TjOrderDetail> detailList, boolean detailList1, TjOrder order, SysUser sysUser,String jxbz) { |
| | | if (null != detailList && detailList1) { |
| | | String format = DateUtil.format(new Date(), "yyMMddHHmmssSSS"); |
| | | for (TjOrderDetail detail : detailList) { |
| | |
| | | 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); |
| | |
| | | wrapper.eq(LtkjJybbzd::getJybbdm,jyxmzd.getJybbdm()); |
| | | LtkjJybbzd jybbzd = jybbzdService.getOne(wrapper); |
| | | sampling.setSpecimenType(jybbzd.getJybbmc()); |
| | | sampling.setJyxmdm(jyxmzd.getJyxmdm()); |
| | | } |
| | | } |
| | | sampling.setSamplingNumber(format); |
| | |
| | | sampling.setUpdateTime(new 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(); |
| | | log.info("getJyFlHb ->{}",JSONUtil.toJsonStr(ajaxResult)); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | List<TjProject> projectList=new ArrayList<>(); |
| | | |
| | | ArrayList<TjOrderDetail> tjOrderDetails = new ArrayList<>(); |
| | | for (String tjProId : tjProIds) { |
| | | // LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | // wqq.eq(TbTransition::getCusId, customer.getCusIdcard()); |
| | |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setJxbz(jxbz); |
| | | tjOrderDetailService.save(detail); |
| | | tjOrderDetails.add(detail); |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | List<TjOrderDetail> collect = tjOrderDetails.stream().filter(item -> { |
| | | TjProject project = projectService.getById(item.getProId()); |
| | | return project != null && project.getProParentId() == 0; |
| | | }).collect(Collectors.toList()); |
| | | addCaiYangDengJi(collect, !collect.isEmpty(), order, sysUser,jxbz); |
| | | tjOrderDetails = new ArrayList<>(); |
| | | |
| | | ArrayList<TjProject> jianChaProjects = new ArrayList<>(); |
| | | ArrayList<TjProject> jianYanProjects = new ArrayList<>(); |
| | |
| | | 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 && (project.getDeptId() == 241L || project.getDeptId() == 317L)) { |
| | |
| | | } |
| | | } |
| | | } |
| | | collect = tjOrderDetails.stream().filter(item -> { |
| | | TjProject project = projectService.getById(item.getProId()); |
| | | return project != null && project.getProParentId() == 0; |
| | | }).collect(Collectors.toList()); |
| | | addCaiYangDengJi(collect, !collect.isEmpty(), order, sysUser,jxbz); |
| | | } |
| | | |
| | | Boolean useLisAndPacsRegister = lisApiMethod.isUseLisAndPacsRegister(order); |
| | | if(null !=config && config.equals("Y")){ |
| | | if (lisApiMethod.isUseLisAndPacsRegister(order)) { |
| | | List<TjProject> projectList2 = jianYanProjects.stream().distinct().collect(Collectors.toList()); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | addCaiYangDengJi(detailList, !detailList.isEmpty(), order, sysUser); |
| | | |
| | | if (useLisAndPacsRegister) { |
| | | // List<TjProject> projectList2 = jianYanProjects.stream().distinct().collect(Collectors.toList()); |
| | | // 检查申请 |
| | | pacsReg(order, customer, jianChaProjects); |
| | | }else { |
| | |
| | | } |
| | | |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | addCaiYangDengJi(detailList, detailList.size() > 0, order, sysUser); |
| | | addCaiYangDengJi(detailList, detailList.size() > 0, order, sysUser,null); |
| | | } |
| | | |
| | | //首页饼状图登记人数接口 |
| | |
| | | import com.ltkj.hosp.hisDto.OutpinimpapplyDto; |
| | | import com.ltkj.hosp.hisDto.OutpinmedicapplyDto; |
| | | import com.ltkj.hosp.mapper.TestMapper; |
| | | import com.ltkj.hosp.mapper.TjSamplingMapper; |
| | | import com.ltkj.hosp.pacsDto.SavePacsApply; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.hosp.sqlDomain.LtkjMiddleDetail; |
| | |
| | | private HisPDFUtil hisPDFUtil; |
| | | @Value("${path.reportServer}") |
| | | private String urlValue; |
| | | @Autowired |
| | | private ITjSamplingService samplingService; |
| | | @Autowired |
| | | private TjSamplingMapper tjSamplingMapper; |
| | | |
| | | //将方法返回值解析成json格式 |
| | | public JSONObject getJSONObject(String builder) { |
| | |
| | | newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater); |
| | | } |
| | | // 查询 对接Lis、Pacs申请如果类型包含在配置内则使用对接lis、pacs |
| | | // if (lisApiMethod.isUseLisAndPacsRegister(tjOrder)) { |
| | | if (lisApiMethod.isUseLisAndPacsRegister(tjOrder)) { |
| | | // 这是上面个人方法引入数据 |
| | | // newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater); |
| | | // AjaxResult ajaxResult = hisApiMethod.tijianshenqing(tjCustomer, DateUtil.format(date1, "yyyy-MM-dd HH:mm:ss"), tjOrder, sysUser, result); |
| | | // if (!ajaxResult.get("code").toString().equals("200")) return ajaxResult; |
| | | // }else { |
| | | // hisApiMethod.tijianshenqing(tjCustomer, DateUtil.format(date1, "yyyy-MM-dd HH:mm:ss"), tjOrder.getCardId()); |
| | | // } |
| | | hisApiMethod.tijianshenqing(tjCustomer, DateUtil.format(date1, "yyyy-MM-dd HH:mm:ss"), tjOrder.getCardId()); |
| | | newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater); |
| | | AjaxResult ajaxResult = hisApiMethod.tijianshenqing(tjCustomer, DateUtil.format(date1, "yyyy-MM-dd HH:mm:ss"), tjOrder, sysUser, result); |
| | | if (!ajaxResult.get("code").toString().equals("200")) return ajaxResult; |
| | | }else { |
| | | hisApiMethod.tijianshenqing(tjCustomer, DateUtil.format(date1, "yyyy-MM-dd HH:mm:ss"), tjOrder.getCardId()); |
| | | } |
| | | // hisApiMethod.tijianshenqing(tjCustomer, DateUtil.format(date1, "yyyy-MM-dd HH:mm:ss"), tjOrder.getCardId()); |
| | | return AjaxResult.success(tjNumber); |
| | | } else { |
| | | tjCustomer.setCardId(tjOrder.getTjNumber()); |
| | |
| | | customer.setCardId("0"); |
| | | tjCustomerService.updateById(customer); |
| | | String configByKey = configService.selectConfigByKey("sfkqdyhis"); |
| | | tjSamplingMapper.deleteByTjNumAndCusId(tjNum,order.getUserId()); |
| | | if (configByKey.equals("Y")) { |
| | | |
| | | HashMap<String, Object> hisRequestParams = new HashMap<>(); |
| | |
| | | } |
| | | |
| | | } |
| | | return AjaxResult.success("撤销成功!!!"); |
| | | } |
| | | return AjaxResult.success("签到记录不存在!"); |
| | | } |
| | |
| | | HashMap<String, Object> hisRequestParams = new HashMap<>(); |
| | | hisRequestParams.put("patientId", order.getCardId()); |
| | | AjaxResult queryPay = hisApiGetMethodService.getHISDataNew("QueryPay", hisRequestParams); |
| | | log.info("queryPay ->{}",JSONUtil.toJsonStr(queryPay)); |
| | | if (Integer.parseInt(queryPay.get("code").toString()) == 200) { |
| | | List<Map<String, String>> data = (List<Map<String, String>>) queryPay.get("data"); |
| | | log.info("data的数据是" + JSONUtil.toJsonStr(data)); |
| | |
| | | } |
| | | } |
| | | try { |
| | | extracted(dto); |
| | | extracted(dto,order); |
| | | } catch (Exception e) { |
| | | log.info("撤销失败,删除表失败"); |
| | | return AjaxResult.error("撤销失败,删除表失败!"); |
| | |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | // @Transactional(propagation =Propagation.REQUIRES_NEW) |
| | | public void extracted(TjProBlDto dto) { |
| | | // @Transactional(propagation =Propagation.REQUIRES_NEW) |
| | | public void extracted(TjProBlDto dto,TjOrder order) { |
| | | for (String bldh : dto.getBldhs()) { |
| | | remarkService.deleteTjOrderDetailByjxbz(bldh); |
| | | tjOrderDetailService.deleteTjOrderDetailByjxbz(bldh); |
| | |
| | | transitionService.deleteTjOrderDetailByjxbz(bldh); |
| | | blService.remove(new LambdaQueryWrapper<TjProBl>().eq(TjProBl::getTjh, dto.getTjh()).eq(TjProBl::getBldh, bldh)); |
| | | } |
| | | tjSamplingMapper.deleteByTjNumAndCusIdAndJxbz(dto.getTjh(),order.getUserId(),dto.getBldhs()); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.extra.pinyin.PinyinUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.system.service.ISysConfigService; |
| | | import com.ltkj.web.controller.lis.LisApiMethod; |
| | | import com.sun.xml.internal.bind.v2.TODO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.aspectj.weaver.AjAttribute; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | * @author ltkj_赵佳豪&李格 |
| | | * @date 2023-04-11 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/sampling/sampling") |
| | | @Api(tags = "PC端 体检采样管理") |
| | |
| | | private LisApiMethod lisApiMethod; |
| | | @Autowired |
| | | private IdUtils idUtils; |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | /** |
| | | * 查询体检采样管理列表 |
| | |
| | | */ |
| | | @GetMapping("/getCusCyList") |
| | | @ApiOperation(value = "根据客户获取采样列表") |
| | | public AjaxResult getCusCyList(@RequestParam @ApiParam(value = "客户id") String cusId) { |
| | | public AjaxResult getCusCyList(@RequestParam @ApiParam(value = "客户id") String cusId, |
| | | @RequestParam(defaultValue = "1") @ApiParam(value = "0是1否") Integer isSignFor) { |
| | | if (cusId == null || StrUtil.isBlank(cusId)) |
| | | return AjaxResult.error("参数错误,未传参数"); |
| | | LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjSampling::getCusId, cusId); |
| | | wrapper.isNull(TjSampling::getParentId).or().eq(TjSampling::getIsMerge,1); |
| | | wrapper.eq(TjSampling::getIsSignFor,isSignFor); |
| | | wrapper.and(i -> i.isNull(TjSampling::getParentId).or().eq(TjSampling::getIsMerge,1)); |
| | | // wrapper.isNull(TjSampling::getParentId).or().eq(TjSampling::getIsMerge,1); |
| | | wrapper.orderByDesc(TjSampling::getIsMerge); |
| | | List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | if (list.isEmpty()){ |
| | |
| | | @ApiOperation(value = "确认采样接口") |
| | | @Transactional |
| | | public AjaxResult confirmSampling(@RequestBody List<String> ids) { |
| | | if (null == ids || ids.size() == 0) { |
| | | if (null == ids || ids.isEmpty()) { |
| | | return AjaxResult.error("请选择要确认项"); |
| | | } |
| | | for (String id : ids) { |
| | | TjSampling sampling = tjSamplingService.getById(id); |
| | | if (null != sampling) { |
| | | sampling.setIsSignFor("0"); |
| | | LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjProject::getProParentId, sampling.getProId()); |
| | | List<TjProject> projectList = projectService.list(wq); |
| | | List<String> collect = new ArrayList<>(); |
| | | for (TjProject project : projectList) { |
| | | Long proId = project.getProId(); |
| | | collect.add(String.valueOf(proId)); |
| | | } |
| | | LambdaQueryWrapper<TjSampling> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjSampling::getTjNum, sampling.getTjNum()); |
| | | wq1.in(TjSampling::getProId, collect); |
| | | List<TjSampling> samplingList = tjSamplingService.list(wq1); |
| | | if (null != samplingList && samplingList.size() > 0) { |
| | | for (TjSampling tjSampling : samplingList) { |
| | | tjSampling.setIsSignFor("0"); |
| | | tjSamplingService.updateById(tjSampling); |
| | | } |
| | | } |
| | | List<TjSampling> tjSamplings = tjSamplingService.listByIds(ids); |
| | | if (tjSamplings.isEmpty()) |
| | | return AjaxResult.error("请选择要确认项"); |
| | | for (TjSampling sampling : tjSamplings) { |
| | | sampling.setIsSignFor("0"); |
| | | // LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); |
| | | // wq.eq(TjProject::getProParentId, sampling.getProId()); |
| | | // List<TjProject> projectList = projectService.list(wq); |
| | | // List<String> collect = new ArrayList<>(); |
| | | // for (TjProject project : projectList) { |
| | | // Long proId = project.getProId(); |
| | | // collect.add(String.valueOf(proId)); |
| | | // } |
| | | // LambdaQueryWrapper<TjSampling> wq1 = new LambdaQueryWrapper<>(); |
| | | // wq1.eq(TjSampling::getTjNum, sampling.getTjNum()); |
| | | // wq1.in(TjSampling::getProId, collect); |
| | | // List<TjSampling> samplingList = tjSamplingService.list(wq1); |
| | | // if (null != samplingList && samplingList.size() > 0) { |
| | | // for (TjSampling tjSampling : samplingList) { |
| | | // tjSampling.setIsSignFor("0"); |
| | | // tjSamplingService.updateById(tjSampling); |
| | | // } |
| | | // } |
| | | TjOrder tjOrder = orderService.getOrderByTjNum(sampling.getTjNum()); |
| | | TjCustomer tjCustomer = customerService.getById(tjOrder.getUserId()); |
| | | boolean updChild; |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | Boolean save; |
| | | if (null != config && config.equals("Y")) { |
| | | save = lisApiMethod.save(sampling, tjOrder, tjCustomer); |
| | | }else { |
| | | save = true; |
| | | } |
| | | if (!tjSamplingService.updateById(sampling)) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("操作失败,请重试"); |
| | | if (save) { |
| | | if (sampling.getIsMerge() == 1) { |
| | | LambdaQueryWrapper<TjSampling> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjSampling::getParentId, sampling.getId()); |
| | | List<TjSampling> list = tjSamplingService.list(wrapper); |
| | | for (TjSampling tjSampling : list) { |
| | | tjSampling.setIsSignFor("0"); |
| | | } |
| | | updChild = tjSamplingService.updateBatchById(list); |
| | | } else { |
| | | updChild = true; |
| | | } |
| | | if (!tjSamplingService.updateById(sampling) && !updChild) { |
| | | // lisApiMethod.cancel(sampling.getJyxh(), tjOrder.getCardId(), PinyinUtil.getFirstLetter(tjCustomer.getCusName(), "")); |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("操作失败请重试"); |
| | | } |
| | | } else { |
| | | return AjaxResult.error("操作失败请重试"); |
| | | } |
| | | } |
| | | |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | // @Select("SELECT a.* FROM tj_order_detail a LEFT JOIN tj_project b ON a.pro_id=b.pro_id \n" + |
| | | // "LEFT JOIN sys_dept c ON c.dept_id=b.dept_id \n" + |
| | | // " WHERE a.deleted=0 AND !ISNULL(a.flowing_water_id) AND a.order_id=#{orderId} and b.pro_parent_id = 0 AND c.org_type=1") |
| | | @Select("SELECT a.* FROM tj_order_detail a LEFT JOIN tj_project b ON a.pro_id=b.pro_id \n" + |
| | | "LEFT JOIN sys_dept c ON c.dept_id=b.dept_id \n" + |
| | | " WHERE a.deleted=0 AND !ISNULL(a.flowing_water_id) AND a.order_id=#{orderId} and b.pro_parent_id = 0 AND c.org_type=1") |
| | | " WHERE a.deleted=0 AND a.order_id=#{orderId} and b.pro_parent_id = 0 AND c.org_type=1") |
| | | List<TjOrderDetail> getCaiYangDengJi(Long orderId); |
| | | } |
| | |
| | | // "</foreach>", |
| | | // "</script>"}) |
| | | boolean updateHeBingXms(@Param("ids") List<String> ids); |
| | | |
| | | @Delete("DELETE FROM tj_sampling WHERE tj_num = #{tjNum} AND cus_id = #{userId}") |
| | | int deleteByTjNumAndCusId(@Param("tjNum") String tjNum,@Param("userId") Long userId); |
| | | |
| | | @Delete({ |
| | | "<script>", |
| | | "DELETE FROM tj_sampling WHERE tj_num = #{tjNum} AND cus_id = #{userId} and jxbz in ", |
| | | "<foreach collection='ids' item='id' open='(' separator=',' close=')'>", |
| | | "#{id}", |
| | | "</foreach>", |
| | | "</script>" |
| | | }) |
| | | int deleteByTjNumAndCusIdAndJxbz(@Param("tjNum") String tjNum,@Param("userId") Long userId,@Param("ids")List<String> ids); |
| | | } |