| | |
| | | TjCustomer tjCustomer = tjCustomerService.getById(order.getUserId()); |
| | | if (null != tjCustomer) { |
| | | order.setTjCustomerSex(tjCustomer.getCusSex()); |
| | | order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | if(null !=tjCustomer.getCusBrithday()) |
| | | order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | order.setTjCustomerName(tjCustomer.getCusName()); |
| | | order.setTjCustomerPhone(tjCustomer.getCusPhone()); |
| | | order.setTjCusIdCard(tjCustomer.getCusIdcard()); |
| | |
| | | TjCustomer tjCustomer = tjCustomerService.getById(order.getUserId()); |
| | | if (null != tjCustomer) { |
| | | order.setTjCustomerSex(tjCustomer.getCusSex()); |
| | | order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | if(null !=tjCustomer.getCusBrithday()) |
| | | order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | order.setTjCustomerName(tjCustomer.getCusName()); |
| | | order.setTjCustomerPhone(tjCustomer.getCusPhone()); |
| | | order.setTjCusIdCard(tjCustomer.getCusIdcard()); |
| | |
| | | boolean b = lock.tryLock(3, TimeUnit.MINUTES); |
| | | if (b) { |
| | | AjaxResult result = processOrderWithTransaction(tjOrder, tjCustomer, tjReservation, tjFlowingWater, mallOrder, sysUser); |
| | | if (!result.get("code").toString().equals("200")) |
| | | if (!result.get("code").toString().equals("200")) { |
| | | hisApiMethod.ZfHisApiMethod(tjOrder.getCardId()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | tjOrderService.tjQiandaodengji(tjOrder.getTjNumber()); |
| | | }else { |
| | | tjOrderService.tjQiandaodengji(tjOrder.getTjNumber()); |
| | | } |
| | | return result; |
| | | } |
| | | }catch (Exception e){ |
| | |
| | | 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; |
| | | if (!ajaxResult.get("code").toString().equals("200")){ |
| | | throw new IllegalStateException("团体申请单发送失败!" + result.get("msg").toString()); |
| | | // 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()); |
| | |
| | | ExecutorService threadPools = Executors.newFixedThreadPool(cusIds.size()); |
| | | for (String cusId : cusIds) { |
| | | |
| | | // threadPools.execute(new Runnable() { |
| | | // @Override |
| | | // public void run() { |
| | | try { |
| | | getAjaxResults(cusId); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | // } |
| | | // }); |
| | | } |
| | | LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); |
| | | wq.in(TjCustomer::getCusIdcard, cusIds); |
| | |
| | | // ExecutorService threadPool = Executors.newFixedThreadPool(list.size()); |
| | | ThreadPoolTaskExecutor executor = threadPoolConfig.threadPoolTaskExecutor(); |
| | | for (Long aLong : list) { |
| | | // threadPool.execute(new Runnable() { |
| | | // @Override |
| | | // public void run() { |
| | | // try { |
| | | // AjaxResult result = getAjaxResult(aLong, sysUser, daoDto.getTjCategory()); |
| | | // threadPool.shutdown(); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // }); |
| | | |
| | | Future<AjaxResult> future = executor.submit(new Callable<AjaxResult>() { |
| | | @Override |
| | | public AjaxResult call() throws Exception { |
| | |
| | | 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 (null != tjReservation.getTeamNo()) tjOrder.setTeamNo(tjReservation.getTeamNo()); |
| | | if (null != tjReservation.getCompanyId()) tjOrder.setFirmId(tjReservation.getCompanyId()); |
| | | if (null != tjReservation.getCompany()) tjOrder.setFirmName(tjReservation.getCompany()); |
| | |
| | | if (StringUtil.isBlank(tjOrder.getFirmId())) { |
| | | tjOrder.setFirmId("0"); |
| | | } |
| | | // |
| | | // tjReservation.setIsExpire(1); |
| | | // tjReservationService.updateById(tjReservation); |
| | | |
| | | //生成体检号 |
| | | // String tjNumber = (sysUser.getUserName() + new SimpleDateFormat("yyMMddHHmmss").format(new Date())); |
| | | // tjNumber = tjNumber.replaceAll(".{6}$", userId.toString().substring(userId.toString().length() - 6)); |
| | | |
| | | |
| | | //获取拼接前缀 |
| | | String makeLisTmhPrefix = configService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | // String tjNumber = (sysUser.getUserName() + idUtils.getTjNumber()); |
| | | // String tjNumber = idUtils.getTjNumber(); |
| | | String sfkqtjhqz = configService.selectConfigByKey("sfkqtjhqz"); |
| | | String makeLisTmhPrefix = ""; |
| | | if(sfkqtjhqz.equalsIgnoreCase("Y")){ |
| | | makeLisTmhPrefix = configService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | } |
| | | |
| | | String tjNumber = idUtils.getNewTjNumberRedisLockAndMysql(); |
| | | 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()); |
| | |
| | | obj.putOpt("pro_name", tbTransition.getProName()); |
| | | BigDecimal ordPrice = tbTransition.getOrdPrice(); |
| | | obj.putOpt("zongjia", ordPrice); |
| | | QueryWrapper<TjProject> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("pro_id", tbTransition.getProId()); |
| | | TjProject tjProject = projectService.getOne(queryWrapper); |
| | | // QueryWrapper<TjProject> queryWrapper = new QueryWrapper<>(); |
| | | // queryWrapper.eq("pro_id", tbTransition.getProId()); |
| | | // TjProject tjProject = projectService.getOne(queryWrapper); |
| | | TjProject tjProject = projectService.getTjProjectByIdNodel(tbTransition.getProId()); |
| | | Integer num = tjProject.getSl(); |
| | | obj.putOpt("num", num); |
| | | BigDecimal price = ordPrice.divide(new BigDecimal(num)); |
| | |
| | | } |
| | | |
| | | tjCustomer.setCardId("0"); |
| | | Long cusNumber = tjCustomer.getCusNumber(); |
| | | cusNumber -= 1; |
| | | tjCustomer.setCusNumber(cusNumber); |
| | | tjCustomerService.updateById(tjCustomer); |
| | | tjOrderService.removeById(order.getOrderId()); |
| | | return AjaxResult.success("撤销成功"); |
| | |
| | | @GetMapping(value = "newgetTransitionList") |
| | | @ApiOperation(value = "最新查询过渡表数据") |
| | | public AjaxResult newgetTransitionList(@RequestParam @ApiParam(value = "客户id") String cusId) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<TbTransition> list = transitionService.newgetTransitionList(cusId); |
| | | return AjaxResult.success(list); |
| | | map.put("list", list); |
| | | map.put("tjCategory", transitionService.getTjCategoryByTbTransition(cusId)); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | @PostMapping(value = "updateTransitionnewPrice") |