新增时间工具,前端显示的时间不要秒

This commit is contained in:
mark 2023-04-26 13:55:12 +08:00
parent bcfcef4395
commit cd2c8248f8
2 changed files with 59 additions and 3 deletions

View File

@ -47,6 +47,10 @@ public class IPOController {
@Value("${logo_link.id}")
private Integer linkId;
/**
* 查询数据库中所有的ipo
* @return
*/
@RequestMapping("/ipos/all")
public Result allIPOs(){
@ -57,6 +61,10 @@ public class IPOController {
return Result.success(ipos);
}
/**
* 根据ipo 的listing_date查询ipo,要求now<listingDate,并添加logo的链接
* @return
*/
@RequestMapping("/ipos/listv1")
@Cacheable(cacheNames = "todayIpos")
@Transactional
@ -81,6 +89,7 @@ public class IPOController {
iporedata.setLogoLink(logoLink);
iporedata.setDateTime(TimeUtil.formatTime(lasttime));
iporedata.setListingDate(TimeUtil.formatTime(listingtime));
iporedata.setGraph(dataForGraph);
@ -92,7 +101,11 @@ public class IPOController {
}
/**
* 根据前端传给后端的日期值来查询listingDate返回给前端listingDate是那一天的所有IPO
* @param dateString
* @return
*/
@RequestMapping("/ipos/listingData")
@Cacheable(cacheNames = "onedayIpos",key="#dateString")
public Result onedayIpos(String dateString) {

View File

@ -49,6 +49,11 @@ public class IPOReferenceDataController {
@Value("${logo_link.id}")
private Integer linkId;
/**
*根据ipoID查询相对应的IPO的详细信息并附上logo链接和PDF下载链接还有Dashbord的public的图graph
* @param ipoID
* @return
*/
@RequestMapping("/ipo/refdata/v1")
@Cacheable(cacheNames = "homepage",key="#ipoID")
public Result result(String ipoID){
@ -82,6 +87,11 @@ public class IPOReferenceDataController {
return Result.success(data);
}
/**
* 根据前端要求通过ipoID筛选companyInformation字段信息返回
* @param ipoID
* @return
*/
@RequestMapping("/ipo/refdata/companyInformation")
@Cacheable(cacheNames = "CI",key="#ipoID")
public Result resultCI(String ipoID){
@ -99,7 +109,11 @@ public class IPOReferenceDataController {
return Result.success(data);
}
/**
* 根据前端要求通过ipoID筛选typeOfListing字段信息返回
* @param ipoID
* @return
*/
@RequestMapping("/ipo/refdata/typeOfListing")
@Cacheable(cacheNames = "TOL",key="#ipoID")
public Result resultTOL(String ipoID){
@ -113,6 +127,11 @@ public class IPOReferenceDataController {
return Result.success(data);
}
/**
* 根据前端要求通过ipoID筛选offering字段信息返回
* @param ipoID
* @return
*/
@RequestMapping("/ipo/refdata/offering")
@Cacheable(cacheNames = "OFF",key="#ipoID")
public Result resultOffering(String ipoID){
@ -126,7 +145,11 @@ public class IPOReferenceDataController {
return Result.success(data);
}
/**
* 根据前端传入的关键字,使用sql进行模糊查询
* @param keyword
* @return
*/
@RequestMapping("/ipo/refdata/search")
public Result search(String keyword){
@ -135,6 +158,11 @@ public class IPOReferenceDataController {
return Result.success(search);
}
/**
* 根据ipoID查询字段给前端的Dashboard里的日历提供数据
* @param ipoID
* @return
*/
@RequestMapping("/ipo/refdata/calendar")
@Cacheable(cacheNames = "calendar",key="#ipoID")
public Result calendar(String ipoID){
@ -145,15 +173,30 @@ public class IPOReferenceDataController {
return Result.success(ipoReferenceData);
}
/**
* 主页的帅选功能根据前端传回的字段筛选相应的内容支持多条件筛选
* @param params
* @return
*/
@PostMapping("/ipo/refdata/filter")
public Result getData(@RequestBody Map<String, Object> params) {
List<IPOReferenceData> data = ipoReferenceDataService.selectByConditions(params);
LogoLink link = logoLinkService.link(linkId);
for (IPOReferenceData ipo : data) {
ipo.setListingDate(TimeUtil.formatTime(ipo.getListingDate()));
try {
String logoLink= link.getLogoLinkPre()+ipo.getIpoID()+link.getLogoLinkSuf();
ipo.setLogoLink(logoLink);
} catch (Exception e) {
}
}
if (Objects.isNull(data)){