| | |
| | | import com.ltkj.hosp.dto.UpdateTransitionnewPriceDto; |
| | | import com.ltkj.hosp.hisDto.OutpinimpapplyDto; |
| | | import com.ltkj.hosp.hisDto.OutpinmedicapplyDto; |
| | | import com.ltkj.hosp.mapper.TbTransitionMapper; |
| | | import com.ltkj.hosp.mapper.TestMapper; |
| | | import com.ltkj.hosp.mapper.TjSamplingMapper; |
| | | import com.ltkj.hosp.pacsDto.SavePacsApply; |
| | |
| | | import org.aspectj.weaver.ast.Var; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.http.HttpRequest; |
| | | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | private TjFlowingWaterHisService tjFlowingWaterHisService; |
| | | @Resource |
| | | private ITjXdPictureService xdPictureService; |
| | | @Autowired |
| | | private TjOrderYcxmService ycxmService; |
| | | @Autowired |
| | | private TbTransitionMapper tbTransitionMapper; |
| | | |
| | | private static final String TJH = "tjhs:tjh"; |
| | | |
| | | //将方法返回值解析成json格式 |
| | | public JSONObject getJSONObject(String builder) { |
| | |
| | | wqq.like(TjCustomer::getCusName, name); |
| | | List<TjCustomer> customerList = tjCustomerService.list(wqq); |
| | | List<TjOrder> list2 = new ArrayList<>(); |
| | | if (null != customerList && customerList.size() > 0) { |
| | | if (null != customerList && !customerList.isEmpty()) { |
| | | List<TjOrder> list = new ArrayList<>(); |
| | | for (TjCustomer customer : customerList) { |
| | | LambdaQueryWrapper<TjOrder> wq = new LambdaQueryWrapper<>(); |
| | |
| | | list.addAll(tjOrderService.list(wq)); |
| | | } |
| | | List<TjOrder> collect = null; |
| | | if (list.size() > 0) { |
| | | if (!list.isEmpty()) { |
| | | for (TjOrder order : list) { |
| | | //筛选有调查问卷的 |
| | | LambdaQueryWrapper<TjSurveyRecord> wqq1 = new LambdaQueryWrapper<>(); |
| | | wqq1.eq(TjSurveyRecord::getTjnumber, order.getTjNumber()); |
| | | List<TjSurveyRecord> one = surveyRecordService.list(wqq1); |
| | | if (one.size() == 0) { |
| | | if (one.isEmpty()) { |
| | | TjCustomer tjCustomer = tjCustomerService.getById(order.getUserId()); |
| | | if (null != tjCustomer) { |
| | | order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | |
| | | LambdaQueryWrapper<TjSurveyRecord> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.eq(TjSurveyRecord::getTjnumber, order.getTjNumber()); |
| | | List<TjSurveyRecord> one = surveyRecordService.list(wqq); |
| | | if (one.size() == 0) { |
| | | if (one.isEmpty()) { |
| | | TjCustomer tjCustomer = tjCustomerService.getById(order.getUserId()); |
| | | if (null != tjCustomer) { |
| | | order.setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | |
| | | wq.isNull(TjOrder::getPrintLastTime); |
| | | } |
| | | if (zt == 6) { |
| | | //已出报告 |
| | | //已打印 |
| | | wq.isNotNull(TjOrder::getPrintLastTime); |
| | | wq.eq(TjOrder::getHeshouStatus, 1); |
| | | wq.isNotNull(TjOrder::getPrintLastTime); |
| | |
| | | order.setZt("报告核收"); |
| | | } |
| | | if (zt == 6) { |
| | | order.setZt("已出报告"); |
| | | order.setZt("已打印"); |
| | | } |
| | | } else { |
| | | if (czwj == 0) { |
| | |
| | | order.setZt("报告核收"); |
| | | } |
| | | if (null != lastTime) { |
| | | //已出报告6 |
| | | order.setZt("已出报告"); |
| | | //已打印6 |
| | | order.setZt("已打印"); |
| | | } |
| | | } |
| | | } |
| | |
| | | TjCustomer tjCustomer = tjCustomerService.getOne(wq); |
| | | if (tjCustomer == null) return AjaxResult.error("该客户未登记"); |
| | | |
| | | LambdaQueryWrapper<TjOrder> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.eq(TjOrder::getUserId, tjOrder.getUserId()); |
| | | wqq.eq(TjOrder::getCheckStatus, 0); |
| | | wqq.isNull(TjOrder::getFinishTime); |
| | | // if (!tjCustomer.getCardId().equals("0")) { |
| | | wqq.eq(TjOrder::getCardId, tjCustomer.getCardId()); |
| | | // LambdaQueryWrapper<TjOrder> wqq = new LambdaQueryWrapper<>(); |
| | | // wqq.eq(TjOrder::getUserId, tjOrder.getUserId()); |
| | | // wqq.eq(TjOrder::getCheckStatus, 0); |
| | | // wqq.isNull(TjOrder::getFinishTime); |
| | | //// if (!tjCustomer.getCardId().equals("0")) { |
| | | // wqq.eq(TjOrder::getCardId, tjCustomer.getCardId()); |
| | | //// } |
| | | // TjOrder order = tjOrderService.getOne(wqq); |
| | | // if (null != order) { |
| | | // transitionService.deletedTbTransitionListByCusIdAndTjNum(tjCustomer.getCusIdcard(), tjCustomer.getCardId()); |
| | | // return AjaxResult.error("不可重复登记"); |
| | | // } |
| | | TjOrder order = tjOrderService.getOne(wqq); |
| | | if (null != order) { |
| | | transitionService.deletedTbTransitionListByCusIdAndTjNum(tjCustomer.getCusIdcard(), tjCustomer.getCardId()); |
| | | return AjaxResult.error("不可重复登记"); |
| | | } |
| | | TjFlowingWater tjFlowingWater = new TjFlowingWater(); |
| | | LambdaQueryWrapper<TjReservation> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjReservation::getIdCard, tjCustomer.getCusIdcard()); |
| | |
| | | } |
| | | tjReservation.setIsExpire(1); |
| | | tjReservationService.updateById(tjReservation); |
| | | if (null != tjReservation.getTeamNo() && tjOrder.getTjType().equals("1")) { |
| | | if (null != tjReservation.getTeamNo()) { |
| | | tjOrder.setTjType("1"); |
| | | } else if (tjOrder.getTjType().equals("2")) { |
| | | tjOrder.setTjType("2"); |
| | | } |
| | | } |
| | | if(StringUtil.isBlank(tjOrder.getFirmId())){ |
| | | if (StringUtil.isBlank(tjOrder.getFirmId())) { |
| | | tjOrder.setFirmId("0"); |
| | | } |
| | | |
| | |
| | | tjOrderService.tjQiandaodengji(tjOrder.getTjNumber()); |
| | | return result; |
| | | } |
| | | } finally { |
| | | }catch (Exception e){ |
| | | log.error(String.valueOf(e)); |
| | | } |
| | | finally { |
| | | lock.unlock(); |
| | | } |
| | | return AjaxResult.error(); |
| | |
| | | public AjaxResult processOrderWithTransaction(TjOrder tjOrder, TjCustomer tjCustomer, TjReservation tjReservation, TjFlowingWater tjFlowingWater, MallOrder mallOrder, SysUser sysUser) { |
| | | |
| | | //获取拼接前缀 |
| | | String makeLisTmhPrefix = configService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | String sfkqtjhqz = configService.selectConfigByKey("sfkqtjhqz"); |
| | | String makeLisTmhPrefix = ""; |
| | | if(sfkqtjhqz.equalsIgnoreCase("Y")){ |
| | | makeLisTmhPrefix = configService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | } |
| | | |
| | | //生成体检号 |
| | | // String tjNumber = (SecurityUtils.getUsername() + new SimpleDateFormat("yyMMddHHmmss").format(new Date())); |
| | | // if(StringUtil.isNotBlank(makeLisTmhPrefix)) tjNumber=makeLisTmhPrefix+tjNumber; |
| | | |
| | | |
| | | String tjNumber = (SecurityUtils.getUsername()+IdUtils.getTjNumber()); |
| | | if(StringUtil.isNotBlank(makeLisTmhPrefix)) tjNumber=makeLisTmhPrefix+tjNumber; |
| | | // String tjNumber = (SecurityUtils.getUsername() + idUtils.getTjNumber()); |
| | | String tjNumber = idUtils.getTjNumber(); |
| | | if (StringUtil.isNotBlank(makeLisTmhPrefix)) tjNumber = makeLisTmhPrefix + tjNumber; |
| | | tjOrder.setTjNumber(tjNumber); |
| | | |
| | | |
| | |
| | | tjFlowingWater.setDiscount(discount.toString()); |
| | | |
| | | BigDecimal subtract = paidIn.subtract(copeWith.multiply(discount.divide(BigDecimal.valueOf(10)))); |
| | | log.info("签到登记体检人: "+tjOrder.getTjNumber()+" 应付: "+copeWith); |
| | | log.info("签到登记体检人: "+tjOrder.getTjNumber()+" 折扣: "+discount); |
| | | log.info("签到登记体检人: "+tjOrder.getTjNumber()+" 实付: "+paidIn); |
| | | log.info("签到登记体检人: "+tjOrder.getTjNumber()+" 相差: "+subtract); |
| | | log.info("签到登记体检人: " + tjOrder.getTjNumber() + " 应付: " + copeWith); |
| | | log.info("签到登记体检人: " + tjOrder.getTjNumber() + " 折扣: " + discount); |
| | | log.info("签到登记体检人: " + tjOrder.getTjNumber() + " 实付: " + paidIn); |
| | | log.info("签到登记体检人: " + tjOrder.getTjNumber() + " 相差: " + subtract); |
| | | |
| | | if (isPay.equals("true")) { |
| | | if (null != mallOrder) { |
| | |
| | | //修改每项的原价现价 |
| | | // transitionService.updateTbTransitionPriceByCusId(tjCustomer.getCusIdcard(), discount, tjOrder.getTjNumber()); |
| | | //修改临时表体检号 |
| | | transitionService.updateTbTransitionTjNumByCusId(tjCustomer.getCusIdcard(),tjOrder.getTjNumber()); |
| | | transitionService.updateTbTransitionTjNumByCusId(tjCustomer.getCusIdcard(), tjOrder.getTjNumber()); |
| | | //补差价 |
| | | /* if(subtract.compareTo(BigDecimal.ZERO)>0){ |
| | | tjFlowingWater.setPaidIn(paidIn.add(subtract)); |
| | |
| | | }*/ |
| | | // 查询 对接Lis、Pacs申请如果类型包含在配置内则使用对接lis、pacs |
| | | if (lisApiMethod.isUseLisAndPacsRegister(tjOrder)) { |
| | | log.info("调用his开启 进入不收费方法 该体检人员不收费:"+tjOrder.getTjNumber()); |
| | | // 这是上面个人方法引入数据 |
| | | tjFlowingWater.setPayStasus(1L); |
| | | newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater); |
| | |
| | | remarkService.updateTjOrderRemarkSfbzByJxbzisnull(tjOrder.getOrderId().toString(), tjFlowingWater.getTjSerialNumber().toString()); |
| | | List<TjXdPicture> xdPictureList = xdPictureService.saveTjXdPicture(tjOrder.getTjNumber()); |
| | | xdPictureService.saveBatch(xdPictureList); |
| | | // List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId()); |
| | | // addCaiYangDengJi(detailList, !detailList.isEmpty(), tjOrder, sysUser, null); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId()); |
| | | addCaiYangDengJi(detailList, !detailList.isEmpty(), tjOrder, sysUser, null); |
| | | log.info("调用his开启 进入不收费方法 该方法执行完毕"); |
| | | } else { |
| | | log.info("调用his开启 进入收费方法 该体检人员不收费:"+tjOrder.getTjNumber()); |
| | | newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId()); |
| | | addCaiYangDengJi(detailList, !detailList.isEmpty(), tjOrder, sysUser, null); |
| | | |
| | | hisApiMethod.tijianshenqing(tjCustomer, DateUtil.format(date1, "yyyy-MM-dd HH:mm:ss"), tjOrder.getCardId()); |
| | | String isUseMx = configService.selectConfigByKey("jcxhis_is_use_mx"); |
| | | if (isUseMx.equalsIgnoreCase("Y")) |
| | | hisApiMethod.tijianshenqing(tjCustomer, DateUtil.format(date1, "yyyy-MM-dd HH:mm:ss"), tjOrder.getCardId()); |
| | | else hisApiMethod.tijianshenqingJinchuanNew(tjCustomer, DateUtil.format(date1, "yyyy-MM-dd HH:mm:ss"), tjOrder.getCardId()); |
| | | } |
| | | return AjaxResult.success(tjNumber); |
| | | } else { |
| | |
| | | |
| | | // 查询 对接Lis、Pacs申请如果类型包含在配置内则使用对接lis、pacs |
| | | |
| | | log.info("签到登记接口该人员: "+tjOrder.getTjNumber()+" 的体检类型是:"+tjOrder.getTjType()); |
| | | if (lisApiMethod.isUseLisAndPacsRegister(tjOrder)) { |
| | | log.info(tjOrder.getTjNumber()+"签到登记进入未收费方法"); |
| | | // 这是上面个人方法引入数据 |
| | | tjFlowingWater.setPayStasus(1L); |
| | | newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater); |
| | |
| | | List<TjXdPicture> xdPictureList = xdPictureService.saveTjXdPicture(tjOrder.getTjNumber()); |
| | | xdPictureService.saveBatch(xdPictureList); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId()); |
| | | log.info(tjOrder.getTjNumber()+"签到登记:采样数据查询个数"+detailList.size()); |
| | | addCaiYangDengJi(detailList, !detailList.isEmpty(), tjOrder, sysUser, null); |
| | | return AjaxResult.success(tjNumber); |
| | | }else { |
| | | } else { |
| | | log.info(tjOrder.getTjNumber()+"else签到登记进入收费方法"); |
| | | newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater); |
| | | AjaxResult error = isRequestCommonHisApi(tjOrder, tjCustomer, tjFlowingWater); |
| | | if (error != null) return error; |
| | |
| | | wrapper.eq(TbTransition::getTjNum, tjOrder.getTjNumber()); |
| | | wrapper.eq(TbTransition::getCusId, tjCustomer.getCusIdcard()); |
| | | wrapper.eq(TbTransition::getCardId, tjCustomer.getCardId()); |
| | | wrapper.isNotNull(TbTransition::getOrdPrice); |
| | | wrapper.gt(TbTransition::getOrdPrice, 0); |
| | | wrapper.isNotNull(TbTransition::getNowPrice); |
| | | 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(); |
| | | BigDecimal danjia = transition.getOrdPrice(); |
| | | // Integer sl = project.getSl(); |
| | | int sl = 1; |
| | | BigDecimal danjia = transition.getNowPrice(); |
| | | BigDecimal allPrice = danjia.multiply(new BigDecimal(sl)); |
| | | obj.putOpt("danJia", danjia); |
| | | obj.putOpt("jieSuanJe", allPrice); |
| | |
| | | obj.putOpt("zhiXingKsMc", dept.getDeptName()); |
| | | obj.putOpt("shouFeiXmId", project.getHisXmbm()); |
| | | obj.putOpt("shouFeiXmMc", project.getHisXmmc()); |
| | | |
| | | // obj.putOpt("zhiXingKs","7805"); |
| | | // obj.putOpt("zhiXingKsMc","体检科"); |
| | | // obj.putOpt("shouFeiXmId","4735346"); |
| | | // obj.putOpt("shouFeiXmMc","体检费"); |
| | | 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); |
| | |
| | | } |
| | | |
| | | } |
| | | 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())); |
| | | 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())); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/addCaiYangDengJi") |
| | | @ApiOperation(value = "手动添加采样记录接口") |
| | | public AjaxResult addCaiYangDengJi(@RequestParam("tjNum") String tjNum){ |
| | | |
| | | try { |
| | | TjOrder order = tjOrderService.getOrderByTjNum(tjNum); |
| | | if(null !=order){ |
| | | Long userId = Long.valueOf(SecurityUtils.getLoginUser().getUserId()); |
| | | SysUser sysUser = userService.getById(userId); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(order.getOrderId()); |
| | | log.info("签到登记:采样数据查询个数"+detailList.size()); |
| | | addCaiYangDengJi(detailList, !detailList.isEmpty(), order, sysUser, null); |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | log.error(String.valueOf(e)); |
| | | } |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/addPlOrderAndDetail") |
| | | @ApiOperation(value = "体检批量签到登记接口") |
| | | @Transactional //(切换数据库出错,所以注释) |
| | | // @Transactional //(切换数据库出错,所以注释) |
| | | public AjaxResult addPlOrderAndDetail(@RequestBody QianDaoDto daoDto, HttpServletResponse response) { |
| | | SysUser sysUser = UserHoder.getLoginUser().getUser(); |
| | | List<String> cusIds = daoDto.getCusIds(); |
| | | ArrayList<String> tjNumbers = new ArrayList<>(); |
| | | ArrayList<String> errTjh = new ArrayList<>(); |
| | | if (null != cusIds && !cusIds.isEmpty()) { |
| | | ExecutorService threadPools = Executors.newFixedThreadPool(cusIds.size()); |
| | | for (String cusId : cusIds) { |
| | |
| | | // } |
| | | // } |
| | | // }); |
| | | |
| | | Future<AjaxResult> future = executor.submit(new Callable<AjaxResult>() { |
| | | @Override |
| | | public AjaxResult call() throws Exception { |
| | |
| | | }); |
| | | try { |
| | | AjaxResult result = future.get(); |
| | | String tjNumber = result.get("tjNumber").toString(); |
| | | tjNumbers.add(tjNumber); |
| | | String code = result.get("code").toString(); |
| | | if (code.equals("200")) { |
| | | String tjNumber = result.get("tjNumber").toString(); |
| | | tjNumbers.add(tjNumber); |
| | | }else { |
| | | String userId = result.get("userId").toString(); |
| | | errTjh.add(userId); |
| | | } |
| | | } catch (InterruptedException | ExecutionException e) { |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | threadPools.shutdown(); |
| | | } |
| | | } |
| | | // TODO 因为有体检号会查出空数据 先使用死数据 |
| | | tjNumbers = new ArrayList<>(); |
| | | tjNumbers.add("02095240229171627"); |
| | | tjNumbers.add("02095240229173104"); |
| | | tjNumbers.add("10001240524172002"); |
| | | tjNumbers.add("10001240304124410"); |
| | | tjNumbers.add("00325240304160123"); |
| | | tjNumbers.add("02095240304162044"); |
| | | tjNumbers.add("02095240304162152"); |
| | | tjNumbers.add("10001240304163505"); |
| | | Map<String, Object> map = null; |
| | | try { |
| | | map = PDFDocumentUtil.getDocument(); |
| | | Document document = (Document) map.get("document"); |
| | | for (int i = 0; i < tjNumbers.size(); i++) { |
| | | // TODO 因为有体检号会查出空数据 先使用死数据 打印导诊单 |
| | | if (!tjNumbers.isEmpty()) { |
| | | /* Map<String, Object> map = null; |
| | | try { |
| | | List<Map<String, String>> djdInfos = tjOrderService.selectDjdInfo(tjNumbers.get(i)); |
| | | Map<String, Object> userInfo = tjOrderService.selectDjdUserInfo(tjNumbers.get(i)); |
| | | LocalDateTime tjsj = (LocalDateTime) userInfo.get("tjsj"); |
| | | DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); |
| | | String time = null; |
| | | if (tjsj != null) { |
| | | time = dateFormat.format(tjsj); |
| | | map = PDFDocumentUtil.getDocument(); |
| | | Document document = (Document) map.get("document"); |
| | | // for (int i = 0; i < tjNumbers.size(); i++) { |
| | | int i = 0; |
| | | for (String tjNumber : tjNumbers) { |
| | | try { |
| | | List<Map<String, Object>> djdInfos = tjOrderService.selectDjdInfo(tjNumber); |
| | | Map<String, Object> userInfo = tjOrderService.selectDjdUserInfo(tjNumber); |
| | | if(null !=userInfo && null !=djdInfos && !djdInfos.isEmpty()){ |
| | | LocalDateTime tjsj = (LocalDateTime) userInfo.get("tjsj"); |
| | | DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); |
| | | String time = null; |
| | | if (tjsj != null) { |
| | | time = dateFormat.format(tjsj); |
| | | } |
| | | PDFDocumentUtil.makeUserInfoTable(document, (String) userInfo.get("tjname"), (String) userInfo.get("sex") |
| | | , (String) userInfo.get("tjh"), (String) userInfo.get("lxdh"), (String) userInfo.get("tjname"), time); |
| | | PDFDocumentUtil.makeTjInfo(document, djdInfos); |
| | | // 多条则换页 |
| | | if (i + 1 < tjNumbers.size()) { |
| | | document.newPage(); |
| | | } |
| | | } |
| | | |
| | | } catch (DocumentException | IOException e) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | //这里删除的是这个人所有项目包括补录项目 |
| | | TjOrder order = tjOrderService.getOrderByTjNum(tjNumber); |
| | | tjOrderService.deleteTjOrderByOrderId(order.getOrderId()); |
| | | tjOrderDetailService.deleteTjOrderDetailByOrderDetailId(String.valueOf(order.getOrderId())); |
| | | remarkService.deletedOrderRemarkByTjNum(tjNumber); |
| | | tjFlowingWaterService.deleteTjFlowingWaterByOrderId(String.valueOf(order.getOrderId())); |
| | | // transitionService.deletedTbTransitionByTjNum(tjNum); |
| | | tjSamplingMapper.deleteByTjNumAndCusId(order.getTjNumber(), order.getUserId()); |
| | | |
| | | TjReservation reservation = tjReservationService.getById(order.getReservationId()); |
| | | if(null !=reservation){ |
| | | reservation.setIsExpire(2); |
| | | tjReservationService.updateById(reservation); |
| | | transitionService.updateTbTransitionByTjNum(tjNumber); |
| | | } |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | PDFDocumentUtil.makeUserInfoTable(document, (String) userInfo.get("tjname"), (String) userInfo.get("sex") |
| | | , (String) userInfo.get("tjh"), (String) userInfo.get("lxdh"), (String) userInfo.get("tjname"), time); |
| | | PDFDocumentUtil.makeTjInfo(document, djdInfos); |
| | | // 多条则换页 |
| | | if (i + 1 < tjNumbers.size()) { |
| | | document.newPage(); |
| | | } |
| | | } catch (DocumentException | IOException e) { |
| | | |
| | | // } |
| | | document.close(); |
| | | ByteArrayOutputStream outputStream = (ByteArrayOutputStream) map.get("stream"); |
| | | String encodeToString = java.util.Base64.getEncoder().encodeToString(outputStream.toByteArray()); |
| | | return AjaxResult.success().put("file", encodeToString); |
| | | } catch (IOException | DocumentException e) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | e.printStackTrace(); |
| | | } |
| | | }*/ |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("tjh",tjNumbers); |
| | | return AjaxResult.success("操作成功",map); |
| | | } |
| | | document.close(); |
| | | ByteArrayOutputStream outputStream = (ByteArrayOutputStream) map.get("stream"); |
| | | String encodeToString = java.util.Base64.getEncoder().encodeToString(outputStream.toByteArray()); |
| | | return AjaxResult.success().put("file", encodeToString); |
| | | } catch (IOException | DocumentException e) { |
| | | e.printStackTrace(); |
| | | if (!errTjh.isEmpty()){ |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("errtjh",errTjh); |
| | | return AjaxResult.success("以上人员签到失败",map); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | return AjaxResult.success("操作成功"); |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | private void getAjaxResults(String cusIdcard) { |
| | | @GetMapping("/signOrderInfo") |
| | | public AjaxResult signOrderInfo(@RequestParam("tjNum") String tjNum){ |
| | | List<Map<String, Object>> djdInfos = tjOrderService.selectDjdInfo(tjNum); |
| | | Map<String, Object> userInfo = tjOrderService.selectDjdUserInfo(tjNum); |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("djd",djdInfos); |
| | | hashMap.put("user",userInfo); |
| | | return AjaxResult.success(hashMap); |
| | | } |
| | | |
| | | @Transactional |
| | | public void getAjaxResults(String cusIdcard) { |
| | | if (!"".equals(cusIdcard) && cusIdcard != null) { |
| | | //根据配置调取存储过程 将临时表数据存入预约表2023.12.12 |
| | | final String getInfoFromSqlData = configService.selectConfigByKey("getInfoFromSqlData"); |
| | |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | } |
| | | |
| | | private AjaxResult getAjaxResult(Long userId, SysUser sysUser, String tjCategory) throws IOException { |
| | | @Transactional |
| | | public AjaxResult getAjaxResult(Long userId, SysUser sysUser, String tjCategory) throws IOException { |
| | | |
| | | LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjCustomer::getCusId, userId); |
| | | TjCustomer tjCustomer = tjCustomerService.getOne(wq); |
| | | if (tjCustomer == null) return AjaxResult.error("该客户未登记或不存在"); |
| | | |
| | | LambdaQueryWrapper<TjOrder> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.eq(TjOrder::getUserId, userId); |
| | | wqq.eq(TjOrder::getCheckStatus, 0); |
| | | wqq.isNull(TjOrder::getFinishTime); |
| | | if (!tjCustomer.getCardId().equals("0")) { |
| | | wqq.eq(TjOrder::getCardId, tjCustomer.getCardId()); |
| | | } |
| | | TjOrder order = tjOrderService.getOne(wqq); |
| | | if (null != order) { |
| | | transitionService.deletedTbTransitionListByCusIdAndTjNum(tjCustomer.getCusIdcard(), tjCustomer.getCardId()); |
| | | return AjaxResult.error("不可重复登记"); |
| | | } |
| | | TjOrder tjOrder = new TjOrder(); |
| | | Date date = new Date(); |
| | | tjOrder.setCreateTime(date); |
| | |
| | | if (tjReservation != null) { |
| | | tjOrder.setReservationId(tjReservation.getId()); |
| | | mallOrder = mallOrderService.getOne(new LambdaQueryWrapper<MallOrder>().eq(MallOrder::getReservationId, tjReservation.getId())); |
| | | if (DateUtil.endOfDay(new Date()).before(tjReservation.getReservationTime())) { |
| | | return AjaxResult.error("未到预约时间"); |
| | | } |
| | | if (DateUtil.endOfDay(tjReservation.getReservationTime()).before(new Date())) { |
| | | tjReservation.setIsExpire(1); |
| | | tjReservationService.updateById(tjReservation); |
| | | return AjaxResult.error("对不起您的预约已超时请重新预约"); |
| | | } |
| | | // if (DateUtil.endOfDay(new Date()).before(tjReservation.getReservationTime())) { |
| | | // return AjaxResult.error("未到预约时间"); |
| | | // } |
| | | // if (DateUtil.endOfDay(tjReservation.getReservationTime()).before(new Date())) { |
| | | // tjReservation.setIsExpire(1); |
| | | // tjReservationService.updateById(tjReservation); |
| | | // return AjaxResult.error("对不起您的预约已超时请重新预约"); |
| | | // } |
| | | if (null != tjReservation.getTeamNo()) tjOrder.setTeamNo(tjReservation.getTeamNo()); |
| | | if (null != tjReservation.getCompanyId()) tjOrder.setFirmId(tjReservation.getCompanyId()); |
| | | if (null != tjReservation.getCompany()) tjOrder.setFirmName(tjReservation.getCompany()); |
| | | if (null != tjReservation.getDepartment()) tjOrder.setFirmDeptName(tjReservation.getDepartment()); |
| | | if (null != tjReservation.getJobNo()) tjOrder.setFirmWorkId(tjReservation.getJobNo()); |
| | | if (null != tjReservation.getPacId()) tjOrder.setPacId(tjReservation.getPacId()); |
| | |
| | | } |
| | | tjReservation.setIsExpire(1); |
| | | tjReservationService.updateById(tjReservation); |
| | | if (null != tjReservation.getTeamNo()) { |
| | | tjOrder.setTjType("1"); |
| | | } else{ |
| | | tjOrder.setTjType("2"); |
| | | } |
| | | |
| | | if (StringUtil.isBlank(tjOrder.getFirmId())) { |
| | | tjOrder.setFirmId("0"); |
| | | } |
| | | // |
| | | // tjReservation.setIsExpire(1); |
| | | // tjReservationService.updateById(tjReservation); |
| | | |
| | | //生成体检号 |
| | | String tjNumber = (sysUser.getUserName() + new SimpleDateFormat("yyMMddHHmmss").format(new Date())); |
| | | // String tjNumber = (sysUser.getUserName() + new SimpleDateFormat("yyMMddHHmmss").format(new Date())); |
| | | // tjNumber = tjNumber.replaceAll(".{6}$", userId.toString().substring(userId.toString().length() - 6)); |
| | | |
| | | tjNumber = tjNumber.replaceAll(".{4}$", userId.toString().substring(userId.toString().length() - 4)); |
| | | |
| | | //获取拼接前缀 |
| | | String makeLisTmhPrefix = configService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | // String tjNumber = (sysUser.getUserName() + idUtils.getTjNumber()); |
| | | String tjNumber = idUtils.getTjNumber(); |
| | | if (StringUtil.isNotBlank(makeLisTmhPrefix)) tjNumber = makeLisTmhPrefix + tjNumber; |
| | | |
| | | |
| | | // if (redisCache.hasKey(TJH)) { |
| | | // while (true){ |
| | | // List<String> tjh = redisCache.getCacheList(TJH); |
| | | // if(tjh.contains(tjNumber)){ |
| | | // tjNumber =(sysUser.getUserName() + IdUtils.getTjNumber()); |
| | | // if (StringUtil.isNotBlank(makeLisTmhPrefix)) tjNumber = makeLisTmhPrefix + tjNumber; |
| | | // }else { |
| | | // tjh.add(tjNumber); |
| | | // } |
| | | // } |
| | | // }else { |
| | | // List<String> stringList = tjOrderService. |
| | | // list(new LambdaQueryWrapper<TjOrder>().select(TjOrder::getTjNumber)).stream().map(TjOrder::getTjNumber).collect(Collectors.toList()); |
| | | // stringList.add(tjNumber); |
| | | // redisCache.setCacheList(TJH,stringList); |
| | | // } |
| | | tjOrder.setTjNumber(tjNumber); |
| | | if (null != tjOrder.getPhoto()) { |
| | | File file = new File(tjOrder.getPhoto()); |
| | |
| | | tjCustomer.setCusNumber(cusNumber); |
| | | // BigDecimal discount = BigDecimal.valueOf(Double.parseDouble(tjOrder.getTjFlowingWater().getDiscount())).divide(BigDecimal.valueOf(10)); |
| | | TjFlowingWater tjFlowingWater = new TjFlowingWater(); |
| | | tjFlowingWater.setCreateTime(date); |
| | | tjFlowingWater.setCreateTime(date); |
| | | tjFlowingWater.setUpdateTime(date); |
| | | tjFlowingWater.setCreateBy(sysUser.getNickName()); |
| | | tjFlowingWater.setUpdateBy(sysUser.getNickName()); |
| | | // BigDecimal bigDecimal = tbTransitionMapper.sumTbTransitionOrdPriceByTjNum(tjOrder.getTjNumber()); |
| | | BigDecimal bigDecimal = tbTransitionMapper.sumTbTransitionOrdPriceByTjNumIsNull(tjCustomer.getCusIdcard()); |
| | | tjFlowingWater.setCopeWith(bigDecimal); |
| | | // BigDecimal bigDecimal1 = tbTransitionMapper.sumTbTransitionNowPriceByTjNum(tjOrder.getTjNumber()); |
| | | BigDecimal bigDecimal1 = tbTransitionMapper.sumTbTransitionNowPriceByTjNumIsNull(tjCustomer.getCusIdcard()); |
| | | tjFlowingWater.setPaidIn(bigDecimal1); |
| | | tjFlowingWater.setDiscount(String.valueOf(10)); |
| | | tjFlowingWater.setPayStasus(1L); |
| | | tjFlowingWater.setPayType(3L); |
| | | |
| | | tjFlowingWater.setPayStasus(0L); |
| | | if ("1".equals(tjOrder.getTjType())) { |
| | | if (tjReservation.getPayType() == 1) { |
| | |
| | | if (tjFlowingWaterService.save(tjFlowingWater)) { |
| | | tjOrder.setTjSerialNumber(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | tjOrderService.updateById(tjOrder); |
| | | |
| | | |
| | | } |
| | | asyncService.ttextracted(tjOrder, tjCustomer, sysUser, tjReservation, tjFlowingWater); |
| | | transitionService.updateTbTransitionTjNumByCusId(tjCustomer.getCusIdcard(), tjOrder.getTjNumber()); |
| | | tjCustomer.setCardId(tjOrder.getTjNumber()); |
| | | tjCustomerService.updateById(tjCustomer); |
| | | transitionService.updateCardIdByTjNumAndIdCard(tjCustomer.getCusIdcard(), tjOrder.getTjNumber(), tjOrder.getTjNumber()); |
| | | tjOrder.setCardId(tjOrder.getTjNumber()); |
| | | tjOrderService.updateById(tjOrder); |
| | | |
| | | // asyncService.ttextracted(tjOrder, tjCustomer, sysUser, tjReservation, tjFlowingWater); |
| | | |
| | | if (lisApiMethod.isUseLisAndPacsRegister(tjOrder)) { |
| | | // 这是上面个人方法引入数据 |
| | | tjFlowingWater.setPayStasus(1L); |
| | | tjOrder.setTjFlowingWater(tjFlowingWater); |
| | | newSaveextracted(tjOrder, tjCustomer, BigDecimal.valueOf(10), sysUser, tjReservation, tjFlowingWater); |
| | | tjOrderDetailService.updateTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId()), |
| | | sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | remarkService.updateTjOrderRemarkSfbzByJxbzisnull(tjOrder.getOrderId().toString(), tjFlowingWater.getTjSerialNumber().toString()); |
| | | List<TjXdPicture> xdPictureList = xdPictureService.saveTjXdPicture(tjOrder.getTjNumber()); |
| | | xdPictureService.saveBatch(xdPictureList); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId()); |
| | | addCaiYangDengJi(detailList, !detailList.isEmpty(), tjOrder, sysUser, null); |
| | | // return AjaxResult.success(tjNumber); |
| | | } |
| | | |
| | | tjCustomer.setCardId("0"); |
| | | tjCustomerService.updateById(tjCustomer); |
| | | return AjaxResult.success().put("tjNumber", tjNumber); |
| | | } |
| | | } |
| | | return AjaxResult.error(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error().put("userId",userId); |
| | | } |
| | | |
| | | |
| | |
| | | return AjaxResult.error("操作失败! 以下项目已存在: " + string); |
| | | } |
| | | transitionService.saveRedisTransitionByPacId(cusId, cardId, pacId); |
| | | |
| | | //补差价 |
| | | List<Map<String, Object>> cjMaps = transitionService.addTbhuoquxiangmuchajia(pacId.toString(), cusId); |
| | | if (null != cjMaps && !cjMaps.isEmpty()) { |
| | | log.info("该套餐"+pacId+"中有差价:"+cjMaps.size()+"个"); |
| | | for (Map<String, Object> cjMap : cjMaps) { |
| | | log.info("添加临时表套餐数据时所选的差价为:"+ cjMap.get("cj").toString()); |
| | | transitionService.buxiangmuchajia(cusId, pacId.toString(), cjMap.get("xmid").toString(), new BigDecimal(cjMap.get("cj").toString())); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | remarkService.deletedOrderRemarkByTjNum(tjNum); |
| | | tjFlowingWaterService.deleteTjFlowingWaterByOrderId(String.valueOf(order.getOrderId())); |
| | | transitionService.deletedTbTransitionByTjNum(tjNum); |
| | | ycxmService.delOrderYcXmJyByTjh(tjNum); |
| | | |
| | | TjCustomer customer = tjCustomerService.getById(order.getUserId()); |
| | | customer.setCardId("0"); |
| | |
| | | for (int i = 0; i < tjNumbers.size(); i++) { |
| | | String tjNumber = tjNumbers.get(i).getTjNumber(); |
| | | try { |
| | | List<Map<String, String>> djdInfos = tjOrderService.selectDjdInfo(tjNumber); |
| | | List<Map<String, Object>> djdInfos = tjOrderService.selectDjdInfo(tjNumber); |
| | | Map<String, Object> userInfo = tjOrderService.selectDjdUserInfo(tjNumber); |
| | | LocalDateTime tjsj = (LocalDateTime) userInfo.get("tjsj"); |
| | | DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); |
| | |
| | | log.info("退费申请 入参 -> {}", JSONUtil.toJsonStr(map)); |
| | | String post = HttpClientUtils.sendPost(apiUrl + "/api/his/" + hospbm + "/creatCostInfo", map); |
| | | log.info("退费申请 返回 -> {}", JSONUtil.toJsonStr(post)); |
| | | if(null !=post){ |
| | | if (null != post) { |
| | | JSONObject jsonObject = JSONUtil.parseObj(post); |
| | | if (jsonObject.getStr("code").equals("200")) { |
| | | // hisTfWaterId |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/chushenyemianyijianjiekou") |
| | | @ApiOperation(value = "初审页面弃检接口") |
| | | @Transactional |
| | | public AjaxResult chushenyemianyijianjiekou(@RequestParam String tjNUm, @RequestParam String proId) { |
| | | LambdaQueryWrapper<TjOrderRemark> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderRemark::getTjNumber, tjNUm); |
| | | wq.eq(TjOrderRemark::getProId, proId); |
| | | TjOrderRemark remark = remarkService.getOne(wq); |
| | | remark.setType(1); |
| | | remarkService.updateById(remark); |
| | | return AjaxResult.success("操作成功!"); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/zongjanyemianshjianzhou") |
| | | @ApiOperation(value = "总检获取时间轴接口") |
| | | @Transactional |
| | |
| | | a = 5; |
| | | } |
| | | if (null != lastTime) { |
| | | //已出报告 |
| | | //已打印 |
| | | a = 6; |
| | | } |
| | | map.put("tjNUm", tjNUm); |
| | |
| | | } |
| | | } |
| | | } |
| | | int i = tjReportService.deleteTjReportByReIds(list.toArray(new Long[]{})); |
| | | if (i == 0) { |
| | | return AjaxResult.error("撤回失败!"); |
| | | if (!list.isEmpty()) { |
| | | int i = tjReportService.deleteTjReportByReIds(list.toArray(new Long[]{})); |
| | | if (i == 0) { |
| | | return AjaxResult.error("撤回失败!"); |
| | | } |
| | | } |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | |
| | | return AjaxResult.error("操作失败! 以下项目已存在: " + string); |
| | | } |
| | | transitionService.ttsaveTemoTransitionByGroupingId(cusId, cardId, pacId.toString()); |
| | | //补差价 |
| | | List<Map<String, Object>> cjMaps = groupingProService.huoquxiangmuchajia(pacId.toString(), cusId); |
| | | if (null != cjMaps && !cjMaps.isEmpty()) { |
| | | for (Map<String, Object> cjMap : cjMaps) { |
| | | transitionService.buxiangmuchajia(cusId, pacId.toString(), cjMap.get("xmid").toString(), new BigDecimal(cjMap.get("cj").toString())); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | @GetMapping(value = "newgetTransitionList") |
| | | @ApiOperation(value = "最新查询过渡表数据") |
| | | public AjaxResult newgetTransitionList(@RequestParam @ApiParam(value = "客户id") String cusId) { |
| | | List<TbTransition> list= transitionService.newgetTransitionList(cusId); |
| | | // String pacId = transitionService.getTbTransitionPacId(cusId); |
| | | // if(StringUtil.isNotBlank(pacId)){ |
| | | // //补差价 |
| | | // List<Map<String,Object>> cjMaps = groupingProService.huoquxiangmuchajia(pacId, cusId); |
| | | // if(null !=cjMaps && !cjMaps.isEmpty()){ |
| | | // for (Map<String, Object> cjMap : cjMaps) { |
| | | // transitionService.buxiangmuchajia(cusId,pacId,cjMap.get("xmid").toString(),new BigDecimal(cjMap.get("cj").toString())); |
| | | // } |
| | | // } |
| | | // } |
| | | List<TbTransition> list = transitionService.newgetTransitionList(cusId); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | |
| | | @Transactional |
| | | public AjaxResult updateTransitionnewPrice(@RequestBody List<UpdateTransitionnewPriceDto> dtos) { |
| | | |
| | | if(null !=dtos && !dtos.isEmpty()){ |
| | | if (null != dtos && !dtos.isEmpty()) { |
| | | int index = 0; |
| | | boolean flag = false; |
| | | for (UpdateTransitionnewPriceDto dto : dtos) { |
| | | LambdaQueryWrapper<TbTransition> wq=new LambdaQueryWrapper<>(); |
| | | wq.eq(TbTransition::getCusId,dto.getCusIdCard()); |
| | | wq.eq(TbTransition::getParentProId,dto.getParentProId()); |
| | | index++; |
| | | LambdaQueryWrapper<TbTransition> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TbTransition::getCusId, dto.getCusIdCard()); |
| | | wq.eq(TbTransition::getParentProId, dto.getParentProId()); |
| | | wq.isNull(TbTransition::getTjNum); |
| | | List<TbTransition> list = transitionService.list(wq); |
| | | log.info("修改的客户身份证号为: "+dto.getCusIdCard()); |
| | | log.info("父项目id为: "+dto.getParentProId()); |
| | | log.info("折扣为: "+new BigDecimal(dto.getDiscount())); |
| | | if(null !=list && !list.isEmpty()){ |
| | | BigDecimal dxzj = transitionService.getTbTransitionPriceAndOrdPrice(dto.getCusIdCard(),dto.getParentProId()); |
| | | log.info("修改的客户身份证号为: " + dto.getCusIdCard()); |
| | | log.info("父项目id为: " + dto.getParentProId()); |
| | | log.info("折扣为: " + new BigDecimal(dto.getDiscount())); |
| | | if (null != list && !list.isEmpty()) { |
| | | |
| | | for (TbTransition transition : list) { |
| | | BigDecimal ordPrice = transition.getOrdPrice(); |
| | | BigDecimal multiply = ordPrice.multiply((new BigDecimal(dto.getDiscount()).divide(BigDecimal.valueOf(10)))); |
| | | log.info("后端计算的金额: "+multiply); |
| | | log.info("后端计算的金额: " + multiply.toString()); |
| | | 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); |
| | | |
| | | BigDecimal dxzj = transitionService.getTbTransitionPriceAndOrdPrice(dto.getCusIdCard(), dto.getParentProId()); |
| | | |
| | | BigDecimal yhj = dto.getYhj(); |
| | | log.info("前端传递的价格:{}",yhj.toString()); |
| | | BigDecimal cj = yhj.subtract(dxzj); |
| | | log.info("计算的差价:{}",cj.toString()); |
| | | for (TbTransition transition : list) { |
| | | BigDecimal result = transition.getNowPrice().add(cj); |
| | | log.info("补上差价前的价格为:{}",transition.getNowPrice().toString()); |
| | | if (result.compareTo(BigDecimal.ZERO)>0 && !flag && cj.compareTo(BigDecimal.ZERO) != 0){ |
| | | transition.setNowPrice(result); |
| | | transitionService.updateById(transition); |
| | | log.info("修改 补上差价后的价格为:{}",result.toString()); |
| | | flag = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/huifuyuyuejilu") |
| | | @ApiOperation(value = "体检记录页面恢复预约记录接口") |
| | | @Transactional |
| | | public AjaxResult huifuyuyuejilu(@RequestBody List<String> tjNUms) { |
| | | |
| | | if (null != tjNUms && !tjNUms.isEmpty()) { |
| | | for (String tjNUm : tjNUms) { |
| | | TjOrder order = tjOrderService.getOrderByTjNum(tjNUm); |
| | | if(null !=order && StringUtil.isNotBlank(order.getReservationId())){ |
| | | //这里删除的是这个人所有项目包括补录项目 |
| | | tjOrderService.deleteTjOrderByOrderId(order.getOrderId()); |
| | | tjOrderDetailService.deleteTjOrderDetailByOrderDetailId(String.valueOf(order.getOrderId())); |
| | | remarkService.deletedOrderRemarkByTjNum(tjNUm); |
| | | tjFlowingWaterService.deleteTjFlowingWaterByOrderId(String.valueOf(order.getOrderId())); |
| | | // transitionService.deletedTbTransitionByTjNum(tjNum); |
| | | tjSamplingMapper.deleteByTjNumAndCusId(order.getTjNumber(), order.getUserId()); |
| | | |
| | | TjReservation reservation = tjReservationService.getById(order.getReservationId()); |
| | | if(null !=reservation){ |
| | | reservation.setIsExpire(2); |
| | | tjReservationService.updateById(reservation); |
| | | transitionService.updateTbTransitionByTjNum(tjNUm); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/addBlTransition") |
| | | @ApiOperation(value = "补录添加过渡表数据") |
| | | @Transactional |
| | | public AjaxResult addBlTransition(@RequestBody Map<String, Object> map) { |
| | | Object packId = map.get("pacId"); |
| | | if (null == map.get("cusId")) return AjaxResult.error("请选择体检人"); |
| | | String cusId = map.get("cusId").toString(); |
| | | Object proIds1 = map.get("proIds"); |
| | | List<Long> proIds = null; |
| | | if (null != proIds1 && !proIds1.equals("")) { |
| | | proIds = JSON.parseArray(proIds1.toString(), Long.class); |
| | | } |
| | | TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusId); |
| | | String cardId = "0"; |
| | | if (null != tjCustomer) { |
| | | cardId = tjCustomer.getCardId(); |
| | | } |
| | | if ((null == proIds || proIds.isEmpty()) && (null == packId || packId.equals(""))) { |
| | | transitionService.deletedTbTransitionByCusId(cusId); |
| | | } |
| | | |
| | | //单项 |
| | | if (null != proIds && !proIds.isEmpty()) { |
| | | //异步保存数据库表 |
| | | for (Long proId : proIds) { |
| | | TjProject project = projectService.selectTjProjectByProId(proId); |
| | | if (null != project) { |
| | | List<TbTransition> transitionList = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId)); |
| | | if (null == transitionList || transitionList.isEmpty()) { |
| | | transitionService.saveRedisTransitionByProId(cusId, cardId, proId); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| | | |