| | |
| | | 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("已打印"); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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())); |
| | |
| | | }*/ |
| | | // 查询 对接Lis、Pacs申请如果类型包含在配置内则使用对接lis、pacs |
| | | if (lisApiMethod.isUseLisAndPacsRegister(tjOrder)) { |
| | | log.info("调用his开启 进入不收费方法 该体检人员不收费:"+tjOrder.getTjNumber()); |
| | | // 这是上面个人方法引入数据 |
| | | tjFlowingWater.setPayStasus(1L); |
| | | 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; |
| | | 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; |
| | | 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); |
| | | 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); |
| | |
| | | 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); |
| | |
| | | a = 5; |
| | | } |
| | | if (null != lastTime) { |
| | | //已出报告 |
| | | //已打印 |
| | | a = 6; |
| | | } |
| | | map.put("tjNUm", tjNUm); |
| | |
| | | public AjaxResult updateTransitionnewPrice(@RequestBody List<UpdateTransitionnewPriceDto> dtos) { |
| | | |
| | | if (null != dtos && !dtos.isEmpty()) { |
| | | int index = 0; |
| | | boolean flag = false; |
| | | for (UpdateTransitionnewPriceDto dto : dtos) { |
| | | index++; |
| | | LambdaQueryWrapper<TbTransition> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TbTransition::getCusId, dto.getCusIdCard()); |
| | | wq.eq(TbTransition::getParentProId, dto.getParentProId()); |
| | |
| | | log.info("父项目id为: " + dto.getParentProId()); |
| | | log.info("折扣为: " + new BigDecimal(dto.getDiscount())); |
| | | if (null != list && !list.isEmpty()) { |
| | | BigDecimal dxzj = transitionService.getTbTransitionPriceAndOrdPrice(dto.getCusIdCard(), dto.getParentProId()); |
| | | |
| | | 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()); |
| | | // int index1 = 0; |
| | | for (TbTransition transition : list) { |
| | | // BigDecimal ordPrice = transition.getOrdPrice(); |
| | | // BigDecimal multiply = ordPrice.multiply((new BigDecimal(dto.getDiscount()).divide(BigDecimal.valueOf(10)))); |
| | | 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; |
| | | } |
| | | // 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); |
| | | } |
| | | |
| | | // 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)))); |
| | | // 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); |
| | | // } |
| | | // }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); |
| | | //// } |
| | | //// } |
| | | // } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | 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(); |
| | | } |
| | | } |
| | | |