| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.other.entity.*; |
| | | import com.dsh.other.feignclient.CourseRecordClient; |
| | | import com.dsh.other.feignclient.account.CityManagerClient; |
| | | import com.dsh.other.feignclient.activity.UserCouponClient; |
| | | import com.dsh.other.feignclient.activity.model.QueryUserCouponByIdAndUserId; |
| | |
| | | import com.dsh.other.feignclient.model.BillingDataRequestVo; |
| | | import com.dsh.other.feignclient.model.SiteChangeStateVO; |
| | | import com.dsh.other.feignclient.model.SiteVo; |
| | | import com.dsh.other.mapper.TOperatorUserMapper; |
| | | import com.dsh.other.model.*; |
| | | import com.dsh.other.model.dto.siteDto.TSiteDTO; |
| | | import com.dsh.other.model.vo.siteVo.ExpireSiteSearchVO; |
| | |
| | | private UserCouponClient userCouponClient; |
| | | @Autowired |
| | | private CityManagerClient cityManagerClient; |
| | | @Autowired |
| | | private IOperatorUserService operatorUserService; |
| | | |
| | | /** |
| | | * 通过运营商id查询运营商对应的支付宝商户号 |
| | | */ |
| | | @RequestMapping("/base/getSMIDByOperatorId") |
| | | @ResponseBody |
| | | public String getSMIDByOperatorId(Integer id) { |
| | | // 获取运营商的管理员 |
| | | return siteService.getSMIDByOperatorId(id); |
| | | }/** |
| | | * 根据运营商id获取对应运营商分账比例 返回格式: 微信分账比例,支付宝分账比例 |
| | | */ |
| | | @RequestMapping("/base/getProportionByOperatorId") |
| | | @ResponseBody |
| | | public String getProportionByOperatorId(Integer id) { |
| | | OperatorUser operatorId = operatorUserService.getOne( |
| | | new QueryWrapper<OperatorUser>().eq("operatorId",id) |
| | | ); |
| | | if (operatorId.getWechatProportion() == null){ |
| | | operatorId.setWechatProportion("0"); |
| | | } |
| | | if (operatorId.getAlipayProportion() == null){ |
| | | operatorId.setAlipayProportion("0"); |
| | | } |
| | | return operatorId.getWechatProportion()+","+operatorId.getAlipayProportion(); |
| | | } |
| | | /** |
| | | * 获取所有场地 |
| | | */ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 预约场地支付宝回调 |
| | | * |
| | |
| | | if (null != map) { |
| | | String code = map.get("out_trade_no"); |
| | | String trade_no = map.get("trade_no"); |
| | | SiteBooking siteBooking = siteBookingService.getOne(new QueryWrapper<SiteBooking>().eq("orderNo", code).eq("state", 1)); |
| | | SiteBooking siteBooking = siteBookingService.getOne(new QueryWrapper<SiteBooking>() |
| | | .eq("orderNo", code).eq("state", 1)); |
| | | if (siteBooking.getStatus() == 0) { |
| | | siteBooking.setPayTime(new Date()); |
| | | siteBooking.setStatus(1); |
| | |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private TGameConfigService gameConfigService; |
| | | @Autowired |
| | | private TGameRecordService gameRecordService; |
| | | |
| | | @Resource |
| | | private CourseRecordClient courseRecordClient; |
| | | /** |
| | | * 启动游戏支付宝回调 |
| | | * |
| | |
| | | if (null != map) { |
| | | |
| | | String code = map.get("passback_params"); |
| | | // String trade_no = map.get("trade_no"); |
| | | // SiteBooking siteBooking = siteBookingService.getOne(new QueryWrapper<SiteBooking>().eq("orderNo", code).eq("state", 1)); |
| | | // if(siteBooking.getStatus() == 0){ |
| | | // siteBooking.setPayTime(new Date()); |
| | | // siteBooking.setStatus(1); |
| | | // siteBooking.setPayOrderNo(trade_no); |
| | | // siteBookingService.updateById(siteBooking); |
| | | // } |
| | | |
| | | String trade_no = map.get("trade_no"); |
| | | String[] s = code.split("_"); |
| | | Integer i = startGame(Integer.valueOf(s[0]), Integer.valueOf(s[1]), Integer.valueOf(s[2]), Integer.valueOf(s[3])); |
| | | List<TGameRecord> list = gameRecordService.list(new QueryWrapper<TGameRecord>().eq("number", s[4]).eq("payType", 2)); |
| | | TGameRecord one = list.get(0); |
| | | TGameConfig config = gameConfigService.getById(s[5]); |
| | | for (TGameRecord coursePackagePayment : list) { |
| | | coursePackagePayment.setStatus(1); |
| | | coursePackagePayment.setMoney(config.getCash()); |
| | | coursePackagePayment.setOrderNo(trade_no); |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setChangeType(3); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("智慧球场;" + config.getCash()); |
| | | courseCounsum.setAppUserId(Integer.valueOf(s[0])); |
| | | courseRecordClient.save(courseCounsum); |
| | | } |
| | | gameRecordService.updateBatchById(list); |
| | | |
| | | System.err.println("===========游戏回调游戏回调=========" + i); |
| | | PrintWriter out = response.getWriter(); |
| | | out.write("success"); |
| | |
| | | JSONObject jsonObject = JSONObject.parseObject(s); |
| | | Object code = jsonObject.get("code"); |
| | | if (String.valueOf(code) != null && "200".equals(String.valueOf(code))) { |
| | | System.err.println("启动了一次游戏"); |
| | | return 200; |
| | | } else { |
| | | return 500; |
| | |
| | | |
| | | @Autowired |
| | | private StoreService service; |
| | | |
| | | @Autowired |
| | | private IOperatorUserService operatorUserService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/site/game") |