Commit e3305c4f authored by hezhen's avatar hezhen

Merge branch 'master_activity' of...

Merge branch 'master_activity' of http://113.105.137.151:22280/youjj/cloud-platform into master_activity
parents 9c2e1d4a f2b741b4
......@@ -9,7 +9,8 @@ public class SystemConfig {
public static final String XXMP_URL = SystemProperty.getConfig("XXMP_URL");
// 视频url
public static final String VIDEO_URL = SystemProperty.getConfig("VIDEO_URL");
// token到期时间
public static final String RENOVATE =SystemProperty.getConfig("RENOVATE") ;
// token到期时间
// token到期时间
public static Integer TOKENOVERTIME = Integer.valueOf(SystemProperty.getConfig("TOKEN_OVER_TIME"));
// redis缓存时间
......
#\u9879\u76EEurl
XXMP_URL=/image
#\u538B\u7F29\u5305\u89E3\u538B\u540E\u4FDD\u5B58\u7684\u8DEF\u5F84
RENOVATE=/renovate
#\u89C6\u9891\u4FDD\u5B58\u6587\u4EF6
VIDEO_URL=/video
#token\u5230\u671F\u65F6\u95F4
......
......@@ -40,7 +40,7 @@ public class ActivityBiz extends BaseBiz<ActivityMapper, Activity> {
*/
private Integer PUBLISHED = 1;
public Object getList(ActivityQuery query) {
public PageInfo<Activity> getList(ActivityQuery query) {
// Example exa = new Example(Activity.class);
// Example.Criteria criteria = exa.createCriteria();
......@@ -137,4 +137,19 @@ public class ActivityBiz extends BaseBiz<ActivityMapper, Activity> {
params.put("id",id);
return params;
}
@Transactional(rollbackFor = Exception.class)
public boolean remove(Integer id) {
try {
Activity activity = new Activity();
activity.setId(id);
activity.setIsDel(1);
updateSelectiveById(activity);
return true;
} catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
e.printStackTrace();
return false;
}
}
}
package com.xxfc.platform.summit.controller;
import com.alibaba.druid.sql.visitor.functions.If;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.summit.biz.ActivityBiz;
......@@ -9,6 +11,8 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author Administrator
*/
......@@ -21,7 +25,27 @@ public class ActivityController extends BaseController<ActivityBiz, Activity> {
@PostMapping("/app/unauth/list")
@ApiOperation(value = "峰会列表",notes = "峰会列表")
public ObjectRestResponse getList(@RequestBody ActivityQuery query ){
return ObjectRestResponse.succ(baseBiz.getList(query));
PageInfo<Activity> info= baseBiz.getList(query);
List<Activity> list = info.getList();
if (query.getType()==1) {
for (Activity activity : list) {
if (activity.getStatus()==0){
long millis = System.currentTimeMillis();
Long startTime = activity.getStartTime();
Long endTime = activity.getEndTime();
if (millis< startTime) {
activity.setStatus(1);
}
if (millis>=startTime&&millis<=endTime){
activity.setStatus(2);
}
if (millis>endTime){
activity.setStatus(3);
}
}
}
}
return ObjectRestResponse.succ(info);
}
@Override
......@@ -44,4 +68,13 @@ public class ActivityController extends BaseController<ActivityBiz, Activity> {
return ObjectRestResponse.createDefaultFail();
}
@PutMapping("/remove/id")
@ApiOperation(value = "删除",notes = "删除")
public ObjectRestResponse remove(@PathVariable Integer id ){
if (baseBiz.remove(id)) {
return ObjectRestResponse.succ();
}
return ObjectRestResponse.createDefaultFail();
}
}
......@@ -61,7 +61,7 @@ public class UploadZipServiceImpl implements UploadZipService {
log.error("zip file save to " + uploadPath + " error", e.getMessage(), e);
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE,"保存压缩文件到:" + uploadPath + " 失败!");
}
//zip压缩包解压
//zip压缩包解压
return unPackZip(file, prefix);
}
......@@ -77,7 +77,7 @@ public class UploadZipServiceImpl implements UploadZipService {
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
if (entry.isDirectory() && index++ == 0) {
File dir = new File(uploadPath+dirPathToday);
File dir = new File(uploadPath+File.separator+dirPathToday);
dir.mkdir();
} else if (!entry.isDirectory()) {
......@@ -89,12 +89,11 @@ public class UploadZipServiceImpl implements UploadZipService {
String format = name.substring(name.lastIndexOf("."));
if (PHOTO_FORMAT.contains(format)) {
String realFileRelPath = dirPathToday + File.separator + no +format;
File targetFile = new File(uploadPath+realFileRelPath);
File targetFile = new File(uploadPath+File.separator+realFileRelPath);
FileUtils.copyInputStreamToFile(zipFile.getInputStream(entry),targetFile);
realFileRelPath=xx_url+ SystemConfig.XXMP_URL+realFileRelPath;
realFileRelPath=xx_url+ SystemConfig.RENOVATE+File.separator+realFileRelPath;
result.append(realFileRelPath+",");
}
}
}
result.substring(0,result.length()-1);
......
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