Commit 529b9248 authored by hanfeng's avatar hanfeng

Merge branch 'master_activity' into base-modify

parents 4ee138d0 b4b4aa14
......@@ -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
......
package com.xxfc.platform.summit.entity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.*;
@Data
@Table(name = "ims_meepo_xianchang_rid")
@ApiModel(value = "活动实体")
public class ImsMeepoXianchangRid {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(value = "id")
private String id;
@Column(name = "weid")
@ApiModelProperty(value = "主公众号")
private String weId;
@Column(name = "uid")
@ApiModelProperty(value = "所属用户")
private String uid;
@Column(name = "rid")
@ApiModelProperty(value = "规则ID")
private String rid;
@Column(name = "title")
@ApiModelProperty(value = "活动标题")
private String title;
@Column(name = "start_time")
@ApiModelProperty(value = "活动开始时间")
private String startTime;
@Column(name = "end_time")
@ApiModelProperty(value = "活动结束时间")
private String endTime;
@Column(name = "controls")
@ApiModelProperty(value = "controls")
private String controls;
@Column(name = "zz_controls")
@ApiModelProperty(value = "zz_controls")
private String zzControls;
@Column(name = "gz_must")
@ApiModelProperty(value = "gz_must")
private String gzMust;
@Column(name = "gz_url")
@ApiModelProperty(value = "gz_url")
private String gzUrl;
@Column(name = "pass_word")
@ApiModelProperty(value = "场控密码")
private String passWord;
@Column(name = "status")
@ApiModelProperty(value = "status")
private String status;
@Column(name = "is_share")
@ApiModelProperty(value = "is_share")
private String isShare;
@Column(name = "open_gps")
@ApiModelProperty(value = "open_gps")
private String openGps;
@Column(name = "must_location")
@ApiModelProperty(value = "must_location")
private String mustLocation;
@Column(name = "tengxun_ak")
@ApiModelProperty(value = "开发秘钥")
private String tengxunAk;
@Column(name = "gps_bg")
@ApiModelProperty(value = "地区背景")
private String gpsBg;
@Column(name = "success_time")
@ApiModelProperty(value = "success_time")
private String successTime;
@Column(name = "open_gps_tiaoshi")
@ApiModelProperty(value = "open_gps_tiaoshi")
private String openGpsTiaoshi;
@Column(name = "is_pay")
@ApiModelProperty(value = "is_pay")
private String isPay;
@Column(name = "pay_type")
@ApiModelProperty(value = "pay_type")
private String payType;
@Column(name = "total_money")
@ApiModelProperty(value = "total_money")
private String totalMoney;
@Column(name = "can_join")
@ApiModelProperty(value = "can_join")
private String canJoin;
@Column(name = "pay_user")
@ApiModelProperty(value = "pay_user")
private String payUser;
@Column(name = "pay_orderid")
@ApiModelProperty(value = "订单号")
private String payOrderid;
@Column(name = "is_important")
@ApiModelProperty(value = "is_important")
private String isImportant;
@Column(name = "has_del")
@ApiModelProperty(value = "has_del")
private String hasDel;
@Column(name = "can_clearuser")
@ApiModelProperty(value = "can_clearuser")
private String canClearuser;
@Column(name = "openappnav")
@ApiModelProperty(value = "openappnav")
private String openappnav;
@Column(name = "appnav")
@ApiModelProperty(value = "appnav")
private String appnav;
@Column(name = "openpcnav")
@ApiModelProperty(value = "openpcnav")
private String openpcnav;
@Column(name = "pcnav")
@ApiModelProperty(value = "pcnav")
private String pcnav;
@Column(name = "must_range")
@ApiModelProperty(value = "must_range")
private String mustRange;
@Column(name = "pclogin_bgimg")
@ApiModelProperty(value = "pclogin_bgimg")
private String pcloginBgimg;
@Column(name = "pclogin_bgvideo")
@ApiModelProperty(value = "pclogin_bgvideo")
private String pcloginBgvideo;
@Column(name = "mustbm")
@ApiModelProperty(value = "mustbm")
private String mustbm;
@Column(name = "dwtype")
@ApiModelProperty(value = "dwtype")
private String dwtype;
@Column(name = "mustaddress")
@ApiModelProperty(value = "mustaddress")
private String mustaddress;
@Column(name = "facebm")
@ApiModelProperty(value = "1为必须人脸签到,2为无需")
private String facebm;
}
......@@ -39,7 +39,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();
......@@ -136,4 +136,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.biz;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.xxfc.platform.summit.entity.ImsMeepoXianchangRid;
import com.xxfc.platform.summit.mapper.ImsMeepoXianchangRidMapper;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
@Service
public class ImsMeepoXianchangRidBiz extends BaseBiz<ImsMeepoXianchangRidMapper, ImsMeepoXianchangRid> {
public List<ImsMeepoXianchangRid> getIds(Integer page, Integer limit) {
Example example =new Example(ImsMeepoXianchangRid.class);
example.orderBy("id").desc();
PageHelper.startPage(page,limit);
List<ImsMeepoXianchangRid> rids = mapper.selectByExample(example);
return new PageInfo<ImsMeepoXianchangRid>(rids).getList();
}
}
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();
}
}
package com.xxfc.platform.summit.controller;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.google.common.collect.Lists;
import com.xxfc.platform.summit.biz.ImsMeepoXianchangRidBiz;
import com.xxfc.platform.summit.entity.ImsMeepoXianchangRid;
import org.apache.commons.collections.CollectionUtils;
import org.mockito.internal.util.collections.ListUtil;
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;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/imxr")
public class ImsMeepoXianchangRidController extends BaseController<ImsMeepoXianchangRidBiz, ImsMeepoXianchangRid> {
@GetMapping("/ids")
public ObjectRestResponse<List> getIds(@RequestParam(value = "page",defaultValue = "1")Integer page,
@RequestParam(value = "limit",defaultValue = "10")Integer limit
){
List<ImsMeepoXianchangRid> rids = baseBiz.getIds(page, limit);
if (CollectionUtils.isEmpty(rids)) {
return ObjectRestResponse.succ(Lists.newArrayList());
}
List<String> collect = rids.parallelStream().map(ImsMeepoXianchangRid::getId).collect(Collectors.toList());
return ObjectRestResponse.succ(collect);
}
}
package com.xxfc.platform.summit.mapper;
import com.xxfc.platform.summit.entity.ImsMeepoXianchangRid;
import tk.mybatis.mapper.common.Mapper;
public interface ImsMeepoXianchangRidMapper extends Mapper<ImsMeepoXianchangRid> {
}
......@@ -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