| | |
| | | package com.dsh.guns.modular.system.controller.system; |
| | | |
| | | import com.alibaba.nacos.common.utils.Md5Utils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.dsh.course.dto.JsDto; |
| | | import com.dsh.course.dto.StudentQeryDto; |
| | | import com.dsh.course.entity.SiteLock; |
| | | import com.dsh.course.feignClient.account.AppUserClient; |
| | | import com.dsh.course.feignClient.account.CityManagerClient; |
| | | import com.dsh.course.feignClient.account.CoachClient; |
| | |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.audit.ManagementAuditWriter; |
| | | import com.dsh.guns.modular.system.controller.util.MD5; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.model.dto.*; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import com.dsh.guns.modular.system.util.*; |
| | | import com.dsh.course.entity.SiteLock; |
| | | import com.google.gson.Gson; |
| | | import com.google.zxing.BarcodeFormat; |
| | | import com.google.zxing.EncodeHintType; |
| | | import com.google.zxing.WriterException; |
| | | import com.google.zxing.client.j2se.MatrixToImageWriter; |
| | | import com.google.zxing.common.BitMatrix; |
| | | import com.google.zxing.qrcode.QRCodeWriter; |
| | | import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; |
| | | import org.apache.commons.fileupload.FileItem; |
| | | import org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.json.JSONArray; |
| | | import org.json.JSONObject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.imageio.ImageIO; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.math.BigDecimal; |
| | | |
| | | import java.nio.file.FileSystems; |
| | | import java.nio.file.Path; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | |
| | | @RequestMapping("/ball") |
| | | public class BallController extends BaseController { |
| | | private String PREFIX = "/system/ball/"; |
| | | @Resource |
| | | private BallClient ballClient; |
| | | @Resource |
| | | private BallClient ballClient; |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Resource |
| | | private ManagementAuditWriter auditWriter; |
| | | |
| | | @RequestMapping("/tolist") |
| | | public String tolist(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list", list); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",roleid); |
| | | model.addAttribute("role", roleid); |
| | | |
| | | return PREFIX+"ball.html"; |
| | | return PREFIX + "ball.html"; |
| | | } |
| | | |
| | | //入园方式 |
| | | @RequestMapping("/joinmethod/{id}") |
| | | public String joinmethod(Model model,@PathVariable("id") Integer id) { |
| | | public String joinmethod(Model model, @PathVariable("id") Integer id) { |
| | | |
| | | |
| | | model.addAttribute("id",id); |
| | | model.addAttribute("id", id); |
| | | |
| | | return PREFIX+"join.html"; |
| | | return PREFIX + "join.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/selectJoin") |
| | | @ResponseBody |
| | | public ResultUtil join(@RequestBody MethodDto method) { |
| | | if (method == null || method.getId() == null) { |
| | | return ResultUtil.error("门票记录不能为空"); |
| | | } |
| | | SiteBooking before = iSiteBookingService.getById(method.getId()); |
| | | if (before == null) { |
| | | return ResultUtil.error("门票记录不存在"); |
| | | } |
| | | Integer previousStatus = before.getStatus(); |
| | | if (!Objects.equals(previousStatus, 1) && !Objects.equals(previousStatus, 4)) { |
| | | return ResultUtil.error("当前门票状态不能确认到店"); |
| | | } |
| | | |
| | | System.out.println("============"+method); |
| | | // 待核销正常确认到店;已过期但运营确认用户实际入场时,直接人工完成。 |
| | | Integer targetStatus = Objects.equals(previousStatus, 4) ? 3 : 2; |
| | | SiteBooking siteBooking = new SiteBooking(); |
| | | siteBooking.setStatus(2); |
| | | siteBooking.setStatus(targetStatus); |
| | | siteBooking.setId(method.getId()); |
| | | siteBooking.setGoType(method.getMethod()); |
| | | iSiteBookingService.updateById(siteBooking); |
| | | try { |
| | | // 以修改前状态作为条件,避免并发操作覆盖其他状态变更。 |
| | | boolean updated = iSiteBookingService.update(siteBooking, |
| | | new LambdaUpdateWrapper<SiteBooking>() |
| | | .eq(SiteBooking::getId, before.getId()) |
| | | .eq(SiteBooking::getStatus, previousStatus)); |
| | | if (!updated) { |
| | | appendTicketStatusAudit(before, targetStatus, method.getMethod(), "FAIL", "门票状态更新失败"); |
| | | return ResultUtil.error("确认到店失败"); |
| | | } |
| | | appendTicketStatusAudit(before, targetStatus, method.getMethod(), "SUCCESS", null); |
| | | } catch (RuntimeException ex) { |
| | | appendTicketStatusAudit(before, targetStatus, method.getMethod(), "FAIL", ex.getMessage()); |
| | | throw ex; |
| | | } |
| | | |
| | | return new ResultUtil<>(0,0,"到店成功",null,null); |
| | | return new ResultUtil<>(0, 0, "到店成功", null, null); |
| | | } |
| | | |
| | | /** 记录运营管理员人工确认到店导致的门票状态变更。 */ |
| | | private void appendTicketStatusAudit(SiteBooking before, Integer targetStatus, Integer goType, |
| | | String result, String errorMessage) { |
| | | try { |
| | | Map<String, Object> beforeData = new HashMap<>(); |
| | | beforeData.put("id", before.getId()); |
| | | beforeData.put("orderNo", before.getOrderNo()); |
| | | beforeData.put("status", before.getStatus()); |
| | | beforeData.put("statusName", ticketStatusName(before.getStatus())); |
| | | |
| | | Map<String, Object> afterData = new HashMap<>(beforeData); |
| | | afterData.put("status", targetStatus); |
| | | afterData.put("statusName", ticketStatusName(targetStatus)); |
| | | afterData.put("goType", goType); |
| | | |
| | | Map<String, Object> audit = new HashMap<>(); |
| | | audit.put("traceId", UUID.randomUUID().toString().replace("-", "")); |
| | | audit.put("sourceService", "mb-cloud-management"); |
| | | audit.put("sourceType", "HTTP"); |
| | | audit.put("operationType", "STATUS_CHANGE"); |
| | | audit.put("riskLevel", "CRITICAL"); |
| | | audit.put("operationName", "运营管理员人工修改门票状态"); |
| | | audit.put("requestMethod", "POST"); |
| | | audit.put("requestUri", "/ball/selectJoin"); |
| | | audit.put("requestParams", "id=" + before.getId() + ", goType=" + goType + ", targetStatus=" + targetStatus); |
| | | audit.put("beforeData", com.alibaba.fastjson.JSONObject.toJSONString(beforeData)); |
| | | audit.put("afterData", com.alibaba.fastjson.JSONObject.toJSONString(afterData)); |
| | | audit.put("userId", UserExt.getUser() == null ? null : UserExt.getUser().getId()); |
| | | audit.put("userAccount", UserExt.getUser() == null ? null : UserExt.getUser().getAccount()); |
| | | audit.put("result", result); |
| | | audit.put("errorMessage", errorMessage); |
| | | // 审计表的 createdAt 即本次管理员操作时间。 |
| | | audit.put("createdAt", new Date()); |
| | | auditWriter.append(audit); |
| | | } catch (Exception ignored) { |
| | | // 审计失败不能阻断实际到店确认,网关日志可作为兜底。 |
| | | } |
| | | } |
| | | |
| | | private String ticketStatusName(Integer status) { |
| | | if (status == null) return "未知"; |
| | | switch (status) { |
| | | case 0: return "待支付"; |
| | | case 1: return "待核销"; |
| | | case 2: return "已到店"; |
| | | case 3: return "已完成"; |
| | | case 4: return "已过期"; |
| | | case 5: return "已取消"; |
| | | default: return "未知"; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/yunying") |
| | |
| | | public ResultUtil getUserSlect() { |
| | | |
| | | |
| | | List<SelectDto> selectDtos = storeService.getSelect(); |
| | | Map<String, List<SelectDto>> map = new HashMap<>(); |
| | | map.put("options", selectDtos); |
| | | |
| | | List<SelectDto> selectDtos = storeService.getSelect(); |
| | | Map<String,List<SelectDto>> map = new HashMap<>(); |
| | | map.put("options",selectDtos); |
| | | |
| | | System.out.println("=======selectDtos====="+selectDtos); |
| | | return new ResultUtil(0,0,"编辑成功",map,""); |
| | | System.out.println("=======selectDtos=====" + selectDtos); |
| | | return new ResultUtil(0, 0, "编辑成功", map, ""); |
| | | } |
| | | |
| | | //取消凭证页面 |
| | | @RequestMapping("/tocancel/{id}") |
| | | public String tocancel(Model model,@PathVariable("id") Integer id) { |
| | | public String tocancel(Model model, @PathVariable("id") Integer id) { |
| | | |
| | | model.addAttribute("id",id); |
| | | model.addAttribute("id", id); |
| | | |
| | | return PREFIX+"cancel.html"; |
| | | return PREFIX + "cancel.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/cancel") |
| | | @ResponseBody |
| | | public ResultUtil cancel(Integer id,String voucher,String textarea) { |
| | | public ResultUtil cancel(Integer id, String voucher, String textarea) { |
| | | |
| | | System.out.println("============"+id); |
| | | System.out.println("============" + id); |
| | | SiteBooking siteBooking = new SiteBooking(); |
| | | siteBooking.setId(id); |
| | | siteBooking.setStatus(5); |
| | |
| | | siteBooking.setCancelUserId(UserExt.getUser().getId()); |
| | | iSiteBookingService.updateById(siteBooking); |
| | | |
| | | return new ResultUtil<>(0,0,"到店成功",null,null); |
| | | return new ResultUtil<>(0, 0, "到店成功", null, null); |
| | | } |
| | | |
| | | @RequestMapping("/confirm/{id}") |
| | |
| | | String money = byId.getMoney(); |
| | | String[] split = money.split(","); |
| | | Double aDouble = Double.valueOf(split[0]); |
| | | System.out.println("============"+id); |
| | | System.out.println("============" + id); |
| | | SiteBooking siteBooking = new SiteBooking(); |
| | | siteBooking.setPayMoney(aDouble); |
| | | siteBooking.setId(id); |
| | |
| | | siteBooking.setPayUserId(UserExt.getUser().getId()); |
| | | iSiteBookingService.updateById(siteBooking); |
| | | |
| | | return new ResultUtil<>(0,0,"手动支付成功",null,null); |
| | | return new ResultUtil<>(0, 0, "手动支付成功", null, null); |
| | | } |
| | | |
| | | |
| | |
| | | @RequestMapping("/list") |
| | | @ResponseBody |
| | | public List<Game> changelist(BallQueryDto ballQueryDto) { |
| | | System.out.println("=======ballQueryDto=========="+ballQueryDto); |
| | | System.out.println("=======ballQueryDto==========" + ballQueryDto); |
| | | User user = UserExt.getUser(); |
| | | ballQueryDto.setType(user.getObjectType()); |
| | | ballQueryDto.setId(user.getObjectId()); |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/editCoursePackageState") |
| | | public ResultUtil editCoursePackageState(Integer id, Integer state){ |
| | | public ResultUtil editCoursePackageState(Integer id, Integer state) { |
| | | Game game = new Game(); |
| | | game.setId(id); |
| | | game.setState(state); |
| | |
| | | |
| | | return multipartFile; |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/save") |
| | | @ResponseBody |
| | | public ResultUtil save(Integer id, String operationId, String red, String blue, String province, String city, Integer site, Integer store |
| | | , String kuacheng, BigDecimal kuachengCoin, BigDecimal kuachengCash, String kuachengImage, BigDecimal kuachengInt, Integer kuachengId,Integer kcId |
| | | , String shequ, BigDecimal shequCoin, BigDecimal shequCash, String shequImage, BigDecimal shequInt, Integer shequId,Integer shequIId |
| | | , String shemen, BigDecimal shemenCoin, BigDecimal shemenCash, String shemenImage, BigDecimal shemenInt, Integer shemenId,Integer smId |
| | | , String sudu, BigDecimal suduCoin, BigDecimal suduCash, String suduImage, BigDecimal suduInt, Integer suduId,Integer sdId |
| | | , String fangkuai, BigDecimal fangkuaiCoin, BigDecimal fangkuaiCash, String fangkuaiImage, BigDecimal fangkuaiInt, Integer fangkuaiId,Integer fkId |
| | | , String jx, BigDecimal jxCoin, BigDecimal jxCash, String jxImage, BigDecimal jxInt, Integer jxId,Integer jxIId |
| | | , String sq, BigDecimal sqCoin, BigDecimal sqCash, String sqImage, BigDecimal sqInt, Integer sqId,Integer qwId |
| | | , String zs, BigDecimal zsCoin, BigDecimal zsCash, String zsImage, BigDecimal zsInt, Integer zsId,Integer zsIId |
| | | , String zs2, BigDecimal zs2Coin, BigDecimal zs2Cash, String zs2Image, BigDecimal zs2Int, Integer zs2Id,Integer zs2IId |
| | | , String ly, BigDecimal lyCoin, BigDecimal lyCash, String lyImage, BigDecimal lyInt, Integer lyId,Integer lyIId |
| | | , String v3, BigDecimal v3Coin, BigDecimal v3Cash, String v3Image, BigDecimal v3Int, Integer v3Id,Integer v3IId |
| | | ,String sutuName |
| | | , String kuacheng, BigDecimal kuachengCoin, BigDecimal kuachengCash, String kuachengImage, BigDecimal kuachengInt, Integer kuachengId, Integer kcId |
| | | , String shequ, BigDecimal shequCoin, BigDecimal shequCash, String shequImage, BigDecimal shequInt, Integer shequId, Integer shequIId |
| | | , String shemen, BigDecimal shemenCoin, BigDecimal shemenCash, String shemenImage, BigDecimal shemenInt, Integer shemenId, Integer smId |
| | | , String sudu, BigDecimal suduCoin, BigDecimal suduCash, String suduImage, BigDecimal suduInt, Integer suduId, Integer sdId |
| | | , String fangkuai, BigDecimal fangkuaiCoin, BigDecimal fangkuaiCash, String fangkuaiImage, BigDecimal fangkuaiInt, Integer fangkuaiId, Integer fkId |
| | | , String jx, BigDecimal jxCoin, BigDecimal jxCash, String jxImage, BigDecimal jxInt, Integer jxId, Integer jxIId |
| | | , String sq, BigDecimal sqCoin, BigDecimal sqCash, String sqImage, BigDecimal sqInt, Integer sqId, Integer qwId |
| | | , String zs, BigDecimal zsCoin, BigDecimal zsCash, String zsImage, BigDecimal zsInt, Integer zsId, Integer zsIId |
| | | , String zs2, BigDecimal zs2Coin, BigDecimal zs2Cash, String zs2Image, BigDecimal zs2Int, Integer zs2Id, Integer zs2IId |
| | | , String ly, BigDecimal lyCoin, BigDecimal lyCash, String lyImage, BigDecimal lyInt, Integer lyId, Integer lyIId |
| | | , String v3, BigDecimal v3Coin, BigDecimal v3Cash, String v3Image, BigDecimal v3Int, Integer v3Id, Integer v3IId |
| | | , String sutuName |
| | | |
| | | ) throws Exception { |
| | | |
| | |
| | | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | |
| | | if (objectType ==3){ |
| | | if (objectType == 3) { |
| | | |
| | | |
| | | TStore byId = storeService.getById(UserExt.getUser().getObjectId()); |
| | | System.out.println("=====byId======="+byId); |
| | | System.out.println("=====byId=======" + byId); |
| | | game.setProvinceCode(byId.getProvinceCode()); |
| | | game.setCityCode(byId.getCityCode()); |
| | | |
| | | |
| | | }else { |
| | | game.setProvinceCode(province); |
| | | game.setCityCode(city); |
| | | } else { |
| | | game.setProvinceCode(province); |
| | | game.setCityCode(city); |
| | | |
| | | } |
| | | game.setSiteId(site); |
| | |
| | | game.setId(id); |
| | | |
| | | |
| | | |
| | | if (!operationId.equals("平台")){ |
| | | game.setOperationId(Integer.valueOf(operationId));} |
| | | else { |
| | | if (!operationId.equals("平台")) { |
| | | game.setOperationId(Integer.valueOf(operationId)); |
| | | } else { |
| | | game.setOperationId(0); |
| | | } |
| | | System.out.println("============"+game); |
| | | |
| | | System.out.println("============" + game); |
| | | TStore tStore = storeService.getById(store); |
| | | game.setOperationId(tStore.getOperatorId()); |
| | | // 判断是新增还是修改 修改不会重新生成sutuId |
| | | if (game.getId()==null) { |
| | | if (game.getId() == null) { |
| | | HashMap<String, String> map5 = new HashMap<>(); |
| | | map5.put("space_id", store + ""); |
| | | map5.put("area_id", site + ""); |
| | |
| | | game.setBlueCode(s); |
| | | game.setRedCode(s1); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | Integer gameId = ballClient.save(game); |
| | | List<TGameConfig> gameConfigList = new ArrayList<>(); |
| | | //玩湃跨城赛 |
| | |
| | | gameConfigkuacheng.setPlayCoin(kuachengCoin); |
| | | gameConfigkuacheng.setIntegral(kuachengInt); |
| | | gameConfigkuacheng.setOtherId(gameId); |
| | | System.out.println("========gameConfig======"+gameConfigkuacheng); |
| | | System.out.println("========gameConfig======" + gameConfigkuacheng); |
| | | gameConfigList.add(gameConfigkuacheng); |
| | | System.out.println("======gameConfigList======="+gameConfigList); |
| | | System.out.println("======gameConfigList=======" + gameConfigList); |
| | | //社区冠军赛 |
| | | TGameConfig gameConfigshequ = new TGameConfig(); |
| | | gameConfigshequ.setId(shequIId); |
| | |
| | | |
| | | //玩湃熊之力-速度 |
| | | TGameConfig gameConfigsudu = new TGameConfig(); |
| | | gameConfigsudu.setGameId(suduId);gameConfigsudu.setId(sdId); |
| | | gameConfigsudu.setGameId(suduId); |
| | | gameConfigsudu.setId(sdId); |
| | | gameConfigsudu.setCash(suduCash); |
| | | gameConfigsudu.setImg(suduImage); |
| | | gameConfigsudu.setName(sudu); |
| | |
| | | gameConfigList.add(gameConfigsq); |
| | | |
| | | |
| | | |
| | | //涨姿势 |
| | | TGameConfig gameConfigzs = new TGameConfig(); |
| | | gameConfigzs.setGameId(zsId); |
| | |
| | | |
| | | //涨姿势2 |
| | | TGameConfig gameConfigzs2 = new TGameConfig(); |
| | | gameConfigzs2.setGameId(zs2Id);gameConfigzs2.setId(zs2IId); |
| | | gameConfigzs2.setGameId(zs2Id); |
| | | gameConfigzs2.setId(zs2IId); |
| | | gameConfigzs2.setCash(zs2Cash); |
| | | gameConfigzs2.setImg(zs2Image); |
| | | gameConfigzs2.setName(zs2); |
| | |
| | | //绿茵密码 |
| | | TGameConfig gameConfigly = new TGameConfig(); |
| | | gameConfigly.setGameId(lyId); |
| | | gameConfigly.setId(lyIId); |
| | | gameConfigly.setId(lyIId); |
| | | gameConfigly.setCash(lyCash); |
| | | gameConfigly.setImg(lyImage); |
| | | gameConfigly.setName(ly); |
| | |
| | | gameConfigly.setIntegral(lyInt); |
| | | gameConfigly.setOtherId(gameId); |
| | | gameConfigList.add(gameConfigly); |
| | | |
| | | |
| | | //激战3V3 |
| | | TGameConfig gameConfigv3 = new TGameConfig(); |
| | | gameConfigv3.setGameId(v3Id); |
| | |
| | | // String s2 = HttpRequestUtil.postRequest("https://port.daowepark.com/v7/user_api/general/addDevice", map2); |
| | | |
| | | |
| | | |
| | | ballClient.saveConfig( gameConfigList); |
| | | ballClient.saveConfig(gameConfigList); |
| | | return null; |
| | | } |
| | | |
| | | // public static void main(String[] args) throws Exception { |
| | | // String blueS = "{\"vipDetail\":1,role\":1,\"time\":[{\"start_time\":\"2025-08-25 09:00:00\",\"end_time\":\"2025-08-30 23:00:00\"}]}"; |
| | | // MyQrCodeUtil.createCodeToFile(blueS); |
| | | // BufferedImage blueImage = QRCodeUtil.createImage(blueS); |
| | | // MultipartFile blueFile = convert(blueImage, new Date().getTime() + UUIDUtil.getRandomCode(3) + ".PNG"); |
| | | // String s = OssUploadUtil.ossUpload("img/", blueFile); |
| | | // System.err.println(s); |
| | | // } |
| | | |
| | | |
| | | @RequestMapping("/pre_add") |
| | | public String add(Model model) { |
| | | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | |
| | | if (objectType ==3){ |
| | | if (objectType == 3) { |
| | | |
| | | model.addAttribute("is3","true"); |
| | | model.addAttribute("storeId",UserExt.getUser().getObjectId()); |
| | | model.addAttribute("is3", "true"); |
| | | model.addAttribute("storeId", UserExt.getUser().getObjectId()); |
| | | TStore byId = storeService.getById(UserExt.getUser().getObjectId()); |
| | | System.out.println("=====byId======="+byId); |
| | | model.addAttribute("cityCode",byId.getCityCode()); |
| | | model.addAttribute("provinceCode",byId.getProvinceCode()); |
| | | model.addAttribute("oId",byId.getOperatorId()); |
| | | return PREFIX+"ball_pre_add1.html"; |
| | | System.out.println("=====byId=======" + byId); |
| | | model.addAttribute("cityCode", byId.getCityCode()); |
| | | model.addAttribute("provinceCode", byId.getProvinceCode()); |
| | | model.addAttribute("oId", byId.getOperatorId()); |
| | | return PREFIX + "ball_pre_add1.html"; |
| | | |
| | | } |
| | | |
| | | if (objectType == 2){ |
| | | model.addAttribute("is2","true"); |
| | | model.addAttribute("oId",UserExt.getUser().getObjectId()); |
| | | return PREFIX+"ball_pre_add2.html"; |
| | | if (objectType == 2) { |
| | | model.addAttribute("is2", "true"); |
| | | model.addAttribute("oId", UserExt.getUser().getObjectId()); |
| | | return PREFIX + "ball_pre_add2.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | model.addAttribute("is","${is}"); |
| | | model.addAttribute("is", "${is}"); |
| | | |
| | | |
| | | |
| | | return PREFIX+"ball_pre_add.html"; |
| | | return PREFIX + "ball_pre_add.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private TGameConfigService gameConfigService; |
| | | |
| | | @RequestMapping("/pre_edit/{id}") |
| | | public String pre_edit(@PathVariable("id") Integer id,Model model) { |
| | | public String pre_edit(@PathVariable("id") Integer id, Model model) { |
| | | Game game = ballClient.queryGame(id); |
| | | System.out.println("---------game------"+game); |
| | | model.addAttribute("game",game); |
| | | if (game.getOperationId() ==0){ |
| | | model.addAttribute("opId","平台"); |
| | | model.addAttribute("is","平台"); |
| | | }else { |
| | | model.addAttribute("opId",game.getOperationId()); |
| | | System.out.println("---------game------" + game); |
| | | model.addAttribute("game", game); |
| | | if (game.getOperationId() == 0) { |
| | | model.addAttribute("opId", "平台"); |
| | | model.addAttribute("is", "平台"); |
| | | } else { |
| | | model.addAttribute("opId", game.getOperationId()); |
| | | } |
| | | |
| | | TGameConfig kc = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 14)); |
| | | model.addAttribute("kc",kc); |
| | | model.addAttribute("kc", kc); |
| | | |
| | | |
| | | TGameConfig sq = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 16)); |
| | | model.addAttribute("sq",sq); |
| | | model.addAttribute("sq", sq); |
| | | |
| | | |
| | | TGameConfig sm = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 13)); |
| | | model.addAttribute("sm",sm); |
| | | model.addAttribute("sm", sm); |
| | | |
| | | TGameConfig sd = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 15)); |
| | | model.addAttribute("sd",sd); |
| | | model.addAttribute("sd", sd); |
| | | |
| | | TGameConfig fk = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 1)); |
| | | model.addAttribute("fk",fk); |
| | | model.addAttribute("fk", fk); |
| | | |
| | | TGameConfig jx = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 7)); |
| | | model.addAttribute("jx",jx); |
| | | model.addAttribute("jx", jx); |
| | | |
| | | TGameConfig qw = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 8)); |
| | | model.addAttribute("qw",qw); |
| | | model.addAttribute("qw", qw); |
| | | |
| | | TGameConfig zs = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 10)); |
| | | model.addAttribute("zs",zs); |
| | | model.addAttribute("zs", zs); |
| | | |
| | | TGameConfig zs2 = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 11)); |
| | | model.addAttribute("zs2",zs2); |
| | | model.addAttribute("zs2", zs2); |
| | | |
| | | TGameConfig ly = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 5)); |
| | | model.addAttribute("ly",ly); |
| | | |
| | | model.addAttribute("ly", ly); |
| | | |
| | | TGameConfig v3 = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 0)); |
| | | model.addAttribute("v3",v3); |
| | | model.addAttribute("v3", v3); |
| | | |
| | | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | |
| | | if (objectType ==3){ |
| | | model.addAttribute("is3","true"); |
| | | model.addAttribute("storeId",UserExt.getUser().getObjectId()); |
| | | if (objectType == 3) { |
| | | model.addAttribute("is3", "true"); |
| | | model.addAttribute("storeId", UserExt.getUser().getObjectId()); |
| | | TStore byId = storeService.getById(UserExt.getUser().getObjectId()); |
| | | model.addAttribute("cityCode",byId.getCityCode()); |
| | | model.addAttribute("provinceCode",byId.getProvinceCode()); |
| | | model.addAttribute("oId",byId.getOperatorId()); |
| | | return PREFIX+"ball_pre_edit1.html"; |
| | | model.addAttribute("cityCode", byId.getCityCode()); |
| | | model.addAttribute("provinceCode", byId.getProvinceCode()); |
| | | model.addAttribute("oId", byId.getOperatorId()); |
| | | return PREFIX + "ball_pre_edit1.html"; |
| | | |
| | | } |
| | | if (objectType == 2){ |
| | | return PREFIX+"ball_pre_edit2.html"; |
| | | if (objectType == 2) { |
| | | return PREFIX + "ball_pre_edit2.html"; |
| | | |
| | | } |
| | | |
| | | return PREFIX+"ball_pre_edit.html"; |
| | | return PREFIX + "ball_pre_edit.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/pre_info/{id}") |
| | | public String pre_info(@PathVariable("id") Integer id,Model model) { |
| | | public String pre_info(@PathVariable("id") Integer id, Model model) { |
| | | |
| | | Game game = ballClient.queryGame(id); |
| | | System.out.println("---------game------"+game); |
| | | model.addAttribute("game",game); |
| | | System.out.println("---------game------" + game); |
| | | model.addAttribute("game", game); |
| | | |
| | | |
| | | if (game.getOperationId() ==0){ |
| | | model.addAttribute("opId","平台"); |
| | | model.addAttribute("is","平台"); |
| | | }else { |
| | | model.addAttribute("opId",game.getOperationId()); |
| | | if (game.getOperationId() == 0) { |
| | | model.addAttribute("opId", "平台"); |
| | | model.addAttribute("is", "平台"); |
| | | } else { |
| | | model.addAttribute("opId", game.getOperationId()); |
| | | } |
| | | |
| | | TGameConfig kc = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 14)); |
| | | model.addAttribute("kc",kc); |
| | | model.addAttribute("kc", kc); |
| | | |
| | | |
| | | TGameConfig sq = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 16)); |
| | | model.addAttribute("sq",sq); |
| | | model.addAttribute("sq", sq); |
| | | |
| | | |
| | | TGameConfig sm = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 13)); |
| | | model.addAttribute("sm",sm); |
| | | model.addAttribute("sm", sm); |
| | | |
| | | TGameConfig sd = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 15)); |
| | | model.addAttribute("sd",sd); |
| | | model.addAttribute("sd", sd); |
| | | |
| | | TGameConfig fk = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 1)); |
| | | model.addAttribute("fk",fk); |
| | | model.addAttribute("fk", fk); |
| | | |
| | | TGameConfig jx = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 7)); |
| | | model.addAttribute("jx",jx); |
| | | model.addAttribute("jx", jx); |
| | | |
| | | TGameConfig qw = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 8)); |
| | | model.addAttribute("qw",qw); |
| | | model.addAttribute("qw", qw); |
| | | |
| | | TGameConfig zs = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 10)); |
| | | model.addAttribute("zs",zs); |
| | | model.addAttribute("zs", zs); |
| | | |
| | | TGameConfig zs2 = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 11)); |
| | | model.addAttribute("zs2",zs2); |
| | | model.addAttribute("zs2", zs2); |
| | | |
| | | TGameConfig ly = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 5)); |
| | | model.addAttribute("ly",ly); |
| | | |
| | | model.addAttribute("ly", ly); |
| | | |
| | | TGameConfig v3 = gameConfigService.getOne(new QueryWrapper<TGameConfig>().eq("otherId", id).eq("gameId", 0)); |
| | | model.addAttribute("v3",v3); |
| | | model.addAttribute("v3", v3); |
| | | |
| | | |
| | | return PREFIX+"ball_pre_info.html"; |
| | | return PREFIX + "ball_pre_info.html"; |
| | | } |
| | | |
| | | @Autowired |
| | | private ISiteBookingService iSiteBookingService; |
| | | private ISiteBookingService iSiteBookingService; |
| | | |
| | | @RequestMapping("/yueyue_edit/{id}") |
| | | public String yueyue_edit(@PathVariable("id") Integer id,Model model) { |
| | | public String yueyue_edit(@PathVariable("id") Integer id, Model model) { |
| | | |
| | | List<String> strings1 = new ArrayList<>(); |
| | | |
| | | SiteBooking book = iSiteBookingService.getById(id); |
| | | model.addAttribute("item", book); |
| | | if (book.getMoney()!=null){ |
| | | model.addAttribute("money",book.getMoney().split(","));} |
| | | if (book.getMoney() != null) { |
| | | model.addAttribute("money", book.getMoney().split(",")); |
| | | } |
| | | String[] split1 = book.getTimes().split(";"); |
| | | model.addAttribute("date",split1[0].substring(0,10)); |
| | | model.addAttribute("date", split1[0].substring(0, 10)); |
| | | |
| | | for (String s : split1) { |
| | | |
| | |
| | | strings1.add(convertedValue); |
| | | } |
| | | |
| | | System.out.println("========strings1====="+strings1); |
| | | System.out.println("========strings1=====" + strings1); |
| | | |
| | | //时间段 |
| | | List<String> strings = new ArrayList<>(); |
| | | // List<SiteBooking> siteBookings = siteClient.listBooks(book.getSiteId()); |
| | | List<SiteBooking> siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", book.getSiteId()).like("times",split1[0].substring(0,10))); |
| | | System.out.println("=======siteBookings======"+siteBookings); |
| | | List<SiteBooking> siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", book.getSiteId()).like("times", split1[0].substring(0, 10))); |
| | | System.out.println("=======siteBookings======" + siteBookings); |
| | | for (SiteBooking siteBooking : siteBookings) { |
| | | String[] split = siteBooking.getTimes().split(";"); |
| | | for (String s : split) { |
| | |
| | | } |
| | | |
| | | } |
| | | System.out.println("======strings======="+strings); |
| | | System.out.println("======strings=======" + strings); |
| | | |
| | | |
| | | List<OrderDto> timeRanges = new ArrayList<>(); |
| | | Site site = siteClient.listById(book.getSiteId()); |
| | | System.out.println("================"+site); |
| | | Site site = siteClient.listById(book.getSiteId()); |
| | | System.out.println("================" + site); |
| | | String appointmentStartTime = site.getAppointmentStartTime(); |
| | | String appointmentEndTime = site.getAppointmentEndTime(); |
| | | //生成用于比较日期是否超过的当前日期 |
| | | LocalDate currentDate = LocalDate.now(); |
| | | LocalDate parsedDate = LocalDate.parse(split1[0].substring(0,10), DateTimeFormatter.ISO_DATE); |
| | | LocalDate parsedDate = LocalDate.parse(split1[0].substring(0, 10), DateTimeFormatter.ISO_DATE); |
| | | boolean isAfterCurrentDate = parsedDate.isBefore(currentDate); |
| | | System.out.println("是否超过当前日期"+isAfterCurrentDate); |
| | | System.out.println("是否超过当前日期" + isAfterCurrentDate); |
| | | String currentTime = appointmentStartTime; |
| | | while (currentTime.compareTo(appointmentEndTime) < 0) { |
| | | String nextTime = null; |
| | | if("智慧场地".equals(site.getTypeName())){ |
| | | nextTime=getNextTimeOne(currentTime); |
| | | }else { |
| | | nextTime= getNextTime(currentTime); |
| | | if ("智慧场地".equals(site.getTypeName())) { |
| | | nextTime = getNextTimeOne(currentTime); |
| | | } else { |
| | | nextTime = getNextTime(currentTime); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | boolean hasExceeded = currentTime1.isAfter(targetTime); |
| | | //是否超过当前时间 |
| | | if (hasExceeded){ |
| | | if (hasExceeded) { |
| | | orderDto.setState(0); |
| | | } |
| | | //是否已经预定 |
| | | if (strings.contains(timeRange)){ |
| | | if (strings.contains(timeRange)) { |
| | | orderDto.setState(0); |
| | | } |
| | | //日期是否超过 |
| | | if (isAfterCurrentDate){ |
| | | if (isAfterCurrentDate) { |
| | | orderDto.setState(0); |
| | | } |
| | | //是否是当前场地当前日期预定的 |
| | | if (strings1.contains(timeRange)){ |
| | | if (strings1.contains(timeRange)) { |
| | | orderDto.setState(1); |
| | | } |
| | | |
| | | timeRanges.add(orderDto); |
| | | currentTime = nextTime; |
| | | } |
| | | System.out.println("-------------"+timeRanges); |
| | | model.addAttribute("timeRanges",timeRanges); |
| | | System.out.println("-------------" + timeRanges); |
| | | model.addAttribute("timeRanges", timeRanges); |
| | | |
| | | System.out.println("======timeRanges========"+timeRanges); |
| | | |
| | | |
| | | |
| | | |
| | | System.out.println("======timeRanges========" + timeRanges); |
| | | |
| | | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | |
| | | model.addAttribute("city", list1); |
| | | String code1 = list1.get(0).get("code").toString(); |
| | | List<TStore> list2 = storeService.list(new QueryWrapper<TStore>().eq("cityCode", code1).eq("state", 1)); |
| | | if(UserExt.getUser().getObjectType()==3){ |
| | | list2=storeService.list(new QueryWrapper<TStore>().eq("id", UserExt.getUser().getObjectId()).eq("state", 1)); |
| | | if (UserExt.getUser().getObjectType() == 3) { |
| | | list2 = storeService.list(new QueryWrapper<TStore>().eq("id", UserExt.getUser().getObjectId()).eq("state", 1)); |
| | | } |
| | | model.addAttribute("store", list2); |
| | | TStore store = list2.get(0); |
| | |
| | | model.addAttribute("site", list3); |
| | | model.addAttribute("objType", UserExt.getUser().getObjectType()); |
| | | // 查询运营商下所有门店 所有场地 |
| | | if (objectType == 2){ |
| | | if (objectType == 2) { |
| | | List<TStore> stores = storeService.list(new QueryWrapper<TStore>().eq("operatorId", objectId)); |
| | | model.addAttribute("store", stores); |
| | | // 门店ids |
| | |
| | | } |
| | | model.addAttribute("objectType", objectType); |
| | | |
| | | return PREFIX+"yuyue_edit.html"; |
| | | return PREFIX + "yuyue_edit.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | @RequestMapping("/yueyue_info/{id}") |
| | | public String yueyue_info(@PathVariable("id") Integer id,Model model) { |
| | | public String yueyue_info(@PathVariable("id") Integer id, Model model) { |
| | | |
| | | List<String> strings1 = new ArrayList<>(); |
| | | |
| | | SiteBooking book = iSiteBookingService.getById(id); |
| | | model.addAttribute("item", book); |
| | | if (book.getMoney()!=null){ |
| | | model.addAttribute("money",book.getMoney().split(","));} |
| | | if (book.getMoney() != null) { |
| | | model.addAttribute("money", book.getMoney().split(",")); |
| | | } |
| | | String[] split1 = book.getTimes().split(";"); |
| | | model.addAttribute("date",split1[0].substring(0,10)); |
| | | model.addAttribute("date", split1[0].substring(0, 10)); |
| | | |
| | | |
| | | User user = userService.getById(book.getCancelUserId()); |
| | | if (user!=null) { |
| | | if (user != null) { |
| | | model.addAttribute("cancelUser", user.getName()); |
| | | } |
| | | |
| | |
| | | String convertedValue = s.substring(11); |
| | | strings1.add(convertedValue); |
| | | } |
| | | switch (book.getStatus()){ |
| | | switch (book.getStatus()) { |
| | | case 0: |
| | | model.addAttribute("state","待支付"); |
| | | model.addAttribute("state", "待支付"); |
| | | break; |
| | | case 1: |
| | | model.addAttribute("state","待核销"); |
| | | model.addAttribute("state", "待核销"); |
| | | break; |
| | | case 2: |
| | | model.addAttribute("state","已到店"); |
| | | model.addAttribute("state", "已到店"); |
| | | break; |
| | | case 3: |
| | | model.addAttribute("state","已完成"); |
| | | model.addAttribute("state", "已完成"); |
| | | break; |
| | | case 4: |
| | | model.addAttribute("state","已过期"); |
| | | model.addAttribute("state", "已过期"); |
| | | break; |
| | | case 5: |
| | | model.addAttribute("state","已取消"); |
| | | model.addAttribute("state", "已取消"); |
| | | break; |
| | | } |
| | | System.out.println("========strings1====="+strings1); |
| | | System.out.println("========strings1=====" + strings1); |
| | | |
| | | //时间段 |
| | | List<String> strings = new ArrayList<>(); |
| | | // List<SiteBooking> siteBookings = siteClient.listBooks(book.getSiteId()); |
| | | List<SiteBooking> siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", book.getSiteId()).like("times",split1[0].substring(0,10))); |
| | | System.out.println("=======siteBookings======"+siteBookings); |
| | | for (SiteBooking siteBooking : siteBookings) { |
| | | String[] split = siteBooking.getTimes().split(";"); |
| | | for (String s : split) { |
| | | |
| | | String convertedValue = s.substring(11); |
| | | strings.add(convertedValue); |
| | | } |
| | | |
| | | } |
| | | System.out.println("======strings======="+strings); |
| | | ////时间段 |
| | | // List<String> strings = new ArrayList<>(); |
| | | //// List<SiteBooking> siteBookings = siteClient.listBooks(book.getSiteId()); |
| | | // List<SiteBooking> siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", book.getSiteId()).like("times", split1[0].substring(0, 10))); |
| | | // System.out.println("=======siteBookings======" + siteBookings); |
| | | // for (SiteBooking siteBooking : siteBookings) { |
| | | // String[] split = siteBooking.getTimes().split(";"); |
| | | // for (String s : split) { |
| | | // |
| | | // String convertedValue = s.substring(11); |
| | | // strings.add(convertedValue); |
| | | // } |
| | | // |
| | | // } |
| | | // System.out.println("======strings=======" + strings); |
| | | |
| | | |
| | | List<OrderDto> timeRanges = new ArrayList<>(); |
| | | |
| | | TSite site = siteService.getById(book.getSiteId()); |
| | | System.out.println("================"+site); |
| | | String appointmentStartTime = site.getAppointmentStartTime(); |
| | | String appointmentEndTime = site.getAppointmentEndTime(); |
| | | //生成用于比较日期是否超过的当前日期 |
| | | LocalDate currentDate = LocalDate.now(); |
| | | LocalDate parsedDate = LocalDate.parse(split1[0].substring(0,10), DateTimeFormatter.ISO_DATE); |
| | | boolean isAfterCurrentDate = parsedDate.isBefore(currentDate); |
| | | System.out.println("是否超过当前日期"+isAfterCurrentDate); |
| | | String currentTime = appointmentStartTime; |
| | | while (currentTime.compareTo(appointmentEndTime) < 0) { |
| | | String nextTime = getNextTime(currentTime); |
| | | |
| | | |
| | | String timeRange = currentTime + "-" + nextTime; |
| | | OrderDto orderDto = new OrderDto(); |
| | | orderDto.setTime(timeRange); |
| | | |
| | | LocalTime currentTime1 = LocalTime.now(); |
| | | LocalTime targetTime = LocalTime.parse(currentTime); |
| | | |
| | | boolean hasExceeded = currentTime1.isAfter(targetTime); |
| | | //是否超过当前时间 |
| | | if (hasExceeded){ |
| | | orderDto.setState(0); |
| | | } |
| | | //是否已经预定 |
| | | if (strings.contains(timeRange)){ |
| | | orderDto.setState(0); |
| | | } |
| | | //日期是否超过 |
| | | if (isAfterCurrentDate){ |
| | | orderDto.setState(0); |
| | | } |
| | | //是否是当前场地当前日期预定的 |
| | | if (strings1.contains(timeRange)){ |
| | | orderDto.setState(1); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | timeRanges.add(orderDto); |
| | | currentTime = nextTime; |
| | | } |
| | | System.out.println("-------------"+timeRanges); |
| | | model.addAttribute("timeRanges",timeRanges); |
| | | System.out.println("======timeRanges========"+timeRanges); |
| | | System.out.println("================" + site); |
| | | // String appointmentStartTime = site.getAppointmentStartTime(); |
| | | // String appointmentEndTime = site.getAppointmentEndTime(); |
| | | // //生成用于比较日期是否超过的当前日期 |
| | | // LocalDate currentDate = LocalDate.now(); |
| | | // LocalDate parsedDate = LocalDate.parse(split1[0].substring(0, 10), DateTimeFormatter.ISO_DATE); |
| | | // boolean isAfterCurrentDate = parsedDate.isBefore(currentDate); |
| | | // System.out.println("是否超过当前日期" + isAfterCurrentDate); |
| | | // String currentTime = appointmentStartTime; |
| | | // while (currentTime.compareTo(appointmentEndTime) < 0) { |
| | | // String nextTime = getNextTime(currentTime); |
| | | // |
| | | // |
| | | // String timeRange = currentTime + "-" + nextTime; |
| | | // OrderDto orderDto = new OrderDto(); |
| | | // orderDto.setTime(timeRange); |
| | | // |
| | | // LocalTime currentTime1 = LocalTime.now(); |
| | | // LocalTime targetTime = LocalTime.parse(currentTime); |
| | | // |
| | | // boolean hasExceeded = currentTime1.isAfter(targetTime); |
| | | // //是否超过当前时间 |
| | | // if (hasExceeded) { |
| | | // orderDto.setState(0); |
| | | // } |
| | | // //是否已经预定 |
| | | // if (strings.contains(timeRange)) { |
| | | // orderDto.setState(0); |
| | | // } |
| | | // //日期是否超过 |
| | | // if (isAfterCurrentDate) { |
| | | // orderDto.setState(0); |
| | | // } |
| | | // //是否是当前场地当前日期预定的 |
| | | // if (strings1.contains(timeRange)) { |
| | | // orderDto.setState(1); |
| | | // } |
| | | // timeRanges.add(orderDto); |
| | | // currentTime = nextTime; |
| | | // } |
| | | System.out.println("-------------" + timeRanges); |
| | | model.addAttribute("timeRanges", timeRanges); |
| | | System.out.println("======timeRanges========" + timeRanges); |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | model.addAttribute("province", book.getProvince()); |
| | | String yuyueTime = ""; |
| | | if (strings1.size()>1){ |
| | | String start = strings1.get(0).split("-")[0]; |
| | | String end = strings1.get(strings1.size()-1).split("-")[1]; |
| | | yuyueTime = start +"-"+end; |
| | | }else{ |
| | | yuyueTime = strings1.get(0); |
| | | } |
| | | model.addAttribute("yuyueTime", yuyueTime); |
| | | model.addAttribute("targetAudience", book.getTargetAudience()); |
| | | model.addAttribute("city", book.getCity()); |
| | | model.addAttribute("store",storeService.getById(book.getStoreId()).getName()); |
| | | model.addAttribute("siteName",siteService.getById(book.getSiteId()).getName()); |
| | | model.addAttribute("store", storeService.getById(book.getStoreId()).getName()); |
| | | model.addAttribute("siteName", siteService.getById(book.getSiteId()).getName()); |
| | | model.addAttribute("objectType", objectType); |
| | | return PREFIX+"yuyue_info.html"; |
| | | return PREFIX + "yuyue_info.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping("/paike") |
| | | public String paike(Model model) { |
| | | |
| | | return PREFIX+"paike.html"; |
| | | return PREFIX + "paike.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequestMapping("/getStudentTotal") |
| | | @ResponseBody |
| | | public List<Map<String, Object>>getStudentTotal(@RequestBody StudentQeryDto studentQeryDto) { |
| | | if (studentQeryDto.getTimes()!=null&& studentQeryDto.getTimes()!=""){ |
| | | public List<Map<String, Object>> getStudentTotal(@RequestBody StudentQeryDto studentQeryDto) { |
| | | if (studentQeryDto.getTimes() != null && studentQeryDto.getTimes() != "") { |
| | | String[] split = studentQeryDto.getTimes().split(","); |
| | | studentQeryDto.setStart(split[0]); |
| | | studentQeryDto.setEnd(split[1]); |
| | | } |
| | | // 如果当前登陆人是运营商 只查询该运营商下的课包的数据 |
| | | if(UserExt.getUser().getObjectType() == 2){ |
| | | if (UserExt.getUser().getObjectType() == 2) { |
| | | // 先查询这个运营商下的所有门店ids |
| | | List<Integer> storeIds = storeService.list(new QueryWrapper<TStore>().eq("operatorId", UserExt.getUser().getObjectId())) |
| | | .stream().map(TStore::getId).collect(Collectors.toList()); |
| | |
| | | } |
| | | |
| | | List<Integer> coursePackageByStoreIds = tCoursePackages.stream().distinct().map(TCoursePackage::getId).collect(Collectors.toList()); |
| | | if (tCoursePackages.isEmpty()){ |
| | | if (tCoursePackages.isEmpty()) { |
| | | coursePackageByStoreIds.add(-1); |
| | | } |
| | | studentQeryDto.setCoursePackageIds(coursePackageByStoreIds); |
| | | |
| | | } |
| | | // 如果当前登陆人是门店 只查询该门店下的课包的数据 |
| | | if(UserExt.getUser().getObjectType() == 3){ |
| | | if (UserExt.getUser().getObjectType() == 3) { |
| | | // 先查询这个运营商下的所有门店ids |
| | | |
| | | List<Integer> storeIds = new ArrayList<>(); |
| | |
| | | tCoursePackages.addAll(coursePackageByStoreId); |
| | | } |
| | | List<Integer> coursePackageByStoreIds = tCoursePackages.stream().distinct().map(TCoursePackage::getId).collect(Collectors.toList()); |
| | | if (tCoursePackages.isEmpty()){ |
| | | if (tCoursePackages.isEmpty()) { |
| | | coursePackageByStoreIds.add(-1); |
| | | } |
| | | studentQeryDto.setCoursePackageIds(coursePackageByStoreIds); |
| | | } |
| | | |
| | | List<Map<String, Object>> pays = coursePackageClient.getStudentTotal(studentQeryDto); |
| | | List<Map<String, Object>> pays = coursePackageClient.getStudentTotal(studentQeryDto); |
| | | return pays; |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping("/bypac") |
| | | @ResponseBody |
| | | public List<Map<String, Object>>bypac(@RequestBody PacQueryDto pacQueryDto) { |
| | | if (pacQueryDto.getTimes()!=null&& pacQueryDto.getTimes()!=""){ |
| | | public List<Map<String, Object>> bypac(@RequestBody PacQueryDto pacQueryDto) { |
| | | if (pacQueryDto.getTimes() != null && pacQueryDto.getTimes() != "") { |
| | | String[] split = pacQueryDto.getTimes().split(","); |
| | | pacQueryDto.setStart(split[0]); |
| | | pacQueryDto.setEnd(split[1]); |
| | | } |
| | | if (UserExt.getUser().getObjectType() == 2){ |
| | | if (UserExt.getUser().getObjectType() == 2) { |
| | | QueryWrapper<TStore> queryWrapper = new QueryWrapper<TStore>().eq("operatorId", UserExt.getUser().getObjectId()).eq("state", 1); |
| | | if(ToolUtil.isNotEmpty(pacQueryDto.getCityCode())){ |
| | | if (ToolUtil.isNotEmpty(pacQueryDto.getCityCode())) { |
| | | queryWrapper.eq("cityCode", pacQueryDto.getCityCode()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(pacQueryDto.getName())){ |
| | | if (ToolUtil.isNotEmpty(pacQueryDto.getName())) { |
| | | queryWrapper.like("name", pacQueryDto.getName()); |
| | | } |
| | | List<Integer> storeIds = storeService.list(queryWrapper) |
| | | .stream().map(TStore::getId).collect(Collectors.toList()); |
| | | storeIds.add(-1); |
| | | pacQueryDto.setStoreIds(storeIds); |
| | | }else{ |
| | | } else { |
| | | QueryWrapper<TStore> queryWrapper = new QueryWrapper<TStore>().eq("state", 1); |
| | | if(ToolUtil.isNotEmpty(pacQueryDto.getCityCode())){ |
| | | if (ToolUtil.isNotEmpty(pacQueryDto.getCityCode())) { |
| | | queryWrapper.eq("cityCode", pacQueryDto.getCityCode()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(pacQueryDto.getName())){ |
| | | if (ToolUtil.isNotEmpty(pacQueryDto.getName())) { |
| | | queryWrapper.like("name", pacQueryDto.getName()); |
| | | } |
| | | List<Integer> storeIds = storeService.list(queryWrapper) |
| | |
| | | storeIds.add(-1); |
| | | pacQueryDto.setStoreIds(storeIds); |
| | | } |
| | | List<Map<String, Object>> pays = coursePackageClient.bypac(pacQueryDto); |
| | | List<Map<String, Object>> pays = coursePackageClient.bypac(pacQueryDto); |
| | | return pays; |
| | | } |
| | | |
| | |
| | | @RequestMapping("/yuyue") |
| | | public String yuyue(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list", list); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",roleid); |
| | | model.addAttribute("role", roleid); |
| | | |
| | | return PREFIX+"yuyue.html"; |
| | | return PREFIX + "yuyue.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/jieshao") |
| | | public String jieshao(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list", list); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",roleid); |
| | | model.addAttribute("role", roleid); |
| | | |
| | | return PREFIX+"jieshao.html"; |
| | | return PREFIX + "jieshao.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @RequestMapping("/yuyuelist") |
| | | @ResponseBody |
| | | public List<Map<String,Object>> yuyuelist(BookingQuery bookingQuery) { |
| | | public List<Map<String, Object>> yuyuelist(BookingQuery bookingQuery) { |
| | | return queryBookingOrders(bookingQuery); |
| | | } |
| | | |
| | | /** |
| | | * 导出当前筛选条件下的全部预约记录,不受列表分页影响。 |
| | | */ |
| | | @RequestMapping("/yuyueexport") |
| | | public void exportYuyue(BookingQuery bookingQuery, HttpServletResponse response) throws IOException { |
| | | List<Map<String, Object>> orders = queryBookingOrders(bookingQuery); |
| | | String[] headers = {"序号", "所在省", "所在市", "预约门店", "入场方式", "预约场地", "姓名", "联系电话", |
| | | "预约时间段", "支付流水号", "支付方式", "金额", "状态"}; |
| | | |
| | | // 线上运行环境使用的是旧版 POI 核心包,使用 HSSF 保持依赖兼容; |
| | | // 超过单 Sheet 上限的数据拆分到多个工作表,确保导出全部命中记录。 |
| | | HSSFWorkbook workbook = new HSSFWorkbook(); |
| | | try { |
| | | final int maxDataRowsPerSheet = 60000; |
| | | int sheetCount = Math.max(1, (orders.size() + maxDataRowsPerSheet - 1) / maxDataRowsPerSheet); |
| | | for (int sheetIndex = 0; sheetIndex < sheetCount; sheetIndex++) { |
| | | Sheet sheet = workbook.createSheet(sheetCount == 1 ? "预约管理" : "预约管理" + (sheetIndex + 1)); |
| | | Row header = sheet.createRow(0); |
| | | for (int i = 0; i < headers.length; i++) { |
| | | header.createCell(i).setCellValue(headers[i]); |
| | | sheet.setColumnWidth(i, i == 8 ? 28 * 256 : 18 * 256); |
| | | } |
| | | int start = sheetIndex * maxDataRowsPerSheet; |
| | | int end = Math.min(start + maxDataRowsPerSheet, orders.size()); |
| | | for (int rowIndex = start; rowIndex < end; rowIndex++) { |
| | | Map<String, Object> order = orders.get(rowIndex); |
| | | Row row = sheet.createRow(rowIndex - start + 1); |
| | | String[] values = { |
| | | valueOf(order.get("id")), valueOf(order.get("province")), valueOf(order.get("city")), |
| | | valueOf(order.get("name")), targetAudienceName(order.get("targetAudience")), |
| | | valueOf(order.get("siteName")), valueOf(order.get("booker")), valueOf(order.get("phone")), |
| | | valueOf(order.get("times")), valueOf(order.get("payOrderNo")), valueOf(order.get("payType")), |
| | | moneyText(order.get("payType"), order.get("payMoney")), ticketStatusName(toInteger(order.get("status"))) |
| | | }; |
| | | for (int columnIndex = 0; columnIndex < values.length; columnIndex++) { |
| | | Cell cell = row.createCell(columnIndex); |
| | | cell.setCellValue(values[columnIndex]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | String fileName = "预约管理_" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; |
| | | response.reset(); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding(StandardCharsets.UTF_8.name()); |
| | | response.setHeader("Content-Disposition", "attachment; filename*=UTF-8''" |
| | | + URLEncoder.encode(fileName, StandardCharsets.UTF_8.name()).replace("+", "%20")); |
| | | try (OutputStream output = response.getOutputStream()) { |
| | | workbook.write(output); |
| | | output.flush(); |
| | | } |
| | | } finally { |
| | | // HSSFWorkbook 由旧版 POI 提供,不调用新版 Workbook 的 close API。 |
| | | } |
| | | } |
| | | |
| | | /** 列表和导出共用同一查询与数据展示转换,保证权限范围和筛选条件一致。 */ |
| | | private List<Map<String, Object>> queryBookingOrders(BookingQuery bookingQuery) { |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | |
| | | if(objectType==2){ |
| | | if (objectType == 2) { |
| | | List<Integer> operatorId = storeService.list(new QueryWrapper<TStore>() |
| | | .eq("operatorId", UserExt.getUser().getObjectId())) |
| | | .eq("operatorId", UserExt.getUser().getObjectId())) |
| | | .stream().map(TStore::getId).collect(Collectors.toList()); |
| | | if (operatorId.isEmpty()){ |
| | | operatorId.add(0); |
| | | } |
| | | bookingQuery.setStoreIds(operatorId); |
| | | } |
| | | if(objectType==3){ |
| | | if (objectType == 3) { |
| | | bookingQuery.setStoreId(UserExt.getUser().getObjectId()); |
| | | } |
| | | List<Map<String,Object>> orders = ballClient.listorder(bookingQuery); |
| | | System.out.println("=======ballQueryDto=========="+bookingQuery); |
| | | List<Map<String, Object>> orders = ballClient.listorder(bookingQuery); |
| | | System.out.println("=======ballQueryDto==========" + bookingQuery); |
| | | for (Map<String, Object> vo : orders) { |
| | | |
| | | |
| | | if (vo.get("payType")!=null && Integer.parseInt(vo.get("payType").toString()) == 1){ |
| | | vo.put("payType","微信"); |
| | | }else if (vo.get("payType")!=null && Integer.parseInt(vo.get("payType").toString()) == 2){ |
| | | vo.put("payType","支付宝"); |
| | | }else if (vo.get("payType")!=null && Integer.parseInt(vo.get("payType").toString()) == 3){ |
| | | vo.put("payType","玩湃币"); |
| | | }else if (vo.get("payType")!=null && Integer.parseInt(vo.get("payType").toString()) == 4){ |
| | | if (vo.get("payUserId")!=null){ |
| | | if (vo.get("payType") != null && Integer.parseInt(vo.get("payType").toString()) == 1) { |
| | | vo.put("payType", "微信"); |
| | | } else if (vo.get("payType") != null && Integer.parseInt(vo.get("payType").toString()) == 2) { |
| | | vo.put("payType", "支付宝"); |
| | | } else if (vo.get("payType") != null && Integer.parseInt(vo.get("payType").toString()) == 3) { |
| | | vo.put("payType", "玩湃币"); |
| | | } else if (vo.get("payType") != null && Integer.parseInt(vo.get("payType").toString()) == 4) { |
| | | if (vo.get("payUserId") != null) { |
| | | User payUserId = userService.getById(Integer.parseInt(vo.get("payUserId").toString())); |
| | | if(payUserId!=null){ |
| | | vo.put("payType","手动支付"+"-"+payUserId.getName()); |
| | | if (payUserId != null) { |
| | | vo.put("payType", "手动支付" + "-" + payUserId.getName()); |
| | | } |
| | | } |
| | | } |
| | |
| | | return orders; |
| | | } |
| | | |
| | | private String targetAudienceName(Object targetAudience) { |
| | | Integer value = toInteger(targetAudience); |
| | | if (Objects.equals(value, 1)) return "订场"; |
| | | if (Objects.equals(value, 2)) return "散客"; |
| | | return ""; |
| | | } |
| | | |
| | | private String moneyText(Object payType, Object payMoney) { |
| | | if (payMoney == null) return ""; |
| | | return valueOf(payMoney) + ("玩湃币".equals(valueOf(payType)) ? "币" : "元"); |
| | | } |
| | | |
| | | private Integer toInteger(Object value) { |
| | | if (value == null || value.toString().trim().isEmpty()) return null; |
| | | try { |
| | | return Integer.valueOf(value.toString()); |
| | | } catch (NumberFormatException ignored) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | private String valueOf(Object value) { |
| | | return value == null ? "" : String.valueOf(value); |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/addjs") |
| | | @ResponseBody |
| | | public ResultUtil addjs( @RequestBody JsDto jsDto) { |
| | | System.out.println("=======jsDto========"+jsDto); |
| | | public ResultUtil addjs(@RequestBody JsDto jsDto) { |
| | | System.out.println("=======jsDto========" + jsDto); |
| | | storeService.insert(jsDto); |
| | | return new ResultUtil(0,0,"保存成功",null,null); |
| | | return new ResultUtil(0, 0, "保存成功", null, null); |
| | | |
| | | } |
| | | |
| | | @RequestMapping("/get/{id}") |
| | | @ResponseBody |
| | | public JsDto getJs( @PathVariable("id") Integer id) { |
| | | JsDto jsDto = storeService.get(id); |
| | | public JsDto getJs(@PathVariable("id") Integer id) { |
| | | JsDto jsDto = storeService.get(id); |
| | | return jsDto; |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/getMoney/{id}/{type}") |
| | | @ResponseBody |
| | | public List<Double> getMoney( @PathVariable("id") Integer id,@PathVariable("type") Integer type) { |
| | | public List<Double> getMoney(@PathVariable("id") Integer id, @PathVariable("type") Integer type) { |
| | | List<Double> doubles = new ArrayList<>(); |
| | | Site site = siteClient.listById(id); |
| | | System.out.println("=====stie====="+site); |
| | | System.out.println("=====type====="+type); |
| | | System.out.println("=====stie=====" + site); |
| | | System.out.println("=====type=====" + type); |
| | | |
| | | if (type == 1 ){ |
| | | if (type == 1) { |
| | | doubles.add(site.getCashPrice()); |
| | | doubles.add(Double.valueOf(site.getPlayPaiCoin())); |
| | | return doubles; |
| | | }else { |
| | | return doubles; |
| | | } else { |
| | | doubles.add(site.getCashPriceOne()); |
| | | doubles.add(site.getPlayPaiCoinOne()); |
| | | return doubles; |
| | | return doubles; |
| | | } |
| | | |
| | | } |
| | | @Resource |
| | | private SiteClient siteClient; |
| | | |
| | | @Resource |
| | | private SiteClient siteClient; |
| | | |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @RequestMapping("/yuyuetimes/{id}") |
| | | @ResponseBody |
| | | public List<OrderDto> yuyuetimes(@PathVariable("id") Integer id,String date,String siteName,String halfName) throws ParseException { |
| | | public List<OrderDto> yuyuetimes(@PathVariable("id") Integer id, String date, String siteName, String halfName) throws ParseException { |
| | | // System.out.println("=======date======"+date); |
| | | // |
| | | // List<String> strings = new ArrayList<>(); |
| | |
| | | Date isPass = format.parse(etime); |
| | | |
| | | |
| | | |
| | | orderDto.setState(1); |
| | | // 查出lock |
| | | List<SiteLock> list = siteLockService.list(new LambdaQueryWrapper<SiteLock>().eq(SiteLock::getSiteId, id)); |
| | |
| | | } |
| | | |
| | | } |
| | | if (isPass.before(now)){ |
| | | if (isPass.before(now)) { |
| | | orderDto.setState(0); |
| | | } |
| | | |
| | |
| | | System.out.println("-------------" + timeRanges); |
| | | |
| | | return timeRanges; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | if (minute == 45) { |
| | | hour++; |
| | | minute = 0; |
| | | } else if (minute == 0){ |
| | | } else if (minute == 0) { |
| | | minute = 15; |
| | | }else if (minute == 15){ |
| | | } else if (minute == 15) { |
| | | minute = 30; |
| | | }else if (minute == 30){ |
| | | } else if (minute == 30) { |
| | | minute = 45; |
| | | } |
| | | |
| | |
| | | @RequestMapping("/halfName/{id}") |
| | | @ResponseBody |
| | | public String[] halfName(@PathVariable("id") Integer id) { |
| | | TSite byId = siteService.getById(id); |
| | | TSite byId = siteService.getById(id); |
| | | String[] split = byId.getHalfName().split(","); |
| | | System.out.println("=-============"+split); |
| | | System.out.println("=-============" + split); |
| | | |
| | | return split; |
| | | } |
| | |
| | | @RequestMapping("/nextName/{id}") |
| | | @ResponseBody |
| | | public String[] nextName(@PathVariable("id") Integer id) { |
| | | TSite byId = siteService.getById(id); |
| | | TSite byId = siteService.getById(id); |
| | | String[] split = byId.getNextName().split(","); |
| | | System.out.println("=-============"+split); |
| | | System.out.println("=-============" + split); |
| | | |
| | | return split; |
| | | } |
| | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | String cityCode = null; |
| | | if(objectType == 2){//城市管理员 |
| | | if (objectType == 2) {//城市管理员 |
| | | // 获取到这个运营商下面的所有门店 |
| | | List<TStore> operatorId = storeService.list(new QueryWrapper<TStore>().eq("operatorId",objectId)); |
| | | List<TStore> operatorId = storeService.list(new QueryWrapper<TStore>().eq("operatorId", objectId)); |
| | | model.addAttribute("store", operatorId); |
| | | List<Coach> coach = coachClient.queryCoachByOperatorId(objectId); |
| | | model.addAttribute("coach", coach); |
| | | // 如果该运营商下面没有门店 |
| | | if (operatorId.size()==0){ |
| | | if (operatorId.size() == 0) { |
| | | List<TStore> o = new ArrayList<>(); |
| | | List<TSite> tSites = new ArrayList<>(); |
| | | model.addAttribute("store", o); |
| | | model.addAttribute("site", tSites); |
| | | }else{ |
| | | } else { |
| | | List<TSite> storeId = siteService.list(new QueryWrapper<TSite>() |
| | | .eq("storeId", operatorId.get(0).getId())); |
| | | model.addAttribute("site", storeId); |
| | | } |
| | | }else { |
| | | } else { |
| | | List<Map<String, Object>> list = storeService.queryProvince(cityCode); |
| | | model.addAttribute("province", list); |
| | | Object code = list.get(0).get("code"); |
| | | List<Map<String, Object>> list1 = storeService.queryCity(code.toString(), cityCode); |
| | | model.addAttribute("city", list1); |
| | | String code1 = list1.get(0).get("code").toString(); |
| | | List<TStore> list2 =new ArrayList<>(); |
| | | if(objectType==3){ |
| | | List<TStore> list2 = new ArrayList<>(); |
| | | if (objectType == 3) { |
| | | list2 = storeService.list(new QueryWrapper<TStore>().eq("id", objectId).eq("state", 1)); |
| | | }else { |
| | | list2 = storeService.list(new QueryWrapper<TStore>().eq("cityCode", code1).eq("state", 1)); |
| | | } else { |
| | | list2 = storeService.list(new QueryWrapper<TStore>().eq("cityCode", code1).eq("state", 1)); |
| | | } |
| | | model.addAttribute("store", list2); |
| | | |
| | |
| | | List<TSite> list3 = siteService.list(new QueryWrapper<TSite>().eq("storeId", store.getId()).eq("state", 1)); |
| | | model.addAttribute("site", list3); |
| | | } |
| | | model.addAttribute("objectType",objectType); |
| | | return PREFIX+"yuyue_add.html"; |
| | | model.addAttribute("objectType", objectType); |
| | | return PREFIX + "yuyue_add.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping("/ordersave") |
| | | @ResponseBody |
| | | public ResultUtil ordersave(SiteBooking siteBooking){ |
| | | public ResultUtil ordersave(SiteBooking siteBooking) { |
| | | siteBooking.setInsertTime(new Date()); |
| | | siteBooking.setState(1); |
| | | siteBooking.setStatus(0); |
| | | siteBooking.setAddType(1); |
| | | |
| | | |
| | | //存开始和结束时间 |
| | | // times格式示例: 2025-10-14 19:00-19:30;2025-10-14 19:30-20:00;2025-10-14 20:00-20:30;2025-10-14 20:30-21:00 |
| | | // targetAudience字段会由Spring MVC自动绑定(1=订场,2=散客) |
| | | String times = siteBooking.getTimes(); |
| | | String[] dates = times.split(";"); |
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | try { |
| | | // 提取最早的开始时间 |
| | | // dates[0] 格式: 2025-10-14 19:00-19:30 |
| | | String start = dates[0]; |
| | | String startDateStr = start.substring(0, start.lastIndexOf("-")); |
| | | Date startDate = format.parse(startDateStr); |
| | | |
| | | // 提取最晚的结束时间 |
| | | // dates[dates.length - 1] 格式: 2025-10-14 20:30-21:00 |
| | | String end = dates[dates.length - 1]; |
| | | String[] str = end.split(" "); |
| | | String endDateStr = str[0] + " " + str[1].substring(str[1].indexOf("-") + 1); |
| | | Date endDate = format.parse(endDateStr); |
| | | |
| | | siteBooking.setStartTime(startDate); |
| | | siteBooking.setEndTime(endDate); |
| | | } catch (Exception e) { |
| | |
| | | String money = siteBooking.getMoney(); |
| | | String[] moneys = money.split(","); |
| | | siteBooking.setPayMoney(Double.valueOf(moneys[0])); |
| | | siteBooking.setMoney(money); |
| | | // 查询当前预约人是否是会员 |
| | | String phone = siteBooking.getPhone(); |
| | | String booker = siteBooking.getBooker(); |
| | | TAppUser appUserByPhone = appUserClient.getAppUserByPhone(phone); |
| | | TStore byId1 = storeService.getById(siteBooking.getStoreId()); |
| | | if (appUserByPhone== null){ |
| | | if (appUserByPhone == null) { |
| | | // 则当前预约人不是会员 添加到会员表里 |
| | | TAppUser tAppUser = new TAppUser(); |
| | | tAppUser.setName(booker); |
| | |
| | | appUserClient.addAppUser1(tAppUser); |
| | | TAppUser appUserByPhone1 = appUserClient.getAppUserByPhone(phone); |
| | | siteBooking.setAppUserId(appUserByPhone1.getId()); |
| | | }else{ |
| | | } else { |
| | | siteBooking.setAppUserId(appUserByPhone.getId()); |
| | | } |
| | | // 如果是运营商添加的话 根据门店的省市来存储 |
| | | if (UserExt.getUser().getObjectType() == 2){ |
| | | if (UserExt.getUser().getObjectType() == 2) { |
| | | TStore byId = storeService.getById(siteBooking.getStoreId()); |
| | | siteBooking.setProvince(byId.getProvince()); |
| | | siteBooking.setProvinceCode(byId.getProvinceCode()); |
| | | siteBooking.setCity(byId.getCity()); |
| | | siteBooking.setCityCode(byId.getCityCode()); |
| | | } |
| | | if (UserExt.getUser().getObjectType() == 3){ |
| | | if (UserExt.getUser().getObjectType() == 3) { |
| | | TStore byId = storeService.getById(UserExt.getUser().getObjectId()); |
| | | siteBooking.setProvince(byId.getProvince()); |
| | | siteBooking.setProvinceCode(byId.getProvinceCode()); |
| | |
| | | siteBooking.setCityCode(byId.getCityCode()); |
| | | } |
| | | |
| | | if (siteBooking.getIsHalf()==2){ |
| | | siteBooking.setHalfName(null); |
| | | } |
| | | siteClient.addSiteBooking(siteBooking); |
| | | System.out.println("================="+siteBooking); |
| | | return new ResultUtil<>(null,200,null,null,null); |
| | | System.out.println("=================" + siteBooking); |
| | | return new ResultUtil<>(null, 200, null, null, null); |
| | | } |
| | | |
| | | @RequestMapping("/orderedit") |
| | | @ResponseBody |
| | | public ResultUtil orderedit(SiteBooking siteBooking){ |
| | | iSiteBookingService.updateById(siteBooking); |
| | | public ResultUtil orderedit(SiteBooking siteBooking) { |
| | | iSiteBookingService.updateById(siteBooking); |
| | | |
| | | System.out.println("================="+siteBooking); |
| | | System.out.println("=================" + siteBooking); |
| | | |
| | | return new ResultUtil<>(null,200,null,null,null); |
| | | return new ResultUtil<>(null, 200, null, null, null); |
| | | } |
| | | |
| | | } |