| | |
| | | package com.ruoyi.admin.controller; |
| | | |
| | | |
| | | import cn.hutool.http.HttpStatus; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.*; |
| | | import com.ruoyi.admin.importExcel.DemoDataListener; |
| | | import com.ruoyi.admin.importExcel.FrozenBuckleImportDTO; |
| | | import com.ruoyi.admin.netty.NettyChannelMap; |
| | | import com.ruoyi.admin.netty.NettyWebSocketController; |
| | | import com.ruoyi.admin.service.*; |
| | | import com.ruoyi.admin.utils.DescribeInstances; |
| | | import com.ruoyi.admin.utils.HttpUtil; |
| | | import com.ruoyi.admin.vo.OrderByServeRecordVO; |
| | | import com.ruoyi.admin.vo.OrderDetailVO; |
| | | import com.ruoyi.admin.vo.OrderReasinDto; |
| | |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.utils.GaoDeMapUtil; |
| | | import com.ruoyi.common.core.utils.SnowflakeIdWorker; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.vo.CityInfoVO; |
| | | import com.ruoyi.common.core.vo.PaperInVo; |
| | | import com.ruoyi.common.core.vo.PrintDto; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | |
| | | import java.io.*; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author hjl |
| | | * @since 2024-05-29 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/order") |
| | | @Api(tags = {"后台-订单管理"}) |
| | |
| | | |
| | | |
| | | Page<Order> data = orderClient.queryPage(orderQueryRequest).getData(); |
| | | List<MasterWorker> list = masterWorkerService.lambdaQuery() |
| | | .eq(MasterWorker::getIsDelete, 0).list(); |
| | | if (null != data) { |
| | | for (Order record : data.getRecords()) { |
| | | // 回收服务信息 |
| | | Integer serverId = record.getServerId(); |
| | | MasterWorker masterWorker = masterWorkerService.lambdaQuery() |
| | | .eq(MasterWorker::getId, serverId) |
| | | .eq(MasterWorker::getIsDelete, 0).one(); |
| | | MasterWorker masterWorker = list.stream().filter(e -> e.getId().equals(serverId)).findFirst().orElse(null); |
| | | if (null != masterWorker) { |
| | | record.setServerName(masterWorker.getRealName()); |
| | | record.setServerPhone(masterWorker.getPhone()); |
| | |
| | | order.setServerName(masterWorker.getRealName()); |
| | | order.setServerPhone(masterWorker.getPhone()); |
| | | order.setAcceptTime(new Date()); |
| | | // 待上门 |
| | | order.setState(Constants.ONE); |
| | | // 待上门 2.0 改为待预约 |
| | | order.setState(7); |
| | | } else { |
| | | // 待派单状态 |
| | | order.setState(Constants.ZERO); |
| | |
| | | .eq(Site::getIsDelete, 0).one(); |
| | | if (null != site) { |
| | | order.setSiteName(site.getSiteName()); |
| | | } |
| | | |
| | | Order orderData = orderClient.detail(order.getOrderId()).getData(); |
| | | |
| | | if(order.getTime()!=null&& order.getServerId()!=null&&(!order.getTime().equals(orderData.getTime()) || !order.getServerId().equals(orderData.getServerId()))){ |
| | | // 修改sys_change_dispatch 为已改派 |
| | | dispatchClient.changeReason(order.getOrderId(),""); |
| | | } |
| | | |
| | | // 师傅信息 |
| | |
| | | // 订单派单 |
| | | boolean result = true; |
| | | if (Constants.TWO.equals(orderId.getType())) { |
| | | orderClient.updateArrivalTime(order.getId(),orderReasinDto.getArriveTime()); |
| | | |
| | | if (order.getState().equals(Constants.SIX) || order.getState().equals(Constants.THREE)) { |
| | | orderClient.updateState(order.getId(), Constants.ONE); |
| | | orderClient.updateState(order.getId(), 7); |
| | | |
| | | //如果是待改派,将上门时间设置为最新的,并且更新再投原因 |
| | | if (order.getState().equals(Constants.SIX)){ |
| | | dispatchClient.changeReason(order.getId(), orderReasinDto.getReason()); |
| | | orderClient.updateArrivalTime(order.getId(),orderReasinDto.getArriveTime()); |
| | | dispatchClient.changeReason(order.getId(), ""); |
| | | } |
| | | |
| | | } |
| | |
| | | // changeDispatch.setUserName(item.getReservationName()); |
| | | // changeDispatch.setIsDelete(Constants.ZERO); |
| | | // result = dispatchClient.saveRecord(changeDispatch).getData(); |
| | | }else { |
| | | orderClient.updateArrivalTime(order.getId(),orderReasinDto.getArriveTime()); |
| | | orderClient.updateState(order.getId(), 7); |
| | | } |
| | | ChannelHandlerContext context = NettyChannelMap.getData(String.valueOf(orderReasinDto.getWorkerId())); |
| | | if (null != context) { |
| | |
| | | @ApiOperation(value = "订单列表-excel导出", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/excelExport") |
| | | public R<String> excelExport(@RequestBody OrderQueryRequest orderQueryRequest, HttpServletResponse response) { |
| | | |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | if (loginUser.getIsFranchisee()) { |
| | | if (null == orderQueryRequest.getCityList() || orderQueryRequest.getCityList().isEmpty()) { |
| | | orderQueryRequest.setCityList(loginUser.getCityList()); |
| | | } else { |
| | | orderQueryRequest.getCityList().addAll(loginUser.getCityList()); |
| | | } |
| | | } |
| | | List<Integer> servIds = new ArrayList<>(); |
| | | if (orderQueryRequest.getClassNameId()!=null){ |
| | | List<Integer> classIds = recoveryClassifyService.lambdaQuery().eq(RecoveryClassify::getId, orderQueryRequest.getClassNameId()).list().stream().map(RecoveryClassify::getId).collect(Collectors.toList()); |
| | | servIds = recoveryServeService.lambdaQuery().eq(BaseEntity::getIsDelete,0).in(RecoveryServe::getClassifyId, classIds).list().stream().map(RecoveryServe::getId).collect(Collectors.toList()); |
| | | } |
| | | if(orderQueryRequest.getServeId()!=null){ |
| | | servIds.add(orderQueryRequest.getServeId()); |
| | | } |
| | | orderQueryRequest.setServIds(servIds); |
| | | Integer franchiseeId = loginUser.getSysUser().getFranchiseeId(); |
| | | if (franchiseeId!=null) { |
| | | Franchisee byId = franchiseeService.getById(franchiseeId); |
| | | String[] siteIds = byId.getSiteIds().split(","); |
| | | orderQueryRequest.setSiteIds(siteIds); |
| | | if (loginUser.getIsFranchisee() && siteIds.length == 0) { |
| | | return orderService.excelExport(new ArrayList<>(), response); |
| | | } |
| | | } |
| | | |
| | | // List<Integer> servIds = new ArrayList<>(); |
| | | // if (orderQueryRequest.getClassNameId()!=null){ |
| | | // List<Integer> classIds = recoveryClassifyService.lambdaQuery().eq(RecoveryClassify::getId, orderQueryRequest.getClassNameId()).list().stream().map(RecoveryClassify::getId).collect(Collectors.toList()); |
| | | // servIds = recoveryServeService.lambdaQuery().eq(BaseEntity::getIsDelete,0).in(RecoveryServe::getClassifyId, classIds).list().stream().map(RecoveryServe::getId).collect(Collectors.toList()); |
| | | // } |
| | | // orderQueryRequest.setServIds(servIds); |
| | | |
| | | |
| | | R<List<Order>> result = orderClient.excelExport(orderQueryRequest); |
| | | for (Order datum : result.getData()) { |
| | | if(StringUtils.hasLength(datum.getServerName())){ |
| | | datum.setServerName(datum.getServerName().charAt(0)+"***"); |
| | | } |
| | | if(StringUtils.hasLength(datum.getServerPhone())){ |
| | | datum.setServerPhone(around(datum.getServerPhone(), 3, 4)); |
| | | } |
| | | } |
| | | // 独立orderService |
| | | return orderService.excelExport(result.getData(), response); |
| | | } |
| | | |
| | | private static String around(String str, int left, int right){ |
| | | if (str == null || (str.length() < left + right +1)){ |
| | | return str; |
| | | } |
| | | String regex = String.format("(?<=\\w{%d})\\w(?=\\w{%d})", left, right); |
| | | return str.replaceAll(regex, "*"); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Page<OrderCountVO>> orderCount(String name, String phone, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | public R<Page<OrderCountVO>> orderCount(@RequestBody OrderCountDataRequest orderCountDataRequest) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | List<String> cityList = new ArrayList<>(); |
| | | if (loginUser.getIsFranchisee()) { |
| | | cityList = loginUser.getCityList(); |
| | | if (orderCountDataRequest.getCityList().isEmpty()) { |
| | | List<String> cityList = new ArrayList<>(); |
| | | if (loginUser.getIsFranchisee()) { |
| | | cityList = loginUser.getCityList(); |
| | | orderCountDataRequest.setCityList(cityList); |
| | | } |
| | | } |
| | | // 查询参数 |
| | | OrderCountDataRequest orderCountDataRequest = new OrderCountDataRequest(); |
| | | orderCountDataRequest.setWorkerName(name); |
| | | orderCountDataRequest.setWorkerPhone(phone); |
| | | orderCountDataRequest.setCityList(cityList); |
| | | orderCountDataRequest.setPageNum(pageNum); |
| | | orderCountDataRequest.setPageSize(pageSize); |
| | | |
| | | |
| | | |
| | | Integer franchiseeId = loginUser.getSysUser().getFranchiseeId(); |
| | |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | @ApiOperation(value = "地图统计", tags = {"后台-订单管理-地图统计"}) |
| | | @ApiOperation(value = "地图统计", tags = {"后台-订单管理-地图统计[2.0]"}) |
| | | @PostMapping(value = "/map/works") |
| | | public R<List<MasterWorker>> map(String cityCode,String name) { |
| | | |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | // if (null == loginUser) { |
| | | // return R.loginExpire("登录失效!"); |
| | | // } |
| | | if (cityCode==null) { |
| | | if (loginUser.getIsFranchisee()) { |
| | | if (loginUser!=null&&loginUser.getIsFranchisee()) { |
| | | cityCode = loginUser.getCityList().get(0); |
| | | } else { |
| | | cityCode = "420100"; |
| | |
| | | if (workIds==null||workIds.isEmpty()){ |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | List<MasterWorker> list = masterWorkerService.lambdaQuery().in(MasterWorker::getId, workIds).eq(name!=null&&name!="",MasterWorker::getRealName,name).eq(cityCode!=null&&cityCode!="", MasterWorker::getCityCode,cityCode).list(); |
| | | List<MasterWorker> list = masterWorkerService.lambdaQuery() |
| | | .in(MasterWorker::getId, workIds) |
| | | .eq(name!=null&&name!="",MasterWorker::getRealName,name) |
| | | .eq(cityCode!=null&&cityCode!=""&&!cityCode.contains("0000"), MasterWorker::getCityCode,cityCode).list(); |
| | | for (MasterWorker masterWorker : list) { |
| | | masterWorker.setLacation(redisService.getCacheObject("work:"+masterWorker.getId()+":")); |
| | | } |
| | |
| | | |
| | | @ApiOperation(value = "获师傅", tags = {"后台-订单管理-地图统计"}) |
| | | @PostMapping(value = "/map/line") |
| | | public R<List<OrderByServeRecordVO>> line(Integer id) { |
| | | public R<Map<String,Object>> line(Integer id) { |
| | | |
| | | Map<String,Object> map = new HashMap<>(); |
| | | |
| | | List<OrderByServeRecordVO> list = new ArrayList<>(); |
| | | // 获取当天时间 |
| | | String today = DateUtils.dateTimeNow("yyyy-MM-dd"); |
| | |
| | | } |
| | | list.add(orderByServeRecord); |
| | | } |
| | | return R.ok(list); |
| | | map.put("orderByServeRecordVO", list); |
| | | MasterWorker masterWorker = masterWorkerService.getById(id); |
| | | map.put("masterWorker", masterWorker); |
| | | |
| | | return R.ok(map); |
| | | } |
| | | |
| | | /** |
| | |
| | | // return R.ok(list); |
| | | // } |
| | | |
| | | @ApiOperation(value = "导入模板下载", tags = {"管理后台"}) |
| | | @PostMapping(value = "/importTemplate") |
| | | public R<String> importTemplate(HttpServletResponse response) throws Exception { |
| | | List<FrozenBuckleImportDTO> list = new ArrayList<>(); |
| | | FrozenBuckleImportDTO bean = new FrozenBuckleImportDTO(); |
| | | list.add(bean); |
| | | // 这里URLEncoder.encode可以防止中文乱码 |
| | | String fileName = URLEncoder.encode("订单导入模板", "UTF-8"); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | EasyExcel.write(response.getOutputStream(), FrozenBuckleImportDTO.class).sheet("订单导入模板").doWrite(list); |
| | | return R.ok("下载成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 管理后台-订单导入 |
| | | */ |
| | | @ApiOperation(value = "订单导入", tags = {"管理后台"}) |
| | | @PostMapping(value = "/importOrder") |
| | | public R<String> importOrder(@RequestParam("file") MultipartFile file) { |
| | | |
| | | if (!file.isEmpty()) { |
| | | //文件名称 |
| | | int begin = Objects.requireNonNull(file.getOriginalFilename()).indexOf("."); |
| | | //文件名称长度 |
| | | int last = file.getOriginalFilename().length(); |
| | | //判断文件格式是否正确 |
| | | String fileName = file.getOriginalFilename().substring(begin, last); |
| | | if (!fileName.endsWith(".xls") && !fileName.endsWith(".xlsx")) { |
| | | throw new IllegalArgumentException("上传文件格式错误"); |
| | | } |
| | | } else { |
| | | throw new IllegalArgumentException("文件不能为空"); |
| | | } |
| | | try (InputStream inputStream = file.getInputStream()) { |
| | | return simpleRead(inputStream); |
| | | } catch (IOException e) { |
| | | System.out.println(e.getMessage()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 批量修改订单时间 |
| | | * @param ids 站点多条id拼接 |
| | | */ |
| | | @ApiOperation(value = "订单列表-批量修改订单时间", tags = {"后台-订单管理[2.0]"}) |
| | | @GetMapping(value = "/batchOrderUpdateTime") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "多个id ',' 拼接", name = "ids", dataType = "String", required = true), |
| | | @ApiImplicitParam(value = "修改上门时间", name = "time", dataType = "String", required = true), |
| | | }) |
| | | public R<Boolean> batchOrderUpdateTime(@RequestParam("ids") String ids, @RequestParam("time") String time) { |
| | | orderClient.batchUpdateTime(ids, time); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 最简单的读的监听器 |
| | | */ |
| | | private R<String> simpleRead(InputStream inputStream){ |
| | | //获取正确数据 |
| | | ArrayList<FrozenBuckleImportDTO> successArrayList = new ArrayList<>(); |
| | | //获取错误数据 |
| | | EasyExcel.read(inputStream) |
| | | .head(FrozenBuckleImportDTO.class) |
| | | .registerReadListener(new DemoDataListener( |
| | | // 监听器中doAfterAllAnalysed执行此方法;所有读取完成之后处理逻辑 |
| | | successArrayList::addAll)) |
| | | // 设置sheet,默认读取第一个 |
| | | .sheet() |
| | | // 设置标题(字段列表)所在行数 |
| | | .headRowNumber(1) |
| | | .doRead(); |
| | | System.err.println(successArrayList); |
| | | |
| | | List<Site> sites = siteService.list(Wrappers.lambdaQuery(Site.class).eq(Site::getIsDelete, 0)); |
| | | List<MasterWorker> masterWorkers = masterWorkerService.list(Wrappers.lambdaQuery(MasterWorker.class).eq(MasterWorker::getIsDelete, 0)); |
| | | List<RecoveryServe> recoveryServes =recoveryServeService.list(Wrappers.lambdaQuery(RecoveryServe.class).eq(RecoveryServe::getIsDelete, 0)); |
| | | |
| | | for (FrozenBuckleImportDTO frozenBuckleImportDTO : successArrayList) { |
| | | OrderRequest order = new OrderRequest(); |
| | | BeanUtils.copyProperties(frozenBuckleImportDTO,order); |
| | | String province = frozenBuckleImportDTO.getProvince(); |
| | | String city = frozenBuckleImportDTO.getCity(); |
| | | String area = frozenBuckleImportDTO.getArea(); |
| | | String address = frozenBuckleImportDTO.getReservationAddress(); |
| | | |
| | | String time = frozenBuckleImportDTO.getTime(); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | try{ |
| | | format.parse(time); |
| | | }catch (Exception e){ |
| | | throw new ServiceException("上门时间格式错误"); |
| | | } |
| | | |
| | | if(!StringUtils.hasLength(address)){ |
| | | return R.fail("详细地址不能为空"); |
| | | } |
| | | // 解析地址经纬度 |
| | | CityInfoVO cityInfoVO = GaoDeMapUtil.getAddressInfo((province==null?"":province) |
| | | + (city==null?"":city) |
| | | + (area==null?"":area) |
| | | + address).getDatas(); |
| | | if(cityInfoVO==null||Objects.isNull(cityInfoVO.getLongitude()) || Objects.isNull(cityInfoVO.getLatitude())){ |
| | | return R.fail("地址输入不正确"); |
| | | } |
| | | String areaCode = cityInfoVO.getCode(); |
| | | String provinceCode = areaCode.substring(0, 2) + "0000"; |
| | | String cityCode = areaCode.substring(0, 4) + "00"; |
| | | order.setProvinceCode(provinceCode); |
| | | order.setCityCode(cityCode); |
| | | order.setAreaCode(areaCode); |
| | | order.setLongitude(cityInfoVO.getLongitude()); |
| | | order.setLatitude(cityInfoVO.getLatitude()); |
| | | if (!StringUtils.hasLength(city)){ |
| | | order.setCity(cityInfoVO.getCity()); |
| | | } |
| | | // 站点信息 |
| | | Site site = sites.stream().filter(e -> e.getSiteName().equals(frozenBuckleImportDTO.getSiteName())).findFirst().orElse(null); |
| | | if(Objects.nonNull(site)){ |
| | | order.setSiteId(site.getId()); |
| | | }else { |
| | | return R.fail("站点信息不存在"); |
| | | } |
| | | // 师傅信息 |
| | | if (StringUtils.hasLength(order.getServerName())) { |
| | | MasterWorker masterWorker = masterWorkers.stream().filter(e -> e.getRealName().equals(frozenBuckleImportDTO.getServerName())).findFirst().orElse(null); |
| | | if(Objects.nonNull(masterWorker)){ |
| | | order.setServerId(masterWorker.getId()); |
| | | order.setServerPhone(masterWorker.getPhone()); |
| | | }else { |
| | | return R.fail("师傅信息不存在"); |
| | | } |
| | | order.setAcceptTime(new Date()); |
| | | // 待上门 |
| | | order.setState(Constants.ONE); |
| | | } else { |
| | | // 待派单状态 |
| | | order.setState(Constants.ZERO); |
| | | } |
| | | // 后台订单 |
| | | order.setType(Constants.ONE); |
| | | order.setSubsidy(BigDecimal.ZERO); |
| | | order.setOrderNumber(String.valueOf(SNOW_FLAKE_ID_WORKER.nextId())); |
| | | // 回收服务信息 |
| | | RecoveryServe recoveryServe = recoveryServes.stream().filter(e->e.getServeName().equals(frozenBuckleImportDTO.getServeName())).findFirst().orElse(null); |
| | | if(Objects.nonNull(recoveryServe)){ |
| | | order.setServeId(recoveryServe.getId()); |
| | | order.setServePrice(recoveryServe.getDefaultPrice()); |
| | | }else { |
| | | return R.fail("服务信息不存在"); |
| | | } |
| | | RecoveryServePrice one = recoveryServePriceService.lambdaQuery().eq(RecoveryServePrice::getCity, order.getCityCode()).eq(RecoveryServePrice::getRecoveryServeId, order.getServeId()).eq(BaseEntity::getIsDelete, 0).one(); |
| | | if (one==null) { |
| | | order.setOrderMoney(recoveryServe.getDefaultPrice()); |
| | | }else { |
| | | order.setOrderMoney(one.getRecoveryPrice()); |
| | | } |
| | | Boolean data = orderClient.save(order).getData(); |
| | | if (null == data) { |
| | | return R.fail(orderClient.save(order).getMsg()); |
| | | } |
| | | System.out.println("服务人员id:" + order.getServerId()); |
| | | ChannelHandlerContext context = NettyChannelMap.getData(String.valueOf(order.getServerId())); |
| | | System.out.println("socket连接信息:" + context); |
| | | if (null != context) { |
| | | System.out.println("服务端发送消息到: " + order.getServerId()); |
| | | NettyWebSocketController.sendMsgToClient(context, "您有一条新的订单,请注意查收!"); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |