从lis、pacs视图查询增加携带院区
修改签到登记价格问题
| | |
| | | if (null != jy && !jy.isEmpty()) { |
| | | log.info("同步检验人员 执行数量->{}", jy.size()); |
| | | for (String s : jy) { |
| | | extractedjianyan(s); |
| | | extractedjianyan(s,dictHosp.getCode()); |
| | | } |
| | | } |
| | | |
| | |
| | | if (null != jc && !jc.isEmpty()) { |
| | | log.info("同步检查人员 执行数量->{}", jc.size()); |
| | | for (String s : jc) { |
| | | extractedjiancha(s); |
| | | extractedjiancha(s,dictHosp.getCode()); |
| | | } |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | taskScheduler.schedule(this::checkAndAddNewTasks, Instant.now().plus(2, ChronoUnit.MINUTES)); |
| | | } |
| | | |
| | | private void extractedjianyan(String s) { |
| | | private void extractedjianyan(String s,String hosp) { |
| | | try { |
| | | List<Aws> awsList = testMapper.getWsxmLtkjHysqdByLisViBySLAVEWS(s); |
| | | if(null !=awsList && !awsList.isEmpty()){ |
| | |
| | | awsService.saveBatch(awsList); |
| | | log.info("保存外送项目成功"); |
| | | } |
| | | List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(s); |
| | | List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(s,hosp); |
| | | List<LtkjHysqd> wssq = testMapper.getWsxmLtkjHysqdByLisVi(s); |
| | | if(null !=wssq && !wssq.isEmpty())hysqdList.addAll(wssq); |
| | | if (null != hysqdList && !hysqdList.isEmpty()) { |
| | |
| | | } |
| | | |
| | | |
| | | private void extractedjiancha(String s) { |
| | | private void extractedjiancha(String s,String hosp) { |
| | | |
| | | try { |
| | | List<LtkjExamJcsqd> jcsqdList = testMapper.getCcXZxYyPacsLtkjExamJcsqd(s); |
| | | List<LtkjExamJcsqd> jcsqdList = testMapper.getCcXZxYyPacsLtkjExamJcsqd(s,hosp); |
| | | if (null != jcsqdList && !jcsqdList.isEmpty()) { |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | jcsqdService.deletedLtkjJcsqdByTjhAndTmh(s); |
| | | jcbgdService.deletedLtkjJcbgdByTjhAndTmh(s); |
| | | jcsqdService.saveBatch(jcsqdList); |
| | | List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(s); |
| | | List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(s,hosp); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | if (null != jcbgdList && !jcbgdList.isEmpty()) jcbgdService.saveBatch(jcbgdList); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | |
| | | if (null != jy && !jy.isEmpty()) { |
| | | log.info("同步检验人员 执行数量->{}", jy.size()); |
| | | for (String s : jy) { |
| | | extractedjianyan(s); |
| | | extractedjianyan(s,yqbm); |
| | | } |
| | | } |
| | | |
| | |
| | | if (null != jc && !jc.isEmpty()) { |
| | | log.info("同步检查人员 执行数量->{}", jc.size()); |
| | | for (String s : jc) { |
| | | extractedjiancha(s); |
| | | extractedjiancha(s,yqbm); |
| | | } |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | return time.isAfter(LocalTime.of(Integer.parseInt(kssj), 0)) && time.isBefore(LocalTime.of(Integer.parseInt(jssj), 0)); |
| | | } |
| | | |
| | | private void extractedjianyan(String s) { |
| | | private void extractedjianyan(String s,String yqbm) { |
| | | try { |
| | | List<Aws> awsList = testMapper.getWsxmLtkjHysqdByLisViBySLAVEWS(s); |
| | | if(null !=awsList && !awsList.isEmpty()){ |
| | |
| | | awsService.saveBatch(awsList); |
| | | log.info("保存外送项目成功"); |
| | | } |
| | | List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(s); |
| | | List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(s,yqbm); |
| | | List<LtkjHysqd> wssq = testMapper.getWsxmLtkjHysqdByLisVi(s); |
| | | if(null !=wssq && !wssq.isEmpty())hysqdList.addAll(wssq); |
| | | if (null != hysqdList && !hysqdList.isEmpty()) { |
| | |
| | | } |
| | | |
| | | |
| | | private void extractedjiancha(String s) { |
| | | private void extractedjiancha(String s,String yqbm) { |
| | | |
| | | try { |
| | | List<LtkjExamJcsqd> jcsqdList = testMapper.getCcXZxYyPacsLtkjExamJcsqd(s); |
| | | List<LtkjExamJcsqd> jcsqdList = testMapper.getCcXZxYyPacsLtkjExamJcsqd(s,yqbm); |
| | | if (null != jcsqdList && !jcsqdList.isEmpty()) { |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | jcsqdService.deletedLtkjJcsqdByTjhAndTmh(s); |
| | | jcbgdService.deletedLtkjJcbgdByTjhAndTmh(s); |
| | | jcsqdService.saveBatch(jcsqdList); |
| | | List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(s); |
| | | List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(s,yqbm); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | if (null != jcbgdList && !jcbgdList.isEmpty()) jcbgdService.saveBatch(jcbgdList); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | |
| | | @GetMapping ("/shoudongtbjyjcwsxmjg") |
| | | @ApiOperation(value = "手动同步检验检查外送项目结果接口") |
| | | public AjaxResult shoudongtbjyjcwsxmjg(@RequestParam @ApiParam(value = "jy检验 jc检查 jyjc检验和检查") String tblx, |
| | | @ApiParam(value = "体检号")@RequestParam String tjh) { |
| | | |
| | | log.info("手动同步检验或检查结果开始->{}",DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); |
| | | @ApiParam(value = "体检号")@RequestParam String tjh, HttpServletRequest request) { |
| | | String hospId = request.getHeader("hospId"); |
| | | log.info("手动同步检验或检查结果开始->{}{}",hospId,DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); |
| | | try { |
| | | |
| | | switch (tblx){ |
| | | case "jy": |
| | | tbjianyan(tjh); |
| | | tbjianyan(tjh,hospId); |
| | | log.info("当前同步的是->{} 结果","检验"); |
| | | break; |
| | | case "jc": |
| | | tbjiancha(tjh); |
| | | tbjiancha(tjh,hospId); |
| | | log.info("当前同步的是->{} 结果","检查"); |
| | | break; |
| | | case "jyjc": |
| | | tbjianyan(tjh); |
| | | tbjiancha(tjh); |
| | | tbjianyan(tjh,hospId); |
| | | tbjiancha(tjh,hospId); |
| | | log.info("当前同步的是->{} 结果","检验检查"); |
| | | break; |
| | | default: |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | private void tbjianyan(String s) { |
| | | private void tbjianyan(String s,String hosp) { |
| | | try { |
| | | List<Aws> awsList = testMapper.getWsxmLtkjHysqdByLisViBySLAVEWS(s); |
| | | if(null !=awsList && !awsList.isEmpty()){ |
| | |
| | | awsService.saveBatch(awsList); |
| | | log.info("保存外送项目成功"); |
| | | } |
| | | List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(s); |
| | | List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(s,hosp); |
| | | log.info("原hysqdList->{} 结果", JSONUtil.parseObj(hysqdList)); |
| | | List<LtkjHysqd> wssq = testMapper.getWsxmLtkjHysqdByLisVi(s); |
| | | if(null !=wssq && !wssq.isEmpty()){ |
| | |
| | | } |
| | | |
| | | |
| | | private void tbjiancha(String s) { |
| | | private void tbjiancha(String s,String hosp) { |
| | | String yqbm = configService.selectConfigByKey("common_api_service_hospbm"); |
| | | try { |
| | | List<LtkjExamJcsqd> jcsqdList = testMapper.getCcXZxYyPacsLtkjExamJcsqd(s); |
| | | List<LtkjExamJcsqd> jcsqdList = testMapper.getCcXZxYyPacsLtkjExamJcsqd(s,hosp); |
| | | if (null != jcsqdList && !jcsqdList.isEmpty()) { |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | jcsqdService.deletedLtkjJcsqdByTjhAndTmh(s); |
| | | jcbgdService.deletedLtkjJcbgdByTjhAndTmh(s); |
| | | jcsqdService.saveBatch(jcsqdList); |
| | | List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(s); |
| | | List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(s,hosp); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | if (null != jcbgdList && !jcbgdList.isEmpty()) jcbgdService.saveBatch(jcbgdList); |
| | | for (LtkjExamJcsqd jcsqd : jcsqdList) { |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.text.Collator; |
| | | import java.util.*; |
| | |
| | | @ApiOperation (value = "同步sql server数据到本地数据库数据接口") |
| | | @RepeatSubmit |
| | | // @Transactional |
| | | public AjaxResult dataSynchronization(@RequestParam String tjNumber) { |
| | | |
| | | public AjaxResult dataSynchronization(@RequestParam String tjNumber, HttpServletRequest request) { |
| | | String hospId = request.getHeader("hospId"); |
| | | RLock lock = redissonClient.getLock("lock:check:dataSynchronization:" + tjNumber); |
| | | try { |
| | | boolean tryLock = lock.tryLock(3L, TimeUnit.SECONDS); |
| | |
| | | return AjaxResult.success("同步成功"); |
| | | } |
| | | else if(null !=sfkqdshitulianjie && sfkqdshitulianjie.equalsIgnoreCase("Y")){ |
| | | List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(order.getTjNumber()); |
| | | List<LtkjHysqd> hysqdList = testMapper.getCcXZxYyLtkjHysqdByLisVi(order.getTjNumber(),hospId); |
| | | if(null != hysqdList && !hysqdList.isEmpty()){ |
| | | for (LtkjHysqd hysqd : hysqdList) { |
| | | LtkjHysqd jybgid = ltkjHysqdService.getLtkjHysqdByTjhAndTmh(hysqd.getTjh(),hysqd.getTmh()); |
| | |
| | | } |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | } |
| | | List<LtkjExamJcsqd> jcsqdList = testMapper.getCcXZxYyPacsLtkjExamJcsqd(order.getTjNumber()); |
| | | List<LtkjExamJcsqd> jcsqdList = testMapper.getCcXZxYyPacsLtkjExamJcsqd(order.getTjNumber(),hospId); |
| | | if(null !=jcsqdList && !jcsqdList.isEmpty()){ |
| | | jcsqdService.deletedLtkjJcsqdByTjhAndTmh(order.getCardId()); |
| | | jcbgdService.deletedLtkjJcbgdByTjhAndTmh(order.getCardId()); |
| | | jcsqdService.saveBatch(jcsqdList); |
| | | List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(order.getCardId()); |
| | | List<LtkjExamJcbgd> jcbgdList = testMapper.getCcXZxYyPacsLtkjExamJcbgd(order.getCardId(),hospId); |
| | | if(null != jcbgdList && !jcbgdList.isEmpty())jcbgdService.saveBatch(jcbgdList); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | } |
| | |
| | | wrapper.gt(TbTransition::getNowPrice, 0); |
| | | |
| | | List<TbTransition> list = tbTransitionService.list(wrapper); |
| | | BigDecimal zongjia = new BigDecimal("0.0"); |
| | | for (TbTransition transition : list) { |
| | | LambdaQueryWrapper<TjProject> wrapper1 = new LambdaQueryWrapper<>(); |
| | | wrapper1.eq(TjProject::getProId, transition.getProId()); |
| | |
| | | SysDept dept = sysDeptService.getOne(wrapper2); |
| | | |
| | | JSONObject obj = JSONUtil.createObj(); |
| | | Integer sl = project.getSl(); |
| | | // Integer sl = project.getSl(); |
| | | int sl = 1; |
| | | BigDecimal danjia = transition.getNowPrice(); |
| | | BigDecimal allPrice = danjia.multiply(new BigDecimal(sl)); |
| | | obj.putOpt("danJia", danjia); |
| | |
| | | obj.putOpt("shouFeiXmId", project.getHisXmbm()); |
| | | obj.putOpt("shouFeiXmMc", project.getHisXmmc()); |
| | | array.add(obj); |
| | | zongjia = zongjia.add(allPrice); |
| | | } |
| | | map.put("feiYongInfoList", array); |
| | | log.info("调用His接口前 收费总价:{}", zongjia.toString()); |
| | | |
| | | String post = HttpClientUtils.sendPost(apiUrl + "/api/his/" + hospbm + "/creatCostInfo", map); |
| | | JSONObject object = JSONUtil.parseObj(post); |
| | |
| | | public AjaxResult updateTransitionnewPrice(@RequestBody List<UpdateTransitionnewPriceDto> dtos) { |
| | | |
| | | if (null != dtos && !dtos.isEmpty()) { |
| | | int index = 0; |
| | | for (UpdateTransitionnewPriceDto dto : dtos) { |
| | | index++; |
| | | LambdaQueryWrapper<TbTransition> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TbTransition::getCusId, dto.getCusIdCard()); |
| | | wq.eq(TbTransition::getParentProId, dto.getParentProId()); |
| | |
| | | log.info("折扣为: " + new BigDecimal(dto.getDiscount())); |
| | | if (null != list && !list.isEmpty()) { |
| | | BigDecimal dxzj = transitionService.getTbTransitionPriceAndOrdPrice(dto.getCusIdCard(), dto.getParentProId()); |
| | | log.info("dxzj:{}",dxzj.toString()); |
| | | if (index == dtos.size()){ |
| | | BigDecimal yhj = dto.getYhj(); |
| | | log.info("前端传递的价格:{}",yhj.toString()); |
| | | BigDecimal cj = yhj.subtract(dxzj); |
| | | log.info("计算的差价:{}",cj.toString()); |
| | | int index1 = 0; |
| | | for (TbTransition transition : list) { |
| | | BigDecimal ordPrice = transition.getOrdPrice(); |
| | | BigDecimal multiply = ordPrice.multiply((new BigDecimal(dto.getDiscount()).divide(BigDecimal.valueOf(10)))); |
| | | log.info("后端计算的金额: " + multiply); |
| | | if (index1 == 0){ |
| | | log.info("修改小项 {}{} 原本价格:{}",transition.getProId(),transition.getProName(),multiply.toString()); |
| | | multiply = multiply.add(cj); |
| | | log.info("增加差价后:{}",multiply.toString()); |
| | | } |
| | | index1++; |
| | | log.info("后端计算的金额: " + multiply.toString()); |
| | | // log.info("前端传递的金额: " + dto.getYhj()); |
| | | transition.setNowPrice(multiply); |
| | | transition.setDiscount(new BigDecimal(dto.getDiscount())); |
| | | transitionService.updateById(transition); |
| | | } |
| | | if (null != dto.getYhj() && dto.getYhj().compareTo(BigDecimal.ZERO) >= 0) { |
| | | List<TbTransition> transitionList = list.stream().filter(a -> |
| | | transitionService.getTbTransitionPriceAndOrdPrice(dto.getCusIdCard(), dto.getParentProId()).subtract(dto.getYhj()).compareTo(BigDecimal.ZERO) >= 0).collect(Collectors.toList()); |
| | | if (!transitionList.isEmpty()) { |
| | | TbTransition tbTransition = transitionList.get(0); |
| | | tbTransition.setNowPrice(dxzj); |
| | | transitionService.updateById(tbTransition); |
| | | }else { |
| | | for (TbTransition transition : list) { |
| | | BigDecimal ordPrice = transition.getOrdPrice(); |
| | | BigDecimal multiply = ordPrice.multiply((new BigDecimal(dto.getDiscount()).divide(BigDecimal.valueOf(10)))); |
| | | log.info("后端计算的金额: " + multiply.toString()); |
| | | // log.info("前端传递的金额: " + dto.getYhj()); |
| | | transition.setNowPrice(multiply); |
| | | transition.setDiscount(new BigDecimal(dto.getDiscount())); |
| | | transitionService.updateById(transition); |
| | | } |
| | | // if (null != dto.getYhj() && dto.getYhj().compareTo(BigDecimal.ZERO) >= 0) { |
| | | // List<TbTransition> transitionList = list.stream().filter(a -> |
| | | // transitionService.getTbTransitionPriceAndOrdPrice(dto.getCusIdCard(), dto.getParentProId()).subtract(dto.getYhj()).compareTo(BigDecimal.ZERO) >= 0).collect(Collectors.toList()); |
| | | // if (!transitionList.isEmpty()) { |
| | | // TbTransition tbTransition = transitionList.get(0); |
| | | // tbTransition.setNowPrice(dxzj); |
| | | // transitionService.updateById(tbTransition); |
| | | // } |
| | | // } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | @DataSource(value = DataSourceType.SLAVE_LIS) |
| | | // @Select("SELECT\n" + |
| | | // " a.GH_PATIENTNO tjh,\n" + |
| | | // " a.SAMPLEID tmh,\n" + |
| | | // " NULL bbbh,\n" + |
| | | // " NULL bbmc,\n" + |
| | | // " a.SFXMID xmid,\n" + |
| | | // " REPLACE(a.SFXMNAME,'tj_','') xmmc,\n" + |
| | | // " a.SENDDATE sqsj,\n" + |
| | | // " a.SENDDOCTOR sqys,\n" + |
| | | // " a.CHECKDATE jgsj,\n" + |
| | | // " a.TXM sqdh,\n" + |
| | | // " a.SENDDOCTOR sqrxm,\n" + |
| | | // " '8001' sqrdm,\n" + |
| | | // " a.AUDITDOCTOR shrxm,\n" + |
| | | // " '已审' jybgjg,\n" + |
| | | // " SYSDATE() create_time\n" + |
| | | // " \n" + |
| | | // "FROM\n" + |
| | | // " vi_his_patientinfo a\n" + |
| | | // "WHERE a.PATIENTTYPE=3 AND a.GH_PATIENTNO =#{tjNum}") |
| | | @Select("SELECT\n" + |
| | | " a.GH_PATIENTNO tjh,\n" + |
| | | " a.SAMPLEID tmh,\n" + |
| | |
| | | " \n" + |
| | | "FROM\n" + |
| | | " vi_his_patientinfo a\n" + |
| | | "WHERE a.PATIENTTYPE=3 AND a.GH_PATIENTNO =#{tjNum}") |
| | | List<LtkjHysqd> getCcXZxYyLtkjHysqdByLisVi(String tjNum); |
| | | "WHERE a.PATIENTTYPE=3 AND a.GH_PATIENTNO =#{tjNum} AND a.HOSPITALID = #{hosp}") |
| | | List<LtkjHysqd> getCcXZxYyLtkjHysqdByLisVi(@Param("tjNum") String tjNum,@Param("hosp") String hosp); |
| | | |
| | | |
| | | |
| | |
| | | " SYSDATE create_time\n" + |
| | | " \n" + |
| | | "FROM\n" + |
| | | " ris.V_TJ_JCBGXX_NEWTJ a WHERE trim(a.HIS_ID)=#{tjNum}") |
| | | List<LtkjExamJcsqd> getCcXZxYyPacsLtkjExamJcsqd(String tjNum); |
| | | " ris.V_TJ_JCBGXX_NEWTJ a WHERE trim(a.HIS_ID)=#{tjNum} AND a.HOSTPITALID = #{hosp}") |
| | | List<LtkjExamJcsqd> getCcXZxYyPacsLtkjExamJcsqd(@Param("tjNum") String tjNum,@Param("hosp") String hosp); |
| | | |
| | | |
| | | @DataSource(value = DataSourceType.SLAVE_PACS) |
| | | // @Select(" SELECT\n" + |
| | | // " trim(a.HIS_ID) tjh,\n" + |
| | | // " trim(a.HIS_ID) tmh,\n" + |
| | | // " trim(a.JCMID) xmdm,\n" + |
| | | // " a.JCMC xmmc,\n" + |
| | | // " NULL bg_mig,\n" + |
| | | // " NULL bg_url,\n" + |
| | | // " TRIM(a.JCSJ) bg_nr,\n" + |
| | | // " a.SHYS shysdm,\n" + |
| | | // " a.SHYS shysxm,\n" + |
| | | // " TRIM(a.JCJL) yxbx,\n" + |
| | | // " a.BGSJ zdsj,\n" + |
| | | // " a.SQRJ sqsj,\n" + |
| | | // " a.JCBW jcbw,\n" + |
| | | // " SYSDATE create_time\n" + |
| | | // "FROM\n" + |
| | | // " ris.V_TJ_JCBGXX_NEWTJ a WHERE a.HIS_ID=#{tjNum}") |
| | | @Select(" SELECT\n" + |
| | | " trim(a.HIS_ID) tjh,\n" + |
| | | " trim(a.HIS_ID) tmh,\n" + |
| | |
| | | " a.JCBW jcbw,\n" + |
| | | " SYSDATE create_time\n" + |
| | | "FROM\n" + |
| | | " ris.V_TJ_JCBGXX_NEWTJ a WHERE a.HIS_ID=#{tjNum}") |
| | | List<LtkjExamJcbgd> getCcXZxYyPacsLtkjExamJcbgd(String tjNum); |
| | | " ris.V_TJ_JCBGXX_NEWTJ a WHERE a.HIS_ID=#{tjNum} AND a.HOSTPITALID = #{hosp}") |
| | | List<LtkjExamJcbgd> getCcXZxYyPacsLtkjExamJcbgd(@Param("tjNum") String tjNum,@Param("hosp") String hosp); |
| | | |
| | | |
| | | List<List<?>> tjplUpdateDetatilByVi(Map<String,Object> map); |