27 changed files with 1283 additions and 8 deletions
@ -0,0 +1,97 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.activity; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 爱心互助活动banner 爱心互助活动banner |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-19 |
|||
*/ |
|||
@Data |
|||
public class ActBannerDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 活动ID |
|||
*/ |
|||
private String actId; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* banner图片 |
|||
*/ |
|||
private String bannerImg; |
|||
|
|||
/** |
|||
* banner类型 0-活动,1-连接 |
|||
*/ |
|||
private String bannerType; |
|||
|
|||
/** |
|||
* 连接地址 |
|||
*/ |
|||
private String url; |
|||
|
|||
/** |
|||
* 上下架状态 0-下架,1-上架 |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 上下架时间 |
|||
*/ |
|||
private Date statusTime; |
|||
|
|||
/** |
|||
* banner位置 0-顶部 |
|||
*/ |
|||
private String bannerPosition; |
|||
|
|||
/** |
|||
* 浏览数量 |
|||
*/ |
|||
private Integer browseNum; |
|||
|
|||
/** |
|||
* 创建部门ID |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
|
|||
} |
@ -0,0 +1,116 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.activity.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 用户活动关系表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-16 |
|||
*/ |
|||
@Data |
|||
public class ActUserRelationAuditFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
@NotBlank(message = "id不能为空") |
|||
private String id; |
|||
|
|||
/** |
|||
* 活动ID |
|||
*/ |
|||
private String actId; |
|||
|
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 用户昵称 |
|||
*/ |
|||
private String nickname; |
|||
|
|||
/** |
|||
* 用户头像 |
|||
*/ |
|||
private String faceImg; |
|||
|
|||
/** |
|||
* 党员标识(0-否,1-是) |
|||
*/ |
|||
private String partyFlag; |
|||
|
|||
/** |
|||
* 报名人真实姓名 |
|||
*/ |
|||
private String realName; |
|||
|
|||
/** |
|||
* 性别(0-女,1-男) |
|||
*/ |
|||
private String sex; |
|||
|
|||
/** |
|||
* 年龄 |
|||
*/ |
|||
private Integer age; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 身份证号 |
|||
*/ |
|||
private String identityNo; |
|||
|
|||
/** |
|||
* 当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 未通过原因(仅当未通过时录入,并读取) |
|||
*/ |
|||
@NotBlank(message = "原因不能为空") |
|||
private String failureReason; |
|||
|
|||
/** |
|||
* 审核时间 |
|||
*/ |
|||
private Date auditTime; |
|||
|
|||
/** |
|||
* 报名时间 |
|||
*/ |
|||
private Date signupTime; |
|||
|
|||
|
|||
} |
@ -0,0 +1,113 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.activity.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 用户活动关系表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-16 |
|||
*/ |
|||
@Data |
|||
public class ActUserRelationResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 活动ID |
|||
*/ |
|||
private String actId; |
|||
|
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 用户昵称 |
|||
*/ |
|||
private String nickname; |
|||
|
|||
/** |
|||
* 用户头像 |
|||
*/ |
|||
private String faceImg; |
|||
|
|||
/** |
|||
* 党员标识(0-否,1-是) |
|||
*/ |
|||
private String partyFlag; |
|||
|
|||
/** |
|||
* 报名人真实姓名 |
|||
*/ |
|||
private String realName; |
|||
|
|||
/** |
|||
* 性别(0-女,1-男) |
|||
*/ |
|||
private String sex; |
|||
|
|||
/** |
|||
* 年龄 |
|||
*/ |
|||
private Integer age; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 身份证号 |
|||
*/ |
|||
private String identityNo; |
|||
|
|||
/** |
|||
* 当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过) |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 未通过原因(仅当未通过时录入,并读取) |
|||
*/ |
|||
private String failureReason; |
|||
|
|||
/** |
|||
* 审核时间 |
|||
*/ |
|||
private Date auditTime; |
|||
|
|||
/** |
|||
* 报名时间 |
|||
*/ |
|||
private Date signupTime; |
|||
|
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
package com.elink.esua.epdc.constant; |
|||
|
|||
public interface ActStateConstant { |
|||
/** |
|||
* 活动状态-上架 |
|||
*/ |
|||
String ACT_INFO_STATUS_GROUNDING = "1"; |
|||
/** |
|||
* 活动状态-下架 |
|||
*/ |
|||
String ACT_INFO_STATUS_UNDERCARRIAGE = "0"; |
|||
|
|||
/** |
|||
* 活动BANNER状态-上架 |
|||
*/ |
|||
String ACT_BANNER_STATUS_GROUNDING = "1"; |
|||
/** |
|||
* 活动BANNER状态-下架 |
|||
*/ |
|||
String ACT_BANNER_STATUS_UNDERCARRIAGE = "0"; |
|||
|
|||
/** |
|||
* 活动报名状态-报名 |
|||
*/ |
|||
String ACT_USER_RELATION_STATUS_APPLY = "0"; |
|||
/** |
|||
* 活动报名状态-通过 |
|||
*/ |
|||
String ACT_USER_RELATION_STATUS_AUDITPASS = "1"; |
|||
|
|||
/** |
|||
* 活动报名状态-打卡 |
|||
*/ |
|||
String ACT_USER_RELATION_STATUS_CLOCK = "2"; |
|||
|
|||
/** |
|||
* 活动报名状态-取消 |
|||
*/ |
|||
String ACT_USER_RELATION_STATUS_CANCEL = "3"; |
|||
/** |
|||
* 活动报名状态-审核驳回 |
|||
*/ |
|||
String ACT_USER_RELATION_STATUS_AUDITREJECT = "4"; |
|||
|
|||
|
|||
} |
|||
|
@ -0,0 +1,98 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.controller; |
|||
|
|||
import com.elink.esua.epdc.activity.ActBannerDTO; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.modules.activity.excel.ActBannerExcel; |
|||
import com.elink.esua.epdc.modules.activity.service.ActBannerService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 爱心互助活动banner 爱心互助活动banner |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-19 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("actbanner") |
|||
public class ActBannerController { |
|||
|
|||
@Autowired |
|||
private ActBannerService actBannerService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<ActBannerDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<ActBannerDTO> page = actBannerService.page(params); |
|||
return new Result<PageData<ActBannerDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<ActBannerDTO> get(@PathVariable("id") String id){ |
|||
ActBannerDTO data = actBannerService.get(id); |
|||
return new Result<ActBannerDTO>().ok(data); |
|||
} |
|||
@GetMapping("grounding/{id}") |
|||
public Result<ActBannerDTO> grounding(@PathVariable("id") String id){ |
|||
return actBannerService.grounding(id); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody ActBannerDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
actBannerService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody ActBannerDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
actBannerService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
actBannerService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<ActBannerDTO> list = actBannerService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, ActBannerExcel.class); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 爱心互助活动banner 爱心互助活动banner |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-19 |
|||
*/ |
|||
@Mapper |
|||
public interface ActBannerDao extends BaseDao<ActBannerEntity> { |
|||
|
|||
} |
@ -0,0 +1,91 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 爱心互助活动banner 爱心互助活动banner |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-19 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_act_banner") |
|||
public class ActBannerEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 活动ID |
|||
*/ |
|||
private String actId; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* banner图片 |
|||
*/ |
|||
private String bannerImg; |
|||
|
|||
/** |
|||
* banner类型 0-活动,1-连接 |
|||
*/ |
|||
private String bannerType; |
|||
|
|||
/** |
|||
* 连接地址 |
|||
*/ |
|||
private String url; |
|||
|
|||
/** |
|||
* 上下架状态 0-下架,1-上架 |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 上下架时间 |
|||
*/ |
|||
private Date statusTime; |
|||
|
|||
/** |
|||
* banner位置 0-顶部 |
|||
*/ |
|||
private String bannerPosition; |
|||
|
|||
/** |
|||
* 浏览数量 |
|||
*/ |
|||
private Integer browseNum; |
|||
|
|||
/** |
|||
* 创建部门ID |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
} |
@ -0,0 +1,86 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 爱心互助活动banner 爱心互助活动banner |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-19 |
|||
*/ |
|||
@Data |
|||
public class ActBannerExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "活动ID") |
|||
private String actId; |
|||
|
|||
@Excel(name = "标题") |
|||
private String title; |
|||
|
|||
@Excel(name = "banner图片") |
|||
private String bannerImg; |
|||
|
|||
@Excel(name = "banner类型 0-活动,1-连接") |
|||
private String bannerType; |
|||
|
|||
@Excel(name = "连接地址") |
|||
private String url; |
|||
|
|||
@Excel(name = "上下架状态 0-下架,1-上架") |
|||
private String status; |
|||
|
|||
@Excel(name = "上下架时间") |
|||
private Date statusTime; |
|||
|
|||
@Excel(name = "banner位置 0-顶部") |
|||
private String bannerPosition; |
|||
|
|||
@Excel(name = "浏览数量") |
|||
private Integer browseNum; |
|||
|
|||
@Excel(name = "创建部门ID") |
|||
private Long deptId; |
|||
|
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
|
|||
@Excel(name = "删除标识 0-否,1-是") |
|||
private String delFlag; |
|||
|
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
|
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
|
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
|
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
|
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.redis; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 爱心互助活动banner 爱心互助活动banner |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-19 |
|||
*/ |
|||
@Component |
|||
public class ActBannerRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,98 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.service; |
|||
|
|||
import com.elink.esua.epdc.activity.ActBannerDTO; |
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 爱心互助活动banner 爱心互助活动banner |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-19 |
|||
*/ |
|||
public interface ActBannerService extends BaseService<ActBannerEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<ActBannerDTO> |
|||
* @author generator |
|||
* @date 2019-12-19 |
|||
*/ |
|||
PageData<ActBannerDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<ActBannerDTO> |
|||
* @author generator |
|||
* @date 2019-12-19 |
|||
*/ |
|||
List<ActBannerDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return ActBannerDTO |
|||
* @author generator |
|||
* @date 2019-12-19 |
|||
*/ |
|||
ActBannerDTO get(String id); |
|||
|
|||
Result grounding(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2019-12-19 |
|||
*/ |
|||
void save(ActBannerDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2019-12-19 |
|||
*/ |
|||
void update(ActBannerDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2019-12-19 |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
@ -0,0 +1,124 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.modules.activity.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.activity.ActBannerDTO; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.constant.ActStateConstant; |
|||
import com.elink.esua.epdc.modules.activity.dao.ActBannerDao; |
|||
import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; |
|||
import com.elink.esua.epdc.modules.activity.redis.ActBannerRedis; |
|||
import com.elink.esua.epdc.modules.activity.service.ActBannerService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 爱心互助活动banner 爱心互助活动banner |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-19 |
|||
*/ |
|||
@Service |
|||
public class ActBannerServiceImpl extends BaseServiceImpl<ActBannerDao, ActBannerEntity> implements ActBannerService { |
|||
|
|||
@Autowired |
|||
private ActBannerRedis actBannerRedis; |
|||
|
|||
@Override |
|||
public PageData<ActBannerDTO> page(Map<String, Object> params) { |
|||
IPage<ActBannerEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, ActBannerDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<ActBannerDTO> list(Map<String, Object> params) { |
|||
List<ActBannerEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, ActBannerDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<ActBannerEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<ActBannerEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public ActBannerDTO get(String id) { |
|||
ActBannerEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, ActBannerDTO.class); |
|||
} |
|||
@Override |
|||
public Result grounding(String id) { |
|||
ActBannerEntity entity = baseDao.selectById(id); |
|||
ActBannerEntity updateEntity = new ActBannerEntity(); |
|||
updateEntity.setId(id); |
|||
updateEntity.setStatusTime(new Date()); |
|||
// 上架
|
|||
if (ActStateConstant.ACT_BANNER_STATUS_UNDERCARRIAGE.equals(entity.getStatus())) { |
|||
updateEntity.setStatus(ActStateConstant.ACT_BANNER_STATUS_GROUNDING); |
|||
updateById(updateEntity); |
|||
// 下架
|
|||
} else if (ActStateConstant.ACT_BANNER_STATUS_GROUNDING.equals(entity.getStatus())) { |
|||
updateEntity.setStatus(ActStateConstant.ACT_BANNER_STATUS_UNDERCARRIAGE); |
|||
updateById(updateEntity); |
|||
} |
|||
return new Result(); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(ActBannerDTO dto) { |
|||
ActBannerEntity entity = ConvertUtils.sourceToTarget(dto, ActBannerEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(ActBannerDTO dto) { |
|||
ActBannerEntity entity = ConvertUtils.sourceToTarget(dto, ActBannerEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.modules.activity.dao.ActBannerDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.modules.activity.entity.ActBannerEntity" id="actBannerMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="actId" column="ACT_ID"/> |
|||
<result property="title" column="TITLE"/> |
|||
<result property="bannerImg" column="BANNER_IMG"/> |
|||
<result property="bannerType" column="BANNER_TYPE"/> |
|||
<result property="url" column="URL"/> |
|||
<result property="status" column="STATUS"/> |
|||
<result property="statusTime" column="STATUS_TIME"/> |
|||
<result property="bannerPosition" column="BANNER_POSITION"/> |
|||
<result property="browseNum" column="BROWSE_NUM"/> |
|||
<result property="deptId" column="DEPT_ID"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue