记得上下班打卡 | git大法好,push需谨慎

Commit 8686e3fe authored by 胡佳晨's avatar 胡佳晨

提交sweet 接口

parent 946ebd39
...@@ -290,6 +290,23 @@ public abstract class DateUtil { ...@@ -290,6 +290,23 @@ public abstract class DateUtil {
} }
} }
/**
* 比较日期
*/
public static int compareStrDayyyyMMdd(String date1, String date2) {
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime date1L = LocalDateTime.parse(date1, df);
LocalDateTime date2L = LocalDateTime.parse(date2, df);
if (date1L.isAfter(date2L)) {// 大于
return 1;
} else if (date1L.isBefore(date2L)) { //小于
return -1;
} else { // 相等
return 0;
}
}
/** /**
* 间隔天数 * 间隔天数
* *
......
...@@ -171,9 +171,6 @@ public class HttpUtil { ...@@ -171,9 +171,6 @@ public class HttpUtil {
public static void main(String[] args) { public static void main(String[] args) {
// String result = httpGetRequest("http://10.0.129.161:9080/globalId?code=YGOL&num=2");
// JSONObject jo = JSONObject.parseObject(result);
// System.out.println(result);
Map<String,Object> header = new HashMap<String,Object>(); Map<String,Object> header = new HashMap<String,Object>();
Map<String,Object> param = new HashMap<String,Object>(); Map<String,Object> param = new HashMap<String,Object>();
param.put("globalId","002"); param.put("globalId","002");
......
...@@ -421,7 +421,6 @@ public class DataUtils { ...@@ -421,7 +421,6 @@ public class DataUtils {
canRefundSinglePrice = singlePrice.subtract(item.getRefundPrice() == null ? BigDecimal.valueOf(0.00) : item.getRefundPrice()); canRefundSinglePrice = singlePrice.subtract(item.getRefundPrice() == null ? BigDecimal.valueOf(0.00) : item.getRefundPrice());
} }
} }
System.out.println("单票剩余未退款金额 : " + canRefundSinglePrice);
//订单锁定金额 //订单锁定金额
BigDecimal orderLockPrice = new BigDecimal("0.00"); BigDecimal orderLockPrice = new BigDecimal("0.00");
for (KylinOrderRefundsVo refundVo : kylinOrderRefundsVoBaseList) { for (KylinOrderRefundsVo refundVo : kylinOrderRefundsVoBaseList) {
...@@ -435,10 +434,8 @@ public class DataUtils { ...@@ -435,10 +434,8 @@ public class DataUtils {
} }
} }
} }
System.out.println("订单锁定金额 : " + orderLockPrice);
//订单可退金额 //订单可退金额
BigDecimal refundSinglePrice = canRefundSinglePrice.subtract(orderLockPrice); BigDecimal refundSinglePrice = canRefundSinglePrice.subtract(orderLockPrice);
System.out.println("订单可退金额 : " + refundSinglePrice);
//是否包含快递费 //是否包含快递费
if (orderTicketVo.getPriceActual().subtract(orderTicketVo.getPriceExpress()).subtract(orderTicketVo.getPriceRefund()).compareTo(canRefundSinglePrice) == 0) { if (orderTicketVo.getPriceActual().subtract(orderTicketVo.getPriceExpress()).subtract(orderTicketVo.getPriceRefund()).compareTo(canRefundSinglePrice) == 0) {
refundSinglePrice = refundSinglePrice.add(orderTicketVo.getPriceExpress()); refundSinglePrice = refundSinglePrice.add(orderTicketVo.getPriceExpress());
......
...@@ -57,7 +57,6 @@ public class DMCheckOrderTimeImpl extends ServiceImpl<KylinOrderTicketsMapper, K ...@@ -57,7 +57,6 @@ public class DMCheckOrderTimeImpl extends ServiceImpl<KylinOrderTicketsMapper, K
private KylinOrderTicketRelationsMapper orderTicketRelationsMapper; private KylinOrderTicketRelationsMapper orderTicketRelationsMapper;
public boolean checkOrderTime(String userId) { public boolean checkOrderTime(String userId) {
String lock = "order_lock:checkOrderTime:" + userId;
List<OrderScriptDto> dtoData = orderTicketsMapper.orderScriptDto(userId); List<OrderScriptDto> dtoData = orderTicketsMapper.orderScriptDto(userId);
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
Long currentTime = System.currentTimeMillis(); Long currentTime = System.currentTimeMillis();
......
...@@ -460,7 +460,6 @@ public class DataImpl { ...@@ -460,7 +460,6 @@ public class DataImpl {
con = DriverManager.getConnection(url, username, password); //获取连接 con = DriverManager.getConnection(url, username, password); //获取连接
String sqlAllCount = "select count(0) as 'allCount' from order_tickets where performance_id > 5721 and status != 2 and status != -1 and created_at like '2021-" + month + "%'"; //设置的预编译语句格式 String sqlAllCount = "select count(0) as 'allCount' from order_tickets where performance_id > 5721 and status != 2 and status != -1 and created_at like '2021-" + month + "%'"; //设置的预编译语句格式
// String sqlAllCount = "select count(0) as 'allCount' from order_tickets where performance_id = "+month + " and status != 2 and status !=-1"; //设置的预编译语句格式 // String sqlAllCount = "select count(0) as 'allCount' from order_tickets where performance_id = "+month + " and status != 2 and status !=-1"; //设置的预编译语句格式
System.out.println(" SQL COUNT = " + sqlAllCount);
pstmt = con.prepareStatement(sqlAllCount); pstmt = con.prepareStatement(sqlAllCount);
ResultSet allCount = pstmt.executeQuery(); ResultSet allCount = pstmt.executeQuery();
int allCountResult = 0;//共多少条 int allCountResult = 0;//共多少条
...@@ -482,7 +481,6 @@ public class DataImpl { ...@@ -482,7 +481,6 @@ public class DataImpl {
//订单 //订单
String sql = "select * from order_tickets where performance_id > 5721 and status != 2 and status != -1 and created_at like '2021-" + month + "%' limit " + count * page + " ," + count; //设置的预编译语句格式 String sql = "select * from order_tickets where performance_id > 5721 and status != 2 and status != -1 and created_at like '2021-" + month + "%' limit " + count * page + " ," + count; //设置的预编译语句格式
// String sql = "select * from order_tickets where performance_id = "+month +" and status != 2 limit " + count * page + " ," + count; // String sql = "select * from order_tickets where performance_id = "+month +" and status != 2 limit " + count * page + " ," + count;
System.out.println(" SQL DATA = " + sql);
pstmt = con.prepareStatement(sql); pstmt = con.prepareStatement(sql);
ResultSet orderData = pstmt.executeQuery(); ResultSet orderData = pstmt.executeQuery();
while (orderData.next()) { while (orderData.next()) {
......
...@@ -239,7 +239,6 @@ public class DataUtils { ...@@ -239,7 +239,6 @@ public class DataUtils {
e.printStackTrace(); e.printStackTrace();
} }
} else { } else {
System.out.println("创建Vo异常");
} }
} }
......
...@@ -39,9 +39,6 @@ public class OrderUtils { ...@@ -39,9 +39,6 @@ public class OrderUtils {
} else { } else {
integers = roadShowOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName); integers = roadShowOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName);
} }
System.out.println("integers PERFORMANCE= " + integers[0]);
System.out.println("integers TICKETS= " + integers[1]);
return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, ticketLimitCount, ticketMemberLimitCount, memberType, integers[0], integers[1]); return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, ticketLimitCount, ticketMemberLimitCount, memberType, integers[0], integers[1]);
} }
......
...@@ -27,9 +27,5 @@ public class SweetConstant { ...@@ -27,9 +27,5 @@ public class SweetConstant {
public String getMessage() { public String getMessage() {
return message; return message;
} }
public String getMessageByCode(String code) {
return ManualPosition.valueOf(code).getMessage();
}
} }
} }
package com.liquidnet.service.sweet.controller;
import com.github.pagehelper.PageInfo;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.sweet.dto.SweetManualAppletDto;
import com.liquidnet.service.sweet.dto.SweetManualArtistList2Dto;
import com.liquidnet.service.sweet.dto.SweetManualArtistListDto;
import com.liquidnet.service.sweet.entity.SweetManualNotify;
import com.liquidnet.service.sweet.entity.SweetRichtext;
import com.liquidnet.service.sweet.entity.SweetStage;
import com.liquidnet.service.sweet.utils.RedisDataUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(tags = "小程序")
@RestController
@RequestMapping("/sweet-applet")
public class SweetAppletController {
@Autowired
private RedisDataUtils redisDataUtils;
@GetMapping("timeSelect")
@ApiOperation("场次选择")
public ResponseDto<List<SweetManualAppletDto>> timeSelect() {
return ResponseDto.success(redisDataUtils.getPushList());
}
@GetMapping("details")
@ApiOperation("详情")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "电子手册id", required = true),
})
public ResponseDto<SweetManualAppletDto> details(@RequestParam(defaultValue = "1") String manualId) {
return ResponseDto.success(redisDataUtils.getAppletPerformance(manualId));
}
@GetMapping("notify")
@ApiOperation("通知")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "电子手册id", required = true),
})
public ResponseDto<List<SweetManualNotify>> notify(@RequestParam(defaultValue = "1") String manualId) {
return ResponseDto.success(redisDataUtils.getNotifyRedisData(manualId));
}
@GetMapping("tags")
@ApiOperation("标签")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "电子手册id", required = true),
})
public ResponseDto<List<String>> tag(@RequestParam(defaultValue = "1") String manualId) {
return ResponseDto.success(redisDataUtils.getTagRedisData(manualId));
}
@GetMapping("timeList")
@ApiOperation("时间表")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "电子手册id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "dateTime", value = "时间 全部传 \"\"", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "stage", value = "舞台 全部传 \"\"", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "isSign", value = "是否签名(1是0否)", required = true),
})
public ResponseDto<SweetManualArtistList2Dto> timeList(@RequestParam(defaultValue = "1") String manualId,
@RequestParam(defaultValue = "2021-12-01") String dateTime,
@RequestParam(defaultValue = "测试舞台") String stage,
@RequestParam(defaultValue = "isSign") Integer isSign) {
SweetManualArtistList2Dto data = redisDataUtils.getTimeList(manualId, dateTime);
List<SweetManualArtistListDto> artistData = data.getData();
List<SweetManualArtistListDto> returnArtist = data.getData();
for (SweetManualArtistListDto item : artistData) {
boolean isSave = false;
if (isSign == 1) {
if (item.getSignatureStart() != null) {
//保留
isSave = true;
}
}
if (!dateTime.isEmpty()) {
if (item.getPerformanceStart().contains(dateTime)) {
//保留
isSave = true;
}
}
if (!stage.isEmpty()) {
if (item.getTitle().equalsIgnoreCase(stage)) {
//保留
isSave = true;
}
}
if (isSave) {
returnArtist.add(item);
}
}
data.setData(returnArtist);
return ResponseDto.success(data);
}
@GetMapping("richText")
@ApiOperation("富文本")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "电子手册id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "type", value = "类型 (1签售时间 2现场地图 3官方大巴 4公共交通 5自驾导航坐标 6官方支持 7观众须知 8防疫指南 9观演攻略)", required = true),
})
public ResponseDto<SweetRichtext> richText(@RequestParam(defaultValue = "1") String manualId,
@RequestParam(defaultValue = "1") String type) {
return ResponseDto.success(redisDataUtils.getRichTextRedisData(manualId, type));
}
@GetMapping("artistDetails")
@ApiOperation("艺人详情")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "电子手册id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "type", value = "类型 (1签售时间 2现场地图 3官方大巴 4公共交通 5自驾导航坐标 6官方支持 7观众须知 8防疫指南 9观演攻略)", required = true),
})
public ResponseDto<SweetRichtext> artistDetails(@RequestParam(defaultValue = "1") String manualId,
@RequestParam(defaultValue = "1") String type) {
return ResponseDto.success(redisDataUtils.getRichTextRedisData(manualId, type));
}
}
...@@ -58,7 +58,7 @@ public class SweetArtistsController { ...@@ -58,7 +58,7 @@ public class SweetArtistsController {
return sweetArtistsService.add(picUrl, name, pinyin, describe); return sweetArtistsService.add(picUrl, name, pinyin, describe);
} }
@PostMapping("detail") @GetMapping("detail")
@ApiOperation("艺人详情") @ApiOperation("艺人详情")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "artistsId", value = "艺人Id", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "artistsId", value = "艺人Id", required = true),
......
...@@ -12,11 +12,7 @@ import io.swagger.annotations.ApiImplicitParam; ...@@ -12,11 +12,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <p> * <p>
...@@ -56,7 +52,7 @@ public class SweetManualArtistsController { ...@@ -56,7 +52,7 @@ public class SweetManualArtistsController {
return sweetManualArtistsService.details(manualRelationId); return sweetManualArtistsService.details(manualRelationId);
} }
@GetMapping("add") @PostMapping("add")
@ApiOperation("宣传手册艺人添加") @ApiOperation("宣传手册艺人添加")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "手册id", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "手册id", required = true),
...@@ -77,7 +73,7 @@ public class SweetManualArtistsController { ...@@ -77,7 +73,7 @@ public class SweetManualArtistsController {
return sweetManualArtistsService.add(manualId, artistId, stageId, performanceStart, performanceEnd, signatureStart, signatureEnd); return sweetManualArtistsService.add(manualId, artistId, stageId, performanceStart, performanceEnd, signatureStart, signatureEnd);
} }
@GetMapping("change") @PostMapping("change")
@ApiOperation("宣传手册艺人修改") @ApiOperation("宣传手册艺人修改")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualRelationId", value = "手册艺人id", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "manualRelationId", value = "手册艺人id", required = true),
...@@ -98,7 +94,7 @@ public class SweetManualArtistsController { ...@@ -98,7 +94,7 @@ public class SweetManualArtistsController {
return sweetManualArtistsService.change(manualRelationId, artistId, stageId, performanceStart, performanceEnd, signatureStart, signatureEnd); return sweetManualArtistsService.change(manualRelationId, artistId, stageId, performanceStart, performanceEnd, signatureStart, signatureEnd);
} }
@GetMapping("delete") @DeleteMapping("delete")
@ApiOperation("宣传手册艺人删除") @ApiOperation("宣传手册艺人删除")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualRelationId", value = "手册艺人id", required = true) @ApiImplicitParam(type = "query", dataType = "String", name = "manualRelationId", value = "手册艺人id", required = true)
......
...@@ -12,11 +12,7 @@ import io.swagger.annotations.ApiImplicitParam; ...@@ -12,11 +12,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <p> * <p>
...@@ -47,7 +43,7 @@ public class SweetManualController { ...@@ -47,7 +43,7 @@ public class SweetManualController {
return sweetManualService.getManualList(page, size, name); return sweetManualService.getManualList(page, size, name);
} }
@GetMapping("changeRelease") @PostMapping("changeRelease")
@ApiOperation("修改是否发布") @ApiOperation("修改是否发布")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "Integer", name = "page", value = "页数", required = true), @ApiImplicitParam(type = "query", dataType = "Integer", name = "page", value = "页数", required = true),
...@@ -58,7 +54,7 @@ public class SweetManualController { ...@@ -58,7 +54,7 @@ public class SweetManualController {
return sweetManualService.changeRelease(manualId, isRelease); return sweetManualService.changeRelease(manualId, isRelease);
} }
@GetMapping("changeStatus") @PostMapping("changeStatus")
@ApiOperation("修改是否开启") @ApiOperation("修改是否开启")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "电子手册id", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "电子手册id", required = true),
......
...@@ -59,7 +59,7 @@ public class SweetManualNotifyController { ...@@ -59,7 +59,7 @@ public class SweetManualNotifyController {
return sweetManualNotifyService.add(manualId, title, content); return sweetManualNotifyService.add(manualId, title, content);
} }
@PostMapping("detail") @GetMapping("detail")
@ApiOperation("通知详情") @ApiOperation("通知详情")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "手册id", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "手册id", required = true),
...@@ -81,7 +81,7 @@ public class SweetManualNotifyController { ...@@ -81,7 +81,7 @@ public class SweetManualNotifyController {
return sweetManualNotifyService.change(manualId, title, content); return sweetManualNotifyService.change(manualId, title, content);
} }
@PostMapping("delete") @DeleteMapping("delete")
@ApiOperation("删除通知") @ApiOperation("删除通知")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualNotifyId", value = "手册通知id", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "manualNotifyId", value = "手册通知id", required = true),
......
...@@ -9,11 +9,7 @@ import io.swagger.annotations.ApiImplicitParam; ...@@ -9,11 +9,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <p> * <p>
...@@ -32,7 +28,7 @@ public class SweetManualSortController { ...@@ -32,7 +28,7 @@ public class SweetManualSortController {
private ISweetManualSortService sweetManualSortService; private ISweetManualSortService sweetManualSortService;
@GetMapping("add") @PostMapping("add")
@ApiOperation("操作 电子手册tag") @ApiOperation("操作 电子手册tag")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "电子手册id", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "电子手册id", required = true),
......
...@@ -12,11 +12,7 @@ import io.swagger.annotations.ApiImplicitParam; ...@@ -12,11 +12,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <p> * <p>
...@@ -62,7 +58,7 @@ public class SweetRichtextController { ...@@ -62,7 +58,7 @@ public class SweetRichtextController {
return sweetRichtextService.add(manualId, details, local, picUrl, type); return sweetRichtextService.add(manualId, details, local, picUrl, type);
} }
@GetMapping("change") @PostMapping("change")
@ApiOperation("修改富文本") @ApiOperation("修改富文本")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "Integer", name = "manualId", value = "页数", required = true), @ApiImplicitParam(type = "query", dataType = "Integer", name = "manualId", value = "页数", required = true),
......
...@@ -50,7 +50,7 @@ public class SweetStageController { ...@@ -50,7 +50,7 @@ public class SweetStageController {
return sweetStageService.add(name); return sweetStageService.add(name);
} }
@PostMapping("detail") @GetMapping("detail")
@ApiOperation("舞台详情") @ApiOperation("舞台详情")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "stageId", value = "舞台Id", required = true), @ApiImplicitParam(type = "query", dataType = "String", name = "stageId", value = "舞台Id", required = true),
......
package com.liquidnet.service.sweet.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class SweetManualAppletDto implements Serializable {
private String manualId;
private String performancesId;
private String title;
private String fieldId;
private String fieldName;
private String cityName;
private String timeStart;
private String timeEnd;
private String longitude;
private String latitude;
}
package com.liquidnet.service.sweet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class SweetManualArtistList2Dto implements Serializable {
private List<SweetManualArtistListDto> data;
private List<String> date;
private List<SweetManualArtistStageListDto> stage;
}
...@@ -3,6 +3,7 @@ package com.liquidnet.service.sweet.dto; ...@@ -3,6 +3,7 @@ package com.liquidnet.service.sweet.dto;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
@Data @Data
public class SweetManualArtistListDto implements Serializable { public class SweetManualArtistListDto implements Serializable {
...@@ -15,4 +16,5 @@ public class SweetManualArtistListDto implements Serializable { ...@@ -15,4 +16,5 @@ public class SweetManualArtistListDto implements Serializable {
private String signatureStart; private String signatureStart;
private String signatureEnd; private String signatureEnd;
private ArrayList<String> date;
} }
package com.liquidnet.service.sweet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
@Data
public class SweetManualArtistStageListDto implements Serializable {
private String title;
}
...@@ -16,5 +16,4 @@ public class SweetManualDto implements Serializable { ...@@ -16,5 +16,4 @@ public class SweetManualDto implements Serializable {
private Integer status; private Integer status;
private Integer manualStatus; private Integer manualStatus;
private Integer isRelease; private Integer isRelease;
} }
package com.liquidnet.service.sweet.mapper; package com.liquidnet.service.sweet.mapper;
import com.liquidnet.service.sweet.dto.SweetManualArtistListDto; import com.liquidnet.service.sweet.dto.SweetManualArtistListDto;
import com.liquidnet.service.sweet.dto.SweetManualArtistStageListDto;
import com.liquidnet.service.sweet.dto.SweetManualDto; import com.liquidnet.service.sweet.dto.SweetManualDto;
import com.liquidnet.service.sweet.entity.SweetManualArtists; import com.liquidnet.service.sweet.entity.SweetManualArtists;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...@@ -22,4 +23,5 @@ public interface SweetManualArtistsMapper extends BaseMapper<SweetManualArtists> ...@@ -22,4 +23,5 @@ public interface SweetManualArtistsMapper extends BaseMapper<SweetManualArtists>
SweetManualArtistListDto getManualDetails(Map<String, Object> map); SweetManualArtistListDto getManualDetails(Map<String, Object> map);
List<SweetManualArtistStageListDto> getStageNameList(Map<String, Object> map);
} }
package com.liquidnet.service.sweet.mapper; package com.liquidnet.service.sweet.mapper;
import com.liquidnet.service.sweet.dto.SweetManualAppletDto;
import com.liquidnet.service.sweet.dto.SweetManualDto; import com.liquidnet.service.sweet.dto.SweetManualDto;
import com.liquidnet.service.sweet.entity.SweetManual; import com.liquidnet.service.sweet.entity.SweetManual;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...@@ -19,4 +20,5 @@ public interface SweetManualMapper extends BaseMapper<SweetManual> { ...@@ -19,4 +20,5 @@ public interface SweetManualMapper extends BaseMapper<SweetManual> {
List<SweetManualDto> getManualList(Map<String,Object> map); List<SweetManualDto> getManualList(Map<String,Object> map);
List<SweetManualAppletDto> getManualAppletDto();
} }
package com.liquidnet.service.sweet.utils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.sweet.constant.SweetConstant;
import com.liquidnet.service.sweet.dto.SweetManualAppletDto;
import com.liquidnet.service.sweet.dto.SweetManualArtistList2Dto;
import com.liquidnet.service.sweet.dto.SweetManualArtistListDto;
import com.liquidnet.service.sweet.dto.SweetManualArtistStageListDto;
import com.liquidnet.service.sweet.entity.SweetManualNotify;
import com.liquidnet.service.sweet.entity.SweetManualSort;
import com.liquidnet.service.sweet.entity.SweetRichtext;
import com.liquidnet.service.sweet.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@Component
public class RedisDataUtils {
@Autowired
private RedisUtil redisUtil;
@Autowired
private SweetManualMapper sweetManualMapper;
@Autowired
private SweetManualArtistsMapper sweetManualArtistsMapper;
@Autowired
private SweetRichtextMapper sweetRichtextMapper;
@Autowired
private SweetManualSortMapper sweetManualSortMapper;
@Autowired
private SweetManualNotifyMapper sweetManualNotifyMapper;
public List<SweetManualAppletDto> setPushList() {
String redisKey = "";
List<SweetManualAppletDto> data = sweetManualMapper.getManualAppletDto();
for (SweetManualAppletDto item : data) {
item.setFieldName((String) redisUtil.hget("kylin:fields:id" + ":" + item.getFieldId(), "name"));
item.setLatitude((String) redisUtil.hget("kylin:fields:id" + ":" + item.getFieldId(), "latitude"));
item.setLongitude((String) redisUtil.hget("kylin:fields:id" + ":" + item.getFieldId(), "longitude"));
}
redisUtil.set(redisKey, data);
return data;
}
public List<SweetManualAppletDto> getPushList() {
String redisKey = "";
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return setPushList();
} else {
return (List<SweetManualAppletDto>) obj;
}
}
public SweetManualAppletDto getAppletPerformance(String manualId) {
List<SweetManualAppletDto> data = getPushList();
SweetManualAppletDto returnData = new SweetManualAppletDto();
for (SweetManualAppletDto item : data) {
if (item.getManualId().equalsIgnoreCase(manualId)) {
returnData = item;
break;
}
}
return returnData;
}
public SweetManualArtistList2Dto setTimeList(String manualId, String dateTime) {
String redisKey = "".concat(manualId).concat(dateTime);
HashMap<String, Object> map = new HashMap<>();
map.put("manualId", manualId);
List<SweetManualArtistListDto> data = sweetManualArtistsMapper.getManualList(map);
//获取时间
SweetManualAppletDto sweetManualAppletDto = getAppletPerformance(manualId);
int intervalDay = (int) DateUtil.intervalDays(DateUtil.parse(sweetManualAppletDto.getTimeStart(), "yyyyMMdd"), (DateUtil.parse(sweetManualAppletDto.getTimeEnd(), "yyyyMMdd")));
Date timeStartDate = DateUtil.parse(sweetManualAppletDto.getTimeStart(), "yyyyMMdd");
ArrayList<String> list = new ArrayList<>();
list.add(DateUtil.format(timeStartDate, DateUtil.Formatter.yyyy_MM_dd));
for (int i = 0; i < intervalDay; i++) {
list.add(DateUtil.format(DateUtil.addDay(timeStartDate, 1), DateUtil.Formatter.yyyy_MM_dd));
}
//获取舞台
List<SweetManualArtistStageListDto> stageData = sweetManualArtistsMapper.getStageNameList(map);
SweetManualArtistList2Dto returnData = new SweetManualArtistList2Dto();
returnData.setDate(list);
returnData.setData(data);
returnData.setStage(stageData);
redisUtil.set(redisKey, returnData);
return returnData;
}
public SweetManualArtistList2Dto getTimeList(String manualId, String dateTime) {
String redisKey = "".concat(manualId).concat(dateTime);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return setTimeList(manualId, dateTime);
} else {
return (SweetManualArtistList2Dto) obj;
}
}
public SweetRichtext setRichTextRedisData(String manualId, String type) {
String redisKey = "".concat(manualId).concat(type);
SweetRichtext sweetRichtext = sweetRichtextMapper.selectOne(Wrappers.lambdaQuery(SweetRichtext.class).eq(SweetRichtext::getManualId, manualId).eq(SweetRichtext::getType, type));
redisUtil.set(redisKey, sweetRichtext);
return sweetRichtext;
}
public SweetRichtext getRichTextRedisData(String manualId, String type) {
String redisKey = "".concat(manualId).concat(type);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return setRichTextRedisData(manualId, type);
} else {
return (SweetRichtext) obj;
}
}
public List<String> setTagRedisData(String manualId) {
String redisKey = "".concat(manualId);
SweetManualSort data = sweetManualSortMapper.selectOne(Wrappers.lambdaQuery(SweetManualSort.class).eq(SweetManualSort::getManualId, manualId));
String[] arrays = data.getShowPosition().split(",");
List<String> returnData = new ArrayList<>();
for (String item : arrays) {
returnData.add(SweetConstant.ManualPosition.valueOf(item).getMessage());
}
redisUtil.set(redisKey, returnData);
return returnData;
}
public List<String> getTagRedisData(String manualId) {
String redisKey = "".concat(manualId);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return setTagRedisData(manualId);
} else {
return (List<String>) obj;
}
}
public List<SweetManualNotify> setNotifyRedisData(String manualId) {
String redisKey = "".concat(manualId);
List<SweetManualNotify> data = sweetManualNotifyMapper.selectList(Wrappers.lambdaQuery(SweetManualNotify.class).eq(SweetManualNotify::getManualId, manualId).eq(SweetManualNotify::getStatus, 1));
redisUtil.set(redisKey, data);
return data;
}
public List<SweetManualNotify> getNotifyRedisData(String manualId) {
String redisKey = "".concat(manualId);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return setNotifyRedisData(manualId);
} else {
return (List<SweetManualNotify>) obj;
}
}
}
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
<result column="signature_end" property="signatureEnd"/> <result column="signature_end" property="signatureEnd"/>
</resultMap> </resultMap>
<resultMap id="getStageNameListResult" type="com.liquidnet.service.sweet.dto.SweetManualArtistStageListDto">
<result column="title" property="title"/>
</resultMap>
<select id="getManualList" parameterType="java.util.Map" resultMap="getManualListResult"> <select id="getManualList" parameterType="java.util.Map" resultMap="getManualListResult">
select manual_relation_id, select manual_relation_id,
sa.`name`, sa.`name`,
...@@ -23,7 +27,9 @@ ...@@ -23,7 +27,9 @@
from sweet_manual_artists as sma from sweet_manual_artists as sma
left join sweet_artists as sa on sa.artists_id = sma.artists_id left join sweet_artists as sa on sa.artists_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id left join sweet_stage as ss on ss.stage_id = sma.stage_id
where manual_id = #{manualId} <where>
sma.status = 1 and manual_id = #{manualId}
</where>
</select> </select>
<select id="getManualDetails" parameterType="java.util.Map" resultMap="getManualListResult"> <select id="getManualDetails" parameterType="java.util.Map" resultMap="getManualListResult">
...@@ -39,4 +45,15 @@ ...@@ -39,4 +45,15 @@
left join sweet_stage as ss on ss.stage_id = sma.stage_id left join sweet_stage as ss on ss.stage_id = sma.stage_id
where manual_relation_id = #{manualRelationId} where manual_relation_id = #{manualRelationId}
</select> </select>
<select id="getStageNameList" parameterType="java.util.Map" resultMap="getStageNameListResult">
select ss.title
from sweet_manual_artists as sma
left join sweet_artists as sa on sa.artists_id = sma.artists_id
left join sweet_stage as ss on ss.stage_id = sma.stage_id
where sma.status = 1
and manual_id = #{manualId}
group by ss.title;
</select>
</mapper> </mapper>
...@@ -14,6 +14,16 @@ ...@@ -14,6 +14,16 @@
<result column="is_release" property="isRelease"/> <result column="is_release" property="isRelease"/>
</resultMap> </resultMap>
<resultMap id="getManualAppletListResult" type="com.liquidnet.service.sweet.dto.SweetManualAppletDto">
<result column="manual_id" property="manualId"/>
<result column="performances_id" property="performancesId"/>
<result column="title" property="title"/>
<result column="field_id" property="fieldId"/>
<result column="city_name" property="cityName"/>
<result column="time_start" property="timeStart"/>
<result column="time_end" property="timeEnd"/>
</resultMap>
<!-- 电子手册列表 --> <!-- 电子手册列表 -->
<select id="getManualList" parameterType="java.util.Map" resultMap="partnerPerformanceListResult"> <select id="getManualList" parameterType="java.util.Map" resultMap="partnerPerformanceListResult">
SELECT SELECT
...@@ -57,4 +67,13 @@ ...@@ -57,4 +67,13 @@
ORDER BY p.created_at desc ORDER BY p.created_at desc
</select> </select>
<select id="getManualAppletList" resultMap="getManualAppletListResult">
select manual_id, performances_id, title, field_id, city_name, time_start, time_end
from kylin_performances as kp
left join sweet_manual as sw on sw.performance_id = kp.performances_id
left join kylin_performance_relations as kpr on kpr.performance_id = kp.performances_id
where sw.`status` = 1
and sw.is_release = 1
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment