From f281d329a6fe9e61b8ff8f43cc9c7fcd0d5753cb Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期四, 27 七月 2023 17:45:14 +0800 Subject: [PATCH] 同步代码 --- cloud-server-competition/src/main/java/com/dsh/competition/model/CompetitionInfo.java | 4 ++++ cloud-server-competition/src/main/resources/mapper/PaymentCompetitionMapper.xml | 8 ++++---- cloud-server-competition/src/main/java/com/dsh/competition/model/CompetitionListVo.java | 2 +- cloud-server-other/src/main/java/com/dsh/other/service/impl/SiteServiceImpl.java | 7 +++---- cloud-server-other/src/main/resources/mapper/SiteMapper.xml | 2 +- cloud-server-competition/src/main/java/com/dsh/competition/service/impl/CompetitionServiceImpl.java | 1 + cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java | 7 ++++++- cloud-server-competition/src/main/java/com/dsh/competition/controller/CompetitionController.java | 5 +++-- cloud-server-other/src/main/java/com/dsh/other/mapper/FrequentlyAskedQuestionsMapper.java | 1 - 9 files changed, 23 insertions(+), 14 deletions(-) diff --git a/cloud-server-competition/src/main/java/com/dsh/competition/controller/CompetitionController.java b/cloud-server-competition/src/main/java/com/dsh/competition/controller/CompetitionController.java index a83c0f5..8b5074a 100644 --- a/cloud-server-competition/src/main/java/com/dsh/competition/controller/CompetitionController.java +++ b/cloud-server-competition/src/main/java/com/dsh/competition/controller/CompetitionController.java @@ -287,8 +287,8 @@ @ApiOperation(value = "获取已报名赛事列表", tags = {"APP-赛事活动列表"}) @ApiImplicitParams({ @ApiImplicitParam(value = "类型(0=全部,1=未开始,2=进行中,3=已结束,4=已取消)", name = "type", dataType = "int", required = true), - @ApiImplicitParam(value = "页码,首页1", name = "pageSize", dataType = "int", required = true), - @ApiImplicitParam(value = "页条数", name = "pageNo", dataType = "int", required = true), + @ApiImplicitParam(value = "页条数", name = "pageSize", dataType = "int", required = true), + @ApiImplicitParam(value = "页码,首页1", name = "pageNo", dataType = "int", required = true), @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") }) public ResultUtil<List<CompetitionListVo>> queryMyCompetitionList(Integer type, Integer pageSize, Integer pageNo){ @@ -363,6 +363,7 @@ paymentCompetition.setPayStatus(3); paymentCompetition.setRefundTime(new Date()); paymentCompetition.setRefundOrderNo(refund_id); + paymentCompetition.setAppUserId(null); paymentCompetitionService.updateById(paymentCompetition); Competition competition = cttService.getById(paymentCompetition.getCompetitionId()); diff --git a/cloud-server-competition/src/main/java/com/dsh/competition/model/CompetitionInfo.java b/cloud-server-competition/src/main/java/com/dsh/competition/model/CompetitionInfo.java index 28c3d75..bbc3cc6 100644 --- a/cloud-server-competition/src/main/java/com/dsh/competition/model/CompetitionInfo.java +++ b/cloud-server-competition/src/main/java/com/dsh/competition/model/CompetitionInfo.java @@ -63,4 +63,8 @@ private List<ParticipantVo> participant; @ApiModelProperty("状态(1=未开始,2=进行中,3=已结束,4=已取消)") private Integer status; + @ApiModelProperty("支付金额") + private Double payMoney; + @ApiModelProperty("支付方式(1=微信,2=支付宝,3=玩湃币,4=课时)") + private Integer payType; } diff --git a/cloud-server-competition/src/main/java/com/dsh/competition/model/CompetitionListVo.java b/cloud-server-competition/src/main/java/com/dsh/competition/model/CompetitionListVo.java index 81623bc..c919df1 100644 --- a/cloud-server-competition/src/main/java/com/dsh/competition/model/CompetitionListVo.java +++ b/cloud-server-competition/src/main/java/com/dsh/competition/model/CompetitionListVo.java @@ -12,7 +12,7 @@ @ApiModel public class CompetitionListVo { @ApiModelProperty("赛事id") - private Integer id; + private Long id; @ApiModelProperty("赛事名称") private String name; @ApiModelProperty("赛事封面") diff --git a/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/CompetitionServiceImpl.java b/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/CompetitionServiceImpl.java index cc8c4d3..74c35c7 100644 --- a/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/CompetitionServiceImpl.java +++ b/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/CompetitionServiceImpl.java @@ -203,6 +203,7 @@ paymentCompetition.setPayType(paymentCompetitionVo.getPayType()); paymentCompetition.setAmount(money.doubleValue()); paymentCompetition.setPayStatus(1); + paymentCompetition.setState(1); paymentCompetition.setInsertTime(new Date()); paymentCompetitionService.save(paymentCompetition); diff --git a/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java b/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java index 779a7b7..7a8211f 100644 --- a/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java +++ b/cloud-server-competition/src/main/java/com/dsh/competition/service/impl/PaymentCompetitionServiceImpl.java @@ -81,7 +81,7 @@ */ @Override public List<CompetitionListVo> queryMyCompetitionList(Integer uid, Integer type, Integer pageSize, Integer pageNo) throws Exception { - pageSize = (pageSize - 1) * pageNo; + pageNo = (pageNo - 1) * pageSize; if(0 == type){ type = null; } @@ -143,6 +143,8 @@ if(paymentCompetition.getPayStatus() == 3){ competitionInfo.setStatus(4); } + competitionInfo.setPayMoney(paymentCompetition.getAmount()); + competitionInfo.setPayType(paymentCompetition.getPayType()); return competitionInfo; } @@ -187,6 +189,7 @@ paymentCompetition.setRefundOrderNo(refund_id); paymentCompetition.setRefundTime(new Date()); paymentCompetition.setPayStatus(3); + paymentCompetition.setAppUserId(null); this.updateById(paymentCompetition); competition.setApplicantsNumber(competition.getApplicantsNumber() - 1); @@ -200,6 +203,7 @@ paymentCompetition.setRefundOrderNo(""); paymentCompetition.setRefundTime(new Date()); paymentCompetition.setPayStatus(3); + paymentCompetition.setAppUserId(null); this.updateById(paymentCompetition); competition.setApplicantsNumber(competition.getApplicantsNumber() - 1); @@ -220,6 +224,7 @@ paymentCompetition.setRefundOrderNo(""); paymentCompetition.setRefundTime(new Date()); paymentCompetition.setPayStatus(3); + paymentCompetition.setAppUserId(null); this.updateById(paymentCompetition); competition.setApplicantsNumber(competition.getApplicantsNumber() - 1); diff --git a/cloud-server-competition/src/main/resources/mapper/PaymentCompetitionMapper.xml b/cloud-server-competition/src/main/resources/mapper/PaymentCompetitionMapper.xml index a897e11..77d15a2 100644 --- a/cloud-server-competition/src/main/resources/mapper/PaymentCompetitionMapper.xml +++ b/cloud-server-competition/src/main/resources/mapper/PaymentCompetitionMapper.xml @@ -20,17 +20,17 @@ where a.state = 1 and a.appUserId = #{uid} and a.payStatus != 1 <!--1=未开始,2=进行中,3=已结束,4=已取消--> <if test="null != type and 1 == type"> - and b.status = 1 + and b.status = 1 and a.payStatus = 2 </if> <if test="null != type and 2 == type"> - and b.status = 2 + and b.status = 2 and a.payStatus = 2 </if> <if test="null != type and 3 == type"> - and b.status = 3 + and b.status = 3 and a.payStatus = 2 </if> <if test="null != type and 4 == type"> and a.payStatus = 3 </if> - order by a.insertTime desc limit #{pageSize}, #{pageNo} + order by a.insertTime desc limit #{pageNo}, #{pageSize} </select> </mapper> \ No newline at end of file diff --git a/cloud-server-other/src/main/java/com/dsh/other/mapper/FrequentlyAskedQuestionsMapper.java b/cloud-server-other/src/main/java/com/dsh/other/mapper/FrequentlyAskedQuestionsMapper.java index 629c450..aae3a21 100644 --- a/cloud-server-other/src/main/java/com/dsh/other/mapper/FrequentlyAskedQuestionsMapper.java +++ b/cloud-server-other/src/main/java/com/dsh/other/mapper/FrequentlyAskedQuestionsMapper.java @@ -12,5 +12,4 @@ * @since 2023-07-03 */ public interface FrequentlyAskedQuestionsMapper extends BaseMapper<FrequentlyAskedQuestions> { - } diff --git a/cloud-server-other/src/main/java/com/dsh/other/service/impl/SiteServiceImpl.java b/cloud-server-other/src/main/java/com/dsh/other/service/impl/SiteServiceImpl.java index 403a241..ede5096 100644 --- a/cloud-server-other/src/main/java/com/dsh/other/service/impl/SiteServiceImpl.java +++ b/cloud-server-other/src/main/java/com/dsh/other/service/impl/SiteServiceImpl.java @@ -134,15 +134,14 @@ int hour = e.get(Calendar.HOUR_OF_DAY); int minute = e.get(Calendar.MINUTE); List<QuerySiteTimes> list = new ArrayList<>(); + SimpleDateFormat sdfs = new SimpleDateFormat("HH:mm"); while (true){ - int s_hour = s.get(Calendar.HOUR_OF_DAY); - int s_minute = s.get(Calendar.MINUTE); - String start = s_hour + ":" + s_minute; + String start = sdfs.format(s.getTime()); s.set(Calendar.MINUTE, s.get(Calendar.MINUTE) + 30); int e_hour = s.get(Calendar.HOUR_OF_DAY); int e_minute = s.get(Calendar.MINUTE); - String end = e_hour + ":" + e_minute; + String end = sdfs.format(e.getTime()); QuerySiteTimes querySiteTimes = new QuerySiteTimes(); querySiteTimes.setTime(start + "-" + end); diff --git a/cloud-server-other/src/main/resources/mapper/SiteMapper.xml b/cloud-server-other/src/main/resources/mapper/SiteMapper.xml index 3b6aa00..592245c 100644 --- a/cloud-server-other/src/main/resources/mapper/SiteMapper.xml +++ b/cloud-server-other/src/main/resources/mapper/SiteMapper.xml @@ -19,7 +19,7 @@ left join t_site_type c on (a.siteTypeId = c.id) where a.state = 1 <if test="null != item.startTime and '' != item.startTime and null != item.endTime and '' != item.endTime"> - and CONCAT(DATE_FORMAT(now, '%Y-%m-%d', ' ', a.appointmentStartTime)) <= CONCAT(DATE_FORMAT(now, '%Y-%m-%d', ' ', #{item.startTime})) and CONCAT(DATE_FORMAT(now, '%Y-%m-%d', ' ', a.appointmentEndTime)) >= CONCAT(DATE_FORMAT(now, '%Y-%m-%d', ' ', #{item.endTime})) + and CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', a.appointmentStartTime) <= CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', #{item.startTime}) and CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', a.appointmentEndTime) >= CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', #{item.endTime}) </if> <if test="null != item.siteTypeId"> and a.siteTypeId = #{item.siteTypeId} -- Gitblit v1.7.1