| | |
| | | props1.setProperty("algorithm-expression", "t_payment_history$->{appUserId % 5 + 1}"); |
| | | result1.getShardingAlgorithms().put("t_payment_history-inline", new AlgorithmConfiguration("INLINE", props1)); |
| | | result1.getKeyGenerators().put("t_payment_history-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | linkedList.add(result1); |
| | | |
| | | //分片规则配置 |
| | | ShardingRuleConfiguration result2 = new ShardingRuleConfiguration(); |
| | | result2.getTables().add(getRechargeRecordsTableRuleConfiguration()); |
| | | result1.getTables().add(getRechargeRecordsTableRuleConfiguration()); |
| | | Properties props2 = new Properties(); |
| | | props2.setProperty("algorithm-expression", "t_recharge_records$->{appUserId % 5 + 1}"); |
| | | result2.getShardingAlgorithms().put("t_recharge_records-inline", new AlgorithmConfiguration("INLINE", props2)); |
| | | result2.getKeyGenerators().put("t_recharge_records-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | linkedList.add(result2); |
| | | result1.getShardingAlgorithms().put("t_recharge_records-inline", new AlgorithmConfiguration("INLINE", props2)); |
| | | result1.getKeyGenerators().put("t_recharge_records-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | |
| | | //分片规则配置 |
| | | ShardingRuleConfiguration result3 = new ShardingRuleConfiguration(); |
| | | result3.getTables().add(getUserIntegralChangesTableRuleConfiguration()); |
| | | result1.getTables().add(getUserIntegralChangesTableRuleConfiguration()); |
| | | Properties props3 = new Properties(); |
| | | props3.setProperty("algorithm-expression", "t_user_integral_changes$->{appUserId % 5 + 1}"); |
| | | result3.getShardingAlgorithms().put("t_user_integral_changes-inline", new AlgorithmConfiguration("INLINE", props3)); |
| | | result3.getKeyGenerators().put("t_user_integral_changes-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | linkedList.add(result3); |
| | | result1.getShardingAlgorithms().put("t_user_integral_changes-inline", new AlgorithmConfiguration("INLINE", props3)); |
| | | result1.getKeyGenerators().put("t_user_integral_changes-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | linkedList.add(result1); |
| | | |
| | | return linkedList; |
| | | } |
| | |
| | | |
| | | PaymentCompetition paymentCompetition = paymentCompetitionService.getOne(new QueryWrapper<PaymentCompetition>().eq("code", code).eq("payType", 1)); |
| | | if(paymentCompetition.getPayStatus() == 1){ |
| | | paymentCompetition.setAppUserId(null); |
| | | paymentCompetition.setPayStatus(2); |
| | | paymentCompetition.setPayTime(new Date()); |
| | | paymentCompetition.setPayOrderNo(transaction_id); |
| | |
| | | |
| | | PaymentCompetition paymentCompetition = paymentCompetitionService.getOne(new QueryWrapper<PaymentCompetition>().eq("code", code).eq("payType", 2)); |
| | | if(paymentCompetition.getPayStatus() == 1){ |
| | | paymentCompetition.setAppUserId(null); |
| | | paymentCompetition.setPayStatus(2); |
| | | paymentCompetition.setPayTime(new Date()); |
| | | paymentCompetition.setPayOrderNo(trade_no); |
| | |
| | | @ApiModelProperty(value = "姓名", dataType = "string", required = true) |
| | | private String name; |
| | | @ApiModelProperty(value = "生日", dataType = "string", required = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date birthday; |
| | | private String birthday; |
| | | @ApiModelProperty(value = "性别(1=男,2=女)", dataType = "int", required = true) |
| | | private Integer gender; |
| | | @ApiModelProperty(value = "身高(CM)", dataType = "int", required = true) |
| | |
| | | @ApiModelProperty(value = "姓名", dataType = "string", required = false) |
| | | private String name; |
| | | @ApiModelProperty(value = "生日", dataType = "string", required = false) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date birthday; |
| | | private String birthday; |
| | | @ApiModelProperty(value = "性别(1=男,2=女)", dataType = "int", required = false) |
| | | private Integer gender; |
| | | @ApiModelProperty(value = "身份证号码", dataType = "string", required = false) |
| | |
| | | private String idcard; |
| | | @ApiModelProperty("电话号码") |
| | | private String phone; |
| | | @ApiModelProperty("身高") |
| | | private Integer height; |
| | | @ApiModelProperty("体重") |
| | | private Double weight; |
| | | @ApiModelProperty("生日") |
| | | private String birthday; |
| | | @ApiModelProperty("性别(1=男,2=女)") |
| | | private Integer gender; |
| | | @ApiModelProperty("剩余课时") |
| | | private Integer residueClassHour; |
| | | } |
| | |
| | | appUser.setPlayPaiCoins(appUser.getPlayPaiCoins() - money.intValue()); |
| | | appUserClient.updateAppUser(appUser); |
| | | |
| | | paymentCompetition = paymentCompetitionService.getById(paymentCompetition.getId()); |
| | | paymentCompetition.setAppUserId(null); |
| | | paymentCompetition.setPayStatus(2); |
| | | paymentCompetition.setPayTime(new Date()); |
| | | paymentCompetition.setPayOrderNo(""); |
| | |
| | | paymentDeductionClassHour.setCode(code); |
| | | coursePackagePaymentClient.paymentDeductionClassHour(paymentDeductionClassHour); |
| | | } |
| | | paymentCompetition = paymentCompetitionService.getById(paymentCompetition.getId()); |
| | | paymentCompetition.setAppUserId(null); |
| | | paymentCompetition.setPayStatus(2); |
| | | paymentCompetition.setPayTime(new Date()); |
| | | paymentCompetition.setPayOrderNo(""); |
| | |
| | | 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){ |
| | | paymentCompetition.setAppUserId(null); |
| | | paymentCompetition.setState(3); |
| | | userCompetitionService.remove(new QueryWrapper<UserCompetition>().eq("paymentCompetitionId", paymentCompetition.getId())); |
| | | break; |
| | | } |
| | | if("SUCCESS".equals(s)){ |
| | | paymentCompetition.setAppUserId(null); |
| | | paymentCompetition.setPayStatus(2); |
| | | paymentCompetition.setPayTime(new Date()); |
| | | paymentCompetition.setPayOrderNo(transaction_id); |
| | |
| | | String s = data1.get("tradeStatus"); |
| | | String tradeNo = data1.get("tradeNo"); |
| | | if("TRADE_CLOSED".equals(s) || "TRADE_FINISHED".equals(s) || num == 10){ |
| | | paymentCompetition.setAppUserId(null); |
| | | paymentCompetition.setState(3); |
| | | userCompetitionService.remove(new QueryWrapper<UserCompetition>().eq("paymentCompetitionId", paymentCompetition.getId())); |
| | | break; |
| | | } |
| | | if("TRADE_SUCCESS".equals(s)){ |
| | | paymentCompetition.setAppUserId(null); |
| | | paymentCompetition.setPayStatus(2); |
| | | paymentCompetition.setPayTime(new Date()); |
| | | paymentCompetition.setPayOrderNo(tradeNo); |
| | |
| | | |
| | | Participant participant = new Participant(); |
| | | BeanUtils.copyProperties(addParticipant, participant); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | if(ToolUtil.isNotEmpty(addParticipant.getBirthday())){ |
| | | Date parse = sdf.parse(addParticipant.getBirthday()); |
| | | participant.setBirthday(parse); |
| | | } |
| | | participant.setAppUserId(uid); |
| | | participant.setState(1); |
| | | participant.setInsertTime(new Date()); |
| | |
| | | participantVo.setResidueClassHour(0); |
| | | } |
| | | participantVo.setPhone(participant.getPhone()); |
| | | participantVo.setHeight(participant.getHeight()); |
| | | participantVo.setWeight(participant.getWeight()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | if(null != participant.getBirthday()){ |
| | | String format = sdf.format(participant.getBirthday()); |
| | | participantVo.setBirthday(format); |
| | | } |
| | | participantVo.setGender(participant.getGender()); |
| | | listVo.add(participantVo); |
| | | } |
| | | return listVo; |
| | |
| | | participant.setHeight(editParticipant.getHeight()); |
| | | participant.setWeight(editParticipant.getWeight()); |
| | | participant.setPhone(editParticipant.getPhone()); |
| | | participant.setGender(editParticipant.getGender()); |
| | | participant.setIdcard(editParticipant.getIdcard()); |
| | | participant.setName(editParticipant.getName()); |
| | | if(ToolUtil.isNotEmpty(editParticipant.getBirthday())){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | participant.setBirthday(sdf.parse(editParticipant.getBirthday())); |
| | | } |
| | | this.updateById(participant); |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | props1.setProperty("algorithm-expression", "t_user_competition$->{appUserId % 5 + 1}"); |
| | | result1.getShardingAlgorithms().put("t_user_competition-inline", new AlgorithmConfiguration("INLINE", props1)); |
| | | result1.getKeyGenerators().put("t_user_competition-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | linkedList.add(result1); |
| | | |
| | | //分片规则配置 |
| | | ShardingRuleConfiguration result2 = new ShardingRuleConfiguration(); |
| | | result2.getTables().add(getPaymentCompetitionTableRuleConfiguration()); |
| | | result1.getTables().add(getPaymentCompetitionTableRuleConfiguration()); |
| | | Properties props2 = new Properties(); |
| | | props2.setProperty("algorithm-expression", "t_payment_competition$->{appUserId % 5 + 1}"); |
| | | result2.getShardingAlgorithms().put("t_payment_competition-inline", new AlgorithmConfiguration("INLINE", props2)); |
| | | result2.getKeyGenerators().put("t_payment_competition-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | linkedList.add(result2); |
| | | |
| | | result1.getShardingAlgorithms().put("t_payment_competition-inline", new AlgorithmConfiguration("INLINE", props2)); |
| | | result1.getKeyGenerators().put("t_payment_competition-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | linkedList.add(result1); |
| | | return linkedList; |
| | | } |
| | | |
| | |
| | | a.introduction, |
| | | DATE_FORMAT(a.registerEndTime, '%Y-%m-%d %H:%i') as registerEndTime, |
| | | CONCAT(a.startAge, '-', a.endAge) as age, |
| | | |
| | | (a.baseNumber + a.applicantsNumber) as heat |
| | | from t_competition a |
| | | where a.auditStatus = 2 and a.`status` = 2 and a.state = 1 |
| | |
| | | props1.setProperty("algorithm-expression", "t_course_package_payment$->{appUserId % 5 + 1}"); |
| | | result1.getShardingAlgorithms().put("t_course_package_payment-inline", new AlgorithmConfiguration("INLINE", props1)); |
| | | result1.getKeyGenerators().put("t_course_package_payment-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | linkedList.add(result1); |
| | | |
| | | //分片规则配置 |
| | | ShardingRuleConfiguration result2 = new ShardingRuleConfiguration(); |
| | | result2.getTables().add(getCoursePackageStudentTableRuleConfiguration()); |
| | | result1.getTables().add(getCoursePackageStudentTableRuleConfiguration()); |
| | | Properties props2 = new Properties(); |
| | | props2.setProperty("algorithm-expression", "t_course_package_student$->{appUserId % 5 + 1}"); |
| | | result2.getShardingAlgorithms().put("t_course_package_student-inline", new AlgorithmConfiguration("INLINE", props2)); |
| | | result2.getKeyGenerators().put("t_course_package_student-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | linkedList.add(result2); |
| | | result1.getShardingAlgorithms().put("t_course_package_student-inline", new AlgorithmConfiguration("INLINE", props2)); |
| | | result1.getKeyGenerators().put("t_course_package_student-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | |
| | | //分片规则配置 |
| | | ShardingRuleConfiguration result3 = new ShardingRuleConfiguration(); |
| | | result3.getTables().add(getPostCourseVideoTableRuleConfiguration()); |
| | | result1.getTables().add(getPostCourseVideoTableRuleConfiguration()); |
| | | Properties props3 = new Properties(); |
| | | props3.setProperty("algorithm-expression", "t_post_course_video$->{coursePackageId % 5 + 1}"); |
| | | result3.getShardingAlgorithms().put("t_post_course_video-inline", new AlgorithmConfiguration("INLINE", props3)); |
| | | result3.getKeyGenerators().put("t_post_course_video-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | linkedList.add(result3); |
| | | result1.getShardingAlgorithms().put("t_post_course_video-inline", new AlgorithmConfiguration("INLINE", props3)); |
| | | result1.getKeyGenerators().put("t_post_course_video-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | |
| | | //分片规则配置 |
| | | ShardingRuleConfiguration result4 = new ShardingRuleConfiguration(); |
| | | result4.getTables().add(getUserVideoDetailsTableRuleConfiguration()); |
| | | result1.getTables().add(getUserVideoDetailsTableRuleConfiguration()); |
| | | Properties props4 = new Properties(); |
| | | props4.setProperty("algorithm-expression", "t_user_video_details$->{appUserId % 5 + 1}"); |
| | | result4.getShardingAlgorithms().put("t_user_video_details-inline", new AlgorithmConfiguration("INLINE", props4)); |
| | | result4.getKeyGenerators().put("t_user_video_details-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | linkedList.add(result4); |
| | | result1.getShardingAlgorithms().put("t_user_video_details-inline", new AlgorithmConfiguration("INLINE", props4)); |
| | | result1.getKeyGenerators().put("t_user_video_details-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | linkedList.add(result1); |
| | | |
| | | return linkedList; |
| | | } |