Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PlayPai
Conflicts:
cloud-server-account/src/main/resources/sharding-jdbc.properties
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/OperatorController.java
| | |
| | | datasource.names=master0 |
| | | datasource.master0.type=com.alibaba.druid.pool.DruidDataSource |
| | | datasource.master0.driverClassName=com.mysql.cj.jdbc.Driver |
| | | datasource.master0.url=jdbc:mysql://192.168.110.110/playpai_activity?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.url=jdbc:mysql://127.0.0.1:3306/playpai_activity?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.username=root |
| | | datasource.master0.password=123456 |
| | | datasource.master0.password=playpai2023! |
| | | datasource.master0.maxActive=20 |
| | | datasource.master0.maxWait=60000 |
| | | datasource.master0.minIdle=5 |
| | |
| | | @Resource |
| | | private StudentClient studentClient; |
| | | @PostMapping("/base/competition/getPeopleFromId1") |
| | | public List<CompetitionUser> getPeopleFromId1(@RequestBody GetPeopleQuery getPeopleQuery) { |
| | | public Page<CompetitionUser> getPeopleFromId1(@RequestBody GetPeopleQuery getPeopleQuery) { |
| | | try { |
| | | Page<UserCompetition> participantPage = new Page<>(getPeopleQuery.getOffset(), getPeopleQuery.getLimit()); |
| | | List<CompetitionUser> page = participantService.getPeopleFromId1(participantPage, getPeopleQuery.getId(), getPeopleQuery.getState()); |
| | | |
| | | List<CompetitionUser> users = new ArrayList<>(); |
| | | List<UserCompetition> coms = userCompetitionService.list(new QueryWrapper<UserCompetition>().eq("competitionId", getPeopleQuery.getId())); |
| | | for (UserCompetition com : coms) { |
| | | int number = com.getParticipantId(); |
| | | String numberString = Integer.toString(number); |
| | | int digitCount = numberString.length(); |
| | | if (digitCount!=9){ |
| | | TStudent tStudent = studentClient.queryById(number); |
| | | CompetitionUser competitionUser = new CompetitionUser(); |
| | | competitionUser.setName(tStudent.getName()); |
| | | competitionUser.setPhone(tStudent.getPhone()); |
| | | competitionUser.setSex(tStudent.getSex()); |
| | | competitionUser.setIdCard(tStudent.getIdCard()); |
| | | competitionUser.setState(tStudent.getState()); |
| | | users.add(competitionUser); |
| | | } |
| | | } |
| | | page.addAll(users); |
| | | |
| | | Page<CompetitionUser> page = participantService.getPeopleFromId1(getPeopleQuery.getOffset(), getPeopleQuery.getLimit(), getPeopleQuery.getId(), getPeopleQuery.getState()); |
| | | return page; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/7/6 16:51 |
| | | */ |
| | | public interface ParticipantMapper extends BaseMapper<Participant> { |
| | | Page<CompetitionUser> getPeopleFromId(@Param("participantPage") Page<UserCompetition> participantPage, @Param("id") Integer id, @Param("state") Integer state); |
| | | Page<CompetitionUser> getPeopleFromId(Page<UserCompetition> participantPage, @Param("id") Integer id, @Param("state") Integer state); |
| | | |
| | | |
| | | List<CompetitionUser> getPeopleFromId1(@Param("participantPage") Page<UserCompetition> participantPage, @Param("id") Integer id, @Param("state") Integer state); |
| | | List<UserCompetition> getPeopleFromId1(@Param("id") Integer id, @Param("state") Integer state, |
| | | @Param("offset") long offset, @Param("limit") long limit); |
| | | |
| | | Integer getPeopleFromIdCount(@Param("id") Integer id, @Param("state") Integer state); |
| | | |
| | | List<CompetitionUser> getPeoples(@Param("id") Integer id, @Param("state") Integer state); |
| | | } |
| | |
| | | void saveParticipant(SaveParticipant saveParticipant) throws Exception; |
| | | |
| | | Page<CompetitionUser> getPeopleFromId(Page<UserCompetition> participantPage, Integer id, Integer state); |
| | | List<CompetitionUser> getPeopleFromId1(Page<UserCompetition> participantPage, Integer id, Integer state); |
| | | Page<CompetitionUser> getPeopleFromId1(long offset, long limit, Integer id, Integer state); |
| | | |
| | | List<CompetitionUser> getPeoples(Integer id, Integer state); |
| | | } |
| | |
| | | import com.dsh.competition.service.IPaymentCompetitionService; |
| | | import com.dsh.competition.service.UserCompetitionService; |
| | | import com.dsh.competition.util.*; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.competition.entity.Participant; |
| | | import com.dsh.competition.entity.PaymentCompetition; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.feignclient.account.StudentClient; |
| | | import com.dsh.competition.feignclient.account.model.Student; |
| | |
| | | import com.dsh.competition.model.ParticipantVo; |
| | | import com.dsh.competition.model.SaveParticipant; |
| | | import com.dsh.competition.service.IParticipantService; |
| | | import com.dsh.competition.service.IPaymentCompetitionService; |
| | | import com.dsh.competition.service.UserCompetitionService; |
| | | import com.dsh.competition.util.CodeGenerateUtils; |
| | | import com.dsh.competition.util.JuHeUtil; |
| | | import com.dsh.competition.util.ResultUtil; |
| | | import com.dsh.competition.util.ToolUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | |
| | | @Resource |
| | | private StudentClient studentClient; |
| | | |
| | | @Autowired |
| | | private UserCompetitionService userCompetitionService; |
| | | |
| | | @Autowired |
| | | private IPaymentCompetitionService paymentCompetitionService; |
| | | |
| | | |
| | | /** |
| | |
| | | return this.baseMapper.getPeopleFromId(participantPage, id, state); |
| | | } |
| | | @Override |
| | | public List<CompetitionUser> getPeopleFromId1(Page<UserCompetition> participantPage, Integer id, Integer state) { |
| | | return this.baseMapper.getPeopleFromId1(participantPage, id, state); |
| | | public Page<CompetitionUser> getPeopleFromId1(long offset, long limit, Integer id, Integer state) { |
| | | List<UserCompetition> peopleFromId1 = this.baseMapper.getPeopleFromId1(id, state, offset, limit); |
| | | int count = this.baseMapper.getPeopleFromIdCount(id, state); |
| | | List<CompetitionUser> list = new ArrayList<>(); |
| | | for (UserCompetition userCompetition : peopleFromId1) { |
| | | Long paymentCompetitionId = userCompetition.getPaymentCompetitionId(); |
| | | PaymentCompetition paymentCompetition = paymentCompetitionService.getById(paymentCompetitionId); |
| | | Participant participant = this.getById(userCompetition.getParticipantId()); |
| | | CompetitionUser competitionUser = new CompetitionUser(); |
| | | if(null != participant){ |
| | | competitionUser.setName(participant.getName()); |
| | | competitionUser.setSex(participant.getGender()); |
| | | competitionUser.setPhone(participant.getPhone()); |
| | | competitionUser.setIdCard(participant.getIdcard()); |
| | | }else{ |
| | | TStudent tStudent = studentClient.queryById(userCompetition.getParticipantId()); |
| | | competitionUser.setName(tStudent.getName()); |
| | | competitionUser.setSex(tStudent.getSex()); |
| | | competitionUser.setPhone(tStudent.getPhone()); |
| | | competitionUser.setIdCard(tStudent.getIdCard()); |
| | | } |
| | | if(null != paymentCompetition){ |
| | | competitionUser.setState(paymentCompetition.getPayStatus()); |
| | | } |
| | | list.add(competitionUser); |
| | | } |
| | | Page<CompetitionUser> page = new Page<>(); |
| | | page.setRecords(list); |
| | | page.setTotal(count); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getPeopleFromId1" resultType="com.dsh.competition.feignclient.model.CompetitionUser"> |
| | | select t2.name,t2.gender sex,t2.phone ,t2.idcard idCard ,t3.payStatus state |
| | | from t_user_competition t1 left join t_participant t2 on t1.participantId = t2.id |
| | | left join t_payment_competition t3 on t1.paymentCompetitionId = t3.id |
| | | where t1.competitionId =#{id} and t2.id is not null and t3.id is not null |
| | | <if test="state !=null and state !='' and state ==1"> |
| | | and t3.payStatus in (1,2) |
| | | <select id="getPeopleFromId1" resultType="com.dsh.competition.entity.UserCompetition"> |
| | | select * from ( |
| | | select |
| | | a.* |
| | | from t_user_competition a |
| | | left join t_payment_competition b on (a.paymentCompetitionId = b.id) |
| | | where b.state = 1 and b.payStatus != 1 and a.competitionId = #{id} |
| | | <if test="null != state and state == 1"> |
| | | and b.payStatus = 2 |
| | | </if> |
| | | <if test="state !=null and state !='' and state ==3"> |
| | | and t3.payStatus =3 |
| | | <if test="null != state and state == 3"> |
| | | and b.payStatus = 3 |
| | | </if> |
| | | group by a.id |
| | | ) as aa where aa.id is not null order by aa.insertTime desc limit #{offset}, #{limit} |
| | | </select> |
| | | |
| | | <select id="getPeopleFromIdCount" resultType="java.lang.Integer"> |
| | | select |
| | | count(*) |
| | | from ( |
| | | select |
| | | a.id |
| | | from t_user_competition a |
| | | left join t_payment_competition b on (a.paymentCompetitionId = b.id) |
| | | where b.state = 1 and b.payStatus != 1 and a.competitionId = #{id} |
| | | <if test="null != state and state == 1"> |
| | | and b.payStatus = 2 |
| | | </if> |
| | | <if test="null != state and state == 3"> |
| | | and b.payStatus = 3 |
| | | </if> |
| | | group by a.id |
| | | ) as aa where aa.id is not null |
| | | </select> |
| | | |
| | | |
| | | <select id="getPeoples" resultType="com.dsh.competition.feignclient.model.CompetitionUser"> |
| | | select t2.id, t2.name,t2.gender sex,t2.phone ,t2.idcard idCard ,t3.payStatus state |
| | | from t_user_competition t1 left join t_participant t2 on t1.participantId = t2.id |
| | |
| | | datasource.names=master0 |
| | | datasource.master0.type=com.alibaba.druid.pool.DruidDataSource |
| | | datasource.master0.driverClassName=com.mysql.cj.jdbc.Driver |
| | | datasource.master0.url=jdbc:mysql://192.168.110.110/playpai_competition?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.url=jdbc:mysql://127.0.0.1:3306/playpai_competition?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.username=root |
| | | datasource.master0.password=123456 |
| | | datasource.master0.password=playpai2023! |
| | | datasource.master0.maxActive=20 |
| | | datasource.master0.maxWait=60000 |
| | | datasource.master0.minIdle=5 |
| | |
| | | }) |
| | | public ResultUtil continuationOperation(ClasspaymentRequest request) { |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if (null == userIdFormRedis) { |
| | | Integer userId = tokenUtil.getUserIdFormRedis(); |
| | | if (null == userId) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Integer couponId = request.getConponId(); |
| | | if (couponId == null || couponId == 0) { |
| | | request.setConponId(null); |
| | | } |
| | | return packagePaymentService.ContinuationOrpaymentCourse(userIdFormRedis, request); |
| | | return packagePaymentService.ContinuationOrpaymentCourse(userId, request); |
| | | } catch (Exception e) { |
| | | return ResultUtil.runErr(); |
| | | } |
| | |
| | | CourseDetailsResponse queryRegisteredCourseDetails(Long coursePayId, Integer appUserId, String lon, String lat); |
| | | |
| | | |
| | | ResultUtil ContinuationOrpaymentCourse(Integer userIdFormRedis, ClasspaymentRequest request); |
| | | ResultUtil ContinuationOrpaymentCourse(Integer userId, ClasspaymentRequest request); |
| | | |
| | | /** |
| | | * 查询学员的课包上课记录 |
| | |
| | | import com.alipay.api.AlipayApiException; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.CoursePackagePaymentConfig; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.feignclient.model.CourseOfStoreVo; |
| | | import com.dsh.course.model.*; |
| | |
| | | * @return |
| | | */ |
| | | ResultUtil paymentCourseCallback(String code, String trade_no, String attach) throws AlipayApiException; |
| | | |
| | | |
| | | |
| | | void addCoursePackageOrderStudent(Long coursePackageOrderId, CoursePackagePaymentConfig coursePackagePaymentConfig); |
| | | |
| | | |
| | | |
| | | void moneyOut(String outNum, String tradeNo,String code) throws AlipayApiException; |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.AlipayApiException; |
| | | import com.alipay.api.domain.Person; |
| | | import com.alipay.api.response.AlipayTradeQueryResponse; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil ContinuationOrpaymentCourse(Integer ids, ClasspaymentRequest request) { |
| | | AppUser userIdFormRedis = appuClient.queryAppUser(ids); |
| | | TCoursePackagePayment tCoursePackagePayment = this.baseMapper.selectById(request.getCoursePayId()); |
| | | public ResultUtil ContinuationOrpaymentCourse(Integer userId, ClasspaymentRequest request) { |
| | | AppUser appUser = appuClient.queryAppUser(userId); |
| | | CoursePackageOrder coursePackageOrder = coursePackageOrderService.getById(request.getCoursePayId()); |
| | | String code = ""; |
| | | BigDecimal money = tCoursePackagePayment.getCashPayment(); |
| | | Integer wpGold = tCoursePackagePayment.getPlayPaiCoin(); |
| | | if (tCoursePackagePayment.getPayStatus() == 1) { |
| | | // 待支付的订单 |
| | | code = tCoursePackagePayment.getCode(); |
| | | tCoursePackagePayment.setPayType(request.getPayType()); |
| | | BigDecimal money = coursePackageOrder.getCashPayment(); |
| | | Integer wpGold = coursePackageOrder.getPlayPaiCoin(); |
| | | if (coursePackageOrder.getPayStatus() == 1) { |
| | | code = coursePackageOrder.getCode(); |
| | | coursePackageOrder.setPayType(request.getPayType()); |
| | | if (request.getUseConpon() == 1) { |
| | | tCoursePackagePayment.setUserCouponId(Long.valueOf(request.getUseConpon())); |
| | | coursePackageOrder.setUserCouponId(Long.valueOf(request.getUseConpon())); |
| | | } |
| | | this.baseMapper.updateById(tCoursePackagePayment); |
| | | coursePackageOrder.setAppUserId(null); |
| | | coursePackageOrderService.updateById(coursePackageOrder); |
| | | } else { |
| | | // 续课的订单 |
| | | // 查询是否续课优惠 |
| | | |
| | | CoursePackagePaymentConfig paymentConfig = cpConfigMapper.selectOne(new QueryWrapper<CoursePackagePaymentConfig>() |
| | | .eq("coursePackageId", request.getLessonId()) |
| | | .eq("classHours", request.getCourseHoursNum())); |
| | |
| | | if (ToolUtil.isNotEmpty(coursePackageDiscount)) { |
| | | String content = coursePackageDiscount.getContent(); |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | if (userIdFormRedis.getIsVip() == 1) { |
| | | if (appUser.getIsVip() == 1) { |
| | | Double jsonObjectDouble = jsonObject.getDouble("num1"); |
| | | money = BigDecimal.valueOf(jsonObjectDouble); |
| | | } else { |
| | |
| | | money = BigDecimal.valueOf(jsonObjectDouble); |
| | | } |
| | | } |
| | | TCoursePackagePayment newPayment = new TCoursePackagePayment(); |
| | | CoursePackageOrder newPayment = new CoursePackageOrder(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | newPayment.setCode(sdf.format(new Date()) + UUIDUtil.getNumberRandom(5)); |
| | | newPayment.setAppUserId(userIdFormRedis.getId()); |
| | | newPayment.setStudentId(request.getStuId()); |
| | | newPayment.setAppUserId(appUser.getId()); |
| | | newPayment.setStudentIds(request.getStuId().toString()); |
| | | newPayment.setCoursePackageId(request.getLessonId()); |
| | | newPayment.setClassHours(tCoursePackagePayment.getClassHours()); |
| | | newPayment.setOriginalPrice(tCoursePackagePayment.getOriginalPrice()); |
| | | newPayment.setTotalClassHours(tCoursePackagePayment.getTotalClassHours()); |
| | | newPayment.setLaveClassHours(tCoursePackagePayment.getTotalClassHours()); |
| | | newPayment.setClassHours(coursePackageOrder.getClassHours()); |
| | | newPayment.setOriginalPrice(coursePackageOrder.getOriginalPrice()); |
| | | if (request.getUseConpon() == 1) { |
| | | newPayment.setUserCouponId(Long.valueOf(request.getUseConpon())); |
| | | } |
| | | newPayment.setAbsencesNumber(0); |
| | | newPayment.setPayUserType(1); |
| | | newPayment.setPayStatus(1); |
| | | newPayment.setStatus(1); |
| | | newPayment.setPayType(request.getPayType()); |
| | | newPayment.setState(1); |
| | | newPayment.setInsertTime(new Date()); |
| | | this.baseMapper.insert(newPayment); |
| | | coursePackageOrderService.save(newPayment); |
| | | code = newPayment.getCode(); |
| | | } |
| | | switch (request.getPayType()) { |
| | |
| | | } |
| | | return AlipayPayment(code, money); |
| | | case 3: |
| | | PlaypaiGoldPayment(userIdFormRedis, code, wpGold); |
| | | PlaypaiGoldPayment(appUser, code, wpGold); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | |
| | | |
| | | public ResultUtil WeChatPayment(String code, BigDecimal request) throws Exception { |
| | | TCoursePackagePaymentMapper baseMapper1 = this.baseMapper; |
| | | ResultUtil weixinpay = payMoneyUtil.weixinpay("课包续费", "", code, request.toString(), |
| | | "/base/coursePackage/wechatRegisteredCoursesCallback", "APP", ""); |
| | | if (weixinpay.getCode() == 200) { |
| | | String finalCode = code; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | int min = 5000; |
| | | wait += (min * num); |
| | | Thread.sleep(wait); |
| | | TCoursePackagePayment coursePackagePayment = baseMapper1.getCoursePackagePaymentByCode(code); |
| | | if (coursePackagePayment.getPayStatus() == 2) { |
| | | CoursePackageOrder coursePackageOrder1 = coursePackageOrderService.getOne(new QueryWrapper<CoursePackageOrder>() |
| | | .eq("code", finalCode).eq("state", 1)); |
| | | if (coursePackageOrder1.getPayStatus() == 2) { |
| | | break; |
| | | } |
| | | ResultUtil<Map<String, String>> resultUtil = payMoneyUtil.queryWXOrder(code, ""); |
| | | if (resultUtil.getCode() == 200 && coursePackagePayment.getPayStatus() == 1) { |
| | | ResultUtil<Map<String, String>> resultUtil = payMoneyUtil.queryWXOrder(finalCode, ""); |
| | | if (resultUtil.getCode() == 200 && coursePackageOrder1.getPayStatus() == 1) { |
| | | /** |
| | | * SUCCESS—支付成功, |
| | | * REFUND—转入退款, |
| | |
| | | String s = data1.get("trade_state"); |
| | | String transaction_id = data1.get("transaction_id"); |
| | | if ("REFUND".equals(s) || "NOTPAY".equals(s) || "CLOSED".equals(s) || "REVOKED".equals(s) || "PAYERROR".equals(s) || num == 10) { |
| | | coursePackagePayment.setState(3); |
| | | baseMapper1.deleteById(coursePackagePayment.getId()); |
| | | //有待支付的订单,这里不处理 |
| | | // coursePackageOrder1.setState(3); |
| | | // coursePackageOrderService.updateById(coursePackageOrder1); |
| | | break; |
| | | } |
| | | if ("SUCCESS".equals(s)) { |
| | | coursePackagePayment.setPayStatus(2); |
| | | coursePackagePayment.setOrderNumber(transaction_id); |
| | | baseMapper1.updateById(coursePackagePayment); |
| | | coursePackageOrder1.setPayStatus(2); |
| | | coursePackageOrder1.setOrderNumber(transaction_id); |
| | | coursePackageOrder1.setAppUserId(null); |
| | | coursePackageOrderService.updateById(coursePackageOrder1); |
| | | //修改课时有效期 |
| | | |
| | | CoursePackagePaymentConfig coursePackagePaymentConfig = coursePackagePaymentConfigService.getOne(new QueryWrapper<CoursePackagePaymentConfig>() |
| | | .eq("coursePackageId", coursePackageOrder1.getId()) |
| | | .eq("classHours", coursePackageOrder1.getClassHours()) |
| | | ); |
| | | coursePackageService.addCoursePackageOrderStudent(coursePackageOrder1.getId(), coursePackagePaymentConfig); |
| | | break; |
| | | } |
| | | if ("USERPAYING".equals(s)) { |
| | |
| | | ResultUtil alipay = payMoneyUtil.alipay(smid1,"课包购买", "课包购买", "", code, request.toString(), |
| | | "/base/coursePackage/alipayRegisteredCoursesCallback"); |
| | | if (alipay.getCode() == 200) { |
| | | String finalCode = code; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | Thread.sleep(1000); |
| | | int num = 1; |
| | | int wait = 0; |
| | | while (num <= 10) { |
| | | int min = 5000; |
| | | wait += (min * num); |
| | | Thread.sleep(wait); |
| | | TCoursePackagePayment coursePackagePayment = baseMapper1.getCoursePackagePaymentByCode(code); |
| | | if (coursePackagePayment.getPayStatus() == 2) { |
| | | CoursePackageOrder coursePackageOrder1 = coursePackageOrderService.getOne(new QueryWrapper<CoursePackageOrder>() |
| | | .eq("code", finalCode).eq("state", 1)); |
| | | if (coursePackageOrder1.getPayStatus() == 2) { |
| | | break; |
| | | } |
| | | AlipayTradeQueryResponse alipayTradeQueryResponse = payMoneyUtil.queryALIOrder(code); |
| | | |
| | | if (coursePackagePayment.getPayStatus() == 1) { |
| | | AlipayTradeQueryResponse alipayTradeQueryResponse = payMoneyUtil.queryALIOrder(finalCode); |
| | | if (null != alipayTradeQueryResponse) { |
| | | /** |
| | | * WAIT_BUYER_PAY(交易创建,等待买家付款)、 |
| | | * TRADE_CLOSED(未付款交易超时关闭,或支付完成后全额退款)、 |
| | | * TRADE_SUCCESS(交易支付成功)、 |
| | | * TRADE_FINISHED(交易结束,不可退款) |
| | | */ |
| | | // Map<String, String> data1 = resultUtil.getData(); |
| | | String s = alipayTradeQueryResponse.getTradeStatus(); |
| | | |
| | | String tradeNo = alipayTradeQueryResponse.getTradeNo(); |
| | | if ("TRADE_CLOSED".equals(s) || "TRADE_FINISHED".equals(s) || num == 10) { |
| | | coursePackagePayment.setState(3); |
| | | baseMapper1.deleteById(coursePackagePayment.getId()); |
| | | |
| | | //有待支付的订单,这里不处理 |
| | | // coursePackageOrder1.setState(3); |
| | | // coursePackageOrderService.updateById(coursePackageOrder1); |
| | | break; |
| | | } |
| | | if ("TRADE_SUCCESS".equals(s)) { |
| | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd"); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm"); |
| | | if (tCoursePackagePayments.size() > 0) { |
| | | |
| | | // int pageNum = 1; // 页码 |
| | | int pageSize = 10; // 每页记录数 |
| | | Page<CoursePackageStudent> page = new Page<>(pageNum, pageSize); |
| | | |
| | | // for (TCoursePackagePayment tCoursePackagePayment : tCoursePackagePayments) { |
| | | // List<CoursePackageStudent> coursePackageStudent1 = cpsMapper.selectList(new QueryWrapper<CoursePackageStudent>() |
| | | // .in("coursePackageId",ids) |
| | | // .eq("studentId",stuId) |
| | | // .eq("appUserId",appUserId) |
| | | // .eq("reservationStatus",1)); |
| | | IPage<CoursePackageStudent> coursePackageStudentPage = cpsMapper.selectPage(page, new QueryWrapper<CoursePackageStudent>() |
| | | .in("coursePackageId", ids) |
| | | .eq("studentId", stuId) |
| | |
| | | } |
| | | } |
| | | |
| | | // recordVo.setCourseHours(tCoursePackagePayment.getClassHours()); |
| | | Date date = DateUtil.getDate(); |
| | | |
| | | |
| | | CoursePackageScheduling byId = coursePackageSchedulingService.getById(coursePackageStudent.getCoursePackageSchedulingId()); |
| | | // String classStartTime = coursePackage.getClassStartTime(); |
| | | // String classEndTime = coursePackage.getClassEndTime(); |
| | | //这里是过滤今天之后的数据 |
| | | |
| | | // if (byId == null||byId.getClassDate().after(new Date())){ |
| | | // continue; |
| | | // } |
| | | |
| | | if (byId == null) { |
| | | continue; |
| | | } |
| | |
| | | |
| | | |
| | | recordVo.setTimeFrame(dateString1 + "-" + dateString2.substring(11)); |
| | | |
| | | // recordVo.setTimeFrame(simpleDateFormat.format(date)+" "+classStartTime+"-"+classEndTime); |
| | | Store store = stoClient.queryStoreById(coursePackage.getStoreId()); |
| | | recordVo.setStoreNameAddr(store.getName() + store.getAddress()); |
| | | recordVo.setCourseStuRecordId(coursePackageStudent.getId()); |
| | |
| | | //待上课 |
| | | recordVo.setStatus(1); |
| | | } |
| | | // else if(coursePackageStudent.getSignInOrNot()==2){ |
| | | // recordVo.setStatus(5); |
| | | // } |
| | | else { |
| | | // CancelledClasses cancelledClasses = cacMapper.selectOne(new QueryWrapper<CancelledClasses>() |
| | | // .eq("coursePackageId",coursePackageStudent.getCoursePackageId())); |
| | | CancelledClasses cancelledClasses = cacMapper.selectOne(new QueryWrapper<CancelledClasses>() |
| | | .eq("coursePackageSchedulingId", byId.getId()).last("limit 1")); |
| | | if (ToolUtil.isNotEmpty(cancelledClasses)) { |
| | |
| | | } |
| | | |
| | | } |
| | | // } |
| | | |
| | | return recordVoList; |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public ResultUtil insertVipPaymentCallback(String code, String orderNumber) { |
| | | TCoursePackagePayment coursePackagePayment = this.baseMapper.getCoursePackagePaymentByCode(code); |
| | | if (coursePackagePayment.getPayStatus() != 1) { |
| | | CoursePackageOrder coursePackageOrder1 = coursePackageOrderService.getOne(new QueryWrapper<CoursePackageOrder>() |
| | | .eq("code", code).eq("state", 1)); |
| | | if (coursePackageOrder1.getPayStatus() == 2) { |
| | | return ResultUtil.success(); |
| | | } |
| | | coursePackagePayment.setPayStatus(2); |
| | | coursePackagePayment.setOrderNumber(orderNumber); |
| | | this.baseMapper.updateById(coursePackagePayment); |
| | | coursePackageOrder1.setPayStatus(2); |
| | | coursePackageOrder1.setOrderNumber(orderNumber); |
| | | coursePackageOrder1.setAppUserId(null); |
| | | coursePackageOrderService.updateById(coursePackageOrder1); |
| | | |
| | | CoursePackagePaymentConfig coursePackagePaymentConfig = coursePackagePaymentConfigService.getOne(new QueryWrapper<CoursePackagePaymentConfig>() |
| | | .eq("coursePackageId", coursePackageOrder1.getId()) |
| | | .eq("classHours", coursePackageOrder1.getClassHours()) |
| | | ); |
| | | coursePackageService.addCoursePackageOrderStudent(coursePackageOrder1.getId(), coursePackagePaymentConfig); |
| | | try { |
| | | coursePackageService.moneyOut(orderNumber,orderNumber,code); |
| | | } catch (AlipayApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public List<CoursePackageListVo> queryCourseList(Integer uid, CoursePackageList coursePackageList) throws Exception { |
| | | AppUser appUser = appUserClient.queryAppUser(uid); |
| | | // Map<String, String> geocode = gdMapGeocodingUtil.geocode(coursePackageList.getLon(), coursePackageList.getLat()); |
| | | // String provinceCode = geocode.get("provinceCode"); |
| | | // String cityCode = geocode.get("cityCode"); |
| | | // QueryWrapper<TCoursePackage> wrapper = new QueryWrapper<TCoursePackage>().in("status", Arrays.asList(1, 2)) |
| | | // .eq("auditStatus", 2).eq("state", 1).eq("provinceCode", provinceCode).eq("cityCode", cityCode); |
| | | |
| | | QueryWrapper<TCoursePackage> wrapper = new QueryWrapper<TCoursePackage>().in("status", Arrays.asList(1, 2)) |
| | | .eq("auditStatus", 2).eq("state", 1); |
| | | if (null != coursePackageList.getCoursePackageTypeId()) { |
| | |
| | | List<TCoursePackage> list1 = this.list(wrapper.last(" order by sort desc, insertTime desc")); |
| | | Date currentTime = new Date(); |
| | | |
| | | // Filter the list based on the conditions |
| | | List<TCoursePackage> list = list1.stream() |
| | | .filter(coursePackage -> coursePackage.getType() != 2 || currentTime.before(coursePackage.getEndTime())) |
| | | .collect(Collectors.toList()); |
| | |
| | | } |
| | | coursePackageListVo.setPaymentPrice(paymentPrice); |
| | | |
| | | double vipPrice1 = coursePackageListVo.getVipPrice(); |
| | | double originalPrice1 = coursePackageListVo.getOriginalPrice(); |
| | | double paymentPrice1 = coursePackageListVo.getPaymentPrice(); |
| | | |
| | | // double minPrice = Math.min(vipPrice1, Math.min(originalPrice1, paymentPrice1)); |
| | | // double maxPrice = Math.max(vipPrice1, Math.max(originalPrice1, paymentPrice1)); |
| | | // coursePackageListVo.setPaymentPrice(minPrice); |
| | | // coursePackageListVo.setOriginalPrice(maxPrice); |
| | | // System.out.println("Minimum price: " + minPrice); |
| | | |
| | | |
| | | // } |
| | | // else{ |
| | | // List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | // .eq("type", 1).eq("auditStatus", 2).eq("status",1)); |
| | | // Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | | // for (TCoursePackageDiscount coursePackageDiscount : list2) { |
| | | // Double num1 = JSON.parseObject(coursePackageDiscount.getContent()).getDouble("discountMember"); |
| | | // if(vipPrice.compareTo(num1) > 0){ |
| | | // vipPrice = num1; |
| | | // } |
| | | // } |
| | | // coursePackageListVo.setPaymentPrice(vipPrice); |
| | | // coursePackageListVo.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | // } |
| | | |
| | | if (coursePackageListVo.getPaymentPrice() < coursePackageListVo.getVipPrice()) { |
| | | coursePackageListVo.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | // coursePackageListVo.setVipPrice(null); |
| | | } |
| | | |
| | | if (appUser.getIsVip() == 1) { |
| | |
| | | * |
| | | * @param coursePackagePaymentConfig |
| | | */ |
| | | @Override |
| | | public void addCoursePackageOrderStudent(Long coursePackageOrderId, CoursePackagePaymentConfig coursePackagePaymentConfig) { |
| | | CoursePackageOrder coursePackageOrder = coursePackageOrderService.getById(coursePackageOrderId); |
| | | // 发放优惠券 |
| | |
| | | //开始排课 |
| | | addPackageStudent(coursePackage, coursePackageOrder.getAppUserId(), Integer.valueOf(id), coursePackageOrderStudent, student.getValidity()); |
| | | |
| | | |
| | | |
| | | //课时记录 |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(coursePackageOrderStudent.getId()); |
| | |
| | | courseCounsum1.setAppUserId(coursePackageOrder.getAppUserId()); |
| | | courseCounsumService.save(courseCounsum1); |
| | | } |
| | | |
| | | |
| | | } else { |
| | | Date useTime = coursePackageOrderStudent.getUseTime(); |
| | | coursePackageOrderStudent.setTotalClassHours(coursePackageOrderStudent.getTotalClassHours() + coursePackagePaymentConfig.getClassHours()); |
| | |
| | | courseCounsum1.setAppUserId(coursePackageOrder.getAppUserId()); |
| | | courseCounsumService.save(courseCounsum1); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | if(coursePackage.getType() == 2){ |
| | | addPackageStudent(coursePackage, coursePackageOrder.getAppUserId(), Integer.valueOf(id), null, null); |
| | |
| | | datasource.names=master0 |
| | | datasource.master0.type=com.alibaba.druid.pool.DruidDataSource |
| | | datasource.master0.driverClassName=com.mysql.cj.jdbc.Driver |
| | | datasource.master0.url=jdbc:mysql://192.168.110.110:3306/playpai_course?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.url=jdbc:mysql://127.0.0.1:3306/playpai_course?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.username=root |
| | | datasource.master0.password=123456 |
| | | datasource.master0.password=playpai2023! |
| | | datasource.master0.maxActive=20 |
| | | datasource.master0.maxWait=60000 |
| | | datasource.master0.minIdle=5 |
| | |
| | | |
| | | <artifactId>mb-cloud-gateway</artifactId> |
| | | <packaging>jar</packaging> |
| | | <name>网关</name> |
| | | <name>网关</name>444 |
| | | <description>网关</description> |
| | | |
| | | |
| | |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @FeignClient("mb-cloud-competition") |
| | | public interface CompetitionClient { |
| | |
| | | |
| | | |
| | | @PostMapping("/base/competition/getPeopleFromId1") |
| | | List<CompetitionUser> getPeopleFromId1(@RequestBody GetPeopleQuery getPeopleQuery); |
| | | Page<CompetitionUser> getPeopleFromId1(@RequestBody GetPeopleQuery getPeopleQuery); |
| | | @PostMapping("/base/competition/getPeoples") |
| | | List<CompetitionUser> getPeoples(@RequestBody GetPeopleQuery getPeopleQuery); |
| | | @PostMapping("/base/competition/listUser") |
| | |
| | | return list; |
| | | } |
| | | |
| | | /*public static void main(String[] args) throws ParseException { |
| | | List<Date> allTheDateOftheMonth = getAllTheDateOftheMonth(new Date()); |
| | | Date date = allTheDateOftheMonth.get(11); |
| | | System.out.println(date.toLocaleString()); |
| | | int i = daysBetween(new Date(), date); |
| | | System.out.println(i); |
| | | }*/ |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | // public void main(String[] ages){ |
| | | // try { |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | // public static void main(String[] agrs){ |
| | | //// TokenResult payToken = MidtransUtil.getPayToken("123456,1", "10", "http://192.168.0.80:5000/payment"); |
| | | //// System.err.println(payToken.toString()); |
| | | // |
| | | //// String sha_512_securePassword = get_SHA_512_SecurePassword("Postman-157856885120010000.00VT-server-HJMpl9HLr_ntOKt5mRONdmKj"); |
| | | //// System.err.println(sha_512_securePassword); |
| | | // |
| | | // PaymentNotice payStatus = MidtransUtil.getPayStatus("123456,1"); |
| | | // System.err.println(null != payStatus ? payStatus.toString() : ""); |
| | | // } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | // public static void main(String[] ages){ |
| | | // ResultUtil<String> payout = Payouts.payout("John Do2", "3345278432", "3345278432", "bca", "beneficiary1@example.com", 10000.0d, "test payout"); |
| | | // if(payout.getCode() != 200){ |
| | | // System.err.println(payout.getMsg()); |
| | | // } |
| | | // System.err.println(payout.getData()); |
| | | //// ResultUtil approve = Payouts.approve("9pYr3axOfiugd2KdLb", "335163"); |
| | | //// if(approve.getCode() != 200){ |
| | | //// System.err.println(approve.getMsg()); |
| | | //// } |
| | | // } |
| | | } |
| | |
| | | //// System.out.println(bucket.getCreationDate()); |
| | | //// } |
| | | //// |
| | | //// public static void main(String[] args) { |
| | | //// OssUploadUtil.createBucket("ssfdfsd"); |
| | | //// } |
| | | //} |
| | |
| | | } |
| | | return URLDecoder.decode(url); |
| | | } |
| | | // public static void main(String[] args) throws ParseException { |
| | | // |
| | | // System.out.println(doubleRetainTwo(0.0)); |
| | | // |
| | | // } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | public class AntMerchantExpandIndirectImageUpload { |
| | | |
| | | // public static void main(String[] args) throws AlipayApiException { |
| | | // String privateKey = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCSsmylIHe0j0pRQrB9p5ljryk9Qg2Z/JgIh+gtZES1TDo35YVw24aRRt7pkY7oHIZqpMRmSsWND1t63LVuNlpq532LG0iEJVJS53GzpRoHDD3iD01GmUoNjkCL36NCrbY0hTDDw7GZnYuJ8194Sss7OEoi7Mghg/XUreX4awwpWngTepCF7zs0S4YJQWyGY4JI6ooGraW23siBVY5MUI9XXLL6UKIExUfKe7zRihs8SrTHNnXtDT6EKYYo8P6M90Xuk173QsK2Xguk1FQ5Blh2ts7UvZVjP+WoQwDvrnqruve5kzDD9gwnAYUvhY66mtlxeub9nf5LLTtCliXeUZpNAgMBAAECggEAaPShSM9e9d9jM5p8PZqw4yJKZhqhMqAHgmsCUZ+gjPn52U4s198oez5ydDgBP85Q2XIDVpB+oPrw34mTgUQAEuaG6wTdMDannMscjYQ9h/dZOyjph+5ajjJNugWKgEVazF7S0e1sXtTaJhvrHVyd5UPTvwMb+Oa59q1okQC91cNa2vJzXiC7dfqWXZW/otmmOpcIcCN8dVDG3YhAuc5ZiT78Ca8x9GHWfw7cw1FRewRZlp/YnD2fJeWEesfvGCV36zCksrJrZz5MFMdf1Qh6+tHxK+E5sPNGdbooviTRnNWrsgyS9NcXFSQItOZQHsbLVID/Bs0kxkYPzbsfX1vRXQKBgQDsBDNZxpmSZJZ/4HfCOfHytWAkH/GHE3GOYH4TdHKLXfxRCinU23OtdrU2Sy8tBZvaajDKkWvMkjWT2w+56+z+xTprTf2PL/LS9zWCc8LPKbif6NfnwaOE8pIBrvkBskGKwbIE2fFVT0B4hNsR80TbPxvvAfCKjUj67qrTXSal+wKBgQCfHiuq/gLuSD2fuplzCwu0Rm/wr56bUpxhq9WNGaPOybR6EPq/wTKp0ow+f9uSuTm2NZhi/TWTXHOizy9vcZChRpj03a7NYwUOw36zvW7SHuF0Uhsp8TrZTyCj1XdhdLyJ9JMyL2DTRpGtLUR01ZSrdXPax7/Xu+OHubijqRD2VwKBgFqCveKm7AwdMS43OhYtPKE0d3tDGNARX9IXJSJ23Nqfn3zApgwwYKtcQ+BfcucUKJHZeX6lyC56v7tFHkHRvWBy6JVwIlZAMCJBla7CkCn8OQZyOCJzuy7oC6BDptDEuKfq4kdEAW4S54mQgabfoT9nc2H0X3fy+NLqpm5KYeDzAoGAYerlIILUNuKJ2aOxDpS7jSLTfB/20MqTpZ9i+UPQBE8oGv4b8Kjpjowc9dEkxDPsCe8Nac08jQSVvJkXLdOLF1QkiHtrOMU4tY8kh2OJsRCD2Vs1kCf8+QGyql+Q6Y43AAZcFsQFJ78Dorh6qhNNO/45X2cQ7aeYK0vlDgHaiF0CgYA4k9Q1tc8sU67TgT9cmMM6hG7/Rf3cU3PIdYuojs1EIG+1BJ7TlEiNAHoPtphlGFFeDP3SVnf59RfYH+BbLiz1JX9p/KFKRRkoXtfd6bySVWHvj4x2WiVpKFvHxhxc3LRubx0ryLGR/tpUJzxp+9luanU/WgSRFKiEZJZqFjjDzw=="; |
| | | // String alipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApCzq4BIE4gMdEXxIAAUbiMpSytkzp+LVLVsBtji87rFGfWUcnrr3NKftaw0WtRu+36d1nDVOWW4CmgsOPyj1GOFoTcJOR/BqyIriwyLxpuMS8qgOqGJZXi+W4Nw2AJL6iMVwY2eI8F1G10gACK2I9TNJRzHh3tMTA6ItysbGoekRDtn6Xrkh5V6cyHQjLw0Q6MJK/68XT6/LWzarDEEYrSnIevOydMY32ptAgm5fp/h08M2khCmI6CuMWKmc87dPpd2krGVTALqprAQvB74AIqO+5DE0fN4LoitOYXAtWDCEF4kHN0hQUygIEGCwtMgEVzkf92VLlCX35YtDhWd1yQIDAQAB"; |
| | | // AlipayConfig alipayConfig = new AlipayConfig(); |
| | | // alipayConfig.setServerUrl("https://openapi.alipay.com/gateway.do"); |
| | | // alipayConfig.setAppId("2021004123692417"); |
| | | // alipayConfig.setPrivateKey(privateKey); |
| | | // alipayConfig.setFormat("json"); |
| | | // alipayConfig.setAlipayPublicKey(alipayPublicKey); |
| | | // alipayConfig.setCharset("UTF8"); |
| | | // alipayConfig.setSignType("RSA2"); |
| | | // AlipayClient alipayClient = new DefaultAlipayClient(alipayConfig); |
| | | // // 这是一个1x1像素的图片流 |
| | | // String imageBase64 = "iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAEUlEQVR42mP4TyRgGFVIX4UAI/uOgGWVNeQAAAAASUVORK5CYII="; |
| | | // // 下列FileItem中也可用直接读取本地文件的方式来获取文件 |
| | | // // FileItem imageContent = new FileItem("本地文件的绝对路径"); |
| | | // AntMerchantExpandIndirectImageUploadRequest request = new AntMerchantExpandIndirectImageUploadRequest(); |
| | | // FileItem imageContent = new FileItem("https://we-park-life.oss-cn-beijing.aliyuncs.com/img/73d85c4b522f4077bda8d20f51439a33.JPG", Base64.getDecoder().decode(imageBase64)); |
| | | // request.setImageContent(imageContent); |
| | | // request.setImageType("jpg"); |
| | | // AntMerchantExpandIndirectImageUploadResponse response = alipayClient.execute(request); |
| | | // System.out.println(response.getBody()); |
| | | // if (response.isSuccess()) { |
| | | // System.out.println("调用成功"); |
| | | // } else { |
| | | // System.out.println("调用失败"); |
| | | // } |
| | | // } |
| | | } |
| | |
| | | //// } |
| | | // } |
| | | |
| | | public static void main(String[] args) { |
| | | String s = "{\"sign\":\"Q8wa/EiKqeRiatW3mDhPA3Ia1jYXK6c8CxlhTQb0o9XHui16UURb7oiqnoS+P22q3a3POjmuhl/Rwm6MBGzp8RNcXwoWTExNq29OR/jZ6SU9HWiOUewv0/kGgNj4WHpbGbVqaoaW3/Q6w0IhCSRT3GAsULHPBeWQ2HyrScl549y/mwsI6bX132S9dHJ5O7we4Oho0pDWrQfE+daP4p+y1HVGeD6WGBq5HjXIuqNmE/ZrRFc/R+8baMwRQgECeohKhpPs9Ov1xuzeq/wuk/NuDG9YbE/+cKs/Kkg3fYIPM1CsIwvam3wP2iYhTaUlEYidt++EwJ2QVIB3OD5So5aKdg==\",\"ant_merchant_expand_indirect_zftorder_query_response\":{\"msg\":\"Success\",\"code\":\"10000\",\"orders\":[{\"reason\":\"公安网校验失败\",\"merchant_name\":\"成都玩湃生活体育发展有限公司\",\"apply_time\":\"2023-12-20 18:36:26\",\"external_id\":\"273c5a8ad59f4e5397253045af1de8fe\",\"order_id\":\"2023122000502000000005299341\",\"apply_type\":\"ZHIFUTONG_CREATE\",\"status\":\"-1\"}]}}"; |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | Page<Competition> competitions = competitionClient.list(listQuery); |
| | | List<Competition> records = new ArrayList<>(); |
| | | for (Competition competition : competitions.getRecords()) { |
| | | // // 当前时间小于开始时间 |
| | | // if (competition.getStartTime().after(new Date())){ |
| | | // competition.setStatus(1); |
| | | // } |
| | | // if (competition.getStartTime().before(new Date())){ |
| | | // |
| | | // |
| | | // if (competition.getEndTime().after(new Date())){ |
| | | // competition.setStatus(2); |
| | | // }else{ |
| | | // competition.setStatus(3); |
| | | // } |
| | | // } |
| | | if (competition.getStatus()!=state && state != null){ |
| | | }else{ |
| | | records.add(competition); |
| | |
| | | @ResponseBody |
| | | public Object listUser(@PathVariable Integer id,Integer state, Integer offset,Integer limit) { |
| | | try { |
| | | // Page<Object> page = new PageFactory<>().defaultPage(); |
| | | // Page<CompetitionUser> data = competitionClient.getPeopleFromId(new GetPeopleQuery(limit,offset,id,state)); |
| | | List <CompetitionUser> data = competitionClient.getPeopleFromId1(new GetPeopleQuery(limit,offset,id,state)); |
| | | return data; |
| | | Page<CompetitionUser> page = competitionClient.getPeopleFromId1(new GetPeopleQuery(limit, offset, id, state)); |
| | | return super.packForBT(page); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | |
| | | log_print("querySendDetails", response.getData()); |
| | | } |
| | | |
| | | // public static void main(String[] args) { |
| | | // ALiSendSms sendSmsDemo = new ALiSendSms(); |
| | | // try { |
| | | // // 创建短信模板 |
| | | // String templateCode = sendSmsDemo.addSmsTemplate(); |
| | | // // 使用刚创建的短信模板发送短信 |
| | | // String sData = sendSmsDemo.sendSms("156xxxxxxxx", templateCode, "{\"code\":\"8888\"}"); |
| | | // Gson gson = new Gson(); |
| | | // Map map = gson.fromJson(sData, Map.class); |
| | | // String bizId = map.get("BizId").toString(); |
| | | // // 根据短信发送流水号查询短信发送情况 |
| | | // sendSmsDemo.querySendDetails(bizId); |
| | | // } catch (ClientException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | // public static void main(String[] ages){ |
| | | // String s = MD5.md5("111111"); |
| | | // System.err.println(s); |
| | | // } |
| | | |
| | | } |
| | |
| | | sc.init(null, trustAllCerts, null); |
| | | HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); |
| | | } |
| | | /*测试发送短信*/ |
| | | // public static void main(String[] args) throws Exception{ |
| | | ///* |
| | | // //String res = send("13981969442","[\"123456\"]",1);//验证码测试 |
| | | // JSONObject object = new JSONObject("{\"result\":[{\"originTo\":\"13981969442\",\"createTime\":\"2019-08-01T11:23:52Z\",\"from\":\"881907307922\",\"smsMsgId\":\"f9a397a3-8e36-479a-834c-a20a7a466d8c_606422718\",\"status\":\"000000\"}],\"code\":\"000000\",\"description\":\"Success\"}"); |
| | | // String code=object.getString("code"); |
| | | // //String res1 = send("13981969442","[\"2017/07/16\",\"成都北\",\"14:30\",\"3\"]",2);//通知类测试 日期格式只能是2017/07/16这种的*/ |
| | | // } |
| | | |
| | | } |
| | |
| | | return strBuilder.toString(); |
| | | } |
| | | |
| | | // public static void main(String[] args) { |
| | | //Get |
| | | /*Long time = new Date().getTime(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("client_id","f168c651bf86f2c1"); |
| | | map.put("timestamp",time); |
| | | map.put("longitude","120.10"); |
| | | map.put("latitude","30.19"); |
| | | String url = "https://sandbox-cop.caocaokeji.cn/v2/common/queryCity"; |
| | | String response = PlatformUtil.doGet(url,"client_id=f168c651bf86f2c1×tamp="+time+"&sign="+SignUtil.sign(map)+"&longitude=120.10&latitude=30.19",null,100000); |
| | | com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(response); |
| | | System.out.println(jsonObject.toJSONString());*/ |
| | | //Post |
| | | /* Map<String,Object> map = new HashMap<>(); |
| | | map.put("client_id","f168c651bf86f2c1"); |
| | | map.put("timestamp",new Date().getTime()); |
| | | map.put("order_id",1); |
| | | map.put("score","3"); |
| | | map.put("content","测试数据"); |
| | | map.put("sign",SignUtil.sign(map)); |
| | | String jsonMsg =JSONObject.toJSONString(map); |
| | | String url = "/v2/common/evaluateOrder"; |
| | | TokenUtil.RequestEntity req = new TokenUtil.RequestEntity(); |
| | | req.setReqMethod(TokenUtil.REQ_METHOD_POST); |
| | | req.setUri(url); |
| | | req.setContent(jsonMsg); |
| | | DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | req.setReqTime(dateFormat.format(new Date())); |
| | | String response = PlatformUtil.doPostJson1("https://sandbox-cop.caocaokeji.cn"+url,req.getContent(),null); |
| | | System.out.println(JSONObject.parseObject(response));*/ |
| | | |
| | | // System.out.println(new Date().getTime()); |
| | | // |
| | | // } |
| | | |
| | | } |
| | |
| | | return cipher.doFinal(context); |
| | | } |
| | | |
| | | /** |
| | | * 主方法测试 |
| | | * |
| | | * @param args |
| | | */ |
| | | // public static void main(String[] args) { |
| | | // String context = "zhaors"; |
| | | // System.out.println("元数据" + context); |
| | | // String encrypt = encrypt(context); |
| | | // System.out.println("加密之后:" + encrypt); |
| | | // String decrypt = decrypt(encrypt); |
| | | // System.out.println("解密之后:" + decrypt); |
| | | // } |
| | | |
| | | } |
| | |
| | | return xingzuo; |
| | | } |
| | | |
| | | // public static void main(String[] args) { |
| | | // System.out.println(ConstellationUtil.getConstellation("1995-09-07")); |
| | | // } |
| | | |
| | | } |
| | |
| | | return getDate(); |
| | | } |
| | | |
| | | /*public static void main(String[] args) throws ParseException { |
| | | // 打印测试日期包含 |
| | | Date time1 = getDate_str("2017-3-11"); |
| | | Date time2 = getDate_str("2017-3-15"); |
| | | Date time3 = getDate_str("2017-3-17"); |
| | | Date time4 = getDate_str("2017-3-12"); |
| | | Date time5 = getDate_str("2017-3-16"); |
| | | Date from = getDate_str("2017-3-12"); |
| | | Date to = getDate_str("2017-3-16"); |
| | | System.out.println(belongCalendar(time1, from, to)); |
| | | System.out.println(belongCalendar(time2, from, to)); |
| | | System.out.println(belongCalendar(time3, from, to)); |
| | | System.out.println(belongCalendar(time4, from, to)); |
| | | System.out.println(belongCalendar(time5, from, to)); |
| | | System.out.println(nowStr()); |
| | | |
| | | } |
| | | */ |
| | | /** |
| | | * 把日期往后增加一天. 正数往后推,负数往前移动 |
| | | * |
| | |
| | | } |
| | | |
| | | |
| | | // public static void main(String[] args) throws ParseException { |
| | | // System.out.println(getDay()); |
| | | // } |
| | | |
| | | |
| | | } |
| | |
| | | import java.io.IOException; |
| | | public class GaoDeMapUtil { |
| | | |
| | | // public static void main(String[] args) { |
| | | // // 地址名称 |
| | | // String address = "深圳市"; |
| | | // // 调用自己写好的封装方法 |
| | | // JSONObject positionObj = getLngAndLat(address); |
| | | // String longitude = positionObj.getString("longitude"); |
| | | // String latitude = positionObj.getString("latitude"); |
| | | // System.out.println("经度:" + longitude); |
| | | // System.out.println("纬度:" + latitude); |
| | | // |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 根据地址查询经纬度 |
| | |
| | | //无需修改,用于格式化鉴权头域,给"Authorization"参数赋值 |
| | | private static final String AUTH_HEADER_VALUE = "WSSE realm=\"SDP\",profile=\"UsernameToken\",type=\"Appkey\""; |
| | | |
| | | // public static void main(String[] args) throws Exception{ |
| | | // |
| | | //// sendSms("[\""+1235+"\"]","17623778642","10690400999303617","d8f8f781b6e04c848f8148f4d6604bcd"); |
| | | //// sendSms("[\"17623778642\",\"蓉A-7823\"]","17623778642","8819122535459","6c848255000c4619833ab690e393f906"); |
| | | // sendSms("[\"17623778642\",\"蓉A-7823\",\"2019/12/27\",\"14:00\"]","17623778642","8819122535459","bb13d00d11e043659001a89c72d54cab"); |
| | | // } |
| | | |
| | | |
| | | public static void sendSms(String code,String phone,String sender,String templateId) throws Exception{ |
| | | //必填,请参考"开发准备"获取如下数据,替换为实际值 |
| | |
| | | return getOrderNo() + suffix; |
| | | } |
| | | |
| | | // public static void main(String[] args) { |
| | | // System.out.println(getOrderNo()); |
| | | // } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | // public static void main(String[] ages){ |
| | | // PayMoneyUtil payMoneyUtil = new PayMoneyUtil(); |
| | | // ResultUtil ce = payMoneyUtil.alipay("测试", "测试", "", "121456457", "10", "http://123.com"); |
| | | // System.err.println(ce); |
| | | // ResultUtil resultUtil = null; |
| | | // try { |
| | | // resultUtil = payMoneyUtil.queryALIOrder("121456457"); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // System.err.println(resultUtil); |
| | | // } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | // public static void main(String[] args) { |
| | | // try { |
| | | // Map<String,String> extras = new HashMap<>(); |
| | | // extras.put("state","1"); |
| | | // PushResult pushResult = pushSystemMessage("您的账号已重置密码为123456,请修改密码后重新登录,如有问题,请联系平台客服。", "1", new String[]{"122"}, extras); |
| | | // System.out.println(pushResult); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | |
| | | } |
| | |
| | | |
| | | public class QuartzTest { |
| | | |
| | | // public static void main(String[] args) throws SchedulerException { |
| | | // Map<String, ? extends Object> maps = ImmutableMap |
| | | // .of("id", 1) ; |
| | | // //QuartzManager.addJob(ActivityStartJob.class, (ActivityStartJob.FROZEN_JOB_NAME_PREFIX+1).toUpperCase(), TimeJobType.ACTIVITYSTART, new Date() , maps); |
| | | // |
| | | // } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | String response = PlatformUtil.doPostJson(host+url,req.getContent(),headers); |
| | | return JSONObject.parseObject(response); |
| | | } |
| | | // public static void main(String[] args) { |
| | | // } |
| | | |
| | | } |
| | | |
| | |
| | | public static final String REQ_METHOD_POST = "POST"; |
| | | public static final String REQ_METHOD_PUT = "PUT"; |
| | | public static final String REQ_METHOD_DELETE = "DELETE"; |
| | | // public static void main(String[] args) throws Exception { |
| | | // RequestEntity req = new RequestEntity(); |
| | | // req.setReqMethod(REQ_METHOD_POST); |
| | | // req.setUri("/open-web/rs/order/v1/add"); |
| | | // req.setReqTime("2015-04-14 13:21:00"); |
| | | // req.setContent("{\"senderProvince\":\"上海市\",\"senderCity\":\"上海市\",\"senderCounty\":\"闵行区\",\"senderAddress\":\"华翔路2239号\"}"); |
| | | // req.setEncryptKey("asd123"); |
| | | // System.out.println(generateToken(req)); |
| | | // } |
| | | |
| | | public static String generateToken(RequestEntity req) throws Exception{ |
| | | /** |
| | | * 将请求方式+uri+请求时间+请求参数进行签名生成token 1.对请求方式+uri+请求时间+请求参数进行HMAC-SHA1加密 |
| | |
| | | |
| | | } |
| | | |
| | | // public static void main(String[] args) { |
| | | // // TODO Auto-generated method stub |
| | | // |
| | | // } |
| | | |
| | | |
| | | } |
| | |
| | | $(function () { |
| | | var defaultColunms = TCompetition.initColumn(); |
| | | var table = new BSTable(TCompetition.id, "/tCompetition/listUser/"+$("#id").val(), defaultColunms); |
| | | table.setPaginationType("client"); |
| | | table.setPaginationType("server"); |
| | | TCompetition.table = table.init(); |
| | | }); |
| | | |
| | |
| | | @Autowired |
| | | private ISiteBookingService siteBookingService; |
| | | |
| | | @Autowired |
| | | private IOperatorUserService operatorUserService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getIntro") |
| | |
| | | |
| | | |
| | | |
| | | |
| | | private String smid = "2088330203191220";//平台支付宝商户号 |
| | | @Autowired |
| | | private ISiteService siteService; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | return weixinpay; |
| | | } else if (type == 2) { |
| | | String params = uid + "_" + gameId + "_" + spaceId + "_" + sutuId + "_" + code + "_" + configId; |
| | | TGame byId = gameService.getById(gameId); |
| | | String smid=""; |
| | | // 属于平台 |
| | | if (byId.getOperationId()==null){ |
| | | smid ="2088330203191220"; |
| | | }else if(byId.getOperationId()==0){ |
| | | smid= "2088330203191220"; |
| | | String smid1=""; |
| | | String params = uid + "_" + gameId + "_" + spaceId + "_" + sutuId+"_"+code+"_"+configId; |
| | | // 判断这个课包属于哪个门店 属于哪个运营商 根据运营商 id 获取对应的商户号 |
| | | TGame game = gameService.getById(gameId); |
| | | |
| | | Integer operationId = game.getOperationId(); |
| | | if (operationId==0){ |
| | | // 是平台的 |
| | | smid1 = smid; |
| | | }else{ |
| | | // 根据运营商id 查询商户号 |
| | | OperatorUser operatorId = operatorUserService.getOne(new QueryWrapper<OperatorUser>() |
| | | .eq("operatorId", byId.getOperationId())); |
| | | if (operatorId!=null){ |
| | | smid = operatorId.getAlipayNum(); |
| | | } |
| | | String smidByOperatorId = siteService.getSMIDByOperatorId(operationId); |
| | | smid1 = smidByOperatorId; |
| | | } |
| | | ResultUtil alipay = payMoneyUtil.alipay(smid,"游戏支付", "游戏支付", params, code, config.getCash().toString(), "/base/site/gameCallback"); |
| | | |
| | | ResultUtil alipay = payMoneyUtil.alipay(smid1,"游戏支付", "游戏支付", params, code, config.getCash().toString(), "/base/site/gameCallback"); |
| | | if (alipay.getCode() == 200) { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | |
| | | } |
| | | gameRecordService.updateBatchById(list); |
| | | Integer integer = startGame(uid, gameId, spaceId, sutuId); |
| | | // 判断这个课包属于哪个门店 属于哪个运营商 根据运营商 id 获取对应的商户号 |
| | | TGame game = gameService.getById(gameId); |
| | | String smid2=""; |
| | | Integer operationId = game.getOperationId(); |
| | | if (operationId==0){ |
| | | // 是平台的 |
| | | smid2 = smid; |
| | | }else{ |
| | | String smidByOperatorId = siteService.getSMIDByOperatorId(operationId); |
| | | smid2 = smidByOperatorId; |
| | | } |
| | | payMoneyUtil.confirm(smid2,code,tradeNo,config.getCash().toString()); |
| | | break; |
| | | } |
| | | if ("WAIT_BUYER_PAY".equals(s)) { |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "门店id", name = "id", dataType = "int", required = true), |
| | | }) |
| | | public ResultUtil<List<TStoreOtherVo>> queryIndexSet(Integer id) { |
| | | public ResultUtil<List<TStoreOtherConfigTrue>> queryIndexSet(Integer id) { |
| | | try { |
| | | List<TStoreOtherConfigTrue> tStoreOtherConfigTrues = new ArrayList<>(); |
| | | |
| | |
| | | if (list.size() > 0) { |
| | | tStoreOtherConfigTrues = tStoreOtherConfigTrueService.list(new LambdaQueryWrapper<TStoreOtherConfigTrue>().in(TStoreOtherConfigTrue::getPid, list.stream().map(TStoreOther::getId).collect(Collectors.toList())).eq(TStoreOtherConfigTrue::getState, 1)); |
| | | } |
| | | List<TStoreOtherVo> list1 = new ArrayList<>(); |
| | | for (TStoreOther tStoreOther : list) { |
| | | TStoreOtherVo storeOtherVo = new TStoreOtherVo(); |
| | | BeanUtils.copyProperties(tStoreOther, storeOtherVo); |
| | | List<TStoreOtherConfigTrue> lists = new ArrayList<>(); |
| | | for (TStoreOtherConfigTrue tStoreOtherConfigTrue : tStoreOtherConfigTrues) { |
| | | for (TStoreOtherConfigTrue tStoreOtherConfigTrue : tStoreOtherConfigTrues) { |
| | | for (TStoreOther tStoreOther : list) { |
| | | if (tStoreOtherConfigTrue.getPid() == tStoreOther.getId()) { |
| | | lists.add(tStoreOtherConfigTrue); |
| | | tStoreOtherConfigTrue.setSort(tStoreOther.getSort()); |
| | | } |
| | | } |
| | | storeOtherVo.setList(lists); |
| | | list1.add(storeOtherVo); |
| | | } |
| | | return ResultUtil.success(list1); |
| | | return ResultUtil.success(tStoreOtherConfigTrues); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |