Browse Source
# Conflicts: # epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java # epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xmldev_shibei_match
79 changed files with 2910 additions and 721 deletions
@ -0,0 +1,42 @@ |
|||
package com.epmet.commons.tools.enums; |
|||
|
|||
/** |
|||
* 通用操作类型 枚举类 |
|||
* dev|test|prod |
|||
* |
|||
* @author jianjun liu |
|||
* @date 2020-07-03 11:14 |
|||
**/ |
|||
public enum CommonOperateTypeEnum { |
|||
ADD("add", "添加"), |
|||
EDIT("edit", "编辑"), |
|||
DEL("del", "删除"), |
|||
; |
|||
|
|||
private String code; |
|||
private String desc; |
|||
|
|||
|
|||
CommonOperateTypeEnum(String code, String name) { |
|||
this.code = code; |
|||
this.desc = name; |
|||
} |
|||
|
|||
public static CommonOperateTypeEnum getEnum(String code) { |
|||
CommonOperateTypeEnum[] values = CommonOperateTypeEnum.values(); |
|||
for (CommonOperateTypeEnum value : values) { |
|||
if (code != null && value.getCode().equals(code)) { |
|||
return value; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public String getCode() { |
|||
return code; |
|||
} |
|||
|
|||
public String getDesc() { |
|||
return desc; |
|||
} |
|||
} |
@ -0,0 +1,46 @@ |
|||
package com.epmet.dto.form.resi; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.Min; |
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 活动内容(活动详情-已结束-回顾稿) 入参 |
|||
* |
|||
* @Auther: zhangyong |
|||
* @Date: 2020-07-21 18:12 |
|||
*/ |
|||
@Data |
|||
public class ResiActContentFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
//>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>>
|
|||
/** |
|||
* 添加用户操作的内部异常分组 |
|||
* 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... |
|||
*/ |
|||
public interface AddUserInternalGroup {} |
|||
|
|||
// <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<<
|
|||
|
|||
/** |
|||
* 活动Id |
|||
*/ |
|||
@NotBlank(message = "活动Id不能为空", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) |
|||
private String actId; |
|||
|
|||
/** |
|||
* 页码,从1开始 |
|||
*/ |
|||
@Min(value = 1, message = "页码必须大于0", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) |
|||
private Integer pageNo; |
|||
|
|||
/** |
|||
* 页容量,默认20页 |
|||
*/ |
|||
@Min(value = 1, message = "每页条数必须大于必须大于0", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) |
|||
private Integer pageSize; |
|||
} |
@ -0,0 +1,38 @@ |
|||
package com.epmet.dto.form.resi; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 活动详情 入参 |
|||
* |
|||
* @Auther: zhangyong |
|||
* @Date: 2020-07-21 18:12 |
|||
*/ |
|||
@Data |
|||
public class ResiActDetailFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
//>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>>
|
|||
/** |
|||
* 添加用户操作的内部异常分组 |
|||
* 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... |
|||
*/ |
|||
public interface AddUserInternalGroup {} |
|||
|
|||
// <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<<
|
|||
|
|||
/** |
|||
* 活动Id |
|||
*/ |
|||
@NotBlank(message = "活动Id不能为空", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) |
|||
private String actId; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
private String userId; |
|||
} |
@ -0,0 +1,93 @@ |
|||
/** |
|||
* 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.epmet.dto.form.resi; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 活动-添加实况 入参 |
|||
* |
|||
* @author zhangyong |
|||
* @since v1.0.0 2020-07-23 |
|||
*/ |
|||
@Data |
|||
public class ResiActInsertLiveFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
//>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>>
|
|||
/** |
|||
* 添加用户操作的内部异常分组 |
|||
* 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... |
|||
*/ |
|||
public interface AddUserInternalGroup {} |
|||
|
|||
/** |
|||
* 添加用户操作的用户可见异常分组 |
|||
* 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup |
|||
* 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 |
|||
*/ |
|||
public interface AddUserShowGroup extends CustomerClientShowGroup {} |
|||
|
|||
// <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<<
|
|||
|
|||
/** |
|||
* 活动ID |
|||
*/ |
|||
@NotBlank(message = "活动ID不能为空", groups = { AddUserInternalGroup.class }) |
|||
private String actId; |
|||
|
|||
/** |
|||
* 活动签到描述 |
|||
*/ |
|||
private String desc; |
|||
|
|||
/** |
|||
* 活动签到位置经度 |
|||
*/ |
|||
@NotBlank(message = "活动签到位置经度不能为空", groups = { AddUserInternalGroup.class }) |
|||
private BigDecimal longitude; |
|||
|
|||
/** |
|||
* 活动签到位置纬度 |
|||
*/ |
|||
@NotBlank(message = "活动签到位置纬度不能为空", groups = { AddUserInternalGroup.class }) |
|||
private BigDecimal latitude; |
|||
|
|||
/** |
|||
* 活动签到地址 |
|||
*/ |
|||
@NotBlank(message = "活动签到地址不能为空", groups = { AddUserInternalGroup.class, AddUserShowGroup.class}) |
|||
private String address; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
private List<String> images; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
private String userId; |
|||
} |
@ -0,0 +1,100 @@ |
|||
/** |
|||
* 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.epmet.dto.form.resi; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.awt.*; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 活动签到 入参 |
|||
* |
|||
* @author zhangyong |
|||
* @since v1.0.0 2020-07-23 |
|||
*/ |
|||
@Data |
|||
public class ResiActSignInFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
//>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>>
|
|||
/** |
|||
* 添加用户操作的内部异常分组 |
|||
* 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... |
|||
*/ |
|||
public interface AddUserInternalGroup {} |
|||
|
|||
/** |
|||
* 添加用户操作的用户可见异常分组 |
|||
* 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup |
|||
* 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 |
|||
*/ |
|||
public interface AddUserShowGroup extends CustomerClientShowGroup {} |
|||
|
|||
// <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<<
|
|||
|
|||
/** |
|||
* 活动ID |
|||
*/ |
|||
@NotBlank(message = "活动ID不能为空", groups = { AddUserInternalGroup.class }) |
|||
private String actId; |
|||
|
|||
/** |
|||
* 活动签到描述 |
|||
*/ |
|||
private String desc; |
|||
|
|||
/** |
|||
* 活动签到位置经度 |
|||
*/ |
|||
@NotBlank(message = "活动签到位置经度不能为空", groups = { AddUserInternalGroup.class }) |
|||
private BigDecimal longitude; |
|||
|
|||
/** |
|||
* 活动签到位置纬度 |
|||
*/ |
|||
@NotBlank(message = "活动签到位置纬度不能为空", groups = { AddUserInternalGroup.class }) |
|||
private BigDecimal latitude; |
|||
|
|||
/** |
|||
* 活动签到地址 |
|||
*/ |
|||
@NotBlank(message = "活动签到地址不能为空", groups = { AddUserInternalGroup.class, AddUserShowGroup.class}) |
|||
private String address; |
|||
|
|||
/** |
|||
* 图片 |
|||
*/ |
|||
private List<String> images; |
|||
|
|||
/** |
|||
* 0不同步实况1同步到实况记录 |
|||
*/ |
|||
@NotBlank(message = "是否同步到实况记录不能为空", groups = { AddUserInternalGroup.class, AddUserShowGroup.class}) |
|||
private Integer syncLive; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
private String userId; |
|||
} |
@ -0,0 +1,106 @@ |
|||
package com.epmet.dto.form.resi; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 志愿者认证 入参 |
|||
* |
|||
* @Auther: zhangyong |
|||
* @Date: 2020-07-23 09:57 |
|||
*/ |
|||
|
|||
@Data |
|||
public class ResiVolunteerAuthenticateFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
//>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>>
|
|||
/** |
|||
* 添加用户操作的内部异常分组 |
|||
* 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... |
|||
*/ |
|||
public interface AddUserInternalGroup {} |
|||
|
|||
/** |
|||
* 添加用户操作的用户可见异常分组 |
|||
* 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup |
|||
* 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 |
|||
*/ |
|||
public interface AddUserShowGroup extends CustomerClientShowGroup {} |
|||
|
|||
// <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<<
|
|||
|
|||
/** |
|||
* 姓 |
|||
*/ |
|||
@NotBlank(message = "姓不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) |
|||
private String surname; |
|||
|
|||
/** |
|||
* 名 |
|||
*/ |
|||
@NotBlank(message = "名不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) |
|||
private String name; |
|||
|
|||
/** |
|||
* 性别(1男2女0未知) |
|||
*/ |
|||
@NotBlank(message = "性别不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) |
|||
private String gender; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
@NotBlank(message = "手机号不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 身份证号码 |
|||
*/ |
|||
@NotBlank(message = "身份证号码不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) |
|||
private String idNum; |
|||
|
|||
/** |
|||
* 街道 |
|||
*/ |
|||
@NotBlank(message = "街道不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) |
|||
private String street; |
|||
|
|||
/** |
|||
* 小区名 |
|||
*/ |
|||
@NotBlank(message = "小区名不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) |
|||
private String district; |
|||
|
|||
/** |
|||
* 楼栋单元 |
|||
*/ |
|||
@NotBlank(message = "楼栋单元不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) |
|||
private String buildingAddress; |
|||
|
|||
/** |
|||
* 志愿者自我介绍 |
|||
*/ |
|||
private String volunteerIntroduce; |
|||
|
|||
/** |
|||
* 昵称 |
|||
*/ |
|||
@NotBlank(message = "昵称不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) |
|||
private String nickname; |
|||
|
|||
/** |
|||
* 头像 |
|||
*/ |
|||
@NotBlank(message = "头像不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class }) |
|||
private String headImgUrl; |
|||
|
|||
/** |
|||
* 志愿者签名 |
|||
*/ |
|||
private String volunteerSignature; |
|||
} |
@ -0,0 +1,56 @@ |
|||
/** |
|||
* 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.epmet.dto.result.resi; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 活动内容 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-19 |
|||
*/ |
|||
@Data |
|||
public class ResiActContentResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String actContentId; |
|||
|
|||
/** |
|||
* 内容 |
|||
*/ |
|||
private String content; |
|||
|
|||
/** |
|||
* 内容类型 图片:img;文字:text |
|||
*/ |
|||
private String contentType; |
|||
|
|||
/** |
|||
* 内容顺序 从1开始 |
|||
*/ |
|||
private Integer orderNum; |
|||
} |
@ -0,0 +1,140 @@ |
|||
/** |
|||
* 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.epmet.dto.result.resi; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 活动详情 |
|||
* |
|||
* @author zhangyong |
|||
* @since v1.0.0 2020-07-20 |
|||
*/ |
|||
@Data |
|||
public class ResiActDetailResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String actId; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
private String contacts; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String tel; |
|||
|
|||
/** |
|||
* 报名截止时间(yyyy-MM-dd HH:mm) |
|||
*/ |
|||
private String signUpEndTime; |
|||
|
|||
/** |
|||
* 活动开始时间(yyyy-MM-dd HH:mm) |
|||
*/ |
|||
private String actStartTime; |
|||
|
|||
/** |
|||
* 活动结束时间(yyyy-MM-dd HH:mm) |
|||
*/ |
|||
private String actEndTime; |
|||
|
|||
/** |
|||
* 活动地点 |
|||
*/ |
|||
private String actAddress; |
|||
|
|||
/** |
|||
* 活动名额类型(true:固定名额 false: 不限制名额) |
|||
*/ |
|||
private Boolean actQuotaCategory; |
|||
|
|||
/** |
|||
* 活动名额 |
|||
*/ |
|||
private Integer actQuota; |
|||
|
|||
/** |
|||
* 已报名人数 |
|||
*/ |
|||
private Integer signupNum; |
|||
|
|||
/** |
|||
* 积分奖励 |
|||
*/ |
|||
private Integer reward; |
|||
|
|||
/** |
|||
* 招募要求 |
|||
*/ |
|||
private String requirement; |
|||
|
|||
/** |
|||
* 活动详情 |
|||
*/ |
|||
private List<ResiActContentResultDTO> actContent; |
|||
|
|||
/** |
|||
* 用户当前状态(sign_up-我要报名,canceld-取消报名,enough-已报满,end_sign_up-截止报名,in_progress-已开始; finished-已结束,canceled-已取消) |
|||
*/ |
|||
private String currentUserStatus; |
|||
|
|||
/** |
|||
* 用户是否是志愿者身份 (true:是,false 不是) |
|||
*/ |
|||
private Boolean userVolunteerFlag; |
|||
|
|||
/** |
|||
* 是否需要是志愿者(true:只有志愿者才可以参加活动,false: 只要是居民就可以参加活动) |
|||
*/ |
|||
private Boolean volunteerLimit; |
|||
|
|||
/** |
|||
* 活动实际开始时间(yyyy-MM-dd HH:mm) |
|||
*/ |
|||
private String actualStartTime; |
|||
|
|||
/** |
|||
* 活动实际结束时间(yyyy-MM-dd HH:mm) |
|||
*/ |
|||
private String actualEndTime; |
|||
|
|||
/** |
|||
* 主办方 |
|||
*/ |
|||
private String sponsor; |
|||
|
|||
/** |
|||
* 是否已签到(true已签到,false未签到) |
|||
*/ |
|||
private Boolean isSignUp; |
|||
} |
@ -0,0 +1,99 @@ |
|||
/** |
|||
* 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.epmet.dto.result.resi; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 活动详情-未通过 |
|||
* |
|||
* @author zhangyong |
|||
* @since v1.0.0 2020-07-20 |
|||
*/ |
|||
@Data |
|||
public class ResiActRefusedDetailResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String actId; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 报名截止时间(yyyy-MM-dd HH:mm) |
|||
*/ |
|||
private String signUpEndTime; |
|||
|
|||
/** |
|||
* 活动开始时间(yyyy-MM-dd HH:mm) |
|||
*/ |
|||
private String actStartTime; |
|||
|
|||
/** |
|||
* 活动结束时间(yyyy-MM-dd HH:mm) |
|||
*/ |
|||
private String actEndTime; |
|||
|
|||
/** |
|||
* 活动地点 |
|||
*/ |
|||
private String actAddress; |
|||
|
|||
/** |
|||
* 活动名额类型(true:固定名额 false: 不限制名额) |
|||
*/ |
|||
private Boolean actQuotaCategory; |
|||
|
|||
/** |
|||
* 活动名额 |
|||
*/ |
|||
private Integer actQuota; |
|||
|
|||
/** |
|||
* 联系人 |
|||
*/ |
|||
private String contacts; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String tel; |
|||
|
|||
/** |
|||
* 积分奖励 |
|||
*/ |
|||
private Integer reward; |
|||
|
|||
/** |
|||
* 主办方 |
|||
*/ |
|||
private String sponsor; |
|||
|
|||
/** |
|||
* 未通过原因 |
|||
*/ |
|||
private String failureReason; |
|||
} |
@ -0,0 +1,55 @@ |
|||
/** |
|||
* 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.epmet.dto.result.resi; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 活动回顾列表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-19 |
|||
*/ |
|||
@Data |
|||
public class ResiActSummaryResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String summaryId; |
|||
|
|||
/** |
|||
* 内容 |
|||
*/ |
|||
private String content; |
|||
|
|||
/** |
|||
* 内容类型 图片:img;文字:text |
|||
*/ |
|||
private String contentType; |
|||
|
|||
/** |
|||
* 内容顺序 从1开始 |
|||
*/ |
|||
private Integer orderNum; |
|||
} |
@ -0,0 +1,60 @@ |
|||
/** |
|||
* 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.epmet.dto.result.resi; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 爱心榜 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-19 |
|||
*/ |
|||
@Data |
|||
public class ResiLeaderboardResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 微信昵称 |
|||
*/ |
|||
private String nickname; |
|||
|
|||
/** |
|||
* 微信头像 |
|||
*/ |
|||
private String headImg; |
|||
|
|||
/** |
|||
* 是否是志愿者(true:是志愿者,false: 不是志愿者) |
|||
*/ |
|||
private Boolean volunteerFlag; |
|||
|
|||
/** |
|||
* 爱心时长(单位:小时) |
|||
*/ |
|||
private Integer kindnessTime; |
|||
|
|||
/** |
|||
* 参加次数 |
|||
*/ |
|||
private Integer participationNum; |
|||
} |
@ -0,0 +1,46 @@ |
|||
package com.epmet.feign; |
|||
|
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.result.UserBaseInfoResultDTO; |
|||
import com.epmet.dto.result.UserRoleResultDTO; |
|||
import com.epmet.feign.fallback.EpmetUserFeignClientFallBack; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 用户模块 |
|||
* |
|||
* @author zhangyong |
|||
* @date 2020/7/22 14:51 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class) |
|||
public interface EpmetUserFeignClient { |
|||
|
|||
/** |
|||
* @param userIds |
|||
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.UserBaseInfoResultDTO>> |
|||
* @author zhangyong |
|||
* @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) |
|||
* @Date 2020/7/22 9:30 |
|||
**/ |
|||
@PostMapping("epmetuser/userbaseinfo/queryuserbaseinfo") |
|||
Result<List<UserBaseInfoResultDTO>> heartQueryUserBaseInfo(@RequestBody List<String> userIds); |
|||
|
|||
/** |
|||
* 根据用户ID,查询用户所属角色: 多种身份 |
|||
* |
|||
* @param userId |
|||
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.UserRoleResultDTO>> |
|||
* @Author zhangyong |
|||
* @Date 14:13 2020-07-23 |
|||
**/ |
|||
@PostMapping(value = "epmetuser/userrole/getuserroleinfobyuserid/{userId}", consumes = MediaType.APPLICATION_JSON_VALUE) |
|||
Result<List<UserRoleResultDTO>> getUserRoleInfoByUserId(@PathVariable("userId") String userId); |
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.epmet.feign.fallback; |
|||
|
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.utils.ModuleUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.UserWechatDTO; |
|||
import com.epmet.dto.result.UserBaseInfoResultDTO; |
|||
import com.epmet.dto.result.UserRoleResultDTO; |
|||
import com.epmet.feign.EpmetUserFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* @author zhangyong |
|||
* @date 2020/7/22 14:51 |
|||
*/ |
|||
@Component |
|||
public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { |
|||
|
|||
@Override |
|||
public Result<List<UserBaseInfoResultDTO>> heartQueryUserBaseInfo(List<String> userIds) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "heartQueryUserBaseInfo", userIds); |
|||
} |
|||
|
|||
@Override |
|||
public Result<List<UserRoleResultDTO>> getUserRoleInfoByUserId(String userId) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoleInfoByUserId", userId); |
|||
} |
|||
} |
@ -0,0 +1,52 @@ |
|||
/** |
|||
* 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.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO; |
|||
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; |
|||
import com.epmet.service.VolunteerInfoService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
|
|||
/** |
|||
* 居民端-志愿者相关api |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-19 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/resi/volunteer") |
|||
public class ResiVolunteerController { |
|||
|
|||
@Autowired |
|||
private VolunteerInfoService volunteerInfoService; |
|||
|
|||
@PostMapping("authenticate") |
|||
public Result authenticate(@LoginUser TokenDto tokenDto, @RequestBody ResiVolunteerAuthenticateFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
return volunteerInfoService.authenticate(tokenDto, formDTO); |
|||
} |
|||
} |
@ -0,0 +1,43 @@ |
|||
package com.epmet.utils; |
|||
|
|||
/** |
|||
* @Description 用户活动关系表当前状态 |
|||
* @Auther: zhangyong |
|||
* @Date: 2020-07-21 17:36 |
|||
*/ |
|||
public interface ActUserRelationStatusConstant { |
|||
/** |
|||
* 已报名/待审核 |
|||
*/ |
|||
String AUDITING="auditing"; |
|||
|
|||
/** |
|||
* 审核通过 |
|||
*/ |
|||
String PASSED="passed"; |
|||
|
|||
/** |
|||
* 审核不通过 |
|||
*/ |
|||
String REFUSED = "refused"; |
|||
|
|||
/** |
|||
* 取消报名 |
|||
*/ |
|||
String CANCELD = "canceld"; |
|||
|
|||
/** |
|||
* 给积分 |
|||
*/ |
|||
String AGREE = "agree"; |
|||
|
|||
/** |
|||
* 不给积分 |
|||
*/ |
|||
String DENY = "deny"; |
|||
|
|||
/** |
|||
* 已签到 |
|||
*/ |
|||
String SIGNED_IN = "signed_in"; |
|||
} |
@ -0,0 +1,49 @@ |
|||
package com.epmet.utils; |
|||
|
|||
/** |
|||
* 用户当前状态(sign_up-我要报名,canceld-取消报名,enough-已报满,end_sign_up-截止报名,in_progress-已开始; finished-已结束,canceled-已取消,points_confirm-已确认积分) |
|||
* @Auther: zhangyong |
|||
* @Date: 2020-07-21 17:36 |
|||
*/ |
|||
public interface ActUserStatusConstant { |
|||
|
|||
/** |
|||
* 我要报名 |
|||
*/ |
|||
String SIGN_UP = "sign_up"; |
|||
|
|||
/** |
|||
* 取消报名 |
|||
*/ |
|||
String CANCELD = "canceld"; |
|||
|
|||
/** |
|||
* 已报满 |
|||
*/ |
|||
String ENOUGH = "enough"; |
|||
|
|||
/** |
|||
* 截止报名 |
|||
*/ |
|||
String END_SIGN_UP = "end_sign_up"; |
|||
|
|||
/** |
|||
* 已开始 |
|||
*/ |
|||
String IN_PROGRESS = "in_progress"; |
|||
|
|||
/** |
|||
* 已结束 |
|||
*/ |
|||
String FINISHED = "finished"; |
|||
|
|||
/** |
|||
* 已取消 |
|||
*/ |
|||
String CANCELED = "canceled"; |
|||
|
|||
/** |
|||
* 已确认积分 |
|||
*/ |
|||
String POINTS_CONFIRM = "points_confirm"; |
|||
} |
@ -0,0 +1,90 @@ |
|||
package com.epmet.utils; |
|||
|
|||
import com.alibaba.nacos.client.utils.StringUtils; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.scan.param.ImgScanParamDTO; |
|||
import com.epmet.commons.tools.scan.param.ImgTaskDTO; |
|||
import com.epmet.commons.tools.scan.param.TextScanParamDTO; |
|||
import com.epmet.commons.tools.scan.param.TextTaskDTO; |
|||
import com.epmet.commons.tools.scan.result.SyncScanResult; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.utils.ScanContentUtils; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
|
|||
import java.util.List; |
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* 文字、图片合法性校验 |
|||
* |
|||
* @author zhangyong |
|||
* @date 2020-07-15 14:26 |
|||
*/ |
|||
@Slf4j |
|||
public class ValidityVerification { |
|||
|
|||
@Value("${openapi.scan.server.url}") |
|||
private String scanApiUrl; |
|||
@Value("${openapi.scan.method.textSyncScan}") |
|||
private String textSyncScanMethod; |
|||
@Value("${openapi.scan.method.imgSyncScan}") |
|||
private String imgSyncScanMethod; |
|||
|
|||
/** |
|||
* 文本校验 |
|||
* @param context 被校验的文本,,不能超过10000 |
|||
* @param businessEnum 业务枚举,定义校验失败后,输出的日志信息 |
|||
* @return void |
|||
* @auther zhangyong |
|||
* @Date 14:42 2020-07-15 |
|||
**/ |
|||
public void textScanVerification(String context, String businessEnum){ |
|||
if (StringUtils.isNotBlank(context)) { |
|||
TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); |
|||
TextTaskDTO taskDTO = new TextTaskDTO(); |
|||
taskDTO.setContent(context); |
|||
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|||
textScanParamDTO.getTasks().add(taskDTO); |
|||
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); |
|||
if (!textSyncScanResult.success()) { |
|||
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|||
} else { |
|||
if (!textSyncScanResult.getData().isAllPass()) { |
|||
// 业务枚举:例如:评论话题失败,评论内容为:%s"
|
|||
log.error(String.format(businessEnum, context)); |
|||
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 图片列表校验 |
|||
* @param imgList 被校验的图片列表 |
|||
* @return void |
|||
* @auther zhangyong |
|||
* @Date 14:42 2020-07-15 |
|||
**/ |
|||
public void imgScanVerification(List<String> imgList){ |
|||
if (NumConstant.ZERO != imgList.size()){ |
|||
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); |
|||
imgList.forEach(url -> { |
|||
ImgTaskDTO task = new ImgTaskDTO(); |
|||
task.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|||
task.setUrl(url); |
|||
imgScanParamDTO.getTasks().add(task); |
|||
}); |
|||
Result<SyncScanResult> imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); |
|||
if (!imgScanResult.success()){ |
|||
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|||
} else { |
|||
if (!imgScanResult.getData().isAllPass()) { |
|||
throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode()); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
@ -1,126 +0,0 @@ |
|||
/** |
|||
* 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.epmet.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 积分规则表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-20 |
|||
*/ |
|||
@Data |
|||
public class PointRuleDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 规则名称 与事件名称保持一致即可 |
|||
*/ |
|||
private String ruleName; |
|||
|
|||
/** |
|||
* 规则说明 事件说明 |
|||
*/ |
|||
private String ruleDesc; |
|||
|
|||
/** |
|||
* 事件CODE 来自事件表 |
|||
*/ |
|||
private String eventCode; |
|||
|
|||
/** |
|||
* 事件名称 来自事件表 |
|||
*/ |
|||
private String eventName; |
|||
|
|||
/** |
|||
* 操作类型 加积分:add;减积分:subtract |
|||
*/ |
|||
private String operateType; |
|||
|
|||
/** |
|||
* 积分上限 |
|||
*/ |
|||
private Integer upLimit; |
|||
|
|||
/** |
|||
* 积分上限描述 |
|||
*/ |
|||
private String upLimitDesc; |
|||
|
|||
/** |
|||
* 获得积分值 |
|||
*/ |
|||
private Integer pointNum; |
|||
|
|||
/** |
|||
* 获得积分单位 次:time;分钟:minute;小时:hour |
|||
*/ |
|||
private String pointUnit; |
|||
|
|||
/** |
|||
* 是否启用 0-否,1-是 |
|||
*/ |
|||
private String enabledFlag; |
|||
|
|||
/** |
|||
* 删除标识 0-否,1-是 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* desc:积分规则Id详情获取 规则列表 |
|||
* @author jianjun liu |
|||
* @date 2020-07-22 15:28 |
|||
**/ |
|||
@Data |
|||
public class PointDetailFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 7587939716742608164L; |
|||
/** |
|||
* 积分规则Id |
|||
*/ |
|||
@NotBlank(message = "积分规则Id不能为空") |
|||
private String ruleId; |
|||
} |
@ -0,0 +1,71 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* desc:积分规则保存/修改 规则列表 |
|||
* |
|||
* @author jianjun liu |
|||
* @date 2020-07-22 15:28 |
|||
**/ |
|||
@Data |
|||
public class PointRuleFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -3228252683629912008L; |
|||
/** |
|||
* 积分规则Id |
|||
*/ |
|||
@NotBlank(message = "积分规则Id不能为空", groups = UpdateGroup.class) |
|||
private String ruleId; |
|||
/** |
|||
* 积分 |
|||
*/ |
|||
@NotBlank(message = "积分不能为空", groups = {AddGroup.class, UpdateGroup.class}) |
|||
private String point; |
|||
|
|||
/** |
|||
* 是否开启 |
|||
*/ |
|||
@NotBlank(message = "是否开启不能为空", groups = {AddGroup.class, UpdateGroup.class}) |
|||
private String enabledFlag; |
|||
/** |
|||
* 上限开启 |
|||
*/ |
|||
@NotBlank(message = "积分上限不能为空", groups = {AddGroup.class, UpdateGroup.class}) |
|||
private String upLimit; |
|||
|
|||
/** |
|||
* 积分规则Id |
|||
*/ |
|||
@NotBlank(message = "客户Id不能为空", groups = {AddGroup.class, UpdateGroup.class}) |
|||
private String customerId; |
|||
|
|||
//=======系统添加时的属性======
|
|||
/** |
|||
* 规则说明 事件说明 |
|||
*/ |
|||
@NotBlank(message = "规则描述不能为空", groups = AddGroup.class) |
|||
private String ruleDesc; |
|||
|
|||
/** |
|||
* 事件CODE 来自事件表 |
|||
*/ |
|||
@NotBlank(message = "事件code不能为空", groups = AddGroup.class) |
|||
private String eventCode; |
|||
|
|||
/** |
|||
* 操作类型 加积分:add;减积分:subtract |
|||
*/ |
|||
@NotBlank(message = "操作类型不能为空", groups = AddGroup.class) |
|||
private String operateType; |
|||
/** |
|||
* 获得积分单位 次:time;分钟:minute;小时:hour |
|||
*/ |
|||
@NotBlank(message = "积分单位不能为空", groups = AddGroup.class) |
|||
private String pointUnit; |
|||
|
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* desc:根据功能Id获取 规则列表 |
|||
* @author jianjun liu |
|||
* @date 2020-07-22 15:28 |
|||
**/ |
|||
@Data |
|||
public class PointRuleListFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -1918653281170340608L; |
|||
/** |
|||
* 功能Id |
|||
*/ |
|||
@NotBlank(message = "功能Id不能为空") |
|||
private String functionId; |
|||
@NotBlank(message = "客户Id不能为空") |
|||
private String customerId; |
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* desc:积分规则-获取客户功能列表 result |
|||
* @author jianjun liu |
|||
* @date 2020-07-22 14:43 |
|||
**/ |
|||
@Data |
|||
public class CustomerFunctionResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -3761765064811136295L; |
|||
|
|||
private String functionId; |
|||
private String functionName; |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* desc:积分规则-详情 result |
|||
* @author jianjun liu |
|||
* @date 2020-07-22 14:43 |
|||
**/ |
|||
@Data |
|||
public class PointDetailResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 2426172750860788081L; |
|||
private String ruleId; |
|||
private String ruleName; |
|||
private String ruleDesc; |
|||
private Integer point; |
|||
private String pointUnit; |
|||
private String upLimit; |
|||
private String enabledFlag; |
|||
private String upLimitDesc; |
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* desc:积分规则-列表 result |
|||
* @author jianjun liu |
|||
* @date 2020-07-22 14:43 |
|||
**/ |
|||
@Data |
|||
public class PointRuleResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -2327977101138032573L; |
|||
private String ruleId; |
|||
private String ruleName; |
|||
private String ruleDesc; |
|||
/** |
|||
* 拼接好的 积分值/单位 |
|||
*/ |
|||
private String pointValue; |
|||
} |
@ -0,0 +1,42 @@ |
|||
package com.epmet.common.enu; |
|||
|
|||
/** |
|||
* 系积分系统-积分单位枚举类 |
|||
* dev|test|prod |
|||
* |
|||
* @author jianjun liu |
|||
* @date 2020-07-03 11:14 |
|||
**/ |
|||
public enum PointUnitEnum { |
|||
TIME("time", "次"), |
|||
MINUTE("minute", "分种"), |
|||
HOUR("hour", "小时"), |
|||
; |
|||
|
|||
private String code; |
|||
private String name; |
|||
|
|||
|
|||
PointUnitEnum(String code, String name) { |
|||
this.code = code; |
|||
this.name = name; |
|||
} |
|||
|
|||
public static PointUnitEnum getEnum(String code) { |
|||
PointUnitEnum[] values = PointUnitEnum.values(); |
|||
for (PointUnitEnum value : values) { |
|||
if (code != null && value.getCode().equals(code)) { |
|||
return value; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public String getCode() { |
|||
return code; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
} |
@ -0,0 +1,43 @@ |
|||
package com.epmet.common.enu; |
|||
|
|||
/** |
|||
* @author jianjun liu |
|||
* @date 2020-06-04 21:39 |
|||
**/ |
|||
public enum SysResponseEnum { |
|||
/** |
|||
* |
|||
* 业务代码枚举类 |
|||
* |
|||
* 编码样式:【CCCBBOOXX】 |
|||
* 编码示例说明: |
|||
* CCC 中心编码&业务系统 (112(与端口号一致)-积分系统服务) |
|||
* BB 业务类型(00-默认 ) |
|||
* OO 操作类型(00-默认) |
|||
* XX 具体编码(00-成功,01-失败,02-参数错误,10-异常 99-系统错误) |
|||
* |
|||
*/ |
|||
/*通用枚举 */ |
|||
EXCEPTION(10001,"系统异常"), |
|||
|
|||
|
|||
/*积分规则 业务 01*/ |
|||
THIRD_SERVICE_ERROR(112010001,"调用第三方接口异常"), |
|||
POINT_RULE_IS_NOT_EXIST(112010002,"积分规则不存在"), |
|||
; |
|||
|
|||
private Integer code; |
|||
private String msg; |
|||
SysResponseEnum(Integer code, String msg){ |
|||
this.code = code; |
|||
this.msg = msg; |
|||
} |
|||
|
|||
public Integer getCode() { |
|||
return code; |
|||
} |
|||
|
|||
public String getMsg() { |
|||
return msg; |
|||
} |
|||
} |
@ -0,0 +1,40 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.dto.form.PointRuleFormDTO; |
|||
import com.epmet.service.PointRuleService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* @author jianjun liu |
|||
* @date 2020-06-04 20:39 |
|||
**/ |
|||
@RestController |
|||
@RequestMapping("opback") |
|||
public class BackDoorController { |
|||
@Autowired |
|||
private PointRuleService pointRuleService; |
|||
|
|||
/** |
|||
* desc:添加规则 |
|||
* |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "sysadd") |
|||
public Result<Boolean> add(@RequestBody PointRuleFormDTO formDTO) { |
|||
TokenDto tokenDTO = new TokenDto(); |
|||
tokenDTO.setUserId("default"); |
|||
formDTO.setCustomerId(tokenDTO.getCustomerId()); |
|||
ValidatorUtils.validateEntity(formDTO, AddGroup.class); |
|||
pointRuleService.add(tokenDTO, formDTO); |
|||
return new Result<Boolean>().ok(true); |
|||
} |
|||
} |
@ -0,0 +1,100 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.dto.form.PointDetailFormDTO; |
|||
import com.epmet.dto.form.PointRuleFormDTO; |
|||
import com.epmet.dto.form.PointRuleListFormDTO; |
|||
import com.epmet.dto.result.CustomerFunctionResultDTO; |
|||
import com.epmet.dto.result.PointDetailResultDTO; |
|||
import com.epmet.dto.result.PointRuleResultDTO; |
|||
import com.epmet.service.PointRuleService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 积分规则controller |
|||
* |
|||
* @author jianjun liu |
|||
* @date 2020-07-22 14:39 |
|||
**/ |
|||
@RestController |
|||
@RequestMapping("rule") |
|||
public class PointRuleController { |
|||
@Autowired |
|||
private PointRuleService pointRuleService; |
|||
|
|||
/** |
|||
* desc:积分规则-获取客户有积分规则的功能列表 |
|||
* |
|||
* @param tokenDTO |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "functionlist") |
|||
public Result<List<CustomerFunctionResultDTO>> getFunctionList(@LoginUser TokenDto tokenDTO) { |
|||
return new Result<List<CustomerFunctionResultDTO>>().ok(pointRuleService.getFunctionList(tokenDTO.getCustomerId())); |
|||
} |
|||
|
|||
/** |
|||
* desc:根据功能id获取积分规则 |
|||
* |
|||
* @param tokenDTO |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "list") |
|||
public Result<List<PointRuleResultDTO>> list(@LoginUser TokenDto tokenDTO, @RequestBody PointRuleListFormDTO formDTO) { |
|||
formDTO.setCustomerId(tokenDTO.getCustomerId()); |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
return new Result<List<PointRuleResultDTO>>().ok(pointRuleService.list(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* desc:根据规则id获取积分规则 |
|||
* |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "detail") |
|||
public Result<PointDetailResultDTO> detail(@RequestBody PointDetailFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
return new Result<PointDetailResultDTO>().ok(pointRuleService.detail(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* desc:根据功能id获取积分规则 |
|||
* |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "update") |
|||
public Result<Boolean> update(@LoginUser TokenDto tokenDTO, @RequestBody PointRuleFormDTO formDTO) { |
|||
formDTO.setCustomerId(tokenDTO.getCustomerId()); |
|||
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); |
|||
pointRuleService.update(tokenDTO,formDTO); |
|||
return new Result<Boolean>().ok(true); |
|||
} |
|||
|
|||
/** |
|||
* desc:添加规则 |
|||
* |
|||
* @param formDTO |
|||
* @return |
|||
*/ |
|||
@PostMapping(value = "add") |
|||
public Result<Boolean> add(@LoginUser TokenDto tokenDTO, @RequestBody PointRuleFormDTO formDTO) { |
|||
formDTO.setCustomerId(tokenDTO.getCustomerId()); |
|||
ValidatorUtils.validateEntity(formDTO, AddGroup.class); |
|||
pointRuleService.add(tokenDTO,formDTO); |
|||
return new Result<Boolean>().ok(true); |
|||
} |
|||
} |
@ -1,9 +1,9 @@ |
|||
<?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.epmet.dao.SysOperateLogDao"> |
|||
<mapper namespace="com.epmet.dao.RuleOperateLogDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.SysOperateLogEntity" id="sysOperateLogMap"> |
|||
<resultMap type="com.epmet.entity.RuleOperateLogEntity" id="sysOperateLogMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="objectId" column="OBJECT_ID"/> |
Loading…
Reference in new issue