Commit 30ec26a5 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents 83b75618 3d00348c
......@@ -96,6 +96,20 @@ public class ActivityList implements Serializable {
@Column(name = "picture")
@ApiModelProperty(value = "活动图片")
private Integer picture;
/**
* 活动类型
*/
@Column(name = "type")
@ApiModelProperty(value = "活动类型")
private Integer type;
/**
* 活动页面链接
*/
@Column(name = "url")
@ApiModelProperty(value = "活动页面链接")
private Integer url;
}
......@@ -76,4 +76,18 @@ public class ActivityManagement {
@Column(name = "picture")
@ApiModelProperty(value = "活动图片")
private Integer picture;
/**
* 活动类型
*/
@Column(name = "type")
@ApiModelProperty(value = "活动类型")
private Integer type;
/**
* 活动页面链接
*/
@Column(name = "url")
@ApiModelProperty(value = "活动页面链接")
private Integer url;
}
......@@ -33,18 +33,17 @@ public class ActivityManagementBiz extends BaseBiz<ActivityManagementMapper, Act
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
public List<ActivityManagement> selectedActivityManagement() throws InvocationTargetException, IllegalAccessException {
public List<ActivityList> selectedActivityManagement() throws InvocationTargetException, IllegalAccessException {
long currentTime = System.currentTimeMillis();
Example exa=Example.builder(ActivityList.class).where(WeekendSqls.<ActivityList>custom()
.andGreaterThanOrEqualTo(ActivityList::getEndTime,currentTime)
.andLessThanOrEqualTo(ActivityList::getStartTime,currentTime)
).orderByAsc("sort").build();
activityListBiz.selectByExample(exa);
List<ActivityList> activityLists = activityListBiz.selectListAll();
if (activityLists==null||activityLists.size()==0) {
return null;
}
ArrayList<ActivityManagement> activityManagements = new ArrayList<>();
for (ActivityList activityList : activityLists) {
ActivityManagement activityManagement =getActivityManagement(activityList);
activityManagements.add(activityManagement);
}
return activityManagements;
return activityLists;
}
/**
......
......@@ -3,6 +3,7 @@ package com.xxfc.platform.activity.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.activity.biz.ActivityManagementBiz;
import com.xxfc.platform.activity.entity.ActivityList;
import com.xxfc.platform.activity.entity.ActivityManagement;
import org.springframework.web.bind.annotation.*;
......@@ -26,10 +27,21 @@ public class ActivityManagementController extends BaseController<ActivityManagem
@RequestMapping("/activity/findAll")
public ObjectRestResponse<List<ActivityManagement>> findAll() throws InvocationTargetException, IllegalAccessException {
List<ActivityManagement> list= baseBiz.selectedActivityManagement();
List<ActivityList> list= baseBiz.selectedActivityManagement();
return ObjectRestResponse.succ(list);
}
/**
* 精彩活动列表
* @return
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
@RequestMapping("/app/unauth/activity/findAll")
public ObjectRestResponse<List<ActivityManagement>> appFindAll() throws InvocationTargetException, IllegalAccessException {
List<ActivityList> list= baseBiz.selectedActivityManagement();
return ObjectRestResponse.succ(list);
}
/**
* 查找一条
......
......@@ -6,6 +6,7 @@ import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.constant.RestCode;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import com.xxfc.platform.app.vo.appVersionQuery;
import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.RedisKey;
......@@ -52,6 +53,8 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
@Value("${app.uploadPath}")
private String uploadPath;
@Value("${upload.server}")
private String Dev_url;
@Autowired
private RedisTemplate redisTemplate;
......@@ -99,16 +102,17 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
public ObjectRestResponse uploadDrivingLicense(MultipartFile file) throws IOException {
DateTime now = DateTime.now();
String dirPathToday = File.separator + now.toString(DEFAULT_DATE_TIME_FORMATTER);
String dirPathToday = "/" + now.toString(DEFAULT_DATE_TIME_FORMATTER);
// String redisNoKey = RedisKey.UPLOAD_FILE_NO_PREFIX + now.toString(DEFAULT_DATE_TIME_FORMATTER);
// Long no = redisTemplate.opsForValue().increment(redisNoKey);
// if(no.equals(1L)){
// redisTemplate.expire(redisNoKey,1, TimeUnit.DAYS);
// }
String fileName = file.getOriginalFilename();
String realFileRelPath = dirPathToday + File.separator+fileName;
String realFileRelPath = dirPathToday + "/"+fileName;
String filePath = uploadPath + realFileRelPath;
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(filePath));
realFileRelPath=Dev_url+realFileRelPath;
return ObjectRestResponse.succ(filePath);
}
......
......@@ -93,7 +93,7 @@ public class ImPraiseBiz extends BaseBiz<ImPraiseMapper, ImPraise> {
return list;
}
public boolean isExist(Long userId, Long questionId) {
public boolean isExist(Integer userId, Long questionId) {
Map<String, Object> map = new HashedMap<>();
map.put("userId", userId);
map.put("questionId",questionId);
......
......@@ -40,7 +40,11 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
public ObjectRestResponse getList(QuestionParamDto questionParamDto) {
Query query = new Query(questionParamDto);
PageDataVO<QuestionListVo> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.getQuestionList(query.getSuper()));
pageDataVO.getData().forEach((a) -> a.setPraise(imPraiseBiz.isExist(a.getUserId(), a.getId())));
AppUserDTO appUserDTO = userBiz.getUserInfo();
if(appUserDTO != null) {
pageDataVO.getData().forEach((a) -> a.setPraise(imPraiseBiz.isExist(appUserDTO.getUserid(), a.getId())));
}
return new ObjectRestResponse<>().data(pageDataVO);
}
......
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